mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 03:02:30 +00:00
feat(ui): handle CSimpleButton_GetButtonState script function
This commit is contained in:
parent
a3b285497a
commit
dd322572c7
3 changed files with 23 additions and 1 deletions
|
|
@ -75,7 +75,24 @@ int32_t CSimpleButton_IsEnabled(lua_State* L) {
|
|||
}
|
||||
|
||||
int32_t CSimpleButton_GetButtonState(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED();
|
||||
auto type = CSimpleButton::GetObjectType();
|
||||
auto button = static_cast<CSimpleButton*>(FrameScript_GetObjectThis(L, type));
|
||||
|
||||
auto buttonState = button->GetButtonState();
|
||||
|
||||
if (buttonState == BUTTONSTATE_DISABLED) {
|
||||
lua_pushstring(L, "DISABLED");
|
||||
return 1;
|
||||
} else if (buttonState == BUTTONSTATE_PUSHED) {
|
||||
lua_pushstring(L, "PUSHED");
|
||||
return 1;
|
||||
} else if (buttonState == BUTTONSTATE_NORMAL) {
|
||||
lua_pushstring(L, "NORMAL");
|
||||
return 1;
|
||||
}
|
||||
|
||||
lua_pushstring(L, "UNKNOWN");
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t CSimpleButton_SetButtonState(lua_State* L) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue