Added Disconnecting from the server when selecting new game and backing out of name select
This commit is contained in:
@@ -206,6 +206,11 @@ bool ArchipelagoClient::StartClient() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ArchipelagoClient::StopClient() {
|
||||||
|
disconnecting = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void ArchipelagoClient::GameLoaded() {
|
void ArchipelagoClient::GameLoaded() {
|
||||||
if(apClient == nullptr) {
|
if(apClient == nullptr) {
|
||||||
return;
|
return;
|
||||||
@@ -387,6 +392,7 @@ void ArchipelagoClient::Poll() {
|
|||||||
apClient->reset();
|
apClient->reset();
|
||||||
apClient = nullptr;
|
apClient = nullptr;
|
||||||
disconnecting = false;
|
disconnecting = false;
|
||||||
|
CVarSetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 0); // disconnected
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2169,6 +2169,10 @@ extern "C" void Archipelago_Connect() {
|
|||||||
ArchipelagoClient::GetInstance().StartClient();
|
ArchipelagoClient::GetInstance().StartClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" void Archipelago_Disconnect() {
|
||||||
|
ArchipelagoClient::GetInstance().StopClient();
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" void Archipelago_ShowArchipelagoMenu() {
|
extern "C" void Archipelago_ShowArchipelagoMenu() {
|
||||||
SohGui::ShowArchipelagoSettingsMenu();
|
SohGui::ShowArchipelagoSettingsMenu();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ void Randomizer_SetSpoilerLoaded(bool spoilerLoaded);
|
|||||||
uint8_t Randomizer_GenerateRandomizer();
|
uint8_t Randomizer_GenerateRandomizer();
|
||||||
void Randomizer_ShowRandomizerMenu();
|
void Randomizer_ShowRandomizerMenu();
|
||||||
void Archipelago_Connect();
|
void Archipelago_Connect();
|
||||||
|
void Archipelago_Disconnect();
|
||||||
void Archipelago_ShowArchipelagoMenu();
|
void Archipelago_ShowArchipelagoMenu();
|
||||||
int CustomMessage_RetrieveIfExists(PlayState* play);
|
int CustomMessage_RetrieveIfExists(PlayState* play);
|
||||||
void Overlay_DisplayText(float duration, const char* text);
|
void Overlay_DisplayText(float duration, const char* text);
|
||||||
|
|||||||
@@ -1699,6 +1699,8 @@ void FileChoose_RotateToMain(GameState* thisx) {
|
|||||||
void FileChoose_RotateToQuest(GameState* thisx) {
|
void FileChoose_RotateToQuest(GameState* thisx) {
|
||||||
FileChooseContext* this = (FileChooseContext*)thisx;
|
FileChooseContext* this = (FileChooseContext*)thisx;
|
||||||
|
|
||||||
|
Archipelago_Disconnect();
|
||||||
|
|
||||||
if (this->configMode == CM_NAME_ENTRY_TO_QUEST_MENU || this->configMode == CM_BOSS_RUSH_TO_QUEST ||
|
if (this->configMode == CM_NAME_ENTRY_TO_QUEST_MENU || this->configMode == CM_BOSS_RUSH_TO_QUEST ||
|
||||||
this->configMode == CM_RANDOMIZER_SETTINGS_MENU_TO_QUEST ||
|
this->configMode == CM_RANDOMIZER_SETTINGS_MENU_TO_QUEST ||
|
||||||
this->configMode == CM_ARCHIPELAGO_SETTINGS_TO_QUEST) {
|
this->configMode == CM_ARCHIPELAGO_SETTINGS_TO_QUEST) {
|
||||||
@@ -1859,6 +1861,8 @@ void FileChoose_UpdateArchipelagoMenu(GameState* thisx) {
|
|||||||
|
|
||||||
void FileChoose_StartArchipelagoMenu(GameState* thisx) {
|
void FileChoose_StartArchipelagoMenu(GameState* thisx) {
|
||||||
FileChooseContext* this = (FileChooseContext*)thisx;
|
FileChooseContext* this = (FileChooseContext*)thisx;
|
||||||
|
Archipelago_Disconnect();
|
||||||
|
fileSelectArchipelagoLoaded = false;
|
||||||
|
|
||||||
this->logoAlpha -= 25;
|
this->logoAlpha -= 25;
|
||||||
this->archipelagoUIAlpha = 0;
|
this->archipelagoUIAlpha = 0;
|
||||||
@@ -3163,7 +3167,9 @@ void FileChoose_ConfigModeDraw(GameState* thisx) {
|
|||||||
if (this->configMode != CM_NAME_ENTRY && this->configMode != CM_START_NAME_ENTRY &&
|
if (this->configMode != CM_NAME_ENTRY && this->configMode != CM_START_NAME_ENTRY &&
|
||||||
this->configMode != CM_QUEST_MENU && this->configMode != CM_NAME_ENTRY_TO_QUEST_MENU &&
|
this->configMode != CM_QUEST_MENU && this->configMode != CM_NAME_ENTRY_TO_QUEST_MENU &&
|
||||||
this->configMode != CM_RANDOMIZER_SETTINGS_MENU &&
|
this->configMode != CM_RANDOMIZER_SETTINGS_MENU &&
|
||||||
this->configMode != CM_NAME_ENTRY_TO_RANDOMIZER_SETTINGS_MENU) {
|
this->configMode != CM_NAME_ENTRY_TO_RANDOMIZER_SETTINGS_MENU &&
|
||||||
|
this->configMode != CM_ARCHIPELAGO_SETTINGS_MENU &&
|
||||||
|
this->configMode != CM_NAME_ENTRY_TO_ARCHIPELAGO_SETTINGS_MENU) {
|
||||||
gDPPipeSync(POLY_OPA_DISP++);
|
gDPPipeSync(POLY_OPA_DISP++);
|
||||||
gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
||||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->windowColor[0], this->windowColor[1], this->windowColor[2],
|
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->windowColor[0], this->windowColor[1], this->windowColor[2],
|
||||||
@@ -3273,7 +3279,9 @@ void FileChoose_ConfigModeDraw(GameState* thisx) {
|
|||||||
this->configMode == CM_NAME_ENTRY_TO_QUEST_MENU || this->configMode == CM_ROTATE_TO_BOSS_RUSH_MENU ||
|
this->configMode == CM_NAME_ENTRY_TO_QUEST_MENU || this->configMode == CM_ROTATE_TO_BOSS_RUSH_MENU ||
|
||||||
this->configMode == CM_ROTATE_TO_RANDOMIZER_SETTINGS_MENU ||
|
this->configMode == CM_ROTATE_TO_RANDOMIZER_SETTINGS_MENU ||
|
||||||
this->configMode == CM_ROTATE_TO_ARCHIPELAGO_MENU ||
|
this->configMode == CM_ROTATE_TO_ARCHIPELAGO_MENU ||
|
||||||
this->configMode == CM_NAME_ENTRY_TO_RANDOMIZER_SETTINGS_MENU) {
|
this->configMode == CM_NAME_ENTRY_TO_RANDOMIZER_SETTINGS_MENU ||
|
||||||
|
this->configMode == CM_ARCHIPELAGO_SETTINGS_MENU ||
|
||||||
|
this->configMode == CM_NAME_ENTRY_TO_ARCHIPELAGO_SETTINGS_MENU) {
|
||||||
// window
|
// window
|
||||||
gDPPipeSync(POLY_OPA_DISP++);
|
gDPPipeSync(POLY_OPA_DISP++);
|
||||||
gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
||||||
|
|||||||
@@ -379,6 +379,8 @@ void FileChoose_DrawNameEntry(GameState* thisx) {
|
|||||||
this->configMode = CM_NAME_ENTRY_TO_QUEST_MENU;
|
this->configMode = CM_NAME_ENTRY_TO_QUEST_MENU;
|
||||||
} else if (this->prevConfigMode == CM_RANDOMIZER_SETTINGS_MENU) {
|
} else if (this->prevConfigMode == CM_RANDOMIZER_SETTINGS_MENU) {
|
||||||
this->configMode = CM_NAME_ENTRY_TO_RANDOMIZER_SETTINGS_MENU;
|
this->configMode = CM_NAME_ENTRY_TO_RANDOMIZER_SETTINGS_MENU;
|
||||||
|
} else if (this->prevConfigMode = CM_ARCHIPELAGO_SETTINGS_MENU) {
|
||||||
|
this->configMode = CM_NAME_ENTRY_TO_ARCHIPELAGO_SETTINGS_MENU;
|
||||||
} else {
|
} else {
|
||||||
this->configMode = CM_NAME_ENTRY_TO_MAIN;
|
this->configMode = CM_NAME_ENTRY_TO_MAIN;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user