Advertisement
Guest User

Untitled

a guest
Nov 28th, 2023
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.95 KB | Gaming | 0 0
  1. #pragma once
  2.  
  3. #include "PythonWindow.h"
  4.  
  5. namespace UI
  6. {
  7.     enum
  8.     {
  9.         ITEM_WIDTH = 32,
  10.         ITEM_HEIGHT = 32,
  11.  
  12.         SLOT_NUMBER_NONE = 0xffffffff,
  13.     };
  14.  
  15.     enum ESlotStyle
  16.     {
  17.         SLOT_STYLE_NONE,
  18.         SLOT_STYLE_PICK_UP,
  19.         SLOT_STYLE_SELECT,
  20.     };
  21.  
  22.     enum ESlotState
  23.     {
  24.         SLOT_STATE_LOCK     = (1 << 0),
  25.         SLOT_STATE_CANT_USE = (1 << 1),
  26.         SLOT_STATE_DISABLE  = (1 << 2),
  27.         SLOT_STATE_ALWAYS_RENDER_COVER = (1 << 3),          // Ηφΐη Cover ΉφΖ°ΐΊ ½½·ΤΏ΅ Ή«Ύπ°΅ µιΎξΏΝ ΐΦΐ» ¶§Ώ΅ΈΈ ·»΄υΈµ Ηϴµ¥, ΐΜ flag°΅ ΐΦΐΈΈι Ίσ ½½·ΤΐΜΎξµµ ΔΏΉφ ·»΄υΈµ
  28.     };
  29.  
  30.     class CSlotWindow : public CWindow
  31.     {
  32.         public:
  33.             static DWORD Type();
  34.  
  35.         public:
  36.             class CSlotButton;
  37.             class CCoverButton;
  38.             class CCoolTimeFinishEffect;
  39.  
  40.             friend class CSlotButton;
  41.             friend class CCoverButton;
  42.  
  43.             typedef struct SSlot
  44.             {
  45.                 DWORD   dwState;
  46.                 DWORD   dwSlotNumber;
  47.                 DWORD   dwCenterSlotNumber;     // NOTE : »ηΐΜΑξ°΅ Ε« ΎΖΐΜΕΫΐΗ °ζΏμ ΎΖΐΜΕΫΐΗ ½ΗΑ¦ ΐ§Δ΅ ΉψΘ£
  48.                 DWORD   dwItemIndex;            // NOTE : Ώ©±βΌ­ »ηΏλµΗ΄Β ItemΐΜ¶σ΄Β ΄άΎξ΄Β ΑΌΐΊ °³³δΐΗ °ΝΐΜ ΎΖ΄Ρ,
  49.                 BOOL    isItem;                 //        "½½·ΤΐΗ ³»ΏλΉ°"ΐΜ¶σ΄Β Ζχ°ύΐϋΐΞ °³³δΎξ. ΄υ ΑΑΐΊ °ΝΐΜ ΐΦΐ»±ξ? - [levites]
  50.                 DWORD   dwItemID;
  51.  
  52.                 // CoolTime
  53.                 float   fCoolTime;
  54.                 float   fStartCoolTime;
  55.  
  56.                 // Toggle
  57.                 BOOL    bActive;
  58.  
  59.                 int     ixPosition;
  60.                 int     iyPosition;
  61.  
  62.                 int     ixCellSize;
  63.                 int     iyCellSize;
  64.  
  65.                 BYTE    byxPlacedItemSize;
  66.                 BYTE    byyPlacedItemSize;
  67.  
  68.                 CGraphicImageInstance * pInstance;
  69.                 CNumberLine * pNumberLine;
  70.  
  71.                 bool    bRenderBaseSlotImage;
  72.                 CCoverButton * pCoverButton;
  73.                 CSlotButton * pSlotButton;
  74.                 CImageBox * pSignImage;
  75.                 CAniImageBox * pFinishCoolTimeEffect;
  76. #ifdef ENABLE_SASH_SYSTEM
  77.                 CAniImageBox*   pActiveSlotEffect[3];
  78. #endif
  79.             } TSlot;
  80.             typedef std::list<TSlot> TSlotList;
  81.             typedef TSlotList::iterator TSlotListIterator;
  82.  
  83.             typedef struct SStoreCoolDown { float fCoolTime; float fElapsedTime; bool bActive; };
  84.  
  85.         public:
  86.             CSlotWindow(PyObject * ppyObject);
  87.             virtual ~CSlotWindow();
  88.  
  89.             void Destroy();
  90.  
  91.             // Manage Slot
  92.             void SetSlotType(DWORD dwType);
  93.             void SetSlotStyle(DWORD dwStyle);
  94.  
  95.             void AppendSlot(DWORD dwIndex, int ixPosition, int iyPosition, int ixCellSize, int iyCellSize);
  96.             void SetCoverButton(DWORD dwIndex, const char * c_szUpImageName, const char * c_szOverImageName, const char * c_szDownImageName, const char * c_szDisableImageName, BOOL bLeftButtonEnable, BOOL bRightButtonEnable);
  97.             void SetSlotBaseImage(const char * c_szFileName, float fr, float fg, float fb, float fa);
  98.             void AppendSlotButton(const char * c_szUpImageName, const char * c_szOverImageName, const char * c_szDownImageName);
  99.             void AppendRequirementSignImage(const char * c_szImageName);
  100.  
  101.             void EnableCoverButton(DWORD dwIndex);
  102.             void DisableCoverButton(DWORD dwIndex);
  103.             void SetAlwaysRenderCoverButton(DWORD dwIndex, bool bAlwaysRender = false);
  104.  
  105.             void ShowSlotBaseImage(DWORD dwIndex);
  106.             void HideSlotBaseImage(DWORD dwIndex);
  107.             BOOL IsDisableCoverButton(DWORD dwIndex);
  108.             BOOL HasSlot(DWORD dwIndex);
  109.  
  110.             void ClearAllSlot();
  111.             void ClearSlot(DWORD dwIndex);
  112.             void SetSlot(DWORD dwIndex, DWORD dwVirtualNumber, BYTE byWidth, BYTE byHeight, CGraphicImage * pImage, D3DXCOLOR& diffuseColor);
  113.             void SetSlotCount(DWORD dwIndex, DWORD dwCount);
  114.             void SetSlotCountNew(DWORD dwIndex, DWORD dwGrade, DWORD dwCount);
  115.             void SetSlotCoolTime(DWORD dwIndex, float fCoolTime, float fElapsedTime = 0.0f);
  116.  
  117.             void StoreSlotCoolTime(DWORD dwKey, DWORD dwSlotIndex, float fCoolTime, float fElapsedTime = .0f);
  118.             void RestoreSlotCoolTime(DWORD dwKey);
  119.  
  120.             void ActivateSlot(DWORD dwIndex);
  121.             void DeactivateSlot(DWORD dwIndex);
  122.             void RefreshSlot();
  123.  
  124.             DWORD GetSlotCount();
  125.  
  126.             void LockSlot(DWORD dwIndex);
  127.             void UnlockSlot(DWORD dwIndex);
  128.             BOOL IsLockSlot(DWORD dwIndex);
  129.             void SetCantUseSlot(DWORD dwIndex);
  130.             void SetUseSlot(DWORD dwIndex);
  131.             BOOL IsCantUseSlot(DWORD dwIndex);
  132.             void EnableSlot(DWORD dwIndex);
  133.             void DisableSlot(DWORD dwIndex);
  134.             BOOL IsEnableSlot(DWORD dwIndex);
  135.  
  136.             // Select
  137.             void ClearSelected();
  138.             void SelectSlot(DWORD dwSelectingIndex);
  139.             BOOL isSelectedSlot(DWORD dwIndex);
  140.             DWORD GetSelectedSlotCount();
  141.             DWORD GetSelectedSlotNumber(DWORD dwIndex);
  142.  
  143.             // Slot Button
  144.             void ShowSlotButton(DWORD dwSlotNumber);
  145.             void HideAllSlotButton();
  146.             void OnPressedSlotButton(DWORD dwType, DWORD dwSlotNumber, BOOL isLeft = TRUE);
  147.  
  148.             // Requirement Sign
  149.             void ShowRequirementSign(DWORD dwSlotNumber);
  150.             void HideRequirementSign(DWORD dwSlotNumber);
  151.  
  152.             // ToolTip
  153.             BOOL OnOverInItem(DWORD dwSlotNumber);
  154.             void OnOverOutItem();
  155.  
  156.             // For Usable Item
  157.             void SetUseMode(BOOL bFlag);
  158.             void SetUsableItem(BOOL bFlag);
  159.  
  160.             // CallBack
  161.             void ReserveDestroyCoolTimeFinishEffect(DWORD dwSlotIndex);
  162.             #ifdef ENABLE_SASH_SYSTEM
  163.             void    ActivateEffect(DWORD dwSlotIndex, float r, float g, float b, float a);
  164.             void    DeactivateEffect(DWORD dwSlotIndex);
  165.             #endif
  166.            
  167.             void SetSlotID(DWORD dwIndex, DWORD dwID);
  168.  
  169.         protected:
  170.             void __Initialize();
  171.             void __CreateToggleSlotImage();
  172.             void __CreateSlotEnableEffect();
  173.             void __CreateFinishCoolTimeEffect(TSlot * pSlot);
  174.             void __CreateBaseImage(const char * c_szFileName, float fr, float fg, float fb, float fa);
  175.  
  176.             void __DestroyToggleSlotImage();
  177.             void __DestroySlotEnableEffect();
  178.             void __DestroyFinishCoolTimeEffect(TSlot * pSlot);
  179.             void __DestroyBaseImage();
  180.  
  181.             // Event
  182.             void OnUpdate();
  183.             void OnRender();
  184.             BOOL OnMouseLeftButtonDown();
  185.             BOOL OnMouseLeftButtonUp();
  186.             BOOL OnMouseRightButtonDown();
  187.             BOOL OnMouseLeftButtonDoubleClick();
  188.             void OnMouseOverOut();
  189.             void OnMouseOver();
  190.             void RenderSlotBaseImage();
  191.             void RenderLockedSlot();
  192.             virtual void OnRenderPickingSlot();
  193.             virtual void OnRenderSelectedSlot();
  194.  
  195.             // Select
  196.             void OnSelectEmptySlot(int iSlotNumber);
  197.             void OnSelectItemSlot(int iSlotNumber);
  198.             void OnUnselectEmptySlot(int iSlotNumber);
  199.             void OnUnselectItemSlot(int iSlotNumber);
  200.             void OnUseSlot();
  201.  
  202.             // Manage Slot
  203.             BOOL GetSlotPointer(DWORD dwIndex, TSlot ** ppSlot);
  204.             BOOL GetSelectedSlotPointer(TSlot ** ppSlot);
  205.             virtual BOOL GetPickedSlotPointer(TSlot ** ppSlot);
  206.             void ClearSlot(TSlot * pSlot);
  207.             virtual void OnRefreshSlot();
  208.  
  209.             // ETC
  210.             BOOL OnIsType(DWORD dwType);
  211.  
  212.         protected:
  213.             DWORD m_dwSlotType;
  214.             DWORD m_dwSlotStyle;
  215.             std::list<DWORD> m_dwSelectedSlotIndexList;
  216.             TSlotList m_SlotList;
  217.             DWORD m_dwToolTipSlotNumber;
  218.  
  219.             std::map<DWORD, std::map<DWORD, SStoreCoolDown>>    m_CoolDownStore;
  220.  
  221.             BOOL m_isUseMode;
  222.             BOOL m_isUsableItem;
  223.  
  224.             CGraphicImageInstance * m_pBaseImageInstance;
  225.             CImageBox * m_pToggleSlotImage;
  226.             CAniImageBox * m_pSlotActiveEffect;
  227.             std::deque<DWORD> m_ReserveDestroyEffectDeque;
  228.     };
  229. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement