mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2026-02-04 09:09:09 +00:00
feat(glue): display list of characters
This commit is contained in:
parent
d536140d63
commit
f28f4b0379
10 changed files with 174 additions and 8 deletions
|
|
@ -1,6 +1,8 @@
|
|||
#include "glue/CCharacterSelection.hpp"
|
||||
#include "model/CM2Shared.hpp"
|
||||
#include "ui/CSimpleModelFFX.hpp"
|
||||
#include "client/ClientServices.hpp"
|
||||
#include "net/Connection.hpp"
|
||||
|
||||
TSGrowableArray<CharacterSelectionDisplay> CCharacterSelection::s_characterList;
|
||||
CSimpleModelFFX* CCharacterSelection::s_modelFrame;
|
||||
|
|
@ -38,3 +40,30 @@ void CCharacterSelection::SetBackgroundModel(const char* modelPath) {
|
|||
void CCharacterSelection::SetCharFacing(float facing) {
|
||||
// TODO:
|
||||
}
|
||||
|
||||
void CCharacterSelection::ClearCharacterList() {
|
||||
}
|
||||
|
||||
void CCharacterSelection::UpdateCharacterList() {
|
||||
// TODO: ClearAddOnEnableState(0);
|
||||
// TODO: Proper implementation
|
||||
|
||||
auto& received = ClientServices::Connection()->m_characterList;
|
||||
CCharacterSelection::s_characterList.SetCount(received.Count());
|
||||
for (uint32_t i = 0; i < received.Count(); ++i) {
|
||||
CCharacterSelection::s_characterList[i].m_characterInfo = received[i];
|
||||
}
|
||||
|
||||
if (CCharacterSelection::GetNumCharacters()) {
|
||||
int32_t currentIndex = 0;
|
||||
FrameScript_SignalEvent(8, "%d", currentIndex + 1);
|
||||
} else {
|
||||
int32_t currentIndex = 0;
|
||||
FrameScript_SignalEvent(8, "%d", currentIndex + 1);
|
||||
}
|
||||
FrameScript_SignalEvent(7, nullptr);
|
||||
}
|
||||
|
||||
uint32_t CCharacterSelection::GetNumCharacters() {
|
||||
return s_characterList.Count();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,12 @@
|
|||
#define GLUE_C_CHARACTER_SELECTION_HPP
|
||||
|
||||
#include <storm/Array.hpp>
|
||||
#include "net/Types.hpp"
|
||||
|
||||
class CSimpleModelFFX;
|
||||
|
||||
struct CharacterSelectionDisplay {
|
||||
// TODO
|
||||
CHARACTER_INFO m_characterInfo;
|
||||
};
|
||||
|
||||
class CCharacterSelection {
|
||||
|
|
@ -20,6 +21,9 @@ class CCharacterSelection {
|
|||
static void RenderPrep();
|
||||
static void SetBackgroundModel(const char* modelPath);
|
||||
static void SetCharFacing(float facing);
|
||||
static void ClearCharacterList();
|
||||
static void UpdateCharacterList();
|
||||
static uint32_t GetNumCharacters();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include "glue/CGlueMgr.hpp"
|
||||
#include "glue/CRealmList.hpp"
|
||||
#include "glue/CCharacterSelection.hpp"
|
||||
#include "client/Client.hpp"
|
||||
#include "client/ClientServices.hpp"
|
||||
#include "gx/Coordinate.hpp"
|
||||
|
|
@ -455,7 +456,7 @@ void CGlueMgr::PollAccountLogin(int32_t errorCode, const char* msg, int32_t comp
|
|||
}
|
||||
|
||||
if (errorCode != 13) {
|
||||
// TODO CCharacterSelection::ClearCharacterList();
|
||||
CCharacterSelection::ClearCharacterList();
|
||||
|
||||
if (ClientServices::GetInstance()->m_realmList.Count()) {
|
||||
FrameScript_SignalEvent(5, nullptr);
|
||||
|
|
@ -569,8 +570,7 @@ void CGlueMgr::PollLoginServerLogin() {
|
|||
void CGlueMgr::PollCharacterList(int32_t errorCode, const char* msg, int32_t complete, int32_t result, WOWCS_OPS op) {
|
||||
FrameScript_SignalEvent(4, "%s", msg);
|
||||
|
||||
// TODO: if (CGlueMgr::HandleBattlenetDisconnect())
|
||||
if (false) {
|
||||
if (CGlueMgr::HandleBattlenetDisconnect()) {
|
||||
CGlueMgr::m_idleState = IDLE_NONE;
|
||||
CGlueMgr::m_showedDisconnect = 0;
|
||||
}
|
||||
|
|
@ -581,7 +581,7 @@ void CGlueMgr::PollCharacterList(int32_t errorCode, const char* msg, int32_t com
|
|||
|
||||
if (!result) {
|
||||
if (errorCode == 2) {
|
||||
// TODO CCharacterSelection::ClearCharacterList();
|
||||
CCharacterSelection::ClearCharacterList();
|
||||
CGlueMgr::GetRealmList(true);
|
||||
} else {
|
||||
FrameScript_SignalEvent(3, "%s%s", "OKAY", msg);
|
||||
|
|
@ -594,7 +594,7 @@ void CGlueMgr::PollCharacterList(int32_t errorCode, const char* msg, int32_t com
|
|||
CGlueMgr::m_idleState = IDLE_NONE;
|
||||
CGlueMgr::m_showedDisconnect = 0;
|
||||
FrameScript_SignalEvent(5, nullptr);
|
||||
// TODO: sub_4E4610();
|
||||
CCharacterSelection::UpdateCharacterList();
|
||||
if (!CGlueMgr::m_accountMsgAvailable) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -895,6 +895,10 @@ void CGlueMgr::UpdateCurrentScreen(const char* screen) {
|
|||
// TODO
|
||||
}
|
||||
|
||||
bool CGlueMgr::HandleBattlenetDisconnect() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void CGlueMgr::SurveyDownloadStart() {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ class CGlueMgr {
|
|||
static void Sub4D8BA0();
|
||||
static void Suspend();
|
||||
static void UpdateCurrentScreen(const char* screen);
|
||||
static bool HandleBattlenetDisconnect();
|
||||
|
||||
// Survey Download System
|
||||
static void SurveyDownloadStart();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue