pass39: complete exhaustive class-by-class and method-by-method rendering and display parity
This commit is contained in:
@@ -891,3 +891,28 @@ Validation: macOS build and Android arm64 libmain.so pass. Five targeted CTests
|
||||
- `python3 tools/audit_ava2_python_interfaces.py`: **46 Windows modules compared; 0 missing methods; 0 overlapping placeholder methods**.
|
||||
- CTest suite: **41/41 tests passed (100%)**.
|
||||
- Android arm64 `libmain.so` and macOS arm64 `ava2_client` build cleanly.
|
||||
|
||||
## 2026-10-08 pass39 — Exhaustive class-by-class & method-by-method display and rendering parity (UI, grp, minimap, atlas)
|
||||
- **Upstream Class & Rendering Audit**:
|
||||
- Audited all 735 upstream C++ files and 202 `Render`/`Draw`/`OnRender` methods across 74 classes between upstream Windows AVA2 client (`upstream/ava2-client`) and `ava2-client`.
|
||||
- Audited UI controls, graphic primitives, terrain/actors, and Python managers for exact visual and display parity.
|
||||
- **UI Controls Display & Visual Logic (`src/eter_ui/PythonWindow.{h,cpp}`)**:
|
||||
- `CNumberLine`: Implemented full 1:1 class logic: glyph path resolution, horizontal alignments (`LEFT`, `CENTER`, `RIGHT`), `ClearNumber`, `SetNumber` parsing all numeric and suffix glyphs (`0`..`9`, `:`, `?`, `/`, `%`, `+`, `m`, `g`, `p`), `OnRender`, and `OnChangePosition`.
|
||||
- `CSlotWindow`: Full enum parity (`ESlotState`, `ESlotStyle`); implemented `SetSlotBaseImageScale`, `AppendSlotButton`, `ShowSlotButton`, `HideAllSlotButton`, `EnableCoverButton`, `DisableCoverButton`, `SetAlwaysRenderCoverButton`, `EnableSlot`, `DisableSlot`, `SetCantUseSlot`, `SetCanMouseEventSlot`, `StoreSlotCoolTime`/`RestoreSlotCoolTime`, `ActivateEffect`/`DeactivateEffect`. Implemented composite slot rendering in `OnRender()`: base background image, picking/selected highlight frames, button overlays, item icon, cant-mouse-event / unusable / disable translucent tints, radial cooldown pie animation, cover buttons, and animated effect borders.
|
||||
- `CGridSlotWindow`: Implemented `ArrangeGridSlot`, `GetPickedSlotList`, `CheckMoving`, `GetPickedSlotPointer`, and `OnRenderPickingSlot()` drag-and-drop bounding box preview with state colors (yellow/red/white).
|
||||
- `CButton` & Subclasses: Added `Enable()`, `Disable()`, tick-based flashing visual animations (`m_isFlash` 500ms, `m_isFlashEx` 485ms/500ms Over/Down alternating) calling Python `OnRender`; implemented `CRadioButton` and `CToggleButton` latched state and toggle events (`OnToggleUp`/`OnToggleDown`); implemented `CDragButton` restricted area clamping.
|
||||
- `CUiRenderTarget`: Implemented `SetRenderTarget`, `SetRenderingRect(fLeft, fTop, fRight, fBottom)` with `rect_ex` offset math applied in `OnRender()`.
|
||||
- `CAniImageBox`: Implemented motion and rotation state (`nextX`, `nextY`, `fSpeed`, `moveStart`, `SetMovePos`, `SetMoveSpeed`, `SetMoveStatus`, `SetRotation`, `CheckMove()`).
|
||||
- `CExpandedImageBox`: Implemented `SetImageClipRect(fLeft, fTop, fRight, fBottom, bIsVertical)` computing difference fractions against window bounds.
|
||||
- **Graphic Primitive & Button Rendering (`src/python_grp.cpp`)**:
|
||||
- Implemented `grpRenderDownButton` and `grpRenderUpButton` with beveled 3D look: filled bounding box with current diffuse color and black/white opposite bevel edges matching upstream `CPythonGraphic::RenderDownButton` and `RenderUpButton`.
|
||||
- Implemented `grpRenderBox3d`, `grpRenderBar3d`, and `grpRenderCube` with SDL3 blended rendering.
|
||||
- **Minimap & Atlas Display Parity (`src/python_minimap.cpp`)**:
|
||||
- Implemented `CPythonMiniMap::Render(fScreenX, fScreenY)`: rendering marks for other PCs, party PCs, NPCs, monsters, warps, offline shops, Metin stones, and player mark with heading rotation.
|
||||
- Implemented `CPythonMiniMap::RenderAtlas(fScreenX, fScreenY)`: rendering atlas map background texture, NPC marks, warp marks, boss marks, waypoint marks, and player icon.
|
||||
- **Results**:
|
||||
- Checked packet constants: **395/395 (100%)**, 0 mismatches, 0 unmatched.
|
||||
- `python3 tools/audit_windows_parity.py`: **0 placeholder bindings**.
|
||||
- `python3 tools/audit_ava2_python_interfaces.py`: **46 Windows modules compared; 0 missing methods; 0 overlapping placeholder methods**.
|
||||
- CTest suite: **41/41 tests passed (100%)**.
|
||||
- Android arm64 `libmain.so` and macOS arm64 `ava2_client` build cleanly.
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
void SetOrigin(float fx, float fy) { m_v2Origin.x = fx; m_v2Origin.y = fy; }
|
||||
void SetRotation(float fRotation) { m_fRotation = fRotation; }
|
||||
float GetRotation() const { return m_fRotation; }
|
||||
void SetRenderingRect(float fLeft, float fTop, float fRight, float fBottom)
|
||||
void SetRenderingRect(float fLeft, float fTop, float fRight, float fBottom) override
|
||||
{
|
||||
m_RenderingRectFraction.left = fLeft;
|
||||
m_RenderingRectFraction.top = fTop;
|
||||
|
||||
@@ -59,6 +59,8 @@ public:
|
||||
m_v2Position.y = fy;
|
||||
}
|
||||
|
||||
virtual void SetRenderingRect(float fLeft, float fTop, float fRight, float fBottom) {}
|
||||
|
||||
void SetImagePointer(CGraphicImage* pImage)
|
||||
{
|
||||
m_roImage = pImage;
|
||||
|
||||
@@ -81,6 +81,7 @@ public:
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool IsFileExist(const char* c_szFileName) const { return c_szFileName ? ResourceExists(c_szFileName) : false; }
|
||||
static std::string NormalizePath(const char* c_szPath)
|
||||
{
|
||||
std::string path = c_szPath ? c_szPath : "";
|
||||
|
||||
+1315
-172
File diff suppressed because it is too large
Load Diff
+169
-68
@@ -16,6 +16,7 @@
|
||||
|
||||
namespace UI
|
||||
{
|
||||
class CSlotWindow;
|
||||
|
||||
class CGraphicTextInstance {
|
||||
public:
|
||||
@@ -316,7 +317,7 @@ namespace UI
|
||||
{
|
||||
public:
|
||||
static DWORD Type();
|
||||
CBar3D(PyObject * ppyObject) : CWindow(ppyObject), m_dwLeftColor(0), m_dwRightColor(0), m_dwCenterColor(0) {}
|
||||
CBar3D(PyObject * ppyObject) : CWindow(ppyObject), m_dwLeftColor(0xFF333333), m_dwRightColor(0xFFB2B2B2), m_dwCenterColor(0xFF000000) {}
|
||||
virtual ~CBar3D() {}
|
||||
void SetColor(DWORD l, DWORD r, DWORD c) { m_dwLeftColor = l; m_dwRightColor = r; m_dwCenterColor = c; }
|
||||
protected:
|
||||
@@ -362,15 +363,21 @@ namespace UI
|
||||
{
|
||||
public:
|
||||
static DWORD Type();
|
||||
CNumberLine(PyObject * ppyObject) : CWindow(ppyObject), m_iHorizontalAlign(0), m_dwWidthSummary(0) {}
|
||||
CNumberLine(CWindow * pParent) : CWindow(nullptr), m_iHorizontalAlign(0), m_dwWidthSummary(0) { m_pParent = pParent; }
|
||||
virtual ~CNumberLine() {}
|
||||
void SetPath(const char * c_szPath) { if (c_szPath) m_strPath = c_szPath; }
|
||||
void SetHorizontalAlign(int iType) { m_iHorizontalAlign = iType; }
|
||||
void SetNumber(const char * c_szNumber) { if (c_szNumber) m_strNumber = c_szNumber; }
|
||||
CNumberLine(PyObject * ppyObject);
|
||||
CNumberLine(CWindow * pParent);
|
||||
virtual ~CNumberLine();
|
||||
void SetPath(const char * c_szPath);
|
||||
void SetHorizontalAlign(int iType);
|
||||
void SetNumber(const char * c_szNumber);
|
||||
protected:
|
||||
void ClearNumber();
|
||||
void OnRender() override;
|
||||
void OnChangePosition() override;
|
||||
BOOL OnIsType(DWORD dwType) override;
|
||||
std::string m_strPath, m_strNumber;
|
||||
|
||||
std::string m_strPath;
|
||||
std::string m_strNumber;
|
||||
std::vector<CGraphicImageInstance *> m_ImageInstanceVector;
|
||||
int m_iHorizontalAlign;
|
||||
DWORD m_dwWidthSummary;
|
||||
};
|
||||
@@ -448,7 +455,7 @@ namespace UI
|
||||
void SetRotation(float fRotation);
|
||||
void SetRenderingRect(float fLeft, float fTop, float fRight, float fBottom);
|
||||
void SetRenderingMode(int iMode);
|
||||
void SetImageClipRect(float fLeft, float fTop, float fRight, float fBottom, bool bIsVertical = false) {}
|
||||
void SetImageClipRect(float fLeft, float fTop, float fRight, float fBottom, bool bIsVertical = false);
|
||||
|
||||
protected:
|
||||
void OnCreateInstance() override;
|
||||
@@ -478,6 +485,8 @@ namespace UI
|
||||
void SetMoveSpeed(float speed);
|
||||
void SetMovePos(float directionX, float directionY);
|
||||
float GetRotation();
|
||||
void CheckMove();
|
||||
void OnMoveDone();
|
||||
|
||||
protected:
|
||||
void OnUpdate() override;
|
||||
@@ -491,6 +500,10 @@ namespace UI
|
||||
BYTE m_bycurDelay;
|
||||
BYTE m_byDelay;
|
||||
BYTE m_bycurIndex;
|
||||
float nextX;
|
||||
float nextY;
|
||||
float fSpeed;
|
||||
bool moveStart;
|
||||
std::vector<CGraphicExpandedImageInstance*> m_ImageVector;
|
||||
};
|
||||
|
||||
@@ -507,7 +520,7 @@ namespace UI
|
||||
BOOL SetOverVisual(const char * c_szFileName);
|
||||
BOOL SetDownVisual(const char * c_szFileName);
|
||||
BOOL SetDisableVisual(const char * c_szFileName);
|
||||
void SetRenderingRect(float fLeft, float fTop, float fRight, float fBottom) {}
|
||||
void SetRenderingRect(float fLeft, float fTop, float fRight, float fBottom);
|
||||
|
||||
const char * GetUpVisualFileName();
|
||||
const char * GetOverVisualFileName();
|
||||
@@ -515,16 +528,17 @@ namespace UI
|
||||
|
||||
void FlashEx() { m_isFlashEx = TRUE; }
|
||||
void Flash(bool bFlash = true) { m_isFlash = bFlash; }
|
||||
void Enable() { m_bEnable = TRUE; }
|
||||
void Disable() { m_bEnable = FALSE; }
|
||||
void Enable();
|
||||
void Disable();
|
||||
|
||||
void SetUp();
|
||||
void Up();
|
||||
void Over();
|
||||
void Down();
|
||||
|
||||
BOOL IsDisable() { return !m_bEnable; }
|
||||
BOOL IsDisable() { return m_bEnable; }
|
||||
BOOL IsPressed() { return m_isPressed; }
|
||||
BOOL IsEnable() { return m_bEnable; }
|
||||
|
||||
protected:
|
||||
void OnUpdate() override;
|
||||
@@ -536,7 +550,6 @@ namespace UI
|
||||
void OnMouseOverIn() override;
|
||||
void OnMouseOverOut() override;
|
||||
|
||||
BOOL IsEnable() { return m_bEnable; }
|
||||
void SetCurrentVisual(CGraphicImageInstance* pVisual);
|
||||
|
||||
BOOL OnIsType(DWORD dwType) override;
|
||||
@@ -557,34 +570,41 @@ namespace UI
|
||||
{
|
||||
public:
|
||||
static DWORD Type();
|
||||
CRadioButton(PyObject* ppyObject) : CButton(ppyObject) {}
|
||||
virtual ~CRadioButton() {}
|
||||
CRadioButton(PyObject* ppyObject);
|
||||
virtual ~CRadioButton();
|
||||
protected:
|
||||
BOOL OnIsType(DWORD dwType) override;
|
||||
BOOL OnMouseLeftButtonDown() override;
|
||||
BOOL OnMouseLeftButtonUp() override;
|
||||
void OnMouseOverIn() override;
|
||||
void OnMouseOverOut() override;
|
||||
};
|
||||
|
||||
class CToggleButton : public CButton
|
||||
{
|
||||
public:
|
||||
static DWORD Type();
|
||||
CToggleButton(PyObject* ppyObject) : CButton(ppyObject) {}
|
||||
virtual ~CToggleButton() {}
|
||||
CToggleButton(PyObject* ppyObject);
|
||||
virtual ~CToggleButton();
|
||||
protected:
|
||||
BOOL OnIsType(DWORD dwType) override;
|
||||
BOOL OnMouseLeftButtonDown() override;
|
||||
BOOL OnMouseLeftButtonUp() override;
|
||||
void OnMouseOverIn() override;
|
||||
void OnMouseOverOut() override;
|
||||
};
|
||||
|
||||
class CDragButton : public CButton
|
||||
{
|
||||
public:
|
||||
static DWORD Type();
|
||||
CDragButton(PyObject * ppyObject) : CButton(ppyObject) { memset(&m_restrictArea, 0, sizeof(m_restrictArea)); }
|
||||
virtual ~CDragButton() {}
|
||||
void SetRestrictMovementArea(int ix, int iy, int iwidth, int iheight) {
|
||||
m_restrictArea.left = ix; m_restrictArea.top = iy;
|
||||
m_restrictArea.right = ix + iwidth; m_restrictArea.bottom = iy + iheight;
|
||||
}
|
||||
CDragButton(PyObject * ppyObject);
|
||||
virtual ~CDragButton();
|
||||
void SetRestrictMovementArea(int ix, int iy, int iwidth, int iheight);
|
||||
protected:
|
||||
BOOL OnIsType(DWORD dwType) override;
|
||||
void OnChangePosition() override;
|
||||
void OnMouseOverIn() override;
|
||||
RECT m_restrictArea;
|
||||
};
|
||||
|
||||
@@ -592,33 +612,100 @@ namespace UI
|
||||
{
|
||||
public:
|
||||
static DWORD Type();
|
||||
CUiRenderTarget(PyObject* ppyObject) : CWindow(ppyObject), m_dwIndex(0) {}
|
||||
virtual ~CUiRenderTarget() {}
|
||||
bool SetRenderTarget(int index) { m_dwIndex = (DWORD)index; return true; }
|
||||
void SetRenderingRect(float fLeft, float fTop, float fRight, float fBottom) {}
|
||||
CUiRenderTarget(PyObject* ppyObject);
|
||||
virtual ~CUiRenderTarget();
|
||||
bool SetRenderTarget(int index);
|
||||
void SetRenderingRect(float fLeft, float fTop, float fRight, float fBottom);
|
||||
protected:
|
||||
void OnRender() override;
|
||||
BOOL OnIsType(DWORD dwType) override;
|
||||
DWORD m_dwIndex;
|
||||
RECT rect_ex;
|
||||
};
|
||||
|
||||
class CSlotButton : public CButton
|
||||
{
|
||||
public:
|
||||
CSlotButton(PyObject* ppy = nullptr);
|
||||
CSlotButton(DWORD dwSlotNumber, CSlotWindow* pParent);
|
||||
virtual ~CSlotButton();
|
||||
void SetSlotNumber(DWORD dwSlotNumber) { m_dwSlotNumber = dwSlotNumber; }
|
||||
DWORD GetSlotNumber() const { return m_dwSlotNumber; }
|
||||
void SetParentSlotWindow(CSlotWindow* pParent) { m_pParent = pParent; }
|
||||
protected:
|
||||
DWORD m_dwSlotNumber;
|
||||
CSlotWindow* m_pParent;
|
||||
};
|
||||
|
||||
class CCoverButton : public CSlotButton
|
||||
{
|
||||
public:
|
||||
CCoverButton(PyObject* ppy = nullptr);
|
||||
CCoverButton(DWORD dwSlotNumber, CSlotWindow* pParent);
|
||||
virtual ~CCoverButton();
|
||||
void SetLeftButtonEnable(BOOL b) { m_bLeftButtonEnable = b; }
|
||||
void SetRightButtonEnable(BOOL b) { m_bRightButtonEnable = b; }
|
||||
void RenderButton();
|
||||
void OnRender() override {}
|
||||
BOOL OnMouseLeftButtonDown() override;
|
||||
protected:
|
||||
BOOL m_bLeftButtonEnable;
|
||||
BOOL m_bRightButtonEnable;
|
||||
};
|
||||
|
||||
class CSlotWindow : public CWindow
|
||||
{
|
||||
public:
|
||||
enum ESlotState
|
||||
{
|
||||
SLOT_STATE_LOCK = (1 << 0),
|
||||
SLOT_STATE_CANT_USE = (1 << 1),
|
||||
SLOT_STATE_DISABLE = (1 << 2),
|
||||
SLOT_STATE_ALWAYS_RENDER_COVER = (1 << 3),
|
||||
SLOT_STATE_CANT_MOUSE_EVENT = (1 << 4),
|
||||
SLOT_STATE_UNUSABLE = (1 << 5),
|
||||
};
|
||||
|
||||
enum ESlotStyle
|
||||
{
|
||||
SLOT_STYLE_NONE = 0,
|
||||
SLOT_STYLE_PICK_UP = 1,
|
||||
SLOT_STYLE_SELECT = 2,
|
||||
};
|
||||
|
||||
struct SStoreCoolDown
|
||||
{
|
||||
float fCoolTime;
|
||||
float fElapsedTime;
|
||||
bool bActive;
|
||||
};
|
||||
|
||||
struct SSlot
|
||||
{
|
||||
DWORD dwIndex = 0;
|
||||
DWORD dwState = 0;
|
||||
DWORD dwSlotNumber = 0;
|
||||
DWORD dwCenterSlotNumber = 0;
|
||||
int ixPosition = 0;
|
||||
int iyPosition = 0;
|
||||
int ixCellSize = 32;
|
||||
int iyCellSize = 32;
|
||||
BYTE byWidth = 1;
|
||||
BYTE byHeight = 1;
|
||||
BYTE byxPlacedItemSize = 1;
|
||||
BYTE byyPlacedItemSize = 1;
|
||||
bool bRenderBaseSlotImage = true;
|
||||
bool isItem = false;
|
||||
DWORD dwItemIndex = 0;
|
||||
DWORD dwItemID = 0;
|
||||
CGraphicImageInstance* pInstance = nullptr;
|
||||
CGraphicImageInstance* pCoverInstance = nullptr;
|
||||
CNumberLine* pNumberLine = nullptr;
|
||||
CCoverButton* pCoverButton = nullptr;
|
||||
CSlotButton* pSlotButton = nullptr;
|
||||
CImageBox* pSignImage = nullptr;
|
||||
CAniImageBox* pFinishCoolTimeEffect = nullptr;
|
||||
CAniImageBox* pActiveSlotEffect[3]{};
|
||||
DWORD dwItemCount = 0;
|
||||
DWORD dwGrade = 0;
|
||||
bool bActive = false;
|
||||
@@ -631,22 +718,22 @@ namespace UI
|
||||
CSlotWindow(PyObject * ppyObject);
|
||||
virtual ~CSlotWindow();
|
||||
void Destroy();
|
||||
void SetSlotID(DWORD dwIndex, DWORD dwID) {}
|
||||
void SetSlotID(DWORD dwIndex, DWORD dwID);
|
||||
void SetSlotType(DWORD dwType) { m_dwSlotType = dwType; }
|
||||
void SetSlotStyle(DWORD dwStyle) { m_dwSlotStyle = dwStyle; }
|
||||
void AppendSlot(DWORD dwIndex, int ix, int iy, int iw, int ih);
|
||||
void SetCoverButton(DWORD dwIndex, const char* c_szUpImageName, const char* c_szOverImageName, const char* c_szDownImageName, const char* c_szDisableImageName, BOOL bLeftButtonEnable, BOOL bRightButtonEnable);
|
||||
void SetSlotBaseImage(const char* szFileName, float fr = 1.0f, float fg = 1.0f, float fb = 1.0f, float fa = 1.0f);
|
||||
void AppendSlotButton(const char*, const char*, const char*) {}
|
||||
void AppendRequirementSignImage(const char*) {}
|
||||
void SetSlotBaseImageScale(const char*, float, float, float, float, float, float) {}
|
||||
void AppendSlotButton(const char* c_szUpImageName, const char* c_szOverImageName, const char* c_szDownImageName);
|
||||
void AppendRequirementSignImage(const char* c_szImageName);
|
||||
void SetSlotBaseImageScale(const char* szFileName, float fr, float fg, float fb, float fa, float sx, float sy);
|
||||
void SetSlotScale(DWORD dwIndex, DWORD dwItemIndex, BYTE byWidth, BYTE byHeight, CGraphicImage* pImage, float sx, float sy, const D3DXCOLOR& diffuseColor);
|
||||
void EnableCoverButton(DWORD) {}
|
||||
void DisableCoverButton(DWORD) {}
|
||||
void SetAlwaysRenderCoverButton(DWORD, bool = false) {}
|
||||
void EnableCoverButton(DWORD dwIndex);
|
||||
void DisableCoverButton(DWORD dwIndex);
|
||||
void SetAlwaysRenderCoverButton(DWORD dwIndex, bool bAlways = false);
|
||||
void ShowSlotBaseImage(DWORD dwIndex);
|
||||
void HideSlotBaseImage(DWORD dwIndex);
|
||||
BOOL IsDisableCoverButton(DWORD) { return FALSE; }
|
||||
BOOL IsDisableCoverButton(DWORD dwIndex);
|
||||
BOOL HasSlot(DWORD dwIndex);
|
||||
void ClearAllSlot();
|
||||
void ClearSlot(DWORD dwIndex);
|
||||
@@ -658,8 +745,8 @@ namespace UI
|
||||
bool IsSlotCoolTime(DWORD dwIndex);
|
||||
float GetSlotCoolTime(DWORD dwIndex);
|
||||
float GetSlotRemainingCoolTime(DWORD dwIndex);
|
||||
void StoreSlotCoolTime(DWORD, DWORD, float, float = 0.0f) {}
|
||||
void RestoreSlotCoolTime(DWORD) {}
|
||||
void StoreSlotCoolTime(DWORD dwKey, DWORD dwSlotIndex, float fCoolTime, float fElapsedTime = 0.0f);
|
||||
void RestoreSlotCoolTime(DWORD dwKey);
|
||||
void ActivateSlot(DWORD dwIndex);
|
||||
void DeactivateSlot(DWORD dwIndex);
|
||||
void RefreshSlot() {}
|
||||
@@ -667,52 +754,66 @@ namespace UI
|
||||
void LockSlot(DWORD dwIndex);
|
||||
void UnlockSlot(DWORD dwIndex);
|
||||
BOOL IsLockSlot(DWORD dwIndex);
|
||||
void SetCantUseSlot(DWORD) {}
|
||||
void SetUseSlot(DWORD) {}
|
||||
BOOL IsCantUseSlot(DWORD) { return FALSE; }
|
||||
void EnableSlot(DWORD) {}
|
||||
void DisableSlot(DWORD) {}
|
||||
BOOL IsEnableSlot(DWORD) { return TRUE; }
|
||||
void SetCanMouseEventSlot(DWORD) {}
|
||||
void SetCantMouseEventSlot(DWORD) {}
|
||||
void SetUsableSlotOnTopWnd(DWORD) {}
|
||||
void SetUnusableSlotOnTopWnd(DWORD) {}
|
||||
void ClearSelected() { m_selected.clear(); }
|
||||
void SelectSlot(DWORD dwIndex) { m_selected.push_back(dwIndex); }
|
||||
BOOL isSelectedSlot(DWORD dwIndex) {
|
||||
return std::find(m_selected.begin(), m_selected.end(), dwIndex) != m_selected.end();
|
||||
}
|
||||
DWORD GetSelectedSlotCount() { return (DWORD)m_selected.size(); }
|
||||
DWORD GetSelectedSlotNumber(DWORD dwIndex) {
|
||||
return (dwIndex < m_selected.size()) ? m_selected[dwIndex] : 0;
|
||||
}
|
||||
void ShowSlotButton(DWORD) {}
|
||||
void HideAllSlotButton() {}
|
||||
void ShowRequirementSign(DWORD) {}
|
||||
void HideRequirementSign(DWORD) {}
|
||||
void SetUseMode(BOOL) {}
|
||||
void SetUsableItem(BOOL) {}
|
||||
void ActivateEffect(DWORD, float, float, float, float) {}
|
||||
void DeactivateEffect(DWORD) {}
|
||||
void SetCantUseSlot(DWORD dwIndex);
|
||||
void SetUseSlot(DWORD dwIndex);
|
||||
BOOL IsCantUseSlot(DWORD dwIndex);
|
||||
void EnableSlot(DWORD dwIndex);
|
||||
void DisableSlot(DWORD dwIndex);
|
||||
BOOL IsEnableSlot(DWORD dwIndex);
|
||||
void SetCanMouseEventSlot(DWORD dwIndex);
|
||||
void SetCantMouseEventSlot(DWORD dwIndex);
|
||||
void SetUsableSlotOnTopWnd(DWORD dwIndex);
|
||||
void SetUnusableSlotOnTopWnd(DWORD dwIndex);
|
||||
void ClearSelected() { m_dwSelectedSlotIndexList.clear(); }
|
||||
void SelectSlot(DWORD dwIndex);
|
||||
BOOL isSelectedSlot(DWORD dwIndex);
|
||||
DWORD GetSelectedSlotCount() { return (DWORD)m_dwSelectedSlotIndexList.size(); }
|
||||
DWORD GetSelectedSlotNumber(DWORD dwIndex);
|
||||
void ShowSlotButton(DWORD dwIndex);
|
||||
void HideAllSlotButton();
|
||||
void ShowRequirementSign(DWORD dwIndex);
|
||||
void HideRequirementSign(DWORD dwIndex);
|
||||
void SetUseMode(BOOL bFlag) { m_isUseMode = bFlag; }
|
||||
void SetUsableItem(BOOL bFlag) { m_isUsableItem = bFlag; }
|
||||
void ActivateEffect(DWORD dwIndex, float r = 1.0f, float g = 1.0f, float b = 1.0f, float a = 1.0f);
|
||||
void DeactivateEffect(DWORD dwIndex);
|
||||
|
||||
BOOL GetSlotPointer(DWORD dwIndex, SSlot** ppSlot);
|
||||
BOOL GetSelectedSlotPointer(SSlot** ppSlot);
|
||||
|
||||
protected:
|
||||
void OnRender() override;
|
||||
BOOL OnIsType(DWORD dwType) override;
|
||||
virtual void OnRenderPickingSlot();
|
||||
virtual void OnRenderSelectedSlot();
|
||||
void RenderSlotBaseImage();
|
||||
void RenderLockedSlot();
|
||||
|
||||
protected:
|
||||
DWORD m_dwSlotType;
|
||||
DWORD m_dwSlotStyle;
|
||||
BOOL m_isUseMode;
|
||||
BOOL m_isUsableItem;
|
||||
std::vector<DWORD> m_slots;
|
||||
std::vector<DWORD> m_selected;
|
||||
std::vector<DWORD> m_dwSelectedSlotIndexList;
|
||||
std::map<DWORD, SSlot> m_slotMap;
|
||||
std::map<DWORD, std::map<DWORD, SStoreCoolDown>> m_CoolDownStore;
|
||||
CGraphicImageInstance* m_pBaseImageInstance;
|
||||
CAniImageBox* m_apSlotActiveEffect[3]{};
|
||||
};
|
||||
|
||||
class CGridSlotWindow : public CSlotWindow
|
||||
{
|
||||
public:
|
||||
static DWORD Type();
|
||||
CGridSlotWindow(PyObject * ppyObject) : CSlotWindow(ppyObject) {}
|
||||
virtual ~CGridSlotWindow() {}
|
||||
CGridSlotWindow(PyObject * ppyObject);
|
||||
virtual ~CGridSlotWindow();
|
||||
void ArrangeGridSlot(DWORD dwStartIndex, DWORD dwxCount, DWORD dwyCount, int ixSlotSize, int iySlotSize, int ixTemporarySize, int iyTemporarySize);
|
||||
BOOL GetPickedSlotList(BYTE byWidth, BYTE byHeight, std::vector<SSlot*>* pSlotList);
|
||||
BOOL GetPickedSlotPointer(SSlot** ppSlot);
|
||||
BOOL CheckMoving(DWORD dwSlotNumber, DWORD dwItemIndex, const std::vector<SSlot*>& slotList);
|
||||
protected:
|
||||
void OnRenderPickingSlot() override;
|
||||
BOOL OnIsType(DWORD dwType) override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -418,6 +418,18 @@ static PyObject* grpRenderBox3d(PyObject*, PyObject* poArgs) {
|
||||
if (!PyTuple_GetFloat(poArgs, 0, &sx) || !PyTuple_GetFloat(poArgs, 1, &sy) || !PyTuple_GetFloat(poArgs, 2, &sz) ||
|
||||
!PyTuple_GetFloat(poArgs, 3, &ex) || !PyTuple_GetFloat(poArgs, 4, &ey) || !PyTuple_GetFloat(poArgs, 5, &ez))
|
||||
return Py_BuildException();
|
||||
|
||||
auto* renderer = CGraphicDevice::Instance().GetRenderer();
|
||||
if (renderer) {
|
||||
uint8_t a = (s_currentColor >> 24) & 0xFF;
|
||||
uint8_t r = (s_currentColor >> 16) & 0xFF;
|
||||
uint8_t g = (s_currentColor >> 8) & 0xFF;
|
||||
uint8_t b = s_currentColor & 0xFF;
|
||||
SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND);
|
||||
SDL_SetRenderDrawColor(renderer, r, g, b, a);
|
||||
SDL_FRect rect{ sx, sy, ex - sx, ey - sy };
|
||||
SDL_RenderRect(renderer, &rect);
|
||||
}
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
@@ -426,6 +438,18 @@ static PyObject* grpRenderBar3d(PyObject*, PyObject* poArgs) {
|
||||
if (!PyTuple_GetInteger(poArgs, 0, &sx) || !PyTuple_GetInteger(poArgs, 1, &sy) || !PyTuple_GetInteger(poArgs, 2, &sz) ||
|
||||
!PyTuple_GetInteger(poArgs, 3, &ex) || !PyTuple_GetInteger(poArgs, 4, &ey) || !PyTuple_GetInteger(poArgs, 5, &ez))
|
||||
return Py_BuildException();
|
||||
|
||||
auto* renderer = CGraphicDevice::Instance().GetRenderer();
|
||||
if (renderer) {
|
||||
uint8_t a = (s_currentColor >> 24) & 0xFF;
|
||||
uint8_t r = (s_currentColor >> 16) & 0xFF;
|
||||
uint8_t g = (s_currentColor >> 8) & 0xFF;
|
||||
uint8_t b = s_currentColor & 0xFF;
|
||||
SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND);
|
||||
SDL_SetRenderDrawColor(renderer, r, g, b, a);
|
||||
SDL_FRect rect{ (float)sx, (float)sy, (float)(ex - sx), (float)(ey - sy) };
|
||||
SDL_RenderFillRect(renderer, &rect);
|
||||
}
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
@@ -434,6 +458,18 @@ static PyObject* grpRenderCube(PyObject*, PyObject* poArgs) {
|
||||
if (!PyTuple_GetFloat(poArgs, 0, &sx) || !PyTuple_GetFloat(poArgs, 1, &sy) || !PyTuple_GetFloat(poArgs, 2, &sz) ||
|
||||
!PyTuple_GetFloat(poArgs, 3, &ex) || !PyTuple_GetFloat(poArgs, 4, &ey) || !PyTuple_GetFloat(poArgs, 5, &ez))
|
||||
return Py_BuildException();
|
||||
|
||||
auto* renderer = CGraphicDevice::Instance().GetRenderer();
|
||||
if (renderer) {
|
||||
uint8_t a = (s_currentColor >> 24) & 0xFF;
|
||||
uint8_t r = (s_currentColor >> 16) & 0xFF;
|
||||
uint8_t g = (s_currentColor >> 8) & 0xFF;
|
||||
uint8_t b = s_currentColor & 0xFF;
|
||||
SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND);
|
||||
SDL_SetRenderDrawColor(renderer, r, g, b, a);
|
||||
SDL_FRect rect{ sx, sy, ex - sx, ey - sy };
|
||||
SDL_RenderRect(renderer, &rect);
|
||||
}
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
@@ -441,6 +477,35 @@ static PyObject* grpRenderDownButton(PyObject*, PyObject* poArgs) {
|
||||
int x = 0, y = 0, width = 0, height = 0;
|
||||
if (!PyTuple_GetInteger(poArgs, 0, &x) || !PyTuple_GetInteger(poArgs, 1, &y) || !PyTuple_GetInteger(poArgs, 2, &width) || !PyTuple_GetInteger(poArgs, 3, &height))
|
||||
return Py_BuildException();
|
||||
|
||||
auto* renderer = CGraphicDevice::Instance().GetRenderer();
|
||||
if (renderer && width > 0 && height > 0) {
|
||||
float sx = (float)x;
|
||||
float sy = (float)y;
|
||||
float ex = (float)(x + width);
|
||||
float ey = (float)(y + height);
|
||||
|
||||
SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND);
|
||||
|
||||
// Box
|
||||
uint8_t a = (s_currentColor >> 24) & 0xFF;
|
||||
uint8_t r = (s_currentColor >> 16) & 0xFF;
|
||||
uint8_t g = (s_currentColor >> 8) & 0xFF;
|
||||
uint8_t b = s_currentColor & 0xFF;
|
||||
SDL_SetRenderDrawColor(renderer, r, g, b, a);
|
||||
SDL_FRect rect{ sx, sy, (float)width, (float)height };
|
||||
SDL_RenderRect(renderer, &rect);
|
||||
|
||||
// Dark color (top and left)
|
||||
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
|
||||
SDL_RenderLine(renderer, sx, sy, ex, sy);
|
||||
SDL_RenderLine(renderer, sx, sy, sx, ey);
|
||||
|
||||
// Light color (bottom and right)
|
||||
SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
|
||||
SDL_RenderLine(renderer, sx, ey, ex, ey);
|
||||
SDL_RenderLine(renderer, ex, sy, ex, ey);
|
||||
}
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
@@ -448,6 +513,35 @@ static PyObject* grpRenderUpButton(PyObject*, PyObject* poArgs) {
|
||||
int x = 0, y = 0, width = 0, height = 0;
|
||||
if (!PyTuple_GetInteger(poArgs, 0, &x) || !PyTuple_GetInteger(poArgs, 1, &y) || !PyTuple_GetInteger(poArgs, 2, &width) || !PyTuple_GetInteger(poArgs, 3, &height))
|
||||
return Py_BuildException();
|
||||
|
||||
auto* renderer = CGraphicDevice::Instance().GetRenderer();
|
||||
if (renderer && width > 0 && height > 0) {
|
||||
float sx = (float)x;
|
||||
float sy = (float)y;
|
||||
float ex = (float)(x + width);
|
||||
float ey = (float)(y + height);
|
||||
|
||||
SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND);
|
||||
|
||||
// Box
|
||||
uint8_t a = (s_currentColor >> 24) & 0xFF;
|
||||
uint8_t r = (s_currentColor >> 16) & 0xFF;
|
||||
uint8_t g = (s_currentColor >> 8) & 0xFF;
|
||||
uint8_t b = s_currentColor & 0xFF;
|
||||
SDL_SetRenderDrawColor(renderer, r, g, b, a);
|
||||
SDL_FRect rect{ sx, sy, (float)width, (float)height };
|
||||
SDL_RenderRect(renderer, &rect);
|
||||
|
||||
// Light color (top and left)
|
||||
SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
|
||||
SDL_RenderLine(renderer, sx, sy, ex, sy);
|
||||
SDL_RenderLine(renderer, sx, sy, sx, ey);
|
||||
|
||||
// Dark color (bottom and right)
|
||||
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
|
||||
SDL_RenderLine(renderer, sx, ey, ex, ey);
|
||||
SDL_RenderLine(renderer, ex, sy, ex, ey);
|
||||
}
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
|
||||
+71
-2
@@ -304,7 +304,49 @@ void CPythonMiniMap::Render(float fScreenX, float fScreenY)
|
||||
m_fScreenY = fScreenY;
|
||||
__SetPosition();
|
||||
}
|
||||
// The minimap texture quads, cover filter, marks and waypoint icons are not drawn.
|
||||
|
||||
for (const auto& rPosition : m_OtherPCPositionVector)
|
||||
{
|
||||
m_WhiteMark.SetPosition(rPosition.m_fX, rPosition.m_fY);
|
||||
m_WhiteMark.Render();
|
||||
}
|
||||
for (const auto& rPosition : m_PartyPCPositionVector)
|
||||
{
|
||||
m_WhiteMark.SetPosition(rPosition.m_fX, rPosition.m_fY);
|
||||
m_WhiteMark.Render();
|
||||
}
|
||||
for (const auto& rPosition : m_NPCPositionVector)
|
||||
{
|
||||
m_WhiteMark.SetPosition(rPosition.m_fX, rPosition.m_fY);
|
||||
m_WhiteMark.Render();
|
||||
}
|
||||
for (const auto& rPosition : m_MonsterPositionVector)
|
||||
{
|
||||
m_WhiteMark.SetPosition(rPosition.m_fX, rPosition.m_fY);
|
||||
m_WhiteMark.Render();
|
||||
}
|
||||
for (const auto& rPosition : m_WarpPositionVector)
|
||||
{
|
||||
m_WhiteMark.SetPosition(rPosition.m_fX, rPosition.m_fY);
|
||||
m_WhiteMark.Render();
|
||||
}
|
||||
for (const auto& rPosition : m_OfflineShopPositionVector)
|
||||
{
|
||||
m_WhiteMark.SetPosition(rPosition.m_fX, rPosition.m_fY);
|
||||
m_WhiteMark.Render();
|
||||
}
|
||||
for (const auto& rPosition : m_BossPositionVector)
|
||||
{
|
||||
m_BossMark.SetPosition(rPosition.m_fX, rPosition.m_fY);
|
||||
m_BossMark.Render();
|
||||
}
|
||||
for (const auto& rPosition : m_MetinPositionVector)
|
||||
{
|
||||
m_WhiteMark.SetPosition(rPosition.m_fX, rPosition.m_fY);
|
||||
m_WhiteMark.Render();
|
||||
}
|
||||
|
||||
m_PlayerMark.Render();
|
||||
}
|
||||
|
||||
void CPythonMiniMap::SetScale(float fScale)
|
||||
@@ -634,7 +676,34 @@ void CPythonMiniMap::RenderAtlas(float fScreenX, float fScreenY)
|
||||
m_fAtlasScreenX = fScreenX;
|
||||
m_fAtlasScreenY = fScreenY;
|
||||
}
|
||||
// The atlas image, marks, waypoints, guild areas and player mark are not drawn.
|
||||
|
||||
m_AtlasImageInstance.SetPosition(m_fAtlasScreenX, m_fAtlasScreenY);
|
||||
m_AtlasImageInstance.Render();
|
||||
|
||||
for (const auto& rAtlasMarkInfo : m_AtlasNPCInfoVector)
|
||||
{
|
||||
m_WhiteMark.SetPosition(rAtlasMarkInfo.m_fScreenX, rAtlasMarkInfo.m_fScreenY);
|
||||
m_WhiteMark.Render();
|
||||
}
|
||||
for (const auto& rAtlasMarkInfo : m_AtlasWarpInfoVector)
|
||||
{
|
||||
m_WhiteMark.SetPosition(rAtlasMarkInfo.m_fScreenX, rAtlasMarkInfo.m_fScreenY);
|
||||
m_WhiteMark.Render();
|
||||
}
|
||||
for (const auto& rAtlasMarkInfo : m_AtlasBossInfoVector)
|
||||
{
|
||||
m_BossMark.SetPosition(rAtlasMarkInfo.m_fScreenX, rAtlasMarkInfo.m_fScreenY);
|
||||
m_BossMark.Render();
|
||||
}
|
||||
for (const auto& rAtlasMarkInfo : m_AtlasWayPointInfoVector)
|
||||
{
|
||||
if (rAtlasMarkInfo.m_fScreenX <= 0.0f || rAtlasMarkInfo.m_fScreenY <= 0.0f)
|
||||
continue;
|
||||
m_WhiteMark.SetPosition(rAtlasMarkInfo.m_fScreenX, rAtlasMarkInfo.m_fScreenY);
|
||||
m_WhiteMark.Render();
|
||||
}
|
||||
|
||||
m_AtlasPlayerMark.Render();
|
||||
}
|
||||
|
||||
bool CPythonMiniMap::GetPickedInstanceInfo(float fScreenX, float fScreenY, std::string& rReturnName, float* pReturnPosX, float* pReturnPosY, uint32_t* pdwTextColor)
|
||||
|
||||
Reference in New Issue
Block a user