mirror of
https://github.com/whoahq/whoa.git
synced 2026-11-15 10:41:17 +03:00
feat(glue): handle ChangeRealm script function
This commit is contained in:
1 parent
dd322572c7
commit
009225be3d
7 files changed
+92
-1
No files matched your search
@@ -47,6 +47,7 @@ char CGlueMgr::m_accountName[1280];
|
||||
float CGlueMgr::m_aspect;
|
||||
bool CGlueMgr::m_authenticated;
|
||||
char CGlueMgr::m_currentScreen[64];
|
||||
int32_t CGlueMgr::m_disconnectPending;
|
||||
int32_t CGlueMgr::m_displayingQueueDialog;
|
||||
CGlueMgr::GLUE_IDLE_STATE CGlueMgr::m_idleState;
|
||||
int32_t CGlueMgr::m_initialized;
|
||||
@@ -55,6 +56,7 @@ int32_t CGlueMgr::m_lastLoginState;
|
||||
int32_t CGlueMgr::m_loginResult;
|
||||
int32_t CGlueMgr::m_loginState;
|
||||
int32_t CGlueMgr::m_matrixRemaining;
|
||||
int32_t CGlueMgr::m_reconnect;
|
||||
int32_t CGlueMgr::m_reload;
|
||||
int32_t CGlueMgr::m_scandllOkayToLogIn = 1; // TODO
|
||||
float CGlueMgr::m_screenHeight;
|
||||
@@ -78,6 +80,31 @@ float CalculateAspectRatio() {
|
||||
return static_cast<float>(width) / static_cast<float>(height);
|
||||
}
|
||||
|
||||
void CGlueMgr::ChangeRealm(const REALM_INFO* realmInfo) {
|
||||
if (!realmInfo) {
|
||||
return;
|
||||
}
|
||||
|
||||
ClientServices::SelectRealm(realmInfo->name);
|
||||
|
||||
if (ClientServices::Connection()->IsConnected()) {
|
||||
CGlueMgr::m_disconnectPending = 1;
|
||||
CGlueMgr::m_reconnect = 1;
|
||||
|
||||
ClientServices::Connection()->Disconnect();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
CGlueMgr::m_idleState = IDLE_ACCOUNT_LOGIN;
|
||||
CGlueMgr::m_showedDisconnect = 0;
|
||||
|
||||
auto text = FrameScript_GetText("GAME_SERVER_LOGIN", -1, GENDER_NOT_APPLICABLE);
|
||||
FrameScript_SignalEvent(3, "%s%s", "CANCEL", text);
|
||||
|
||||
ClientServices::Connection()->Connect();
|
||||
}
|
||||
|
||||
void CGlueMgr::DisplayLoginStatus() {
|
||||
// No change
|
||||
if (CGlueMgr::m_lastLoginState == CGlueMgr::m_loginState && CGlueMgr::m_lastLoginResult == CGlueMgr::m_loginResult) {
|
||||
|
||||
@@ -36,6 +36,7 @@ class CGlueMgr {
|
||||
static float m_aspect;
|
||||
static bool m_authenticated;
|
||||
static char m_currentScreen[];
|
||||
static int32_t m_disconnectPending;
|
||||
static int32_t m_displayingQueueDialog;
|
||||
static GLUE_IDLE_STATE m_idleState;
|
||||
static int32_t m_initialized;
|
||||
@@ -44,6 +45,7 @@ class CGlueMgr {
|
||||
static int32_t m_loginResult;
|
||||
static int32_t m_loginState;
|
||||
static int32_t m_matrixRemaining;
|
||||
static int32_t m_reconnect;
|
||||
static int32_t m_reload;
|
||||
static int32_t m_scandllOkayToLogIn;
|
||||
static float m_screenHeight;
|
||||
@@ -53,6 +55,7 @@ class CGlueMgr {
|
||||
static int32_t m_suspended;
|
||||
|
||||
// Static functions
|
||||
static void ChangeRealm(const REALM_INFO* realmInfo);
|
||||
static void DisplayLoginStatus();
|
||||
// TODO a1: const EVENT_DATA_IDLE*
|
||||
static int32_t HandleDisplaySizeChanged(const CSizeEvent& event);
|
||||
|
||||
Reference in new issue
Block a user