Merge branch 'aManchipelago-QuestSelect' into aManchipelago
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
@@ -44,6 +44,9 @@ static const ALIGN_ASSET(2) char gTitleRandomizerSubtitleTex[] = dgTitleRandomiz
|
|||||||
#define dgTitleBossRushSubtitleTex "__OTR__objects/object_mag/gTitleBossRushSubtitleTex"
|
#define dgTitleBossRushSubtitleTex "__OTR__objects/object_mag/gTitleBossRushSubtitleTex"
|
||||||
static const ALIGN_ASSET(2) char gTitleBossRushSubtitleTex[] = dgTitleBossRushSubtitleTex;
|
static const ALIGN_ASSET(2) char gTitleBossRushSubtitleTex[] = dgTitleBossRushSubtitleTex;
|
||||||
|
|
||||||
|
#define dgTitleArchipelagoSubtilteTex "__OTR__objects/object_mag/gTitleArchipelagoSubtitleTex"
|
||||||
|
static const ALIGN_ASSET(2) char gTitleArchipelagoSubtitleTex[] = dgTitleArchipelagoSubtilteTex;
|
||||||
|
|
||||||
#define dgOcarinaAButtonDL "__OTR__objects/object_ocarina_a_button/gOcarinaAButtonDL"
|
#define dgOcarinaAButtonDL "__OTR__objects/object_ocarina_a_button/gOcarinaAButtonDL"
|
||||||
static const ALIGN_ASSET(2) char gOcarinaAButtonDL[] = dgOcarinaAButtonDL;
|
static const ALIGN_ASSET(2) char gOcarinaAButtonDL[] = dgOcarinaAButtonDL;
|
||||||
|
|
||||||
|
|||||||
@@ -1593,7 +1593,7 @@ typedef struct {
|
|||||||
/* 0x1CAD4 */ s16 newFileNameCharCount;
|
/* 0x1CAD4 */ s16 newFileNameCharCount;
|
||||||
/* 0x1CAD6 */ s16 unk_1CAD6[5];
|
/* 0x1CAD6 */ s16 unk_1CAD6[5];
|
||||||
s16 logoAlpha;
|
s16 logoAlpha;
|
||||||
s8 questType[3]; // 0 for Normal, 1 for MQ
|
s8 questType[4]; // 0 for Normal, 1 for MQ
|
||||||
StickDirectionPrompt stickLeftPrompt;
|
StickDirectionPrompt stickLeftPrompt;
|
||||||
StickDirectionPrompt stickRightPrompt;
|
StickDirectionPrompt stickRightPrompt;
|
||||||
f32 arrowAnimTween;
|
f32 arrowAnimTween;
|
||||||
@@ -1607,6 +1607,10 @@ typedef struct {
|
|||||||
uint8_t randomizerIndex;
|
uint8_t randomizerIndex;
|
||||||
int16_t randomizerUIAlpha;
|
int16_t randomizerUIAlpha;
|
||||||
uint16_t randomizerArrowOffset;
|
uint16_t randomizerArrowOffset;
|
||||||
|
uint8_t archipelagoIndex;
|
||||||
|
int16_t archipelagoUIAlpha;
|
||||||
|
uint16_t archipelagoArrowOffset;
|
||||||
|
|
||||||
} FileChooseContext; // size = 0x1CAE0
|
} FileChooseContext; // size = 0x1CAE0
|
||||||
|
|
||||||
// Macros for `EntranceInfo.field`
|
// Macros for `EntranceInfo.field`
|
||||||
|
|||||||
@@ -329,7 +329,7 @@ typedef enum {
|
|||||||
/* 01 */ QUEST_MASTER,
|
/* 01 */ QUEST_MASTER,
|
||||||
/* 02 */ QUEST_RANDOMIZER,
|
/* 02 */ QUEST_RANDOMIZER,
|
||||||
/* 03 */ QUEST_BOSSRUSH,
|
/* 03 */ QUEST_BOSSRUSH,
|
||||||
/* 03 */ QUEST_ARCHIPELAGO,
|
/* 04 */ QUEST_ARCHIPELAGO,
|
||||||
} Quest;
|
} Quest;
|
||||||
|
|
||||||
#define IS_VANILLA (gSaveContext.ship.quest.id == QUEST_NORMAL)
|
#define IS_VANILLA (gSaveContext.ship.quest.id == QUEST_NORMAL)
|
||||||
|
|||||||
@@ -63,6 +63,61 @@ std::array<std::string, LANGUAGE_MAX> RandomizerSettingsMenuText[RSM_MAX] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* SohFileSelect_GetSettingText(uint8_t optionIndex, uint8_t language) {
|
std::array<std::string, LANGUAGE_MAX> ArchipelagoSettingsMenuText[ASM_MAX] {
|
||||||
|
// ASM_START_ARCHIPELAGO
|
||||||
|
{
|
||||||
|
"Start Archipelago",
|
||||||
|
"Todo",
|
||||||
|
"Todo",
|
||||||
|
},
|
||||||
|
// ASM_CHANGE_CONNECTION_INFO
|
||||||
|
{
|
||||||
|
"Change Connection Info",
|
||||||
|
"Todo",
|
||||||
|
"Todo",
|
||||||
|
},
|
||||||
|
// ASM_SERVER_ADDRESS
|
||||||
|
{
|
||||||
|
"Server Address: ",
|
||||||
|
"Todo",
|
||||||
|
"Todo",
|
||||||
|
},
|
||||||
|
// ASM_SLOT_NAME
|
||||||
|
{
|
||||||
|
"Slot Name: ",
|
||||||
|
"Todo",
|
||||||
|
"Todo",
|
||||||
|
},
|
||||||
|
// ASM_NOT_CONNECTED
|
||||||
|
{
|
||||||
|
"Not Connected",
|
||||||
|
"Todo",
|
||||||
|
"Todo",
|
||||||
|
},
|
||||||
|
// ASM_CONNECTING
|
||||||
|
{
|
||||||
|
"Connecting...",
|
||||||
|
"Todo",
|
||||||
|
"Todo",
|
||||||
|
},
|
||||||
|
// ASM_CONNECTED
|
||||||
|
{
|
||||||
|
"Connected",
|
||||||
|
"Todo",
|
||||||
|
"Todo",
|
||||||
|
},
|
||||||
|
// ASM_STATUS
|
||||||
|
{
|
||||||
|
"Status:",
|
||||||
|
"Todo",
|
||||||
|
"Todo",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const char* SohFileSelect_GetRandomizerSettingText(uint8_t optionIndex, uint8_t language) {
|
||||||
return RandomizerSettingsMenuText[optionIndex][language].c_str();
|
return RandomizerSettingsMenuText[optionIndex][language].c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* SohFileSelect_GetArchipelagoSettingText(uint8_t optionIndex, uint8_t language) {
|
||||||
|
return ArchipelagoSettingsMenuText[optionIndex][language].c_str();
|
||||||
|
}
|
||||||
@@ -6,7 +6,8 @@
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
const char* SohFileSelect_GetSettingText(u8 optionIndex, u8 language);
|
const char* SohFileSelect_GetRandomizerSettingText(u8 optionIndex, u8 language);
|
||||||
|
const char* SohFileSelect_GetArchipelagoSettingText(u8 optionIndex, u8 language);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
@@ -20,4 +21,16 @@ typedef enum {
|
|||||||
RSM_MAX,
|
RSM_MAX,
|
||||||
} RandomizerSettingsMenuEnums;
|
} RandomizerSettingsMenuEnums;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
ASM_START_ARCHIPELAGO,
|
||||||
|
ASM_CHANGE_CONNECTION_INFO,
|
||||||
|
ASM_SERVER_ADDRESS,
|
||||||
|
ASM_SLOT_NAME,
|
||||||
|
ASM_NOT_CONNECTED,
|
||||||
|
ASM_CONNECTING,
|
||||||
|
ASM_CONNECTED,
|
||||||
|
ASM_STATUS,
|
||||||
|
ASM_MAX
|
||||||
|
} ArchipelagoSettingsMenuEnums;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -846,7 +846,7 @@ void RegisterOnUpdateMainMenuSelection() {
|
|||||||
return;
|
return;
|
||||||
uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : gSaveContext.language;
|
uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : gSaveContext.language;
|
||||||
|
|
||||||
auto optionName = SohFileSelect_GetSettingText(optionIndex, language);
|
auto optionName = SohFileSelect_GetRandomizerSettingText(optionIndex, language);
|
||||||
SpeechSynthesizer::Instance->Speak(optionName, GetLanguageCode());
|
SpeechSynthesizer::Instance->Speak(optionName, GetLanguageCode());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -43,10 +43,24 @@ bool ArchipelagoClient::StartClient() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
disconnecting = false;
|
disconnecting = false;
|
||||||
|
retries = 0;
|
||||||
apClient = std::unique_ptr<APClient>(
|
apClient = std::unique_ptr<APClient>(
|
||||||
new APClient(uuid, AP_Client_consts::AP_GAME_NAME,
|
new APClient(uuid, AP_Client_consts::AP_GAME_NAME,
|
||||||
CVarGetString(CVAR_REMOTE_ARCHIPELAGO("ServerAddress"), "localhost:38281"), "cacert.pem"));
|
CVarGetString(CVAR_REMOTE_ARCHIPELAGO("ServerAddress"), "localhost:38281"), "cacert.pem"));
|
||||||
|
|
||||||
|
CVarSetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 1); // connecting
|
||||||
|
|
||||||
|
apClient->set_socket_error_handler([&](const std::string& msg) {
|
||||||
|
retries++;
|
||||||
|
if(retries > AP_Client_consts::MAX_RETRIES) {
|
||||||
|
ArchipelagoConsole_SendMessage("[ERROR] Could not connect to server");
|
||||||
|
CVarSetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 2); // connection error
|
||||||
|
disconnecting = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ArchipelagoConsole_SendMessage("[ERROR] Could not connect to server, retrying...");
|
||||||
|
});
|
||||||
|
|
||||||
apClient->set_room_info_handler([&]() {
|
apClient->set_room_info_handler([&]() {
|
||||||
std::list<std::string> tags;
|
std::list<std::string> tags;
|
||||||
// tags.push_back("DeathLink"); // todo, implement deathlink
|
// tags.push_back("DeathLink"); // todo, implement deathlink
|
||||||
@@ -55,6 +69,7 @@ bool ArchipelagoClient::StartClient() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
apClient->set_slot_connected_handler([&](const nlohmann::json data) {
|
apClient->set_slot_connected_handler([&](const nlohmann::json data) {
|
||||||
|
CVarSetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 3); // slot connected
|
||||||
ArchipelagoConsole_SendMessage("[LOG] Connected.", true);
|
ArchipelagoConsole_SendMessage("[LOG] Connected.", true);
|
||||||
ArchipelagoClient::StartLocationScouts();
|
ArchipelagoClient::StartLocationScouts();
|
||||||
|
|
||||||
@@ -117,6 +132,7 @@ bool ArchipelagoClient::StartClient() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArchipelagoConsole_SendMessage("[LOG] Scouting finished.", true);
|
ArchipelagoConsole_SendMessage("[LOG] Scouting finished.", true);
|
||||||
|
CVarSetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 4); // locations scouted
|
||||||
}); // todo maybe move these functions to a lambda, since they don't have to be static anymore
|
}); // todo maybe move these functions to a lambda, since they don't have to be static anymore
|
||||||
|
|
||||||
apClient->set_location_checked_handler([&](const std::list<int64_t> locations) {
|
apClient->set_location_checked_handler([&](const std::list<int64_t> locations) {
|
||||||
@@ -203,6 +219,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;
|
||||||
@@ -386,6 +407,8 @@ void ArchipelagoClient::Poll() {
|
|||||||
if (disconnecting) {
|
if (disconnecting) {
|
||||||
apClient->reset();
|
apClient->reset();
|
||||||
apClient = nullptr;
|
apClient = nullptr;
|
||||||
|
disconnecting = false;
|
||||||
|
CVarSetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 0); // disconnected
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -542,7 +565,7 @@ void RegisterArchipelago() {
|
|||||||
// make sure the client is constructed
|
// make sure the client is constructed
|
||||||
ArchipelagoClient::GetInstance();
|
ArchipelagoClient::GetInstance();
|
||||||
|
|
||||||
CVarSetInteger(CVAR_REMOTE_ARCHIPELAGO("Connected"), 0);
|
CVarSetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 0);
|
||||||
|
|
||||||
COND_HOOK(GameInteractor::OnGameFrameUpdate, true, []() { ArchipelagoClient::GetInstance().Poll(); });
|
COND_HOOK(GameInteractor::OnGameFrameUpdate, true, []() { ArchipelagoClient::GetInstance().Poll(); });
|
||||||
COND_HOOK(GameInteractor::PostLoadGame, true,
|
COND_HOOK(GameInteractor::PostLoadGame, true,
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ static constexpr int MAX_PLAYER_NAME_LENGHT = 17;
|
|||||||
static constexpr int MAX_PASSWORD_LENGTH = 32;
|
static constexpr int MAX_PASSWORD_LENGTH = 32;
|
||||||
|
|
||||||
static constexpr char const* AP_GAME_NAME = "Ship of Harkinian";
|
static constexpr char const* AP_GAME_NAME = "Ship of Harkinian";
|
||||||
|
static constexpr int MAX_RETRIES = 6;
|
||||||
} // namespace AP_Client_consts
|
} // namespace AP_Client_consts
|
||||||
|
|
||||||
class ArchipelagoClient {
|
class ArchipelagoClient {
|
||||||
@@ -64,6 +65,7 @@ class ArchipelagoClient {
|
|||||||
std::unique_ptr<APClient> apClient;
|
std::unique_ptr<APClient> apClient;
|
||||||
bool itemQueued;
|
bool itemQueued;
|
||||||
bool disconnecting;
|
bool disconnecting;
|
||||||
|
int retries;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ArchipelagoClient();
|
ArchipelagoClient();
|
||||||
|
|||||||
@@ -2233,6 +2233,18 @@ extern "C" void Randomizer_ShowRandomizerMenu() {
|
|||||||
SohGui::ShowRandomizerSettingsMenu();
|
SohGui::ShowRandomizerSettingsMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" void Archipelago_Connect() {
|
||||||
|
ArchipelagoClient::GetInstance().StartClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" void Archipelago_Disconnect() {
|
||||||
|
ArchipelagoClient::GetInstance().StopClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" void Archipelago_ShowArchipelagoMenu() {
|
||||||
|
SohGui::ShowArchipelagoSettingsMenu();
|
||||||
|
}
|
||||||
|
|
||||||
CustomMessage Randomizer_GetCustomGetItemMessage(Player* player) {
|
CustomMessage Randomizer_GetCustomGetItemMessage(Player* player) {
|
||||||
s16 giid;
|
s16 giid;
|
||||||
if (player->getItemEntry.objectId != OBJECT_INVALID) {
|
if (player->getItemEntry.objectId != OBJECT_INVALID) {
|
||||||
|
|||||||
@@ -155,6 +155,9 @@ uint8_t Randomizer_IsSpoilerLoaded();
|
|||||||
void Randomizer_SetSpoilerLoaded(bool spoilerLoaded);
|
void Randomizer_SetSpoilerLoaded(bool spoilerLoaded);
|
||||||
uint8_t Randomizer_GenerateRandomizer();
|
uint8_t Randomizer_GenerateRandomizer();
|
||||||
void Randomizer_ShowRandomizerMenu();
|
void Randomizer_ShowRandomizerMenu();
|
||||||
|
void Archipelago_Connect();
|
||||||
|
void Archipelago_Disconnect();
|
||||||
|
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);
|
||||||
void Overlay_DisplayText_Seconds(int seconds, const char* text);
|
void Overlay_DisplayText_Seconds(int seconds, const char* text);
|
||||||
|
|||||||
@@ -258,4 +258,8 @@ void RegisterPopup(std::string title, std::string message, std::string button1,
|
|||||||
void ShowRandomizerSettingsMenu() {
|
void ShowRandomizerSettingsMenu() {
|
||||||
mRandomizerSettingsWindow->Show();
|
mRandomizerSettingsWindow->Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ShowArchipelagoSettingsMenu() {
|
||||||
|
mArchipelagoSettingsWindow->Show();
|
||||||
|
}
|
||||||
} // namespace SohGui
|
} // namespace SohGui
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ void Destroy();
|
|||||||
void RegisterPopup(std::string title, std::string message, std::string button1 = "OK", std::string button2 = "",
|
void RegisterPopup(std::string title, std::string message, std::string button1 = "OK", std::string button2 = "",
|
||||||
std::function<void()> button1callback = nullptr, std::function<void()> button2callback = nullptr);
|
std::function<void()> button1callback = nullptr, std::function<void()> button2callback = nullptr);
|
||||||
void ShowRandomizerSettingsMenu();
|
void ShowRandomizerSettingsMenu();
|
||||||
|
void ShowArchipelagoSettingsMenu();
|
||||||
UIWidgets::Colors GetMenuThemeColor();
|
UIWidgets::Colors GetMenuThemeColor();
|
||||||
} // namespace SohGui
|
} // namespace SohGui
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,11 @@ typedef enum {
|
|||||||
CM_START_RANDOMIZER_SETTINGS_MENU,
|
CM_START_RANDOMIZER_SETTINGS_MENU,
|
||||||
CM_RANDOMIZER_SETTINGS_MENU_TO_QUEST,
|
CM_RANDOMIZER_SETTINGS_MENU_TO_QUEST,
|
||||||
CM_NAME_ENTRY_TO_RANDOMIZER_SETTINGS_MENU,
|
CM_NAME_ENTRY_TO_RANDOMIZER_SETTINGS_MENU,
|
||||||
|
CM_ROTATE_TO_ARCHIPELAGO_MENU,
|
||||||
|
CM_ARCHIPELAGO_SETTINGS_MENU,
|
||||||
|
CM_START_ARCHIPELAGO_SETTINGS_MENU,
|
||||||
|
CM_ARCHIPELAGO_SETTINGS_TO_QUEST,
|
||||||
|
CM_NAME_ENTRY_TO_ARCHIPELAGO_SETTINGS_MENU,
|
||||||
} ConfigMode;
|
} ConfigMode;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|||||||
@@ -704,7 +704,7 @@ static void DrawMoreInfo(FileChooseContext* this, s16 fileIndex, u8 alpha) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define MIN_QUEST (ResourceMgr_GameHasOriginal() ? QUEST_NORMAL : QUEST_MASTER)
|
#define MIN_QUEST (ResourceMgr_GameHasOriginal() ? QUEST_NORMAL : QUEST_MASTER)
|
||||||
#define MAX_QUEST QUEST_BOSSRUSH
|
#define MAX_QUEST QUEST_ARCHIPELAGO
|
||||||
|
|
||||||
void Sram_InitDebugSave(void);
|
void Sram_InitDebugSave(void);
|
||||||
void Sram_InitBossRushSave();
|
void Sram_InitBossRushSave();
|
||||||
@@ -1031,7 +1031,6 @@ void DrawSeedHashSprites(FileChooseContext* this) {
|
|||||||
u8 generating;
|
u8 generating;
|
||||||
int retries = 0;
|
int retries = 0;
|
||||||
bool fileSelectSpoilerFileLoaded = false;
|
bool fileSelectSpoilerFileLoaded = false;
|
||||||
bool fileSelectArchipelagoLoaded = false;
|
|
||||||
|
|
||||||
void FileChoose_UpdateRandomizer() {
|
void FileChoose_UpdateRandomizer() {
|
||||||
if (CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0) != 0 && generating == 0) {
|
if (CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0) != 0 && generating == 0) {
|
||||||
@@ -1053,7 +1052,6 @@ void FileChoose_UpdateRandomizer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!SpoilerFileExists(CVarGetString(CVAR_GENERAL("SpoilerLog"), "")) &&
|
if (!SpoilerFileExists(CVarGetString(CVAR_GENERAL("SpoilerLog"), "")) &&
|
||||||
!fileSelectArchipelagoLoaded &&
|
|
||||||
!CVarGetInteger(CVAR_RANDOMIZER_SETTING("DontGenerateSpoiler"), 0)) {
|
!CVarGetInteger(CVAR_RANDOMIZER_SETTING("DontGenerateSpoiler"), 0)) {
|
||||||
CVarSetString(CVAR_GENERAL("SpoilerLog"), "");
|
CVarSetString(CVAR_GENERAL("SpoilerLog"), "");
|
||||||
Randomizer_SetSpoilerLoaded(false);
|
Randomizer_SetSpoilerLoaded(false);
|
||||||
@@ -1083,12 +1081,6 @@ void FileChoose_UpdateRandomizer() {
|
|||||||
remove(fileLoc);
|
remove(fileLoc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CVarGetInteger(CVAR_REMOTE_ARCHIPELAGO("Connected"), 0) && !fileSelectArchipelagoLoaded) {
|
|
||||||
ParseArchipelago();
|
|
||||||
fileSelectArchipelagoLoaded = true;
|
|
||||||
Audio_PlayFanfare(NA_BGM_HORSE_GOAL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static s16 sLastFileChooseButtonIndex;
|
static s16 sLastFileChooseButtonIndex;
|
||||||
@@ -1364,6 +1356,11 @@ void FileChoose_UpdateQuestMenu(GameState* thisx) {
|
|||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
this->prevConfigMode = this->configMode;
|
this->prevConfigMode = this->configMode;
|
||||||
this->configMode = CM_ROTATE_TO_RANDOMIZER_SETTINGS_MENU;
|
this->configMode = CM_ROTATE_TO_RANDOMIZER_SETTINGS_MENU;
|
||||||
|
} else if (this->questType[this->buttonIndex] == QUEST_ARCHIPELAGO) {
|
||||||
|
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||||
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
|
this->prevConfigMode = this->configMode;
|
||||||
|
this->configMode = CM_ROTATE_TO_ARCHIPELAGO_MENU;
|
||||||
} else {
|
} else {
|
||||||
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
@@ -1644,7 +1641,8 @@ void FileChoose_RotateToNameEntry(GameState* thisx) {
|
|||||||
|
|
||||||
this->windowRot += VREG(16);
|
this->windowRot += VREG(16);
|
||||||
|
|
||||||
if (this->prevConfigMode == CM_RANDOMIZER_SETTINGS_MENU) {
|
if (this->prevConfigMode == CM_RANDOMIZER_SETTINGS_MENU ||
|
||||||
|
this->prevConfigMode == CM_ARCHIPELAGO_SETTINGS_MENU) {
|
||||||
if (this->windowRot >= 942.0f) {
|
if (this->windowRot >= 942.0f) {
|
||||||
this->windowRot = 628.0f;
|
this->windowRot = 628.0f;
|
||||||
this->configMode = CM_START_NAME_ENTRY;
|
this->configMode = CM_START_NAME_ENTRY;
|
||||||
@@ -1701,7 +1699,8 @@ void FileChoose_RotateToQuest(GameState* thisx) {
|
|||||||
FileChooseContext* this = (FileChooseContext*)thisx;
|
FileChooseContext* this = (FileChooseContext*)thisx;
|
||||||
|
|
||||||
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->windowRot -= VREG(16);
|
this->windowRot -= VREG(16);
|
||||||
|
|
||||||
if (this->windowRot <= 314.0f) {
|
if (this->windowRot <= 314.0f) {
|
||||||
@@ -1749,6 +1748,130 @@ void FileChoose_RotateToRandomizer(GameState* thisx) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FileChoose_RotateToArchipelago(GameState* thisx) {
|
||||||
|
FileChooseContext* this = (FileChooseContext*)thisx;
|
||||||
|
|
||||||
|
if (this->configMode == CM_NAME_ENTRY_TO_ARCHIPELAGO_SETTINGS_MENU ) {
|
||||||
|
this->windowRot -= VREG(16);
|
||||||
|
|
||||||
|
if (this->windowRot <= 314.0f) {
|
||||||
|
this->windowRot = 628.0f;
|
||||||
|
this->configMode = CM_START_ARCHIPELAGO_SETTINGS_MENU;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this->windowRot += VREG(16);
|
||||||
|
|
||||||
|
if (this->windowRot >= 628.0f) {
|
||||||
|
this->windowRot = 628.0f;
|
||||||
|
this->configMode = CM_START_ARCHIPELAGO_SETTINGS_MENU;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void FileChoose_UpdateArchipelagoMenu(GameState* thisx) {
|
||||||
|
FileChooseContext* this = (FileChooseContext*)thisx;
|
||||||
|
Input* input = &this->state.input[0];
|
||||||
|
bool dpad = CVarGetInteger(CVAR_SETTING("DpadInText"), 0);
|
||||||
|
|
||||||
|
// Fade in elements after opening Archipelago Options menu
|
||||||
|
this->archipelagoUIAlpha += 25;
|
||||||
|
if (this->archipelagoUIAlpha > 255) {
|
||||||
|
this->archipelagoUIAlpha = 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Move menu selection up or down
|
||||||
|
if(ABS(this->stickRelY) > 30 || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) {
|
||||||
|
// move down
|
||||||
|
if(this->stickRelY < -30 || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN))) {
|
||||||
|
if ((this->archipelagoIndex + 1) > ASM_CHANGE_CONNECTION_INFO) {
|
||||||
|
this->archipelagoIndex = ASM_START_ARCHIPELAGO;
|
||||||
|
} else {
|
||||||
|
this->archipelagoIndex++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (((int8_t)this->archipelagoIndex - 1) < ASM_START_ARCHIPELAGO) {
|
||||||
|
this->archipelagoIndex = ASM_CHANGE_CONNECTION_INFO;
|
||||||
|
} else {
|
||||||
|
this->archipelagoIndex--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||||
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CHECK_BTN_ALL(input->press.button, BTN_B)) {
|
||||||
|
this->configMode = CM_ARCHIPELAGO_SETTINGS_TO_QUEST;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CHECK_BTN_ALL(input->press.button, BTN_A)) {
|
||||||
|
if (this->archipelagoIndex == ASM_START_ARCHIPELAGO) {
|
||||||
|
uint16_t testnumber = CVarGetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 0);
|
||||||
|
// Only continue when connected to a slot and locations are scouted.
|
||||||
|
if (CVarGetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 0) != 4) {
|
||||||
|
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||||
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||||
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
|
ParseArchipelago();
|
||||||
|
static u8 emptyName[] = { 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E };
|
||||||
|
static u8 emptyNameNES[] = { 0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF };
|
||||||
|
static u8 linkName[] = { 0x15, 0x2C, 0x31, 0x2E, 0x3E, 0x3E, 0x3E, 0x3E };
|
||||||
|
static u8 linkNameNES[] = { 0xB6, 0xB3, 0xB8, 0xB5, 0xDF, 0xDF, 0xDF, 0xDF };
|
||||||
|
static u8 linkNameJP[] = { 0x81, 0x87, 0x61, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF };
|
||||||
|
u8* defaultName;
|
||||||
|
|
||||||
|
this->prevConfigMode = this->configMode;
|
||||||
|
this->configMode = CM_ROTATE_TO_NAME_ENTRY;
|
||||||
|
this->logoAlpha = 0;
|
||||||
|
CVarSetInteger(CVAR_GENERAL("OnFileSelectNameEntry"), 1);
|
||||||
|
this->kbdButton = FS_KBD_BTN_NONE;
|
||||||
|
this->charPage = FS_CHAR_PAGE_ENG;
|
||||||
|
this->kbdX = 0;
|
||||||
|
this->kbdY = 0;
|
||||||
|
this->charIndex = 0;
|
||||||
|
this->charBgAlpha = 0;
|
||||||
|
this->newFileNameCharCount = CVarGetInteger(CVAR_ENHANCEMENT("LinkDefaultName"), 0) ? 4 : 0;
|
||||||
|
this->nameEntryBoxPosX = 120;
|
||||||
|
this->nameEntryBoxAlpha = 0;
|
||||||
|
if (ResourceMgr_GetGameRegion(0) == GAME_REGION_PAL && gSaveContext.language != LANGUAGE_JPN) {
|
||||||
|
defaultName = CVarGetInteger(CVAR_ENHANCEMENT("LinkDefaultName"), 0) ? &linkName : &emptyName;
|
||||||
|
} else if (gSaveContext.language == LANGUAGE_JPN) { // Japanese
|
||||||
|
if (CVarGetInteger(CVAR_ENHANCEMENT("LinkDefaultName"), 0) != 0) {
|
||||||
|
// Set player name to "リンク" ("Link" in Katakana, 3 characters long) when playing in Japanese.
|
||||||
|
defaultName = &linkNameJP;
|
||||||
|
this->newFileNameCharCount = 3;
|
||||||
|
} else {
|
||||||
|
defaultName = &emptyNameNES;
|
||||||
|
}
|
||||||
|
this->charPage = FS_CHAR_PAGE_HIRA; // Default to Hiragana Keyboard
|
||||||
|
} else { // GAME_REGION_NTSC
|
||||||
|
defaultName = CVarGetInteger(CVAR_ENHANCEMENT("LinkDefaultName"), 0) ? &linkNameNES : &emptyNameNES;
|
||||||
|
}
|
||||||
|
memcpy(Save_GetSaveMetaInfo(this->buttonIndex)->playerName, defaultName, 8);
|
||||||
|
} else if (this->archipelagoIndex == ASM_CHANGE_CONNECTION_INFO) {
|
||||||
|
Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||||
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||||
|
Archipelago_ShowArchipelagoMenu();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void FileChoose_StartArchipelagoMenu(GameState* thisx) {
|
||||||
|
FileChooseContext* this = (FileChooseContext*)thisx;
|
||||||
|
|
||||||
|
this->logoAlpha -= 25;
|
||||||
|
this->archipelagoUIAlpha = 0;
|
||||||
|
this->archipelagoArrowOffset = 0;
|
||||||
|
|
||||||
|
if (this->logoAlpha <= 0) {
|
||||||
|
this->logoAlpha = 0;
|
||||||
|
this->configMode = CM_ARCHIPELAGO_SETTINGS_MENU;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void (*gConfigModeUpdateFuncs[])(GameState*) = {
|
static void (*gConfigModeUpdateFuncs[])(GameState*) = {
|
||||||
FileChoose_StartFadeIn, FileChoose_FinishFadeIn,
|
FileChoose_StartFadeIn, FileChoose_FinishFadeIn,
|
||||||
FileChoose_UpdateMainMenu, FileChoose_SetupCopySource,
|
FileChoose_UpdateMainMenu, FileChoose_SetupCopySource,
|
||||||
@@ -1777,7 +1900,9 @@ static void (*gConfigModeUpdateFuncs[])(GameState*) = {
|
|||||||
FileChoose_StartBossRushMenu, FileChoose_RotateToQuest,
|
FileChoose_StartBossRushMenu, FileChoose_RotateToQuest,
|
||||||
FileChoose_RotateToRandomizer, FileChoose_UpdateRandomizerMenu,
|
FileChoose_RotateToRandomizer, FileChoose_UpdateRandomizerMenu,
|
||||||
FileChoose_StartRandomizerMenu, FileChoose_RotateToQuest,
|
FileChoose_StartRandomizerMenu, FileChoose_RotateToQuest,
|
||||||
FileChoose_RotateToRandomizer,
|
FileChoose_RotateToRandomizer, FileChoose_RotateToArchipelago,
|
||||||
|
FileChoose_UpdateArchipelagoMenu, FileChoose_StartArchipelagoMenu,
|
||||||
|
FileChoose_RotateToQuest, FileChoose_RotateToArchipelago
|
||||||
};
|
};
|
||||||
|
|
||||||
static void (*gConfigModeUpdateFuncsNES[])(GameState*) = {
|
static void (*gConfigModeUpdateFuncsNES[])(GameState*) = {
|
||||||
@@ -1808,7 +1933,9 @@ static void (*gConfigModeUpdateFuncsNES[])(GameState*) = {
|
|||||||
FileChoose_StartBossRushMenu, FileChoose_RotateToQuest,
|
FileChoose_StartBossRushMenu, FileChoose_RotateToQuest,
|
||||||
FileChoose_RotateToRandomizer, FileChoose_UpdateRandomizerMenu,
|
FileChoose_RotateToRandomizer, FileChoose_UpdateRandomizerMenu,
|
||||||
FileChoose_StartRandomizerMenu, FileChoose_RotateToQuest,
|
FileChoose_StartRandomizerMenu, FileChoose_RotateToQuest,
|
||||||
FileChoose_RotateToRandomizer,
|
FileChoose_RotateToRandomizer, FileChoose_RotateToArchipelago,
|
||||||
|
FileChoose_UpdateArchipelagoMenu, FileChoose_StartArchipelagoMenu,
|
||||||
|
FileChoose_RotateToQuest, FileChoose_RotateToArchipelago
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2471,6 +2598,7 @@ void FileChoose_DrawWindowContents(GameState* thisx) {
|
|||||||
case CM_NAME_ENTRY_TO_QUEST_MENU:
|
case CM_NAME_ENTRY_TO_QUEST_MENU:
|
||||||
case CM_ROTATE_TO_BOSS_RUSH_MENU:
|
case CM_ROTATE_TO_BOSS_RUSH_MENU:
|
||||||
case CM_ROTATE_TO_RANDOMIZER_SETTINGS_MENU:
|
case CM_ROTATE_TO_RANDOMIZER_SETTINGS_MENU:
|
||||||
|
case CM_ROTATE_TO_ARCHIPELAGO_MENU:
|
||||||
tex = FileChoose_GetQuestChooseTitleTexName(gSaveContext.language);
|
tex = FileChoose_GetQuestChooseTitleTexName(gSaveContext.language);
|
||||||
break;
|
break;
|
||||||
case CM_BOSS_RUSH_MENU:
|
case CM_BOSS_RUSH_MENU:
|
||||||
@@ -2480,6 +2608,10 @@ void FileChoose_DrawWindowContents(GameState* thisx) {
|
|||||||
case CM_START_RANDOMIZER_SETTINGS_MENU:
|
case CM_START_RANDOMIZER_SETTINGS_MENU:
|
||||||
case CM_RANDOMIZER_SETTINGS_MENU_TO_QUEST:
|
case CM_RANDOMIZER_SETTINGS_MENU_TO_QUEST:
|
||||||
case CM_NAME_ENTRY_TO_RANDOMIZER_SETTINGS_MENU:
|
case CM_NAME_ENTRY_TO_RANDOMIZER_SETTINGS_MENU:
|
||||||
|
case CM_START_ARCHIPELAGO_SETTINGS_MENU:
|
||||||
|
case CM_ARCHIPELAGO_SETTINGS_MENU:
|
||||||
|
case CM_ARCHIPELAGO_SETTINGS_TO_QUEST:
|
||||||
|
case CM_NAME_ENTRY_TO_ARCHIPELAGO_SETTINGS_MENU:
|
||||||
tex = FileChoose_GetSohOptionsTitleTexName(gSaveContext.language);
|
tex = FileChoose_GetSohOptionsTitleTexName(gSaveContext.language);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -2596,6 +2728,17 @@ void FileChoose_DrawWindowContents(GameState* thisx) {
|
|||||||
ResourceMgr_GameHasOriginal() ? gTitleZeldaShieldLogoTex : gTitleZeldaShieldLogoMQTex, 160, 160);
|
ResourceMgr_GameHasOriginal() ? gTitleZeldaShieldLogoTex : gTitleZeldaShieldLogoMQTex, 160, 160);
|
||||||
FileChoose_DrawImageRGBA32(this->state.gfxCtx, 182, 180, gTitleBossRushSubtitleTex, 128, 32);
|
FileChoose_DrawImageRGBA32(this->state.gfxCtx, 182, 180, gTitleBossRushSubtitleTex, 128, 32);
|
||||||
break;
|
break;
|
||||||
|
case QUEST_ARCHIPELAGO:
|
||||||
|
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->logoAlpha);
|
||||||
|
FileChoose_DrawTextureI8(this->state.gfxCtx, gTitleTheLegendOfTextTex, 72, 8, 156, 108, 72, 8, 1024,
|
||||||
|
1024);
|
||||||
|
FileChoose_DrawTextureI8(this->state.gfxCtx, gTitleOcarinaOfTimeTMTextTex, 96, 8, 154, 163, 96, 8, 1024,
|
||||||
|
1024);
|
||||||
|
FileChoose_DrawImageRGBA32(
|
||||||
|
this->state.gfxCtx, 160, 135,
|
||||||
|
ResourceMgr_GameHasOriginal() ? gTitleZeldaShieldLogoTex : gTitleZeldaShieldLogoMQTex, 160, 160);
|
||||||
|
FileChoose_DrawImageRGBA32(this->state.gfxCtx, 182, 180, gTitleArchipelagoSubtitleTex, 128, 32);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else if (this->configMode == CM_BOSS_RUSH_MENU) {
|
} else if (this->configMode == CM_BOSS_RUSH_MENU) {
|
||||||
uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : gSaveContext.language;
|
uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : gSaveContext.language;
|
||||||
@@ -2676,13 +2819,13 @@ void FileChoose_DrawWindowContents(GameState* thisx) {
|
|||||||
textColorR = textColorG = textColorB = 100;
|
textColorR = textColorG = textColorB = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
Interface_DrawTextLine(this->state.gfxCtx, SohFileSelect_GetSettingText(index, language), 70,
|
Interface_DrawTextLine(this->state.gfxCtx, SohFileSelect_GetRandomizerSettingText(index, language), 70,
|
||||||
(80 + (index * 16)), textColorR, textColorG, textColorB, textAlpha, 0.8f, true);
|
(80 + (index * 16)), textColorR, textColorG, textColorB, textAlpha, 0.8f, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show text to indicate randomizer is being generated.
|
// Show text to indicate randomizer is being generated.
|
||||||
if (generating) {
|
if (generating) {
|
||||||
Interface_DrawTextLine(this->state.gfxCtx, SohFileSelect_GetSettingText(RSM_GENERATING, language), 70,
|
Interface_DrawTextLine(this->state.gfxCtx, SohFileSelect_GetRandomizerSettingText(RSM_GENERATING, language), 70,
|
||||||
(80 + 64), 255, 255, 255, textAlpha, 0.8f, true);
|
(80 + 64), 255, 255, 255, textAlpha, 0.8f, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2691,7 +2834,7 @@ void FileChoose_DrawWindowContents(GameState* thisx) {
|
|||||||
if (!Randomizer_IsSeedGenerated() && !Randomizer_IsSpoilerLoaded() &&
|
if (!Randomizer_IsSeedGenerated() && !Randomizer_IsSpoilerLoaded() &&
|
||||||
this->randomizerIndex == RSM_START_RANDOMIZER) {
|
this->randomizerIndex == RSM_START_RANDOMIZER) {
|
||||||
Interface_DrawTextLine(this->state.gfxCtx,
|
Interface_DrawTextLine(this->state.gfxCtx,
|
||||||
SohFileSelect_GetSettingText(RSM_NO_RANDOMIZER_GENERATED, language), 70, (80 + 64),
|
SohFileSelect_GetRandomizerSettingText(RSM_NO_RANDOMIZER_GENERATED, language), 70, (80 + 64),
|
||||||
240, 80, 80, textAlpha, 0.8f, true);
|
240, 80, 80, textAlpha, 0.8f, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2705,12 +2848,91 @@ void FileChoose_DrawWindowContents(GameState* thisx) {
|
|||||||
this->stickRightPrompt.arrowColorG, this->stickRightPrompt.arrowColorB, textAlpha, 62,
|
this->stickRightPrompt.arrowColorG, this->stickRightPrompt.arrowColorB, textAlpha, 62,
|
||||||
(85 + textOffset), 0.42f, 0, 0, 1.0f, 1.0f);
|
(85 + textOffset), 0.42f, 0, 0, 1.0f, 1.0f);
|
||||||
|
|
||||||
|
} else if (this->configMode == CM_ARCHIPELAGO_SETTINGS_MENU) {
|
||||||
|
uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : gSaveContext.language;
|
||||||
|
uint8_t textAlpha = this->archipelagoUIAlpha;
|
||||||
|
|
||||||
|
uint8_t textIndex = 0;
|
||||||
|
|
||||||
|
for (uint8_t index = 0; index <= ASM_CHANGE_CONNECTION_INFO; index++) {
|
||||||
|
uint8_t textColorR = 255;
|
||||||
|
uint8_t textColorG = 255;
|
||||||
|
uint8_t textColorB = 255;
|
||||||
|
|
||||||
|
// If current index is the selected one, make the text yellow.
|
||||||
|
if (this->archipelagoIndex == index) {
|
||||||
|
textColorB = 80;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If not connected, make Start Archipelago text gray.
|
||||||
|
if (index == ASM_START_ARCHIPELAGO && CVarGetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 0) != 4) {
|
||||||
|
textColorR = textColorG = textColorB = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
Interface_DrawTextLine(this->state.gfxCtx, SohFileSelect_GetArchipelagoSettingText(index, language), 70,
|
||||||
|
(80 + index * 16), textColorR, textColorG, textColorB, textAlpha, 0.8f,
|
||||||
|
true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Server address text
|
||||||
|
Interface_DrawTextLine(this->state.gfxCtx,
|
||||||
|
SohFileSelect_GetArchipelagoSettingText(ASM_SERVER_ADDRESS, language), 70,
|
||||||
|
120, 255, 255, 255, textAlpha, 0.8f, true);
|
||||||
|
textIndex++;
|
||||||
|
Interface_DrawTextLine(this->state.gfxCtx, CVarGetString(CVAR_REMOTE_ARCHIPELAGO("ServerAddress"), "No Data"),
|
||||||
|
70, 130, 185, 185, 185, textAlpha, 0.8f, true);
|
||||||
|
|
||||||
|
// Slot name text
|
||||||
|
textIndex++;
|
||||||
|
Interface_DrawTextLine(this->state.gfxCtx, SohFileSelect_GetArchipelagoSettingText(ASM_SLOT_NAME, language), 70,
|
||||||
|
145, 255, 255, 255, textAlpha, 0.8f, true);
|
||||||
|
textIndex++;
|
||||||
|
Interface_DrawTextLine(this->state.gfxCtx, CVarGetString(CVAR_REMOTE_ARCHIPELAGO("SlotName"), "No Data"), 70,
|
||||||
|
155, 185, 185, 185, textAlpha, 0.8f, true);
|
||||||
|
|
||||||
|
// Connection status text
|
||||||
|
Interface_DrawTextLine(this->state.gfxCtx, SohFileSelect_GetArchipelagoSettingText(ASM_STATUS, language),
|
||||||
|
70, 175, 255, 255, 255, textAlpha, 0.8f, true);
|
||||||
|
|
||||||
|
switch(CVarGetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 0)) {
|
||||||
|
case 0: // Not Connected
|
||||||
|
Interface_DrawTextLine(this->state.gfxCtx,
|
||||||
|
SohFileSelect_GetArchipelagoSettingText(ASM_NOT_CONNECTED, language), 110, 175,
|
||||||
|
255, 120, 120, textAlpha, 0.8f, true);
|
||||||
|
break;
|
||||||
|
case 1: // Connecting
|
||||||
|
case 2: // Connection error, retrying
|
||||||
|
case 3: // Connected
|
||||||
|
Interface_DrawTextLine(this->state.gfxCtx,
|
||||||
|
SohFileSelect_GetArchipelagoSettingText(ASM_CONNECTING, language), 110, 175, 185,
|
||||||
|
185, 185, textAlpha, 0.8f, true);
|
||||||
|
break;
|
||||||
|
case 4: // Connected + Locations Scouted
|
||||||
|
Interface_DrawTextLine(this->state.gfxCtx,
|
||||||
|
SohFileSelect_GetArchipelagoSettingText(ASM_CONNECTED, language), 110, 175, 120,
|
||||||
|
255, 120, textAlpha, 0.8f, true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Gfx_SetupDL_39Opa(this->state.gfxCtx);
|
||||||
|
gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
||||||
|
gDPLoadTextureBlock(POLY_OPA_DISP++, gArrowCursorTex, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 24, 0,
|
||||||
|
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOMASK, G_TX_NOLOD,
|
||||||
|
G_TX_NOLOD);
|
||||||
|
FileChoose_DrawTextRec(this->state.gfxCtx, this->stickRightPrompt.arrowColorR,
|
||||||
|
this->stickRightPrompt.arrowColorG, this->stickRightPrompt.arrowColorB, textAlpha, 62,
|
||||||
|
(85 + (this->archipelagoIndex * 16)), 0.42f, 0, 0, 1.0f, 1.0f);
|
||||||
|
|
||||||
} else if (this->configMode != CM_ROTATE_TO_NAME_ENTRY && this->configMode != CM_START_BOSS_RUSH_MENU &&
|
} else if (this->configMode != CM_ROTATE_TO_NAME_ENTRY && this->configMode != CM_START_BOSS_RUSH_MENU &&
|
||||||
this->configMode != CM_ROTATE_TO_BOSS_RUSH_MENU && this->configMode != CM_BOSS_RUSH_TO_QUEST &&
|
this->configMode != CM_ROTATE_TO_BOSS_RUSH_MENU && this->configMode != CM_BOSS_RUSH_TO_QUEST &&
|
||||||
this->configMode != CM_START_RANDOMIZER_SETTINGS_MENU &&
|
this->configMode != CM_START_RANDOMIZER_SETTINGS_MENU &&
|
||||||
this->configMode != CM_ROTATE_TO_RANDOMIZER_SETTINGS_MENU &&
|
this->configMode != CM_ROTATE_TO_RANDOMIZER_SETTINGS_MENU &&
|
||||||
this->configMode != CM_RANDOMIZER_SETTINGS_MENU_TO_QUEST &&
|
this->configMode != CM_RANDOMIZER_SETTINGS_MENU_TO_QUEST &&
|
||||||
this->configMode != CM_NAME_ENTRY_TO_RANDOMIZER_SETTINGS_MENU) {
|
this->configMode != CM_NAME_ENTRY_TO_RANDOMIZER_SETTINGS_MENU &&
|
||||||
|
this->configMode != CM_START_ARCHIPELAGO_SETTINGS_MENU &&
|
||||||
|
this->configMode != CM_ROTATE_TO_ARCHIPELAGO_MENU &&
|
||||||
|
this->configMode != CM_ARCHIPELAGO_SETTINGS_TO_QUEST &&
|
||||||
|
this->configMode != CM_NAME_ENTRY_TO_ARCHIPELAGO_SETTINGS_MENU) {
|
||||||
gDPPipeSync(POLY_OPA_DISP++);
|
gDPPipeSync(POLY_OPA_DISP++);
|
||||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->titleAlpha[1]);
|
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->titleAlpha[1]);
|
||||||
gDPLoadTextureBlock(POLY_OPA_DISP++, sTitleLabels[gSaveContext.language][this->nextTitleLabel], G_IM_FMT_IA,
|
gDPLoadTextureBlock(POLY_OPA_DISP++, sTitleLabels[gSaveContext.language][this->nextTitleLabel], G_IM_FMT_IA,
|
||||||
@@ -2962,7 +3184,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],
|
||||||
@@ -3071,7 +3295,10 @@ void FileChoose_ConfigModeDraw(GameState* thisx) {
|
|||||||
this->configMode == CM_ROTATE_TO_NAME_ENTRY || this->configMode == CM_QUEST_TO_MAIN ||
|
this->configMode == CM_ROTATE_TO_NAME_ENTRY || this->configMode == CM_QUEST_TO_MAIN ||
|
||||||
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_NAME_ENTRY_TO_RANDOMIZER_SETTINGS_MENU) {
|
this->configMode == CM_ROTATE_TO_ARCHIPELAGO_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);
|
||||||
@@ -3104,7 +3331,11 @@ void FileChoose_ConfigModeDraw(GameState* thisx) {
|
|||||||
this->configMode == CM_START_BOSS_RUSH_MENU || this->configMode == CM_BOSS_RUSH_TO_QUEST ||
|
this->configMode == CM_START_BOSS_RUSH_MENU || this->configMode == CM_BOSS_RUSH_TO_QUEST ||
|
||||||
this->configMode == CM_RANDOMIZER_SETTINGS_MENU || this->configMode == CM_ROTATE_TO_RANDOMIZER_SETTINGS_MENU ||
|
this->configMode == CM_RANDOMIZER_SETTINGS_MENU || this->configMode == CM_ROTATE_TO_RANDOMIZER_SETTINGS_MENU ||
|
||||||
this->configMode == CM_START_RANDOMIZER_SETTINGS_MENU ||
|
this->configMode == CM_START_RANDOMIZER_SETTINGS_MENU ||
|
||||||
this->configMode == CM_RANDOMIZER_SETTINGS_MENU_TO_QUEST) {
|
this->configMode == CM_RANDOMIZER_SETTINGS_MENU_TO_QUEST ||
|
||||||
|
this->configMode == CM_START_ARCHIPELAGO_SETTINGS_MENU ||
|
||||||
|
this->configMode == CM_ARCHIPELAGO_SETTINGS_MENU ||
|
||||||
|
this->configMode == CM_ROTATE_TO_ARCHIPELAGO_MENU ||
|
||||||
|
this->configMode == CM_ARCHIPELAGO_SETTINGS_TO_QUEST) {
|
||||||
// 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);
|
||||||
@@ -3918,6 +4149,7 @@ void FileChoose_InitContext(GameState* thisx) {
|
|||||||
this->bossRushIndex = 0;
|
this->bossRushIndex = 0;
|
||||||
this->bossRushOffset = 0;
|
this->bossRushOffset = 0;
|
||||||
this->randomizerIndex = 0;
|
this->randomizerIndex = 0;
|
||||||
|
this->archipelagoIndex = 0;
|
||||||
|
|
||||||
ShrinkWindow_SetVal(0);
|
ShrinkWindow_SetVal(0);
|
||||||
|
|
||||||
@@ -3965,7 +4197,6 @@ void FileChoose_Init(GameState* thisx) {
|
|||||||
this->questType[1] = MIN_QUEST;
|
this->questType[1] = MIN_QUEST;
|
||||||
this->questType[2] = MIN_QUEST;
|
this->questType[2] = MIN_QUEST;
|
||||||
fileSelectSpoilerFileLoaded = false;
|
fileSelectSpoilerFileLoaded = false;
|
||||||
fileSelectArchipelagoLoaded = false;
|
|
||||||
CVarSetInteger(CVAR_GENERAL("OnFileSelectNameEntry"), 0);
|
CVarSetInteger(CVAR_GENERAL("OnFileSelectNameEntry"), 0);
|
||||||
|
|
||||||
SREG(30) = 1;
|
SREG(30) = 1;
|
||||||
|
|||||||
@@ -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