mirror of
https://github.com/whoahq/whoa.git
synced 2026-11-15 10:41:17 +03:00
feat(glue): handle character list state in CGlueMgr::Idle
This commit is contained in:
4 files changed
+69
No files matched your search
@@ -50,3 +50,7 @@ void CCharacterSelection::SetBackgroundModel(const char* modelPath) {
|
||||
model->IsDrawable(1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void CCharacterSelection::UpdateCharacterList() {
|
||||
// TODO
|
||||
}
|
||||
@@ -21,6 +21,7 @@ class CCharacterSelection {
|
||||
static void OnGetCharacterList();
|
||||
static void RenderPrep();
|
||||
static void SetBackgroundModel(const char* modelPath);
|
||||
static void UpdateCharacterList();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -185,6 +185,17 @@ void CGlueMgr::GetCharacterList() {
|
||||
ClientServices::Connection()->GetCharacterList();
|
||||
}
|
||||
|
||||
void CGlueMgr::GetRealmList(int32_t a1) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
|
||||
int32_t CGlueMgr::HandleBattlenetDisconnect() {
|
||||
// TODO
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t CGlueMgr::HandleDisplaySizeChanged(const CSizeEvent& event) {
|
||||
if (
|
||||
CGlueMgr::m_screenWidth > 0
|
||||
@@ -261,6 +272,11 @@ int32_t CGlueMgr::Idle(const void* a1, void* a2) {
|
||||
break;
|
||||
}
|
||||
|
||||
case IDLE_CHARACTER_LIST: {
|
||||
CGlueMgr::PollCharacterList(msg, complete, result, errorCode);
|
||||
break;
|
||||
}
|
||||
|
||||
case IDLE_ENTER_WORLD: {
|
||||
CGlueMgr::PollEnterWorld();
|
||||
break;
|
||||
@@ -456,6 +472,51 @@ void CGlueMgr::PollAccountLogin(int32_t errorCode, const char* msg, int32_t comp
|
||||
CGlueMgr::SetScreen("charselect");
|
||||
}
|
||||
|
||||
void CGlueMgr::PollCharacterList(const char* msg, int32_t complete, int32_t result, int32_t errorCode) {
|
||||
FrameScript_SignalEvent(4, "%s", msg);
|
||||
|
||||
if (CGlueMgr::HandleBattlenetDisconnect()) {
|
||||
CGlueMgr::m_idleState = IDLE_NONE;
|
||||
CGlueMgr::m_showedDisconnect = 0;
|
||||
}
|
||||
|
||||
if (!complete) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Error
|
||||
|
||||
if (result == 0) {
|
||||
if (errorCode == 2) {
|
||||
CCharacterSelection::ClearCharacterList();
|
||||
CGlueMgr::GetRealmList(1);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
FrameScript_SignalEvent(3, "%s%s", "OKAY", msg);
|
||||
|
||||
CGlueMgr::m_idleState = IDLE_NONE;
|
||||
CGlueMgr::m_showedDisconnect = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Success
|
||||
|
||||
CGlueMgr::m_idleState = IDLE_NONE;
|
||||
CGlueMgr::m_showedDisconnect = 0;
|
||||
|
||||
FrameScript_SignalEvent(5, nullptr);
|
||||
|
||||
CCharacterSelection::UpdateCharacterList();
|
||||
|
||||
if (CGlueMgr::m_accountMsgAvailable) {
|
||||
FrameScript_SignalEvent(34, nullptr);
|
||||
CGlueMgr::m_accountMsgAvailable = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void CGlueMgr::PollEnterWorld() {
|
||||
if (!LoadingScreenDrawing()) {
|
||||
return;
|
||||
|
||||
@@ -59,12 +59,15 @@ class CGlueMgr {
|
||||
static void ChangeRealm(const REALM_INFO* realmInfo);
|
||||
static void DisplayLoginStatus();
|
||||
static void GetCharacterList();
|
||||
static void GetRealmList(int32_t a1);
|
||||
static int32_t HandleBattlenetDisconnect();
|
||||
static int32_t HandleDisplaySizeChanged(const CSizeEvent& event);
|
||||
static int32_t Idle(const void* a1, void* a2); // TODO a1: const EVENT_DATA_IDLE*
|
||||
static void Initialize();
|
||||
static void LoginServerLogin(const char* accountName, const char* password);
|
||||
static int32_t OnKickReasonMsg(void* param, NETMESSAGE msgId, uint32_t time, CDataStore* msg);
|
||||
static void PollAccountLogin(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op);
|
||||
static void PollCharacterList(const char* msg, int32_t complete, int32_t result, int32_t errorCode);
|
||||
static void PollEnterWorld();
|
||||
static void PollLoginServerLogin();
|
||||
static void QuitGame();
|
||||
|
||||
Reference in new issue
Block a user