Merge pull request #2826 from HarbourMasters/develop-spock

Spock -> Develop
This commit is contained in:
Christopher Leggett 2023-05-03 23:00:45 -04:00 committed by GitHub
commit 071a2d0418
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
124 changed files with 663 additions and 512 deletions

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -1 +1 @@
Subproject commit 2ddffdb5b60377a09a4a198a8fd67726951bbb27 Subproject commit 7fe0c076a8261d7e878b196d2b5de57beccf1177

64
soh/assets/soh_assets.h Normal file
View File

@ -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;

View File

@ -229,7 +229,7 @@ void AudioCollection::RemoveFromShufflePool(SequenceInfo* seqInfo) {
excludedSequences.insert(seqInfo); excludedSequences.insert(seqInfo);
includedSequences.erase(seqInfo); includedSequences.erase(seqInfo);
CVarSetInteger(cvarKey.c_str(), 1); CVarSetInteger(cvarKey.c_str(), 1);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
void AudioCollection::AddToShufflePool(SequenceInfo* seqInfo) { void AudioCollection::AddToShufflePool(SequenceInfo* seqInfo) {
@ -237,7 +237,7 @@ void AudioCollection::AddToShufflePool(SequenceInfo* seqInfo) {
includedSequences.insert(seqInfo); includedSequences.insert(seqInfo);
excludedSequences.erase(seqInfo); excludedSequences.erase(seqInfo);
CVarClear(cvarKey.c_str()); CVarClear(cvarKey.c_str());
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
void AudioCollection::InitializeShufflePool() { void AudioCollection::InitializeShufflePool() {

View File

@ -2,6 +2,7 @@
#include <map> #include <map>
#include <string> #include <string>
#include <set> #include <set>
#include <cstdint>
enum SeqType { enum SeqType {
SEQ_NOSHUFFLE = 0, SEQ_NOSHUFFLE = 0,

View File

@ -158,7 +158,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
const std::string randomizeAllButton = "Randomize All" + hiddenTabId; const std::string randomizeAllButton = "Randomize All" + hiddenTabId;
if (ImGui::Button(resetAllButton.c_str())) { if (ImGui::Button(resetAllButton.c_str())) {
ResetGroup(map, type); ResetGroup(map, type);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
if (type == SEQ_BGM_WORLD) { if (type == SEQ_BGM_WORLD) {
ReplayCurrentBGM(); ReplayCurrentBGM();
} }
@ -166,7 +166,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(randomizeAllButton.c_str())) { if (ImGui::Button(randomizeAllButton.c_str())) {
RandomizeGroup(type); RandomizeGroup(type);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
if (type == SEQ_BGM_WORLD) { if (type == SEQ_BGM_WORLD) {
ReplayCurrentBGM(); ReplayCurrentBGM();
} }
@ -205,7 +205,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
if (ImGui::Selectable(seqData.label.c_str())) { if (ImGui::Selectable(seqData.label.c_str())) {
CVarSetInteger(cvarKey.c_str(), value); CVarSetInteger(cvarKey.c_str(), value);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
UpdateCurrentBGM(defaultValue, type); UpdateCurrentBGM(defaultValue, type);
} }
} }
@ -219,7 +219,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
ImGui::PushItemWidth(-FLT_MIN); ImGui::PushItemWidth(-FLT_MIN);
if (ImGui::Button(resetButton.c_str())) { if (ImGui::Button(resetButton.c_str())) {
CVarSetInteger(cvarKey.c_str(), defaultValue); CVarSetInteger(cvarKey.c_str(), defaultValue);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
UpdateCurrentBGM(defaultValue, seqData.category); UpdateCurrentBGM(defaultValue, seqData.category);
} }
ImGui::SameLine(); ImGui::SameLine();
@ -236,7 +236,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
auto it = validSequences.begin(); auto it = validSequences.begin();
const auto& seqData = *std::next(it, rand() % validSequences.size()); const auto& seqData = *std::next(it, rand() % validSequences.size());
CVarSetInteger(cvarKey.c_str(), seqData->sequenceId); CVarSetInteger(cvarKey.c_str(), seqData->sequenceId);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
UpdateCurrentBGM(seqData->sequenceId, type); UpdateCurrentBGM(seqData->sequenceId, type);
} }
} }
@ -378,7 +378,7 @@ void DrawSfxEditor(bool& open) {
const std::string resetButton = "Reset##linkVoiceFreqMultiplier"; const std::string resetButton = "Reset##linkVoiceFreqMultiplier";
if (ImGui::Button(resetButton.c_str())) { if (ImGui::Button(resetButton.c_str())) {
CVarSetFloat("gLinkVoiceFreqMultiplier", 1.0f); CVarSetFloat("gLinkVoiceFreqMultiplier", 1.0f);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
ImGui::NewLine(); ImGui::NewLine();
@ -552,7 +552,7 @@ void DrawSfxEditor(bool& open) {
void InitAudioEditor() { void InitAudioEditor() {
//Draw the bar in the menu. //Draw the bar in the menu.
SohImGui::AddWindow("Enhancements", "Audio Editor", DrawSfxEditor); Ship::AddWindow("Enhancements", "Audio Editor", DrawSfxEditor);
} }
std::vector<SeqType> allTypes = { SEQ_BGM_WORLD, SEQ_BGM_EVENT, SEQ_BGM_BATTLE, SEQ_OCARINA, SEQ_FANFARE, SEQ_INSTRUMENT, SEQ_SFX }; std::vector<SeqType> 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); RandomizeGroup(type);
} }
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
ReplayCurrentBGM(); ReplayCurrentBGM();
} }
@ -571,6 +571,6 @@ void AudioEditor_ResetAll() {
ResetGroup(AudioCollection::Instance->GetAllSequences(), type); ResetGroup(AudioCollection::Instance->GetAllSequences(), type);
} }
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
ReplayCurrentBGM(); ReplayCurrentBGM();
} }

View File

@ -88,7 +88,7 @@ namespace GameControlEditor {
void DrawUI(bool&); void DrawUI(bool&);
void Init() { void Init() {
SohImGui::AddWindow("Enhancements", "Game Control Editor", DrawUI); Ship::AddWindow("Enhancements", "Game Control Editor", DrawUI);
addButtonName(BTN_A, "A"); addButtonName(BTN_A, "A");
addButtonName(BTN_B, "B"); addButtonName(BTN_B, "B");
@ -136,7 +136,7 @@ namespace GameControlEditor {
} }
if (ImGui::Selectable(i->second, i->first == currentButton)) { if (ImGui::Selectable(i->second, i->first == currentButton)) {
CVarSetInteger(mapping.cVarName, i->first); CVarSetInteger(mapping.cVarName, i->first);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
} }
ImGui::EndCombo(); ImGui::EndCombo();
@ -172,7 +172,7 @@ namespace GameControlEditor {
ImGui::TableSetupColumn("Modifiers##CustomOcaranaModifiers", PANEL_TABLE_COLUMN_FLAGS); ImGui::TableSetupColumn("Modifiers##CustomOcaranaModifiers", PANEL_TABLE_COLUMN_FLAGS);
TableHelper::InitHeader(false); TableHelper::InitHeader(false);
SohImGui::BeginGroupPanel("Notes", ImGui::GetContentRegionAvail()); Ship::BeginGroupPanel("Notes", ImGui::GetContentRegionAvail());
labelWidth = ImGui::CalcTextSize("D5").x + 10; labelWidth = ImGui::CalcTextSize("D5").x + 10;
DrawMapping(ocarinaD5, labelWidth, disableMask); DrawMapping(ocarinaD5, labelWidth, disableMask);
DrawMapping(ocarinaB4, labelWidth, disableMask); DrawMapping(ocarinaB4, labelWidth, disableMask);
@ -181,16 +181,16 @@ namespace GameControlEditor {
DrawMapping(ocarinaD4, labelWidth, disableMask); DrawMapping(ocarinaD4, labelWidth, disableMask);
ImGui::Dummy(ImVec2(0, 5)); ImGui::Dummy(ImVec2(0, 5));
float cursorY = ImGui::GetCursorPosY(); float cursorY = ImGui::GetCursorPosY();
SohImGui::EndGroupPanel(); Ship::EndGroupPanel();
TableHelper::NextCol(); TableHelper::NextCol();
SohImGui::BeginGroupPanel("Modifiers", ImGui::GetContentRegionAvail()); Ship::BeginGroupPanel("Modifiers", ImGui::GetContentRegionAvail());
labelWidth = ImGui::CalcTextSize(ocarinaSongDisable.label).x + 10; labelWidth = ImGui::CalcTextSize(ocarinaSongDisable.label).x + 10;
DrawMapping(ocarinaSongDisable, labelWidth, disableMask); DrawMapping(ocarinaSongDisable, labelWidth, disableMask);
DrawMapping(ocarinaSharp, labelWidth, disableMask); DrawMapping(ocarinaSharp, labelWidth, disableMask);
DrawMapping(ocarinaFlat, labelWidth, disableMask); DrawMapping(ocarinaFlat, labelWidth, disableMask);
SohImGui::EndGroupPanel(cursorY - ImGui::GetCursorPosY() + 2); Ship::EndGroupPanel(cursorY - ImGui::GetCursorPosY() + 2);
ImGui::EndTable(); ImGui::EndTable();
} }
@ -201,7 +201,7 @@ namespace GameControlEditor {
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
} }
SohImGui::BeginGroupPanel("Alternate controls", ImGui::GetContentRegionAvail()); Ship::BeginGroupPanel("Alternate controls", ImGui::GetContentRegionAvail());
if (ImGui::BeginTable("tableOcarinaAlternateControls", 2, ImGuiTableFlags_SizingFixedSame)) { if (ImGui::BeginTable("tableOcarinaAlternateControls", 2, ImGuiTableFlags_SizingFixedSame)) {
ImGui::TableSetupColumn("D-pad", PANEL_TABLE_COLUMN_FLAGS); ImGui::TableSetupColumn("D-pad", PANEL_TABLE_COLUMN_FLAGS);
ImGui::TableSetupColumn("Right stick", PANEL_TABLE_COLUMN_FLAGS); ImGui::TableSetupColumn("Right stick", PANEL_TABLE_COLUMN_FLAGS);
@ -213,7 +213,7 @@ namespace GameControlEditor {
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
ImGui::EndTable(); ImGui::EndTable();
} }
SohImGui::EndGroupPanel(); Ship::EndGroupPanel();
ImGui::EndTable(); 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 // 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 // Therefore CurrentPort - 1 must always be used inside this function instead of CurrentPort
void DrawCustomButtons() { void DrawCustomButtons() {
SohImGui::GetInputEditor()->DrawControllerSelect(CurrentPort - 1); Ship::GetInputEditor()->DrawControllerSelect(CurrentPort - 1);
SohImGui::GetInputEditor()->DrawButton("Modifier 1", BTN_MODIFIER1, CurrentPort - 1, &BtnReading); Ship::GetInputEditor()->DrawButton("Modifier 1", BTN_MODIFIER1, CurrentPort - 1, &BtnReading);
SohImGui::GetInputEditor()->DrawButton("Modifier 2", BTN_MODIFIER2, CurrentPort - 1, &BtnReading); Ship::GetInputEditor()->DrawButton("Modifier 2", BTN_MODIFIER2, CurrentPort - 1, &BtnReading);
} }
void DrawCameraControlPanel() { void DrawCameraControlPanel() {
@ -233,7 +233,7 @@ namespace GameControlEditor {
} }
UIWidgets::Spacer(0); 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"); UIWidgets::PaddedEnhancementCheckbox("Right Stick Aiming", "gRightStickAiming");
DrawHelpIcon("Allows for aiming with the right stick in:\n-First-Person/C-Up view\n-Weapon Aiming"); 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"); UIWidgets::PaddedEnhancementCheckbox("Invert Aiming X Axis", "gInvertAimingXAxis");
@ -252,10 +252,10 @@ namespace GameControlEditor {
CVarSetFloat("gFirstPersonCameraSensitivity", 1.0f); CVarSetFloat("gFirstPersonCameraSensitivity", 1.0f);
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
SohImGui::EndGroupPanel(); Ship::EndGroupPanel();
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
SohImGui::BeginGroupPanel("Third-Person Camera", ImGui::GetContentRegionAvail()); Ship::BeginGroupPanel("Third-Person Camera", ImGui::GetContentRegionAvail());
UIWidgets::PaddedEnhancementCheckbox("Free Camera", "gFreeCamera"); UIWidgets::PaddedEnhancementCheckbox("Free Camera", "gFreeCamera");
DrawHelpIcon("Enables free camera control\nNote: You must remap C buttons off of the right stick in the " 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); "gFreeCameraDistMax", 100, 900, "", 185, true, false, true);
UIWidgets::PaddedEnhancementSliderInt("Camera Transition Speed: %d", "##CamTranSpeed", UIWidgets::PaddedEnhancementSliderInt("Camera Transition Speed: %d", "##CamTranSpeed",
"gFreeCameraTransitionSpeed", 0, 900, "", 25, true, false, true); "gFreeCameraTransitionSpeed", 0, 900, "", 25, true, false, true);
SohImGui::EndGroupPanel(); Ship::EndGroupPanel();
} }
void DrawDpadControlPanel() { void DrawDpadControlPanel() {
@ -283,7 +283,7 @@ namespace GameControlEditor {
ImVec2 cursor = ImGui::GetCursorPos(); ImVec2 cursor = ImGui::GetCursorPos();
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5)); 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"); 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" 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"); "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"); "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"); 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"); 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() { void DrawMiscControlPanel() {
@ -302,7 +302,7 @@ namespace GameControlEditor {
ImVec2 cursor = ImGui::GetCursorPos(); ImVec2 cursor = ImGui::GetCursorPos();
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5)); 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"); UIWidgets::PaddedText("Allow the cursor to be on any slot");
static const char* cursorOnAnySlot[3] = { "Only in Rando", "Always", "Never" }; static const char* cursorOnAnySlot[3] = { "Only in Rando", "Always", "Never" };
UIWidgets::EnhancementCombobox("gPauseAnyCursor", cursorOnAnySlot, PAUSE_ANY_CURSOR_RANDO_ONLY); 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"); 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)) { if (CVarGetInteger("gEnableWalkModify", 0)) {
UIWidgets::Spacer(5); 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::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 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); 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::Spacer(0);
UIWidgets::PaddedEnhancementCheckbox("Answer Navi Prompt with L Button", "gNaviOnL"); UIWidgets::PaddedEnhancementCheckbox("Answer Navi Prompt with L Button", "gNaviOnL");
DrawHelpIcon("Speak to Navi with L but enter first-person camera with C-Up"); DrawHelpIcon("Speak to Navi with L but enter first-person camera with C-Up");
SohImGui::EndGroupPanel(); Ship::EndGroupPanel();
} }

