feat(gameui): update CGTooltip member variables

This commit is contained in:
VDm 2025-08-14 01:20:39 +04:00
parent 55bcd21c1f
commit 3d8cd8b87f
2 changed files with 20 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#include "gameui/CGTooltip.hpp"
#include "gameui/CGTooltipScript.hpp"
#include "ui/CSimpleFontString.hpp"
#include "util/Lua.hpp"
#include <bc/Memory.hpp>
@ -76,7 +77,21 @@ void CGTooltip::AddLine(
const CImVector& leftColor,
const CImVector& rightColor,
int32_t wrapped) {
if ((!leftText || !*leftText) && (!rightText || !*rightText)) {
return;
}
if (!this->m_linesMax) {
return;
}
if (this->m_lines == this->m_linesMax - 1) {
char name[256];
SStrPrintf(name, sizeof(name), "%sTextLeft%d", this->GetDisplayName(), this->m_linesMax + 1);
// TODO: CDataAllocator
auto leftFontString = NEW(CSimpleFontString, this, 2, 1);
leftFontString->SetName(name);
}
}
bool CGTooltip::IsA(int32_t type) {

View File

@ -56,6 +56,11 @@ class CGTooltip : public CSimpleFrame {
// Member variables
CSimpleFrame* m_owner = nullptr;
TOOLTIP_ANCHORPOINT m_anchorPoint = ANCHOR_NONE;
uint32_t m_lines = 0;
uint32_t m_linesMax = 0;
TSFixedArray<CSimpleFontString*> m_leftStrings;
TSFixedArray<CSimpleFontString*> m_rightStrings;
TSFixedArray<int32_t> m_wrapLine;
float m_padding = 0.0f;
float m_minWidth = 0.0f;
uint32_t m_minWidthForced = 0;