mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-05 15:42:17 +03:00
feat(ui): add CGGameUI::EnterWorld
This commit is contained in:
parent
1d364ec689
commit
e5aab736b7
@ -4,5 +4,6 @@
|
||||
#include "ui/game/CGGameUI.hpp"
|
||||
#include "ui/game/CGPetInfo.hpp"
|
||||
#include "ui/game/ScriptEvents.hpp"
|
||||
#include "ui/game/Types.hpp"
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#include "ui/game/CGGameUI.hpp"
|
||||
#include "client/Client.hpp"
|
||||
#include "object/Client.hpp"
|
||||
#include "ui/CScriptObject.hpp"
|
||||
#include "ui/FrameXML.hpp"
|
||||
#include "ui/Key.hpp"
|
||||
@ -17,6 +18,7 @@
|
||||
#include "ui/game/GMTicketInfoScript.hpp"
|
||||
#include "ui/game/GameScript.hpp"
|
||||
#include "ui/game/ScriptEvents.hpp"
|
||||
#include "ui/game/Types.hpp"
|
||||
#include "ui/game/UIBindingsScript.hpp"
|
||||
#include "ui/simple/CSimpleTop.hpp"
|
||||
#include "util/CStatus.hpp"
|
||||
@ -24,6 +26,7 @@
|
||||
|
||||
WOWGUID CGGameUI::s_currentObjectTrack;
|
||||
CScriptObject* CGGameUI::s_gameTooltip;
|
||||
bool CGGameUI::s_inWorld;
|
||||
WOWGUID CGGameUI::s_lockedTarget;
|
||||
bool CGGameUI::s_loggingIn;
|
||||
CSimpleTop* CGGameUI::s_simpleTop;
|
||||
@ -65,6 +68,28 @@ void LoadScriptFunctions() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CGGameUI::EnterWorld() {
|
||||
if (CGGameUI::s_inWorld) {
|
||||
return;
|
||||
}
|
||||
|
||||
CGGameUI::s_inWorld = true;
|
||||
|
||||
// TODO
|
||||
|
||||
if (CGGameUI::s_loggingIn) {
|
||||
CGGameUI::s_loggingIn = false;
|
||||
|
||||
FrameScript_SignalEvent(SCRIPT_PLAYER_LOGIN, nullptr);
|
||||
|
||||
// TODO CGLCD::Login();
|
||||
}
|
||||
|
||||
FrameScript_SignalEvent(SCRIPT_PLAYER_ENTERING_WORLD, nullptr);
|
||||
|
||||
// TODO
|
||||
}
|
||||
|
||||
WOWGUID& CGGameUI::GetCurrentObjectTrack() {
|
||||
return CGGameUI::s_currentObjectTrack;
|
||||
}
|
||||
@ -155,6 +180,12 @@ void CGGameUI::Initialize() {
|
||||
STORM_ASSERT(CGGameUI::s_gameTooltip);
|
||||
|
||||
// TODO
|
||||
|
||||
if (ClntObjMgrGetActivePlayer()) {
|
||||
CGGameUI::EnterWorld();
|
||||
}
|
||||
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CGGameUI::InitializeGame() {
|
||||
|
||||
@ -13,6 +13,7 @@ class CGGameUI {
|
||||
static CSimpleTop* s_simpleTop;
|
||||
|
||||
// Static functions
|
||||
static void EnterWorld();
|
||||
static WOWGUID& GetCurrentObjectTrack();
|
||||
static WOWGUID& GetLockedTarget();
|
||||
static void Initialize();
|
||||
@ -24,6 +25,7 @@ class CGGameUI {
|
||||
|
||||
private:
|
||||
static WOWGUID s_currentObjectTrack;
|
||||
static bool s_inWorld;
|
||||
static WOWGUID s_lockedTarget;
|
||||
static bool s_loggingIn;
|
||||
};
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
#include "ui/ScriptFunctionsSystem.hpp"
|
||||
#include "ui/game/CGGameUI.hpp"
|
||||
#include "ui/game/ScriptUtil.hpp"
|
||||
#include "ui/game/Types.hpp"
|
||||
#include "util/GUID.hpp"
|
||||
#include "util/Lua.hpp"
|
||||
#include "util/StringTo.hpp"
|
||||
@ -1133,9 +1134,9 @@ void ScriptEventsInitialize() {
|
||||
g_scriptEvents[250] = "LOOT_SLOT_CLEARED";
|
||||
g_scriptEvents[251] = "LOOT_SLOT_CHANGED";
|
||||
g_scriptEvents[252] = "LOOT_CLOSED";
|
||||
g_scriptEvents[253] = "PLAYER_LOGIN";
|
||||
g_scriptEvents[254] = "PLAYER_LOGOUT";
|
||||
g_scriptEvents[255] = "PLAYER_ENTERING_WORLD";
|
||||
g_scriptEvents[SCRIPT_PLAYER_LOGIN] = "PLAYER_LOGIN";
|
||||
g_scriptEvents[SCRIPT_PLAYER_LOGOUT] = "PLAYER_LOGOUT";
|
||||
g_scriptEvents[SCRIPT_PLAYER_ENTERING_WORLD] = "PLAYER_ENTERING_WORLD";
|
||||
g_scriptEvents[256] = "PLAYER_LEAVING_WORLD";
|
||||
g_scriptEvents[257] = "PLAYER_ALIVE";
|
||||
g_scriptEvents[258] = "PLAYER_DEAD";
|
||||
|
||||
12
src/ui/game/Types.hpp
Normal file
12
src/ui/game/Types.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
#ifndef UI_GAME_TYPES_HPP
|
||||
#define UI_GAME_TYPES_HPP
|
||||
|
||||
enum SCRIPTEVENT {
|
||||
// TODO
|
||||
SCRIPT_PLAYER_LOGIN = 253,
|
||||
SCRIPT_PLAYER_LOGOUT = 254,
|
||||
SCRIPT_PLAYER_ENTERING_WORLD = 255,
|
||||
// TODO
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Reference in New Issue
Block a user