mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-10-26 13:56:05 +03:00
feat(gameui): update CGTooltip member variables
This commit is contained in:
parent
55bcd21c1f
commit
3d8cd8b87f
@ -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) {
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user