mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-19 06:01:07 +03:00
Compare commits
16 Commits
4c1cd35899
...
35f0f47419
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35f0f47419 | ||
|
|
856bb72e1a | ||
|
|
3713a7ee89 | ||
|
|
98103db5ee | ||
|
|
d0621df975 | ||
|
|
fd31a10eaf | ||
|
|
78f2afb891 | ||
|
|
d9b6647c42 | ||
|
|
dc22db2f18 | ||
|
|
977a3051db | ||
|
|
c54dda367b | ||
|
|
35699af8d2 | ||
|
|
61484450b8 | ||
|
|
bc2dabeea9 | ||
|
|
6a4a2110f4 | ||
|
|
a82628adaa |
@ -160,6 +160,10 @@ ClientConnection* ClientServices::Connection() {
|
||||
return ClientServices::s_currentConnection;
|
||||
}
|
||||
|
||||
void ClientServices::CharacterDelete(uint64_t guid) {
|
||||
ClientServices::Connection()->RequestCharacterDelete(guid);
|
||||
}
|
||||
|
||||
void ClientServices::Disconnect() {
|
||||
ClientServices::Connection()->Disconnect();
|
||||
}
|
||||
|
||||
@ -33,6 +33,7 @@ class ClientServices : public LoginResponse {
|
||||
// Static functions
|
||||
static void ConnectToSelectedServer();
|
||||
static ClientConnection* Connection();
|
||||
static void CharacterDelete(uint64_t guid);
|
||||
static void Disconnect();
|
||||
static const char* GetCurrentLoginPortal();
|
||||
static const char* GetCurrentLoginServer();
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
#include "glue/CCharacterSelectionScript.hpp"
|
||||
#include "CGlueMgr.hpp"
|
||||
#include "db/Db.hpp"
|
||||
#include "glue/CCharacterSelection.hpp"
|
||||
#include "object/client/CGUnit_C.hpp"
|
||||
@ -157,7 +158,17 @@ int32_t Script_SelectCharacter(lua_State* L) {
|
||||
}
|
||||
|
||||
int32_t Script_DeleteCharacter(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
if (!lua_isnumber(L, 1)) {
|
||||
luaL_error(L, "Usage: DeleteCharacter(index)");
|
||||
}
|
||||
|
||||
int32_t index = static_cast<int32_t>(lua_tonumber(L, 1)) - 1;
|
||||
|
||||
if (index >= 0 && index < CCharacterSelection::s_characterList.Count()) {
|
||||
CGlueMgr::DeleteCharacter(CCharacterSelection::s_characterList.m_data[index].m_info.guid);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t Script_RenameCharacter(lua_State* L) {
|
||||
|
||||
@ -129,6 +129,17 @@ void CGlueMgr::ChangeRealm(const REALM_INFO* realmInfo) {
|
||||
ClientServices::Connection()->Connect();
|
||||
}
|
||||
|
||||
void CGlueMgr::DeleteCharacter(uint64_t guid) {
|
||||
if (guid) {
|
||||
CGlueMgr::SetIdleState(IDLE_DELETE_CHARACTER);
|
||||
|
||||
auto text = FrameScript_GetText(ClientServices::GetErrorToken(70), -1, GENDER_NOT_APPLICABLE);
|
||||
FrameScript_SignalEvent(OPEN_STATUS_DIALOG, "%s%s", "CANCEL", text);
|
||||
|
||||
ClientServices::CharacterDelete(guid);
|
||||
}
|
||||
}
|
||||
|
||||
void CGlueMgr::EnterWorld() {
|
||||
if (!ClientServices::GetSelectedRealm()) {
|
||||
return;
|
||||
|
||||
@ -66,6 +66,7 @@ class CGlueMgr {
|
||||
// Static functions
|
||||
static void CancelRealmListQuery();
|
||||
static void ChangeRealm(const REALM_INFO* realmInfo);
|
||||
static void DeleteCharacter(uint64_t guid);
|
||||
static void DisplayLoginStatus();
|
||||
static void EnterWorld();
|
||||
static void GetCharacterList();
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#include "net/connection/ClientConnection.hpp"
|
||||
#include "net/Login.hpp"
|
||||
#include "client/ClientServices.hpp"
|
||||
#include "common/datastore/CDataStore.hpp"
|
||||
#include "net/Login.hpp"
|
||||
#include "ui/FrameScript.hpp"
|
||||
|
||||
void ClientConnection::AccountLogin(const char* name, const char* password, int32_t region, WOW_LOCALE locale) {
|
||||
@ -160,3 +161,19 @@ int32_t ClientConnection::PollStatus(WOWCS_OPS& op, const char** msg, int32_t& r
|
||||
|
||||
return this->m_statusComplete;
|
||||
}
|
||||
|
||||
void ClientConnection::RequestCharacterDelete(uint64_t guid) {
|
||||
this->Initiate(COP_DELETE_CHARACTER, 70, nullptr);
|
||||
|
||||
if (this->IsConnected()) {
|
||||
CDataStore netMsg;
|
||||
netMsg.Put(static_cast<uint32_t>(CMSG_CHAR_DELETE));
|
||||
netMsg.Put(guid);
|
||||
netMsg.Finalize();
|
||||
|
||||
this->Send(&netMsg);
|
||||
}
|
||||
else {
|
||||
this->Cancel(4);
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,6 +43,7 @@ class ClientConnection : public RealmConnection {
|
||||
void Initiate(WOWCS_OPS op, int32_t errorCode, void (*cleanup)());
|
||||
int32_t IsConnected();
|
||||
int32_t PollStatus(WOWCS_OPS& op, const char** msg, int32_t& result, int32_t& errorCode);
|
||||
void RequestCharacterDelete(uint64_t guid);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@ -35,6 +35,33 @@ const char* FrameScript_Object::GetDisplayName() {
|
||||
return name ? name : "<unnamed>";
|
||||
}
|
||||
|
||||
int32_t FrameScript_Object::GetScript(lua_State* L) {
|
||||
if (!lua_isstring(L, 2)) {
|
||||
luaL_error(L, "Usage: %s:GetScript(\"type\")", this->GetDisplayName());
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto name = lua_tostring(L, 2);
|
||||
ScriptData data;
|
||||
|
||||
auto script = this->GetScriptByName(name, data);
|
||||
|
||||
if (!script) {
|
||||
luaL_error(L, "%s doesn't have a \"%s\" script", this->GetDisplayName(), lua_tostring(L, 2));
|
||||
return 0;
|
||||
}
|
||||
|
||||
// TODO taint management
|
||||
|
||||
if (script->luaRef > 0) {
|
||||
lua_rawgeti(L, LUA_REGISTRYINDEX, script->luaRef);
|
||||
} else {
|
||||
lua_pushnil(L);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
FrameScript_Object::ScriptIx* FrameScript_Object::GetScriptByName(const char* name, FrameScript_Object::ScriptData& data) {
|
||||
if (!SStrCmpI(name, "OnEvent", STORM_MAX_STR)) {
|
||||
data.wrapper = "return function(self,event,...) %s end";
|
||||
|
||||
@ -43,6 +43,7 @@ class FrameScript_Object {
|
||||
|
||||
// Member functions
|
||||
const char* GetDisplayName();
|
||||
int32_t GetScript(lua_State* L);
|
||||
int32_t RegisterScriptEvent(const char* name);
|
||||
void RegisterScriptObject(const char* name);
|
||||
void RunScript(ScriptIx const& script, int32_t argCount, const char* a4);
|
||||
|
||||
@ -188,7 +188,10 @@ int32_t CSimpleFrame_HasScript(lua_State* L) {
|
||||
}
|
||||
|
||||
int32_t CSimpleFrame_GetScript(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
auto type = CSimpleFrame::GetObjectType();
|
||||
auto frame = static_cast<CSimpleFrame*>(FrameScript_GetObjectThis(L, type));
|
||||
|
||||
return frame->GetScript(L);
|
||||
}
|
||||
|
||||
int32_t CSimpleFrame_SetScript(lua_State* L) {
|
||||
|
||||
@ -1,5 +1,11 @@
|
||||
#include "ui/simple/CSimpleStatusBar.hpp"
|
||||
#include "ui/LoadXML.hpp"
|
||||
#include "ui/simple/CSimpleStatusBarScript.hpp"
|
||||
#include "ui/simple/CSimpleTexture.hpp"
|
||||
#include "util/CStatus.hpp"
|
||||
#include "util/Lua.hpp"
|
||||
#include "util/StringTo.hpp"
|
||||
#include <common/XML.hpp>
|
||||
|
||||
int32_t CSimpleStatusBar::s_metatable;
|
||||
int32_t CSimpleStatusBar::s_objectType;
|
||||
@ -22,10 +28,210 @@ void CSimpleStatusBar::RegisterScriptMethods(lua_State* L) {
|
||||
FrameScript_Object::FillScriptMethodTable(L, SimpleStatusBarMethods, NUM_SIMPLE_STATUS_BAR_SCRIPT_METHODS);
|
||||
}
|
||||
|
||||
CSimpleStatusBar::CSimpleStatusBar(CSimpleFrame* parent) : CSimpleFrame(parent) {
|
||||
// TODO
|
||||
FrameScript_Object::ScriptIx* CSimpleStatusBar::GetScriptByName(const char* name, ScriptData& data) {
|
||||
auto script = this->CSimpleFrame::GetScriptByName(name, data);
|
||||
|
||||
if (script) {
|
||||
return script;
|
||||
}
|
||||
|
||||
if (!SStrCmpI(name, "OnValueChanged")) {
|
||||
script = &this->m_onValueChanged;
|
||||
data.wrapper = "return function(self,value) %s end";
|
||||
} else if (!SStrCmpI(name, "OnMinMaxChanged")) {
|
||||
script = &this->m_onMinMaxChanged;
|
||||
data.wrapper = "return function(self,min,max) %s end";
|
||||
}
|
||||
|
||||
return script;
|
||||
}
|
||||
|
||||
int32_t CSimpleStatusBar::GetScriptMetaTable() {
|
||||
return CSimpleStatusBar::s_metatable;
|
||||
}
|
||||
|
||||
float CSimpleStatusBar::GetMaxValue() const {
|
||||
return this->m_maxValue;
|
||||
}
|
||||
|
||||
float CSimpleStatusBar::GetMinValue() const {
|
||||
return this->m_minValue;
|
||||
}
|
||||
|
||||
float CSimpleStatusBar::GetValue() const {
|
||||
return this->m_value;
|
||||
}
|
||||
|
||||
bool CSimpleStatusBar::IsA(int32_t type) {
|
||||
return type == CSimpleStatusBar::s_objectType
|
||||
|| type == CSimpleFrame::s_objectType
|
||||
|| type == CScriptRegion::s_objectType
|
||||
|| type == CScriptObject::s_objectType;
|
||||
}
|
||||
|
||||
void CSimpleStatusBar::LoadXML(const XMLNode* node, CStatus* status) {
|
||||
this->CSimpleFrame::LoadXML(node, status);
|
||||
|
||||
int32_t drawlayer = DRAWLAYER_ARTWORK;
|
||||
auto drawlayerAttr = node->GetAttributeByName("drawLayer");
|
||||
if (drawlayerAttr && *drawlayerAttr) {
|
||||
StringToDrawLayer(drawlayerAttr, drawlayer);
|
||||
}
|
||||
|
||||
for (auto child = node->GetChild(); child; child = child->GetSibling()) {
|
||||
if (!SStrCmpI(child->GetName(), "BarTexture")) {
|
||||
auto texture = LoadXML_Texture(child, this, status);
|
||||
this->SetBarTexture(texture, drawlayer);
|
||||
} else if (!SStrCmpI(child->GetName(), "BarColor")) {
|
||||
CImVector color = {};
|
||||
LoadXML_Color(child, color);
|
||||
this->SetStatusBarColor(color);
|
||||
}
|
||||
}
|
||||
|
||||
auto minValueAttr = node->GetAttributeByName("minValue");
|
||||
if (minValueAttr && *minValueAttr) {
|
||||
auto maxValueAttr = node->GetAttributeByName("maxValue");
|
||||
if (maxValueAttr && *maxValueAttr) {
|
||||
auto minValue = SStrToFloat(minValueAttr);
|
||||
auto maxValue = SStrToFloat(maxValueAttr);
|
||||
|
||||
if (minValue < -1.0e12 || minValue > 1.0e12 || maxValue < -1.0e12 || maxValue > 1.0e12) {
|
||||
status->Add(STATUS_ERROR, "Frame %s: Min or Max out of range", this->GetDisplayName());
|
||||
} else if (maxValue - minValue > 1.0e12) {
|
||||
status->Add(STATUS_ERROR, "Frame %s: Min and Max too far apart", this->GetDisplayName());
|
||||
} else {
|
||||
this->SetMinMaxValues(minValue, maxValue);
|
||||
}
|
||||
|
||||
auto defaultValueAttr = node->GetAttributeByName("defaultValue");
|
||||
if (defaultValueAttr && *defaultValueAttr) {
|
||||
auto defaultValue = SStrToFloat(defaultValueAttr);
|
||||
this->SetValue(defaultValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto orientationAttr = node->GetAttributeByName("orientation");
|
||||
if (orientationAttr && *orientationAttr) {
|
||||
ORIENTATION orientation;
|
||||
if (StringToOrientation(orientationAttr, orientation)) {
|
||||
this->SetOrientation(orientation);
|
||||
} else {
|
||||
status->Add(STATUS_WARNING, "Frame %s: Unknown orientation %s in element %s", this->GetDisplayName(), orientationAttr, node->GetName());
|
||||
}
|
||||
}
|
||||
|
||||
auto rotatesTextureAttr = node->GetAttributeByName("rotatesTexture");
|
||||
if (rotatesTextureAttr && *rotatesTextureAttr) {
|
||||
auto rotatesTexture = StringToBOOL(rotatesTextureAttr);
|
||||
this->SetRotatesTexture(rotatesTexture);
|
||||
}
|
||||
}
|
||||
|
||||
void CSimpleStatusBar::RunOnMinMaxChangedScript() {
|
||||
if (!this->m_onMinMaxChanged.luaRef) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto L = FrameScript_GetContext();
|
||||
|
||||
lua_pushnumber(L, this->m_minValue);
|
||||
lua_pushnumber(L, this->m_maxValue);
|
||||
|
||||
this->RunScript(this->m_onMinMaxChanged, 2, nullptr);
|
||||
}
|
||||
|
||||
void CSimpleStatusBar::RunOnValueChangedScript() {
|
||||
if (!this->m_onValueChanged.luaRef) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto L = FrameScript_GetContext();
|
||||
|
||||
lua_pushnumber(L, this->m_value);
|
||||
|
||||
this->RunScript(this->m_onValueChanged, 1, nullptr);
|
||||
}
|
||||
|
||||
void CSimpleStatusBar::SetBarTexture(CSimpleTexture* texture, int32_t drawlayer) {
|
||||
// No change
|
||||
if (this->m_barTexture == texture) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->m_barTexture) {
|
||||
delete this->m_barTexture;
|
||||
}
|
||||
|
||||
if (texture) {
|
||||
texture->SetFrame(this, drawlayer, true);
|
||||
|
||||
texture->SetPoint(FRAMEPOINT_BOTTOMLEFT, this, FRAMEPOINT_BOTTOMLEFT, 0.0f, 0.0f, true);
|
||||
texture->SetPoint(FRAMEPOINT_BOTTOMRIGHT, this, FRAMEPOINT_BOTTOMRIGHT, 0.0f, 0.0f, true);
|
||||
texture->SetPoint(FRAMEPOINT_TOPLEFT, this, FRAMEPOINT_TOPLEFT, 0.0f, 0.0f, true);
|
||||
texture->SetPoint(FRAMEPOINT_TOPRIGHT, this, FRAMEPOINT_TOPRIGHT, 0.0f, 0.0f, true);
|
||||
}
|
||||
|
||||
this->m_barTexture = texture;
|
||||
|
||||
this->m_changed = true;
|
||||
}
|
||||
|
||||
void CSimpleStatusBar::SetMinMaxValues(float min, float max) {
|
||||
if (min > max) {
|
||||
min = max;
|
||||
}
|
||||
|
||||
// No change
|
||||
if (this->m_rangeSet && this->m_minValue == min && this->m_maxValue == max) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->m_minValue = min;
|
||||
this->m_maxValue = max;
|
||||
|
||||
this->m_changed = true;
|
||||
this->m_rangeSet = true;
|
||||
|
||||
this->RunOnMinMaxChangedScript();
|
||||
|
||||
if (this->m_valueSet) {
|
||||
this->SetValue(this->m_value);
|
||||
}
|
||||
}
|
||||
|
||||
void CSimpleStatusBar::SetOrientation(ORIENTATION orientation) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CSimpleStatusBar::SetRotatesTexture(int32_t enabled) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CSimpleStatusBar::SetStatusBarColor(const CImVector& color) {
|
||||
if (this->m_barTexture) {
|
||||
this->m_barTexture->SetVertexColor(color);
|
||||
}
|
||||
}
|
||||
|
||||
void CSimpleStatusBar::SetValue(float value) {
|
||||
if (!this->m_rangeSet) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clamp value
|
||||
value = std::min(std::max(value, this->m_minValue), this->m_maxValue);
|
||||
|
||||
// No change
|
||||
if (this->m_valueSet && this->m_value == value) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->m_value = value;
|
||||
|
||||
this->m_changed = true;
|
||||
this->m_valueSet = true;
|
||||
|
||||
this->RunOnValueChangedScript();
|
||||
}
|
||||
|
||||
@ -5,23 +5,52 @@
|
||||
|
||||
class CSimpleStatusBar : public CSimpleFrame {
|
||||
public:
|
||||
// Static variables
|
||||
// Public static variables
|
||||
static int32_t s_metatable;
|
||||
static int32_t s_objectType;
|
||||
|
||||
// Static functions
|
||||
// Public static functions
|
||||
static void CreateScriptMetaTable();
|
||||
static int32_t GetObjectType();
|
||||
static void RegisterScriptMethods(lua_State* L);
|
||||
|
||||
// Member variables
|
||||
// TODO
|
||||
|
||||
// Virtual member functions
|
||||
// Public virtual member functions
|
||||
virtual int32_t GetScriptMetaTable();
|
||||
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
||||
virtual bool IsA(int32_t type);
|
||||
// TODO
|
||||
virtual void SetValue(float value);
|
||||
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||
|
||||
// Member functions
|
||||
CSimpleStatusBar(CSimpleFrame* parent);
|
||||
// Public member functions
|
||||
CSimpleStatusBar(CSimpleFrame* parent)
|
||||
: CSimpleFrame(parent)
|
||||
, m_changed(false)
|
||||
, m_rangeSet(false)
|
||||
, m_valueSet(false) {};
|
||||
float GetMaxValue() const;
|
||||
float GetMinValue() const;
|
||||
float GetValue() const;
|
||||
void RunOnMinMaxChangedScript();
|
||||
void RunOnValueChangedScript();
|
||||
void SetBarTexture(CSimpleTexture* texture, int32_t drawlayer);
|
||||
void SetMinMaxValues(float min, float max);
|
||||
void SetOrientation(ORIENTATION orientation);
|
||||
void SetRotatesTexture(int32_t enabled);
|
||||
void SetStatusBarColor(const CImVector& color);
|
||||
|
||||
protected:
|
||||
// Protected member variables
|
||||
uint32_t m_changed : 1;
|
||||
uint32_t m_rangeSet : 1;
|
||||
uint32_t m_valueSet : 1;
|
||||
float m_minValue = 0.0f;
|
||||
float m_maxValue = 0.0f;
|
||||
float m_value = 0.0f;
|
||||
CSimpleTexture* m_barTexture = nullptr;
|
||||
ORIENTATION m_orientation = ORIENTATION_HORIZONTAL;
|
||||
ScriptIx m_onValueChanged;
|
||||
ScriptIx m_onMinMaxChanged;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
#include "ui/simple/CSimpleStatusBarScript.hpp"
|
||||
#include "ui/simple/CSimpleStatusBar.hpp"
|
||||
#include "ui/FrameScript.hpp"
|
||||
#include "util/Lua.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
namespace {
|
||||
@ -13,19 +15,65 @@ int32_t CSimpleStatusBar_SetOrientation(lua_State* L) {
|
||||
}
|
||||
|
||||
int32_t CSimpleStatusBar_GetMinMaxValues(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
auto type = CSimpleStatusBar::GetObjectType();
|
||||
auto statusBar = static_cast<CSimpleStatusBar*>(FrameScript_GetObjectThis(L, type));
|
||||
|
||||
lua_pushnumber(L, statusBar->GetMinValue());
|
||||
lua_pushnumber(L, statusBar->GetMaxValue());
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
int32_t CSimpleStatusBar_SetMinMaxValues(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
auto type = CSimpleStatusBar::GetObjectType();
|
||||
auto statusBar = static_cast<CSimpleStatusBar*>(FrameScript_GetObjectThis(L, type));
|
||||
|
||||
if (!lua_isnumber(L, 2) || !lua_isnumber(L, 3)) {
|
||||
luaL_error(L, "Usage: %s:SetMinMaxValues(min, max)", statusBar->GetDisplayName());
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto min = lua_tonumber(L, 2);
|
||||
auto max = lua_tonumber(L, 3);
|
||||
|
||||
if (min < -1.0e12 || min > 1.0e12 || max < -1.0e12 || max > 1.0e12) {
|
||||
luaL_error(L, "Min or Max out of range");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (max - min > 1.0e12) {
|
||||
luaL_error(L, "Min and Max too far apart");
|
||||
return 0;
|
||||
}
|
||||
|
||||
statusBar->SetMinMaxValues(static_cast<float>(min), static_cast<float>(max));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t CSimpleStatusBar_GetValue(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
auto type = CSimpleStatusBar::GetObjectType();
|
||||
auto statusBar = static_cast<CSimpleStatusBar*>(FrameScript_GetObjectThis(L, type));
|
||||
|
||||
lua_pushnumber(L, statusBar->GetValue());
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t CSimpleStatusBar_SetValue(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
auto type = CSimpleStatusBar::GetObjectType();
|
||||
auto statusBar = static_cast<CSimpleStatusBar*>(FrameScript_GetObjectThis(L, type));
|
||||
|
||||
if (!lua_isnumber(L, 2)) {
|
||||
luaL_error(L, "Usage: %s:SetValue(value)", statusBar->GetDisplayName());
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto value = static_cast<float>(lua_tonumber(L, 2));
|
||||
|
||||
statusBar->SetValue(value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t CSimpleStatusBar_GetStatusBarTexture(lua_State* L) {
|
||||
@ -41,7 +89,15 @@ int32_t CSimpleStatusBar_GetStatusBarColor(lua_State* L) {
|
||||
}
|
||||
|
||||
int32_t CSimpleStatusBar_SetStatusBarColor(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
auto type = CSimpleStatusBar::GetObjectType();
|
||||
auto statusBar = static_cast<CSimpleStatusBar*>(FrameScript_GetObjectThis(L, type));
|
||||
|
||||
CImVector color = {};
|
||||
FrameScript_GetColor(L, 2, color);
|
||||
|
||||
statusBar->SetStatusBarColor(color);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t CSimpleStatusBar_GetRotatesTexture(lua_State* L) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user