mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 03:02:30 +00:00
feat(glue): handle SetPreferredInfo script command
This commit is contained in:
parent
84c1fecfb2
commit
e0b6f361cc
3 changed files with 102 additions and 1 deletions
|
|
@ -1,4 +1,6 @@
|
|||
#include "ui/ScriptFunctions.hpp"
|
||||
#include "glue/CRealmList.hpp"
|
||||
#include "util/StringTo.hpp"
|
||||
#include "ui/Types.hpp"
|
||||
#include "util/Lua.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
|
@ -33,7 +35,17 @@ int32_t Script_GetRealmCategories(lua_State* L) {
|
|||
}
|
||||
|
||||
int32_t Script_SetPreferredInfo(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED();
|
||||
if (!lua_isnumber(L, 1)) {
|
||||
return luaL_error(L, "Usage: SetPreferredInfo(index, pvp, rp)");
|
||||
}
|
||||
|
||||
uint32_t index = lua_tonumber(L, 1);
|
||||
int32_t pvp = StringToBOOL(L, 2, 0);
|
||||
int32_t rp = StringToBOOL(L, 3, 0);
|
||||
|
||||
CRealmList::SetPreferredInfo(index, pvp, rp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t Script_SortRealms(lua_State* L) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue