mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 19:22:30 +00:00
feat(ui): implement CScriptRegion LUA methods
This commit is contained in:
parent
8c442f5a82
commit
d63ebf7696
11 changed files with 208 additions and 30 deletions
|
|
@ -16,7 +16,7 @@ void CGCharacterModelBase::CreateScriptMetaTable() {
|
|||
}
|
||||
|
||||
void CGCharacterModelBase::RegisterScriptMethods(lua_State* L) {
|
||||
CSimpleFrame::RegisterScriptMethods(L);
|
||||
CSimpleModel::RegisterScriptMethods(L);
|
||||
FrameScript_Object::FillScriptMethodTable(L, CGCharacterModelBaseMethods, NUM_CGCHARACTER_MODEL_BASE_SCRIPT_METHODS);
|
||||
}
|
||||
|
||||
|
|
@ -24,6 +24,5 @@ int32_t CGCharacterModelBase::GetScriptMetaTable() {
|
|||
return CGCharacterModelBase::s_metatable;
|
||||
}
|
||||
|
||||
CGCharacterModelBase::CGCharacterModelBase(CSimpleFrame* parent)
|
||||
: CSimpleFrame(parent) {
|
||||
CGCharacterModelBase::CGCharacterModelBase(CSimpleFrame* parent) : CSimpleModel(parent) {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
#ifndef GAME_UI_CGCHARACTER_MODEL_BASE_HPP
|
||||
#define GAME_UI_CGCHARACTER_MODEL_BASE_HPP
|
||||
|
||||
#include "ui/CSimpleFrame.hpp"
|
||||
#include "ui/CSimpleModel.hpp"
|
||||
#include "ui/CSimpleTop.hpp"
|
||||
|
||||
class CGCharacterModelBase : public CSimpleFrame {
|
||||
class CGCharacterModelBase : public CSimpleModel {
|
||||
public:
|
||||
// Static variables
|
||||
static int32_t s_metatable;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
// External from "ui/ScriptFunctions.hpp"
|
||||
void RegisterSimpleFrameScriptMethods();
|
||||
int32_t Script_GetScreenWidth(lua_State* L);
|
||||
int32_t Script_GetScreenHeight(lua_State* L);
|
||||
|
||||
|
||||
static int32_t Script_FrameXML_Debug(lua_State* L) {
|
||||
|
|
@ -580,14 +582,6 @@ static int32_t Script_ArenaTeamDisband(lua_State* L) {
|
|||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
static int32_t Script_GetScreenWidth(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
static int32_t Script_GetScreenHeight(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
static int32_t Script_GetDamageBonusStat(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,10 @@ static int32_t Script_BNGetInfo(lua_State* L) {
|
|||
}
|
||||
|
||||
static int32_t Script_BNGetNumFriends(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
// TODO
|
||||
lua_pushnumber(L, 0.0);
|
||||
lua_pushnumber(L, 0.0);
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int32_t Script_BNGetFriendInfo(lua_State* L) {
|
||||
|
|
@ -49,7 +52,9 @@ static int32_t Script_BNGetSelectedFriend(lua_State* L) {
|
|||
}
|
||||
|
||||
static int32_t Script_BNGetNumFriendInvites(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
// TODO
|
||||
lua_pushnumber(L, 0.0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int32_t Script_BNGetFriendInviteInfo(lua_State* L) {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@ static int32_t Script_ContainerIDToInventoryID(lua_State* L) {
|
|||
}
|
||||
|
||||
static int32_t Script_GetContainerNumSlots(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
// TODO
|
||||
lua_pushnumber(L, 16.0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int32_t Script_GetContainerItemInfo(lua_State* L) {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,10 @@
|
|||
|
||||
|
||||
static int32_t Script_GetNumFriends(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
// TODO
|
||||
lua_pushnumber(L, 10.0);
|
||||
lua_pushnumber(L, 0.0);
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int32_t Script_GetFriendInfo(lua_State* L) {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@
|
|||
|
||||
|
||||
static int32_t Script_GetNumTrackingTypes(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
// TODO
|
||||
lua_pushnumber(L, 0.0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int32_t Script_GetTrackingInfo(lua_State* L) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#include "ui/FrameScript.hpp"
|
||||
#include "util/Lua.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
#include "client/ClientServices.hpp"
|
||||
#include <common/Time.hpp>
|
||||
|
||||
static int32_t Script_GetTime(lua_State* L) {
|
||||
|
|
@ -33,7 +34,8 @@ static int32_t Script_AppendToFile(lua_State* L) {
|
|||
}
|
||||
|
||||
static int32_t Script_GetAccountExpansionLevel(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
lua_pushnumber(L, ClientServices::GetExpansionLevel());
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int32_t Script_UnitExists(lua_State* L) {
|
||||
|
|
@ -245,7 +247,7 @@ static int32_t Script_UnitSex(lua_State* L) {
|
|||
|
||||
static int32_t Script_UnitLevel(lua_State* L) {
|
||||
// TODO
|
||||
lua_pushnumber(L, 1.0);
|
||||
lua_pushnumber(L, 25.0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue