diff --git a/OTRExporter/assets/textures/icons/gSohIcon.png b/OTRExporter/assets/textures/icons/gIcon.png similarity index 100% rename from OTRExporter/assets/textures/icons/gSohIcon.png rename to OTRExporter/assets/textures/icons/gIcon.png diff --git a/libultraship b/libultraship index 2ddffdb5b..7fe0c076a 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 2ddffdb5b60377a09a4a198a8fd67726951bbb27 +Subproject commit 7fe0c076a8261d7e878b196d2b5de57beccf1177 diff --git a/soh/assets/soh_assets.h b/soh/assets/soh_assets.h new file mode 100644 index 000000000..416c20706 --- /dev/null +++ b/soh/assets/soh_assets.h @@ -0,0 +1,64 @@ +#pragma once + +#include "align_asset_macro.h" + +// This file is manually made +// When new assets are added to the soh.otr file +// We need to add the aligned version of the resource names here and use in code +// On Mac, not using aligned resource names was causing crashes in release builds + +// objects +#define dgChristmasGreenTreasureChestFrontTex "__OTR__objects/object_box/gChristmasGreenTreasureChestFrontTex" +static const ALIGN_ASSET(2) char gChristmasGreenTreasureChestFrontTex[] = dgChristmasGreenTreasureChestFrontTex; + +#define dgChristmasGreenTreasureChestSideAndTopTex "__OTR__objects/object_box/gChristmasGreenTreasureChestSideAndTopTex" +static const ALIGN_ASSET(2) char gChristmasGreenTreasureChestSideAndTopTex[] = dgChristmasGreenTreasureChestSideAndTopTex; + +#define dgChristmasRedTreasureChestFrontTex "__OTR__objects/object_box/gChristmasRedTreasureChestFrontTex" +static const ALIGN_ASSET(2) char gChristmasRedTreasureChestFrontTex[] = dgChristmasRedTreasureChestFrontTex; + +#define dgChristmasRedTreasureChestSideAndTopTex "__OTR__objects/object_box/gChristmasRedTreasureChestSideAndTopTex" +static const ALIGN_ASSET(2) char gChristmasRedTreasureChestSideAndTopTex[] = dgChristmasRedTreasureChestSideAndTopTex; + +#define dgGoldTreasureChestFrontTex "__OTR__objects/object_box/gGoldTreasureChestFrontTex" +static const ALIGN_ASSET(2) char gGoldTreasureChestFrontTex[] = dgGoldTreasureChestFrontTex; + +#define dgGoldTreasureChestSideAndTopTex "__OTR__objects/object_box/gGoldTreasureChestSideAndTopTex" +static const ALIGN_ASSET(2) char gGoldTreasureChestSideAndTopTex[] = dgGoldTreasureChestSideAndTopTex; + +#define dgKeyTreasureChestFrontTex "__OTR__objects/object_box/gKeyTreasureChestFrontTex" +static const ALIGN_ASSET(2) char gKeyTreasureChestFrontTex[] = dgKeyTreasureChestFrontTex; + +#define dgKeyTreasureChestSideAndTopTex "__OTR__objects/object_box/gKeyTreasureChestSideAndTopTex" +static const ALIGN_ASSET(2) char gKeyTreasureChestSideAndTopTex[] = dgKeyTreasureChestSideAndTopTex; + +#define dgSkullTreasureChestFrontTex "__OTR__objects/object_box/gSkullTreasureChestFrontTex" +static const ALIGN_ASSET(2) char gSkullTreasureChestFrontTex[] = dgSkullTreasureChestFrontTex; + +#define dgSkullTreasureChestSideAndTopTex "__OTR__objects/object_box/gSkullTreasureChestSideAndTopTex" +static const ALIGN_ASSET(2) char gSkullTreasureChestSideAndTopTex[] = dgSkullTreasureChestSideAndTopTex; + +#define dgTitleRandomizerSubtitleTex "__OTR__objects/object_mag/gTitleRandomizerSubtitleTex" +static const ALIGN_ASSET(2) char gTitleRandomizerSubtitleTex[] = dgTitleRandomizerSubtitleTex; + +// textures +#define dgDPad "__OTR__textures/parameter_static/gDPad" +static const ALIGN_ASSET(2) char gDPadTex[] = dgDPad; + +#define dgFileSelMQButtonTex "__OTR__textures/title_static/gFileSelMQButtonTex" +static const ALIGN_ASSET(2) char gFileSelMQButtonTex[] = dgFileSelMQButtonTex; + +#define dgFileSelPleaseChooseAQuestENGTex "__OTR__textures/title_static/gFileSelPleaseChooseAQuestENGTex" +static const ALIGN_ASSET(2) char gFileSelPleaseChooseAQuestENGTex[] = dgFileSelPleaseChooseAQuestENGTex; + +#define dgFileSelPleaseChooseAQuestFRATex "__OTR__textures/title_static/gFileSelPleaseChooseAQuestFRATex" +static const ALIGN_ASSET(2) char gFileSelPleaseChooseAQuestFRATex[] = dgFileSelPleaseChooseAQuestFRATex; + +#define dgFileSelPleaseChooseAQuestGERTex "__OTR__textures/title_static/gFileSelPleaseChooseAQuestGERTex" +static const ALIGN_ASSET(2) char gFileSelPleaseChooseAQuestGERTex[] = dgFileSelPleaseChooseAQuestGERTex; + +#define dgFileSelRANDButtonTex "__OTR__textures/title_static/gFileSelRANDButtonTex" +static const ALIGN_ASSET(2) char gFileSelRANDButtonTex[] = dgFileSelRANDButtonTex; + +#define dgEmptyTexture "__OTR__textures/virtual/gEmptyTexture" +static const ALIGN_ASSET(2) char gEmptyTexture[] = dgEmptyTexture; diff --git a/soh/soh/Enhancements/audio/AudioCollection.cpp b/soh/soh/Enhancements/audio/AudioCollection.cpp index 3d988c9be..b59385f8a 100644 --- a/soh/soh/Enhancements/audio/AudioCollection.cpp +++ b/soh/soh/Enhancements/audio/AudioCollection.cpp @@ -229,7 +229,7 @@ void AudioCollection::RemoveFromShufflePool(SequenceInfo* seqInfo) { excludedSequences.insert(seqInfo); includedSequences.erase(seqInfo); CVarSetInteger(cvarKey.c_str(), 1); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } void AudioCollection::AddToShufflePool(SequenceInfo* seqInfo) { @@ -237,7 +237,7 @@ void AudioCollection::AddToShufflePool(SequenceInfo* seqInfo) { includedSequences.insert(seqInfo); excludedSequences.erase(seqInfo); CVarClear(cvarKey.c_str()); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } void AudioCollection::InitializeShufflePool() { diff --git a/soh/soh/Enhancements/audio/AudioCollection.h b/soh/soh/Enhancements/audio/AudioCollection.h index 75247793b..87e255259 100644 --- a/soh/soh/Enhancements/audio/AudioCollection.h +++ b/soh/soh/Enhancements/audio/AudioCollection.h @@ -2,6 +2,7 @@ #include #include #include +#include enum SeqType { SEQ_NOSHUFFLE = 0, diff --git a/soh/soh/Enhancements/audio/AudioEditor.cpp b/soh/soh/Enhancements/audio/AudioEditor.cpp index d0cc13bb0..d6bf71d19 100644 --- a/soh/soh/Enhancements/audio/AudioEditor.cpp +++ b/soh/soh/Enhancements/audio/AudioEditor.cpp @@ -158,7 +158,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) { const std::string randomizeAllButton = "Randomize All" + hiddenTabId; if (ImGui::Button(resetAllButton.c_str())) { ResetGroup(map, type); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); if (type == SEQ_BGM_WORLD) { ReplayCurrentBGM(); } @@ -166,7 +166,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) { ImGui::SameLine(); if (ImGui::Button(randomizeAllButton.c_str())) { RandomizeGroup(type); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); if (type == SEQ_BGM_WORLD) { ReplayCurrentBGM(); } @@ -205,7 +205,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) { if (ImGui::Selectable(seqData.label.c_str())) { CVarSetInteger(cvarKey.c_str(), value); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); UpdateCurrentBGM(defaultValue, type); } } @@ -219,7 +219,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) { ImGui::PushItemWidth(-FLT_MIN); if (ImGui::Button(resetButton.c_str())) { CVarSetInteger(cvarKey.c_str(), defaultValue); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); UpdateCurrentBGM(defaultValue, seqData.category); } ImGui::SameLine(); @@ -236,7 +236,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) { auto it = validSequences.begin(); const auto& seqData = *std::next(it, rand() % validSequences.size()); CVarSetInteger(cvarKey.c_str(), seqData->sequenceId); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); UpdateCurrentBGM(seqData->sequenceId, type); } } @@ -378,7 +378,7 @@ void DrawSfxEditor(bool& open) { const std::string resetButton = "Reset##linkVoiceFreqMultiplier"; if (ImGui::Button(resetButton.c_str())) { CVarSetFloat("gLinkVoiceFreqMultiplier", 1.0f); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } ImGui::NewLine(); @@ -552,7 +552,7 @@ void DrawSfxEditor(bool& open) { void InitAudioEditor() { //Draw the bar in the menu. - SohImGui::AddWindow("Enhancements", "Audio Editor", DrawSfxEditor); + Ship::AddWindow("Enhancements", "Audio Editor", DrawSfxEditor); } std::vector allTypes = { SEQ_BGM_WORLD, SEQ_BGM_EVENT, SEQ_BGM_BATTLE, SEQ_OCARINA, SEQ_FANFARE, SEQ_INSTRUMENT, SEQ_SFX }; @@ -562,7 +562,7 @@ void AudioEditor_RandomizeAll() { RandomizeGroup(type); } - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); ReplayCurrentBGM(); } @@ -571,6 +571,6 @@ void AudioEditor_ResetAll() { ResetGroup(AudioCollection::Instance->GetAllSequences(), type); } - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); ReplayCurrentBGM(); } diff --git a/soh/soh/Enhancements/controls/GameControlEditor.cpp b/soh/soh/Enhancements/controls/GameControlEditor.cpp index 2f49e5b90..d8780353e 100644 --- a/soh/soh/Enhancements/controls/GameControlEditor.cpp +++ b/soh/soh/Enhancements/controls/GameControlEditor.cpp @@ -88,7 +88,7 @@ namespace GameControlEditor { void DrawUI(bool&); void Init() { - SohImGui::AddWindow("Enhancements", "Game Control Editor", DrawUI); + Ship::AddWindow("Enhancements", "Game Control Editor", DrawUI); addButtonName(BTN_A, "A"); addButtonName(BTN_B, "B"); @@ -136,7 +136,7 @@ namespace GameControlEditor { } if (ImGui::Selectable(i->second, i->first == currentButton)) { CVarSetInteger(mapping.cVarName, i->first); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } } ImGui::EndCombo(); @@ -172,7 +172,7 @@ namespace GameControlEditor { ImGui::TableSetupColumn("Modifiers##CustomOcaranaModifiers", PANEL_TABLE_COLUMN_FLAGS); TableHelper::InitHeader(false); - SohImGui::BeginGroupPanel("Notes", ImGui::GetContentRegionAvail()); + Ship::BeginGroupPanel("Notes", ImGui::GetContentRegionAvail()); labelWidth = ImGui::CalcTextSize("D5").x + 10; DrawMapping(ocarinaD5, labelWidth, disableMask); DrawMapping(ocarinaB4, labelWidth, disableMask); @@ -181,16 +181,16 @@ namespace GameControlEditor { DrawMapping(ocarinaD4, labelWidth, disableMask); ImGui::Dummy(ImVec2(0, 5)); float cursorY = ImGui::GetCursorPosY(); - SohImGui::EndGroupPanel(); + Ship::EndGroupPanel(); TableHelper::NextCol(); - SohImGui::BeginGroupPanel("Modifiers", ImGui::GetContentRegionAvail()); + Ship::BeginGroupPanel("Modifiers", ImGui::GetContentRegionAvail()); labelWidth = ImGui::CalcTextSize(ocarinaSongDisable.label).x + 10; DrawMapping(ocarinaSongDisable, labelWidth, disableMask); DrawMapping(ocarinaSharp, labelWidth, disableMask); DrawMapping(ocarinaFlat, labelWidth, disableMask); - SohImGui::EndGroupPanel(cursorY - ImGui::GetCursorPosY() + 2); + Ship::EndGroupPanel(cursorY - ImGui::GetCursorPosY() + 2); ImGui::EndTable(); } @@ -201,7 +201,7 @@ namespace GameControlEditor { UIWidgets::Spacer(0); } - SohImGui::BeginGroupPanel("Alternate controls", ImGui::GetContentRegionAvail()); + Ship::BeginGroupPanel("Alternate controls", ImGui::GetContentRegionAvail()); if (ImGui::BeginTable("tableOcarinaAlternateControls", 2, ImGuiTableFlags_SizingFixedSame)) { ImGui::TableSetupColumn("D-pad", PANEL_TABLE_COLUMN_FLAGS); ImGui::TableSetupColumn("Right stick", PANEL_TABLE_COLUMN_FLAGS); @@ -213,7 +213,7 @@ namespace GameControlEditor { UIWidgets::Spacer(0); ImGui::EndTable(); } - SohImGui::EndGroupPanel(); + Ship::EndGroupPanel(); ImGui::EndTable(); } @@ -221,10 +221,10 @@ namespace GameControlEditor { // CurrentPort is indexed started at 1 here due to the Generic tab, instead of 0 like in InputEditor // Therefore CurrentPort - 1 must always be used inside this function instead of CurrentPort void DrawCustomButtons() { - SohImGui::GetInputEditor()->DrawControllerSelect(CurrentPort - 1); + Ship::GetInputEditor()->DrawControllerSelect(CurrentPort - 1); - SohImGui::GetInputEditor()->DrawButton("Modifier 1", BTN_MODIFIER1, CurrentPort - 1, &BtnReading); - SohImGui::GetInputEditor()->DrawButton("Modifier 2", BTN_MODIFIER2, CurrentPort - 1, &BtnReading); + Ship::GetInputEditor()->DrawButton("Modifier 1", BTN_MODIFIER1, CurrentPort - 1, &BtnReading); + Ship::GetInputEditor()->DrawButton("Modifier 2", BTN_MODIFIER2, CurrentPort - 1, &BtnReading); } void DrawCameraControlPanel() { @@ -233,7 +233,7 @@ namespace GameControlEditor { } UIWidgets::Spacer(0); - SohImGui::BeginGroupPanel("Aiming/First-Person Camera", ImGui::GetContentRegionAvail()); + Ship::BeginGroupPanel("Aiming/First-Person Camera", ImGui::GetContentRegionAvail()); UIWidgets::PaddedEnhancementCheckbox("Right Stick Aiming", "gRightStickAiming"); DrawHelpIcon("Allows for aiming with the right stick in:\n-First-Person/C-Up view\n-Weapon Aiming"); UIWidgets::PaddedEnhancementCheckbox("Invert Aiming X Axis", "gInvertAimingXAxis"); @@ -252,10 +252,10 @@ namespace GameControlEditor { CVarSetFloat("gFirstPersonCameraSensitivity", 1.0f); } UIWidgets::Spacer(0); - SohImGui::EndGroupPanel(); + Ship::EndGroupPanel(); UIWidgets::Spacer(0); - SohImGui::BeginGroupPanel("Third-Person Camera", ImGui::GetContentRegionAvail()); + Ship::BeginGroupPanel("Third-Person Camera", ImGui::GetContentRegionAvail()); UIWidgets::PaddedEnhancementCheckbox("Free Camera", "gFreeCamera"); DrawHelpIcon("Enables free camera control\nNote: You must remap C buttons off of the right stick in the " @@ -273,7 +273,7 @@ namespace GameControlEditor { "gFreeCameraDistMax", 100, 900, "", 185, true, false, true); UIWidgets::PaddedEnhancementSliderInt("Camera Transition Speed: %d", "##CamTranSpeed", "gFreeCameraTransitionSpeed", 0, 900, "", 25, true, false, true); - SohImGui::EndGroupPanel(); + Ship::EndGroupPanel(); } void DrawDpadControlPanel() { @@ -283,7 +283,7 @@ namespace GameControlEditor { ImVec2 cursor = ImGui::GetCursorPos(); ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5)); - SohImGui::BeginGroupPanel("D-Pad Options", ImGui::GetContentRegionAvail()); + Ship::BeginGroupPanel("D-Pad Options", ImGui::GetContentRegionAvail()); UIWidgets::PaddedEnhancementCheckbox("D-pad Support on Pause Screen", "gDpadPause"); DrawHelpIcon("Navigate Pause with the D-pad\nIf used with D-pad as Equip Items, you must hold C-Up to equip instead of navigate\n" "To make the cursor only move a single space no matter how long a direction is held, manually set gDpadHoldChange to 0"); @@ -292,7 +292,7 @@ namespace GameControlEditor { "To make the cursor only move a single space during name entry no matter how long a direction is held, manually set gDpadHoldChange to 0"); UIWidgets::PaddedEnhancementCheckbox("D-pad as Equip Items", "gDpadEquips"); DrawHelpIcon("Equip items and equipment on the D-pad\nIf used with D-pad on Pause Screen, you must hold C-Up to equip instead of navigate"); - SohImGui::EndGroupPanel(); + Ship::EndGroupPanel(); } void DrawMiscControlPanel() { @@ -302,7 +302,7 @@ namespace GameControlEditor { ImVec2 cursor = ImGui::GetCursorPos(); ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5)); - SohImGui::BeginGroupPanel("Misc Controls", ImGui::GetContentRegionAvail()); + Ship::BeginGroupPanel("Misc Controls", ImGui::GetContentRegionAvail()); UIWidgets::PaddedText("Allow the cursor to be on any slot"); static const char* cursorOnAnySlot[3] = { "Only in Rando", "Always", "Never" }; UIWidgets::EnhancementCombobox("gPauseAnyCursor", cursorOnAnySlot, PAUSE_ANY_CURSOR_RANDO_ONLY); @@ -313,16 +313,16 @@ namespace GameControlEditor { DrawHelpIcon("Hold the assigned button to change the maximum walking speed\nTo change the assigned button, go into the Ports tabs above"); if (CVarGetInteger("gEnableWalkModify", 0)) { UIWidgets::Spacer(5); - SohImGui::BeginGroupPanel("Walk Modifier", ImGui::GetContentRegionAvail()); + Ship::BeginGroupPanel("Walk Modifier", ImGui::GetContentRegionAvail()); UIWidgets::PaddedEnhancementCheckbox("Toggle modifier instead of holding", "gWalkSpeedToggle", true, false); UIWidgets::PaddedEnhancementSliderFloat("Modifier 1: %d %%", "##WalkMod1", "gWalkModifierOne", 0.0f, 5.0f, "", 1.0f, true, true, false, true); UIWidgets::PaddedEnhancementSliderFloat("Modifier 2: %d %%", "##WalkMod2", "gWalkModifierTwo", 0.0f, 5.0f, "", 1.0f, true, true, false, true); - SohImGui::EndGroupPanel(); + Ship::EndGroupPanel(); } UIWidgets::Spacer(0); UIWidgets::PaddedEnhancementCheckbox("Answer Navi Prompt with L Button", "gNaviOnL"); DrawHelpIcon("Speak to Navi with L but enter first-person camera with C-Up"); - SohImGui::EndGroupPanel(); + Ship::EndGroupPanel(); } diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp index 7e13fd598..340b7331d 100644 --- a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp +++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp @@ -1413,7 +1413,7 @@ void Draw_Placements(){ void DrawSillyTab() { if (CVarGetInteger("gLetItSnow", 0)) { if (UIWidgets::EnhancementCheckbox("Let It Snow", "gLetItSnow")) { - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } } if (UIWidgets::EnhancementSliderFloat("Link Body Scale: %f", "##Link_BodyScale", "gCosmetics.Link_BodyScale.Value", 0.001f, 0.025f, "", 0.01f, false)) { @@ -1423,7 +1423,7 @@ void DrawSillyTab() { if (ImGui::Button("Reset##Link_BodyScale")) { CVarClear("gCosmetics.Link_BodyScale.Value"); CVarClear("gCosmetics.Link_BodyScale.Changed"); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); static Player* player = GET_PLAYER(gPlayState); player->actor.scale.x = 0.01f; player->actor.scale.y = 0.01f; @@ -1436,7 +1436,7 @@ void DrawSillyTab() { if (ImGui::Button("Reset##Link_HeadScale")) { CVarClear("gCosmetics.Link_HeadScale.Value"); CVarClear("gCosmetics.Link_HeadScale.Changed"); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } if (UIWidgets::EnhancementSliderFloat("Link Sword Scale: %f", "##Link_SwordScale", "gCosmetics.Link_SwordScale.Value", 1.0f, 2.5f, "", 1.0f, false)) { CVarSetInteger("gCosmetics.Link_SwordScale.Changed", 1); @@ -1445,44 +1445,44 @@ void DrawSillyTab() { if (ImGui::Button("Reset##Link_SwordScale")) { CVarClear("gCosmetics.Link_SwordScale.Value"); CVarClear("gCosmetics.Link_SwordScale.Changed"); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } UIWidgets::EnhancementSliderFloat("Bunny Hood Length: %f", "##BunnyHood_EarLength", "gCosmetics.BunnyHood_EarLength", -300.0f, 1000.0f, "", 0.0f, false); ImGui::SameLine(); if (ImGui::Button("Reset##BunnyHood_EarLength")) { CVarClear("gCosmetics.BunnyHood_EarLength"); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } UIWidgets::EnhancementSliderFloat("Bunny Hood Spread: %f", "##BunnyHood_EarSpread", "gCosmetics.BunnyHood_EarSpread", -300.0f, 500.0f, "", 0.0f, false); ImGui::SameLine(); if (ImGui::Button("Reset##BunnyHood_EarSpread")) { CVarClear("gCosmetics.BunnyHood_EarSpread"); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } UIWidgets::EnhancementSliderFloat("Goron Neck Length: %f", "##Goron_NeckLength", "gCosmetics.Goron_NeckLength", 0.0f, 1000.0f, "", 0.0f, false); ImGui::SameLine(); if (ImGui::Button("Reset##Goron_NeckLength")) { CVarClear("gCosmetics.Goron_NeckLength"); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } UIWidgets::EnhancementCheckbox("Unfix Goron Spin", "gUnfixGoronSpin"); UIWidgets::EnhancementSliderFloat("Fairies Size: %f", "##Fairies_Size", "gCosmetics.Fairies_Size", 0.25f, 5.0f, "", 1.0f, false); ImGui::SameLine(); if (ImGui::Button("Reset##Fairies_Size")) { CVarClear("gCosmetics.Fairies_Size"); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } UIWidgets::EnhancementSliderFloat("N64 Logo Spin Speed: %f", "##N64Logo_SpinSpeed", "gCosmetics.N64Logo_SpinSpeed", 0.25f, 5.0f, "", 1.0f, false); ImGui::SameLine(); if (ImGui::Button("Reset##N64Logo_SpinSpeed")) { CVarClear("gCosmetics.N64Logo_SpinSpeed"); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } UIWidgets::EnhancementSliderFloat("Moon Size: %f", "##Moon_Size", "gCosmetics.Moon_Size", 0.5f, 2.0f, "", 1.0f, false); ImGui::SameLine(); if (ImGui::Button("Reset##Moon_Size")) { CVarClear("gCosmetics.Moon_Size"); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } if (UIWidgets::EnhancementSliderFloat("Kak Windmill Speed: %f", "##Kak_Windmill_Speed", "gCosmetics.Kak_Windmill_Speed.Value", 100.0f, 6000.0f, "", 100.0f, false)) { CVarSetInteger("gCosmetics.Kak_Windmill_Speed.Changed", 1); @@ -1491,7 +1491,7 @@ void DrawSillyTab() { if (ImGui::Button("Reset##Kak_Windmill_Speed")) { CVarClear("gCosmetics.Kak_Windmill_Speed.Value"); CVarClear("gCosmetics.Kak_Windmill_Speed.Changed"); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } } @@ -1599,7 +1599,7 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) { CVarSetInteger((cosmeticOption.rainbowCvar), 0); CVarSetInteger((cosmeticOption.changedCvar), 1); ApplyOrResetCustomGfxPatches(); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } ImGui::SameLine(); ImGui::Text(cosmeticOption.label.c_str()); @@ -1607,7 +1607,7 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) { if (ImGui::Button(("Random##" + cosmeticOption.label).c_str())) { RandomizeColor(cosmeticOption); ApplyOrResetCustomGfxPatches(); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } ImGui::SameLine(); bool isRainbow = (bool)CVarGetInteger((cosmeticOption.rainbowCvar), 0); @@ -1615,20 +1615,20 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) { CVarSetInteger((cosmeticOption.rainbowCvar), isRainbow); CVarSetInteger((cosmeticOption.changedCvar), 1); ApplyOrResetCustomGfxPatches(); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } ImGui::SameLine(); bool isLocked = (bool)CVarGetInteger((cosmeticOption.lockedCvar), 0); if (ImGui::Checkbox(("Locked##" + cosmeticOption.label).c_str(), &isLocked)) { CVarSetInteger((cosmeticOption.lockedCvar), isLocked); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } if (CVarGetInteger((cosmeticOption.changedCvar), 0)) { ImGui::SameLine(); if (ImGui::Button(("Reset##" + cosmeticOption.label).c_str())) { ResetColor(cosmeticOption); ApplyOrResetCustomGfxPatches(); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } } } @@ -1644,7 +1644,7 @@ void DrawCosmeticGroup(CosmeticGroup cosmeticGroup) { } } ApplyOrResetCustomGfxPatches(); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } ImGui::SameLine(); if (ImGui::Button(("Reset##" + label).c_str())) { @@ -1654,7 +1654,7 @@ void DrawCosmeticGroup(CosmeticGroup cosmeticGroup) { } } ApplyOrResetCustomGfxPatches(); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } for (auto& [id, cosmeticOption] : cosmeticOptions) { if (cosmeticOption.group == cosmeticGroup && (!cosmeticOption.advancedOption || CVarGetInteger("gCosmetics.AdvancedMode", 0))) { @@ -1691,7 +1691,7 @@ void DrawCosmeticsEditor(bool& open) { CVarSetInteger(cosmeticOption.lockedCvar, 1); } } - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } ImGui::SameLine(); if (ImGui::Button("Unlock All Advanced", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) { @@ -1700,7 +1700,7 @@ void DrawCosmeticsEditor(bool& open) { CVarSetInteger(cosmeticOption.lockedCvar, 0); } } - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } } UIWidgets::EnhancementCheckbox("Sync Rainbow colors", "gCosmetics.RainbowSync"); @@ -1712,7 +1712,7 @@ void DrawCosmeticsEditor(bool& open) { } } ApplyOrResetCustomGfxPatches(); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } ImGui::SameLine(); if (ImGui::Button("Reset All", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) { @@ -1722,7 +1722,7 @@ void DrawCosmeticsEditor(bool& open) { } } ApplyOrResetCustomGfxPatches(); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } if (ImGui::Button("Lock All", ImVec2(ImGui::GetContentRegionAvail().x / 2, 30.0f))) { @@ -1731,7 +1731,7 @@ void DrawCosmeticsEditor(bool& open) { CVarSetInteger(cosmeticOption.lockedCvar, 1); } } - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } ImGui::SameLine(); if (ImGui::Button("Unlock All", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) { @@ -1740,7 +1740,7 @@ void DrawCosmeticsEditor(bool& open) { CVarSetInteger(cosmeticOption.lockedCvar, 0); } } - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } if (ImGui::BeginTabBar("CosmeticsContextTabBar", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) { @@ -1765,7 +1765,7 @@ void DrawCosmeticsEditor(bool& open) { if (ImGui::Button("Reset##Trails_Duration")) { CVarClear("gCosmetics.Trails_Duration.Value"); CVarClear("gCosmetics.Trails_Duration.Changed"); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } ImGui::EndTabItem(); } @@ -1802,10 +1802,10 @@ void RegisterOnLoadGameHook() { void InitCosmeticsEditor() { // There's probably a better way to do this, but leaving as is for historical reasons. Even though there is no // real window being rendered here, it calls this every frame allowing us to rotate through the rainbow hue for cosmetics - SohImGui::AddWindow("Enhancements", "Cosmetics Update Tick", CosmeticsUpdateTick, true, true); + Ship::AddWindow("Enhancements", "Cosmetics Update Tick", CosmeticsUpdateTick, true, true); // Draw the bar in the menu. - SohImGui::AddWindow("Enhancements", "Cosmetics Editor", DrawCosmeticsEditor); + Ship::AddWindow("Enhancements", "Cosmetics Editor", DrawCosmeticsEditor); // Convert the `current color` into the format that the ImGui color picker expects for (auto& [id, cosmeticOption] : cosmeticOptions) { Color_RGBA8 defaultColor = {cosmeticOption.defaultColor.x, cosmeticOption.defaultColor.y, cosmeticOption.defaultColor.z, cosmeticOption.defaultColor.w}; @@ -1816,7 +1816,7 @@ void InitCosmeticsEditor() { cosmeticOption.currentColor.z = cvarColor.b / 255.0; cosmeticOption.currentColor.w = cvarColor.a / 255.0; } - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); ApplyOrResetCustomGfxPatches(); ApplyAuthenticGfxPatches(); @@ -1831,7 +1831,7 @@ void CosmeticsEditor_RandomizeAll() { } } - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); ApplyOrResetCustomGfxPatches(); } @@ -1842,6 +1842,6 @@ void CosmeticsEditor_ResetAll() { } } - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); ApplyOrResetCustomGfxPatches(); } diff --git a/soh/soh/Enhancements/custom-message/CustomMessageManager.h b/soh/soh/Enhancements/custom-message/CustomMessageManager.h index eedb06f9a..2509b92b2 100644 --- a/soh/soh/Enhancements/custom-message/CustomMessageManager.h +++ b/soh/soh/Enhancements/custom-message/CustomMessageManager.h @@ -1,6 +1,7 @@ #pragma once #include #include +#include #include "../../../include/z64item.h" #include "../../../include/message_data_textbox_types.h" diff --git a/soh/soh/Enhancements/debugconsole.cpp b/soh/soh/Enhancements/debugconsole.cpp index 29f569933..cf11dde1d 100644 --- a/soh/soh/Enhancements/debugconsole.cpp +++ b/soh/soh/Enhancements/debugconsole.cpp @@ -31,16 +31,16 @@ extern PlayState* gPlayState; #include -#define CMD_REGISTER SohImGui::GetConsole()->AddCommand +#define CMD_REGISTER Ship::GetConsole()->AddCommand static bool ActorSpawnHandler(std::shared_ptr Console, const std::vector& args) { if ((args.size() != 9) && (args.size() != 3) && (args.size() != 6)) { - SohImGui::GetConsole()->SendErrorMessage("Not enough arguments passed to actorspawn"); + Ship::GetConsole()->SendErrorMessage("Not enough arguments passed to actorspawn"); return CMD_FAILED; } if (gPlayState == nullptr) { - SohImGui::GetConsole()->SendErrorMessage("PlayState == nullptr"); + Ship::GetConsole()->SendErrorMessage("PlayState == nullptr"); return CMD_FAILED; } @@ -76,7 +76,7 @@ static bool ActorSpawnHandler(std::shared_ptr Console, const std: if (Actor_Spawn(&gPlayState->actorCtx, gPlayState, actorId, spawnPoint.pos.x, spawnPoint.pos.y, spawnPoint.pos.z, spawnPoint.rot.x, spawnPoint.rot.y, spawnPoint.rot.z, params, 0) == NULL) { - SohImGui::GetConsole()->SendErrorMessage("Failed to spawn actor. Actor_Spawn returned NULL"); + Ship::GetConsole()->SendErrorMessage("Failed to spawn actor. Actor_Spawn returned NULL"); return CMD_FAILED; } return CMD_SUCCESS; @@ -87,17 +87,17 @@ static bool KillPlayerHandler(std::shared_ptr Console, const std: effect->parameters[0] = 0; GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] You've met with a terrible fate, haven't you?"); + Ship::GetConsole()->SendInfoMessage("[SOH] You've met with a terrible fate, haven't you?"); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not kill player."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not kill player."); return CMD_FAILED; } } static bool SetPlayerHealthHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } int health; @@ -105,12 +105,12 @@ static bool SetPlayerHealthHandler(std::shared_ptr Console, const try { health = std::stoi(args[1]); } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Health value must be an integer."); + Ship::GetConsole()->SendErrorMessage("[SOH] Health value must be an integer."); return CMD_FAILED; } if (health < 0) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Health value must be a positive integer"); + Ship::GetConsole()->SendErrorMessage("[SOH] Health value must be a positive integer"); return CMD_FAILED; } @@ -118,10 +118,10 @@ static bool SetPlayerHealthHandler(std::shared_ptr Console, const effect->parameters[0] = health; GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Player health updated to %d", health); + Ship::GetConsole()->SendInfoMessage("[SOH] Player health updated to %d", health); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not set player health."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not set player health."); return CMD_FAILED; } } @@ -144,31 +144,31 @@ static bool RupeeHandler(std::shared_ptr Console, const std::vect rupeeAmount = std::stoi(args[1]); } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Rupee count must be an integer."); + Ship::GetConsole()->SendErrorMessage("[SOH] Rupee count must be an integer."); return CMD_FAILED; } if (rupeeAmount < 0) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Rupee count must be positive"); + Ship::GetConsole()->SendErrorMessage("[SOH] Rupee count must be positive"); return CMD_FAILED; } gSaveContext.rupees = rupeeAmount; - SohImGui::GetConsole()->SendInfoMessage("Set rupee count to %u", rupeeAmount); + Ship::GetConsole()->SendInfoMessage("Set rupee count to %u", rupeeAmount); return CMD_SUCCESS; } static bool SetPosHandler(std::shared_ptr Console, const std::vector args) { if (gPlayState == nullptr) { - SohImGui::GetConsole()->SendErrorMessage("PlayState == nullptr"); + Ship::GetConsole()->SendErrorMessage("PlayState == nullptr"); return CMD_FAILED; } Player* player = GET_PLAYER(gPlayState); if (args.size() == 1) { - SohImGui::GetConsole()->SendInfoMessage("Player position is [ %.2f, %.2f, %.2f ]", player->actor.world.pos.x, + Ship::GetConsole()->SendInfoMessage("Player position is [ %.2f, %.2f, %.2f ]", player->actor.world.pos.x, player->actor.world.pos.y, player->actor.world.pos.z); return CMD_SUCCESS; @@ -180,7 +180,7 @@ static bool SetPosHandler(std::shared_ptr Console, const std::vec player->actor.world.pos.y = std::stof(args[2]); player->actor.world.pos.z = std::stof(args[3]); - SohImGui::GetConsole()->SendInfoMessage("Set player position to [ %.2f, %.2f, %.2f ]", player->actor.world.pos.x, + Ship::GetConsole()->SendInfoMessage("Set player position to [ %.2f, %.2f, %.2f ]", player->actor.world.pos.x, player->actor.world.pos.y, player->actor.world.pos.z); return CMD_SUCCESS; @@ -188,7 +188,7 @@ static bool SetPosHandler(std::shared_ptr Console, const std::vec static bool ResetHandler(std::shared_ptr Console, std::vector args) { if (gPlayState == nullptr) { - SohImGui::GetConsole()->SendErrorMessage("PlayState == nullptr"); + Ship::GetConsole()->SendErrorMessage("PlayState == nullptr"); return CMD_FAILED; } @@ -207,7 +207,7 @@ const static std::map ammoItems{ static bool AddAmmoHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 3) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } int amount; @@ -215,18 +215,18 @@ static bool AddAmmoHandler(std::shared_ptr Console, const std::ve try { amount = std::stoi(args[2]); } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("Ammo count must be an integer"); + Ship::GetConsole()->SendErrorMessage("Ammo count must be an integer"); return CMD_FAILED; } if (amount < 0) { - SohImGui::GetConsole()->SendErrorMessage("Ammo count must be positive"); + Ship::GetConsole()->SendErrorMessage("Ammo count must be positive"); return CMD_FAILED; } const auto& it = ammoItems.find(args[1]); if (it == ammoItems.end()) { - SohImGui::GetConsole()->SendErrorMessage("Invalid ammo type. Options are 'sticks', 'nuts', 'bombs', 'seeds', 'arrows', 'bombchus' and 'beans'"); + Ship::GetConsole()->SendErrorMessage("Invalid ammo type. Options are 'sticks', 'nuts', 'bombs', 'seeds', 'arrows', 'bombchus' and 'beans'"); return CMD_FAILED; } @@ -236,17 +236,17 @@ static bool AddAmmoHandler(std::shared_ptr Console, const std::ve GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Added ammo."); + Ship::GetConsole()->SendInfoMessage("[SOH] Added ammo."); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not add ammo."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not add ammo."); return CMD_FAILED; } } static bool TakeAmmoHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 3) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } int amount; @@ -254,18 +254,18 @@ static bool TakeAmmoHandler(std::shared_ptr Console, const std::v try { amount = std::stoi(args[2]); } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("Ammo count must be an integer"); + Ship::GetConsole()->SendErrorMessage("Ammo count must be an integer"); return CMD_FAILED; } if (amount < 0) { - SohImGui::GetConsole()->SendErrorMessage("Ammo count must be positive"); + Ship::GetConsole()->SendErrorMessage("Ammo count must be positive"); return CMD_FAILED; } const auto& it = ammoItems.find(args[1]); if (it == ammoItems.end()) { - SohImGui::GetConsole()->SendErrorMessage( + Ship::GetConsole()->SendErrorMessage( "Invalid ammo type. Options are 'sticks', 'nuts', 'bombs', 'seeds', 'arrows', 'bombchus' and 'beans'"); return CMD_FAILED; } @@ -276,10 +276,10 @@ static bool TakeAmmoHandler(std::shared_ptr Console, const std::v GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Took ammo."); + Ship::GetConsole()->SendInfoMessage("[SOH] Took ammo."); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not take ammo."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not take ammo."); return CMD_FAILED; } } @@ -293,7 +293,7 @@ const static std::map bottleItems{ static bool BottleHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 3) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } @@ -301,19 +301,19 @@ static bool BottleHandler(std::shared_ptr Console, const std::vec try { slot = std::stoi(args[2]); } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Bottle slot must be an integer."); + Ship::GetConsole()->SendErrorMessage("[SOH] Bottle slot must be an integer."); return CMD_FAILED; } if ((slot < 1) || (slot > 4)) { - SohImGui::GetConsole()->SendErrorMessage("Invalid slot passed"); + Ship::GetConsole()->SendErrorMessage("Invalid slot passed"); return CMD_FAILED; } const auto& it = bottleItems.find(args[1]); if (it == bottleItems.end()) { - SohImGui::GetConsole()->SendErrorMessage("Invalid item passed"); + Ship::GetConsole()->SendErrorMessage("Invalid item passed"); return CMD_FAILED; } @@ -325,7 +325,7 @@ static bool BottleHandler(std::shared_ptr Console, const std::vec static bool BHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } @@ -335,7 +335,7 @@ static bool BHandler(std::shared_ptr Console, const std::vector Console, const std::vector& args) { if (args.size() < 3) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } @@ -346,7 +346,7 @@ static bool ItemHandler(std::shared_ptr Console, const std::vecto static bool GiveItemHandler(std::shared_ptr Console, const std::vector args) { if (args.size() < 3) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } GetItemEntry getItemEntry = GET_ITEM_NONE; @@ -356,7 +356,7 @@ static bool GiveItemHandler(std::shared_ptr Console, const std::v } else if (args[1].compare("randomizer") == 0) { getItemEntry = ItemTableManager::Instance->RetrieveItemEntry(MOD_RANDOMIZER, std::stoi(args[2])); } else { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Invalid argument passed, must be 'vanilla' or 'randomizer'"); + Ship::GetConsole()->SendErrorMessage("[SOH] Invalid argument passed, must be 'vanilla' or 'randomizer'"); return CMD_FAILED; } @@ -367,7 +367,7 @@ static bool GiveItemHandler(std::shared_ptr Console, const std::v static bool EntranceHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } @@ -376,7 +376,7 @@ static bool EntranceHandler(std::shared_ptr Console, const std::v try { entrance = std::stoi(args[1], nullptr, 16); } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Entrance value must be a Hex number."); + Ship::GetConsole()->SendErrorMessage("[SOH] Entrance value must be a Hex number."); return CMD_FAILED; } @@ -396,7 +396,7 @@ static bool VoidHandler(std::shared_ptr Console, const std::vecto gPlayState->fadeTransition = 2; gSaveContext.nextTransitionType = 2; } else { - SohImGui::GetConsole()->SendErrorMessage("gPlayState == nullptr"); + Ship::GetConsole()->SendErrorMessage("gPlayState == nullptr"); return CMD_FAILED; } return CMD_SUCCESS; @@ -409,7 +409,7 @@ static bool ReloadHandler(std::shared_ptr Console, const std::vec gPlayState->fadeTransition = 11; gSaveContext.nextTransitionType = 11; } else { - SohImGui::GetConsole()->SendErrorMessage("gPlayState == nullptr"); + Ship::GetConsole()->SendErrorMessage("gPlayState == nullptr"); return CMD_FAILED; } return CMD_SUCCESS; @@ -421,13 +421,13 @@ const static std::map fw_options { static bool FWHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } const auto& it = fw_options.find(args[1]); if (it == fw_options.end()) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Invalid option. Options are 'clear', 'warp', 'backup'"); + Ship::GetConsole()->SendErrorMessage("[SOH] Invalid option. Options are 'clear', 'warp', 'backup'"); return CMD_FAILED; } @@ -436,7 +436,7 @@ static bool FWHandler(std::shared_ptr Console, const std::vector< switch(it->second) { case 0: //clear gSaveContext.fw = clear; - SohImGui::GetConsole()->SendInfoMessage("[SOH] Farore's wind point cleared! Reload scene to take effect."); + Ship::GetConsole()->SendInfoMessage("[SOH] Farore's wind point cleared! Reload scene to take effect."); return CMD_SUCCESS; break; case 1: //warp @@ -445,7 +445,7 @@ static bool FWHandler(std::shared_ptr Console, const std::vector< gPlayState->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_TOP].entranceIndex; gPlayState->fadeTransition = 5; } else { - SohImGui::GetConsole()->SendErrorMessage("Farore's wind not set!"); + Ship::GetConsole()->SendErrorMessage("Farore's wind not set!"); return CMD_FAILED; } return CMD_SUCCESS; @@ -454,17 +454,17 @@ static bool FWHandler(std::shared_ptr Console, const std::vector< if (CVarGetInteger("gBetterFW", 0)) { gSaveContext.fw = gSaveContext.backupFW; gSaveContext.fw.set = 1; - SohImGui::GetConsole()->SendInfoMessage("[SOH] Backup FW data copied! Reload scene to take effect."); + Ship::GetConsole()->SendInfoMessage("[SOH] Backup FW data copied! Reload scene to take effect."); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendErrorMessage("Better Farore's Wind isn't turned on!"); + Ship::GetConsole()->SendErrorMessage("Better Farore's Wind isn't turned on!"); return CMD_FAILED; } break; } } else { - SohImGui::GetConsole()->SendErrorMessage("gPlayState == nullptr"); + Ship::GetConsole()->SendErrorMessage("gPlayState == nullptr"); return CMD_FAILED; } @@ -476,7 +476,7 @@ static bool FileSelectHandler(std::shared_ptr Console, const std: SET_NEXT_GAMESTATE(&gPlayState->state, FileChoose_Init, FileChooseContext); gPlayState->state.running = 0; } else { - SohImGui::GetConsole()->SendErrorMessage("gPlayState == nullptr"); + Ship::GetConsole()->SendErrorMessage("gPlayState == nullptr"); return CMD_FAILED; } return CMD_SUCCESS; @@ -493,10 +493,10 @@ static bool SaveStateHandler(std::shared_ptr Console, const std:: switch (rtn) { case SaveStateReturn::SUCCESS: - SohImGui::GetConsole()->SendInfoMessage("[SOH] Saved state to slot %u", slot); + Ship::GetConsole()->SendInfoMessage("[SOH] Saved state to slot %u", slot); return CMD_SUCCESS; case SaveStateReturn::FAIL_WRONG_GAMESTATE: - SohImGui::GetConsole()->SendErrorMessage("[SOH] Can not save a state outside of \"GamePlay\""); + Ship::GetConsole()->SendErrorMessage("[SOH] Can not save a state outside of \"GamePlay\""); return CMD_FAILED; } } @@ -507,16 +507,16 @@ static bool LoadStateHandler(std::shared_ptr Console, const std:: switch (rtn) { case SaveStateReturn::SUCCESS: - SohImGui::GetConsole()->SendInfoMessage("[SOH] Loaded state from slot (%u)", slot); + Ship::GetConsole()->SendInfoMessage("[SOH] Loaded state from slot (%u)", slot); return CMD_SUCCESS; case SaveStateReturn::FAIL_INVALID_SLOT: - SohImGui::GetConsole()->SendErrorMessage("[SOH] Invalid State Slot Number (%u)", slot); + Ship::GetConsole()->SendErrorMessage("[SOH] Invalid State Slot Number (%u)", slot); return CMD_FAILED; case SaveStateReturn::FAIL_STATE_EMPTY: - SohImGui::GetConsole()->SendErrorMessage("[SOH] State Slot (%u) is empty", slot); + Ship::GetConsole()->SendErrorMessage("[SOH] State Slot (%u) is empty", slot); return CMD_FAILED; case SaveStateReturn::FAIL_WRONG_GAMESTATE: - SohImGui::GetConsole()->SendErrorMessage("[SOH] Can not load a state outside of \"GamePlay\""); + Ship::GetConsole()->SendErrorMessage("[SOH] Can not load a state outside of \"GamePlay\""); return CMD_FAILED; } @@ -524,7 +524,7 @@ static bool LoadStateHandler(std::shared_ptr Console, const std:: static bool StateSlotSelectHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } uint8_t slot; @@ -532,24 +532,24 @@ static bool StateSlotSelectHandler(std::shared_ptr Console, const try { slot = std::stoi(args[1], nullptr, 10); } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] SaveState slot value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] SaveState slot value must be a number."); return CMD_FAILED; } if (slot < 0) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Invalid slot passed. Slot must be between 0 and 2"); + Ship::GetConsole()->SendErrorMessage("[SOH] Invalid slot passed. Slot must be between 0 and 2"); return CMD_FAILED; } OTRGlobals::Instance->gSaveStateMgr->SetCurrentSlot(slot); - SohImGui::GetConsole()->SendInfoMessage("[SOH] Slot %u selected", + Ship::GetConsole()->SendInfoMessage("[SOH] Slot %u selected", OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot()); return CMD_SUCCESS; } static bool InvisibleHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } uint8_t state; @@ -557,7 +557,7 @@ static bool InvisibleHandler(std::shared_ptr Console, const std:: try { state = std::stoi(args[1], nullptr, 10) == 0 ? 0 : 1; } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Invisible value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] Invisible value must be a number."); return CMD_FAILED; } @@ -565,10 +565,10 @@ static bool InvisibleHandler(std::shared_ptr Console, const std:: GameInteractionEffectQueryResult result = state ? GameInteractor::ApplyEffect(effect) : GameInteractor::RemoveEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Invisible Link %s", state ? "enabled" : "disabled"); + Ship::GetConsole()->SendInfoMessage("[SOH] Invisible Link %s", state ? "enabled" : "disabled"); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not %s Invisible Link.", + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not %s Invisible Link.", state ? "enable" : "disable"); return CMD_FAILED; } @@ -576,7 +576,7 @@ static bool InvisibleHandler(std::shared_ptr Console, const std:: static bool GiantLinkHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } uint8_t state; @@ -584,7 +584,7 @@ static bool GiantLinkHandler(std::shared_ptr Console, const std:: try { state = std::stoi(args[1], nullptr, 10) == 0 ? 0 : 1; } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Giant value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] Giant value must be a number."); return CMD_FAILED; } @@ -593,10 +593,10 @@ static bool GiantLinkHandler(std::shared_ptr Console, const std:: GameInteractionEffectQueryResult result = state ? GameInteractor::ApplyEffect(effect) : GameInteractor::RemoveEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Giant Link %s", state ? "enabled" : "disabled"); + Ship::GetConsole()->SendInfoMessage("[SOH] Giant Link %s", state ? "enabled" : "disabled"); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not %s Giant Link.", + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not %s Giant Link.", state ? "enable" : "disable"); return CMD_FAILED; } @@ -604,7 +604,7 @@ static bool GiantLinkHandler(std::shared_ptr Console, const std:: static bool MinishLinkHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } uint8_t state; @@ -612,7 +612,7 @@ static bool MinishLinkHandler(std::shared_ptr Console, const std: try { state = std::stoi(args[1], nullptr, 10) == 0 ? 0 : 1; } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Minish value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] Minish value must be a number."); return CMD_FAILED; } @@ -621,10 +621,10 @@ static bool MinishLinkHandler(std::shared_ptr Console, const std: GameInteractionEffectQueryResult result = state ? GameInteractor::ApplyEffect(effect) : GameInteractor::RemoveEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Minish Link %s", state ? "enabled" : "disabled"); + Ship::GetConsole()->SendInfoMessage("[SOH] Minish Link %s", state ? "enabled" : "disabled"); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not %s Minish Link.", + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not %s Minish Link.", state ? "enable" : "disable"); return CMD_FAILED; } @@ -632,7 +632,7 @@ static bool MinishLinkHandler(std::shared_ptr Console, const std: static bool AddHeartContainerHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } int hearts; @@ -640,12 +640,12 @@ static bool AddHeartContainerHandler(std::shared_ptr Console, con try { hearts = std::stoi(args[1]); } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Hearts value must be an integer."); + Ship::GetConsole()->SendErrorMessage("[SOH] Hearts value must be an integer."); return CMD_FAILED; } if (hearts < 0) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Hearts value must be a positive integer"); + Ship::GetConsole()->SendErrorMessage("[SOH] Hearts value must be a positive integer"); return CMD_FAILED; } @@ -653,17 +653,17 @@ static bool AddHeartContainerHandler(std::shared_ptr Console, con effect->parameters[0] = hearts; GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Added %d heart containers", hearts); + Ship::GetConsole()->SendInfoMessage("[SOH] Added %d heart containers", hearts); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not add heart containers."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not add heart containers."); return CMD_FAILED; } } static bool RemoveHeartContainerHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } int hearts; @@ -671,12 +671,12 @@ static bool RemoveHeartContainerHandler(std::shared_ptr Console, try { hearts = std::stoi(args[1]); } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Hearts value must be an integer."); + Ship::GetConsole()->SendErrorMessage("[SOH] Hearts value must be an integer."); return CMD_FAILED; } if (hearts < 0) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Hearts value must be a positive integer"); + Ship::GetConsole()->SendErrorMessage("[SOH] Hearts value must be a positive integer"); return CMD_FAILED; } @@ -684,17 +684,17 @@ static bool RemoveHeartContainerHandler(std::shared_ptr Console, effect->parameters[0] = -hearts; GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Removed %d heart containers", hearts); + Ship::GetConsole()->SendInfoMessage("[SOH] Removed %d heart containers", hearts); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not remove heart containers."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not remove heart containers."); return CMD_FAILED; } } static bool GravityHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } @@ -703,23 +703,23 @@ static bool GravityHandler(std::shared_ptr Console, const std::ve try { effect->parameters[0] = Ship::Math::clamp(std::stoi(args[1], nullptr, 10), GI_GRAVITY_LEVEL_LIGHT, GI_GRAVITY_LEVEL_HEAVY); } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Gravity value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] Gravity value must be a number."); return CMD_FAILED; } GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Updated gravity."); + Ship::GetConsole()->SendInfoMessage("[SOH] Updated gravity."); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not update gravity."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not update gravity."); return CMD_FAILED; } } static bool NoUIHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } uint8_t state; @@ -727,7 +727,7 @@ static bool NoUIHandler(std::shared_ptr Console, const std::vecto try { state = std::stoi(args[1], nullptr, 10) == 0 ? 0 : 1; } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] No UI value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] No UI value must be a number."); return CMD_FAILED; } @@ -736,10 +736,10 @@ static bool NoUIHandler(std::shared_ptr Console, const std::vecto state ? GameInteractor::ApplyEffect(effect) : GameInteractor::RemoveEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] No UI %s", state ? "enabled" : "disabled"); + Ship::GetConsole()->SendInfoMessage("[SOH] No UI %s", state ? "enabled" : "disabled"); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not %s No UI.", + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not %s No UI.", state ? "enable" : "disable"); return CMD_FAILED; } @@ -750,17 +750,17 @@ static bool FreezeHandler(std::shared_ptr Console, const std::vec GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Player frozen"); + Ship::GetConsole()->SendInfoMessage("[SOH] Player frozen"); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not freeze player."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not freeze player."); return CMD_FAILED; } } static bool DefenseModifierHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } GameInteractionEffectBase* effect = new GameInteractionEffect::ModifyDefenseModifier(); @@ -768,23 +768,23 @@ static bool DefenseModifierHandler(std::shared_ptr Console, const try { effect->parameters[0] = std::stoi(args[1], nullptr, 10); } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Defense modifier value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] Defense modifier value must be a number."); return CMD_FAILED; } GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Defense modifier set to %d", effect->parameters[0]); + Ship::GetConsole()->SendInfoMessage("[SOH] Defense modifier set to %d", effect->parameters[0]); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not set defense modifier."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not set defense modifier."); return CMD_FAILED; } } static bool DamageHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } GameInteractionEffectBase* effect = new GameInteractionEffect::ModifyHealth(); @@ -792,29 +792,29 @@ static bool DamageHandler(std::shared_ptr Console, const std::vec try { int value = std::stoi(args[1], nullptr, 10); if (value < 0) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Invalid value passed. Value must be greater than 0"); + Ship::GetConsole()->SendErrorMessage("[SOH] Invalid value passed. Value must be greater than 0"); return CMD_FAILED; } effect->parameters[0] = -value; } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Damage value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] Damage value must be a number."); return CMD_FAILED; } GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Player damaged"); + Ship::GetConsole()->SendInfoMessage("[SOH] Player damaged"); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not damage player."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not damage player."); return CMD_FAILED; } } static bool HealHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } GameInteractionEffectBase* effect = new GameInteractionEffect::ModifyHealth(); @@ -822,22 +822,22 @@ static bool HealHandler(std::shared_ptr Console, const std::vecto try { int value = std::stoi(args[1], nullptr, 10); if (value < 0) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Invalid value passed. Value must be greater than 0"); + Ship::GetConsole()->SendErrorMessage("[SOH] Invalid value passed. Value must be greater than 0"); return CMD_FAILED; } effect->parameters[0] = value; } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Damage value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] Damage value must be a number."); return CMD_FAILED; } GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Player healed"); + Ship::GetConsole()->SendInfoMessage("[SOH] Player healed"); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not heal player."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not heal player."); return CMD_FAILED; } } @@ -847,10 +847,10 @@ static bool FillMagicHandler(std::shared_ptr Console, const std:: GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Magic filled"); + Ship::GetConsole()->SendInfoMessage("[SOH] Magic filled"); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not fill magic."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not fill magic."); return CMD_FAILED; } } @@ -860,17 +860,17 @@ static bool EmptyMagicHandler(std::shared_ptr Console, const std: GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Magic emptied"); + Ship::GetConsole()->SendInfoMessage("[SOH] Magic emptied"); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not empty magic."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not empty magic."); return CMD_FAILED; } } static bool NoZHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } uint8_t state; @@ -878,7 +878,7 @@ static bool NoZHandler(std::shared_ptr Console, const std::vector try { state = std::stoi(args[1], nullptr, 10) == 0 ? 0 : 1; } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] NoZ value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] NoZ value must be a number."); return CMD_FAILED; } @@ -887,10 +887,10 @@ static bool NoZHandler(std::shared_ptr Console, const std::vector state ? GameInteractor::ApplyEffect(effect) : GameInteractor::RemoveEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] NoZ " + std::string(state ? "enabled" : "disabled")); + Ship::GetConsole()->SendInfoMessage("[SOH] NoZ " + std::string(state ? "enabled" : "disabled")); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not " + + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not " + std::string(state ? "enable" : "disable") + " NoZ."); return CMD_FAILED; } @@ -898,7 +898,7 @@ static bool NoZHandler(std::shared_ptr Console, const std::vector static bool OneHitKOHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } uint8_t state; @@ -906,7 +906,7 @@ static bool OneHitKOHandler(std::shared_ptr Console, const std::v try { state = std::stoi(args[1], nullptr, 10) == 0 ? 0 : 1; } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] One-hit KO value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] One-hit KO value must be a number."); return CMD_FAILED; } @@ -915,10 +915,10 @@ static bool OneHitKOHandler(std::shared_ptr Console, const std::v state ? GameInteractor::ApplyEffect(effect) : GameInteractor::RemoveEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] One-hit KO " + std::string(state ? "enabled" : "disabled")); + Ship::GetConsole()->SendInfoMessage("[SOH] One-hit KO " + std::string(state ? "enabled" : "disabled")); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not " + + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not " + std::string(state ? "enable" : "disable") + " One-hit KO."); return CMD_FAILED; } @@ -926,7 +926,7 @@ static bool OneHitKOHandler(std::shared_ptr Console, const std::v static bool PacifistHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } uint8_t state; @@ -934,7 +934,7 @@ static bool PacifistHandler(std::shared_ptr Console, const std::v try { state = std::stoi(args[1], nullptr, 10) == 0 ? 0 : 1; } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Pacifist value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] Pacifist value must be a number."); return CMD_FAILED; } @@ -943,10 +943,10 @@ static bool PacifistHandler(std::shared_ptr Console, const std::v state ? GameInteractor::ApplyEffect(effect) : GameInteractor::RemoveEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Pacifist " + std::string(state ? "enabled" : "disabled")); + Ship::GetConsole()->SendInfoMessage("[SOH] Pacifist " + std::string(state ? "enabled" : "disabled")); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not " + + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not " + std::string(state ? "enable" : "disable") + " Pacifist."); return CMD_FAILED; } @@ -954,7 +954,7 @@ static bool PacifistHandler(std::shared_ptr Console, const std::v static bool PaperLinkHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } uint8_t state; @@ -962,7 +962,7 @@ static bool PaperLinkHandler(std::shared_ptr Console, const std:: try { state = std::stoi(args[1], nullptr, 10) == 0 ? 0 : 1; } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Paper Link value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] Paper Link value must be a number."); return CMD_FAILED; } @@ -972,10 +972,10 @@ static bool PaperLinkHandler(std::shared_ptr Console, const std:: state ? GameInteractor::ApplyEffect(effect) : GameInteractor::RemoveEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Paper Link " + std::string(state ? "enabled" : "disabled")); + Ship::GetConsole()->SendInfoMessage("[SOH] Paper Link " + std::string(state ? "enabled" : "disabled")); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not " + + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not " + std::string(state ? "enable" : "disable") + " Paper Link."); return CMD_FAILED; } @@ -983,7 +983,7 @@ static bool PaperLinkHandler(std::shared_ptr Console, const std:: static bool RainstormHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } uint8_t state; @@ -991,7 +991,7 @@ static bool RainstormHandler(std::shared_ptr Console, const std:: try { state = std::stoi(args[1], nullptr, 10) == 0 ? 0 : 1; } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Rainstorm value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] Rainstorm value must be a number."); return CMD_FAILED; } @@ -1000,10 +1000,10 @@ static bool RainstormHandler(std::shared_ptr Console, const std:: state ? GameInteractor::ApplyEffect(effect) : GameInteractor::RemoveEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Rainstorm " + std::string(state ? "enabled" : "disabled")); + Ship::GetConsole()->SendInfoMessage("[SOH] Rainstorm " + std::string(state ? "enabled" : "disabled")); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not " + + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not " + std::string(state ? "enable" : "disable") + " Rainstorm."); return CMD_FAILED; } @@ -1011,7 +1011,7 @@ static bool RainstormHandler(std::shared_ptr Console, const std:: static bool ReverseControlsHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } uint8_t state; @@ -1019,7 +1019,7 @@ static bool ReverseControlsHandler(std::shared_ptr Console, const try { state = std::stoi(args[1], nullptr, 10) == 0 ? 0 : 1; } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Reverse controls value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] Reverse controls value must be a number."); return CMD_FAILED; } @@ -1028,11 +1028,11 @@ static bool ReverseControlsHandler(std::shared_ptr Console, const state ? GameInteractor::ApplyEffect(effect) : GameInteractor::RemoveEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Reverse controls " + + Ship::GetConsole()->SendInfoMessage("[SOH] Reverse controls " + std::string(state ? "enabled" : "disabled")); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not " + + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not " + std::string(state ? "enable" : "disable") + " Reverse controls."); return CMD_FAILED; } @@ -1040,7 +1040,7 @@ static bool ReverseControlsHandler(std::shared_ptr Console, const static bool UpdateRupeesHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } GameInteractionEffectBase* effect = new GameInteractionEffect::ModifyRupees(); @@ -1048,23 +1048,23 @@ static bool UpdateRupeesHandler(std::shared_ptr Console, const st try { effect->parameters[0] = std::stoi(args[1], nullptr, 10); } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Rupee value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] Rupee value must be a number."); return CMD_FAILED; } GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Rupees updated"); + Ship::GetConsole()->SendInfoMessage("[SOH] Rupees updated"); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not update rupees."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not update rupees."); return CMD_FAILED; } } static bool SpeedModifierHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } GameInteractionEffectBase* effect = new GameInteractionEffect::ModifyRunSpeedModifier(); @@ -1072,16 +1072,16 @@ static bool SpeedModifierHandler(std::shared_ptr Console, const s try { effect->parameters[0] = std::stoi(args[1], nullptr, 10); } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Speed modifier value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] Speed modifier value must be a number."); return CMD_FAILED; } GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Speed modifier updated"); + Ship::GetConsole()->SendInfoMessage("[SOH] Speed modifier updated"); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not update speed modifier."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not update speed modifier."); return CMD_FAILED; } } @@ -1094,13 +1094,13 @@ const static std::map boots { static bool BootsHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } const auto& it = boots.find(args[1]); if (it == boots.end()) { - SohImGui::GetConsole()->SendErrorMessage("Invalid boot type. Options are 'kokiri', 'iron' and 'hover'"); + Ship::GetConsole()->SendErrorMessage("Invalid boot type. Options are 'kokiri', 'iron' and 'hover'"); return CMD_FAILED; } @@ -1109,10 +1109,10 @@ static bool BootsHandler(std::shared_ptr Console, const std::vect GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Boots updated."); + Ship::GetConsole()->SendInfoMessage("[SOH] Boots updated."); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not update boots."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not update boots."); return CMD_FAILED; } } @@ -1125,13 +1125,13 @@ const static std::map shields { static bool GiveShieldHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } const auto& it = shields.find(args[1]); if (it == shields.end()) { - SohImGui::GetConsole()->SendErrorMessage("Invalid shield type. Options are 'deku', 'hylian' and 'mirror'"); + Ship::GetConsole()->SendErrorMessage("Invalid shield type. Options are 'deku', 'hylian' and 'mirror'"); return CMD_FAILED; } @@ -1140,23 +1140,23 @@ static bool GiveShieldHandler(std::shared_ptr Console, const std: GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Gave shield."); + Ship::GetConsole()->SendInfoMessage("[SOH] Gave shield."); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not give shield."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not give shield."); return CMD_FAILED; } } static bool TakeShieldHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } const auto& it = shields.find(args[1]); if (it == shields.end()) { - SohImGui::GetConsole()->SendErrorMessage("Invalid shield type. Options are 'deku', 'hylian' and 'mirror'"); + Ship::GetConsole()->SendErrorMessage("Invalid shield type. Options are 'deku', 'hylian' and 'mirror'"); return CMD_FAILED; } @@ -1165,17 +1165,17 @@ static bool TakeShieldHandler(std::shared_ptr Console, const std: GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Took shield."); + Ship::GetConsole()->SendInfoMessage("[SOH] Took shield."); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not take shield."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not take shield."); return CMD_FAILED; } } static bool KnockbackHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } GameInteractionEffectBase* effect = new GameInteractionEffect::KnockbackPlayer(); @@ -1183,22 +1183,22 @@ static bool KnockbackHandler(std::shared_ptr Console, const std:: try { int value = std::stoi(args[1], nullptr, 10); if (value < 0) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Invalid value passed. Value must be greater than 0"); + Ship::GetConsole()->SendErrorMessage("[SOH] Invalid value passed. Value must be greater than 0"); return CMD_FAILED; } effect->parameters[0] = value; } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Knockback value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] Knockback value must be a number."); return CMD_FAILED; } GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Knockback applied"); + Ship::GetConsole()->SendInfoMessage("[SOH] Knockback applied"); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not apply knockback."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not apply knockback."); return CMD_FAILED; } } @@ -1208,10 +1208,10 @@ static bool ElectrocuteHandler(std::shared_ptr Console, const std GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Electrocuted player"); + Ship::GetConsole()->SendInfoMessage("[SOH] Electrocuted player"); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not electrocute player."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not electrocute player."); return CMD_FAILED; } } @@ -1221,10 +1221,10 @@ static bool BurnHandler(std::shared_ptr Console, const std::vecto GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Burned player"); + Ship::GetConsole()->SendInfoMessage("[SOH] Burned player"); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not burn player."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not burn player."); return CMD_FAILED; } } @@ -1233,10 +1233,10 @@ static bool CuccoStormHandler(std::shared_ptr Console, const std: GameInteractionEffectQueryResult result = GameInteractor::RawAction::SpawnActor(ACTOR_EN_NIW, 0); if (result == GameInteractionEffectQueryResult::Possible) { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Spawned cucco storm"); + Ship::GetConsole()->SendInfoMessage("[SOH] Spawned cucco storm"); return CMD_SUCCESS; } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not spawn cucco storm."); + Ship::GetConsole()->SendInfoMessage("[SOH] Command failed: Could not spawn cucco storm."); return CMD_FAILED; } } @@ -1260,18 +1260,18 @@ static bool GenerateRandoHandler(std::shared_ptr Console, const s return CMD_SUCCESS; } } catch (std::invalid_argument const& ex) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] seed|count value must be a number."); + Ship::GetConsole()->SendErrorMessage("[SOH] seed|count value must be a number."); return CMD_FAILED; } - SohImGui::GetConsole()->SendErrorMessage("[SOH] Rando generation already in progress"); + Ship::GetConsole()->SendErrorMessage("[SOH] Rando generation already in progress"); return CMD_FAILED; } static bool CosmeticsHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } @@ -1280,7 +1280,7 @@ static bool CosmeticsHandler(std::shared_ptr Console, const std:: } else if (args[1].compare("randomize") == 0) { CosmeticsEditor_RandomizeAll(); } else { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Invalid argument passed, must be 'reset' or 'randomize'"); + Ship::GetConsole()->SendErrorMessage("[SOH] Invalid argument passed, must be 'reset' or 'randomize'"); return CMD_FAILED; } @@ -1289,7 +1289,7 @@ static bool CosmeticsHandler(std::shared_ptr Console, const std:: static bool SfxHandler(std::shared_ptr Console, const std::vector& args) { if (args.size() < 2) { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); + Ship::GetConsole()->SendErrorMessage("[SOH] Unexpected arguments passed"); return CMD_FAILED; } @@ -1298,7 +1298,7 @@ static bool SfxHandler(std::shared_ptr Console, const std::vector } else if (args[1].compare("randomize") == 0) { AudioEditor_RandomizeAll(); } else { - SohImGui::GetConsole()->SendErrorMessage("[SOH] Invalid argument passed, must be 'reset' or 'randomize'"); + Ship::GetConsole()->SendErrorMessage("[SOH] Invalid argument passed, must be 'reset' or 'randomize'"); return CMD_FAILED; } @@ -1361,7 +1361,7 @@ static bool SetCVarHandler(std::shared_ptr Console, const std::ve CVarSave(); - //SohImGui::GetConsole()->SendInfoMessage("[SOH] Updated player position to [ %.2f, %.2f, %.2f ]", pos.x, pos.y, pos.z); + //Ship::GetConsole()->SendInfoMessage("[SOH] Updated player position to [ %.2f, %.2f, %.2f ]", pos.x, pos.y, pos.z); return CMD_SUCCESS; } @@ -1374,17 +1374,17 @@ static bool GetCVarHandler(std::shared_ptr Console, const std::ve if (cvar != nullptr) { if (cvar->Type == Ship::ConsoleVariableType::Integer) - SohImGui::GetConsole()->SendInfoMessage("[SOH] Variable %s is %i", args[1].c_str(), cvar->Integer); + Ship::GetConsole()->SendInfoMessage("[SOH] Variable %s is %i", args[1].c_str(), cvar->Integer); else if (cvar->Type == Ship::ConsoleVariableType::Float) - SohImGui::GetConsole()->SendInfoMessage("[SOH] Variable %s is %f", args[1].c_str(), cvar->Float); + Ship::GetConsole()->SendInfoMessage("[SOH] Variable %s is %f", args[1].c_str(), cvar->Float); else if (cvar->Type == Ship::ConsoleVariableType::String) - SohImGui::GetConsole()->SendInfoMessage("[SOH] Variable %s is %s", args[1].c_str(), cvar->String.c_str()); + Ship::GetConsole()->SendInfoMessage("[SOH] Variable %s is %s", args[1].c_str(), cvar->String.c_str()); else if (cvar->Type == Ship::ConsoleVariableType::Color) - SohImGui::GetConsole()->SendInfoMessage("[SOH] Variable %s is %08X", args[1].c_str(), cvar->Color); + Ship::GetConsole()->SendInfoMessage("[SOH] Variable %s is %08X", args[1].c_str(), cvar->Color); } else { - SohImGui::GetConsole()->SendInfoMessage("[SOH] Could not find variable %s", args[1].c_str()); + Ship::GetConsole()->SendInfoMessage("[SOH] Could not find variable %s", args[1].c_str()); } @@ -1584,5 +1584,6 @@ void DebugConsole_Init(void) { { "reset|randomize", Ship::ArgumentType::TEXT }, }}); + CVarSave(); CVarLoad(); } diff --git a/soh/soh/Enhancements/debugger/actorViewer.cpp b/soh/soh/Enhancements/debugger/actorViewer.cpp index b0c870383..6bf29c12b 100644 --- a/soh/soh/Enhancements/debugger/actorViewer.cpp +++ b/soh/soh/Enhancements/debugger/actorViewer.cpp @@ -787,5 +787,5 @@ void DrawActorViewer(bool& open) { } void InitActorViewer() { - SohImGui::AddWindow("Developer Tools", "Actor Viewer", DrawActorViewer); + Ship::AddWindow("Developer Tools", "Actor Viewer", DrawActorViewer); } diff --git a/soh/soh/Enhancements/debugger/colViewer.cpp b/soh/soh/Enhancements/debugger/colViewer.cpp index c046fe38a..17244706a 100644 --- a/soh/soh/Enhancements/debugger/colViewer.cpp +++ b/soh/soh/Enhancements/debugger/colViewer.cpp @@ -288,7 +288,7 @@ void CreateSphereData() { } void InitColViewer() { - SohImGui::AddWindow("Developer Tools", "Collision Viewer", DrawColViewerWindow); + Ship::AddWindow("Developer Tools", "Collision Viewer", DrawColViewerWindow); CreateCylinderData(); CreateSphereData(); diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index 314358271..0f423dcce 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -21,6 +21,7 @@ extern PlayState* gPlayState; #include "textures/icon_item_static/icon_item_static.h" #include "textures/icon_item_24_static/icon_item_24_static.h" +#include "textures/parameter_static/parameter_static.h" } typedef struct { @@ -140,7 +141,7 @@ std::map itemMapping = { }; std::map gregMapping = { - {ITEM_RUPEE_GREEN, {ITEM_RUPEE_GREEN, "ITEM_RUPEE_GREEN", "ITEM_RUPEE_GREEN_Faded", "__OTR__textures/parameter_static/gRupeeCounterIconTex"}} + {ITEM_RUPEE_GREEN, {ITEM_RUPEE_GREEN, "ITEM_RUPEE_GREEN", "ITEM_RUPEE_GREEN_Faded", gRupeeCounterIconTex}} }; // Maps entries in the GS flag array to the area name it represents @@ -604,7 +605,7 @@ void DrawInfoTab() { void DrawBGSItemFlag(uint8_t itemID) { const ItemMapEntry& slotEntry = itemMapping[itemID]; - ImGui::Image(SohImGui::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1)); + ImGui::Image(Ship::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1)); ImGui::SameLine(); int tradeIndex = itemID - ITEM_POCKET_EGG; bool hasItem = (gSaveContext.adultTradeItems & (1 << tradeIndex)) != 0; @@ -646,7 +647,7 @@ void DrawInventoryTab() { uint8_t item = gSaveContext.inventory.items[index]; if (item != ITEM_NONE) { const ItemMapEntry& slotEntry = itemMapping.find(item)->second; - if (ImGui::ImageButton(SohImGui::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), + if (ImGui::ImageButton(Ship::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { selectedIndex = index; ImGui::OpenPopup(itemPopupPicker); @@ -694,7 +695,7 @@ void DrawInventoryTab() { ImGui::SameLine(); } const ItemMapEntry& slotEntry = possibleItems[pickerIndex]; - if (ImGui::ImageButton(SohImGui::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), + if (ImGui::ImageButton(Ship::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { gSaveContext.inventory.items[selectedIndex] = slotEntry.id; // Set adult trade item flag if you're playing adult trade shuffle in rando @@ -732,7 +733,7 @@ void DrawInventoryTab() { ImGui::PushItemWidth(32.0f); ImGui::BeginGroup(); - ImGui::Image(SohImGui::GetTextureByName(itemMapping[item].name), ImVec2(32.0f, 32.0f)); + ImGui::Image(Ship::GetTextureByName(itemMapping[item].name), ImVec2(32.0f, 32.0f)); ImGui::InputScalar("##ammoInput", ImGuiDataType_S8, &AMMO(item)); ImGui::EndGroup(); @@ -1147,7 +1148,7 @@ void DrawUpgradeIcon(const std::string& categoryName, int32_t categoryId, const uint8_t item = items[CUR_UPG_VALUE(categoryId)]; if (item != ITEM_NONE) { const ItemMapEntry& slotEntry = itemMapping[item]; - if (ImGui::ImageButton(SohImGui::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), + if (ImGui::ImageButton(Ship::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { ImGui::OpenPopup(upgradePopupPicker); } @@ -1175,7 +1176,7 @@ void DrawUpgradeIcon(const std::string& categoryName, int32_t categoryId, const UIWidgets::SetLastItemHoverText("None"); } else { const ItemMapEntry& slotEntry = itemMapping[items[pickerIndex]]; - if (ImGui::ImageButton(SohImGui::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), + if (ImGui::ImageButton(Ship::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { Inventory_ChangeUpgrade(categoryId, pickerIndex); ImGui::CloseCurrentPopup(); @@ -1212,7 +1213,7 @@ void DrawEquipmentTab() { bool hasEquip = (bitMask & gSaveContext.inventory.equipment) != 0; const ItemMapEntry& entry = itemMapping[equipmentValues[i]]; ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); - if (ImGui::ImageButton(SohImGui::GetTextureByName(hasEquip ? entry.name : entry.nameFaded), + if (ImGui::ImageButton(Ship::GetTextureByName(hasEquip ? entry.name : entry.nameFaded), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { if (hasEquip) { gSaveContext.inventory.equipment &= ~bitMask; @@ -1311,7 +1312,7 @@ void DrawQuestItemButton(uint32_t item) { uint32_t bitMask = 1 << entry.id; bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 0; ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); - if (ImGui::ImageButton(SohImGui::GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded), + if (ImGui::ImageButton(Ship::GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { if (hasQuestItem) { gSaveContext.inventory.questItems &= ~bitMask; @@ -1329,7 +1330,7 @@ void DrawDungeonItemButton(uint32_t item, uint32_t scene) { uint32_t bitMask = 1 << (entry.id - ITEM_KEY_BOSS); // Bitset starts at ITEM_KEY_BOSS == 0. the rest are sequential bool hasItem = (bitMask & gSaveContext.inventory.dungeonItems[scene]) != 0; ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); - if (ImGui::ImageButton(SohImGui::GetTextureByName(hasItem ? entry.name : entry.nameFaded), + if (ImGui::ImageButton(Ship::GetTextureByName(hasItem ? entry.name : entry.nameFaded), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { if (hasItem) { gSaveContext.inventory.dungeonItems[scene] &= ~bitMask; @@ -1376,7 +1377,7 @@ void DrawQuestStatusTab() { uint32_t bitMask = 1 << entry.id; bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 0; ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); - if (ImGui::ImageButton(SohImGui::GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded), + if (ImGui::ImageButton(Ship::GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded), ImVec2(16.0f, 24.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { if (hasQuestItem) { gSaveContext.inventory.questItems &= ~bitMask; @@ -1439,7 +1440,7 @@ void DrawQuestStatusTab() { if (dungeonItemsScene != SCENE_BDAN_BOSS) { float lineHeight = ImGui::GetTextLineHeightWithSpacing(); - ImGui::Image(SohImGui::GetTextureByName(itemMapping[ITEM_KEY_SMALL].name), ImVec2(lineHeight, lineHeight)); + ImGui::Image(Ship::GetTextureByName(itemMapping[ITEM_KEY_SMALL].name), ImVec2(lineHeight, lineHeight)); ImGui::SameLine(); if (ImGui::InputScalar("##Keys", ImGuiDataType_S8, gSaveContext.inventory.dungeonKeys + dungeonItemsScene)) { gSaveContext.sohStats.dungeonKeys[dungeonItemsScene] = gSaveContext.inventory.dungeonKeys[dungeonItemsScene]; @@ -1780,34 +1781,34 @@ void DrawSaveEditor(bool& open) { } void InitSaveEditor() { - SohImGui::AddWindow("Developer Tools", "Save Editor", DrawSaveEditor); + Ship::AddWindow("Developer Tools", "Save Editor", DrawSaveEditor); // Load item icons into ImGui for (const auto& entry : itemMapping) { - SohImGui::LoadResource(entry.second.name, entry.second.texturePath); - SohImGui::LoadResource(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f)); + Ship::LoadResource(entry.second.name, entry.second.texturePath); + Ship::LoadResource(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f)); } for (const auto& entry : gregMapping) { ImVec4 gregGreen = ImVec4(42.0f / 255.0f, 169.0f / 255.0f, 40.0f / 255.0f, 1.0f); ImVec4 gregFadedGreen = gregGreen; gregFadedGreen.w = 0.3f; - SohImGui::LoadResource(entry.second.name, entry.second.texturePath, gregGreen); - SohImGui::LoadResource(entry.second.nameFaded, entry.second.texturePath, gregFadedGreen); + Ship::LoadResource(entry.second.name, entry.second.texturePath, gregGreen); + Ship::LoadResource(entry.second.nameFaded, entry.second.texturePath, gregFadedGreen); } for (const auto& entry : questMapping) { - SohImGui::LoadResource(entry.second.name, entry.second.texturePath); - SohImGui::LoadResource(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f)); + Ship::LoadResource(entry.second.name, entry.second.texturePath); + Ship::LoadResource(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f)); } for (const auto& entry : songMapping) { - SohImGui::LoadResource(entry.name, gSongNoteTex, entry.color); + Ship::LoadResource(entry.name, gSongNoteTex, entry.color); ImVec4 fadedCol = entry.color; fadedCol.w = 0.3f; - SohImGui::LoadResource(entry.nameFaded, gSongNoteTex, fadedCol); + Ship::LoadResource(entry.nameFaded, gSongNoteTex, fadedCol); } for (const auto& entry : vanillaSongMapping) { - SohImGui::LoadResource(entry.name, gSongNoteTex, entry.color); + Ship::LoadResource(entry.name, gSongNoteTex, entry.color); ImVec4 fadedCol = entry.color; fadedCol.w = 0.3f; - SohImGui::LoadResource(entry.nameFaded, gSongNoteTex, fadedCol); + Ship::LoadResource(entry.nameFaded, gSongNoteTex, fadedCol); } } diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.h b/soh/soh/Enhancements/debugger/debugSaveEditor.h index 8ed825b10..af4013ca5 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.h +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.h @@ -4,6 +4,7 @@ #include #include #include +#include #include void InitSaveEditor(); diff --git a/soh/soh/Enhancements/debugger/dlViewer.cpp b/soh/soh/Enhancements/debugger/dlViewer.cpp index 9be8f3c0c..e19e395e0 100644 --- a/soh/soh/Enhancements/debugger/dlViewer.cpp +++ b/soh/soh/Enhancements/debugger/dlViewer.cpp @@ -2,7 +2,7 @@ #include "../../util.h" #include "../../UIWidgets.hpp" #include -#include "ResourceMgr.h" +#include "ResourceManager.h" #include "DisplayList.h" #include "../../OTRGlobals.h" @@ -138,7 +138,7 @@ void DrawDLViewer(bool& open) { } void InitDLViewer() { - SohImGui::AddWindow("Developer Tools", "Display List Viewer", DrawDLViewer); + Ship::AddWindow("Developer Tools", "Display List Viewer", DrawDLViewer); displayListsSearchResults = ResourceMgr_ListFiles("*DL", &displayListsSearchResultsCount); } diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp index 3f40889ea..11881893a 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp @@ -335,7 +335,7 @@ void GameInteractor::RawAction::SetCosmeticsColor(uint8_t cosmeticCategory, uint break; } - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); ApplyOrResetCustomGfxPatches(); } diff --git a/soh/soh/Enhancements/gameplaystats.cpp b/soh/soh/Enhancements/gameplaystats.cpp index 011183609..bcab59aea 100644 --- a/soh/soh/Enhancements/gameplaystats.cpp +++ b/soh/soh/Enhancements/gameplaystats.cpp @@ -665,7 +665,8 @@ void SetupDisplayColors() { } void InitStatTracker() { - SohImGui::AddWindow("Enhancements", "Gameplay Stats", DrawStatsTracker, CVarGetInteger("gGameplayStatsEnabled", 0) == 1); + Ship::AddWindow("Enhancements", "Gameplay Stats", DrawStatsTracker, + CVarGetInteger("gGameplayStatsEnabled", 0) == 1); SetupDisplayNames(); SetupDisplayColors(); } \ No newline at end of file diff --git a/soh/soh/Enhancements/presets.cpp b/soh/soh/Enhancements/presets.cpp index bb5dab2c6..9977e49be 100644 --- a/soh/soh/Enhancements/presets.cpp +++ b/soh/soh/Enhancements/presets.cpp @@ -59,7 +59,7 @@ void DrawPresetSelector(PresetType presetTypeId) { if (selectedPresetId != 0) { applyPreset(selectedPresetDef.entries); } - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } ImGui::PopStyleVar(1); } diff --git a/soh/soh/Enhancements/randomizer/3drando/cosmetics.hpp b/soh/soh/Enhancements/randomizer/3drando/cosmetics.hpp index 6f770f011..65125215a 100644 --- a/soh/soh/Enhancements/randomizer/3drando/cosmetics.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/cosmetics.hpp @@ -3,6 +3,7 @@ #include #include #include +#include namespace Cosmetics { constexpr std::string_view RANDOM_CHOICE_STR = "Random Choice"; diff --git a/soh/soh/Enhancements/randomizer/3drando/custom_messages.hpp b/soh/soh/Enhancements/randomizer/3drando/custom_messages.hpp index 2f17b62ef..b7a0b0061 100644 --- a/soh/soh/Enhancements/randomizer/3drando/custom_messages.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/custom_messages.hpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "text.hpp" diff --git a/soh/soh/Enhancements/randomizer/3drando/spoiler_log.hpp b/soh/soh/Enhancements/randomizer/3drando/spoiler_log.hpp index 4c3174140..98c0704f1 100644 --- a/soh/soh/Enhancements/randomizer/3drando/spoiler_log.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/spoiler_log.hpp @@ -3,6 +3,7 @@ #include #include #include +#include using RandomizerHash = std::array; diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 0bffcc8bd..5096f5ca7 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -4361,7 +4361,7 @@ void DrawRandoEditor(bool& open) { excludedLocationString += ","; } CVarSetString("gRandomizeExcludedLocations", excludedLocationString.c_str()); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } ImGui::SameLine(); ImGui::Text(rcObject->rcShortName.c_str()); @@ -4402,7 +4402,7 @@ void DrawRandoEditor(bool& open) { excludedLocationString += ","; } CVarSetString("gRandomizeExcludedLocations", excludedLocationString.c_str()); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } ImGui::SameLine(); ImGui::Text(rcObject->rcShortName.c_str()); @@ -5443,7 +5443,7 @@ void InitRandoItemTable() { void InitRando() { - SohImGui::AddWindow("Randomizer", "Randomizer Settings", DrawRandoEditor); + Ship::AddWindow("Randomizer", "Randomizer Settings", DrawRandoEditor); Randomizer::CreateCustomMessages(); seedString = (char*)calloc(MAX_SEED_STRING_SIZE, sizeof(char)); InitRandoItemTable(); diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp index c2cf203ae..3caba22a6 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp @@ -1023,8 +1023,8 @@ void DrawCheckTrackerOptions(bool& open) { } void InitCheckTracker() { - SohImGui::AddWindow("Randomizer", "Check Tracker", DrawCheckTracker, CVarGetInteger("gCheckTrackerEnabled", 0) == 1); - SohImGui::AddWindow("Randomizer", "Check Tracker Settings", DrawCheckTrackerOptions); + Ship::AddWindow("Randomizer", "Check Tracker", DrawCheckTracker, CVarGetInteger("gCheckTrackerEnabled", 0) == 1); + Ship::AddWindow("Randomizer", "Check Tracker Settings", DrawCheckTrackerOptions); Color_Background = CVarGetColor("gCheckTrackerBgColor", Color_Bg_Default); Color_Area_Incomplete_Main = CVarGetColor("gCheckTrackerAreaMainIncompleteColor", Color_Main_Default); Color_Area_Incomplete_Extra = CVarGetColor("gCheckTrackerAreaExtraIncompleteColor", Color_Area_Incomplete_Extra_Default); diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp index dfd8061fa..17ae15487 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp @@ -919,7 +919,8 @@ void DrawEntranceTracker(bool& open) { } void InitEntranceTracker() { - SohImGui::AddWindow("Randomizer", "Entrance Tracker", DrawEntranceTracker, CVarGetInteger("gEntranceTrackerEnabled", 0) == 1); + Ship::AddWindow("Randomizer", "Entrance Tracker", DrawEntranceTracker, + CVarGetInteger("gEntranceTrackerEnabled", 0) == 1); // Setup hooks for loading and clearing the entrance tracker data GameInteractor::Instance->RegisterGameHook([](int32_t fileNum) { diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.h b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.h index bdcb22963..61ecd9ac2 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.h +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.h @@ -2,6 +2,7 @@ #include #include +#include typedef enum { // ENTRANCE_GROUP_NO_GROUP, diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index 5d6f14d4f..2c95879ff 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -452,7 +452,7 @@ void DrawItemCount(ItemTrackerItem item) { void DrawEquip(ItemTrackerItem item) { bool hasEquip = (item.data & gSaveContext.inventory.equipment) != 0; int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); - ImGui::Image(SohImGui::GetTextureByName(hasEquip && IsValidSaveFile() ? item.name : item.nameFaded), + ImGui::Image(Ship::GetTextureByName(hasEquip && IsValidSaveFile() ? item.name : item.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id)); @@ -462,7 +462,7 @@ void DrawQuest(ItemTrackerItem item) { bool hasQuestItem = (item.data & gSaveContext.inventory.questItems) != 0; int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); ImGui::BeginGroup(); - ImGui::Image(SohImGui::GetTextureByName(hasQuestItem && IsValidSaveFile() ? item.name : item.nameFaded), + ImGui::Image(Ship::GetTextureByName(hasQuestItem && IsValidSaveFile() ? item.name : item.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); if (item.id == QUEST_SKULL_TOKEN) { @@ -524,7 +524,7 @@ void DrawItem(ItemTrackerItem item) { } ImGui::BeginGroup(); - ImGui::Image(SohImGui::GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), + ImGui::Image(Ship::GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); DrawItemCount(item); @@ -542,7 +542,7 @@ void DrawBottle(ItemTrackerItem item) { } int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); - ImGui::Image(SohImGui::GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), + ImGui::Image(Ship::GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id)); @@ -557,11 +557,11 @@ void DrawDungeonItem(ItemTrackerItem item) { bool hasSmallKey = (gSaveContext.inventory.dungeonKeys[item.data]) >= 0; ImGui::BeginGroup(); if (itemId == ITEM_KEY_SMALL) { - ImGui::Image(SohImGui::GetTextureByName(hasSmallKey && IsValidSaveFile() ? item.name : item.nameFaded), + ImGui::Image(Ship::GetTextureByName(hasSmallKey && IsValidSaveFile() ? item.name : item.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); } else { - ImGui::Image(SohImGui::GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), + ImGui::Image(Ship::GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); } @@ -601,7 +601,7 @@ void DrawSong(ItemTrackerItem item) { bool hasSong = (bitMask & gSaveContext.inventory.questItems) != 0; ImVec2 p = ImGui::GetCursorScreenPos(); ImGui::SetCursorScreenPos(ImVec2(p.x + 6, p.y)); - ImGui::Image(SohImGui::GetTextureByName(hasSong && IsValidSaveFile() ? item.name : item.nameFaded), + ImGui::Image(Ship::GetTextureByName(hasSong && IsValidSaveFile() ? item.name : item.nameFaded), ImVec2(iconSize / 1.5, iconSize), ImVec2(0, 0), ImVec2(1, 1)); UIWidgets::SetLastItemHoverText(SohUtils::GetQuestItemName(item.id)); } @@ -637,7 +637,7 @@ void DrawNotes(bool resizeable = false) { ItemTrackerNotes::TrackerNotesInputTextMultiline("##ItemTrackerNotes", &itemTrackerNotes, size, ImGuiInputTextFlags_AllowTabInput); if (ImGui::IsItemDeactivatedAfterEdit() && IsValidSaveFile()) { CVarSetString(("gItemTrackerNotes" + std::to_string(gSaveContext.fileNum)).c_str(), std::string(std::begin(itemTrackerNotes), std::end(itemTrackerNotes)).c_str()); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } ImGui::EndGroup(); } @@ -985,7 +985,7 @@ void DrawItemTrackerOptions(bool& open) { CVarSetFloat("gItemTrackerBgColorG", ChromaKeyBackground.y); CVarSetFloat("gItemTrackerBgColorB", ChromaKeyBackground.z); CVarSetFloat("gItemTrackerBgColorA", ChromaKeyBackground.w); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } ImGui::PopItemWidth(); @@ -1081,8 +1081,8 @@ void DrawItemTrackerOptions(bool& open) { } void InitItemTracker() { - SohImGui::AddWindow("Randomizer", "Item Tracker", DrawItemTracker, CVarGetInteger("gItemTrackerEnabled", 0) == 1); - SohImGui::AddWindow("Randomizer", "Item Tracker Settings", DrawItemTrackerOptions); + Ship::AddWindow("Randomizer", "Item Tracker", DrawItemTracker, CVarGetInteger("gItemTrackerEnabled", 0) == 1); + Ship::AddWindow("Randomizer", "Item Tracker Settings", DrawItemTrackerOptions); float trackerBgR = CVarGetFloat("gItemTrackerBgColorR", 0); float trackerBgG = CVarGetFloat("gItemTrackerBgColorG", 0); float trackerBgB = CVarGetFloat("gItemTrackerBgColorB", 0); @@ -1107,6 +1107,6 @@ void InitItemTracker() { }); Ship::RegisterHook([](uint32_t fileNum) { CVarSetString(("gItemTrackerNotes" + std::to_string(fileNum)).c_str(), ""); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); }); } diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.h b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.h index 910d1a7b7..bfc0a93a0 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.h +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.h @@ -2,6 +2,7 @@ #include #include +#include void InitItemTracker(); void DrawItemTracker(bool& open); diff --git a/soh/soh/Enhancements/savestates.cpp b/soh/soh/Enhancements/savestates.cpp index 7083e7d24..51cb871d9 100644 --- a/soh/soh/Enhancements/savestates.cpp +++ b/soh/soh/Enhancements/savestates.cpp @@ -837,7 +837,7 @@ extern "C" void ProcessSaveStateRequests(void) { } void SaveStateMgr::SetCurrentSlot(unsigned int slot) { - SohImGui::GetGameOverlay()->TextDrawNotification(1.0f, true, "slot %u set", slot); + Ship::GetGameOverlay()->TextDrawNotification(1.0f, true, "slot %u set", slot); this->currentSlot = slot; } @@ -855,12 +855,12 @@ void SaveStateMgr::ProcessSaveStateRequests(void) { this->states[request.slot] = std::make_shared(OTRGlobals::Instance->gSaveStateMgr, request.slot); } this->states[request.slot]->Save(); - SohImGui::GetGameOverlay()->TextDrawNotification(1.0f, true, "saved state %u", request.slot); + Ship::GetGameOverlay()->TextDrawNotification(1.0f, true, "saved state %u", request.slot); break; case RequestType::LOAD: if (this->states.contains(request.slot)) { this->states[request.slot]->Load(); - SohImGui::GetGameOverlay()->TextDrawNotification(1.0f, true, "loaded state %u", request.slot); + Ship::GetGameOverlay()->TextDrawNotification(1.0f, true, "loaded state %u", request.slot); } else { SPDLOG_ERROR("Invalid SaveState slot: {}", request.type); } @@ -876,7 +876,7 @@ void SaveStateMgr::ProcessSaveStateRequests(void) { SaveStateReturn SaveStateMgr::AddRequest(const SaveStateRequest request) { if (gPlayState == nullptr) { SPDLOG_ERROR("[SOH] Can not save or load a state outside of \"GamePlay\""); - SohImGui::GetGameOverlay()->TextDrawNotification(1.0f, true, "states not available here", request.slot); + Ship::GetGameOverlay()->TextDrawNotification(1.0f, true, "states not available here", request.slot); return SaveStateReturn::FAIL_WRONG_GAMESTATE; } @@ -890,7 +890,7 @@ SaveStateReturn SaveStateMgr::AddRequest(const SaveStateRequest request) { return SaveStateReturn::SUCCESS; } else { SPDLOG_ERROR("Invalid SaveState slot: {}", request.type); - SohImGui::GetGameOverlay()->TextDrawNotification(1.0f, true, "state slot %u empty", request.slot); + Ship::GetGameOverlay()->TextDrawNotification(1.0f, true, "state slot %u empty", request.slot); return SaveStateReturn::FAIL_INVALID_SLOT; } [[unlikely]] default: diff --git a/soh/soh/Enhancements/tts/tts.cpp b/soh/soh/Enhancements/tts/tts.cpp index 013cf06d3..7c7ae3ff7 100644 --- a/soh/soh/Enhancements/tts/tts.cpp +++ b/soh/soh/Enhancements/tts/tts.cpp @@ -1,7 +1,7 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/speechsynthesizer/SpeechSynthesizer.h" -#include +#include #include #include #include diff --git a/soh/soh/Extractor/Extract.cpp b/soh/soh/Extractor/Extract.cpp index b8031f017..e0e5e74b3 100644 --- a/soh/soh/Extractor/Extract.cpp +++ b/soh/soh/Extractor/Extract.cpp @@ -429,13 +429,11 @@ extern "C" int zapd_main(int argc, char** argv); bool Extractor::CallZapd() { constexpr int argc = 16; char xmlPath[100]; - char baseromPath[100]; char confPath[100]; std::array argv; const char* version = GetZapdVerStr(); snprintf(xmlPath, 100, "assets/extractor/xmls/%s", version); - snprintf(baseromPath, 100, "%s", mCurrentRomPath.c_str()); snprintf(confPath, 100, "assets/extractor/Config_%s.xml", version); argv[0] = "ZAPD"; @@ -443,7 +441,7 @@ bool Extractor::CallZapd() { argv[2] = "-i"; argv[3] = xmlPath; argv[4] = "-b"; - argv[5] = baseromPath; + argv[5] = mCurrentRomPath.c_str(); argv[6] = "-fl"; argv[7] = "assets/extractor/filelists"; argv[8] = "-gsf"; diff --git a/soh/soh/GameMenuBar.cpp b/soh/soh/GameMenuBar.cpp index 981bc1840..b7a8f6619 100644 --- a/soh/soh/GameMenuBar.cpp +++ b/soh/soh/GameMenuBar.cpp @@ -131,8 +131,8 @@ namespace GameMenuBar { } ImGui::Text("Audio API (Needs reload)"); - auto audioBackends = SohImGui::GetAvailableAudioBackends(); - auto currentAudioBackend = SohImGui::GetCurrentAudioBackend(); + auto audioBackends = Ship::GetAvailableAudioBackends(); + auto currentAudioBackend = Ship::GetCurrentAudioBackend(); if (audioBackends.size() <= 1) { UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f); @@ -140,7 +140,7 @@ namespace GameMenuBar { if (ImGui::BeginCombo("##AApi", currentAudioBackend.second)) { for (uint8_t i = 0; i < audioBackends.size(); i++) { if (ImGui::Selectable(audioBackends[i].second, audioBackends[i] == currentAudioBackend)) { - SohImGui::SetCurrentAudioBackend(i, audioBackends[i]); + Ship::SetCurrentAudioBackend(i, audioBackends[i]); } } @@ -164,8 +164,8 @@ namespace GameMenuBar { { bool currentValue = CVarGetInteger("gControllerConfigurationEnabled", 0); CVarSetInteger("gControllerConfigurationEnabled", !currentValue); - SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::ToggleInputEditorWindow(CVarGetInteger("gControllerConfigurationEnabled", 0)); + Ship::RequestCvarSaveOnNextTick(); + Ship::ToggleInputEditorWindow(CVarGetInteger("gControllerConfigurationEnabled", 0)); } UIWidgets::PaddedSeparator(); ImGui::PopStyleColor(1); @@ -190,18 +190,18 @@ namespace GameMenuBar { #ifndef __APPLE__ UIWidgets::EnhancementSliderFloat("Internal Resolution: %d %%", "##IMul", "gInternalResolution", 0.5f, 2.0f, "", 1.0f, true); UIWidgets::Tooltip("Multiplies your output resolution by the value inputted, as a more intensive but effective form of anti-aliasing"); - SohImGui::SetResolutionMultiplier(CVarGetFloat("gInternalResolution", 1)); + Ship::SetResolutionMultiplier(CVarGetFloat("gInternalResolution", 1)); #endif #ifndef __WIIU__ UIWidgets::PaddedEnhancementSliderInt("MSAA: %d", "##IMSAA", "gMSAAValue", 1, 8, "", 1, true, true, false); UIWidgets::Tooltip("Activates multi-sample anti-aliasing when above 1x up to 8x for 8 samples for every pixel"); - SohImGui::SetMSAALevel(CVarGetInteger("gMSAAValue", 1)); + Ship::SetMSAALevel(CVarGetInteger("gMSAAValue", 1)); #endif { // FPS Slider const int minFps = 20; static int maxFps; - if (SohImGui::WindowBackend() == SohImGui::Backend::DX11) { + if (Ship::WindowBackend() == Ship::Backend::DX11) { maxFps = 360; } else { maxFps = Ship::Window::GetInstance()->GetCurrentRefreshRate(); @@ -264,15 +264,15 @@ namespace GameMenuBar { currentFps = 60; } CVarSetInteger("gInterpolationFPS", currentFps); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); #else bool matchingRefreshRate = - CVarGetInteger("gMatchRefreshRate", 0) && SohImGui::WindowBackend() != SohImGui::Backend::DX11; + CVarGetInteger("gMatchRefreshRate", 0) && Ship::WindowBackend() != Ship::Backend::DX11; UIWidgets::PaddedEnhancementSliderInt( (currentFps == 20) ? "FPS: Original (20)" : "FPS: %d", "##FPSInterpolation", "gInterpolationFPS", minFps, maxFps, "", 20, true, true, false, matchingRefreshRate); #endif - if (SohImGui::WindowBackend() == SohImGui::Backend::DX11) { + if (Ship::WindowBackend() == Ship::Backend::DX11) { UIWidgets::Tooltip( "Uses Matrix Interpolation to create extra frames, resulting in smoother graphics. This is purely " "visual and does not impact game logic, execution of glitches etc.\n\n" @@ -286,13 +286,13 @@ namespace GameMenuBar { } } // END FPS Slider - if (SohImGui::WindowBackend() == SohImGui::Backend::DX11) { + if (Ship::WindowBackend() == Ship::Backend::DX11) { UIWidgets::Spacer(0); if (ImGui::Button("Match Refresh Rate")) { int hz = Ship::Window::GetInstance()->GetCurrentRefreshRate(); if (hz >= 20 && hz <= 360) { CVarSetInteger("gInterpolationFPS", hz); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } } } else { @@ -300,7 +300,7 @@ namespace GameMenuBar { } UIWidgets::Tooltip("Matches interpolation value to the current game's window refresh rate"); - if (SohImGui::WindowBackend() == SohImGui::Backend::DX11) { + if (Ship::WindowBackend() == Ship::Backend::DX11) { UIWidgets::PaddedEnhancementSliderInt(CVarGetInteger("gExtraLatencyThreshold", 80) == 0 ? "Jitter fix: Off" : "Jitter fix: >= %d FPS", "##ExtraLatencyThreshold", "gExtraLatencyThreshold", 0, 360, "", 80, true, true, false); UIWidgets::Tooltip("When Interpolation FPS setting is at least this threshold, add one frame of input lag (e.g. 16.6 ms for 60 FPS) in order to avoid jitter. This setting allows the CPU to work on one frame while GPU works on the previous frame.\nThis setting should be used when your computer is too slow to do CPU + GPU work in time."); @@ -309,8 +309,8 @@ namespace GameMenuBar { UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); ImGui::Text("Renderer API (Needs reload)"); - auto renderingBackends = SohImGui::GetAvailableRenderingBackends(); - auto currentRenderingBackend = SohImGui::GetCurrentRenderingBackend(); + auto renderingBackends = Ship::GetAvailableRenderingBackends(); + auto currentRenderingBackend = Ship::GetCurrentRenderingBackend(); if (renderingBackends.size() <= 1) { UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f); @@ -318,7 +318,7 @@ namespace GameMenuBar { if (ImGui::BeginCombo("##RApi", currentRenderingBackend.second)) { for (uint8_t i = 0; i < renderingBackends.size(); i++) { if (ImGui::Selectable(renderingBackends[i].second, renderingBackends[i] == currentRenderingBackend)) { - SohImGui::SetCurrentRenderingBackend(i, renderingBackends[i]); + Ship::SetCurrentRenderingBackend(i, renderingBackends[i]); } } @@ -332,25 +332,24 @@ namespace GameMenuBar { UIWidgets::PaddedEnhancementCheckbox("Enable Vsync", "gVsyncEnabled", true, false); } - if (SohImGui::SupportsWindowedFullscreen()) { + if (Ship::SupportsWindowedFullscreen()) { UIWidgets::PaddedEnhancementCheckbox("Windowed fullscreen", "gSdlWindowedFullscreen", true, false); } - if (SohImGui::SupportsViewports()) { + if (Ship::SupportsViewports()) { UIWidgets::PaddedEnhancementCheckbox("Allow multi-windows", "gEnableMultiViewports", true, false); UIWidgets::Tooltip("Allows windows to be able to be dragged off of the main game window. Requires a reload to take effect."); } // If more filters are added to LUS, make sure to add them to the filters list here ImGui::Text("Texture Filter (Needs reload)"); - const char* filters[] = { SohImGui::GetSupportedTextureFilters()[0], - SohImGui::GetSupportedTextureFilters()[1], - SohImGui::GetSupportedTextureFilters()[2] }; + const char* filters[] = { Ship::GetSupportedTextureFilters()[0], Ship::GetSupportedTextureFilters()[1], + Ship::GetSupportedTextureFilters()[2] }; UIWidgets::EnhancementCombobox("gTextureFilter", filters, 0); UIWidgets::Spacer(0); - SohImGui::DrawSettings(); + Ship::DrawSettings(); ImGui::EndMenu(); } @@ -991,28 +990,28 @@ namespace GameMenuBar { { bool currentValue = CVarGetInteger("gGameControlEditorEnabled", 0); CVarSetInteger("gGameControlEditorEnabled", !currentValue); - SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Game Control Editor", CVarGetInteger("gGameControlEditorEnabled", 0)); + Ship::RequestCvarSaveOnNextTick(); + Ship::EnableWindow("Game Control Editor", CVarGetInteger("gGameControlEditorEnabled", 0)); } if (ImGui::Button(GetWindowButtonText("Cosmetics Editor", CVarGetInteger("gCosmeticsEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { bool currentValue = CVarGetInteger("gCosmeticsEditorEnabled", 0); CVarSetInteger("gCosmeticsEditorEnabled", !currentValue); - SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Cosmetics Editor", CVarGetInteger("gCosmeticsEditorEnabled", 0)); + Ship::RequestCvarSaveOnNextTick(); + Ship::EnableWindow("Cosmetics Editor", CVarGetInteger("gCosmeticsEditorEnabled", 0)); } if (ImGui::Button(GetWindowButtonText("Audio Editor", CVarGetInteger("gAudioEditor.WindowOpen", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { bool currentValue = CVarGetInteger("gAudioEditor.WindowOpen", 0); CVarSetInteger("gAudioEditor.WindowOpen", !currentValue); - SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Audio Editor", CVarGetInteger("gAudioEditor.WindowOpen", 0)); + Ship::RequestCvarSaveOnNextTick(); + Ship::EnableWindow("Audio Editor", CVarGetInteger("gAudioEditor.WindowOpen", 0)); } if (ImGui::Button(GetWindowButtonText("Gameplay Stats", CVarGetInteger("gGameplayStatsEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { bool currentValue = CVarGetInteger("gGameplayStatsEnabled", 0); CVarSetInteger("gGameplayStatsEnabled", !currentValue); - SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Gameplay Stats", CVarGetInteger("gGameplayStatsEnabled", 0)); + Ship::RequestCvarSaveOnNextTick(); + Ship::EnableWindow("Gameplay Stats", CVarGetInteger("gGameplayStatsEnabled", 0)); } ImGui::PopStyleVar(3); ImGui::PopStyleColor(1); @@ -1133,9 +1132,9 @@ namespace GameMenuBar { CVarSetInteger("gEnableBetaQuest", betaQuestEnabled); CVarSetInteger("gBetaQuestWorld", betaQuestWorld); - SohImGui::DispatchConsoleCommand("reset"); + Ship::DispatchConsoleCommand("reset"); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } if (!isBetaQuestEnabled) { @@ -1178,8 +1177,8 @@ namespace GameMenuBar { { bool currentValue = CVarGetInteger("gStatsEnabled", 0); CVarSetInteger("gStatsEnabled", !currentValue); - SohImGui::ToggleStatisticsWindow(true); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::ToggleStatisticsWindow(true); + Ship::RequestCvarSaveOnNextTick(); } UIWidgets::Tooltip("Shows the stats window, with your FPS and frametimes, and the OS you're playing on"); UIWidgets::Spacer(0); @@ -1187,8 +1186,8 @@ namespace GameMenuBar { { bool currentValue = CVarGetInteger("gConsoleEnabled", 0); CVarSetInteger("gConsoleEnabled", !currentValue); - SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::ToggleConsoleWindow(!currentValue); + Ship::RequestCvarSaveOnNextTick(); + Ship::ToggleConsoleWindow(!currentValue); } UIWidgets::Tooltip("Enables the console window, allowing you to input commands, type help for some examples"); UIWidgets::Spacer(0); @@ -1196,32 +1195,32 @@ namespace GameMenuBar { { bool currentValue = CVarGetInteger("gSaveEditorEnabled", 0); CVarSetInteger("gSaveEditorEnabled", !currentValue); - SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Save Editor", CVarGetInteger("gSaveEditorEnabled", 0)); + Ship::RequestCvarSaveOnNextTick(); + Ship::EnableWindow("Save Editor", CVarGetInteger("gSaveEditorEnabled", 0)); } UIWidgets::Spacer(0); if (ImGui::Button(GetWindowButtonText("Collision Viewer", CVarGetInteger("gCollisionViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { bool currentValue = CVarGetInteger("gCollisionViewerEnabled", 0); CVarSetInteger("gCollisionViewerEnabled", !currentValue); - SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Collision Viewer", CVarGetInteger("gCollisionViewerEnabled", 0)); + Ship::RequestCvarSaveOnNextTick(); + Ship::EnableWindow("Collision Viewer", CVarGetInteger("gCollisionViewerEnabled", 0)); } UIWidgets::Spacer(0); if (ImGui::Button(GetWindowButtonText("Actor Viewer", CVarGetInteger("gActorViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { bool currentValue = CVarGetInteger("gActorViewerEnabled", 0); CVarSetInteger("gActorViewerEnabled", !currentValue); - SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Actor Viewer", CVarGetInteger("gActorViewerEnabled", 0)); + Ship::RequestCvarSaveOnNextTick(); + Ship::EnableWindow("Actor Viewer", CVarGetInteger("gActorViewerEnabled", 0)); } UIWidgets::Spacer(0); if (ImGui::Button(GetWindowButtonText("Display List Viewer", CVarGetInteger("gDLViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { bool currentValue = CVarGetInteger("gDLViewerEnabled", 0); CVarSetInteger("gDLViewerEnabled", !currentValue); - SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Display List Viewer", CVarGetInteger("gDLViewerEnabled", 0)); + Ship::RequestCvarSaveOnNextTick(); + Ship::EnableWindow("Display List Viewer", CVarGetInteger("gDLViewerEnabled", 0)); } ImGui::PopStyleVar(3); ImGui::PopStyleColor(1); @@ -1246,48 +1245,48 @@ namespace GameMenuBar { { bool currentValue = CVarGetInteger("gRandomizerSettingsEnabled", 0); CVarSetInteger("gRandomizerSettingsEnabled", !currentValue); - SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Randomizer Settings", CVarGetInteger("gRandomizerSettingsEnabled", 0)); + Ship::RequestCvarSaveOnNextTick(); + Ship::EnableWindow("Randomizer Settings", CVarGetInteger("gRandomizerSettingsEnabled", 0)); } UIWidgets::Spacer(0); if (ImGui::Button(GetWindowButtonText("Item Tracker", CVarGetInteger("gItemTrackerEnabled", 0)).c_str(), buttonSize)) { bool currentValue = CVarGetInteger("gItemTrackerEnabled", 0); CVarSetInteger("gItemTrackerEnabled", !currentValue); - SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Item Tracker", CVarGetInteger("gItemTrackerEnabled", 0)); + Ship::RequestCvarSaveOnNextTick(); + Ship::EnableWindow("Item Tracker", CVarGetInteger("gItemTrackerEnabled", 0)); } UIWidgets::Spacer(0); if (ImGui::Button(GetWindowButtonText("Item Tracker Settings", CVarGetInteger("gItemTrackerSettingsEnabled", 0)).c_str(), buttonSize)) { bool currentValue = CVarGetInteger("gItemTrackerSettingsEnabled", 0); CVarSetInteger("gItemTrackerSettingsEnabled", !currentValue); - SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Item Tracker Settings", CVarGetInteger("gItemTrackerSettingsEnabled", 0)); + Ship::RequestCvarSaveOnNextTick(); + Ship::EnableWindow("Item Tracker Settings", CVarGetInteger("gItemTrackerSettingsEnabled", 0)); } UIWidgets::Spacer(0); if (ImGui::Button(GetWindowButtonText("Entrance Tracker", CVarGetInteger("gEntranceTrackerEnabled", 0)).c_str(), buttonSize)) { bool currentValue = CVarGetInteger("gEntranceTrackerEnabled", 0); CVarSetInteger("gEntranceTrackerEnabled", !currentValue); - SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Entrance Tracker", CVarGetInteger("gEntranceTrackerEnabled", 0)); + Ship::RequestCvarSaveOnNextTick(); + Ship::EnableWindow("Entrance Tracker", CVarGetInteger("gEntranceTrackerEnabled", 0)); } UIWidgets::Spacer(0); if (ImGui::Button(GetWindowButtonText("Check Tracker", CVarGetInteger("gCheckTrackerEnabled", 0)).c_str(), buttonSize)) { bool currentValue = CVarGetInteger("gCheckTrackerEnabled", 0); CVarSetInteger("gCheckTrackerEnabled", !currentValue); - SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Check Tracker", CVarGetInteger("gCheckTrackerEnabled", 0)); + Ship::RequestCvarSaveOnNextTick(); + Ship::EnableWindow("Check Tracker", CVarGetInteger("gCheckTrackerEnabled", 0)); } UIWidgets::Spacer(0); if (ImGui::Button(GetWindowButtonText("Check Tracker Settings", CVarGetInteger("gCheckTrackerSettingsEnabled", 0)).c_str(), buttonSize)) { bool currentValue = CVarGetInteger("gCheckTrackerSettingsEnabled", 0); CVarSetInteger("gCheckTrackerSettingsEnabled", !currentValue); - SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Check Tracker Settings", CVarGetInteger("gCheckTrackerSettingsEnabled", 0)); + Ship::RequestCvarSaveOnNextTick(); + Ship::EnableWindow("Check Tracker Settings", CVarGetInteger("gCheckTrackerSettingsEnabled", 0)); } ImGui::PopStyleVar(3); ImGui::PopStyleColor(1); diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index a3940504a..afb3a82a6 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1,12 +1,12 @@ -#include "OTRGlobals.h" +#include "OTRGlobals.h" #include "OTRAudio.h" #include #include #include #include -#include -#include +#include +#include #include #include #include @@ -240,7 +240,7 @@ OTRGlobals::OTRGlobals() { OOT_PAL_GC_DBG1, OOT_PAL_GC_DBG2 }; - context = Ship::Window::CreateInstance("Ship of Harkinian", OTRFiles); + context = Ship::Window::CreateInstance("Ship of Harkinian", "soh", OTRFiles); context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Animation, "Animation", std::make_shared()); context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_PlayerAnimation, "PlayerAnimation", std::make_shared()); @@ -271,7 +271,7 @@ OTRGlobals::OTRGlobals() { cameraStrings[i] = dup; } - auto versions = context->GetResourceManager()->GetGameVersions(); + auto versions = context->GetResourceManager()->GetArchive()->GetGameVersions(); for (uint32_t version : versions) { if (!ValidHashes.contains(version)) { @@ -324,7 +324,7 @@ bool OTRGlobals::HasOriginal() { } uint32_t OTRGlobals::GetInterpolationFPS() { - if (SohImGui::WindowBackend() == SohImGui::Backend::DX11) { + if (Ship::WindowBackend() == Ship::Backend::DX11) { return CVarGetInteger("gInterpolationFPS", 20); } @@ -717,6 +717,8 @@ extern "C" void InitOTR() { exit(1); } extract.CallZapd(); + } else { + exit(1); } if (Extractor::ShowYesNoBox("Extraction Complete", "ROM Extracted. Extract another?") == IDYES) { Extractor extract; @@ -734,8 +736,8 @@ extern "C" void InitOTR() { #elif defined(__WIIU__) Ship::WiiU::Init(); #endif - SohImGui::AddSetupHooksDelegate(GameMenuBar::SetupHooks); - SohImGui::RegisterMenuDrawMethod(GameMenuBar::Draw); + Ship::AddSetupHooksDelegate(GameMenuBar::SetupHooks); + Ship::RegisterMenuDrawMethod(GameMenuBar::Draw); OTRGlobals::Instance = new OTRGlobals(); SaveManager::Instance = new SaveManager(); @@ -995,11 +997,11 @@ extern "C" uint16_t OTRGetPixelDepth(float x, float y) { } extern "C" uint32_t ResourceMgr_GetNumGameVersions() { - return OTRGlobals::Instance->context->GetResourceManager()->GetGameVersions().size(); + return OTRGlobals::Instance->context->GetResourceManager()->GetArchive()->GetGameVersions().size(); } extern "C" uint32_t ResourceMgr_GetGameVersion(int index) { - return OTRGlobals::Instance->context->GetResourceManager()->GetGameVersions()[index]; + return OTRGlobals::Instance->context->GetResourceManager()->GetArchive()->GetGameVersions()[index]; } uint32_t IsSceneMasterQuest(s16 sceneNum) { @@ -1390,9 +1392,26 @@ extern "C" AnimationHeaderCommon* ResourceMgr_LoadAnimByName(const char* path) { return (AnimationHeaderCommon*)GetResourceDataByName(path, false); } -extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, SkelAnime* skelAnime) -{ - SkeletonHeader* skelHeader = (SkeletonHeader*)GetResourceDataByName(path, false); +extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, SkelAnime* skelAnime) { + std::string pathStr = std::string(path); + static const std::string sOtr = "__OTR__"; + + if (pathStr.starts_with(sOtr)) { + pathStr = pathStr.substr(sOtr.length()); + } + + bool isAlt = CVarGetInteger("gAltAssets", 0); + + if (isAlt) { + pathStr = Ship::Resource::gAltAssetPrefix + pathStr; + } + + SkeletonHeader* skelHeader = (SkeletonHeader*)GetResourceDataByName(pathStr.c_str(), false); + + // If there isn't an alternate model, load the regular one + if (isAlt && skelHeader == NULL) { + skelHeader = (SkeletonHeader*)GetResourceDataByName(path, false); + } // This function is only called when a skeleton is initialized. // Therefore we can take this oppurtunity to take note of the Skeleton that is created... @@ -1401,7 +1420,6 @@ extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, Skel Ship::SkeletonPatcher::RegisterSkeleton(stringPath, skelAnime); } - return skelHeader; } @@ -1451,11 +1469,11 @@ void OTRGlobals::CheckSaveFile(size_t sramSize) const { } extern "C" void Ctx_ReadSaveFile(uintptr_t addr, void* dramAddr, size_t size) { - OTRGlobals::Instance->context->ReadSaveFile(GetSaveFile(), addr, dramAddr, size); + SaveManager::ReadSaveFile(GetSaveFile(), addr, dramAddr, size); } extern "C" void Ctx_WriteSaveFile(uintptr_t addr, void* dramAddr, size_t size) { - OTRGlobals::Instance->context->WriteSaveFile(GetSaveFile(), addr, dramAddr, size); + SaveManager::WriteSaveFile(GetSaveFile(), addr, dramAddr, size); } std::wstring StringToU16(const std::string& s) { @@ -1953,12 +1971,12 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) { } extern "C" void Overlay_DisplayText(float duration, const char* text) { - SohImGui::GetGameOverlay()->TextDrawNotification(duration, true, text); + Ship::GetGameOverlay()->TextDrawNotification(duration, true, text); } extern "C" void Overlay_DisplayText_Seconds(int seconds, const char* text) { float duration = seconds * OTRGlobals::Instance->GetInterpolationFPS() * 0.05; - SohImGui::GetGameOverlay()->TextDrawNotification(duration, true, text); + Ship::GetGameOverlay()->TextDrawNotification(duration, true, text); } extern "C" void Entrance_ClearEntranceTrackingData(void) { diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index a051da7f7..286efdf46 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -18,6 +18,28 @@ extern "C" SaveContext gSaveContext; +void SaveManager::WriteSaveFile(const std::filesystem::path& savePath, const uintptr_t addr, void* dramAddr, + const size_t size) { + std::ofstream saveFile = std::ofstream(savePath, std::fstream::in | std::fstream::out | std::fstream::binary); + saveFile.seekp(addr); + saveFile.write((char*)dramAddr, size); + saveFile.close(); +} + +void SaveManager::ReadSaveFile(std::filesystem::path savePath, uintptr_t addr, void* dramAddr, size_t size) { + std::ifstream saveFile = std::ifstream(savePath, std::fstream::in | std::fstream::out | std::fstream::binary); + + // If the file doesn't exist, initialize DRAM + if (saveFile.good()) { + saveFile.seekg(addr); + saveFile.read((char*)dramAddr, size); + } else { + memset(dramAddr, 0, size); + } + + saveFile.close(); +} + std::filesystem::path SaveManager::GetFileName(int fileNum) { const std::filesystem::path sSavePath(Ship::Window::GetPathRelativeToAppDirectory("Save")); return sSavePath / ("file" + std::to_string(fileNum + 1) + ".sav"); diff --git a/soh/soh/SaveManager.h b/soh/soh/SaveManager.h index a43e80910..aeb0ed44d 100644 --- a/soh/soh/SaveManager.h +++ b/soh/soh/SaveManager.h @@ -35,6 +35,9 @@ class SaveManager { public: static SaveManager* Instance; + static void WriteSaveFile(const std::filesystem::path& savePath, uintptr_t addr, void* dramAddr, size_t size); + static void ReadSaveFile(std::filesystem::path savePath, uintptr_t addr, void* dramAddr, size_t size); + using InitFunc = void(*)(bool isDebug); using LoadFunc = void(*)(); using SaveFunc = void(*)(); diff --git a/soh/soh/UIWidgets.cpp b/soh/soh/UIWidgets.cpp index d4a54cd34..34a8febbe 100644 --- a/soh/soh/UIWidgets.cpp +++ b/soh/soh/UIWidgets.cpp @@ -206,7 +206,7 @@ namespace UIWidgets { bool val = (bool)CVarGetInteger(cvarName, defaultValue); if (CustomCheckbox(text, &val, disabled, disabledGraphic)) { CVarSetInteger(cvarName, val); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); changed = true; } @@ -246,7 +246,7 @@ namespace UIWidgets { CVarSetInteger(cvarName, i); selected = i; changed = true; - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } } } @@ -259,7 +259,7 @@ namespace UIWidgets { if (disabledValue >= 0 && selected != disabledValue) { CVarSetInteger(cvarName, disabledValue); changed = true; - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } } @@ -348,7 +348,7 @@ namespace UIWidgets { if (changed) { CVarSetInteger(cvarName, val); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } return changed; @@ -424,7 +424,7 @@ namespace UIWidgets { if (changed) { CVarSetFloat(cvarName, val); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); } return changed; @@ -471,7 +471,7 @@ namespace UIWidgets { int val = CVarGetInteger(cvarName, 0); if (ImGui::RadioButton(make_invisible.c_str(), id == val)) { CVarSetInteger(cvarName, id); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); ret = true; } ImGui::SameLine(); @@ -498,7 +498,7 @@ namespace UIWidgets { CVarSetColor(cvarName, colorsRGBA); CVarSetInteger(Cvar_RBM.c_str(), 0); //On click disable rainbow mode. - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); changed = true; } Tooltip("Revert colors to the game's original colors (GameCube version)\nOverwrites previously chosen color"); @@ -523,7 +523,7 @@ namespace UIWidgets { NewColors.b = fmin(fmax(colors->z * 255, 0), 255); CVarSetColor(cvarName, NewColors); CVarSetInteger(Cvar_RBM.c_str(), 0); // On click disable rainbow mode. - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); changed = true; } Tooltip("Chooses a random color\nOverwrites previously chosen color"); @@ -584,7 +584,7 @@ namespace UIWidgets { colors.a = 255.0; CVarSetColor(cvarName, colors); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); changed = true; } } @@ -600,7 +600,7 @@ namespace UIWidgets { colors.a = ColorRGBA.w * 255.0; CVarSetColor(cvarName, colors); - SohImGui::RequestCvarSaveOnNextTick(); + Ship::RequestCvarSaveOnNextTick(); changed = true; } } diff --git a/soh/soh/resource/importer/AnimationFactory.cpp b/soh/soh/resource/importer/AnimationFactory.cpp index 45cd5d7d1..5a6a02f8b 100644 --- a/soh/soh/resource/importer/AnimationFactory.cpp +++ b/soh/soh/resource/importer/AnimationFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr AnimationFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr AnimationFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/AnimationFactory.h b/soh/soh/resource/importer/AnimationFactory.h index 2ec5a23fd..c5883305e 100644 --- a/soh/soh/resource/importer/AnimationFactory.h +++ b/soh/soh/resource/importer/AnimationFactory.h @@ -6,7 +6,7 @@ namespace Ship { class AnimationFactory : public ResourceFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/AudioSampleFactory.cpp b/soh/soh/resource/importer/AudioSampleFactory.cpp index 6e2219b01..80b00c21a 100644 --- a/soh/soh/resource/importer/AudioSampleFactory.cpp +++ b/soh/soh/resource/importer/AudioSampleFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr AudioSampleFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr AudioSampleFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/AudioSampleFactory.h b/soh/soh/resource/importer/AudioSampleFactory.h index 1b4900292..582bb9baa 100644 --- a/soh/soh/resource/importer/AudioSampleFactory.h +++ b/soh/soh/resource/importer/AudioSampleFactory.h @@ -7,7 +7,7 @@ namespace Ship { class AudioSampleFactory : public ResourceFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/AudioSequenceFactory.cpp b/soh/soh/resource/importer/AudioSequenceFactory.cpp index 7596e9edb..40f9d420f 100644 --- a/soh/soh/resource/importer/AudioSequenceFactory.cpp +++ b/soh/soh/resource/importer/AudioSequenceFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr AudioSequenceFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr AudioSequenceFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/AudioSequenceFactory.h b/soh/soh/resource/importer/AudioSequenceFactory.h index ab48584a0..21d45ef62 100644 --- a/soh/soh/resource/importer/AudioSequenceFactory.h +++ b/soh/soh/resource/importer/AudioSequenceFactory.h @@ -7,7 +7,7 @@ namespace Ship { class AudioSequenceFactory : public ResourceFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/AudioSoundFontFactory.cpp b/soh/soh/resource/importer/AudioSoundFontFactory.cpp index 05e50b219..cb5cdcb2d 100644 --- a/soh/soh/resource/importer/AudioSoundFontFactory.cpp +++ b/soh/soh/resource/importer/AudioSoundFontFactory.cpp @@ -4,7 +4,7 @@ #include "libultraship/bridge.h" namespace Ship { -std::shared_ptr AudioSoundFontFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr AudioSoundFontFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/AudioSoundFontFactory.h b/soh/soh/resource/importer/AudioSoundFontFactory.h index 9abf08c0b..43b56d0d5 100644 --- a/soh/soh/resource/importer/AudioSoundFontFactory.h +++ b/soh/soh/resource/importer/AudioSoundFontFactory.h @@ -7,7 +7,7 @@ namespace Ship { class AudioSoundFontFactory : public ResourceFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/BackgroundFactory.cpp b/soh/soh/resource/importer/BackgroundFactory.cpp index ae707673a..f57a403c8 100644 --- a/soh/soh/resource/importer/BackgroundFactory.cpp +++ b/soh/soh/resource/importer/BackgroundFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr BackgroundFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr BackgroundFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/BackgroundFactory.h b/soh/soh/resource/importer/BackgroundFactory.h index 3f1a1c9ba..445ebe9b4 100644 --- a/soh/soh/resource/importer/BackgroundFactory.h +++ b/soh/soh/resource/importer/BackgroundFactory.h @@ -6,7 +6,7 @@ namespace Ship { class BackgroundFactory : public ResourceFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/CollisionHeaderFactory.cpp b/soh/soh/resource/importer/CollisionHeaderFactory.cpp index c18659a1e..e926d339d 100644 --- a/soh/soh/resource/importer/CollisionHeaderFactory.cpp +++ b/soh/soh/resource/importer/CollisionHeaderFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr CollisionHeaderFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr CollisionHeaderFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/CollisionHeaderFactory.h b/soh/soh/resource/importer/CollisionHeaderFactory.h index fe06e9821..85c4b0f70 100644 --- a/soh/soh/resource/importer/CollisionHeaderFactory.h +++ b/soh/soh/resource/importer/CollisionHeaderFactory.h @@ -6,7 +6,7 @@ namespace Ship { class CollisionHeaderFactory : public ResourceFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/CutsceneFactory.cpp b/soh/soh/resource/importer/CutsceneFactory.cpp index ac9788cc5..89372d8a5 100644 --- a/soh/soh/resource/importer/CutsceneFactory.cpp +++ b/soh/soh/resource/importer/CutsceneFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr CutsceneFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr CutsceneFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/CutsceneFactory.h b/soh/soh/resource/importer/CutsceneFactory.h index bf1061ca0..9bbc439f7 100644 --- a/soh/soh/resource/importer/CutsceneFactory.h +++ b/soh/soh/resource/importer/CutsceneFactory.h @@ -7,7 +7,7 @@ namespace Ship { class CutsceneFactory : public ResourceFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/PathFactory.cpp b/soh/soh/resource/importer/PathFactory.cpp index 8abc59694..4d610deeb 100644 --- a/soh/soh/resource/importer/PathFactory.cpp +++ b/soh/soh/resource/importer/PathFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr PathFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr PathFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/PathFactory.h b/soh/soh/resource/importer/PathFactory.h index 8e6918133..c772679a7 100644 --- a/soh/soh/resource/importer/PathFactory.h +++ b/soh/soh/resource/importer/PathFactory.h @@ -7,7 +7,7 @@ namespace Ship { class PathFactory : public ResourceFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/PlayerAnimationFactory.cpp b/soh/soh/resource/importer/PlayerAnimationFactory.cpp index ea08b2bbb..0822697fc 100644 --- a/soh/soh/resource/importer/PlayerAnimationFactory.cpp +++ b/soh/soh/resource/importer/PlayerAnimationFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr PlayerAnimationFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr PlayerAnimationFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/PlayerAnimationFactory.h b/soh/soh/resource/importer/PlayerAnimationFactory.h index b38b2482a..1c57f80bb 100644 --- a/soh/soh/resource/importer/PlayerAnimationFactory.h +++ b/soh/soh/resource/importer/PlayerAnimationFactory.h @@ -6,7 +6,7 @@ namespace Ship { class PlayerAnimationFactory : public ResourceFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/SceneFactory.cpp b/soh/soh/resource/importer/SceneFactory.cpp index 9ea9f4c19..8963bff03 100644 --- a/soh/soh/resource/importer/SceneFactory.cpp +++ b/soh/soh/resource/importer/SceneFactory.cpp @@ -30,7 +30,7 @@ namespace Ship { -std::shared_ptr SceneFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SceneFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { if (SceneFactory::sceneCommandFactories.empty()) { diff --git a/soh/soh/resource/importer/SceneFactory.h b/soh/soh/resource/importer/SceneFactory.h index 5f08553f5..ddbb330c9 100644 --- a/soh/soh/resource/importer/SceneFactory.h +++ b/soh/soh/resource/importer/SceneFactory.h @@ -9,7 +9,7 @@ namespace Ship { class SceneFactory : public ResourceFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; diff --git a/soh/soh/resource/importer/SkeletonFactory.cpp b/soh/soh/resource/importer/SkeletonFactory.cpp index a10702f8a..24faaecaf 100644 --- a/soh/soh/resource/importer/SkeletonFactory.cpp +++ b/soh/soh/resource/importer/SkeletonFactory.cpp @@ -4,7 +4,7 @@ #include namespace Ship { -std::shared_ptr SkeletonFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SkeletonFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); @@ -26,7 +26,7 @@ std::shared_ptr SkeletonFactory::ReadResource(std::shared_ptr SkeletonFactory::ReadResourceXML(std::shared_ptr resourceMgr, +std::shared_ptr SkeletonFactory::ReadResourceXML(std::shared_ptr resourceMgr, std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/SkeletonFactory.h b/soh/soh/resource/importer/SkeletonFactory.h index 09e293a97..bb898d7d3 100644 --- a/soh/soh/resource/importer/SkeletonFactory.h +++ b/soh/soh/resource/importer/SkeletonFactory.h @@ -7,10 +7,10 @@ namespace Ship { class SkeletonFactory : public ResourceFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; - std::shared_ptr ReadResourceXML(std::shared_ptr resourceMgr, + std::shared_ptr ReadResourceXML(std::shared_ptr resourceMgr, std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; diff --git a/soh/soh/resource/importer/SkeletonLimbFactory.cpp b/soh/soh/resource/importer/SkeletonLimbFactory.cpp index 4b3ce4885..9401708d8 100644 --- a/soh/soh/resource/importer/SkeletonLimbFactory.cpp +++ b/soh/soh/resource/importer/SkeletonLimbFactory.cpp @@ -4,7 +4,7 @@ #include "libultraship/bridge.h" namespace Ship { -std::shared_ptr SkeletonLimbFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SkeletonLimbFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); @@ -26,7 +26,7 @@ std::shared_ptr SkeletonLimbFactory::ReadResource(std::shared_ptr SkeletonLimbFactory::ReadResourceXML(std::shared_ptr resourceMgr, +std::shared_ptr SkeletonLimbFactory::ReadResourceXML(std::shared_ptr resourceMgr, std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/SkeletonLimbFactory.h b/soh/soh/resource/importer/SkeletonLimbFactory.h index 6d33b72e0..ba98b73c5 100644 --- a/soh/soh/resource/importer/SkeletonLimbFactory.h +++ b/soh/soh/resource/importer/SkeletonLimbFactory.h @@ -7,10 +7,10 @@ namespace Ship { class SkeletonLimbFactory : public ResourceFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; - std::shared_ptr ReadResourceXML(std::shared_ptr resourceMgr, + std::shared_ptr ReadResourceXML(std::shared_ptr resourceMgr, std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; diff --git a/soh/soh/resource/importer/TextFactory.cpp b/soh/soh/resource/importer/TextFactory.cpp index 5718de3f2..fe66d6309 100644 --- a/soh/soh/resource/importer/TextFactory.cpp +++ b/soh/soh/resource/importer/TextFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr TextFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr TextFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); @@ -28,7 +28,7 @@ std::shared_ptr TextFactory::ReadResource(std::shared_ptr return resource; } -std::shared_ptr TextFactory::ReadResourceXML(std::shared_ptr resourceMgr, +std::shared_ptr TextFactory::ReadResourceXML(std::shared_ptr resourceMgr, std::shared_ptr initData, tinyxml2::XMLElement* reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/TextFactory.h b/soh/soh/resource/importer/TextFactory.h index 6f67daca7..18f19dc29 100644 --- a/soh/soh/resource/importer/TextFactory.h +++ b/soh/soh/resource/importer/TextFactory.h @@ -7,10 +7,10 @@ namespace Ship { class TextFactory : public ResourceFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; - std::shared_ptr ReadResourceXML(std::shared_ptr resourceMgr, + std::shared_ptr ReadResourceXML(std::shared_ptr resourceMgr, std::shared_ptr initData, tinyxml2::XMLElement* reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/EndMarkerFactory.cpp b/soh/soh/resource/importer/scenecommand/EndMarkerFactory.cpp index a60390827..fe54e6b4b 100644 --- a/soh/soh/resource/importer/scenecommand/EndMarkerFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/EndMarkerFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr EndMarkerFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr EndMarkerFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/EndMarkerFactory.h b/soh/soh/resource/importer/scenecommand/EndMarkerFactory.h index 68ccc7919..f64d4ed5d 100644 --- a/soh/soh/resource/importer/scenecommand/EndMarkerFactory.h +++ b/soh/soh/resource/importer/scenecommand/EndMarkerFactory.h @@ -5,7 +5,7 @@ namespace Ship { class EndMarkerFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetActorListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetActorListFactory.cpp index d2da1d126..226acb410 100644 --- a/soh/soh/resource/importer/scenecommand/SetActorListFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetActorListFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetActorListFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetActorListFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetActorListFactory.h b/soh/soh/resource/importer/scenecommand/SetActorListFactory.h index 7f5672e43..e36038076 100644 --- a/soh/soh/resource/importer/scenecommand/SetActorListFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetActorListFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetActorListFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.cpp b/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.cpp index 0a19953bd..6b7cfb355 100644 --- a/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.cpp @@ -4,7 +4,7 @@ #include "libultraship/bridge.h" namespace Ship { -std::shared_ptr SetAlternateHeadersFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetAlternateHeadersFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.h b/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.h index 383204ba1..e37e344a4 100644 --- a/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetAlternateHeadersFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.cpp index 1aaf73ba4..8615cb04e 100644 --- a/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetCameraSettingsFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetCameraSettingsFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.h index 5432e8d5e..a87710bea 100644 --- a/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetCameraSettingsFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.cpp b/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.cpp index 0e6112b3c..0c60750c2 100644 --- a/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.cpp @@ -4,7 +4,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetCollisionHeaderFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetCollisionHeaderFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.h b/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.h index 453f3ad0d..0d98f31a2 100644 --- a/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetCollisionHeaderFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.cpp b/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.cpp index 959deff02..93ca5a68e 100644 --- a/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetCsCameraFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetCsCameraFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.h b/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.h index de74e91a1..69a39eb81 100644 --- a/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetCsCameraFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.cpp b/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.cpp index e03fa78d8..2441af6f1 100644 --- a/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.cpp @@ -4,7 +4,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetCutscenesFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetCutscenesFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.h b/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.h index c7c277fdb..da594ed8a 100644 --- a/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetCutscenesFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.cpp index 21e9ddac1..7d1503091 100644 --- a/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetEchoSettingsFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetEchoSettingsFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.h index d15de3ef1..02e01713f 100644 --- a/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetEchoSettingsFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.cpp index cb2b4ef0e..0fcb989c7 100644 --- a/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetEntranceListFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetEntranceListFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.h b/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.h index d6a016c97..c333fbb94 100644 --- a/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetEntranceListFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetExitListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetExitListFactory.cpp index ac980811c..a5a033437 100644 --- a/soh/soh/resource/importer/scenecommand/SetExitListFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetExitListFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetExitListFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetExitListFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetExitListFactory.h b/soh/soh/resource/importer/scenecommand/SetExitListFactory.h index b4f4d8511..1cebd4441 100644 --- a/soh/soh/resource/importer/scenecommand/SetExitListFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetExitListFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetExitListFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetLightListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetLightListFactory.cpp index ff013cbae..0d47b84b5 100644 --- a/soh/soh/resource/importer/scenecommand/SetLightListFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetLightListFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetLightListFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetLightListFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetLightListFactory.h b/soh/soh/resource/importer/scenecommand/SetLightListFactory.h index cc9849e22..12805c95d 100644 --- a/soh/soh/resource/importer/scenecommand/SetLightListFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetLightListFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetLightListFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.cpp index 8d6c0ef97..3acf90b4b 100644 --- a/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetLightingSettingsFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetLightingSettingsFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.h index f02b65883..42fde2854 100644 --- a/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetLightingSettingsFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetMeshFactory.cpp b/soh/soh/resource/importer/scenecommand/SetMeshFactory.cpp index 6a1e4d33c..f50393b21 100644 --- a/soh/soh/resource/importer/scenecommand/SetMeshFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetMeshFactory.cpp @@ -4,7 +4,7 @@ #include "libultraship/bridge.h" namespace Ship { -std::shared_ptr SetMeshFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetMeshFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetMeshFactory.h b/soh/soh/resource/importer/scenecommand/SetMeshFactory.h index 968002860..4ba2d91b4 100644 --- a/soh/soh/resource/importer/scenecommand/SetMeshFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetMeshFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetMeshFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetObjectListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetObjectListFactory.cpp index 8d483631a..d9a8a83f0 100644 --- a/soh/soh/resource/importer/scenecommand/SetObjectListFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetObjectListFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetObjectListFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetObjectListFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetObjectListFactory.h b/soh/soh/resource/importer/scenecommand/SetObjectListFactory.h index b3a9f9666..c6e21d741 100644 --- a/soh/soh/resource/importer/scenecommand/SetObjectListFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetObjectListFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetObjectListFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.cpp b/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.cpp index 93d96ce03..8e0c858da 100644 --- a/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.cpp @@ -4,7 +4,7 @@ #include namespace Ship { -std::shared_ptr SetPathwaysFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetPathwaysFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.h b/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.h index c7c69183d..c1f1d4479 100644 --- a/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetPathwaysFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.cpp b/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.cpp index f387a111c..1f87c58a3 100644 --- a/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetRoomBehaviorFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetRoomBehaviorFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.h b/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.h index 6f0d6d1bf..947663dda 100644 --- a/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetRoomBehaviorFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetRoomListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetRoomListFactory.cpp index df5dea725..67d6306ce 100644 --- a/soh/soh/resource/importer/scenecommand/SetRoomListFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetRoomListFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetRoomListFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetRoomListFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetRoomListFactory.h b/soh/soh/resource/importer/scenecommand/SetRoomListFactory.h index f85aef356..19bc785de 100644 --- a/soh/soh/resource/importer/scenecommand/SetRoomListFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetRoomListFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetRoomListFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.cpp b/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.cpp index 0199d2dda..a7454d790 100644 --- a/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetSkyboxModifierFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetSkyboxModifierFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.h b/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.h index fe29e5ff0..40d7db4c6 100644 --- a/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetSkyboxModifierFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.cpp index 66e80be6f..c62ae7eb6 100644 --- a/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetSkyboxSettingsFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetSkyboxSettingsFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.h index 9c84c579a..278e38dbb 100644 --- a/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetSkyboxSettingsFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.cpp index bf1815628..5567a2041 100644 --- a/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetSoundSettingsFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetSoundSettingsFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.h index f790908c9..085ffd410 100644 --- a/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetSoundSettingsFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.cpp index d607a9ade..4fe6589b6 100644 --- a/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetSpecialObjectsFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetSpecialObjectsFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.h b/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.h index 05190c631..e9ac975ca 100644 --- a/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetSpecialObjectsFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.cpp index c35721782..42b767613 100644 --- a/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetStartPositionListFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetStartPositionListFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.h b/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.h index d218348f7..6174fa54e 100644 --- a/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetStartPositionListFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.cpp index 5542e95a8..63c7d9b29 100644 --- a/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetTimeSettingsFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetTimeSettingsFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.h index 746b9b788..ddd277d09 100644 --- a/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetTimeSettingsFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.cpp index af53e17af..716e346c0 100644 --- a/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetTransitionActorListFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetTransitionActorListFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.h b/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.h index b6242c341..161a3b185 100644 --- a/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetTransitionActorListFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.cpp index 8727008b7..f43e7558b 100644 --- a/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" namespace Ship { -std::shared_ptr SetWindSettingsFactory::ReadResource(std::shared_ptr resourceMgr, +std::shared_ptr SetWindSettingsFactory::ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) { auto resource = std::make_shared(resourceMgr, initData); diff --git a/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.h index 19dc1efb0..2406ca80e 100644 --- a/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.h +++ b/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.h @@ -5,7 +5,7 @@ namespace Ship { class SetWindSettingsFactory : public SceneCommandFactory { public: - std::shared_ptr ReadResource(std::shared_ptr resourceMgr, + std::shared_ptr ReadResource(std::shared_ptr resourceMgr, std::shared_ptr initData, std::shared_ptr reader) override; }; diff --git a/soh/soh/resource/type/Skeleton.cpp b/soh/soh/resource/type/Skeleton.cpp index 52f5f5a5d..785b02c78 100644 --- a/soh/soh/resource/type/Skeleton.cpp +++ b/soh/soh/resource/type/Skeleton.cpp @@ -1,4 +1,4 @@ -#include "resource/ResourceMgr.h" +#include "resource/ResourceManager.h" #include "Skeleton.h" #include "soh/OTRGlobals.h" #include "libultraship/libultraship.h" diff --git a/soh/soh/z_message_OTR.cpp b/soh/soh/z_message_OTR.cpp index bb51843a4..9e06424b9 100644 --- a/soh/soh/z_message_OTR.cpp +++ b/soh/soh/z_message_OTR.cpp @@ -1,5 +1,5 @@ #include "OTRGlobals.h" -#include +#include #include "soh/resource/type/Scene.h" #include #include "global.h" diff --git a/soh/soh/z_play_otr.cpp b/soh/soh/z_play_otr.cpp index b178cbf49..5827e4555 100644 --- a/soh/soh/z_play_otr.cpp +++ b/soh/soh/z_play_otr.cpp @@ -1,5 +1,5 @@ #include "OTRGlobals.h" -#include +#include #include "soh/resource/type/Scene.h" #include #include "soh/Enhancements/game-interactor/GameInteractor.h" diff --git a/soh/soh/z_scene_otr.cpp b/soh/soh/z_scene_otr.cpp index cab4d1c69..6bcd1f0e2 100644 --- a/soh/soh/z_scene_otr.cpp +++ b/soh/soh/z_scene_otr.cpp @@ -1,5 +1,5 @@ #include "OTRGlobals.h" -#include +#include #include "soh/resource/type/Scene.h" #include #include "global.h" @@ -38,7 +38,7 @@ extern "C" s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId); extern "C" RomFile sNaviMsgFiles[]; s32 OTRScene_ExecuteCommands(PlayState* play, Ship::Scene* scene); -std::shared_ptr ResourceMgr_LoadFile(const char* path) { +std::shared_ptr ResourceMgr_LoadFile(const char* path) { std::string Path = path; if (IsGameMasterQuest()) { size_t pos = 0; diff --git a/soh/src/code/gfxprint.c b/soh/src/code/gfxprint.c index f7aa20a76..8637e86d5 100644 --- a/soh/src/code/gfxprint.c +++ b/soh/src/code/gfxprint.c @@ -128,7 +128,25 @@ u8 sGfxPrintFontData[(16 * 256) / 2] = { // Can be used to set GFXP_FLAG_ENLARGE by default static u8 sDefaultSpecialFlags; -static const char rGfxPrintFontData[] = "__OTR__alt/textures/font/sGfxPrintFontData"; +static const char rGfxPrintFontData[] = "__OTR__textures/font/sGfxPrintFontData"; +static const char rGfxPrintFontDataAlt[] = "__OTR__alt/textures/font/sGfxPrintFontData"; + +// OTRTODO: this isn't as clean as it could be if we implemented +// the GfxPrint texture extraction to `.otr` as described in +// https://github.com/HarbourMasters/Shipwright/issues/2762 +typedef enum {hardcoded, otrDefault, otrAlt} font_texture_t; +font_texture_t GfxPrint_TextureToUse() { + if (CVarGetInteger("gAltAssets", 0) && ResourceMgr_FileExists(rGfxPrintFontDataAlt)) { + // If we have alt assets enabled, and we have alt prefixed font texture, use that + return otrAlt; + } else if (ResourceMgr_FileExists(rGfxPrintFontData)) { + // if we have a non alt prefixed font texture, use that + return otrDefault; + } + + // default to hardcoded font + return hardcoded; +} void GfxPrint_Setup(GfxPrint* this) { s32 width = 16; @@ -142,19 +160,22 @@ void GfxPrint_Setup(GfxPrint* this) { G_AC_NONE | G_ZS_PRIM | G_RM_XLU_SURF | G_RM_XLU_SURF2); gDPSetCombineMode(this->dList++, G_CC_DECALRGBA, G_CC_DECALRGBA); - bool useAltTexture = ResourceMgr_FileExists(rGfxPrintFontData) && CVarGetInteger("gAltAssets", 0); - if (!useAltTexture) { + + + if (GfxPrint_TextureToUse() == hardcoded) { gDPLoadTextureBlock_4b(this->dList++, sGfxPrintFontData, G_IM_FMT_CI, width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); } else { - gDPLoadTextureBlock_4b(this->dList++, rGfxPrintFontData, G_IM_FMT_CI, width * 4, height, 0, G_TX_NOMIRROR | G_TX_WRAP, + gDPLoadTextureBlock_4b(this->dList++, + GfxPrint_TextureToUse() == otrAlt ? rGfxPrintFontDataAlt : rGfxPrintFontData, + G_IM_FMT_CI, width * 4, height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); } gDPLoadTLUT(this->dList++, 64, 256, sGfxPrintFontTLUT); for (i = 1; i < 4; i++) { - if (useAltTexture) { + if (GfxPrint_TextureToUse() != hardcoded) { gDPSetTile(this->dList++, G_IM_FMT_RGBA, G_IM_SIZ_4b, 1, 0, i * 2, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); } else { @@ -204,7 +225,6 @@ void GfxPrint_SetBasePosPx(GfxPrint* this, s32 x, s32 y) { void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c) { u32 tile = (c & 0xFF) * 2; u8 offset = ((c * 2) & 0x7) / 2; - u8 useAltTexture = ResourceMgr_FileExists(rGfxPrintFontData) && CVarGetInteger("gAltAssets", 0); if (this->flags & GFXP_FLAG_UPDATE) { this->flags &= ~GFXP_FLAG_UPDATE; @@ -243,7 +263,7 @@ void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c) { (this->posY + 32) << 1, tile, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1 << 9, 1 << 9); } else { gSPTextureRectangle(this->dList++, this->posX, this->posY, this->posX + 32, this->posY + 32, - useAltTexture ? 0 : tile, (useAltTexture ? ((128 * 4) * offset) : 0) + (u16)((c & 4) * 64), + GfxPrint_TextureToUse() != hardcoded ? 0 : tile, (GfxPrint_TextureToUse() != hardcoded ? ((128 * 4) * offset) : 0) + (u16)((c & 4) * 64), (u16)(c >> 3) * 256, 1 << 10, 1 << 10); } diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 8198caebf..954ce1190 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -3,6 +3,7 @@ #include "textures/parameter_static/parameter_static.h" #include "textures/do_action_static/do_action_static.h" #include "textures/icon_item_static/icon_item_static.h" +#include "soh_assets.h" #include "soh/Enhancements/randomizer/adult_trade_shuffle.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "libultraship/bridge.h" @@ -2270,6 +2271,7 @@ u8 Item_Give(PlayState* play, u8 item) { } gSaveContext.inventory.items[temp + i] = item; + break; } } } else { @@ -5219,7 +5221,7 @@ void Interface_Draw(PlayState* play) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, dPadColor.r, dPadColor.g, dPadColor.b, dpadAlpha); if (fullUi) { - gDPLoadTextureBlock(OVERLAY_DISP++, "__OTR__textures/parameter_static/gDPad", + gDPLoadTextureBlock(OVERLAY_DISP++, gDPadTex, G_IM_FMT_IA, G_IM_SIZ_16b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPWideTextureRectangle(OVERLAY_DISP++, DpadPosX << 2, DpadPosY << 2, diff --git a/soh/src/code/z_scene_table.c b/soh/src/code/z_scene_table.c index 33e58dbd0..9e4f845f5 100644 --- a/soh/src/code/z_scene_table.c +++ b/soh/src/code/z_scene_table.c @@ -1006,7 +1006,7 @@ void func_800995DC(PlayState* play) { { s32 pad; } - gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A2F8[gSaveContext.nightFlag])); + gSPSegmentLoadRes(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A2F8[gSaveContext.nightFlag])); CLOSE_DISPS(play->state.gfxCtx); } @@ -1046,8 +1046,8 @@ void func_80099878(PlayState* play) { OPEN_DISPS(play->state.gfxCtx); gameplayFrames = play->gameplayFrames; - gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gDCEntranceTextures[gSaveContext.nightFlag])); - gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sDCLavaFloorTextures[(s32)(gameplayFrames & 14) >> 1])); + gSPSegmentLoadRes(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gDCEntranceTextures[gSaveContext.nightFlag])); + gSPSegmentLoadRes(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sDCLavaFloorTextures[(s32)(gameplayFrames & 14) >> 1])); gSPSegment(POLY_XLU_DISP++, 0x09, Gfx_TwoTexScroll(play->state.gfxCtx, 0, (gameplayFrames * 1) % 256, 0, 64, 32, 1, 0, (gameplayFrames * 1) % 128, 64, 32)); @@ -1301,7 +1301,7 @@ void func_8009AFE0(PlayState* play) { { s32 pad[2]; } - gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sThievesHideoutEntranceTextures[gSaveContext.nightFlag])); + gSPSegmentLoadRes(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sThievesHideoutEntranceTextures[gSaveContext.nightFlag])); CLOSE_DISPS(play->state.gfxCtx); } @@ -1323,7 +1323,7 @@ void func_8009B0FC(PlayState* play) { spAC = play->roomCtx.unk_74[1] & 0xFF; gameplayFrames = play->gameplayFrames; - gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A330[gSaveContext.nightFlag])); + gSPSegmentLoadRes(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A330[gSaveContext.nightFlag])); if (spB0 == 1) { gSPSegment(POLY_OPA_DISP++, 0x08, @@ -1548,7 +1548,7 @@ void func_8009C3EC(PlayState* play) { OPEN_DISPS(play->state.gfxCtx); gameplayFrames = play->gameplayFrames; - gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sIceCavernEntranceTextures[gSaveContext.nightFlag])); + gSPSegmentLoadRes(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sIceCavernEntranceTextures[gSaveContext.nightFlag])); gSPSegment(POLY_OPA_DISP++, 0x09, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); @@ -1650,7 +1650,7 @@ void func_8009CC00(PlayState* play) { OPEN_DISPS(play->state.gfxCtx); gameplayFrames = play->gameplayFrames; - gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sGTGEntranceTextures[gSaveContext.nightFlag])); + gSPSegmentLoadRes(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sGTGEntranceTextures[gSaveContext.nightFlag])); gSPSegment(POLY_OPA_DISP++, 0x09, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); @@ -1746,7 +1746,7 @@ void func_8009D31C(PlayState* play) { { s32 pad[2]; } - gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sLonLonHouseEntranceTextures[gSaveContext.nightFlag])); + gSPSegmentLoadRes(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sLonLonHouseEntranceTextures[gSaveContext.nightFlag])); gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128); @@ -1778,8 +1778,8 @@ void func_8009D438(PlayState* play) { var = gSaveContext.nightFlag; } - gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sGuardHouseView1Textures[var])); - gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sGuardHouseView2Textures[var])); + gSPSegmentLoadRes(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sGuardHouseView1Textures[var])); + gSPSegmentLoadRes(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sGuardHouseView2Textures[var])); gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128); @@ -1823,7 +1823,7 @@ void func_8009D758(PlayState* play) { OPEN_DISPS(play->state.gfxCtx); gameplayFrames = play->gameplayFrames; - gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sForestTempleEntranceTextures[gSaveContext.nightFlag])); + gSPSegmentLoadRes(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sForestTempleEntranceTextures[gSaveContext.nightFlag])); gSPSegment(POLY_XLU_DISP++, 0x09, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); @@ -1853,7 +1853,7 @@ void func_8009D974(PlayState* play) { { s32 pad[2]; } - gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sSpiritTempleEntranceTextures[gSaveContext.nightFlag])); + gSPSegmentLoadRes(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sSpiritTempleEntranceTextures[gSaveContext.nightFlag])); CLOSE_DISPS(play->state.gfxCtx); } @@ -1915,7 +1915,7 @@ void func_8009DD5C(PlayState* play) { { s32 pad[2]; } - gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sKakarikoWindowTextures[gSaveContext.nightFlag])); + gSPSegmentLoadRes(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sKakarikoWindowTextures[gSaveContext.nightFlag])); gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128); @@ -2051,7 +2051,7 @@ void func_8009E730(PlayState* play) { gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128); - gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sZorasDomainEntranceTextures[gSaveContext.nightFlag])); + gSPSegmentLoadRes(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sZorasDomainEntranceTextures[gSaveContext.nightFlag])); { s32 pad[2]; } @@ -2183,7 +2183,7 @@ void func_8009F1B4(PlayState* play) { { s32 pad[2]; } - gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A380[gSaveContext.nightFlag])); + gSPSegmentLoadRes(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A380[gSaveContext.nightFlag])); CLOSE_DISPS(play->state.gfxCtx); } @@ -2316,7 +2316,7 @@ void func_8009F9D0(PlayState* play) { gDPPipeSync(POLY_XLU_DISP++); gDPSetEnvColor(POLY_XLU_DISP++, 128, 128, 128, 128); - gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sGoronCityEntranceTextures[gSaveContext.nightFlag])); + gSPSegmentLoadRes(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sGoronCityEntranceTextures[gSaveContext.nightFlag])); { s32 pad[2]; } @@ -2334,7 +2334,7 @@ void func_8009FB74(PlayState* play) { { s32 pad[2]; } - gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sLonLonRanchWindowTextures[gSaveContext.nightFlag])); + gSPSegmentLoadRes(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sLonLonRanchWindowTextures[gSaveContext.nightFlag])); gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128); diff --git a/soh/src/overlays/actors/ovl_En_Box/z_en_box.c b/soh/src/overlays/actors/ovl_En_Box/z_en_box.c index 4e864e582..2a83e587e 100644 --- a/soh/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/soh/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -1,5 +1,6 @@ #include "z_en_box.h" #include "objects/object_box/object_box.h" +#include "soh_assets.h" #define FLAGS 0 @@ -756,16 +757,16 @@ void EnBox_UpdateSizeAndTexture(EnBox* this, PlayState* play) { void EnBox_CreateExtraChestTextures() { if (hasCreatedRandoChestTextures) return; Gfx gTreasureChestChestTextures[] = { - gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, "__OTR__objects/object_box/gSkullTreasureChestFrontTex"), - gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, "__OTR__objects/object_box/gSkullTreasureChestSideAndTopTex"), - gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, "__OTR__objects/object_box/gGoldTreasureChestFrontTex"), - gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, "__OTR__objects/object_box/gGoldTreasureChestSideAndTopTex"), - gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, "__OTR__objects/object_box/gKeyTreasureChestFrontTex"), - gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, "__OTR__objects/object_box/gKeyTreasureChestSideAndTopTex"), - gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, "__OTR__objects/object_box/gChristmasRedTreasureChestFrontTex"), - gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, "__OTR__objects/object_box/gChristmasRedTreasureChestSideAndTopTex"), - gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, "__OTR__objects/object_box/gChristmasGreenTreasureChestFrontTex"), - gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, "__OTR__objects/object_box/gChristmasGreenTreasureChestSideAndTopTex"), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gSkullTreasureChestFrontTex), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gSkullTreasureChestSideAndTopTex), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gGoldTreasureChestFrontTex), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gGoldTreasureChestSideAndTopTex), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gKeyTreasureChestFrontTex), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gKeyTreasureChestSideAndTopTex), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gChristmasRedTreasureChestFrontTex), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gChristmasRedTreasureChestSideAndTopTex), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gChristmasGreenTreasureChestFrontTex), + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gChristmasGreenTreasureChestSideAndTopTex), }; Gfx* frontCmd = ResourceMgr_LoadGfxByName(gTreasureChestChestFrontDL); diff --git a/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c index 0dd77b716..dd000c6e2 100644 --- a/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -701,7 +701,7 @@ void EnMag_DrawInnerMq(Actor* thisx, PlayState* play, Gfx** gfxp) { gDPPipeSync(gfx++); gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, (s16)this->subAlpha); - EnMag_DrawImageRGBA32(&gfx, 174, 145, "__OTR__objects/object_mag/gTitleMasterQuestSubtitleTex", 128, 32); + EnMag_DrawImageRGBA32(&gfx, 174, 145, gTitleMasterQuestSubtitleTex, 128, 32); } Gfx_SetupDL_39Ptr(&gfx); diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index 171766609..262500527 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -9,6 +9,7 @@ #include #include "objects/object_mag/object_mag.h" #include "objects/gameplay_keep/gameplay_keep.h" +#include "soh_assets.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/custom-message/CustomMessageTypes.h" @@ -1367,11 +1368,11 @@ const char* FileChoose_GetQuestChooseTitleTexName(Language lang) { switch (lang) { case LANGUAGE_ENG: default: - return "__OTR__textures/title_static/gFileSelPleaseChooseAQuestENGTex"; + return gFileSelPleaseChooseAQuestENGTex; case LANGUAGE_FRA: - return "__OTR__textures/title_static/gFileSelPleaseChooseAQuestFRATex"; + return gFileSelPleaseChooseAQuestFRATex; case LANGUAGE_GER: - return "__OTR__textures/title_static/gFileSelPleaseChooseAQuestGERTex"; + return gFileSelPleaseChooseAQuestGERTex; } } @@ -1451,7 +1452,7 @@ void FileChoose_DrawWindowContents(GameState* thisx) { 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, gTitleZeldaShieldLogoMQTex, 160, 160); - FileChoose_DrawImageRGBA32(this->state.gfxCtx, 182, 180, "__OTR__objects/object_mag/gTitleMasterQuestSubtitleTex", 128, 32); + FileChoose_DrawImageRGBA32(this->state.gfxCtx, 182, 180, gTitleMasterQuestSubtitleTex, 128, 32); break; case RANDOMIZER_QUEST: @@ -1460,7 +1461,7 @@ void FileChoose_DrawWindowContents(GameState* thisx) { 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, "__OTR__objects/object_mag/gTitleRandomizerSubtitleTex", 128, 32); + FileChoose_DrawImageRGBA32(this->state.gfxCtx, 182, 180, gTitleRandomizerSubtitleTex, 128, 32); break; } } else if (this->configMode != CM_ROTATE_TO_NAME_ENTRY) { @@ -1536,7 +1537,7 @@ void FileChoose_DrawWindowContents(GameState* thisx) { this->nameAlpha[i]); } gDPLoadTextureBlock(POLY_OPA_DISP++, - "__OTR__textures/title_static/gFileSelRANDButtonTex", + gFileSelRANDButtonTex, G_IM_FMT_IA, G_IM_SIZ_16b, 44, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(POLY_OPA_DISP++, 8, 10, 11, 9, 0); @@ -1553,7 +1554,7 @@ void FileChoose_DrawWindowContents(GameState* thisx) { this->nameAlpha[i]); } gDPLoadTextureBlock(POLY_OPA_DISP++, - "__OTR__textures/title_static/gFileSelMQButtonTex", + gFileSelMQButtonTex, G_IM_FMT_IA, G_IM_SIZ_16b, 44, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(POLY_OPA_DISP++, 8, 10, 11, 9, 0); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index 89bc1c6ac..aae19180e 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -922,3 +922,8 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { } } } + +void KaleidoScope_ResetTradeSelect() { + gSelectingMask = false; + gSelectingAdultTrade = false; +} diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h index af42f7f73..ad53fdd3a 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h @@ -37,4 +37,6 @@ void PauseMapMark_Draw(PlayState* play); void KaleidoScope_UpdateCursorSize(PauseContext* pauseCtx); +void KaleidoScope_ResetTradeSelect(); + #endif diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index dfd7fae49..48ec05600 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -940,6 +940,8 @@ void KaleidoScope_SwitchPage(PauseContext* pauseCtx, u8 pt) { gSaveContext.unk_13EA = 0; Interface_ChangeAlpha(50); + + KaleidoScope_ResetTradeSelect(); } void KaleidoScope_HandlePageToggles(PauseContext* pauseCtx, Input* input) { @@ -3587,6 +3589,8 @@ void KaleidoScope_Update(PlayState* play) } } + KaleidoScope_ResetTradeSelect(); + pauseCtx->state = 4; break;