feat(ui): implement Script_SelectCharacter

This commit is contained in:
fallenoak committed 2025-10-05 19:43:42 -05:00
1 parent cf219c37ca
commit 6c9d15d6f7
3 files changed
+21 -1

No files matched your search

+16 -1
View File
@@ -51,7 +51,22 @@ int32_t Script_GetCharacterInfo(lua_State* L) {
}
int32_t Script_SelectCharacter(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
if (!lua_isnumber(L, 1)) {
return luaL_error(L, "Usage: SelectCharacter(index)");
}
int32_t index = static_cast<int32_t>(lua_tonumber(L, 1)) - 1;
if (index < 0 || index >= CCharacterSelection::s_characterList.Count()) {
index = 0;
}
CCharacterSelection::s_selectionIndex = index;
CCharacterSelection::ShowCharacter();
FrameScript_SignalEvent(8, "%d", CCharacterSelection::s_selectionIndex + 1);
return 0;
}
int32_t Script_DeleteCharacter(lua_State* L) {