View File

@ -1413,7 +1413,7 @@ void Draw_Placements(){
void DrawSillyTab() { void DrawSillyTab() {
if (CVarGetInteger("gLetItSnow", 0)) { if (CVarGetInteger("gLetItSnow", 0)) {
if (UIWidgets::EnhancementCheckbox("Let It Snow", "gLetItSnow")) { 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)) { 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")) { if (ImGui::Button("Reset##Link_BodyScale")) {
CVarClear("gCosmetics.Link_BodyScale.Value"); CVarClear("gCosmetics.Link_BodyScale.Value");
CVarClear("gCosmetics.Link_BodyScale.Changed"); CVarClear("gCosmetics.Link_BodyScale.Changed");
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
static Player* player = GET_PLAYER(gPlayState); static Player* player = GET_PLAYER(gPlayState);
player->actor.scale.x = 0.01f; player->actor.scale.x = 0.01f;
player->actor.scale.y = 0.01f; player->actor.scale.y = 0.01f;
@ -1436,7 +1436,7 @@ void DrawSillyTab() {
if (ImGui::Button("Reset##Link_HeadScale")) { if (ImGui::Button("Reset##Link_HeadScale")) {
CVarClear("gCosmetics.Link_HeadScale.Value"); CVarClear("gCosmetics.Link_HeadScale.Value");
CVarClear("gCosmetics.Link_HeadScale.Changed"); 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)) { 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); CVarSetInteger("gCosmetics.Link_SwordScale.Changed", 1);
@ -1445,44 +1445,44 @@ void DrawSillyTab() {
if (ImGui::Button("Reset##Link_SwordScale")) { if (ImGui::Button("Reset##Link_SwordScale")) {
CVarClear("gCosmetics.Link_SwordScale.Value"); CVarClear("gCosmetics.Link_SwordScale.Value");
CVarClear("gCosmetics.Link_SwordScale.Changed"); 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); UIWidgets::EnhancementSliderFloat("Bunny Hood Length: %f", "##BunnyHood_EarLength", "gCosmetics.BunnyHood_EarLength", -300.0f, 1000.0f, "", 0.0f, false);
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Reset##BunnyHood_EarLength")) { if (ImGui::Button("Reset##BunnyHood_EarLength")) {
CVarClear("gCosmetics.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); UIWidgets::EnhancementSliderFloat("Bunny Hood Spread: %f", "##BunnyHood_EarSpread", "gCosmetics.BunnyHood_EarSpread", -300.0f, 500.0f, "", 0.0f, false);
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Reset##BunnyHood_EarSpread")) { if (ImGui::Button("Reset##BunnyHood_EarSpread")) {
CVarClear("gCosmetics.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); UIWidgets::EnhancementSliderFloat("Goron Neck Length: %f", "##Goron_NeckLength", "gCosmetics.Goron_NeckLength", 0.0f, 1000.0f, "", 0.0f, false);
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Reset##Goron_NeckLength")) { if (ImGui::Button("Reset##Goron_NeckLength")) {
CVarClear("gCosmetics.Goron_NeckLength"); CVarClear("gCosmetics.Goron_NeckLength");
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
UIWidgets::EnhancementCheckbox("Unfix Goron Spin", "gUnfixGoronSpin"); UIWidgets::EnhancementCheckbox("Unfix Goron Spin", "gUnfixGoronSpin");
UIWidgets::EnhancementSliderFloat("Fairies Size: %f", "##Fairies_Size", "gCosmetics.Fairies_Size", 0.25f, 5.0f, "", 1.0f, false); UIWidgets::EnhancementSliderFloat("Fairies Size: %f", "##Fairies_Size", "gCosmetics.Fairies_Size", 0.25f, 5.0f, "", 1.0f, false);
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Reset##Fairies_Size")) { if (ImGui::Button("Reset##Fairies_Size")) {
CVarClear("gCosmetics.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); UIWidgets::EnhancementSliderFloat("N64 Logo Spin Speed: %f", "##N64Logo_SpinSpeed", "gCosmetics.N64Logo_SpinSpeed", 0.25f, 5.0f, "", 1.0f, false);
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Reset##N64Logo_SpinSpeed")) { if (ImGui::Button("Reset##N64Logo_SpinSpeed")) {
CVarClear("gCosmetics.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); UIWidgets::EnhancementSliderFloat("Moon Size: %f", "##Moon_Size", "gCosmetics.Moon_Size", 0.5f, 2.0f, "", 1.0f, false);
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Reset##Moon_Size")) { if (ImGui::Button("Reset##Moon_Size")) {
CVarClear("gCosmetics.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)) { 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); CVarSetInteger("gCosmetics.Kak_Windmill_Speed.Changed", 1);
@ -1491,7 +1491,7 @@ void DrawSillyTab() {
if (ImGui::Button("Reset##Kak_Windmill_Speed")) { if (ImGui::Button("Reset##Kak_Windmill_Speed")) {
CVarClear("gCosmetics.Kak_Windmill_Speed.Value"); CVarClear("gCosmetics.Kak_Windmill_Speed.Value");
CVarClear("gCosmetics.Kak_Windmill_Speed.Changed"); CVarClear("gCosmetics.Kak_Windmill_Speed.Changed");
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
} }
@ -1599,7 +1599,7 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) {
CVarSetInteger((cosmeticOption.rainbowCvar), 0); CVarSetInteger((cosmeticOption.rainbowCvar), 0);
CVarSetInteger((cosmeticOption.changedCvar), 1); CVarSetInteger((cosmeticOption.changedCvar), 1);
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text(cosmeticOption.label.c_str()); ImGui::Text(cosmeticOption.label.c_str());
@ -1607,7 +1607,7 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) {
if (ImGui::Button(("Random##" + cosmeticOption.label).c_str())) { if (ImGui::Button(("Random##" + cosmeticOption.label).c_str())) {
RandomizeColor(cosmeticOption); RandomizeColor(cosmeticOption);
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
bool isRainbow = (bool)CVarGetInteger((cosmeticOption.rainbowCvar), 0); bool isRainbow = (bool)CVarGetInteger((cosmeticOption.rainbowCvar), 0);
@ -1615,20 +1615,20 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) {
CVarSetInteger((cosmeticOption.rainbowCvar), isRainbow); CVarSetInteger((cosmeticOption.rainbowCvar), isRainbow);
CVarSetInteger((cosmeticOption.changedCvar), 1); CVarSetInteger((cosmeticOption.changedCvar), 1);
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
bool isLocked = (bool)CVarGetInteger((cosmeticOption.lockedCvar), 0); bool isLocked = (bool)CVarGetInteger((cosmeticOption.lockedCvar), 0);
if (ImGui::Checkbox(("Locked##" + cosmeticOption.label).c_str(), &isLocked)) { if (ImGui::Checkbox(("Locked##" + cosmeticOption.label).c_str(), &isLocked)) {
CVarSetInteger((cosmeticOption.lockedCvar), isLocked); CVarSetInteger((cosmeticOption.lockedCvar), isLocked);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
if (CVarGetInteger((cosmeticOption.changedCvar), 0)) { if (CVarGetInteger((cosmeticOption.changedCvar), 0)) {
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(("Reset##" + cosmeticOption.label).c_str())) { if (ImGui::Button(("Reset##" + cosmeticOption.label).c_str())) {
ResetColor(cosmeticOption); ResetColor(cosmeticOption);
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
} }
} }
@ -1644,7 +1644,7 @@ void DrawCosmeticGroup(CosmeticGroup cosmeticGroup) {
} }
} }
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(("Reset##" + label).c_str())) { if (ImGui::Button(("Reset##" + label).c_str())) {
@ -1654,7 +1654,7 @@ void DrawCosmeticGroup(CosmeticGroup cosmeticGroup) {
} }
} }
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
for (auto& [id, cosmeticOption] : cosmeticOptions) { for (auto& [id, cosmeticOption] : cosmeticOptions) {
if (cosmeticOption.group == cosmeticGroup && (!cosmeticOption.advancedOption || CVarGetInteger("gCosmetics.AdvancedMode", 0))) { if (cosmeticOption.group == cosmeticGroup && (!cosmeticOption.advancedOption || CVarGetInteger("gCosmetics.AdvancedMode", 0))) {
@ -1691,7 +1691,7 @@ void DrawCosmeticsEditor(bool& open) {
CVarSetInteger(cosmeticOption.lockedCvar, 1); CVarSetInteger(cosmeticOption.lockedCvar, 1);
} }
} }
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Unlock All Advanced", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) { if (ImGui::Button("Unlock All Advanced", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) {
@ -1700,7 +1700,7 @@ void DrawCosmeticsEditor(bool& open) {
CVarSetInteger(cosmeticOption.lockedCvar, 0); CVarSetInteger(cosmeticOption.lockedCvar, 0);
} }
} }
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
} }
UIWidgets::EnhancementCheckbox("Sync Rainbow colors", "gCosmetics.RainbowSync"); UIWidgets::EnhancementCheckbox("Sync Rainbow colors", "gCosmetics.RainbowSync");
@ -1712,7 +1712,7 @@ void DrawCosmeticsEditor(bool& open) {
} }
} }
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Reset All", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) { if (ImGui::Button("Reset All", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) {
@ -1722,7 +1722,7 @@ void DrawCosmeticsEditor(bool& open) {
} }
} }
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
if (ImGui::Button("Lock All", ImVec2(ImGui::GetContentRegionAvail().x / 2, 30.0f))) { if (ImGui::Button("Lock All", ImVec2(ImGui::GetContentRegionAvail().x / 2, 30.0f))) {
@ -1731,7 +1731,7 @@ void DrawCosmeticsEditor(bool& open) {
CVarSetInteger(cosmeticOption.lockedCvar, 1); CVarSetInteger(cosmeticOption.lockedCvar, 1);
} }
} }
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Unlock All", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) { if (ImGui::Button("Unlock All", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) {
@ -1740,7 +1740,7 @@ void DrawCosmeticsEditor(bool& open) {
CVarSetInteger(cosmeticOption.lockedCvar, 0); CVarSetInteger(cosmeticOption.lockedCvar, 0);
} }
} }
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
if (ImGui::BeginTabBar("CosmeticsContextTabBar", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) { if (ImGui::BeginTabBar("CosmeticsContextTabBar", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) {
@ -1765,7 +1765,7 @@ void DrawCosmeticsEditor(bool& open) {
if (ImGui::Button("Reset##Trails_Duration")) { if (ImGui::Button("Reset##Trails_Duration")) {
CVarClear("gCosmetics.Trails_Duration.Value"); CVarClear("gCosmetics.Trails_Duration.Value");
CVarClear("gCosmetics.Trails_Duration.Changed"); CVarClear("gCosmetics.Trails_Duration.Changed");
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
@ -1802,10 +1802,10 @@ void RegisterOnLoadGameHook() {
void InitCosmeticsEditor() { void InitCosmeticsEditor() {
// There's probably a better way to do this, but leaving as is for historical reasons. Even though there is no // 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 // 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. // 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 // Convert the `current color` into the format that the ImGui color picker expects
for (auto& [id, cosmeticOption] : cosmeticOptions) { for (auto& [id, cosmeticOption] : cosmeticOptions) {
Color_RGBA8 defaultColor = {cosmeticOption.defaultColor.x, cosmeticOption.defaultColor.y, cosmeticOption.defaultColor.z, cosmeticOption.defaultColor.w}; 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.z = cvarColor.b / 255.0;
cosmeticOption.currentColor.w = cvarColor.a / 255.0; cosmeticOption.currentColor.w = cvarColor.a / 255.0;
} }
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
ApplyAuthenticGfxPatches(); ApplyAuthenticGfxPatches();
@ -1831,7 +1831,7 @@ void CosmeticsEditor_RandomizeAll() {
} }
} }
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
} }
@ -1842,6 +1842,6 @@ void CosmeticsEditor_ResetAll() {
} }
} }
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
} }

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>
#include <cstdint>
#include "../../../include/z64item.h" #include "../../../include/z64item.h"
#include "../../../include/message_data_textbox_types.h" #include "../../../include/message_data_textbox_types.h"

