mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-08 18:36:00 +03:00
Compare commits
No commits in common. "0a0c327c464f948e949c8616b89613e8e5a9131c" and "6f5d3662b6a140e9816043ff7b433778985db6f9" have entirely different histories.
0a0c327c46
...
6f5d3662b6
@ -493,9 +493,7 @@ static int32_t Script_ForceQuit(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int32_t Script_GetCursorMoney(lua_State* L) {
|
static int32_t Script_GetCursorMoney(lua_State* L) {
|
||||||
// TODO
|
WHOA_UNIMPLEMENTED(0);
|
||||||
lua_pushnumber(L, 0.0);
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t Script_DropCursorMoney(lua_State* L) {
|
static int32_t Script_DropCursorMoney(lua_State* L) {
|
||||||
|
|||||||
@ -93,9 +93,7 @@ static int32_t Script_ChangeActionBarPage(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int32_t Script_GetActionBarPage(lua_State* L) {
|
static int32_t Script_GetActionBarPage(lua_State* L) {
|
||||||
// TODO
|
WHOA_UNIMPLEMENTED(0);
|
||||||
lua_pushinteger(L, 1);
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t Script_GetActionBarToggles(lua_State* L) {
|
static int32_t Script_GetActionBarToggles(lua_State* L) {
|
||||||
|
|||||||
@ -250,9 +250,7 @@ static int32_t Script_UnitLevel(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int32_t Script_GetMoney(lua_State* L) {
|
static int32_t Script_GetMoney(lua_State* L) {
|
||||||
// TODO
|
WHOA_UNIMPLEMENTED(0);
|
||||||
lua_pushnumber(L, 10.0);
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t Script_GetHonorCurrency(lua_State* L) {
|
static int32_t Script_GetHonorCurrency(lua_State* L) {
|
||||||
|
|||||||
@ -41,15 +41,11 @@ static int32_t Script_CancelTradeAccept(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int32_t Script_GetPlayerTradeMoney(lua_State* L) {
|
static int32_t Script_GetPlayerTradeMoney(lua_State* L) {
|
||||||
// TODO
|
WHOA_UNIMPLEMENTED(0);
|
||||||
lua_pushnumber(L, 0.0);
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t Script_GetTargetTradeMoney(lua_State* L) {
|
static int32_t Script_GetTargetTradeMoney(lua_State* L) {
|
||||||
// TODO
|
WHOA_UNIMPLEMENTED(0);
|
||||||
lua_pushnumber(L, 0.0);
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t Script_PickupTradeMoney(lua_State* L) {
|
static int32_t Script_PickupTradeMoney(lua_State* L) {
|
||||||
|
|||||||
@ -1,14 +1,10 @@
|
|||||||
#include "ui/CSimpleFrameScript.hpp"
|
#include "ui/CSimpleFrameScript.hpp"
|
||||||
#include "ui/CSimpleFrame.hpp"
|
|
||||||
#include "ui/CSimpleTexture.hpp"
|
|
||||||
#include "gx/Coordinate.hpp"
|
#include "gx/Coordinate.hpp"
|
||||||
|
#include "ui/CSimpleFrame.hpp"
|
||||||
#include "ui/FrameScript.hpp"
|
#include "ui/FrameScript.hpp"
|
||||||
#include "ui/FrameXML.hpp"
|
|
||||||
#include "ui/CBackdropGenerator.hpp"
|
#include "ui/CBackdropGenerator.hpp"
|
||||||
#include "util/Lua.hpp"
|
#include "util/Lua.hpp"
|
||||||
#include "util/Unimplemented.hpp"
|
#include "util/Unimplemented.hpp"
|
||||||
#include "util/StringTo.hpp"
|
|
||||||
#include <bc/Memory.hpp>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
@ -23,57 +19,7 @@ int32_t CSimpleFrame_CreateTitleRegion(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleFrame_CreateTexture(lua_State* L) {
|
int32_t CSimpleFrame_CreateTexture(lua_State* L) {
|
||||||
int32_t type = CSimpleFrame::GetObjectType();
|
WHOA_UNIMPLEMENTED(0);
|
||||||
CSimpleFrame* frame = static_cast<CSimpleFrame*>(FrameScript_GetObjectThis(L, type));
|
|
||||||
|
|
||||||
const char* name = lua_isstring(L, 2) ? lua_tolstring(L, 2, nullptr) : nullptr;
|
|
||||||
|
|
||||||
int32_t drawLayer = 2;
|
|
||||||
if (lua_isstring(L, 3)) {
|
|
||||||
StringToDrawLayer(lua_tolstring(L, 3, nullptr), drawLayer);
|
|
||||||
}
|
|
||||||
|
|
||||||
XMLNode* frameNode = nullptr;
|
|
||||||
|
|
||||||
if (lua_type(L, 4) == LUA_TSTRING) {
|
|
||||||
const char* tainted;
|
|
||||||
bool locked;
|
|
||||||
|
|
||||||
const char* inheritName = lua_tolstring(L, 4, nullptr);
|
|
||||||
const char* frameName = frame->GetName();
|
|
||||||
if (!frameName) {
|
|
||||||
frameName = "<unnamed>";
|
|
||||||
}
|
|
||||||
|
|
||||||
frameNode = FrameXML_AcquireHashNode(inheritName, tainted, locked);
|
|
||||||
if (!frameNode) {
|
|
||||||
luaL_error(L, "%s:CreateTexture(): Couldn't find inherited node \"%s\"", frameName, inheritName);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (locked) {
|
|
||||||
luaL_error(L, "%s:CreateTexture(): Recursively inherited node \"%s\"", frameName, inheritName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
auto texture = NEW(CSimpleTexture, frame, drawLayer, 1);
|
|
||||||
if (name && *name) {
|
|
||||||
texture->SetName(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (frameNode) {
|
|
||||||
CStatus status;
|
|
||||||
texture->PostLoadXML(frameNode, &status);
|
|
||||||
FrameXML_ReleaseHashNode(lua_tolstring(L, 4, nullptr));
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
if (!texture->lua_registered) {
|
|
||||||
texture->RegisterScriptObject(nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
lua_rawgeti(L, LUA_REGISTRYINDEX, texture->lua_objectRef);
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleFrame_CreateFontString(lua_State* L) {
|
int32_t CSimpleFrame_CreateFontString(lua_State* L) {
|
||||||
|
|||||||
@ -418,15 +418,7 @@ int32_t FrameScript_ExecuteFile(const char* filePath, const char* a2, MD5_CTX* m
|
|||||||
MD5Update(md5, static_cast<unsigned char*>(fileBuffer), fileBytes);
|
MD5Update(md5, static_cast<unsigned char*>(fileBuffer), fileBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
char* cleanBuffer = static_cast<char*>(fileBuffer);
|
int32_t v10 = FrameScript_ExecuteBuffer(static_cast<char*>(fileBuffer), fileBytes, v11, status, a2);
|
||||||
|
|
||||||
// Skip UTF8 BOM
|
|
||||||
if (fileBytes >= 3 && memcmp(fileBuffer, "\xEF\xBB\xBF", 3) == 0) {
|
|
||||||
cleanBuffer += 3;
|
|
||||||
fileBytes -= 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t v10 = FrameScript_ExecuteBuffer(cleanBuffer, fileBytes, v11, status, a2);
|
|
||||||
|
|
||||||
SFile::Unload(fileBuffer);
|
SFile::Unload(fileBuffer);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user