mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 16:52:45 +03:00
Compare commits
8 Commits
61b05eb366
...
c4077daa3f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c4077daa3f | ||
|
|
b9f2c60966 | ||
|
|
5f7bf8c95c | ||
|
|
7d9173b880 | ||
|
|
98ea309985 | ||
|
|
ba5006a4d8 | ||
|
|
e872450202 | ||
|
|
bc1d7cbd66 |
@ -522,36 +522,6 @@ int32_t Script_IsScanDLLFinished(lua_State* L) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_IsWindowsClient(lua_State* L) {
|
|
||||||
#if defined(WHOA_SYSTEM_WIN)
|
|
||||||
lua_pushnumber(L, 1.0);
|
|
||||||
#else
|
|
||||||
lua_pushnil(L);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_IsMacClient(lua_State* L) {
|
|
||||||
#if defined(WHOA_SYSTEM_MAC)
|
|
||||||
lua_pushnumber(L, 1.0);
|
|
||||||
#else
|
|
||||||
lua_pushnil(L);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_IsLinuxClient(lua_State* L) {
|
|
||||||
#if defined(WHOA_SYSTEM_LINUX)
|
|
||||||
lua_pushnumber(L, 1.0);
|
|
||||||
#else
|
|
||||||
lua_pushnil(L);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_SetRealmSplitState(lua_State* L) {
|
int32_t Script_SetRealmSplitState(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
WHOA_UNIMPLEMENTED(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,3 +6,33 @@
|
|||||||
int32_t Script_GetAccountExpansionLevel(lua_State* L) {
|
int32_t Script_GetAccountExpansionLevel(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
WHOA_UNIMPLEMENTED(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t Script_IsLinuxClient(lua_State* L) {
|
||||||
|
#if defined(WHOA_SYSTEM_LINUX)
|
||||||
|
lua_pushnumber(L, 1.0);
|
||||||
|
#else
|
||||||
|
lua_pushnil(L);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_IsMacClient(lua_State* L) {
|
||||||
|
#if defined(WHOA_SYSTEM_MAC)
|
||||||
|
lua_pushnumber(L, 1.0);
|
||||||
|
#else
|
||||||
|
lua_pushnil(L);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_IsWindowsClient(lua_State* L) {
|
||||||
|
#if defined(WHOA_SYSTEM_WIN)
|
||||||
|
lua_pushnumber(L, 1.0);
|
||||||
|
#else
|
||||||
|
lua_pushnil(L);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|||||||
@ -6,4 +6,10 @@
|
|||||||
|
|
||||||
int32_t Script_GetAccountExpansionLevel(lua_State* L);
|
int32_t Script_GetAccountExpansionLevel(lua_State* L);
|
||||||
|
|
||||||
|
int32_t Script_IsLinuxClient(lua_State* L);
|
||||||
|
|
||||||
|
int32_t Script_IsMacClient(lua_State* L);
|
||||||
|
|
||||||
|
int32_t Script_IsWindowsClient(lua_State* L);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
#include "ui/Key.hpp"
|
#include "ui/Key.hpp"
|
||||||
#include "ui/game/CGWorldFrame.hpp"
|
#include "ui/game/CGWorldFrame.hpp"
|
||||||
#include "ui/game/GMTicketInfoScript.hpp"
|
#include "ui/game/GMTicketInfoScript.hpp"
|
||||||
|
#include "ui/game/GameScript.hpp"
|
||||||
#include "ui/game/ScriptEvents.hpp"
|
#include "ui/game/ScriptEvents.hpp"
|
||||||
#include "ui/simple/CSimpleTop.hpp"
|
#include "ui/simple/CSimpleTop.hpp"
|
||||||
#include "util/CStatus.hpp"
|
#include "util/CStatus.hpp"
|
||||||
@ -14,6 +15,10 @@ CSimpleTop* CGGameUI::s_simpleTop;
|
|||||||
void LoadScriptFunctions() {
|
void LoadScriptFunctions() {
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
GameScriptRegisterFunctions();
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
ScriptEventsRegisterFunctions();
|
ScriptEventsRegisterFunctions();
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|||||||
1590
src/ui/game/GameScript.cpp
Normal file
1590
src/ui/game/GameScript.cpp
Normal file
File diff suppressed because it is too large
Load Diff
6
src/ui/game/GameScript.hpp
Normal file
6
src/ui/game/GameScript.hpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#ifndef UI_GAME_GAME_SCRIPT_HPP
|
||||||
|
#define UI_GAME_GAME_SCRIPT_HPP
|
||||||
|
|
||||||
|
void GameScriptRegisterFunctions();
|
||||||
|
|
||||||
|
#endif
|
||||||
@ -73,7 +73,16 @@ int32_t CSimpleFontString_Hide(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleFontString_IsVisible(lua_State* L) {
|
int32_t CSimpleFontString_IsVisible(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
auto type = CSimpleFontString::GetObjectType();
|
||||||
|
auto string = static_cast<CSimpleFontString*>(FrameScript_GetObjectThis(L, type));
|
||||||
|
|
||||||
|
if (string->IsVisible()) {
|
||||||
|
lua_pushnumber(L, 1.0);
|
||||||
|
} else {
|
||||||
|
lua_pushnil(L);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleFontString_IsShown(lua_State* L) {
|
int32_t CSimpleFontString_IsShown(lua_State* L) {
|
||||||
|
|||||||
@ -100,6 +100,18 @@ void CSimpleFrame::DisableDrawLayer(uint32_t drawlayer) {
|
|||||||
this->NotifyDrawLayerChanged(drawlayer);
|
this->NotifyDrawLayerChanged(drawlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSimpleFrame::DisableEvent(CSimpleEventType eventType) {
|
||||||
|
if (!(this->m_eventmask & (1 << eventType))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->m_visible) {
|
||||||
|
this->m_top->UnregisterForEvent(this, eventType, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
this->m_eventmask &= ~(1 << eventType);
|
||||||
|
}
|
||||||
|
|
||||||
void CSimpleFrame::EnableDrawLayer(uint32_t drawlayer) {
|
void CSimpleFrame::EnableDrawLayer(uint32_t drawlayer) {
|
||||||
this->m_drawenabled[drawlayer] = 1;
|
this->m_drawenabled[drawlayer] = 1;
|
||||||
this->NotifyDrawLayerChanged(drawlayer);
|
this->NotifyDrawLayerChanged(drawlayer);
|
||||||
@ -1342,7 +1354,7 @@ void CSimpleFrame::SetBeingScrolled(int32_t a2, int32_t a3) {
|
|||||||
this->m_batchDirty |= 0x1F;
|
this->m_batchDirty |= 0x1F;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto child = this->m_children.Head(); child; this->m_children.Link(child)->Next()) {
|
for (auto child = this->m_children.Head(); child; child = this->m_children.Link(child)->Next()) {
|
||||||
if (!(child->frame->m_flags & 0x4000)) {
|
if (!(child->frame->m_flags & 0x4000)) {
|
||||||
child->frame->SetBeingScrolled(a2, -1);
|
child->frame->SetBeingScrolled(a2, -1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -123,6 +123,7 @@ class CSimpleFrame : public CScriptRegion {
|
|||||||
CSimpleFrame(CSimpleFrame* parent);
|
CSimpleFrame(CSimpleFrame* parent);
|
||||||
void AddFrameRegion(CSimpleRegion* region, uint32_t drawlayer);
|
void AddFrameRegion(CSimpleRegion* region, uint32_t drawlayer);
|
||||||
void DisableDrawLayer(uint32_t drawlayer);
|
void DisableDrawLayer(uint32_t drawlayer);
|
||||||
|
void DisableEvent(CSimpleEventType eventType);
|
||||||
void EnableDrawLayer(uint32_t drawlayer);
|
void EnableDrawLayer(uint32_t drawlayer);
|
||||||
void EnableEvent(CSimpleEventType eventType, int32_t priority);
|
void EnableEvent(CSimpleEventType eventType, int32_t priority);
|
||||||
int32_t GetHitRect(CRect& rect);
|
int32_t GetHitRect(CRect& rect);
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
#include "ui/FrameScript.hpp"
|
#include "ui/FrameScript.hpp"
|
||||||
#include "ui/simple/CSimpleFrame.hpp"
|
#include "ui/simple/CSimpleFrame.hpp"
|
||||||
#include "util/Lua.hpp"
|
#include "util/Lua.hpp"
|
||||||
|
#include "util/StringTo.hpp"
|
||||||
#include "util/Unimplemented.hpp"
|
#include "util/Unimplemented.hpp"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -459,7 +460,22 @@ int32_t CSimpleFrame_IsKeyboardEnabled(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleFrame_EnableMouse(lua_State* L) {
|
int32_t CSimpleFrame_EnableMouse(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
auto type = CSimpleFrame::GetObjectType();
|
||||||
|
auto frame = static_cast<CSimpleFrame*>(FrameScript_GetObjectThis(L, type));
|
||||||
|
|
||||||
|
if (!frame->ProtectedFunctionsAllowed()) {
|
||||||
|
// TODO disallowed logic
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringToBOOL(L, 2, 1)) {
|
||||||
|
frame->EnableEvent(SIMPLE_EVENT_MOUSE, -1);
|
||||||
|
} else {
|
||||||
|
frame->DisableEvent(SIMPLE_EVENT_MOUSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleFrame_IsMouseEnabled(lua_State* L) {
|
int32_t CSimpleFrame_IsMouseEnabled(lua_State* L) {
|
||||||
|
|||||||
@ -49,6 +49,10 @@ bool CSimpleRegion::IsShown() {
|
|||||||
return this->m_shown == 1;
|
return this->m_shown == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CSimpleRegion::IsVisible() {
|
||||||
|
return this->m_visible == 1;
|
||||||
|
}
|
||||||
|
|
||||||
void CSimpleRegion::OnColorChanged(bool a2) {
|
void CSimpleRegion::OnColorChanged(bool a2) {
|
||||||
if (this->m_parent) {
|
if (this->m_parent) {
|
||||||
uint8_t effectiveAlpha = this->m_parent->m_alpha * this->m_parent->alphaBD / 255;
|
uint8_t effectiveAlpha = this->m_parent->m_alpha * this->m_parent->alphaBD / 255;
|
||||||
|
|||||||
@ -32,6 +32,7 @@ class CSimpleRegion : public CScriptRegion {
|
|||||||
void Hide();
|
void Hide();
|
||||||
void HideThis();
|
void HideThis();
|
||||||
bool IsShown();
|
bool IsShown();
|
||||||
|
bool IsVisible();
|
||||||
void OnRegionChanged();
|
void OnRegionChanged();
|
||||||
void SetVertexColor(const CImVector& color);
|
void SetVertexColor(const CImVector& color);
|
||||||
void SetVertexGradient(ORIENTATION orientation, const CImVector& minColor, const CImVector& maxColor);
|
void SetVertexGradient(ORIENTATION orientation, const CImVector& minColor, const CImVector& maxColor);
|
||||||
|
|||||||
@ -97,11 +97,29 @@ int32_t CSimpleTexture_Hide(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleTexture_IsVisible(lua_State* L) {
|
int32_t CSimpleTexture_IsVisible(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
auto type = CSimpleTexture::GetObjectType();
|
||||||
|
auto texture = static_cast<CSimpleTexture*>(FrameScript_GetObjectThis(L, type));
|
||||||
|
|
||||||
|
if (texture->IsVisible()) {
|
||||||
|
lua_pushnumber(L, 1.0);
|
||||||
|
} else {
|
||||||
|
lua_pushnil(L);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleTexture_IsShown(lua_State* L) {
|
int32_t CSimpleTexture_IsShown(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
auto type = CSimpleTexture::GetObjectType();
|
||||||
|
auto texture = static_cast<CSimpleTexture*>(FrameScript_GetObjectThis(L, type));
|
||||||
|
|
||||||
|
if (texture->IsShown()) {
|
||||||
|
lua_pushnumber(L, 1.0);
|
||||||
|
} else {
|
||||||
|
lua_pushnil(L);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleTexture_GetTexture(lua_State* L) {
|
int32_t CSimpleTexture_GetTexture(lua_State* L) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user