File diff suppressed because it is too large Load Diff

View File

@ -787,5 +787,5 @@ void DrawActorViewer(bool& open) {
} }
void InitActorViewer() { void InitActorViewer() {
SohImGui::AddWindow("Developer Tools", "Actor Viewer", DrawActorViewer); Ship::AddWindow("Developer Tools", "Actor Viewer", DrawActorViewer);
} }

View File

@ -288,7 +288,7 @@ void CreateSphereData() {
} }
void InitColViewer() { void InitColViewer() {
SohImGui::AddWindow("Developer Tools", "Collision Viewer", DrawColViewerWindow); Ship::AddWindow("Developer Tools", "Collision Viewer", DrawColViewerWindow);
CreateCylinderData(); CreateCylinderData();
CreateSphereData(); CreateSphereData();

View File

@ -21,6 +21,7 @@ extern PlayState* gPlayState;
#include "textures/icon_item_static/icon_item_static.h" #include "textures/icon_item_static/icon_item_static.h"
#include "textures/icon_item_24_static/icon_item_24_static.h" #include "textures/icon_item_24_static/icon_item_24_static.h"
#include "textures/parameter_static/parameter_static.h"
} }
typedef struct { typedef struct {
@ -140,7 +141,7 @@ std::map<uint32_t, ItemMapEntry> itemMapping = {
}; };
std::map<uint32_t, ItemMapEntry> gregMapping = { std::map<uint32_t, ItemMapEntry> 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 // Maps entries in the GS flag array to the area name it represents
@ -604,7 +605,7 @@ void DrawInfoTab() {
void DrawBGSItemFlag(uint8_t itemID) { void DrawBGSItemFlag(uint8_t itemID) {
const ItemMapEntry& slotEntry = itemMapping[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(); ImGui::SameLine();
int tradeIndex = itemID - ITEM_POCKET_EGG; int tradeIndex = itemID - ITEM_POCKET_EGG;
bool hasItem = (gSaveContext.adultTradeItems & (1 << tradeIndex)) != 0; bool hasItem = (gSaveContext.adultTradeItems & (1 << tradeIndex)) != 0;
@ -646,7 +647,7 @@ void DrawInventoryTab() {
uint8_t item = gSaveContext.inventory.items[index]; uint8_t item = gSaveContext.inventory.items[index];
if (item != ITEM_NONE) { if (item != ITEM_NONE) {
const ItemMapEntry& slotEntry = itemMapping.find(item)->second; 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)) { ImVec2(1, 1), 0)) {
selectedIndex = index; selectedIndex = index;
ImGui::OpenPopup(itemPopupPicker); ImGui::OpenPopup(itemPopupPicker);
@ -694,7 +695,7 @@ void DrawInventoryTab() {
ImGui::SameLine(); ImGui::SameLine();
} }
const ItemMapEntry& slotEntry = possibleItems[pickerIndex]; 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)) { ImVec2(0, 0), ImVec2(1, 1), 0)) {
gSaveContext.inventory.items[selectedIndex] = slotEntry.id; gSaveContext.inventory.items[selectedIndex] = slotEntry.id;
// Set adult trade item flag if you're playing adult trade shuffle in rando // 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::PushItemWidth(32.0f);
ImGui::BeginGroup(); 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::InputScalar("##ammoInput", ImGuiDataType_S8, &AMMO(item));
ImGui::EndGroup(); ImGui::EndGroup();
@ -1147,7 +1148,7 @@ void DrawUpgradeIcon(const std::string& categoryName, int32_t categoryId, const
uint8_t item = items[CUR_UPG_VALUE(categoryId)]; uint8_t item = items[CUR_UPG_VALUE(categoryId)];
if (item != ITEM_NONE) { if (item != ITEM_NONE) {
const ItemMapEntry& slotEntry = itemMapping[item]; 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)) { ImVec2(1, 1), 0)) {
ImGui::OpenPopup(upgradePopupPicker); ImGui::OpenPopup(upgradePopupPicker);
} }
@ -1175,7 +1176,7 @@ void DrawUpgradeIcon(const std::string& categoryName, int32_t categoryId, const
UIWidgets::SetLastItemHoverText("None"); UIWidgets::SetLastItemHoverText("None");
} else { } else {
const ItemMapEntry& slotEntry = itemMapping[items[pickerIndex]]; 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)) { ImVec2(1, 1), 0)) {
Inventory_ChangeUpgrade(categoryId, pickerIndex); Inventory_ChangeUpgrade(categoryId, pickerIndex);
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
@ -1212,7 +1213,7 @@ void DrawEquipmentTab() {
bool hasEquip = (bitMask & gSaveContext.inventory.equipment) != 0; bool hasEquip = (bitMask & gSaveContext.inventory.equipment) != 0;
const ItemMapEntry& entry = itemMapping[equipmentValues[i]]; const ItemMapEntry& entry = itemMapping[equipmentValues[i]];
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); 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)) { ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) {
if (hasEquip) { if (hasEquip) {
gSaveContext.inventory.equipment &= ~bitMask; gSaveContext.inventory.equipment &= ~bitMask;
@ -1311,7 +1312,7 @@ void DrawQuestItemButton(uint32_t item) {
uint32_t bitMask = 1 << entry.id; uint32_t bitMask = 1 << entry.id;
bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 0; bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 0;
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 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)) { ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) {
if (hasQuestItem) { if (hasQuestItem) {
gSaveContext.inventory.questItems &= ~bitMask; 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 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; bool hasItem = (bitMask & gSaveContext.inventory.dungeonItems[scene]) != 0;
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 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)) { ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) {
if (hasItem) { if (hasItem) {
gSaveContext.inventory.dungeonItems[scene] &= ~bitMask; gSaveContext.inventory.dungeonItems[scene] &= ~bitMask;
@ -1376,7 +1377,7 @@ void DrawQuestStatusTab() {
uint32_t bitMask = 1 << entry.id; uint32_t bitMask = 1 << entry.id;
bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 0; bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 0;
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 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)) { ImVec2(16.0f, 24.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) {
if (hasQuestItem) { if (hasQuestItem) {
gSaveContext.inventory.questItems &= ~bitMask; gSaveContext.inventory.questItems &= ~bitMask;
@ -1439,7 +1440,7 @@ void DrawQuestStatusTab() {
if (dungeonItemsScene != SCENE_BDAN_BOSS) { if (dungeonItemsScene != SCENE_BDAN_BOSS) {
float lineHeight = ImGui::GetTextLineHeightWithSpacing(); 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(); ImGui::SameLine();
if (ImGui::InputScalar("##Keys", ImGuiDataType_S8, gSaveContext.inventory.dungeonKeys + dungeonItemsScene)) { if (ImGui::InputScalar("##Keys", ImGuiDataType_S8, gSaveContext.inventory.dungeonKeys + dungeonItemsScene)) {
gSaveContext.sohStats.dungeonKeys[dungeonItemsScene] = gSaveContext.inventory.dungeonKeys[dungeonItemsScene]; gSaveContext.sohStats.dungeonKeys[dungeonItemsScene] = gSaveContext.inventory.dungeonKeys[dungeonItemsScene];
@ -1780,34 +1781,34 @@ void DrawSaveEditor(bool& open) {
} }
void InitSaveEditor() { void InitSaveEditor() {
SohImGui::AddWindow("Developer Tools", "Save Editor", DrawSaveEditor); Ship::AddWindow("Developer Tools", "Save Editor", DrawSaveEditor);
// Load item icons into ImGui // Load item icons into ImGui
for (const auto& entry : itemMapping) { for (const auto& entry : itemMapping) {
SohImGui::LoadResource(entry.second.name, entry.second.texturePath); Ship::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.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
} }
for (const auto& entry : gregMapping) { for (const auto& entry : gregMapping) {
ImVec4 gregGreen = ImVec4(42.0f / 255.0f, 169.0f / 255.0f, 40.0f / 255.0f, 1.0f); ImVec4 gregGreen = ImVec4(42.0f / 255.0f, 169.0f / 255.0f, 40.0f / 255.0f, 1.0f);
ImVec4 gregFadedGreen = gregGreen; ImVec4 gregFadedGreen = gregGreen;
gregFadedGreen.w = 0.3f; gregFadedGreen.w = 0.3f;
SohImGui::LoadResource(entry.second.name, entry.second.texturePath, gregGreen); Ship::LoadResource(entry.second.name, entry.second.texturePath, gregGreen);
SohImGui::LoadResource(entry.second.nameFaded, entry.second.texturePath, gregFadedGreen); Ship::LoadResource(entry.second.nameFaded, entry.second.texturePath, gregFadedGreen);
} }
for (const auto& entry : questMapping) { for (const auto& entry : questMapping) {
SohImGui::LoadResource(entry.second.name, entry.second.texturePath); Ship::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.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
} }
for (const auto& entry : songMapping) { for (const auto& entry : songMapping) {
SohImGui::LoadResource(entry.name, gSongNoteTex, entry.color); Ship::LoadResource(entry.name, gSongNoteTex, entry.color);
ImVec4 fadedCol = entry.color; ImVec4 fadedCol = entry.color;
fadedCol.w = 0.3f; fadedCol.w = 0.3f;
SohImGui::LoadResource(entry.nameFaded, gSongNoteTex, fadedCol); Ship::LoadResource(entry.nameFaded, gSongNoteTex, fadedCol);
} }
for (const auto& entry : vanillaSongMapping) { for (const auto& entry : vanillaSongMapping) {
SohImGui::LoadResource(entry.name, gSongNoteTex, entry.color); Ship::LoadResource(entry.name, gSongNoteTex, entry.color);
ImVec4 fadedCol = entry.color; ImVec4 fadedCol = entry.color;
fadedCol.w = 0.3f; fadedCol.w = 0.3f;
SohImGui::LoadResource(entry.nameFaded, gSongNoteTex, fadedCol); Ship::LoadResource(entry.nameFaded, gSongNoteTex, fadedCol);
} }
} }

View File

@ -4,6 +4,7 @@
#include <map> #include <map>
#include <string> #include <string>
#include <vector> #include <vector>
#include <cstdint>
#include <soh/Enhancements/randomizer/randomizer_inf.h> #include <soh/Enhancements/randomizer/randomizer_inf.h>
void InitSaveEditor(); void InitSaveEditor();

View File

@ -2,7 +2,7 @@
#include "../../util.h" #include "../../util.h"
#include "../../UIWidgets.hpp" #include "../../UIWidgets.hpp"
#include <ImGuiImpl.h> #include <ImGuiImpl.h>
#include "ResourceMgr.h" #include "ResourceManager.h"
#include "DisplayList.h" #include "DisplayList.h"
#include "../../OTRGlobals.h" #include "../../OTRGlobals.h"
@ -138,7 +138,7 @@ void DrawDLViewer(bool& open) {
} }
void InitDLViewer() { void InitDLViewer() {
SohImGui::AddWindow("Developer Tools", "Display List Viewer", DrawDLViewer); Ship::AddWindow("Developer Tools", "Display List Viewer", DrawDLViewer);
displayListsSearchResults = ResourceMgr_ListFiles("*DL", &displayListsSearchResultsCount); displayListsSearchResults = ResourceMgr_ListFiles("*DL", &displayListsSearchResultsCount);
} }

View File

@ -335,7 +335,7 @@ void GameInteractor::RawAction::SetCosmeticsColor(uint8_t cosmeticCategory, uint
break; break;
} }
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
} }

View File

@ -665,7 +665,8 @@ void SetupDisplayColors() {
} }
void InitStatTracker() { void InitStatTracker() {
SohImGui::AddWindow("Enhancements", "Gameplay Stats", DrawStatsTracker, CVarGetInteger("gGameplayStatsEnabled", 0) == 1); Ship::AddWindow("Enhancements", "Gameplay Stats", DrawStatsTracker,
CVarGetInteger("gGameplayStatsEnabled", 0) == 1);
SetupDisplayNames(); SetupDisplayNames();
SetupDisplayColors(); SetupDisplayColors();
} }

View File

@ -59,7 +59,7 @@ void DrawPresetSelector(PresetType presetTypeId) {
if (selectedPresetId != 0) { if (selectedPresetId != 0) {
applyPreset(selectedPresetDef.entries); applyPreset(selectedPresetDef.entries);
} }
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
ImGui::PopStyleVar(1); ImGui::PopStyleVar(1);
} }

View File

@ -3,6 +3,7 @@
#include <array> #include <array>
#include <string> #include <string>
#include <vector> #include <vector>
#include <cstdint>
namespace Cosmetics { namespace Cosmetics {
constexpr std::string_view RANDOM_CHOICE_STR = "Random Choice"; constexpr std::string_view RANDOM_CHOICE_STR = "Random Choice";

View File

@ -3,6 +3,7 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include <vector> #include <vector>
#include <cstdint>
#include "text.hpp" #include "text.hpp"

View File

@ -3,6 +3,7 @@
#include <array> #include <array>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <cstdint>
using RandomizerHash = std::array<std::string, 5>; using RandomizerHash = std::array<std::string, 5>;

View File

@ -4361,7 +4361,7 @@ void DrawRandoEditor(bool& open) {
excludedLocationString += ","; excludedLocationString += ",";
} }
CVarSetString("gRandomizeExcludedLocations", excludedLocationString.c_str()); CVarSetString("gRandomizeExcludedLocations", excludedLocationString.c_str());
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text(rcObject->rcShortName.c_str()); ImGui::Text(rcObject->rcShortName.c_str());
@ -4402,7 +4402,7 @@ void DrawRandoEditor(bool& open) {
excludedLocationString += ","; excludedLocationString += ",";
} }
CVarSetString("gRandomizeExcludedLocations", excludedLocationString.c_str()); CVarSetString("gRandomizeExcludedLocations", excludedLocationString.c_str());
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text(rcObject->rcShortName.c_str()); ImGui::Text(rcObject->rcShortName.c_str());
@ -5443,7 +5443,7 @@ void InitRandoItemTable() {
void InitRando() { void InitRando() {
SohImGui::AddWindow("Randomizer", "Randomizer Settings", DrawRandoEditor); Ship::AddWindow("Randomizer", "Randomizer Settings", DrawRandoEditor);
Randomizer::CreateCustomMessages(); Randomizer::CreateCustomMessages();
seedString = (char*)calloc(MAX_SEED_STRING_SIZE, sizeof(char)); seedString = (char*)calloc(MAX_SEED_STRING_SIZE, sizeof(char));
InitRandoItemTable(); InitRandoItemTable();

View File

@ -1023,8 +1023,8 @@ void DrawCheckTrackerOptions(bool& open) {
} }
void InitCheckTracker() { void InitCheckTracker() {
SohImGui::AddWindow("Randomizer", "Check Tracker", DrawCheckTracker, CVarGetInteger("gCheckTrackerEnabled", 0) == 1); Ship::AddWindow("Randomizer", "Check Tracker", DrawCheckTracker, CVarGetInteger("gCheckTrackerEnabled", 0) == 1);
SohImGui::AddWindow("Randomizer", "Check Tracker Settings", DrawCheckTrackerOptions); Ship::AddWindow("Randomizer", "Check Tracker Settings", DrawCheckTrackerOptions);
Color_Background = CVarGetColor("gCheckTrackerBgColor", Color_Bg_Default); Color_Background = CVarGetColor("gCheckTrackerBgColor", Color_Bg_Default);
Color_Area_Incomplete_Main = CVarGetColor("gCheckTrackerAreaMainIncompleteColor", Color_Main_Default); Color_Area_Incomplete_Main = CVarGetColor("gCheckTrackerAreaMainIncompleteColor", Color_Main_Default);
Color_Area_Incomplete_Extra = CVarGetColor("gCheckTrackerAreaExtraIncompleteColor", Color_Area_Incomplete_Extra_Default); Color_Area_Incomplete_Extra = CVarGetColor("gCheckTrackerAreaExtraIncompleteColor", Color_Area_Incomplete_Extra_Default);

View File

@ -919,7 +919,8 @@ void DrawEntranceTracker(bool& open) {
} }
void InitEntranceTracker() { 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 // Setup hooks for loading and clearing the entrance tracker data
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnLoadGame>([](int32_t fileNum) { GameInteractor::Instance->RegisterGameHook<GameInteractor::OnLoadGame>([](int32_t fileNum) {

View File

@ -2,6 +2,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <cstdint>
typedef enum { typedef enum {
// ENTRANCE_GROUP_NO_GROUP, // ENTRANCE_GROUP_NO_GROUP,

View File

@ -452,7 +452,7 @@ void DrawItemCount(ItemTrackerItem item) {
void DrawEquip(ItemTrackerItem item) { void DrawEquip(ItemTrackerItem item) {
bool hasEquip = (item.data & gSaveContext.inventory.equipment) != 0; bool hasEquip = (item.data & gSaveContext.inventory.equipment) != 0;
int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); 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)); ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id)); UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id));
@ -462,7 +462,7 @@ void DrawQuest(ItemTrackerItem item) {
bool hasQuestItem = (item.data & gSaveContext.inventory.questItems) != 0; bool hasQuestItem = (item.data & gSaveContext.inventory.questItems) != 0;
int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); int iconSize = CVarGetInteger("gItemTrackerIconSize", 36);
ImGui::BeginGroup(); 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)); ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
if (item.id == QUEST_SKULL_TOKEN) { if (item.id == QUEST_SKULL_TOKEN) {
@ -524,7 +524,7 @@ void DrawItem(ItemTrackerItem item) {
} }
ImGui::BeginGroup(); 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)); ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
DrawItemCount(item); DrawItemCount(item);
@ -542,7 +542,7 @@ void DrawBottle(ItemTrackerItem item) {
} }
int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); 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)); ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id)); UIWidgets::SetLastItemHoverText(SohUtils::GetItemName(item.id));
@ -557,11 +557,11 @@ void DrawDungeonItem(ItemTrackerItem item) {
bool hasSmallKey = (gSaveContext.inventory.dungeonKeys[item.data]) >= 0; bool hasSmallKey = (gSaveContext.inventory.dungeonKeys[item.data]) >= 0;
ImGui::BeginGroup(); ImGui::BeginGroup();
if (itemId == ITEM_KEY_SMALL) { 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)); ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
} }
else { 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)); ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
} }
@ -601,7 +601,7 @@ void DrawSong(ItemTrackerItem item) {
bool hasSong = (bitMask & gSaveContext.inventory.questItems) != 0; bool hasSong = (bitMask & gSaveContext.inventory.questItems) != 0;
ImVec2 p = ImGui::GetCursorScreenPos(); ImVec2 p = ImGui::GetCursorScreenPos();
ImGui::SetCursorScreenPos(ImVec2(p.x + 6, p.y)); 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)); ImVec2(iconSize / 1.5, iconSize), ImVec2(0, 0), ImVec2(1, 1));
UIWidgets::SetLastItemHoverText(SohUtils::GetQuestItemName(item.id)); UIWidgets::SetLastItemHoverText(SohUtils::GetQuestItemName(item.id));
} }
@ -637,7 +637,7 @@ void DrawNotes(bool resizeable = false) {
ItemTrackerNotes::TrackerNotesInputTextMultiline("##ItemTrackerNotes", &itemTrackerNotes, size, ImGuiInputTextFlags_AllowTabInput); ItemTrackerNotes::TrackerNotesInputTextMultiline("##ItemTrackerNotes", &itemTrackerNotes, size, ImGuiInputTextFlags_AllowTabInput);
if (ImGui::IsItemDeactivatedAfterEdit() && IsValidSaveFile()) { if (ImGui::IsItemDeactivatedAfterEdit() && IsValidSaveFile()) {
CVarSetString(("gItemTrackerNotes" + std::to_string(gSaveContext.fileNum)).c_str(), std::string(std::begin(itemTrackerNotes), std::end(itemTrackerNotes)).c_str()); 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(); ImGui::EndGroup();
} }
@ -985,7 +985,7 @@ void DrawItemTrackerOptions(bool& open) {
CVarSetFloat("gItemTrackerBgColorG", ChromaKeyBackground.y); CVarSetFloat("gItemTrackerBgColorG", ChromaKeyBackground.y);
CVarSetFloat("gItemTrackerBgColorB", ChromaKeyBackground.z); CVarSetFloat("gItemTrackerBgColorB", ChromaKeyBackground.z);
CVarSetFloat("gItemTrackerBgColorA", ChromaKeyBackground.w); CVarSetFloat("gItemTrackerBgColorA", ChromaKeyBackground.w);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
ImGui::PopItemWidth(); ImGui::PopItemWidth();
@ -1081,8 +1081,8 @@ void DrawItemTrackerOptions(bool& open) {
} }
void InitItemTracker() { void InitItemTracker() {
SohImGui::AddWindow("Randomizer", "Item Tracker", DrawItemTracker, CVarGetInteger("gItemTrackerEnabled", 0) == 1); Ship::AddWindow("Randomizer", "Item Tracker", DrawItemTracker, CVarGetInteger("gItemTrackerEnabled", 0) == 1);
SohImGui::AddWindow("Randomizer", "Item Tracker Settings", DrawItemTrackerOptions); Ship::AddWindow("Randomizer", "Item Tracker Settings", DrawItemTrackerOptions);
float trackerBgR = CVarGetFloat("gItemTrackerBgColorR", 0); float trackerBgR = CVarGetFloat("gItemTrackerBgColorR", 0);
float trackerBgG = CVarGetFloat("gItemTrackerBgColorG", 0); float trackerBgG = CVarGetFloat("gItemTrackerBgColorG", 0);
float trackerBgB = CVarGetFloat("gItemTrackerBgColorB", 0); float trackerBgB = CVarGetFloat("gItemTrackerBgColorB", 0);
@ -1107,6 +1107,6 @@ void InitItemTracker() {
}); });
Ship::RegisterHook<Ship::DeleteFile>([](uint32_t fileNum) { Ship::RegisterHook<Ship::DeleteFile>([](uint32_t fileNum) {
CVarSetString(("gItemTrackerNotes" + std::to_string(fileNum)).c_str(), ""); CVarSetString(("gItemTrackerNotes" + std::to_string(fileNum)).c_str(), "");
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
}); });
} }

