mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 03:02:30 +00:00
feat(gameui): add CGTooltipScript methods
This commit is contained in:
parent
b291f47306
commit
6f5d3662b6
5 changed files with 411 additions and 9 deletions
|
|
@ -1,11 +1,29 @@
|
|||
#include "gameui/CGTooltip.hpp"
|
||||
#include "gameui/CGTooltipScript.hpp"
|
||||
#include <bc/Memory.hpp>
|
||||
|
||||
CGTooltip::CGTooltip(CSimpleFrame* parent) : CSimpleFrame(parent) {
|
||||
}
|
||||
int32_t CGTooltip::s_metatable;
|
||||
|
||||
CSimpleFrame* CGTooltip::Create(CSimpleFrame* parent) {
|
||||
// TODO: Data = CDataAllocator__GetData(0, ".?AVCGTooltip@@", -2);
|
||||
|
||||
auto m = SMemAlloc(sizeof(CGTooltip), __FILE__, __LINE__, 0);
|
||||
return m ? (new (m) CGTooltip(parent)) : nullptr;
|
||||
return NEW(CGTooltip, parent);
|
||||
}
|
||||
|
||||
void CGTooltip::CreateScriptMetaTable() {
|
||||
lua_State* L = FrameScript_GetContext();
|
||||
int32_t ref = FrameScript_Object::CreateScriptMetaTable(L, &CGTooltip::RegisterScriptMethods);
|
||||
CGTooltip::s_metatable = ref;
|
||||
}
|
||||
|
||||
void CGTooltip::RegisterScriptMethods(lua_State* L) {
|
||||
CSimpleFrame::RegisterScriptMethods(L);
|
||||
FrameScript_Object::FillScriptMethodTable(L, CGTooltipMethods, NUM_CGTOOLTIP_SCRIPT_METHODS);
|
||||
}
|
||||
|
||||
int32_t CGTooltip::GetScriptMetaTable() {
|
||||
return CGTooltip::s_metatable;
|
||||
}
|
||||
|
||||
CGTooltip::CGTooltip(CSimpleFrame* parent)
|
||||
: CSimpleFrame(parent) {
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue