clang format

This commit is contained in:
aMannus
2025-07-31 10:44:47 +02:00
parent e53d29e12d
commit 00a70eae87
7 changed files with 114 additions and 111 deletions

View File

@@ -111,13 +111,13 @@ std::array<std::string, LANGUAGE_MAX> ArchipelagoSettingsMenuText[ASM_MAX]{
"Todo", "Todo",
"Todo", "Todo",
}, },
//ASM_CHAR_START_TO_CONNECT // ASM_CHAR_START_TO_CONNECT
{ {
"Start to automatically connect to this slot", "Start to automatically connect to this slot",
"Todo", "Todo",
"Todo", "Todo",
}, },
//ASM_CHAR_SELECT_CONNECTED_TO_OTHER_SLOT // ASM_CHAR_SELECT_CONNECTED_TO_OTHER_SLOT
{ {
"Connected to a different slot", "Connected to a different slot",
"Todo", "Todo",

View File

@@ -53,9 +53,7 @@ bool ArchipelagoClient::StartClient() {
uri = CVarGetString(CVAR_REMOTE_ARCHIPELAGO("ServerAddress"), "localhost:38281"); uri = CVarGetString(CVAR_REMOTE_ARCHIPELAGO("ServerAddress"), "localhost:38281");
password = CVarGetString(CVAR_REMOTE_ARCHIPELAGO("Password"), ""); password = CVarGetString(CVAR_REMOTE_ARCHIPELAGO("Password"), "");
apClient = std::unique_ptr<APClient>( apClient = std::unique_ptr<APClient>(new APClient(uuid, AP_Client_consts::AP_GAME_NAME, uri, "cacert.pem"));
new APClient(uuid, AP_Client_consts::AP_GAME_NAME,
uri, "cacert.pem"));
CVarSetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 1); // Connecting CVarSetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 1); // Connecting
@@ -67,7 +65,7 @@ bool ArchipelagoClient::StartClient() {
CVarSetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 2); // Connection error CVarSetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 2); // Connection error
disconnecting = true; disconnecting = true;
if(GameInteractor::IsSaveLoaded) { if (GameInteractor::IsSaveLoaded) {
SohGui::ShowArchipelagoSettingsMenu(); SohGui::ShowArchipelagoSettingsMenu();
} }
return; return;
@@ -80,8 +78,7 @@ bool ArchipelagoClient::StartClient() {
if (CVarGetInteger(CVAR_REMOTE_ARCHIPELAGO("DeathLink"), 0)) { if (CVarGetInteger(CVAR_REMOTE_ARCHIPELAGO("DeathLink"), 0)) {
tags.push_back("DeathLink"); tags.push_back("DeathLink");
} }
apClient->ConnectSlot(CVarGetString(CVAR_REMOTE_ARCHIPELAGO("SlotName"), ""), apClient->ConnectSlot(CVarGetString(CVAR_REMOTE_ARCHIPELAGO("SlotName"), ""), password, 0b001, tags);
password, 0b001, tags);
}); });
apClient->set_slot_connected_handler([&](const nlohmann::json data) { apClient->set_slot_connected_handler([&](const nlohmann::json data) {
@@ -234,19 +231,20 @@ bool ArchipelagoClient::StartClient() {
}); });
apClient->set_bounced_handler([&](const nlohmann::json data) { apClient->set_bounced_handler([&](const nlohmann::json data) {
if(data.contains("tags")) { if (data.contains("tags")) {
std::list<std::string> tags = data["tags"]; std::list<std::string> tags = data["tags"];
bool deathLink = (std::find(tags.begin(), tags.end(), "DeathLink") != tags.end()); bool deathLink = (std::find(tags.begin(), tags.end(), "DeathLink") != tags.end());
if (deathLink && data["data"]["source"] != apClient->get_slot()) { if (deathLink && data["data"]["source"] != apClient->get_slot()) {
if (GameInteractor::IsSaveLoaded()) { if (GameInteractor::IsSaveLoaded()) {
gSaveContext.health = 0; gSaveContext.health = 0;
std::string prefixText = std::string(data["data"]["source"]) + " died."; std::string prefixText = std::string(data["data"]["source"]) + " died.";
Notification::Emit({ .prefix = prefixText, .message = "Cause:", .suffix = data["data"]["cause"] }); Notification::Emit({ .prefix = prefixText, .message = "Cause:", .suffix = data["data"]["cause"] });
std::string deathLinkMessage = "[LOG] Received death link from " + std::string(data["data"]["source"]) + std::string deathLinkMessage = "[LOG] Received death link from " +
std::string(data["data"]["source"]) +
". Cause: " + std::string(data["data"]["cause"]); ". Cause: " + std::string(data["data"]["cause"]);
ArchipelagoConsole_SendMessage(deathLinkMessage.c_str()); ArchipelagoConsole_SendMessage(deathLinkMessage.c_str());
isDeathLinkedDeath = true; isDeathLinkedDeath = true;
} }
} }
@@ -262,7 +260,7 @@ bool ArchipelagoClient::StopClient() {
} }
void ArchipelagoClient::GameLoaded() { void ArchipelagoClient::GameLoaded() {
// Load textures for the archipelago items that're shown in the notifications // Load textures for the archipelago items that're shown in the notifications
static bool sArchipelagoTexturesLoaded = false; static bool sArchipelagoTexturesLoaded = false;
if (!sArchipelagoTexturesLoaded) { if (!sArchipelagoTexturesLoaded) {
@@ -277,7 +275,7 @@ void ArchipelagoClient::GameLoaded() {
} }
if (apClient == nullptr) { if (apClient == nullptr) {
if(IS_ARCHIPELAGO) { if (IS_ARCHIPELAGO) {
CVarSetString(CVAR_REMOTE_ARCHIPELAGO("ServerAddress"), gSaveContext.ship.quest.data.archipelago.archiUri); CVarSetString(CVAR_REMOTE_ARCHIPELAGO("ServerAddress"), gSaveContext.ship.quest.data.archipelago.archiUri);
CVarSetString(CVAR_REMOTE_ARCHIPELAGO("SlotName"), gSaveContext.ship.quest.data.archipelago.slotName); CVarSetString(CVAR_REMOTE_ARCHIPELAGO("SlotName"), gSaveContext.ship.quest.data.archipelago.slotName);
CVarSetString(CVAR_REMOTE_ARCHIPELAGO("Password"), gSaveContext.ship.quest.data.archipelago.roomPass); CVarSetString(CVAR_REMOTE_ARCHIPELAGO("Password"), gSaveContext.ship.quest.data.archipelago.roomPass);
@@ -423,7 +421,7 @@ void ArchipelagoClient::QueueItem(const ApItem item) {
} }
void ArchipelagoClient::SendGameWon() { void ArchipelagoClient::SendGameWon() {
if(apClient == nullptr) { if (apClient == nullptr) {
return; return;
} }
@@ -473,10 +471,10 @@ void ArchipelagoClient::Poll() {
apClient->poll(); apClient->poll();
} }
void ArchipelagoClient::ResetQueue(){ void ArchipelagoClient::ResetQueue() {
itemQueued = false; itemQueued = false;
std::queue<ApItem> empty; std::queue<ApItem> empty;
std::swap( receiveQueue, empty ); std::swap(receiveQueue, empty);
} }
bool ArchipelagoClient::slotMatch(const std::string& slotName, const std::string& roomHash) { bool ArchipelagoClient::slotMatch(const std::string& slotName, const std::string& roomHash) {
@@ -484,7 +482,7 @@ bool ArchipelagoClient::slotMatch(const std::string& slotName, const std::string
return false; return false;
} }
if(disconnecting) { if (disconnecting) {
return false; return false;
} }
@@ -624,7 +622,7 @@ void LoadArchipelagoData() {
ARRAY_COUNT(gSaveContext.ship.quest.data.archipelago.slotName)); ARRAY_COUNT(gSaveContext.ship.quest.data.archipelago.slotName));
SaveManager::Instance->LoadCharArray("archiUri", gSaveContext.ship.quest.data.archipelago.archiUri, SaveManager::Instance->LoadCharArray("archiUri", gSaveContext.ship.quest.data.archipelago.archiUri,
ARRAY_COUNT(gSaveContext.ship.quest.data.archipelago.archiUri)); ARRAY_COUNT(gSaveContext.ship.quest.data.archipelago.archiUri));
SaveManager::Instance->LoadCharArray("roomPass", gSaveContext.ship.quest.data.archipelago.roomPass, SaveManager::Instance->LoadCharArray("roomPass", gSaveContext.ship.quest.data.archipelago.roomPass,
ARRAY_COUNT(gSaveContext.ship.quest.data.archipelago.roomPass)); ARRAY_COUNT(gSaveContext.ship.quest.data.archipelago.roomPass));
SaveManager::Instance->LoadArray( SaveManager::Instance->LoadArray(

View File

@@ -100,9 +100,9 @@ void ArchipelagoConsoleWindow::DrawElement() {
ImGui::PopStyleVar(4); ImGui::PopStyleVar(4);
}; };
ImVec4 ArchipelagoConsoleWindow::getColorVal(const AP_Text::TextColor color) { ImVec4 ArchipelagoConsoleWindow::getColorVal(const AP_Text::TextColor color) {
using apt = AP_Text::TextColor; using apt = AP_Text::TextColor;
switch(color) { switch (color) {
case apt::COLOR_ERROR: case apt::COLOR_ERROR:
return ImVec4(1.0f, 0.4f, 0.4f, 1.0f); return ImVec4(1.0f, 0.4f, 0.4f, 1.0f);
case apt::COLOR_LOG: case apt::COLOR_LOG:
@@ -137,4 +137,3 @@ ImVec4 ArchipelagoConsoleWindow::getColorVal(const AP_Text::TextColor color) {
return ImVec4(0.93f, 0.93f, 0.93f, 1.00f); return ImVec4(0.93f, 0.93f, 0.93f, 1.00f);
}; };
} }

View File

@@ -2,29 +2,29 @@
#ifdef __cplusplus #ifdef __cplusplus
namespace AP_Text { namespace AP_Text {
enum class TextColor : char { enum class TextColor : char {
COLOR_DEFAULT = 0, COLOR_DEFAULT = 0,
COLOR_ERROR, COLOR_ERROR,
COLOR_LOG, COLOR_LOG,
COLOR_BLACK, COLOR_BLACK,
COLOR_RED, COLOR_RED,
COLOR_GREEN, COLOR_GREEN,
COLOR_YELLOW, COLOR_YELLOW,
COLOR_BLUE, COLOR_BLUE,
COLOR_CYAN, COLOR_CYAN,
COLOR_MAGENTA, COLOR_MAGENTA,
COLOR_SLATEBLUE, COLOR_SLATEBLUE,
COLOR_PLUM, COLOR_PLUM,
COLOR_SALMON, COLOR_SALMON,
COLOR_WHITE, COLOR_WHITE,
COLOR_ORANGE, COLOR_ORANGE,
COLOR_GRAY COLOR_GRAY
}; };
struct ColoredTextNode { struct ColoredTextNode {
std::string text; std::string text;
AP_Text::TextColor color; AP_Text::TextColor color;
}; };
} } // namespace AP_Text
#endif #endif

View File

@@ -517,7 +517,8 @@ void SaveManager::InitMeta(int fileNum) {
ARRAY_COUNT(fileMetaInfo[fileNum].archiUri)); ARRAY_COUNT(fileMetaInfo[fileNum].archiUri));
SohUtils::CopyStringToCharArray(fileMetaInfo[fileNum].slotName, gSaveContext.ship.quest.data.archipelago.slotName, SohUtils::CopyStringToCharArray(fileMetaInfo[fileNum].slotName, gSaveContext.ship.quest.data.archipelago.slotName,
ARRAY_COUNT(fileMetaInfo[fileNum].slotName)); ARRAY_COUNT(fileMetaInfo[fileNum].slotName));
SohUtils::CopyStringToCharArray(fileMetaInfo[fileNum].archiRoomSeed, gSaveContext.ship.quest.data.archipelago.roomHash, SohUtils::CopyStringToCharArray(fileMetaInfo[fileNum].archiRoomSeed,
gSaveContext.ship.quest.data.archipelago.roomHash,
ARRAY_COUNT(fileMetaInfo[fileNum].archiRoomSeed)); ARRAY_COUNT(fileMetaInfo[fileNum].archiRoomSeed));
} }

View File

@@ -3434,19 +3434,19 @@ void Interface_DrawArchipelagoStatusString(PlayState* play) {
int32_t sTexScale = 1024.0f / (scale / 100.0f); int32_t sTexScale = 1024.0f / (scale / 100.0f);
gDPLoadTextureBlock(play->state.gfxCtx->overlay.p++, gArchipelagoItemTex, G_IM_FMT_RGBA, G_IM_SIZ_32b, 64, 64, 0, gDPLoadTextureBlock(play->state.gfxCtx->overlay.p++, gArchipelagoItemTex, G_IM_FMT_RGBA, G_IM_SIZ_32b, 64, 64, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 0, 0, G_TX_NOLOD, G_TX_NOLOD); G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 0, 0, G_TX_NOLOD, G_TX_NOLOD);
gSPWideTextureRectangle(play->state.gfxCtx->overlay.p++, posX << 2, posY << 2, (posX + sTexSize) << 2, gSPWideTextureRectangle(play->state.gfxCtx->overlay.p++, posX << 2, posY << 2, (posX + sTexSize) << 2,
(posY + sTexSize) << 2, G_TX_RENDERTILE, 0, 0, sTexScale, sTexScale); (posY + sTexSize) << 2, G_TX_RENDERTILE, 0, 0, sTexScale, sTexScale);
//SPWideTextureRectangle(OVERLAY_DISP++, ((rMagicBarX + gSaveContext.magicCapacity) + 8) << 2, magicBarY << 2, // SPWideTextureRectangle(OVERLAY_DISP++, ((rMagicBarX + gSaveContext.magicCapacity) + 8) << 2, magicBarY << 2,
// ((rMagicBarX + gSaveContext.magicCapacity) + 16) << 2, (magicBarY + 16) << 2, // ((rMagicBarX + gSaveContext.magicCapacity) + 16) << 2, (magicBarY + 16) << 2,
// G_TX_RENDERTILE, 256, 0, 1 << 10, 1 << 10); // G_TX_RENDERTILE, 256, 0, 1 << 10, 1 << 10);
posX += 13; posX += 13;
uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : gSaveContext.language; uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : gSaveContext.language;
char* statusText = SohFileSelect_GetArchipelagoSettingText(ASM_NOT_CONNECTED, language); char* statusText = SohFileSelect_GetArchipelagoSettingText(ASM_NOT_CONNECTED, language);
switch(CVarGetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 0)) { switch (CVarGetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 0)) {
case 0: // Not Connected case 0: // Not Connected
statusText = SohFileSelect_GetArchipelagoSettingText(ASM_NOT_CONNECTED, language); statusText = SohFileSelect_GetArchipelagoSettingText(ASM_NOT_CONNECTED, language);
break; break;
@@ -3460,7 +3460,6 @@ void Interface_DrawArchipelagoStatusString(PlayState* play) {
break; break;
} }
Interface_DrawTextLineOverlay(play->state.gfxCtx, statusText, posX, posY, 255, 255, 255, 255, 0.8f, true); Interface_DrawTextLineOverlay(play->state.gfxCtx, statusText, posX, posY, 255, 255, 255, 255, 0.8f, true);
} }
@@ -5437,7 +5436,7 @@ void Interface_Draw(PlayState* play) {
Interface_DrawLineupTick(play); Interface_DrawLineupTick(play);
} }
if(IS_ARCHIPELAGO) { if (IS_ARCHIPELAGO) {
Interface_DrawArchipelagoStatusString(play); Interface_DrawArchipelagoStatusString(play);
} }
@@ -6981,8 +6980,8 @@ void Interface_DrawTextCharacter(GraphicsContext* gfx, int16_t x, int16_t y, voi
} }
void Interface_DrawTextCharacter_overlay(GraphicsContext* gfx, int16_t x, int16_t y, void* texture, uint16_t colorR, void Interface_DrawTextCharacter_overlay(GraphicsContext* gfx, int16_t x, int16_t y, void* texture, uint16_t colorR,
uint16_t colorG, uint16_t colorB, uint16_t colorA, float textScale, uint16_t colorG, uint16_t colorB, uint16_t colorA, float textScale,
uint8_t textShadow) { uint8_t textShadow) {
int32_t scale = R_TEXT_CHAR_SCALE * textScale; int32_t scale = R_TEXT_CHAR_SCALE * textScale;
int32_t sCharTexSize = (scale / 100.0f) * 16.0f; int32_t sCharTexSize = (scale / 100.0f) * 16.0f;
@@ -6993,16 +6992,16 @@ void Interface_DrawTextCharacter_overlay(GraphicsContext* gfx, int16_t x, int16_
gDPPipeSync(OVERLAY_DISP++); gDPPipeSync(OVERLAY_DISP++);
gDPLoadTextureBlock_4b(OVERLAY_DISP++, texture, G_IM_FMT_I, FONT_CHAR_TEX_WIDTH, FONT_CHAR_TEX_HEIGHT, 0, gDPLoadTextureBlock_4b(OVERLAY_DISP++, texture, G_IM_FMT_I, FONT_CHAR_TEX_WIDTH, FONT_CHAR_TEX_HEIGHT, 0,
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
G_TX_NOLOD); G_TX_NOLOD);
if (textShadow) { if (textShadow) {
// Draw drop shadow // Draw drop shadow
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, colorA); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, colorA);
gSPWideTextureRectangle(OVERLAY_DISP++, (x + R_TEXT_DROP_SHADOW_OFFSET) << 2, (y + R_TEXT_DROP_SHADOW_OFFSET) << 2, gSPWideTextureRectangle(
(x + R_TEXT_DROP_SHADOW_OFFSET + sCharTexSize) << 2, OVERLAY_DISP++, (x + R_TEXT_DROP_SHADOW_OFFSET) << 2, (y + R_TEXT_DROP_SHADOW_OFFSET) << 2,
(y + R_TEXT_DROP_SHADOW_OFFSET + sCharTexSize) << 2, G_TX_RENDERTILE, 0, 0, sCharTexScale, (x + R_TEXT_DROP_SHADOW_OFFSET + sCharTexSize) << 2, (y + R_TEXT_DROP_SHADOW_OFFSET + sCharTexSize) << 2,
sCharTexScale); G_TX_RENDERTILE, 0, 0, sCharTexScale, sCharTexScale);
} }
gDPPipeSync(OVERLAY_DISP++); gDPPipeSync(OVERLAY_DISP++);
@@ -7010,7 +7009,7 @@ void Interface_DrawTextCharacter_overlay(GraphicsContext* gfx, int16_t x, int16_
// Draw normal text // Draw normal text
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, colorR, colorG, colorB, colorA); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, colorR, colorG, colorB, colorA);
gSPWideTextureRectangle(OVERLAY_DISP++, x << 2, y << 2, (x + sCharTexSize) << 2, (y + sCharTexSize) << 2, gSPWideTextureRectangle(OVERLAY_DISP++, x << 2, y << 2, (x + sCharTexSize) << 2, (y + sCharTexSize) << 2,
G_TX_RENDERTILE, 0, 0, sCharTexScale, sCharTexScale); G_TX_RENDERTILE, 0, 0, sCharTexScale, sCharTexScale);
CLOSE_DISPS(gfx); CLOSE_DISPS(gfx);
} }
@@ -7047,8 +7046,8 @@ uint16_t Interface_DrawTextLine(GraphicsContext* gfx, char text[], int16_t x, in
} }
uint16_t Interface_DrawTextLineOverlay(GraphicsContext* gfx, char text[], int16_t x, int16_t y, uint16_t colorR, uint16_t Interface_DrawTextLineOverlay(GraphicsContext* gfx, char text[], int16_t x, int16_t y, uint16_t colorR,
uint16_t colorG, uint16_t colorB, uint16_t colorA, float textScale, uint16_t colorG, uint16_t colorB, uint16_t colorA, float textScale,
uint8_t textShadow) { uint8_t textShadow) {
uint16_t textureIndex; uint16_t textureIndex;
uint16_t kerningOffset = 0; uint16_t kerningOffset = 0;
@@ -7061,16 +7060,16 @@ uint16_t Interface_DrawTextLineOverlay(GraphicsContext* gfx, char text[], int16_
if (processedText[i] == '\n') { if (processedText[i] == '\n') {
lineOffset += 15 * textScale; lineOffset += 15 * textScale;
kerningOffset = 0; kerningOffset = 0;
} else { } else {
textureIndex = processedText[i] - 32; textureIndex = processedText[i] - 32;
if (textureIndex != 0) { if (textureIndex != 0) {
texture = Ship_GetCharFontTexture(processedText[i]); texture = Ship_GetCharFontTexture(processedText[i]);
Interface_DrawTextCharacter_overlay(gfx, (int16_t)(x + kerningOffset), (int16_t)(y + lineOffset), texture, colorR, colorG, colorB, Interface_DrawTextCharacter_overlay(gfx, (int16_t)(x + kerningOffset), (int16_t)(y + lineOffset),
colorA, textScale, textShadow); texture, colorR, colorG, colorB, colorA, textScale, textShadow);
} }
kerningOffset += kerningOffset +=
(uint16_t)(Ship_GetCharFontWidth(processedText[i]) * (R_TEXT_CHAR_SCALE / 100.0f) * textScale); (uint16_t)(Ship_GetCharFontWidth(processedText[i]) * (R_TEXT_CHAR_SCALE / 100.0f) * textScale);
} }
} }

View File

@@ -2479,7 +2479,7 @@ void FileChoose_DrawFileInfo(GameState* thisx, s16 fileIndex, s16 isActive) {
// draw death count // draw death count
if (CVarGetInteger(CVAR_ENHANCEMENT("FileSelectMoreInfo"), 0) == 0 || this->menuMode != FS_MENU_MODE_SELECT || if (CVarGetInteger(CVAR_ENHANCEMENT("FileSelectMoreInfo"), 0) == 0 || this->menuMode != FS_MENU_MODE_SELECT ||
Save_GetSaveMetaInfo(this->selectedFileIndex)->archiSave) { Save_GetSaveMetaInfo(this->selectedFileIndex)->archiSave) {
for (i = 0, vtxOffset = 0; i < 3; i++, vtxOffset += 4) { for (i = 0, vtxOffset = 0; i < 3; i++, vtxOffset += 4) {
FileChoose_DrawCharacter(this->state.gfxCtx, sp54->fontBuf + deathCountSplit[i] * FONT_CHAR_TEX_SIZE, FileChoose_DrawCharacter(this->state.gfxCtx, sp54->fontBuf + deathCountSplit[i] * FONT_CHAR_TEX_SIZE,
vtxOffset); vtxOffset);
@@ -2506,7 +2506,7 @@ void FileChoose_DrawFileInfo(GameState* thisx, s16 fileIndex, s16 isActive) {
i = Save_GetSaveMetaInfo(fileIndex)->healthCapacity / 0x10; i = Save_GetSaveMetaInfo(fileIndex)->healthCapacity / 0x10;
if (CVarGetInteger(CVAR_ENHANCEMENT("FileSelectMoreInfo"), 0) == 0 || this->menuMode != FS_MENU_MODE_SELECT || if (CVarGetInteger(CVAR_ENHANCEMENT("FileSelectMoreInfo"), 0) == 0 || this->menuMode != FS_MENU_MODE_SELECT ||
Save_GetSaveMetaInfo(this->selectedFileIndex)->archiSave) { Save_GetSaveMetaInfo(this->selectedFileIndex)->archiSave) {
// draw hearts // draw hearts
for (vtxOffset = 0, j = 0; j < i; j++, vtxOffset += 4) { for (vtxOffset = 0, j = 0; j < i; j++, vtxOffset += 4) {
gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[D_8081284C[fileIndex] + vtxOffset] + 0x30, 4, 0); gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[D_8081284C[fileIndex] + vtxOffset] + 0x30, 4, 0);
@@ -2523,8 +2523,8 @@ void FileChoose_DrawFileInfo(GameState* thisx, s16 fileIndex, s16 isActive) {
textAlpha = 255; textAlpha = 255;
} }
if (CVarGetInteger(CVAR_ENHANCEMENT("FileSelectMoreInfo"), 0) != 0 && this->menuMode == FS_MENU_MODE_SELECT && if (CVarGetInteger(CVAR_ENHANCEMENT("FileSelectMoreInfo"), 0) != 0 && this->menuMode == FS_MENU_MODE_SELECT &&
Save_GetSaveMetaInfo(this->selectedFileIndex)->archiSave == 0) { Save_GetSaveMetaInfo(this->selectedFileIndex)->archiSave == 0) {
DrawMoreInfo(this, fileIndex, textAlpha); DrawMoreInfo(this, fileIndex, textAlpha);
} else { } else {
// draw quest items // draw quest items
@@ -2549,51 +2549,55 @@ void FileChoose_DrawFileInfo(GameState* thisx, s16 fileIndex, s16 isActive) {
} }
} }
if(Save_GetSaveMetaInfo(this->selectedFileIndex)->archiSave) { if (Save_GetSaveMetaInfo(this->selectedFileIndex)->archiSave) {
uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : gSaveContext.language; uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : gSaveContext.language;
// Connection status text // Connection status text
int statusPos = 61 + Interface_DrawTextLine(this->state.gfxCtx, SohFileSelect_GetArchipelagoSettingText(ASM_STATUS, language), int statusPos = 61 + Interface_DrawTextLine(this->state.gfxCtx,
58, 133, 200, 200, 200, textAlpha, 0.8f, true); SohFileSelect_GetArchipelagoSettingText(ASM_STATUS, language),
58, 133, 200, 200, 200, textAlpha, 0.8f, true);
const bool connectedToThisSlot = checkArchipelagoSlotInfo(Save_GetSaveMetaInfo(this->selectedFileIndex)->slotName, const bool connectedToThisSlot =
Save_GetSaveMetaInfo(this->selectedFileIndex)->archiRoomSeed); checkArchipelagoSlotInfo(Save_GetSaveMetaInfo(this->selectedFileIndex)->slotName,
Save_GetSaveMetaInfo(this->selectedFileIndex)->archiRoomSeed);
switch(CVarGetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 0)) { switch (CVarGetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 0)) {
case 0: // Not Connected case 0: // Not Connected
Interface_DrawTextLine(this->state.gfxCtx, Interface_DrawTextLine(this->state.gfxCtx,
SohFileSelect_GetArchipelagoSettingText(ASM_NOT_CONNECTED, language), SohFileSelect_GetArchipelagoSettingText(ASM_NOT_CONNECTED, language),
statusPos, 133, 255, 120, 120, textAlpha, 0.8f, true); statusPos, 133, 255, 120, 120, textAlpha, 0.8f, true);
break; break;
case 1: // Connecting case 1: // Connecting
case 2: // Connection error, retrying case 2: // Connection error, retrying
case 3: // Connected case 3: // Connected
Interface_DrawTextLine(this->state.gfxCtx, Interface_DrawTextLine(this->state.gfxCtx,
SohFileSelect_GetArchipelagoSettingText(ASM_CONNECTING, language), SohFileSelect_GetArchipelagoSettingText(ASM_CONNECTING, language), statusPos,
statusPos, 133, 185, 185, 185, textAlpha, 0.8f, true); 133, 185, 185, 185, textAlpha, 0.8f, true);
break; break;
case 4: // Connected + Locations Scouted case 4: // Connected + Locations Scouted
if(connectedToThisSlot) { if (connectedToThisSlot) {
Interface_DrawTextLine(this->state.gfxCtx, Interface_DrawTextLine(this->state.gfxCtx,
SohFileSelect_GetArchipelagoSettingText(ASM_CONNECTED, language), SohFileSelect_GetArchipelagoSettingText(ASM_CONNECTED, language),
statusPos, 133, 120, 255, 120, textAlpha, 0.8f, true); statusPos, 133, 120, 255, 120, textAlpha, 0.8f, true);
} else { } else {
Interface_DrawTextLine(this->state.gfxCtx, Interface_DrawTextLine(
SohFileSelect_GetArchipelagoSettingText(ASM_CHAR_SELECT_CONNECTED_TO_OTHER_SLOT, language), this->state.gfxCtx,
SohFileSelect_GetArchipelagoSettingText(ASM_CHAR_SELECT_CONNECTED_TO_OTHER_SLOT, language),
statusPos, 133, 255, 255, 120, textAlpha, 0.8f, true); statusPos, 133, 255, 255, 120, textAlpha, 0.8f, true);
} }
break; break;
} }
if(!connectedToThisSlot) { if (!connectedToThisSlot) {
Interface_DrawTextLine(this->state.gfxCtx, SohFileSelect_GetArchipelagoSettingText(ASM_CHAR_START_TO_CONNECT, language), Interface_DrawTextLine(this->state.gfxCtx,
58, 144, 200, 200, 200, textAlpha, 0.8f, true); SohFileSelect_GetArchipelagoSettingText(ASM_CHAR_START_TO_CONNECT, language), 58,
144, 200, 200, 200, textAlpha, 0.8f, true);
} }
//Interface_DrawTextLine(this->state.gfxCtx, // Interface_DrawTextLine(this->state.gfxCtx,
// SohFileSelect_GetArchipelagoSettingText(ASM_CHAR_SELECT_CHANGE_CONNECTION_INFO, language), 95, 220, // SohFileSelect_GetArchipelagoSettingText(ASM_CHAR_SELECT_CHANGE_CONNECTION_INFO, language), 95, 220,
// 100, 250, 255, textAlpha, 1.0f, true); // 100, 250, 255, textAlpha, 1.0f, true);
} }
} }
@@ -2994,26 +2998,27 @@ void FileChoose_DrawWindowContents(GameState* thisx) {
155, 185, 185, 185, textAlpha, 0.8f, true); 155, 185, 185, 185, textAlpha, 0.8f, true);
// Connection status text // Connection status text
int statusPos = 75 + Interface_DrawTextLine(this->state.gfxCtx, SohFileSelect_GetArchipelagoSettingText(ASM_STATUS, language), 70, int statusPos = 75 + Interface_DrawTextLine(this->state.gfxCtx,
175, 255, 255, 255, textAlpha, 0.8f, true); SohFileSelect_GetArchipelagoSettingText(ASM_STATUS, language), 70,
175, 255, 255, 255, textAlpha, 0.8f, true);
switch (CVarGetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 0)) { switch (CVarGetInteger(CVAR_REMOTE_ARCHIPELAGO("ConnectionStatus"), 0)) {
case 0: // Not Connected case 0: // Not Connected
Interface_DrawTextLine(this->state.gfxCtx, Interface_DrawTextLine(this->state.gfxCtx,
SohFileSelect_GetArchipelagoSettingText(ASM_NOT_CONNECTED, language), statusPos, 175, SohFileSelect_GetArchipelagoSettingText(ASM_NOT_CONNECTED, language), statusPos,
255, 120, 120, textAlpha, 0.8f, true); 175, 255, 120, 120, textAlpha, 0.8f, true);
break; break;
case 1: // Connecting case 1: // Connecting
case 2: // Connection error, retrying case 2: // Connection error, retrying
case 3: // Connected case 3: // Connected
Interface_DrawTextLine(this->state.gfxCtx, Interface_DrawTextLine(this->state.gfxCtx,
SohFileSelect_GetArchipelagoSettingText(ASM_CONNECTING, language), statusPos, 175, 185, SohFileSelect_GetArchipelagoSettingText(ASM_CONNECTING, language), statusPos,
185, 185, textAlpha, 0.8f, true); 175, 185, 185, 185, textAlpha, 0.8f, true);
break; break;
case 4: // Connected + Locations Scouted case 4: // Connected + Locations Scouted
Interface_DrawTextLine(this->state.gfxCtx, Interface_DrawTextLine(this->state.gfxCtx,
SohFileSelect_GetArchipelagoSettingText(ASM_CONNECTED, language), statusPos, 175, 120, SohFileSelect_GetArchipelagoSettingText(ASM_CONNECTED, language), statusPos, 175,
255, 120, textAlpha, 0.8f, true); 120, 255, 120, textAlpha, 0.8f, true);
break; break;
} }
@@ -3055,7 +3060,8 @@ void FileChoose_DrawWindowContents(GameState* thisx) {
// Draw the small file name box instead when more meta info is enabled // Draw the small file name box instead when more meta info is enabled
if (CVarGetInteger(CVAR_ENHANCEMENT("FileSelectMoreInfo"), 0) != 0 && if (CVarGetInteger(CVAR_ENHANCEMENT("FileSelectMoreInfo"), 0) != 0 &&
this->menuMode == FS_MENU_MODE_SELECT && Save_GetSaveMetaInfo(this->selectedFileIndex)->archiSave == 0) { this->menuMode == FS_MENU_MODE_SELECT &&
Save_GetSaveMetaInfo(this->selectedFileIndex)->archiSave == 0) {
// Location of file 1 small name box vertices // Location of file 1 small name box vertices
gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[68], 4, 0); gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[68], 4, 0);