View File

@ -2,6 +2,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <cstdint>
void InitItemTracker(); void InitItemTracker();
void DrawItemTracker(bool& open); void DrawItemTracker(bool& open);

View File

@ -837,7 +837,7 @@ extern "C" void ProcessSaveStateRequests(void) {
} }
void SaveStateMgr::SetCurrentSlot(unsigned int slot) { 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; this->currentSlot = slot;
} }
@ -855,12 +855,12 @@ void SaveStateMgr::ProcessSaveStateRequests(void) {
this->states[request.slot] = std::make_shared<SaveState>(OTRGlobals::Instance->gSaveStateMgr, request.slot); this->states[request.slot] = std::make_shared<SaveState>(OTRGlobals::Instance->gSaveStateMgr, request.slot);
} }
this->states[request.slot]->Save(); 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; break;
case RequestType::LOAD: case RequestType::LOAD:
if (this->states.contains(request.slot)) { if (this->states.contains(request.slot)) {
this->states[request.slot]->Load(); 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 { } else {
SPDLOG_ERROR("Invalid SaveState slot: {}", request.type); SPDLOG_ERROR("Invalid SaveState slot: {}", request.type);
} }
@ -876,7 +876,7 @@ void SaveStateMgr::ProcessSaveStateRequests(void) {
SaveStateReturn SaveStateMgr::AddRequest(const SaveStateRequest request) { SaveStateReturn SaveStateMgr::AddRequest(const SaveStateRequest request) {
if (gPlayState == nullptr) { if (gPlayState == nullptr) {
SPDLOG_ERROR("[SOH] Can not save or load a state outside of \"GamePlay\""); 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; return SaveStateReturn::FAIL_WRONG_GAMESTATE;
} }
@ -890,7 +890,7 @@ SaveStateReturn SaveStateMgr::AddRequest(const SaveStateRequest request) {
return SaveStateReturn::SUCCESS; return SaveStateReturn::SUCCESS;
} else { } else {
SPDLOG_ERROR("Invalid SaveState slot: {}", request.type); 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; return SaveStateReturn::FAIL_INVALID_SLOT;
} }
[[unlikely]] default: [[unlikely]] default:

View File

@ -1,7 +1,7 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/speechsynthesizer/SpeechSynthesizer.h" #include "soh/Enhancements/speechsynthesizer/SpeechSynthesizer.h"
#include <OtrFile.h> #include <File.h>
#include <libultraship/classes.h> #include <libultraship/classes.h>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
#include <spdlog/fmt/fmt.h> #include <spdlog/fmt/fmt.h>

View File

@ -429,13 +429,11 @@ extern "C" int zapd_main(int argc, char** argv);
bool Extractor::CallZapd() { bool Extractor::CallZapd() {
constexpr int argc = 16; constexpr int argc = 16;
char xmlPath[100]; char xmlPath[100];
char baseromPath[100];
char confPath[100]; char confPath[100];
std::array<const char*, argc> argv; std::array<const char*, argc> argv;
const char* version = GetZapdVerStr(); const char* version = GetZapdVerStr();
snprintf(xmlPath, 100, "assets/extractor/xmls/%s", version); snprintf(xmlPath, 100, "assets/extractor/xmls/%s", version);
snprintf(baseromPath, 100, "%s", mCurrentRomPath.c_str());
snprintf(confPath, 100, "assets/extractor/Config_%s.xml", version); snprintf(confPath, 100, "assets/extractor/Config_%s.xml", version);
argv[0] = "ZAPD"; argv[0] = "ZAPD";
@ -443,7 +441,7 @@ bool Extractor::CallZapd() {
argv[2] = "-i"; argv[2] = "-i";
argv[3] = xmlPath; argv[3] = xmlPath;
argv[4] = "-b"; argv[4] = "-b";
argv[5] = baseromPath; argv[5] = mCurrentRomPath.c_str();
argv[6] = "-fl"; argv[6] = "-fl";
argv[7] = "assets/extractor/filelists"; argv[7] = "assets/extractor/filelists";
argv[8] = "-gsf"; argv[8] = "-gsf";

View File

@ -131,8 +131,8 @@ namespace GameMenuBar {
} }
ImGui::Text("Audio API (Needs reload)"); ImGui::Text("Audio API (Needs reload)");
auto audioBackends = SohImGui::GetAvailableAudioBackends(); auto audioBackends = Ship::GetAvailableAudioBackends();
auto currentAudioBackend = SohImGui::GetCurrentAudioBackend(); auto currentAudioBackend = Ship::GetCurrentAudioBackend();
if (audioBackends.size() <= 1) { if (audioBackends.size() <= 1) {
UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f); UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f);
@ -140,7 +140,7 @@ namespace GameMenuBar {
if (ImGui::BeginCombo("##AApi", currentAudioBackend.second)) { if (ImGui::BeginCombo("##AApi", currentAudioBackend.second)) {
for (uint8_t i = 0; i < audioBackends.size(); i++) { for (uint8_t i = 0; i < audioBackends.size(); i++) {
if (ImGui::Selectable(audioBackends[i].second, audioBackends[i] == currentAudioBackend)) { 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); bool currentValue = CVarGetInteger("gControllerConfigurationEnabled", 0);
CVarSetInteger("gControllerConfigurationEnabled", !currentValue); CVarSetInteger("gControllerConfigurationEnabled", !currentValue);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
SohImGui::ToggleInputEditorWindow(CVarGetInteger("gControllerConfigurationEnabled", 0)); Ship::ToggleInputEditorWindow(CVarGetInteger("gControllerConfigurationEnabled", 0));
} }
UIWidgets::PaddedSeparator(); UIWidgets::PaddedSeparator();
ImGui::PopStyleColor(1); ImGui::PopStyleColor(1);
@ -190,18 +190,18 @@ namespace GameMenuBar {
#ifndef __APPLE__ #ifndef __APPLE__
UIWidgets::EnhancementSliderFloat("Internal Resolution: %d %%", "##IMul", "gInternalResolution", 0.5f, 2.0f, "", 1.0f, true); 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"); 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 #endif
#ifndef __WIIU__ #ifndef __WIIU__
UIWidgets::PaddedEnhancementSliderInt("MSAA: %d", "##IMSAA", "gMSAAValue", 1, 8, "", 1, true, true, false); 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"); 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 #endif
{ // FPS Slider { // FPS Slider
const int minFps = 20; const int minFps = 20;
static int maxFps; static int maxFps;
if (SohImGui::WindowBackend() == SohImGui::Backend::DX11) { if (Ship::WindowBackend() == Ship::Backend::DX11) {
maxFps = 360; maxFps = 360;
} else { } else {
maxFps = Ship::Window::GetInstance()->GetCurrentRefreshRate(); maxFps = Ship::Window::GetInstance()->GetCurrentRefreshRate();
@ -264,15 +264,15 @@ namespace GameMenuBar {
currentFps = 60; currentFps = 60;
} }
CVarSetInteger("gInterpolationFPS", currentFps); CVarSetInteger("gInterpolationFPS", currentFps);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
#else #else
bool matchingRefreshRate = bool matchingRefreshRate =
CVarGetInteger("gMatchRefreshRate", 0) && SohImGui::WindowBackend() != SohImGui::Backend::DX11; CVarGetInteger("gMatchRefreshRate", 0) && Ship::WindowBackend() != Ship::Backend::DX11;
UIWidgets::PaddedEnhancementSliderInt( UIWidgets::PaddedEnhancementSliderInt(
(currentFps == 20) ? "FPS: Original (20)" : "FPS: %d", (currentFps == 20) ? "FPS: Original (20)" : "FPS: %d",
"##FPSInterpolation", "gInterpolationFPS", minFps, maxFps, "", 20, true, true, false, matchingRefreshRate); "##FPSInterpolation", "gInterpolationFPS", minFps, maxFps, "", 20, true, true, false, matchingRefreshRate);
#endif #endif
if (SohImGui::WindowBackend() == SohImGui::Backend::DX11) { if (Ship::WindowBackend() == Ship::Backend::DX11) {
UIWidgets::Tooltip( UIWidgets::Tooltip(
"Uses Matrix Interpolation to create extra frames, resulting in smoother graphics. This is purely " "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" "visual and does not impact game logic, execution of glitches etc.\n\n"
@ -286,13 +286,13 @@ namespace GameMenuBar {
} }
} // END FPS Slider } // END FPS Slider
if (SohImGui::WindowBackend() == SohImGui::Backend::DX11) { if (Ship::WindowBackend() == Ship::Backend::DX11) {
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button("Match Refresh Rate")) { if (ImGui::Button("Match Refresh Rate")) {
int hz = Ship::Window::GetInstance()->GetCurrentRefreshRate(); int hz = Ship::Window::GetInstance()->GetCurrentRefreshRate();
if (hz >= 20 && hz <= 360) { if (hz >= 20 && hz <= 360) {
CVarSetInteger("gInterpolationFPS", hz); CVarSetInteger("gInterpolationFPS", hz);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
} }
} else { } else {
@ -300,7 +300,7 @@ namespace GameMenuBar {
} }
UIWidgets::Tooltip("Matches interpolation value to the current game's window refresh rate"); 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", UIWidgets::PaddedEnhancementSliderInt(CVarGetInteger("gExtraLatencyThreshold", 80) == 0 ? "Jitter fix: Off" : "Jitter fix: >= %d FPS",
"##ExtraLatencyThreshold", "gExtraLatencyThreshold", 0, 360, "", 80, true, true, false); "##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."); 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); UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f);
ImGui::Text("Renderer API (Needs reload)"); ImGui::Text("Renderer API (Needs reload)");
auto renderingBackends = SohImGui::GetAvailableRenderingBackends(); auto renderingBackends = Ship::GetAvailableRenderingBackends();
auto currentRenderingBackend = SohImGui::GetCurrentRenderingBackend(); auto currentRenderingBackend = Ship::GetCurrentRenderingBackend();
if (renderingBackends.size() <= 1) { if (renderingBackends.size() <= 1) {
UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f); UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f);
@ -318,7 +318,7 @@ namespace GameMenuBar {
if (ImGui::BeginCombo("##RApi", currentRenderingBackend.second)) { if (ImGui::BeginCombo("##RApi", currentRenderingBackend.second)) {
for (uint8_t i = 0; i < renderingBackends.size(); i++) { for (uint8_t i = 0; i < renderingBackends.size(); i++) {
if (ImGui::Selectable(renderingBackends[i].second, renderingBackends[i] == currentRenderingBackend)) { 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); UIWidgets::PaddedEnhancementCheckbox("Enable Vsync", "gVsyncEnabled", true, false);
} }
if (SohImGui::SupportsWindowedFullscreen()) { if (Ship::SupportsWindowedFullscreen()) {
UIWidgets::PaddedEnhancementCheckbox("Windowed fullscreen", "gSdlWindowedFullscreen", true, false); UIWidgets::PaddedEnhancementCheckbox("Windowed fullscreen", "gSdlWindowedFullscreen", true, false);
} }
if (SohImGui::SupportsViewports()) { if (Ship::SupportsViewports()) {
UIWidgets::PaddedEnhancementCheckbox("Allow multi-windows", "gEnableMultiViewports", true, false); 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."); 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 // If more filters are added to LUS, make sure to add them to the filters list here
ImGui::Text("Texture Filter (Needs reload)"); ImGui::Text("Texture Filter (Needs reload)");
const char* filters[] = { SohImGui::GetSupportedTextureFilters()[0], const char* filters[] = { Ship::GetSupportedTextureFilters()[0], Ship::GetSupportedTextureFilters()[1],
SohImGui::GetSupportedTextureFilters()[1], Ship::GetSupportedTextureFilters()[2] };
SohImGui::GetSupportedTextureFilters()[2] };
UIWidgets::EnhancementCombobox("gTextureFilter", filters, 0); UIWidgets::EnhancementCombobox("gTextureFilter", filters, 0);
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
SohImGui::DrawSettings(); Ship::DrawSettings();
ImGui::EndMenu(); ImGui::EndMenu();
} }
@ -991,28 +990,28 @@ namespace GameMenuBar {
{ {
bool currentValue = CVarGetInteger("gGameControlEditorEnabled", 0); bool currentValue = CVarGetInteger("gGameControlEditorEnabled", 0);
CVarSetInteger("gGameControlEditorEnabled", !currentValue); CVarSetInteger("gGameControlEditorEnabled", !currentValue);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
SohImGui::EnableWindow("Game Control Editor", CVarGetInteger("gGameControlEditorEnabled", 0)); Ship::EnableWindow("Game Control Editor", CVarGetInteger("gGameControlEditorEnabled", 0));
} }
if (ImGui::Button(GetWindowButtonText("Cosmetics Editor", CVarGetInteger("gCosmeticsEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) if (ImGui::Button(GetWindowButtonText("Cosmetics Editor", CVarGetInteger("gCosmeticsEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
{ {
bool currentValue = CVarGetInteger("gCosmeticsEditorEnabled", 0); bool currentValue = CVarGetInteger("gCosmeticsEditorEnabled", 0);
CVarSetInteger("gCosmeticsEditorEnabled", !currentValue); CVarSetInteger("gCosmeticsEditorEnabled", !currentValue);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
SohImGui::EnableWindow("Cosmetics Editor", CVarGetInteger("gCosmeticsEditorEnabled", 0)); Ship::EnableWindow("Cosmetics Editor", CVarGetInteger("gCosmeticsEditorEnabled", 0));
} }
if (ImGui::Button(GetWindowButtonText("Audio Editor", CVarGetInteger("gAudioEditor.WindowOpen", 0)).c_str(), ImVec2(-1.0f, 0.0f))) if (ImGui::Button(GetWindowButtonText("Audio Editor", CVarGetInteger("gAudioEditor.WindowOpen", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
{ {
bool currentValue = CVarGetInteger("gAudioEditor.WindowOpen", 0); bool currentValue = CVarGetInteger("gAudioEditor.WindowOpen", 0);
CVarSetInteger("gAudioEditor.WindowOpen", !currentValue); CVarSetInteger("gAudioEditor.WindowOpen", !currentValue);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
SohImGui::EnableWindow("Audio Editor", CVarGetInteger("gAudioEditor.WindowOpen", 0)); Ship::EnableWindow("Audio Editor", CVarGetInteger("gAudioEditor.WindowOpen", 0));
} }
if (ImGui::Button(GetWindowButtonText("Gameplay Stats", CVarGetInteger("gGameplayStatsEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { if (ImGui::Button(GetWindowButtonText("Gameplay Stats", CVarGetInteger("gGameplayStatsEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) {
bool currentValue = CVarGetInteger("gGameplayStatsEnabled", 0); bool currentValue = CVarGetInteger("gGameplayStatsEnabled", 0);
CVarSetInteger("gGameplayStatsEnabled", !currentValue); CVarSetInteger("gGameplayStatsEnabled", !currentValue);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
SohImGui::EnableWindow("Gameplay Stats", CVarGetInteger("gGameplayStatsEnabled", 0)); Ship::EnableWindow("Gameplay Stats", CVarGetInteger("gGameplayStatsEnabled", 0));
} }
ImGui::PopStyleVar(3); ImGui::PopStyleVar(3);
ImGui::PopStyleColor(1); ImGui::PopStyleColor(1);
@ -1133,9 +1132,9 @@ namespace GameMenuBar {
CVarSetInteger("gEnableBetaQuest", betaQuestEnabled); CVarSetInteger("gEnableBetaQuest", betaQuestEnabled);
CVarSetInteger("gBetaQuestWorld", betaQuestWorld); CVarSetInteger("gBetaQuestWorld", betaQuestWorld);
SohImGui::DispatchConsoleCommand("reset"); Ship::DispatchConsoleCommand("reset");
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
if (!isBetaQuestEnabled) { if (!isBetaQuestEnabled) {
@ -1178,8 +1177,8 @@ namespace GameMenuBar {
{ {
bool currentValue = CVarGetInteger("gStatsEnabled", 0); bool currentValue = CVarGetInteger("gStatsEnabled", 0);
CVarSetInteger("gStatsEnabled", !currentValue); CVarSetInteger("gStatsEnabled", !currentValue);
SohImGui::ToggleStatisticsWindow(true); Ship::ToggleStatisticsWindow(true);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
UIWidgets::Tooltip("Shows the stats window, with your FPS and frametimes, and the OS you're playing on"); UIWidgets::Tooltip("Shows the stats window, with your FPS and frametimes, and the OS you're playing on");
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
@ -1187,8 +1186,8 @@ namespace GameMenuBar {
{ {
bool currentValue = CVarGetInteger("gConsoleEnabled", 0); bool currentValue = CVarGetInteger("gConsoleEnabled", 0);
CVarSetInteger("gConsoleEnabled", !currentValue); CVarSetInteger("gConsoleEnabled", !currentValue);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
SohImGui::ToggleConsoleWindow(!currentValue); Ship::ToggleConsoleWindow(!currentValue);
} }
UIWidgets::Tooltip("Enables the console window, allowing you to input commands, type help for some examples"); UIWidgets::Tooltip("Enables the console window, allowing you to input commands, type help for some examples");
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
@ -1196,32 +1195,32 @@ namespace GameMenuBar {
{ {
bool currentValue = CVarGetInteger("gSaveEditorEnabled", 0); bool currentValue = CVarGetInteger("gSaveEditorEnabled", 0);
CVarSetInteger("gSaveEditorEnabled", !currentValue); CVarSetInteger("gSaveEditorEnabled", !currentValue);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
SohImGui::EnableWindow("Save Editor", CVarGetInteger("gSaveEditorEnabled", 0)); Ship::EnableWindow("Save Editor", CVarGetInteger("gSaveEditorEnabled", 0));
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Collision Viewer", CVarGetInteger("gCollisionViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) if (ImGui::Button(GetWindowButtonText("Collision Viewer", CVarGetInteger("gCollisionViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
{ {
bool currentValue = CVarGetInteger("gCollisionViewerEnabled", 0); bool currentValue = CVarGetInteger("gCollisionViewerEnabled", 0);
CVarSetInteger("gCollisionViewerEnabled", !currentValue); CVarSetInteger("gCollisionViewerEnabled", !currentValue);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
SohImGui::EnableWindow("Collision Viewer", CVarGetInteger("gCollisionViewerEnabled", 0)); Ship::EnableWindow("Collision Viewer", CVarGetInteger("gCollisionViewerEnabled", 0));
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Actor Viewer", CVarGetInteger("gActorViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) if (ImGui::Button(GetWindowButtonText("Actor Viewer", CVarGetInteger("gActorViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
{ {
bool currentValue = CVarGetInteger("gActorViewerEnabled", 0); bool currentValue = CVarGetInteger("gActorViewerEnabled", 0);
CVarSetInteger("gActorViewerEnabled", !currentValue); CVarSetInteger("gActorViewerEnabled", !currentValue);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
SohImGui::EnableWindow("Actor Viewer", CVarGetInteger("gActorViewerEnabled", 0)); Ship::EnableWindow("Actor Viewer", CVarGetInteger("gActorViewerEnabled", 0));
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Display List Viewer", CVarGetInteger("gDLViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) if (ImGui::Button(GetWindowButtonText("Display List Viewer", CVarGetInteger("gDLViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
{ {
bool currentValue = CVarGetInteger("gDLViewerEnabled", 0); bool currentValue = CVarGetInteger("gDLViewerEnabled", 0);
CVarSetInteger("gDLViewerEnabled", !currentValue); CVarSetInteger("gDLViewerEnabled", !currentValue);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
SohImGui::EnableWindow("Display List Viewer", CVarGetInteger("gDLViewerEnabled", 0)); Ship::EnableWindow("Display List Viewer", CVarGetInteger("gDLViewerEnabled", 0));
} }
ImGui::PopStyleVar(3); ImGui::PopStyleVar(3);
ImGui::PopStyleColor(1); ImGui::PopStyleColor(1);
@ -1246,48 +1245,48 @@ namespace GameMenuBar {
{ {
bool currentValue = CVarGetInteger("gRandomizerSettingsEnabled", 0); bool currentValue = CVarGetInteger("gRandomizerSettingsEnabled", 0);
CVarSetInteger("gRandomizerSettingsEnabled", !currentValue); CVarSetInteger("gRandomizerSettingsEnabled", !currentValue);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
SohImGui::EnableWindow("Randomizer Settings", CVarGetInteger("gRandomizerSettingsEnabled", 0)); Ship::EnableWindow("Randomizer Settings", CVarGetInteger("gRandomizerSettingsEnabled", 0));
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Item Tracker", CVarGetInteger("gItemTrackerEnabled", 0)).c_str(), buttonSize)) if (ImGui::Button(GetWindowButtonText("Item Tracker", CVarGetInteger("gItemTrackerEnabled", 0)).c_str(), buttonSize))
{ {
bool currentValue = CVarGetInteger("gItemTrackerEnabled", 0); bool currentValue = CVarGetInteger("gItemTrackerEnabled", 0);
CVarSetInteger("gItemTrackerEnabled", !currentValue); CVarSetInteger("gItemTrackerEnabled", !currentValue);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
SohImGui::EnableWindow("Item Tracker", CVarGetInteger("gItemTrackerEnabled", 0)); Ship::EnableWindow("Item Tracker", CVarGetInteger("gItemTrackerEnabled", 0));
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Item Tracker Settings", CVarGetInteger("gItemTrackerSettingsEnabled", 0)).c_str(), buttonSize)) if (ImGui::Button(GetWindowButtonText("Item Tracker Settings", CVarGetInteger("gItemTrackerSettingsEnabled", 0)).c_str(), buttonSize))
{ {
bool currentValue = CVarGetInteger("gItemTrackerSettingsEnabled", 0); bool currentValue = CVarGetInteger("gItemTrackerSettingsEnabled", 0);
CVarSetInteger("gItemTrackerSettingsEnabled", !currentValue); CVarSetInteger("gItemTrackerSettingsEnabled", !currentValue);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
SohImGui::EnableWindow("Item Tracker Settings", CVarGetInteger("gItemTrackerSettingsEnabled", 0)); Ship::EnableWindow("Item Tracker Settings", CVarGetInteger("gItemTrackerSettingsEnabled", 0));
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Entrance Tracker", CVarGetInteger("gEntranceTrackerEnabled", 0)).c_str(), buttonSize)) if (ImGui::Button(GetWindowButtonText("Entrance Tracker", CVarGetInteger("gEntranceTrackerEnabled", 0)).c_str(), buttonSize))
{ {
bool currentValue = CVarGetInteger("gEntranceTrackerEnabled", 0); bool currentValue = CVarGetInteger("gEntranceTrackerEnabled", 0);
CVarSetInteger("gEntranceTrackerEnabled", !currentValue); CVarSetInteger("gEntranceTrackerEnabled", !currentValue);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
SohImGui::EnableWindow("Entrance Tracker", CVarGetInteger("gEntranceTrackerEnabled", 0)); Ship::EnableWindow("Entrance Tracker", CVarGetInteger("gEntranceTrackerEnabled", 0));
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Check Tracker", CVarGetInteger("gCheckTrackerEnabled", 0)).c_str(), buttonSize)) if (ImGui::Button(GetWindowButtonText("Check Tracker", CVarGetInteger("gCheckTrackerEnabled", 0)).c_str(), buttonSize))
{ {
bool currentValue = CVarGetInteger("gCheckTrackerEnabled", 0); bool currentValue = CVarGetInteger("gCheckTrackerEnabled", 0);
CVarSetInteger("gCheckTrackerEnabled", !currentValue); CVarSetInteger("gCheckTrackerEnabled", !currentValue);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
SohImGui::EnableWindow("Check Tracker", CVarGetInteger("gCheckTrackerEnabled", 0)); Ship::EnableWindow("Check Tracker", CVarGetInteger("gCheckTrackerEnabled", 0));
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button(GetWindowButtonText("Check Tracker Settings", CVarGetInteger("gCheckTrackerSettingsEnabled", 0)).c_str(), buttonSize)) if (ImGui::Button(GetWindowButtonText("Check Tracker Settings", CVarGetInteger("gCheckTrackerSettingsEnabled", 0)).c_str(), buttonSize))
{ {
bool currentValue = CVarGetInteger("gCheckTrackerSettingsEnabled", 0); bool currentValue = CVarGetInteger("gCheckTrackerSettingsEnabled", 0);
CVarSetInteger("gCheckTrackerSettingsEnabled", !currentValue); CVarSetInteger("gCheckTrackerSettingsEnabled", !currentValue);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
SohImGui::EnableWindow("Check Tracker Settings", CVarGetInteger("gCheckTrackerSettingsEnabled", 0)); Ship::EnableWindow("Check Tracker Settings", CVarGetInteger("gCheckTrackerSettingsEnabled", 0));
} }
ImGui::PopStyleVar(3); ImGui::PopStyleVar(3);
ImGui::PopStyleColor(1); ImGui::PopStyleColor(1);

View File

@ -1,12 +1,12 @@
#include "OTRGlobals.h" #include "OTRGlobals.h"
#include "OTRAudio.h" #include "OTRAudio.h"
#include <iostream> #include <iostream>
#include <algorithm> #include <algorithm>
#include <filesystem> #include <filesystem>
#include <fstream> #include <fstream>
#include <ResourceMgr.h> #include <ResourceManager.h>
#include <OtrFile.h> #include <File.h>
#include <DisplayList.h> #include <DisplayList.h>
#include <Window.h> #include <Window.h>
#include <GameVersions.h> #include <GameVersions.h>
@ -240,7 +240,7 @@ OTRGlobals::OTRGlobals() {
OOT_PAL_GC_DBG1, OOT_PAL_GC_DBG1,
OOT_PAL_GC_DBG2 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<Ship::AnimationFactory>()); context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Animation, "Animation", std::make_shared<Ship::AnimationFactory>());
context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_PlayerAnimation, "PlayerAnimation", std::make_shared<Ship::PlayerAnimationFactory>()); context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_PlayerAnimation, "PlayerAnimation", std::make_shared<Ship::PlayerAnimationFactory>());
@ -271,7 +271,7 @@ OTRGlobals::OTRGlobals() {
cameraStrings[i] = dup; cameraStrings[i] = dup;
} }
auto versions = context->GetResourceManager()->GetGameVersions(); auto versions = context->GetResourceManager()->GetArchive()->GetGameVersions();
for (uint32_t version : versions) { for (uint32_t version : versions) {
if (!ValidHashes.contains(version)) { if (!ValidHashes.contains(version)) {
@ -324,7 +324,7 @@ bool OTRGlobals::HasOriginal() {
} }
uint32_t OTRGlobals::GetInterpolationFPS() { uint32_t OTRGlobals::GetInterpolationFPS() {
if (SohImGui::WindowBackend() == SohImGui::Backend::DX11) { if (Ship::WindowBackend() == Ship::Backend::DX11) {
return CVarGetInteger("gInterpolationFPS", 20); return CVarGetInteger("gInterpolationFPS", 20);
} }
@ -717,6 +717,8 @@ extern "C" void InitOTR() {
exit(1); exit(1);
} }
extract.CallZapd(); extract.CallZapd();
} else {
exit(1);
} }
if (Extractor::ShowYesNoBox("Extraction Complete", "ROM Extracted. Extract another?") == IDYES) { if (Extractor::ShowYesNoBox("Extraction Complete", "ROM Extracted. Extract another?") == IDYES) {
Extractor extract; Extractor extract;
@ -734,8 +736,8 @@ extern "C" void InitOTR() {
#elif defined(__WIIU__) #elif defined(__WIIU__)
Ship::WiiU::Init(); Ship::WiiU::Init();
#endif #endif
SohImGui::AddSetupHooksDelegate(GameMenuBar::SetupHooks); Ship::AddSetupHooksDelegate(GameMenuBar::SetupHooks);
SohImGui::RegisterMenuDrawMethod(GameMenuBar::Draw); Ship::RegisterMenuDrawMethod(GameMenuBar::Draw);
OTRGlobals::Instance = new OTRGlobals(); OTRGlobals::Instance = new OTRGlobals();
SaveManager::Instance = new SaveManager(); SaveManager::Instance = new SaveManager();
@ -995,11 +997,11 @@ extern "C" uint16_t OTRGetPixelDepth(float x, float y) {
} }
extern "C" uint32_t ResourceMgr_GetNumGameVersions() { 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) { 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) { uint32_t IsSceneMasterQuest(s16 sceneNum) {
@ -1390,9 +1392,26 @@ extern "C" AnimationHeaderCommon* ResourceMgr_LoadAnimByName(const char* path) {
return (AnimationHeaderCommon*)GetResourceDataByName(path, false); return (AnimationHeaderCommon*)GetResourceDataByName(path, false);
} }
extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, SkelAnime* skelAnime) extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, SkelAnime* skelAnime) {
{ std::string pathStr = std::string(path);
SkeletonHeader* skelHeader = (SkeletonHeader*)GetResourceDataByName(path, false); 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. // 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... // 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); Ship::SkeletonPatcher::RegisterSkeleton(stringPath, skelAnime);
} }
return skelHeader; 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) { 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) { 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) { 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) { 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) { extern "C" void Overlay_DisplayText_Seconds(int seconds, const char* text) {
float duration = seconds * OTRGlobals::Instance->GetInterpolationFPS() * 0.05; 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) { extern "C" void Entrance_ClearEntranceTrackingData(void) {

View File

@ -18,6 +18,28 @@
extern "C" SaveContext gSaveContext; 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) { std::filesystem::path SaveManager::GetFileName(int fileNum) {
const std::filesystem::path sSavePath(Ship::Window::GetPathRelativeToAppDirectory("Save")); const std::filesystem::path sSavePath(Ship::Window::GetPathRelativeToAppDirectory("Save"));
return sSavePath / ("file" + std::to_string(fileNum + 1) + ".sav"); return sSavePath / ("file" + std::to_string(fileNum + 1) + ".sav");

View File

@ -35,6 +35,9 @@ class SaveManager {
public: public:
static SaveManager* Instance; 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 InitFunc = void(*)(bool isDebug);
using LoadFunc = void(*)(); using LoadFunc = void(*)();
using SaveFunc = void(*)(); using SaveFunc = void(*)();

View File

@ -206,7 +206,7 @@ namespace UIWidgets {
bool val = (bool)CVarGetInteger(cvarName, defaultValue); bool val = (bool)CVarGetInteger(cvarName, defaultValue);
if (CustomCheckbox(text, &val, disabled, disabledGraphic)) { if (CustomCheckbox(text, &val, disabled, disabledGraphic)) {
CVarSetInteger(cvarName, val); CVarSetInteger(cvarName, val);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
changed = true; changed = true;
} }
@ -246,7 +246,7 @@ namespace UIWidgets {
CVarSetInteger(cvarName, i); CVarSetInteger(cvarName, i);
selected = i; selected = i;
changed = true; changed = true;
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
} }
} }
@ -259,7 +259,7 @@ namespace UIWidgets {
if (disabledValue >= 0 && selected != disabledValue) { if (disabledValue >= 0 && selected != disabledValue) {
CVarSetInteger(cvarName, disabledValue); CVarSetInteger(cvarName, disabledValue);
changed = true; changed = true;
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
} }
@ -348,7 +348,7 @@ namespace UIWidgets {
if (changed) { if (changed) {
CVarSetInteger(cvarName, val); CVarSetInteger(cvarName, val);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
return changed; return changed;
@ -424,7 +424,7 @@ namespace UIWidgets {
if (changed) { if (changed) {
CVarSetFloat(cvarName, val); CVarSetFloat(cvarName, val);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
} }
return changed; return changed;
@ -471,7 +471,7 @@ namespace UIWidgets {
int val = CVarGetInteger(cvarName, 0); int val = CVarGetInteger(cvarName, 0);
if (ImGui::RadioButton(make_invisible.c_str(), id == val)) { if (ImGui::RadioButton(make_invisible.c_str(), id == val)) {
CVarSetInteger(cvarName, id); CVarSetInteger(cvarName, id);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
ret = true; ret = true;
} }
ImGui::SameLine(); ImGui::SameLine();
@ -498,7 +498,7 @@ namespace UIWidgets {
CVarSetColor(cvarName, colorsRGBA); CVarSetColor(cvarName, colorsRGBA);
CVarSetInteger(Cvar_RBM.c_str(), 0); //On click disable rainbow mode. CVarSetInteger(Cvar_RBM.c_str(), 0); //On click disable rainbow mode.
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
changed = true; changed = true;
} }
Tooltip("Revert colors to the game's original colors (GameCube version)\nOverwrites previously chosen color"); 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); NewColors.b = fmin(fmax(colors->z * 255, 0), 255);
CVarSetColor(cvarName, NewColors); CVarSetColor(cvarName, NewColors);
CVarSetInteger(Cvar_RBM.c_str(), 0); // On click disable rainbow mode. CVarSetInteger(Cvar_RBM.c_str(), 0); // On click disable rainbow mode.
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
changed = true; changed = true;
} }
Tooltip("Chooses a random color\nOverwrites previously chosen color"); Tooltip("Chooses a random color\nOverwrites previously chosen color");
@ -584,7 +584,7 @@ namespace UIWidgets {
colors.a = 255.0; colors.a = 255.0;
CVarSetColor(cvarName, colors); CVarSetColor(cvarName, colors);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
changed = true; changed = true;
} }
} }
@ -600,7 +600,7 @@ namespace UIWidgets {
colors.a = ColorRGBA.w * 255.0; colors.a = ColorRGBA.w * 255.0;
CVarSetColor(cvarName, colors); CVarSetColor(cvarName, colors);
SohImGui::RequestCvarSaveOnNextTick(); Ship::RequestCvarSaveOnNextTick();
changed = true; changed = true;
} }
} }

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> AnimationFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> AnimationFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<Animation>(resourceMgr, initData); auto resource = std::make_shared<Animation>(resourceMgr, initData);

View File

@ -6,7 +6,7 @@
namespace Ship { namespace Ship {
class AnimationFactory : public ResourceFactory { class AnimationFactory : public ResourceFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> AudioSampleFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> AudioSampleFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<AudioSample>(resourceMgr, initData); auto resource = std::make_shared<AudioSample>(resourceMgr, initData);

View File

@ -7,7 +7,7 @@ namespace Ship {
class AudioSampleFactory : public ResourceFactory class AudioSampleFactory : public ResourceFactory
{ {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> AudioSequenceFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> AudioSequenceFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<AudioSequence>(resourceMgr, initData); auto resource = std::make_shared<AudioSequence>(resourceMgr, initData);

View File

@ -7,7 +7,7 @@ namespace Ship {
class AudioSequenceFactory : public ResourceFactory class AudioSequenceFactory : public ResourceFactory
{ {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -4,7 +4,7 @@
#include "libultraship/bridge.h" #include "libultraship/bridge.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> AudioSoundFontFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> AudioSoundFontFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<AudioSoundFont>(resourceMgr, initData); auto resource = std::make_shared<AudioSoundFont>(resourceMgr, initData);

View File

@ -7,7 +7,7 @@ namespace Ship {
class AudioSoundFontFactory : public ResourceFactory class AudioSoundFontFactory : public ResourceFactory
{ {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> BackgroundFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> BackgroundFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<Background>(resourceMgr, initData); auto resource = std::make_shared<Background>(resourceMgr, initData);

View File

@ -6,7 +6,7 @@
namespace Ship { namespace Ship {
class BackgroundFactory : public ResourceFactory { class BackgroundFactory : public ResourceFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> CollisionHeaderFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> CollisionHeaderFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<CollisionHeader>(resourceMgr, initData); auto resource = std::make_shared<CollisionHeader>(resourceMgr, initData);

View File

@ -6,7 +6,7 @@
namespace Ship { namespace Ship {
class CollisionHeaderFactory : public ResourceFactory { class CollisionHeaderFactory : public ResourceFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> CutsceneFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> CutsceneFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<Cutscene>(resourceMgr, initData); auto resource = std::make_shared<Cutscene>(resourceMgr, initData);

View File

@ -7,7 +7,7 @@ namespace Ship {
class CutsceneFactory : public ResourceFactory class CutsceneFactory : public ResourceFactory
{ {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> PathFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> PathFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<Path>(resourceMgr, initData); auto resource = std::make_shared<Path>(resourceMgr, initData);

View File

@ -7,7 +7,7 @@ namespace Ship {
class PathFactory : public ResourceFactory class PathFactory : public ResourceFactory
{ {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> PlayerAnimationFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> PlayerAnimationFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<PlayerAnimation>(resourceMgr, initData); auto resource = std::make_shared<PlayerAnimation>(resourceMgr, initData);

View File

@ -6,7 +6,7 @@
namespace Ship { namespace Ship {
class PlayerAnimationFactory : public ResourceFactory { class PlayerAnimationFactory : public ResourceFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -30,7 +30,7 @@
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SceneFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SceneFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
if (SceneFactory::sceneCommandFactories.empty()) { if (SceneFactory::sceneCommandFactories.empty()) {

View File

@ -9,7 +9,7 @@
namespace Ship { namespace Ship {
class SceneFactory : public ResourceFactory { class SceneFactory : public ResourceFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;

View File

@ -4,7 +4,7 @@
#include <libultraship/bridge.h> #include <libultraship/bridge.h>
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SkeletonFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SkeletonFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<Skeleton>(resourceMgr, initData); auto resource = std::make_shared<Skeleton>(resourceMgr, initData);
@ -26,7 +26,7 @@ std::shared_ptr<Resource> SkeletonFactory::ReadResource(std::shared_ptr<Resource
return resource; return resource;
} }
std::shared_ptr<Resource> SkeletonFactory::ReadResourceXML(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SkeletonFactory::ReadResourceXML(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
tinyxml2::XMLElement* reader) { tinyxml2::XMLElement* reader) {
auto resource = std::make_shared<Skeleton>(resourceMgr, initData); auto resource = std::make_shared<Skeleton>(resourceMgr, initData);

View File

@ -7,10 +7,10 @@ namespace Ship {
class SkeletonFactory : public ResourceFactory class SkeletonFactory : public ResourceFactory
{ {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
std::shared_ptr<Resource> ReadResourceXML(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResourceXML(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;
}; };

View File

@ -4,7 +4,7 @@
#include "libultraship/bridge.h" #include "libultraship/bridge.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SkeletonLimbFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SkeletonLimbFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SkeletonLimb>(resourceMgr, initData); auto resource = std::make_shared<SkeletonLimb>(resourceMgr, initData);
@ -26,7 +26,7 @@ std::shared_ptr<Resource> SkeletonLimbFactory::ReadResource(std::shared_ptr<Reso
return resource; return resource;
} }
std::shared_ptr<Resource> SkeletonLimbFactory::ReadResourceXML(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SkeletonLimbFactory::ReadResourceXML(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
tinyxml2::XMLElement* reader) { tinyxml2::XMLElement* reader) {
auto resource = std::make_shared<SkeletonLimb>(resourceMgr, initData); auto resource = std::make_shared<SkeletonLimb>(resourceMgr, initData);

View File

@ -7,10 +7,10 @@ namespace Ship {
class SkeletonLimbFactory : public ResourceFactory class SkeletonLimbFactory : public ResourceFactory
{ {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
std::shared_ptr<Resource> ReadResourceXML(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResourceXML(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> TextFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> TextFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<Text>(resourceMgr, initData); auto resource = std::make_shared<Text>(resourceMgr, initData);
@ -28,7 +28,7 @@ std::shared_ptr<Resource> TextFactory::ReadResource(std::shared_ptr<ResourceMgr>
return resource; return resource;
} }
std::shared_ptr<Resource> TextFactory::ReadResourceXML(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> TextFactory::ReadResourceXML(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
tinyxml2::XMLElement* reader) { tinyxml2::XMLElement* reader) {
auto resource = std::make_shared<Text>(resourceMgr, initData); auto resource = std::make_shared<Text>(resourceMgr, initData);

View File

@ -7,10 +7,10 @@ namespace Ship {
class TextFactory : public ResourceFactory class TextFactory : public ResourceFactory
{ {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
std::shared_ptr<Resource> ReadResourceXML(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResourceXML(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
tinyxml2::XMLElement* reader) override; tinyxml2::XMLElement* reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> EndMarkerFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> EndMarkerFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<EndMarker>(resourceMgr, initData); auto resource = std::make_shared<EndMarker>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class EndMarkerFactory : public SceneCommandFactory { class EndMarkerFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetActorListFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetActorListFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetActorList>(resourceMgr, initData); auto resource = std::make_shared<SetActorList>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class SetActorListFactory : public SceneCommandFactory { class SetActorListFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -4,7 +4,7 @@
#include "libultraship/bridge.h" #include "libultraship/bridge.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetAlternateHeadersFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetAlternateHeadersFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetAlternateHeaders>(resourceMgr, initData); auto resource = std::make_shared<SetAlternateHeaders>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class SetAlternateHeadersFactory : public SceneCommandFactory { class SetAlternateHeadersFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetCameraSettingsFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetCameraSettingsFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetCameraSettings>(resourceMgr, initData); auto resource = std::make_shared<SetCameraSettings>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class SetCameraSettingsFactory : public SceneCommandFactory { class SetCameraSettingsFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -4,7 +4,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetCollisionHeaderFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetCollisionHeaderFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetCollisionHeader>(resourceMgr, initData); auto resource = std::make_shared<SetCollisionHeader>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class SetCollisionHeaderFactory : public SceneCommandFactory { class SetCollisionHeaderFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetCsCameraFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetCsCameraFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetCsCamera>(resourceMgr, initData); auto resource = std::make_shared<SetCsCamera>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class SetCsCameraFactory : public SceneCommandFactory { class SetCsCameraFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -4,7 +4,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetCutscenesFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetCutscenesFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetCutscenes>(resourceMgr, initData); auto resource = std::make_shared<SetCutscenes>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class SetCutscenesFactory : public SceneCommandFactory { class SetCutscenesFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetEchoSettingsFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetEchoSettingsFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetEchoSettings>(resourceMgr, initData); auto resource = std::make_shared<SetEchoSettings>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class SetEchoSettingsFactory : public SceneCommandFactory { class SetEchoSettingsFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetEntranceListFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetEntranceListFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetEntranceList>(resourceMgr, initData); auto resource = std::make_shared<SetEntranceList>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class SetEntranceListFactory : public SceneCommandFactory { class SetEntranceListFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetExitListFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetExitListFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetExitList>(resourceMgr, initData); auto resource = std::make_shared<SetExitList>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class SetExitListFactory : public SceneCommandFactory { class SetExitListFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetLightListFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetLightListFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetLightList>(resourceMgr, initData); auto resource = std::make_shared<SetLightList>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class SetLightListFactory : public SceneCommandFactory { class SetLightListFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetLightingSettingsFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetLightingSettingsFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetLightingSettings>(resourceMgr, initData); auto resource = std::make_shared<SetLightingSettings>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class SetLightingSettingsFactory : public SceneCommandFactory { class SetLightingSettingsFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -4,7 +4,7 @@
#include "libultraship/bridge.h" #include "libultraship/bridge.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetMeshFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetMeshFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetMesh>(resourceMgr, initData); auto resource = std::make_shared<SetMesh>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class SetMeshFactory : public SceneCommandFactory { class SetMeshFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetObjectListFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetObjectListFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetObjectList>(resourceMgr, initData); auto resource = std::make_shared<SetObjectList>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class SetObjectListFactory : public SceneCommandFactory { class SetObjectListFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -4,7 +4,7 @@
#include <libultraship/bridge.h> #include <libultraship/bridge.h>
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetPathwaysFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetPathwaysFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetPathways>(resourceMgr, initData); auto resource = std::make_shared<SetPathways>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class SetPathwaysFactory : public SceneCommandFactory { class SetPathwaysFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetRoomBehaviorFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetRoomBehaviorFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetRoomBehavior>(resourceMgr, initData); auto resource = std::make_shared<SetRoomBehavior>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class SetRoomBehaviorFactory : public SceneCommandFactory { class SetRoomBehaviorFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetRoomListFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetRoomListFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetRoomList>(resourceMgr, initData); auto resource = std::make_shared<SetRoomList>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class SetRoomListFactory : public SceneCommandFactory { class SetRoomListFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetSkyboxModifierFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetSkyboxModifierFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetSkyboxModifier>(resourceMgr, initData); auto resource = std::make_shared<SetSkyboxModifier>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class SetSkyboxModifierFactory : public SceneCommandFactory { class SetSkyboxModifierFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetSkyboxSettingsFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetSkyboxSettingsFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetSkyboxSettings>(resourceMgr, initData); auto resource = std::make_shared<SetSkyboxSettings>(resourceMgr, initData);

View File

@ -5,7 +5,7 @@
namespace Ship { namespace Ship {
class SetSkyboxSettingsFactory : public SceneCommandFactory { class SetSkyboxSettingsFactory : public SceneCommandFactory {
public: public:
std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) override; std::shared_ptr<BinaryReader> reader) override;
}; };

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace Ship { namespace Ship {
std::shared_ptr<Resource> SetSoundSettingsFactory::ReadResource(std::shared_ptr<ResourceMgr> resourceMgr, std::shared_ptr<Resource> SetSoundSettingsFactory::ReadResource(std::shared_ptr<ResourceManager> resourceMgr,
std::shared_ptr<ResourceInitData> initData, std::shared_ptr<ResourceInitData> initData,
std::shared_ptr<BinaryReader> reader) { std::shared_ptr<BinaryReader> reader) {
auto resource = std::make_shared<SetSoundSettings>(resourceMgr, initData); auto resource = std::make_shared<SetSoundSettings>(resourceMgr, initData);

Some files were not shown because too many files have changed in this diff Show More