mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-19 06:01:07 +03:00
Compare commits
No commits in common. "22eb04e495693941750903b2681dbe8bfeb7d62d" and "91a4afd976e41a8f707db5fdc7f0f7604095a9b1" have entirely different histories.
22eb04e495
...
91a4afd976
@ -98,21 +98,6 @@ enum TextureImageMode {
|
|||||||
ImageMode_Desaturate = 1
|
ImageMode_Desaturate = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
enum TOOLTIP_ANCHORPOINT {
|
|
||||||
TOOLTIP_ANCHOR_LEFT = 0,
|
|
||||||
TOOLTIP_ANCHOR_RIGHT = 1,
|
|
||||||
TOOLTIP_ANCHOR_BOTTOMLEFT = 2,
|
|
||||||
TOOLTIP_ANCHOR_BOTTOM = 3,
|
|
||||||
TOOLTIP_ANCHOR_BOTTOMRIGHT = 4,
|
|
||||||
TOOLTIP_ANCHOR_TOPLEFT = 5,
|
|
||||||
TOOLTIP_ANCHOR_TOP = 6,
|
|
||||||
TOOLTIP_ANCHOR_TOPRIGHT = 7,
|
|
||||||
TOOLTIP_ANCHOR_CURSOR = 8,
|
|
||||||
TOOLTIP_ANCHOR_NONE = 9,
|
|
||||||
TOOLTIP_ANCHOR_PRESERVE = 10,
|
|
||||||
TOOLTIP_ANCHOR_CURSOR_RIGHT = 11,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct FRAMEPRIORITY {
|
struct FRAMEPRIORITY {
|
||||||
CSimpleFrame* frame;
|
CSimpleFrame* frame;
|
||||||
uint32_t priority;
|
uint32_t priority;
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
#include "ui/game/BattlefieldInfoScript.hpp"
|
#include "ui/game/BattlefieldInfoScript.hpp"
|
||||||
#include "ui/game/CGBattlefieldInfo.hpp"
|
|
||||||
#include "ui/FrameScript.hpp"
|
#include "ui/FrameScript.hpp"
|
||||||
#include "util/Unimplemented.hpp"
|
#include "util/Unimplemented.hpp"
|
||||||
|
|
||||||
@ -106,9 +105,7 @@ int32_t Script_GetBattlefieldStatData(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_RequestBattlefieldPositions(lua_State* L) {
|
int32_t Script_RequestBattlefieldPositions(lua_State* L) {
|
||||||
CGBattlefieldInfo::RequestPlayerPositions();
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_GetNumBattlefieldPositions(lua_State* L) {
|
int32_t Script_GetNumBattlefieldPositions(lua_State* L) {
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
#include "ui/game/CGBattlefieldInfo.hpp"
|
|
||||||
|
|
||||||
void CGBattlefieldInfo::RequestPlayerPositions() {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
#ifndef UI_GAME_C_G_BATTLEFIELD_INFO_HPP
|
|
||||||
#define UI_GAME_C_G_BATTLEFIELD_INFO_HPP
|
|
||||||
|
|
||||||
class CGBattlefieldInfo {
|
|
||||||
public:
|
|
||||||
// Static functions
|
|
||||||
static void RequestPlayerPositions();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -35,10 +35,3 @@ CGTooltip::CGTooltip(CSimpleFrame* parent) : CSimpleFrame(parent) {
|
|||||||
int32_t CGTooltip::GetScriptMetaTable() {
|
int32_t CGTooltip::GetScriptMetaTable() {
|
||||||
return CGTooltip::s_metatable;
|
return CGTooltip::s_metatable;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CGTooltip::IsA(int32_t type) {
|
|
||||||
return type == CGTooltip::s_objectType
|
|
||||||
|| type == CSimpleFrame::s_objectType
|
|
||||||
|| type == CScriptRegion::s_objectType
|
|
||||||
|| type == CScriptObject::s_objectType;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -16,14 +16,9 @@ class CGTooltip : public CSimpleFrame {
|
|||||||
static void RegisterScriptMethods(lua_State* L);
|
static void RegisterScriptMethods(lua_State* L);
|
||||||
|
|
||||||
// Member variables
|
// Member variables
|
||||||
CSimpleFrame* m_owner = nullptr;
|
|
||||||
TOOLTIP_ANCHORPOINT m_anchorPoint;
|
|
||||||
// TODO
|
|
||||||
C2Vector m_offset;
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
// Virtual member functions
|
// Virtual member functions
|
||||||
virtual bool IsA(int32_t type);
|
|
||||||
virtual int32_t GetScriptMetaTable();
|
virtual int32_t GetScriptMetaTable();
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
#include "ui/game/CGTooltipScript.hpp"
|
#include "ui/game/CGTooltipScript.hpp"
|
||||||
#include "ui/game/CGTooltip.hpp"
|
|
||||||
#include "ui/FrameScript.hpp"
|
#include "ui/FrameScript.hpp"
|
||||||
#include "util/Lua.hpp"
|
|
||||||
#include "util/Unimplemented.hpp"
|
#include "util/Unimplemented.hpp"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -27,35 +25,7 @@ int32_t CGTooltip_GetPadding(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t CGTooltip_IsOwned(lua_State* L) {
|
int32_t CGTooltip_IsOwned(lua_State* L) {
|
||||||
auto type = CGTooltip::GetObjectType();
|
WHOA_UNIMPLEMENTED(0);
|
||||||
auto tooltip = static_cast<CGTooltip*>(FrameScript_GetObjectThis(L, type));
|
|
||||||
|
|
||||||
if (lua_type(L, 2) != LUA_TTABLE) {
|
|
||||||
luaL_error(L, "Usage: %s:IsOwned(frame)", tooltip->GetDisplayName());
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
lua_rawgeti(L, 2, 0);
|
|
||||||
auto frame = static_cast<CSimpleFrame*>(lua_touserdata(L, -1));
|
|
||||||
lua_settop(L, -2);
|
|
||||||
|
|
||||||
if (!frame) {
|
|
||||||
luaL_error(L, "%s:IsOwned(): Couldn't find 'this' in frame object", tooltip->GetDisplayName());
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!frame->IsA(CSimpleFrame::GetObjectType())) {
|
|
||||||
luaL_error(L, "%s:IsOwned(): Wrong object type, expected frame", tooltip->GetDisplayName());
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tooltip->m_owner == frame) {
|
|
||||||
lua_pushnumber(L, 1.0);
|
|
||||||
} else {
|
|
||||||
lua_pushnil(L);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CGTooltip_GetOwner(lua_State* L) {
|
int32_t CGTooltip_GetOwner(lua_State* L) {
|
||||||
|
|||||||
@ -218,22 +218,7 @@ int32_t CSimpleButton_SetFontString(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleButton_GetFontString(lua_State* L) {
|
int32_t CSimpleButton_GetFontString(lua_State* L) {
|
||||||
auto type = CSimpleButton::GetObjectType();
|
WHOA_UNIMPLEMENTED(0);
|
||||||
auto button = static_cast<CSimpleButton*>(FrameScript_GetObjectThis(L, type));
|
|
||||||
auto text = button->m_text;
|
|
||||||
|
|
||||||
if (!text) {
|
|
||||||
lua_pushnil(L);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!text->lua_registered) {
|
|
||||||
text->RegisterScriptObject(nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
lua_rawgeti(L, LUA_REGISTRYINDEX, text->lua_objectRef);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleButton_SetText(lua_State* L) {
|
int32_t CSimpleButton_SetText(lua_State* L) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user