mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 03:02:30 +00:00
feat(gameui): update CGTooltip member variables
This commit is contained in:
parent
55bcd21c1f
commit
3d8cd8b87f
2 changed files with 20 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
#include "gameui/CGTooltip.hpp"
|
#include "gameui/CGTooltip.hpp"
|
||||||
#include "gameui/CGTooltipScript.hpp"
|
#include "gameui/CGTooltipScript.hpp"
|
||||||
|
#include "ui/CSimpleFontString.hpp"
|
||||||
#include "util/Lua.hpp"
|
#include "util/Lua.hpp"
|
||||||
#include <bc/Memory.hpp>
|
#include <bc/Memory.hpp>
|
||||||
|
|
||||||
|
|
@ -76,7 +77,21 @@ void CGTooltip::AddLine(
|
||||||
const CImVector& leftColor,
|
const CImVector& leftColor,
|
||||||
const CImVector& rightColor,
|
const CImVector& rightColor,
|
||||||
int32_t wrapped) {
|
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) {
|
bool CGTooltip::IsA(int32_t type) {
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,11 @@ class CGTooltip : public CSimpleFrame {
|
||||||
// Member variables
|
// Member variables
|
||||||
CSimpleFrame* m_owner = nullptr;
|
CSimpleFrame* m_owner = nullptr;
|
||||||
TOOLTIP_ANCHORPOINT m_anchorPoint = ANCHOR_NONE;
|
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_padding = 0.0f;
|
||||||
float m_minWidth = 0.0f;
|
float m_minWidth = 0.0f;
|
||||||
uint32_t m_minWidthForced = 0;
|
uint32_t m_minWidthForced = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue