mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 00:32:45 +03:00
feat(glue): implement Script_SetSelectedClass
This commit is contained in:
parent
6f97bf6d5d
commit
827706d49c
@ -266,7 +266,18 @@ int32_t Script_SetSelectedSex(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_SetSelectedClass(lua_State* L) {
|
int32_t Script_SetSelectedClass(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
if (!lua_isnumber(L, 1)) {
|
||||||
|
luaL_error(L, "Usage: SetSelectedClass(index)");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t classIndex = lua_tonumber(L, 1) - 1;
|
||||||
|
|
||||||
|
auto classRec = g_chrClassesDB.GetRecordByIndex(classIndex);
|
||||||
|
|
||||||
|
CCharacterCreation::SetSelectedClass(classRec ? classRec->GetID() : 0);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_UpdateCustomizationBackground(lua_State* L) {
|
int32_t Script_UpdateCustomizationBackground(lua_State* L) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user