support lus renamespacing (#4075)

This commit is contained in:
briaguya 2024-04-28 21:36:44 -04:00 committed by GitHub
parent 92467b87b5
commit 552bb2886f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
145 changed files with 1007 additions and 1007 deletions

@ -1 +1 @@
Subproject commit 85f6de497f6d375390cc3b4ba55eae5ef9c1b153 Subproject commit 6f978e0d237530f304ba2018bbdc539b175c184a

View File

@ -388,7 +388,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);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
void AudioCollection::AddToShufflePool(SequenceInfo* seqInfo) { void AudioCollection::AddToShufflePool(SequenceInfo* seqInfo) {
@ -396,7 +396,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());
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
void AudioCollection::InitializeShufflePool() { void AudioCollection::InitializeShufflePool() {

View File

@ -203,7 +203,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
auto currentBGM = func_800FA0B4(SEQ_PLAYER_BGM_MAIN); auto currentBGM = func_800FA0B4(SEQ_PLAYER_BGM_MAIN);
auto prevReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM); auto prevReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM);
ResetGroup(map, type); ResetGroup(map, type);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
auto curReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM); auto curReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM);
if (type == SEQ_BGM_WORLD && prevReplacement != curReplacement) { if (type == SEQ_BGM_WORLD && prevReplacement != curReplacement) {
ReplayCurrentBGM(); ReplayCurrentBGM();
@ -214,7 +214,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
auto currentBGM = func_800FA0B4(SEQ_PLAYER_BGM_MAIN); auto currentBGM = func_800FA0B4(SEQ_PLAYER_BGM_MAIN);
auto prevReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM); auto prevReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM);
RandomizeGroup(type); RandomizeGroup(type);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
auto curReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM); auto curReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM);
if (type == SEQ_BGM_WORLD && prevReplacement != curReplacement) { if (type == SEQ_BGM_WORLD && prevReplacement != curReplacement) {
ReplayCurrentBGM(); ReplayCurrentBGM();
@ -225,7 +225,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
auto currentBGM = func_800FA0B4(SEQ_PLAYER_BGM_MAIN); auto currentBGM = func_800FA0B4(SEQ_PLAYER_BGM_MAIN);
auto prevReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM); auto prevReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM);
LockGroup(map, type); LockGroup(map, type);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
auto curReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM); auto curReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM);
if (type == SEQ_BGM_WORLD && prevReplacement != curReplacement) { if (type == SEQ_BGM_WORLD && prevReplacement != curReplacement) {
ReplayCurrentBGM(); ReplayCurrentBGM();
@ -236,7 +236,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
auto currentBGM = func_800FA0B4(SEQ_PLAYER_BGM_MAIN); auto currentBGM = func_800FA0B4(SEQ_PLAYER_BGM_MAIN);
auto prevReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM); auto prevReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM);
UnlockGroup(map, type); UnlockGroup(map, type);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
auto curReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM); auto curReplacement = AudioCollection::Instance->GetReplacementSequence(currentBGM);
if (type == SEQ_BGM_WORLD && prevReplacement != curReplacement) { if (type == SEQ_BGM_WORLD && prevReplacement != curReplacement) {
ReplayCurrentBGM(); ReplayCurrentBGM();
@ -281,7 +281,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);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
UpdateCurrentBGM(defaultValue, type); UpdateCurrentBGM(defaultValue, type);
} }
@ -301,7 +301,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
if (ImGui::Button(resetButton.c_str())) { if (ImGui::Button(resetButton.c_str())) {
CVarClear(cvarKey.c_str()); CVarClear(cvarKey.c_str());
CVarClear(cvarLockKey.c_str()); CVarClear(cvarLockKey.c_str());
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
UpdateCurrentBGM(defaultValue, seqData.category); UpdateCurrentBGM(defaultValue, seqData.category);
} }
UIWidgets::Tooltip("Reset to default"); UIWidgets::Tooltip("Reset to default");
@ -322,7 +322,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
if (locked) { if (locked) {
CVarClear(cvarLockKey.c_str()); CVarClear(cvarLockKey.c_str());
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
UpdateCurrentBGM(defaultValue, type); UpdateCurrentBGM(defaultValue, type);
} }
} }
@ -335,7 +335,7 @@ void Draw_SfxTab(const std::string& tabId, SeqType type) {
} else { } else {
CVarSetInteger(cvarLockKey.c_str(), 1); CVarSetInteger(cvarLockKey.c_str(), 1);
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
UIWidgets::Tooltip(locked ? "Sound locked" : "Sound unlocked"); UIWidgets::Tooltip(locked ? "Sound locked" : "Sound unlocked");
} }
@ -521,7 +521,7 @@ void AudioEditor::DrawElement() {
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(CVAR_AUDIO("LinkVoiceFreqMultiplier"), 1.0f); CVarSetFloat(CVAR_AUDIO("LinkVoiceFreqMultiplier"), 1.0f);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
ImGui::NewLine(); ImGui::NewLine();
@ -710,14 +710,14 @@ void AudioEditor_RandomizeAll() {
RandomizeGroup(type); RandomizeGroup(type);
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
ReplayCurrentBGM(); ReplayCurrentBGM();
} }
void AudioEditor_RandomizeGroup(SeqType group) { void AudioEditor_RandomizeGroup(SeqType group) {
RandomizeGroup(group); RandomizeGroup(group);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
ReplayCurrentBGM(); ReplayCurrentBGM();
} }
@ -726,14 +726,14 @@ void AudioEditor_ResetAll() {
ResetGroup(AudioCollection::Instance->GetAllSequences(), type); ResetGroup(AudioCollection::Instance->GetAllSequences(), type);
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
ReplayCurrentBGM(); ReplayCurrentBGM();
} }
void AudioEditor_ResetGroup(SeqType group) { void AudioEditor_ResetGroup(SeqType group) {
ResetGroup(AudioCollection::Instance->GetAllSequences(), group); ResetGroup(AudioCollection::Instance->GetAllSequences(), group);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
ReplayCurrentBGM(); ReplayCurrentBGM();
} }
@ -742,7 +742,7 @@ void AudioEditor_LockAll() {
LockGroup(AudioCollection::Instance->GetAllSequences(), type); LockGroup(AudioCollection::Instance->GetAllSequences(), type);
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
void AudioEditor_UnlockAll() { void AudioEditor_UnlockAll() {
@ -750,5 +750,5 @@ void AudioEditor_UnlockAll() {
UnlockGroup(AudioCollection::Instance->GetAllSequences(), type); UnlockGroup(AudioCollection::Instance->GetAllSequences(), type);
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }

View File

@ -10,9 +10,9 @@
#include <ImGui/imgui.h> #include <ImGui/imgui.h>
#include "AudioCollection.h" #include "AudioCollection.h"
class AudioEditor : public LUS::GuiWindow { class AudioEditor : public Ship::GuiWindow {
public: public:
using LUS::GuiWindow::GuiWindow; using GuiWindow::GuiWindow;
void DrawElement() override; void DrawElement() override;
void InitElement() override; void InitElement() override;

View File

@ -47,14 +47,14 @@ void InputViewer::RenderButton(std::string btnTexture, std::string btnOutlineTex
// Render Outline based on settings // Render Outline based on settings
if (outlineMode == BUTTON_OUTLINE_ALWAYS_SHOWN || (outlineMode == BUTTON_OUTLINE_NOT_PRESSED && !state) || if (outlineMode == BUTTON_OUTLINE_ALWAYS_SHOWN || (outlineMode == BUTTON_OUTLINE_NOT_PRESSED && !state) ||
(outlineMode == BUTTON_OUTLINE_PRESSED && state)) { (outlineMode == BUTTON_OUTLINE_PRESSED && state)) {
ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(btnOutlineTexture), size, ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(btnOutlineTexture), size,
ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255)); ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255));
} }
// Render button if pressed // Render button if pressed
if (state) { if (state) {
ImGui::SetCursorPos(pos); ImGui::SetCursorPos(pos);
ImGui::SetNextItemAllowOverlap(); ImGui::SetNextItemAllowOverlap();
ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(btnTexture), size, ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(btnTexture), size,
ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255)); ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255));
} }
} }
@ -63,61 +63,61 @@ void InputViewer::DrawElement() {
if (CVarGetInteger(CVAR_WINDOW("InputViewer"), 0)) { if (CVarGetInteger(CVAR_WINDOW("InputViewer"), 0)) {
static bool sButtonTexturesLoaded = false; static bool sButtonTexturesLoaded = false;
if (!sButtonTexturesLoaded) { if (!sButtonTexturesLoaded) {
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage( Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"Input-Viewer-Background", "textures/buttons/InputViewerBackground.png"); "Input-Viewer-Background", "textures/buttons/InputViewerBackground.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("A-Btn", "textures/buttons/ABtn.png"); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("A-Btn", "textures/buttons/ABtn.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("B-Btn", "textures/buttons/BBtn.png"); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("B-Btn", "textures/buttons/BBtn.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("L-Btn", "textures/buttons/LBtn.png"); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("L-Btn", "textures/buttons/LBtn.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("R-Btn", "textures/buttons/RBtn.png"); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("R-Btn", "textures/buttons/RBtn.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Z-Btn", "textures/buttons/ZBtn.png"); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Z-Btn", "textures/buttons/ZBtn.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Start-Btn", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Start-Btn",
"textures/buttons/StartBtn.png"); "textures/buttons/StartBtn.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Left", "textures/buttons/CLeft.png"); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Left", "textures/buttons/CLeft.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Right", "textures/buttons/CRight.png"); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Right", "textures/buttons/CRight.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Up", "textures/buttons/CUp.png"); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Up", "textures/buttons/CUp.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Down", "textures/buttons/CDown.png"); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Down", "textures/buttons/CDown.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Analog-Stick", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Analog-Stick",
"textures/buttons/AnalogStick.png"); "textures/buttons/AnalogStick.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Left", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Left",
"textures/buttons/DPadLeft.png"); "textures/buttons/DPadLeft.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Right", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Right",
"textures/buttons/DPadRight.png"); "textures/buttons/DPadRight.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Up", "textures/buttons/DPadUp.png"); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Up", "textures/buttons/DPadUp.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Down", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Down",
"textures/buttons/DPadDown.png"); "textures/buttons/DPadDown.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Right-Stick", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Right-Stick",
"textures/buttons/RightStick.png"); "textures/buttons/RightStick.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("A-Btn Outline", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("A-Btn Outline",
"textures/buttons/ABtnOutline.png"); "textures/buttons/ABtnOutline.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("B-Btn Outline", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("B-Btn Outline",
"textures/buttons/BBtnOutline.png"); "textures/buttons/BBtnOutline.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("L-Btn Outline", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("L-Btn Outline",
"textures/buttons/LBtnOutline.png"); "textures/buttons/LBtnOutline.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("R-Btn Outline", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("R-Btn Outline",
"textures/buttons/RBtnOutline.png"); "textures/buttons/RBtnOutline.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Z-Btn Outline", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Z-Btn Outline",
"textures/buttons/ZBtnOutline.png"); "textures/buttons/ZBtnOutline.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Start-Btn Outline", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Start-Btn Outline",
"textures/buttons/StartBtnOutline.png"); "textures/buttons/StartBtnOutline.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Left Outline", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Left Outline",
"textures/buttons/CLeftOutline.png"); "textures/buttons/CLeftOutline.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Right Outline", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Right Outline",
"textures/buttons/CRightOutline.png"); "textures/buttons/CRightOutline.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Up Outline", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Up Outline",
"textures/buttons/CUpOutline.png"); "textures/buttons/CUpOutline.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Down Outline", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Down Outline",
"textures/buttons/CDownOutline.png"); "textures/buttons/CDownOutline.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Analog-Stick Outline", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Analog-Stick Outline",
"textures/buttons/AnalogStickOutline.png"); "textures/buttons/AnalogStickOutline.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Left Outline", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Left Outline",
"textures/buttons/DPadLeftOutline.png"); "textures/buttons/DPadLeftOutline.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Right Outline", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Right Outline",
"textures/buttons/DPadRightOutline.png"); "textures/buttons/DPadRightOutline.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Up Outline", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Up Outline",
"textures/buttons/DPadUpOutline.png"); "textures/buttons/DPadUpOutline.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Down Outline", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Down Outline",
"textures/buttons/DPadDownOutline.png"); "textures/buttons/DPadDownOutline.png");
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Right-Stick Outline", Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Right-Stick Outline",
"textures/buttons/RightStickOutline.png"); "textures/buttons/RightStickOutline.png");
sButtonTexturesLoaded = true; sButtonTexturesLoaded = true;
} }
@ -133,7 +133,7 @@ void InputViewer::DrawElement() {
const int showAnalogAngles = CVarGetInteger("gInputViewer.AnalogAngles.Enabled", 0); const int showAnalogAngles = CVarGetInteger("gInputViewer.AnalogAngles.Enabled", 0);
const int buttonOutlineMode = CVarGetInteger("gInputViewer.ButtonOutlineMode", BUTTON_OUTLINE_NOT_PRESSED); const int buttonOutlineMode = CVarGetInteger("gInputViewer.ButtonOutlineMode", BUTTON_OUTLINE_NOT_PRESSED);
ImVec2 bgSize = LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureSize("Input-Viewer-Background"); ImVec2 bgSize = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureSize("Input-Viewer-Background");
ImVec2 scaledBGSize = ImVec2(bgSize.x * scale, bgSize.y * scale); ImVec2 scaledBGSize = ImVec2(bgSize.x * scale, bgSize.y * scale);
ImGui::SetNextWindowSize(ImVec2( ImGui::SetNextWindowSize(ImVec2(
@ -150,7 +150,7 @@ void InputViewer::DrawElement() {
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0, 0, 0, 0)); ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0, 0, 0, 0));
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0.0f, 0.0f)); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0.0f, 0.0f));
OSContPad* pads = LUS::Context::GetInstance()->GetControlDeck()->GetPads(); OSContPad* pads = Ship::Context::GetInstance()->GetControlDeck()->GetPads();
ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollbar |
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoBackground |
@ -168,7 +168,7 @@ void InputViewer::DrawElement() {
ImGui::SetNextItemAllowOverlap(); ImGui::SetNextItemAllowOverlap();
// Background // Background
ImGui::Image( ImGui::Image(
LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Input-Viewer-Background"), Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Input-Viewer-Background"),
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255)); scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255));
} }
@ -263,7 +263,7 @@ void InputViewer::DrawElement() {
ImGui::SetNextItemAllowOverlap(); ImGui::SetNextItemAllowOverlap();
ImGui::SetCursorPos(aPos); ImGui::SetCursorPos(aPos);
ImGui::Image( ImGui::Image(
LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Analog-Stick Outline"), Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Analog-Stick Outline"),
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255)); scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255));
} }
const int analogStickMode = const int analogStickMode =
@ -274,7 +274,7 @@ void InputViewer::DrawElement() {
ImGui::SetCursorPos( ImGui::SetCursorPos(
ImVec2(aPos.x + maxStickDistance * ((float)(pads[0].stick_x) / MAX_AXIS_RANGE) * scale, ImVec2(aPos.x + maxStickDistance * ((float)(pads[0].stick_x) / MAX_AXIS_RANGE) * scale,
aPos.y - maxStickDistance * ((float)(pads[0].stick_y) / MAX_AXIS_RANGE) * scale)); aPos.y - maxStickDistance * ((float)(pads[0].stick_y) / MAX_AXIS_RANGE) * scale));
ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Analog-Stick"), ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Analog-Stick"),
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255)); scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255));
} }
@ -287,7 +287,7 @@ void InputViewer::DrawElement() {
ImGui::SetNextItemAllowOverlap(); ImGui::SetNextItemAllowOverlap();
ImGui::SetCursorPos(aPos); ImGui::SetCursorPos(aPos);
ImGui::Image( ImGui::Image(
LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Right-Stick Outline"), Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Right-Stick Outline"),
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255)); scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255));
} }
const int rightStickMode = const int rightStickMode =
@ -298,7 +298,7 @@ void InputViewer::DrawElement() {
ImGui::SetCursorPos( ImGui::SetCursorPos(
ImVec2(aPos.x + maxRightStickDistance * ((float)(pads[0].right_stick_x) / MAX_AXIS_RANGE) * scale, ImVec2(aPos.x + maxRightStickDistance * ((float)(pads[0].right_stick_x) / MAX_AXIS_RANGE) * scale,
aPos.y - maxRightStickDistance * ((float)(pads[0].right_stick_y) / MAX_AXIS_RANGE) * scale)); aPos.y - maxRightStickDistance * ((float)(pads[0].right_stick_y) / MAX_AXIS_RANGE) * scale));
ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Right-Stick"), ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Right-Stick"),
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255)); scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255));
} }

View File

@ -15,9 +15,9 @@ typedef enum {
STICK_MODE_ALWAYS_HIDDEN, STICK_MODE_ALWAYS_HIDDEN,
} StickMode; } StickMode;
class InputViewer : public LUS::GuiWindow { class InputViewer : public Ship::GuiWindow {
public: public:
using LUS::GuiWindow::GuiWindow; using GuiWindow::GuiWindow;
void InitElement() override {}; void InitElement() override {};
void DrawElement() override; void DrawElement() override;
@ -32,9 +32,9 @@ public:
void RenderButton(std::string btn, std::string btnOutline, int state, ImVec2 size, int outlineMode); void RenderButton(std::string btn, std::string btnOutline, int state, ImVec2 size, int outlineMode);
}; };
class InputViewerSettingsWindow : public LUS::GuiWindow { class InputViewerSettingsWindow : public Ship::GuiWindow {
public: public:
using LUS::GuiWindow::GuiWindow; using GuiWindow::GuiWindow;
void InitElement() override {}; void InitElement() override {};
void DrawElement() override; void DrawElement() override;

View File

@ -57,7 +57,7 @@ void SohInputEditorWindow::UpdateElement() {
} }
if (mInputEditorPopupOpen && ImGui::IsPopupOpen("", ImGuiPopupFlags_AnyPopupId)) { if (mInputEditorPopupOpen && ImGui::IsPopupOpen("", ImGuiPopupFlags_AnyPopupId)) {
LUS::Context::GetInstance()->GetControlDeck()->BlockGameInput(INPUT_EDITOR_WINDOW_GAME_INPUT_BLOCK_ID); Ship::Context::GetInstance()->GetControlDeck()->BlockGameInput(INPUT_EDITOR_WINDOW_GAME_INPUT_BLOCK_ID);
// continue to block input for a third of a second after getting the mapping // continue to block input for a third of a second after getting the mapping
mGameInputBlockTimer = ImGui::GetIO().Framerate / 3; mGameInputBlockTimer = ImGui::GetIO().Framerate / 3;
@ -69,24 +69,24 @@ void SohInputEditorWindow::UpdateElement() {
} }
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->BlockImGuiGamepadNavigation(); Ship::Context::GetInstance()->GetWindow()->GetGui()->BlockImGuiGamepadNavigation();
} else { } else {
if (mGameInputBlockTimer != INT32_MAX) { if (mGameInputBlockTimer != INT32_MAX) {
mGameInputBlockTimer--; mGameInputBlockTimer--;
if (mGameInputBlockTimer <= 0) { if (mGameInputBlockTimer <= 0) {
LUS::Context::GetInstance()->GetControlDeck()->UnblockGameInput( Ship::Context::GetInstance()->GetControlDeck()->UnblockGameInput(
INPUT_EDITOR_WINDOW_GAME_INPUT_BLOCK_ID); INPUT_EDITOR_WINDOW_GAME_INPUT_BLOCK_ID);
mGameInputBlockTimer = INT32_MAX; mGameInputBlockTimer = INT32_MAX;
} }
} }
if (LUS::Context::GetInstance()->GetWindow()->GetGui()->ImGuiGamepadNavigationEnabled()) { if (Ship::Context::GetInstance()->GetWindow()->GetGui()->ImGuiGamepadNavigationEnabled()) {
mMappingInputBlockTimer = ImGui::GetIO().Framerate / 3; mMappingInputBlockTimer = ImGui::GetIO().Framerate / 3;
} else { } else {
mMappingInputBlockTimer = INT32_MAX; mMappingInputBlockTimer = INT32_MAX;
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->UnblockImGuiGamepadNavigation(); Ship::Context::GetInstance()->GetWindow()->GetGui()->UnblockImGuiGamepadNavigation();
} }
} }
@ -176,26 +176,26 @@ void SohInputEditorWindow::DrawAnalogPreview(const char* label, ImVec2 stick, fl
#define BUTTON_COLOR_GAMEPAD_PURPLE ImVec4(0.431f, 0.369f, 0.706f, 0.5f) #define BUTTON_COLOR_GAMEPAD_PURPLE ImVec4(0.431f, 0.369f, 0.706f, 0.5f)
#define BUTTON_COLOR_GAMEPAD_PURPLE_HOVERED ImVec4(0.431f, 0.369f, 0.706f, 1.0f) #define BUTTON_COLOR_GAMEPAD_PURPLE_HOVERED ImVec4(0.431f, 0.369f, 0.706f, 1.0f)
void SohInputEditorWindow::GetButtonColorsForLUSDeviceIndex(LUS::LUSDeviceIndex lusIndex, ImVec4& buttonColor, void SohInputEditorWindow::GetButtonColorsForLUSDeviceIndex(Ship::ShipDeviceIndex lusIndex, ImVec4& buttonColor,
ImVec4& buttonHoveredColor) { ImVec4& buttonHoveredColor) {
switch (lusIndex) { switch (lusIndex) {
case LUS::LUSDeviceIndex::Keyboard: case Ship::ShipDeviceIndex::Keyboard:
buttonColor = BUTTON_COLOR_KEYBOARD_BEIGE; buttonColor = BUTTON_COLOR_KEYBOARD_BEIGE;
buttonHoveredColor = BUTTON_COLOR_KEYBOARD_BEIGE_HOVERED; buttonHoveredColor = BUTTON_COLOR_KEYBOARD_BEIGE_HOVERED;
break; break;
case LUS::LUSDeviceIndex::Blue: case Ship::ShipDeviceIndex::Blue:
buttonColor = BUTTON_COLOR_GAMEPAD_BLUE; buttonColor = BUTTON_COLOR_GAMEPAD_BLUE;
buttonHoveredColor = BUTTON_COLOR_GAMEPAD_BLUE_HOVERED; buttonHoveredColor = BUTTON_COLOR_GAMEPAD_BLUE_HOVERED;
break; break;
case LUS::LUSDeviceIndex::Red: case Ship::ShipDeviceIndex::Red:
buttonColor = BUTTON_COLOR_GAMEPAD_RED; buttonColor = BUTTON_COLOR_GAMEPAD_RED;
buttonHoveredColor = BUTTON_COLOR_GAMEPAD_RED_HOVERED; buttonHoveredColor = BUTTON_COLOR_GAMEPAD_RED_HOVERED;
break; break;
case LUS::LUSDeviceIndex::Orange: case Ship::ShipDeviceIndex::Orange:
buttonColor = BUTTON_COLOR_GAMEPAD_ORANGE; buttonColor = BUTTON_COLOR_GAMEPAD_ORANGE;
buttonHoveredColor = BUTTON_COLOR_GAMEPAD_ORANGE_HOVERED; buttonHoveredColor = BUTTON_COLOR_GAMEPAD_ORANGE_HOVERED;
break; break;
case LUS::LUSDeviceIndex::Green: case Ship::ShipDeviceIndex::Green:
buttonColor = BUTTON_COLOR_GAMEPAD_GREEN; buttonColor = BUTTON_COLOR_GAMEPAD_GREEN;
buttonHoveredColor = BUTTON_COLOR_GAMEPAD_GREEN_HOVERED; buttonHoveredColor = BUTTON_COLOR_GAMEPAD_GREEN_HOVERED;
break; break;
@ -230,7 +230,7 @@ void SohInputEditorWindow::DrawButtonLineAddMappingButton(uint8_t port, uint16_t
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }
// todo: figure out why optional params (using id = "" in the definition) wasn't working // todo: figure out why optional params (using id = "" in the definition) wasn't working
if (mMappingInputBlockTimer == INT32_MAX && LUS::Context::GetInstance() if (mMappingInputBlockTimer == INT32_MAX && Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(port) ->GetControllerByPort(port)
->GetButton(bitmask) ->GetButton(bitmask)
@ -243,7 +243,7 @@ void SohInputEditorWindow::DrawButtonLineAddMappingButton(uint8_t port, uint16_t
} }
void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, uint16_t bitmask, std::string id) { void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, uint16_t bitmask, std::string id) {
auto mapping = LUS::Context::GetInstance() auto mapping = Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(port) ->GetControllerByPort(port)
->GetButton(bitmask) ->GetButton(bitmask)
@ -269,7 +269,7 @@ void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, uint16_
auto buttonHoveredColor = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered); auto buttonHoveredColor = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered);
auto physicalInputDisplayName = auto physicalInputDisplayName =
StringHelper::Sprintf("%s %s", icon.c_str(), mapping->GetPhysicalInputName().c_str()); StringHelper::Sprintf("%s %s", icon.c_str(), mapping->GetPhysicalInputName().c_str());
GetButtonColorsForLUSDeviceIndex(mapping->GetLUSDeviceIndex(), buttonColor, buttonHoveredColor); GetButtonColorsForLUSDeviceIndex(mapping->GetShipDeviceIndex(), buttonColor, buttonHoveredColor);
ImGui::PushStyleColor(ImGuiCol_Button, buttonColor); ImGui::PushStyleColor(ImGuiCol_Button, buttonColor);
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, buttonHoveredColor); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, buttonHoveredColor);
auto popupId = StringHelper::Sprintf("editButtonMappingPopup##%s", id.c_str()); auto popupId = StringHelper::Sprintf("editButtonMappingPopup##%s", id.c_str());
@ -292,7 +292,7 @@ void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, uint16_
mInputEditorPopupOpen = false; mInputEditorPopupOpen = false;
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }
if (mMappingInputBlockTimer == INT32_MAX && LUS::Context::GetInstance() if (mMappingInputBlockTimer == INT32_MAX && Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(port) ->GetControllerByPort(port)
->GetButton(bitmask) ->GetButton(bitmask)
@ -307,18 +307,18 @@ void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, uint16_
ImGui::SameLine(0, 0); ImGui::SameLine(0, 0);
#ifndef __WIIU__ #ifndef __WIIU__
auto sdlAxisDirectionToButtonMapping = std::dynamic_pointer_cast<LUS::SDLAxisDirectionToButtonMapping>(mapping); auto sdlAxisDirectionToButtonMapping = std::dynamic_pointer_cast<Ship::SDLAxisDirectionToButtonMapping>(mapping);
auto indexMapping = LUS::Context::GetInstance() auto indexMapping = Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetDeviceIndexMappingManager() ->GetDeviceIndexMappingManager()
->GetDeviceIndexMappingFromLUSDeviceIndex(mapping->GetLUSDeviceIndex()); ->GetDeviceIndexMappingFromShipDeviceIndex(mapping->GetShipDeviceIndex());
auto sdlIndexMapping = std::dynamic_pointer_cast<LUS::LUSDeviceIndexToSDLDeviceIndexMapping>(indexMapping); auto sdlIndexMapping = std::dynamic_pointer_cast<Ship::ShipDeviceIndexToSDLDeviceIndexMapping>(indexMapping);
if (sdlIndexMapping != nullptr && sdlAxisDirectionToButtonMapping != nullptr) { if (sdlIndexMapping != nullptr && sdlAxisDirectionToButtonMapping != nullptr) {
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0.0f, 0.5f)); ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0.0f, 0.5f));
auto buttonColor = ImGui::GetStyleColorVec4(ImGuiCol_Button); auto buttonColor = ImGui::GetStyleColorVec4(ImGuiCol_Button);
auto buttonHoveredColor = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered); auto buttonHoveredColor = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered);
GetButtonColorsForLUSDeviceIndex(mapping->GetLUSDeviceIndex(), buttonColor, buttonHoveredColor); GetButtonColorsForLUSDeviceIndex(mapping->GetShipDeviceIndex(), buttonColor, buttonHoveredColor);
ImGui::PushStyleColor(ImGuiCol_Button, buttonColor); ImGui::PushStyleColor(ImGuiCol_Button, buttonColor);
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, buttonHoveredColor); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, buttonHoveredColor);
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f)); ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f));
@ -433,7 +433,7 @@ void SohInputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, uint16_
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f)); ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f));
if (ImGui::Button(StringHelper::Sprintf("%s###removeButtonMappingButton%s", ICON_FA_TIMES, id.c_str()).c_str(), if (ImGui::Button(StringHelper::Sprintf("%s###removeButtonMappingButton%s", ICON_FA_TIMES, id.c_str()).c_str(),
ImVec2(ImGui::CalcTextSize(ICON_FA_TIMES).x + SCALE_IMGUI_SIZE(10.0f), 0.0f))) { ImVec2(ImGui::CalcTextSize(ICON_FA_TIMES).x + SCALE_IMGUI_SIZE(10.0f), 0.0f))) {
LUS::Context::GetInstance() Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(port) ->GetControllerByPort(port)
->GetButton(bitmask) ->GetButton(bitmask)
@ -459,7 +459,7 @@ void SohInputEditorWindow::DrawButtonLine(const char* buttonName, uint8_t port,
} }
void SohInputEditorWindow::DrawStickDirectionLineAddMappingButton(uint8_t port, uint8_t stick, void SohInputEditorWindow::DrawStickDirectionLineAddMappingButton(uint8_t port, uint8_t stick,
LUS::Direction direction) { Ship::Direction direction) {
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f)); ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f));
auto popupId = StringHelper::Sprintf("addStickDirectionMappingPopup##%d-%d-%d", port, stick, direction); auto popupId = StringHelper::Sprintf("addStickDirectionMappingPopup##%d-%d-%d", port, stick, direction);
if (ImGui::Button( if (ImGui::Button(
@ -477,9 +477,9 @@ void SohInputEditorWindow::DrawStickDirectionLineAddMappingButton(uint8_t port,
mInputEditorPopupOpen = false; mInputEditorPopupOpen = false;
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }
if (stick == LUS::LEFT) { if (stick == Ship::LEFT) {
if (mMappingInputBlockTimer == INT32_MAX && if (mMappingInputBlockTimer == INT32_MAX &&
LUS::Context::GetInstance() Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(port) ->GetControllerByPort(port)
->GetLeftStick() ->GetLeftStick()
@ -489,7 +489,7 @@ void SohInputEditorWindow::DrawStickDirectionLineAddMappingButton(uint8_t port,
} }
} else { } else {
if (mMappingInputBlockTimer == INT32_MAX && if (mMappingInputBlockTimer == INT32_MAX &&
LUS::Context::GetInstance() Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(port) ->GetControllerByPort(port)
->GetRightStick() ->GetRightStick()
@ -502,16 +502,16 @@ void SohInputEditorWindow::DrawStickDirectionLineAddMappingButton(uint8_t port,
} }
void SohInputEditorWindow::DrawStickDirectionLineEditMappingButton(uint8_t port, uint8_t stick, void SohInputEditorWindow::DrawStickDirectionLineEditMappingButton(uint8_t port, uint8_t stick,
LUS::Direction direction, std::string id) { Ship::Direction direction, std::string id) {
std::shared_ptr<LUS::ControllerAxisDirectionMapping> mapping = nullptr; std::shared_ptr<Ship::ControllerAxisDirectionMapping> mapping = nullptr;
if (stick == LUS::LEFT) { if (stick == Ship::LEFT) {
mapping = LUS::Context::GetInstance() mapping = Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(port) ->GetControllerByPort(port)
->GetLeftStick() ->GetLeftStick()
->GetAxisDirectionMappingById(direction, id); ->GetAxisDirectionMappingById(direction, id);
} else { } else {
mapping = LUS::Context::GetInstance() mapping = Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(port) ->GetControllerByPort(port)
->GetRightStick() ->GetRightStick()
@ -539,7 +539,7 @@ void SohInputEditorWindow::DrawStickDirectionLineEditMappingButton(uint8_t port,
auto buttonHoveredColor = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered); auto buttonHoveredColor = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered);
auto physicalInputDisplayName = auto physicalInputDisplayName =
StringHelper::Sprintf("%s %s", icon.c_str(), mapping->GetPhysicalInputName().c_str()); StringHelper::Sprintf("%s %s", icon.c_str(), mapping->GetPhysicalInputName().c_str());
GetButtonColorsForLUSDeviceIndex(mapping->GetLUSDeviceIndex(), buttonColor, buttonHoveredColor); GetButtonColorsForLUSDeviceIndex(mapping->GetShipDeviceIndex(), buttonColor, buttonHoveredColor);
ImGui::PushStyleColor(ImGuiCol_Button, buttonColor); ImGui::PushStyleColor(ImGuiCol_Button, buttonColor);
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, buttonHoveredColor); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, buttonHoveredColor);
auto popupId = StringHelper::Sprintf("editStickDirectionMappingPopup##%s", id.c_str()); auto popupId = StringHelper::Sprintf("editStickDirectionMappingPopup##%s", id.c_str());
@ -564,9 +564,9 @@ void SohInputEditorWindow::DrawStickDirectionLineEditMappingButton(uint8_t port,
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }
if (stick == LUS::LEFT) { if (stick == Ship::LEFT) {
if (mMappingInputBlockTimer == INT32_MAX && if (mMappingInputBlockTimer == INT32_MAX &&
LUS::Context::GetInstance() Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(port) ->GetControllerByPort(port)
->GetLeftStick() ->GetLeftStick()
@ -576,7 +576,7 @@ void SohInputEditorWindow::DrawStickDirectionLineEditMappingButton(uint8_t port,
} }
} else { } else {
if (mMappingInputBlockTimer == INT32_MAX && if (mMappingInputBlockTimer == INT32_MAX &&
LUS::Context::GetInstance() Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(port) ->GetControllerByPort(port)
->GetRightStick() ->GetRightStick()
@ -595,14 +595,14 @@ void SohInputEditorWindow::DrawStickDirectionLineEditMappingButton(uint8_t port,
if (ImGui::Button( if (ImGui::Button(
StringHelper::Sprintf("%s###removeStickDirectionMappingButton%s", ICON_FA_TIMES, id.c_str()).c_str(), StringHelper::Sprintf("%s###removeStickDirectionMappingButton%s", ICON_FA_TIMES, id.c_str()).c_str(),
ImVec2(ImGui::CalcTextSize(ICON_FA_TIMES).x + SCALE_IMGUI_SIZE(10.0f), 0.0f))) { ImVec2(ImGui::CalcTextSize(ICON_FA_TIMES).x + SCALE_IMGUI_SIZE(10.0f), 0.0f))) {
if (stick == LUS::LEFT) { if (stick == Ship::LEFT) {
LUS::Context::GetInstance() Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(port) ->GetControllerByPort(port)
->GetLeftStick() ->GetLeftStick()
->ClearAxisDirectionMapping(direction, id); ->ClearAxisDirectionMapping(direction, id);
} else { } else {
LUS::Context::GetInstance() Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(port) ->GetControllerByPort(port)
->GetRightStick() ->GetRightStick()
@ -616,7 +616,7 @@ void SohInputEditorWindow::DrawStickDirectionLineEditMappingButton(uint8_t port,
} }
void SohInputEditorWindow::DrawStickDirectionLine(const char* axisDirectionName, uint8_t port, uint8_t stick, void SohInputEditorWindow::DrawStickDirectionLine(const char* axisDirectionName, uint8_t port, uint8_t stick,
LUS::Direction direction, ImVec4 color = CHIP_COLOR_N64_GREY) { Ship::Direction direction, ImVec4 color = CHIP_COLOR_N64_GREY) {
ImGui::NewLine(); ImGui::NewLine();
ImGui::SameLine(); ImGui::SameLine();
ImGui::BeginDisabled(); ImGui::BeginDisabled();
@ -634,21 +634,21 @@ void SohInputEditorWindow::DrawStickDirectionLine(const char* axisDirectionName,
void SohInputEditorWindow::DrawStickSection(uint8_t port, uint8_t stick, int32_t id, void SohInputEditorWindow::DrawStickSection(uint8_t port, uint8_t stick, int32_t id,
ImVec4 color = CHIP_COLOR_N64_GREY) { ImVec4 color = CHIP_COLOR_N64_GREY) {
static int8_t sX, sY; static int8_t sX, sY;
std::shared_ptr<LUS::ControllerStick> controllerStick = nullptr; std::shared_ptr<Ship::ControllerStick> controllerStick = nullptr;
if (stick == LUS::LEFT) { if (stick == Ship::LEFT) {
controllerStick = LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetLeftStick(); controllerStick = Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetLeftStick();
} else { } else {
controllerStick = LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetRightStick(); controllerStick = Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetRightStick();
} }
controllerStick->Process(sX, sY); controllerStick->Process(sX, sY);
DrawAnalogPreview(StringHelper::Sprintf("##AnalogPreview%d", id).c_str(), ImVec2(sX, sY)); DrawAnalogPreview(StringHelper::Sprintf("##AnalogPreview%d", id).c_str(), ImVec2(sX, sY));
ImGui::SameLine(); ImGui::SameLine();
ImGui::BeginGroup(); ImGui::BeginGroup();
DrawStickDirectionLine(ICON_FA_ARROW_UP, port, stick, LUS::UP, color); DrawStickDirectionLine(ICON_FA_ARROW_UP, port, stick, Ship::UP, color);
DrawStickDirectionLine(ICON_FA_ARROW_DOWN, port, stick, LUS::DOWN, color); DrawStickDirectionLine(ICON_FA_ARROW_DOWN, port, stick, Ship::DOWN, color);
DrawStickDirectionLine(ICON_FA_ARROW_LEFT, port, stick, LUS::LEFT, color); DrawStickDirectionLine(ICON_FA_ARROW_LEFT, port, stick, Ship::LEFT, color);
DrawStickDirectionLine(ICON_FA_ARROW_RIGHT, port, stick, LUS::RIGHT, color); DrawStickDirectionLine(ICON_FA_ARROW_RIGHT, port, stick, Ship::RIGHT, color);
ImGui::EndGroup(); ImGui::EndGroup();
ImGui::SetNextItemOpen(true, ImGuiCond_Once); ImGui::SetNextItemOpen(true, ImGuiCond_Once);
if (ImGui::TreeNode(StringHelper::Sprintf("Analog Stick Options##%d", id).c_str())) { if (ImGui::TreeNode(StringHelper::Sprintf("Analog Stick Options##%d", id).c_str())) {
@ -776,7 +776,7 @@ void SohInputEditorWindow::UpdateBitmaskToMappingIds(uint8_t port) {
// todo: do we need this now that ControllerButton exists? // todo: do we need this now that ControllerButton exists?
for (auto [bitmask, button] : for (auto [bitmask, button] :
LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetAllButtons()) { Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetAllButtons()) {
for (auto [id, mapping] : button->GetAllButtonMappings()) { for (auto [id, mapping] : button->GetAllButtonMappings()) {
// using a vector here instead of a set because i want newly added mappings // using a vector here instead of a set because i want newly added mappings
// to go to the end of the list instead of autosorting // to go to the end of the list instead of autosorting
@ -791,12 +791,12 @@ void SohInputEditorWindow::UpdateBitmaskToMappingIds(uint8_t port) {
void SohInputEditorWindow::UpdateStickDirectionToMappingIds(uint8_t port) { void SohInputEditorWindow::UpdateStickDirectionToMappingIds(uint8_t port) {
// todo: do we need this? // todo: do we need this?
for (auto stick : for (auto stick :
{ std::make_pair<uint8_t, std::shared_ptr<LUS::ControllerStick>>( { std::make_pair<uint8_t, std::shared_ptr<Ship::ControllerStick>>(
LUS::LEFT, LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetLeftStick()), Ship::LEFT, Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetLeftStick()),
std::make_pair<uint8_t, std::shared_ptr<LUS::ControllerStick>>( std::make_pair<uint8_t, std::shared_ptr<Ship::ControllerStick>>(
LUS::RIGHT, Ship::RIGHT,
LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetRightStick()) }) { Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetRightStick()) }) {
for (auto direction : { LUS::LEFT, LUS::RIGHT, LUS::UP, LUS::DOWN }) { for (auto direction : { Ship::LEFT, Ship::RIGHT, Ship::UP, Ship::DOWN }) {
for (auto [id, mapping] : stick.second->GetAllAxisDirectionMappingByDirection(direction)) { for (auto [id, mapping] : stick.second->GetAllAxisDirectionMappingByDirection(direction)) {
// using a vector here instead of a set because i want newly added mappings // using a vector here instead of a set because i want newly added mappings
// to go to the end of the list instead of autosorting // to go to the end of the list instead of autosorting
@ -815,7 +815,7 @@ void SohInputEditorWindow::DrawRemoveRumbleMappingButton(uint8_t port, std::stri
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f)); ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f));
if (ImGui::Button(StringHelper::Sprintf("%s###removeRumbleMapping%s", ICON_FA_TIMES, id.c_str()).c_str(), if (ImGui::Button(StringHelper::Sprintf("%s###removeRumbleMapping%s", ICON_FA_TIMES, id.c_str()).c_str(),
ImVec2(SCALE_IMGUI_SIZE(20.0f), SCALE_IMGUI_SIZE(20.0f)))) { ImVec2(SCALE_IMGUI_SIZE(20.0f), SCALE_IMGUI_SIZE(20.0f)))) {
LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetRumble()->ClearRumbleMapping(id); Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetRumble()->ClearRumbleMapping(id);
} }
ImGui::PopStyleVar(); ImGui::PopStyleVar();
} }
@ -838,7 +838,7 @@ void SohInputEditorWindow::DrawAddRumbleMappingButton(uint8_t port) {
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }
if (mMappingInputBlockTimer == INT32_MAX && LUS::Context::GetInstance() if (mMappingInputBlockTimer == INT32_MAX && Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(port) ->GetControllerByPort(port)
->GetRumble() ->GetRumble()
@ -855,7 +855,7 @@ bool SohInputEditorWindow::TestingRumble() {
} }
void SohInputEditorWindow::DrawRumbleSection(uint8_t port) { void SohInputEditorWindow::DrawRumbleSection(uint8_t port) {
for (auto [id, mapping] : LUS::Context::GetInstance() for (auto [id, mapping] : Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(port) ->GetControllerByPort(port)
->GetRumble() ->GetRumble()
@ -864,7 +864,7 @@ void SohInputEditorWindow::DrawRumbleSection(uint8_t port) {
ImGui::SetNextItemOpen(true, ImGuiCond_Once); ImGui::SetNextItemOpen(true, ImGuiCond_Once);
auto buttonColor = ImGui::GetStyleColorVec4(ImGuiCol_Button); auto buttonColor = ImGui::GetStyleColorVec4(ImGuiCol_Button);
auto buttonHoveredColor = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered); auto buttonHoveredColor = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered);
GetButtonColorsForLUSDeviceIndex(mapping->GetLUSDeviceIndex(), buttonColor, buttonHoveredColor); GetButtonColorsForLUSDeviceIndex(mapping->GetShipDeviceIndex(), buttonColor, buttonHoveredColor);
// begin hackaround https://github.com/ocornut/imgui/issues/282#issuecomment-123763192 // begin hackaround https://github.com/ocornut/imgui/issues/282#issuecomment-123763192
// spaces to have background color for text in a tree node // spaces to have background color for text in a tree node
std::string spaces = ""; std::string spaces = "";
@ -998,7 +998,7 @@ void SohInputEditorWindow::DrawRemoveLEDMappingButton(uint8_t port, std::string
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f)); ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f));
if (ImGui::Button(StringHelper::Sprintf("%s###removeLEDMapping%s", ICON_FA_TIMES, id.c_str()).c_str(), if (ImGui::Button(StringHelper::Sprintf("%s###removeLEDMapping%s", ICON_FA_TIMES, id.c_str()).c_str(),
ImVec2(SCALE_IMGUI_SIZE(20.0f), SCALE_IMGUI_SIZE(20.0f)))) { ImVec2(SCALE_IMGUI_SIZE(20.0f), SCALE_IMGUI_SIZE(20.0f)))) {
LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetLED()->ClearLEDMapping(id); Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetLED()->ClearLEDMapping(id);
} }
ImGui::PopStyleVar(); ImGui::PopStyleVar();
} }
@ -1021,7 +1021,7 @@ void SohInputEditorWindow::DrawAddLEDMappingButton(uint8_t port) {
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }
if (mMappingInputBlockTimer == INT32_MAX && LUS::Context::GetInstance() if (mMappingInputBlockTimer == INT32_MAX && Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(port) ->GetControllerByPort(port)
->GetLED() ->GetLED()
@ -1035,7 +1035,7 @@ void SohInputEditorWindow::DrawAddLEDMappingButton(uint8_t port) {
void SohInputEditorWindow::DrawLEDSection(uint8_t port) { void SohInputEditorWindow::DrawLEDSection(uint8_t port) {
for (auto [id, mapping] : for (auto [id, mapping] :
LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetLED()->GetAllLEDMappings()) { Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetLED()->GetAllLEDMappings()) {
ImGui::AlignTextToFramePadding(); ImGui::AlignTextToFramePadding();
ImGui::SetNextItemOpen(true, ImGuiCond_Once); ImGui::SetNextItemOpen(true, ImGuiCond_Once);
auto open = ImGui::TreeNode( auto open = ImGui::TreeNode(
@ -1088,7 +1088,7 @@ void SohInputEditorWindow::DrawLEDSection(uint8_t port) {
color.b = colorVec.z * 255.0; color.b = colorVec.z * 255.0;
CVarSetColor24("gLedPort1Color", color); CVarSetColor24("gLedPort1Color", color);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text("Custom Color"); ImGui::Text("Custom Color");
@ -1116,7 +1116,7 @@ void SohInputEditorWindow::DrawRemoveGyroMappingButton(uint8_t port, std::string
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f)); ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(1.0f, 0.5f));
if (ImGui::Button(StringHelper::Sprintf("%s###removeGyroMapping%s", ICON_FA_TIMES, id.c_str()).c_str(), if (ImGui::Button(StringHelper::Sprintf("%s###removeGyroMapping%s", ICON_FA_TIMES, id.c_str()).c_str(),
ImVec2(SCALE_IMGUI_SIZE(20.0f), SCALE_IMGUI_SIZE(20.0f)))) { ImVec2(SCALE_IMGUI_SIZE(20.0f), SCALE_IMGUI_SIZE(20.0f)))) {
LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetGyro()->ClearGyroMapping(); Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetGyro()->ClearGyroMapping();
} }
ImGui::PopStyleVar(); ImGui::PopStyleVar();
} }
@ -1139,7 +1139,7 @@ void SohInputEditorWindow::DrawAddGyroMappingButton(uint8_t port) {
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }
if (mMappingInputBlockTimer == INT32_MAX && LUS::Context::GetInstance() if (mMappingInputBlockTimer == INT32_MAX && Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(port) ->GetControllerByPort(port)
->GetGyro() ->GetGyro()
@ -1153,7 +1153,7 @@ void SohInputEditorWindow::DrawAddGyroMappingButton(uint8_t port) {
void SohInputEditorWindow::DrawGyroSection(uint8_t port) { void SohInputEditorWindow::DrawGyroSection(uint8_t port) {
auto mapping = auto mapping =
LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetGyro()->GetGyroMapping(); Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(port)->GetGyro()->GetGyroMapping();
if (mapping != nullptr) { if (mapping != nullptr) {
auto id = mapping->GetGyroMappingId(); auto id = mapping->GetGyroMappingId();
ImGui::AlignTextToFramePadding(); ImGui::AlignTextToFramePadding();
@ -1236,28 +1236,28 @@ void SohInputEditorWindow::DrawGyroSection(uint8_t port) {
} }
void SohInputEditorWindow::DrawButtonDeviceIcons(uint8_t portIndex, std::set<uint16_t> bitmasks) { void SohInputEditorWindow::DrawButtonDeviceIcons(uint8_t portIndex, std::set<uint16_t> bitmasks) {
std::set<LUS::LUSDeviceIndex> allLusDeviceIndices; std::set<Ship::ShipDeviceIndex> allLusDeviceIndices;
allLusDeviceIndices.insert(LUS::LUSDeviceIndex::Keyboard); allLusDeviceIndices.insert(Ship::ShipDeviceIndex::Keyboard);
for (auto [lusIndex, mapping] : LUS::Context::GetInstance() for (auto [lusIndex, mapping] : Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetDeviceIndexMappingManager() ->GetDeviceIndexMappingManager()
->GetAllDeviceIndexMappingsFromConfig()) { ->GetAllDeviceIndexMappingsFromConfig()) {
allLusDeviceIndices.insert(lusIndex); allLusDeviceIndices.insert(lusIndex);
} }
std::vector<std::pair<LUS::LUSDeviceIndex, bool>> lusDeviceIndiciesWithMappings; std::vector<std::pair<Ship::ShipDeviceIndex, bool>> lusDeviceIndiciesWithMappings;
for (auto lusIndex : allLusDeviceIndices) { for (auto lusIndex : allLusDeviceIndices) {
for (auto [bitmask, button] : for (auto [bitmask, button] :
LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->GetAllButtons()) { Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->GetAllButtons()) {
if (!bitmasks.contains(bitmask)) { if (!bitmasks.contains(bitmask)) {
continue; continue;
} }
if (button->HasMappingsForLUSDeviceIndex(lusIndex)) { if (button->HasMappingsForShipDeviceIndex(lusIndex)) {
for (auto [id, mapping] : button->GetAllButtonMappings()) { for (auto [id, mapping] : button->GetAllButtonMappings()) {
if (mapping->GetLUSDeviceIndex() == lusIndex) { if (mapping->GetShipDeviceIndex() == lusIndex) {
lusDeviceIndiciesWithMappings.push_back( lusDeviceIndiciesWithMappings.push_back(
std::pair<LUS::LUSDeviceIndex, bool>(lusIndex, mapping->PhysicalDeviceIsConnected())); std::pair<Ship::ShipDeviceIndex, bool>(lusIndex, mapping->PhysicalDeviceIsConnected()));
break; break;
} }
} }
@ -1273,7 +1273,7 @@ void SohInputEditorWindow::DrawButtonDeviceIcons(uint8_t portIndex, std::set<uin
ImGui::PushStyleColor(ImGuiCol_Button, buttonColor); ImGui::PushStyleColor(ImGuiCol_Button, buttonColor);
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, buttonHoveredColor); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, buttonHoveredColor);
ImGui::SameLine(); ImGui::SameLine();
if (lusIndex == LUS::LUSDeviceIndex::Keyboard) { if (lusIndex == Ship::ShipDeviceIndex::Keyboard) {
ImGui::SmallButton(ICON_FA_KEYBOARD_O); ImGui::SmallButton(ICON_FA_KEYBOARD_O);
} else { } else {
ImGui::SmallButton(connected ? ICON_FA_GAMEPAD : ICON_FA_CHAIN_BROKEN); ImGui::SmallButton(connected ? ICON_FA_GAMEPAD : ICON_FA_CHAIN_BROKEN);
@ -1283,30 +1283,30 @@ void SohInputEditorWindow::DrawButtonDeviceIcons(uint8_t portIndex, std::set<uin
} }
} }
void SohInputEditorWindow::DrawAnalogStickDeviceIcons(uint8_t portIndex, LUS::Stick stick) { void SohInputEditorWindow::DrawAnalogStickDeviceIcons(uint8_t portIndex, Ship::Stick stick) {
std::set<LUS::LUSDeviceIndex> allLusDeviceIndices; std::set<Ship::ShipDeviceIndex> allLusDeviceIndices;
allLusDeviceIndices.insert(LUS::LUSDeviceIndex::Keyboard); allLusDeviceIndices.insert(Ship::ShipDeviceIndex::Keyboard);
for (auto [lusIndex, mapping] : LUS::Context::GetInstance() for (auto [lusIndex, mapping] : Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetDeviceIndexMappingManager() ->GetDeviceIndexMappingManager()
->GetAllDeviceIndexMappingsFromConfig()) { ->GetAllDeviceIndexMappingsFromConfig()) {
allLusDeviceIndices.insert(lusIndex); allLusDeviceIndices.insert(lusIndex);
} }
std::vector<std::pair<LUS::LUSDeviceIndex, bool>> lusDeviceIndiciesWithMappings; std::vector<std::pair<Ship::ShipDeviceIndex, bool>> lusDeviceIndiciesWithMappings;
for (auto lusIndex : allLusDeviceIndices) { for (auto lusIndex : allLusDeviceIndices) {
auto controllerStick = auto controllerStick =
stick == LUS::Stick::LEFT_STICK stick == Ship::Stick::LEFT_STICK
? LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->GetLeftStick() ? Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->GetLeftStick()
: LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->GetRightStick(); : Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->GetRightStick();
if (controllerStick->HasMappingsForLUSDeviceIndex(lusIndex)) { if (controllerStick->HasMappingsForShipDeviceIndex(lusIndex)) {
for (auto [direction, mappings] : controllerStick->GetAllAxisDirectionMappings()) { for (auto [direction, mappings] : controllerStick->GetAllAxisDirectionMappings()) {
bool foundMapping = false; bool foundMapping = false;
for (auto [id, mapping] : mappings) { for (auto [id, mapping] : mappings) {
if (mapping->GetLUSDeviceIndex() == lusIndex) { if (mapping->GetShipDeviceIndex() == lusIndex) {
foundMapping = true; foundMapping = true;
lusDeviceIndiciesWithMappings.push_back( lusDeviceIndiciesWithMappings.push_back(
std::pair<LUS::LUSDeviceIndex, bool>(lusIndex, mapping->PhysicalDeviceIsConnected())); std::pair<Ship::ShipDeviceIndex, bool>(lusIndex, mapping->PhysicalDeviceIsConnected()));
break; break;
} }
} }
@ -1324,7 +1324,7 @@ void SohInputEditorWindow::DrawAnalogStickDeviceIcons(uint8_t portIndex, LUS::St
ImGui::PushStyleColor(ImGuiCol_Button, buttonColor); ImGui::PushStyleColor(ImGuiCol_Button, buttonColor);
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, buttonHoveredColor); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, buttonHoveredColor);
ImGui::SameLine(); ImGui::SameLine();
if (lusIndex == LUS::LUSDeviceIndex::Keyboard) { if (lusIndex == Ship::ShipDeviceIndex::Keyboard) {
ImGui::SmallButton(ICON_FA_KEYBOARD_O); ImGui::SmallButton(ICON_FA_KEYBOARD_O);
} else { } else {
ImGui::SmallButton(connected ? ICON_FA_GAMEPAD : ICON_FA_CHAIN_BROKEN); ImGui::SmallButton(connected ? ICON_FA_GAMEPAD : ICON_FA_CHAIN_BROKEN);
@ -1335,29 +1335,29 @@ void SohInputEditorWindow::DrawAnalogStickDeviceIcons(uint8_t portIndex, LUS::St
} }
void SohInputEditorWindow::DrawRumbleDeviceIcons(uint8_t portIndex) { void SohInputEditorWindow::DrawRumbleDeviceIcons(uint8_t portIndex) {
std::set<LUS::LUSDeviceIndex> allLusDeviceIndices; std::set<Ship::ShipDeviceIndex> allLusDeviceIndices;
for (auto [lusIndex, mapping] : LUS::Context::GetInstance() for (auto [lusIndex, mapping] : Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetDeviceIndexMappingManager() ->GetDeviceIndexMappingManager()
->GetAllDeviceIndexMappingsFromConfig()) { ->GetAllDeviceIndexMappingsFromConfig()) {
allLusDeviceIndices.insert(lusIndex); allLusDeviceIndices.insert(lusIndex);
} }
std::vector<std::pair<LUS::LUSDeviceIndex, bool>> lusDeviceIndiciesWithMappings; std::vector<std::pair<Ship::ShipDeviceIndex, bool>> lusDeviceIndiciesWithMappings;
for (auto lusIndex : allLusDeviceIndices) { for (auto lusIndex : allLusDeviceIndices) {
if (LUS::Context::GetInstance() if (Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(portIndex) ->GetControllerByPort(portIndex)
->GetRumble() ->GetRumble()
->HasMappingsForLUSDeviceIndex(lusIndex)) { ->HasMappingsForShipDeviceIndex(lusIndex)) {
for (auto [id, mapping] : LUS::Context::GetInstance() for (auto [id, mapping] : Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(portIndex) ->GetControllerByPort(portIndex)
->GetRumble() ->GetRumble()
->GetAllRumbleMappings()) { ->GetAllRumbleMappings()) {
if (mapping->GetLUSDeviceIndex() == lusIndex) { if (mapping->GetShipDeviceIndex() == lusIndex) {
lusDeviceIndiciesWithMappings.push_back( lusDeviceIndiciesWithMappings.push_back(
std::pair<LUS::LUSDeviceIndex, bool>(lusIndex, mapping->PhysicalDeviceIsConnected())); std::pair<Ship::ShipDeviceIndex, bool>(lusIndex, mapping->PhysicalDeviceIsConnected()));
break; break;
} }
} }
@ -1379,14 +1379,14 @@ void SohInputEditorWindow::DrawRumbleDeviceIcons(uint8_t portIndex) {
void SohInputEditorWindow::DrawGyroDeviceIcons(uint8_t portIndex) { void SohInputEditorWindow::DrawGyroDeviceIcons(uint8_t portIndex) {
auto mapping = auto mapping =
LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->GetGyro()->GetGyroMapping(); Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->GetGyro()->GetGyroMapping();
if (mapping == nullptr) { if (mapping == nullptr) {
return; return;
} }
auto buttonColor = ImGui::GetStyleColorVec4(ImGuiCol_Button); auto buttonColor = ImGui::GetStyleColorVec4(ImGuiCol_Button);
auto buttonHoveredColor = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered); auto buttonHoveredColor = ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered);
GetButtonColorsForLUSDeviceIndex(mapping->GetLUSDeviceIndex(), buttonColor, buttonHoveredColor); GetButtonColorsForLUSDeviceIndex(mapping->GetShipDeviceIndex(), buttonColor, buttonHoveredColor);
ImGui::PushStyleColor(ImGuiCol_Button, buttonColor); ImGui::PushStyleColor(ImGuiCol_Button, buttonColor);
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, buttonHoveredColor); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, buttonHoveredColor);
ImGui::SameLine(); ImGui::SameLine();
@ -1396,29 +1396,29 @@ void SohInputEditorWindow::DrawGyroDeviceIcons(uint8_t portIndex) {
} }
void SohInputEditorWindow::DrawLEDDeviceIcons(uint8_t portIndex) { void SohInputEditorWindow::DrawLEDDeviceIcons(uint8_t portIndex) {
std::set<LUS::LUSDeviceIndex> allLusDeviceIndices; std::set<Ship::ShipDeviceIndex> allLusDeviceIndices;
for (auto [lusIndex, mapping] : LUS::Context::GetInstance() for (auto [lusIndex, mapping] : Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetDeviceIndexMappingManager() ->GetDeviceIndexMappingManager()
->GetAllDeviceIndexMappingsFromConfig()) { ->GetAllDeviceIndexMappingsFromConfig()) {
allLusDeviceIndices.insert(lusIndex); allLusDeviceIndices.insert(lusIndex);
} }
std::vector<std::pair<LUS::LUSDeviceIndex, bool>> lusDeviceIndiciesWithMappings; std::vector<std::pair<Ship::ShipDeviceIndex, bool>> lusDeviceIndiciesWithMappings;
for (auto lusIndex : allLusDeviceIndices) { for (auto lusIndex : allLusDeviceIndices) {
if (LUS::Context::GetInstance() if (Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(portIndex) ->GetControllerByPort(portIndex)
->GetRumble() ->GetRumble()
->HasMappingsForLUSDeviceIndex(lusIndex)) { ->HasMappingsForShipDeviceIndex(lusIndex)) {
for (auto [id, mapping] : LUS::Context::GetInstance() for (auto [id, mapping] : Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(portIndex) ->GetControllerByPort(portIndex)
->GetLED() ->GetLED()
->GetAllLEDMappings()) { ->GetAllLEDMappings()) {
if (mapping->GetLUSDeviceIndex() == lusIndex) { if (mapping->GetShipDeviceIndex() == lusIndex) {
lusDeviceIndiciesWithMappings.push_back( lusDeviceIndiciesWithMappings.push_back(
std::pair<LUS::LUSDeviceIndex, bool>(lusIndex, mapping->PhysicalDeviceIsConnected())); std::pair<Ship::ShipDeviceIndex, bool>(lusIndex, mapping->PhysicalDeviceIsConnected()));
break; break;
} }
} }
@ -1516,7 +1516,7 @@ void SohInputEditorWindow::DrawMapping(CustomButtonMap& mapping, float labelWidt
} }
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);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
} }
ImGui::EndCombo(); ImGui::EndCombo();
@ -1548,7 +1548,7 @@ void SohInputEditorWindow::DrawOcarinaControlPanel() {
ImGui::TableSetupColumn("Modifiers##CustomOcaranaModifiers", PANEL_TABLE_COLUMN_FLAGS); ImGui::TableSetupColumn("Modifiers##CustomOcaranaModifiers", PANEL_TABLE_COLUMN_FLAGS);
TableHelper::InitHeader(false); TableHelper::InitHeader(false);
LUS::GuiWindow::BeginGroupPanel("Notes", ImGui::GetContentRegionAvail()); Ship::GuiWindow::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);
@ -1557,16 +1557,16 @@ void SohInputEditorWindow::DrawOcarinaControlPanel() {
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();
LUS::GuiWindow::EndGroupPanel(0); Ship::GuiWindow::EndGroupPanel(0);
TableHelper::NextCol(); TableHelper::NextCol();
LUS::GuiWindow::BeginGroupPanel("Modifiers", ImGui::GetContentRegionAvail()); Ship::GuiWindow::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);
LUS::GuiWindow::EndGroupPanel(cursorY - ImGui::GetCursorPosY() + 2); Ship::GuiWindow::EndGroupPanel(cursorY - ImGui::GetCursorPosY() + 2);
ImGui::EndTable(); ImGui::EndTable();
} }
@ -1577,7 +1577,7 @@ void SohInputEditorWindow::DrawOcarinaControlPanel() {
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
} }
LUS::GuiWindow::BeginGroupPanel("Alternate controls", ImGui::GetContentRegionAvail()); Ship::GuiWindow::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);
@ -1589,7 +1589,7 @@ void SohInputEditorWindow::DrawOcarinaControlPanel() {
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
ImGui::EndTable(); ImGui::EndTable();
} }
LUS::GuiWindow::EndGroupPanel(0); Ship::GuiWindow::EndGroupPanel(0);
ImGui::EndTable(); ImGui::EndTable();
} }
@ -1597,7 +1597,7 @@ void SohInputEditorWindow::DrawOcarinaControlPanel() {
void SohInputEditorWindow::DrawCameraControlPanel() { void SohInputEditorWindow::DrawCameraControlPanel() {
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));
LUS::GuiWindow::BeginGroupPanel("Aiming/First-Person Camera", ImGui::GetContentRegionAvail()); Ship::GuiWindow::BeginGroupPanel("Aiming/First-Person Camera", ImGui::GetContentRegionAvail());
UIWidgets::PaddedEnhancementCheckbox("Right Stick Aiming", "gRightStickAiming"); UIWidgets::PaddedEnhancementCheckbox("Right Stick Aiming", "gRightStickAiming");
UIWidgets::Tooltip("Allows for aiming with the right stick in:\n-First-Person/C-Up view\n-Weapon Aiming"); UIWidgets::Tooltip("Allows for aiming with the right stick in:\n-First-Person/C-Up view\n-Weapon Aiming");
if (CVarGetInteger("gRightStickAiming", 0)) { if (CVarGetInteger("gRightStickAiming", 0)) {
@ -1629,12 +1629,12 @@ void SohInputEditorWindow::DrawCameraControlPanel() {
"gFirstPersonCameraSensitivityY", 0.01f, 5.0f, "", 1.0f, true); "gFirstPersonCameraSensitivityY", 0.01f, 5.0f, "", 1.0f, true);
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
LUS::GuiWindow::EndGroupPanel(0); Ship::GuiWindow::EndGroupPanel(0);
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
cursor = ImGui::GetCursorPos(); cursor = ImGui::GetCursorPos();
ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5)); ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5));
LUS::GuiWindow::BeginGroupPanel("Third-Person Camera", ImGui::GetContentRegionAvail()); Ship::GuiWindow::BeginGroupPanel("Third-Person Camera", ImGui::GetContentRegionAvail());
UIWidgets::PaddedEnhancementCheckbox("Free Camera", "gFreeCamera"); UIWidgets::PaddedEnhancementCheckbox("Free Camera", "gFreeCamera");
UIWidgets::Tooltip("Enables free camera control\nNote: You must remap C buttons off of the right stick in the " UIWidgets::Tooltip("Enables free camera control\nNote: You must remap C buttons off of the right stick in the "
@ -1652,13 +1652,13 @@ void SohInputEditorWindow::DrawCameraControlPanel() {
"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);
LUS::GuiWindow::EndGroupPanel(0); Ship::GuiWindow::EndGroupPanel(0);
} }
void SohInputEditorWindow::DrawDpadControlPanel() { void SohInputEditorWindow::DrawDpadControlPanel() {
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));
LUS::GuiWindow::BeginGroupPanel("D-Pad Options", ImGui::GetContentRegionAvail()); Ship::GuiWindow::BeginGroupPanel("D-Pad Options", ImGui::GetContentRegionAvail());
UIWidgets::PaddedEnhancementCheckbox("D-pad Support on Pause Screen", "gDpadPause"); UIWidgets::PaddedEnhancementCheckbox("D-pad Support on Pause Screen", "gDpadPause");
UIWidgets::Tooltip("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" UIWidgets::Tooltip("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");
@ -1667,13 +1667,13 @@ void SohInputEditorWindow::DrawDpadControlPanel() {
"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");
UIWidgets::Tooltip("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"); UIWidgets::Tooltip("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");
LUS::GuiWindow::EndGroupPanel(0); Ship::GuiWindow::EndGroupPanel(0);
} }
void SohInputEditorWindow::DrawMiscControlPanel() { void SohInputEditorWindow::DrawMiscControlPanel() {
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));
LUS::GuiWindow::BeginGroupPanel("Misc Controls", ImGui::GetContentRegionAvail()); Ship::GuiWindow::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);
@ -1685,24 +1685,24 @@ void SohInputEditorWindow::DrawMiscControlPanel() {
UIWidgets::Tooltip("Hold the assigned button to change the maximum walking or swimming speed"); UIWidgets::Tooltip("Hold the assigned button to change the maximum walking or swimming speed");
if (CVarGetInteger("gEnableWalkModify", 0)) { if (CVarGetInteger("gEnableWalkModify", 0)) {
UIWidgets::Spacer(5); UIWidgets::Spacer(5);
LUS::GuiWindow::BeginGroupPanel("Speed Modifier", ImGui::GetContentRegionAvail()); Ship::GuiWindow::BeginGroupPanel("Speed Modifier", ImGui::GetContentRegionAvail());
UIWidgets::PaddedEnhancementCheckbox("Toggle modifier instead of holding", "gWalkSpeedToggle", true, false); UIWidgets::PaddedEnhancementCheckbox("Toggle modifier instead of holding", "gWalkSpeedToggle", true, false);
LUS::GuiWindow::BeginGroupPanel("Walk Modifier", ImGui::GetContentRegionAvail()); Ship::GuiWindow::BeginGroupPanel("Walk Modifier", ImGui::GetContentRegionAvail());
UIWidgets::PaddedEnhancementCheckbox("Don't affect jump distance/velocity", "gWalkModifierDoesntChangeJump", true, false); UIWidgets::PaddedEnhancementCheckbox("Don't affect jump distance/velocity", "gWalkModifierDoesntChangeJump", true, false);
UIWidgets::PaddedEnhancementSliderFloat("Walk Modifier 1: %.0f %%", "##WalkMod1", "gWalkModifierOne", 0.0f, 5.0f, "", 1.0f, true, true, false, true); UIWidgets::PaddedEnhancementSliderFloat("Walk Modifier 1: %.0f %%", "##WalkMod1", "gWalkModifierOne", 0.0f, 5.0f, "", 1.0f, true, true, false, true);
UIWidgets::PaddedEnhancementSliderFloat("Walk Modifier 2: %.0f %%", "##WalkMod2", "gWalkModifierTwo", 0.0f, 5.0f, "", 1.0f, true, true, false, true); UIWidgets::PaddedEnhancementSliderFloat("Walk Modifier 2: %.0f %%", "##WalkMod2", "gWalkModifierTwo", 0.0f, 5.0f, "", 1.0f, true, true, false, true);
LUS::GuiWindow::EndGroupPanel(0); Ship::GuiWindow::EndGroupPanel(0);
LUS::GuiWindow::BeginGroupPanel("Swim Modifier", ImGui::GetContentRegionAvail()); Ship::GuiWindow::BeginGroupPanel("Swim Modifier", ImGui::GetContentRegionAvail());
UIWidgets::PaddedEnhancementSliderFloat("Swim Modifier 1: %.0f %%", "##SwimMod1", "gSwimModifierOne", 0.0f, 5.0f, "", 1.0f, true, true, false, true); UIWidgets::PaddedEnhancementSliderFloat("Swim Modifier 1: %.0f %%", "##SwimMod1", "gSwimModifierOne", 0.0f, 5.0f, "", 1.0f, true, true, false, true);
UIWidgets::PaddedEnhancementSliderFloat("Swim Modifier 2: %.0f %%", "##SwimMod2", "gSwimModifierTwo", 0.0f, 5.0f, "", 1.0f, true, true, false, true); UIWidgets::PaddedEnhancementSliderFloat("Swim Modifier 2: %.0f %%", "##SwimMod2", "gSwimModifierTwo", 0.0f, 5.0f, "", 1.0f, true, true, false, true);
LUS::GuiWindow::EndGroupPanel(0); Ship::GuiWindow::EndGroupPanel(0);
LUS::GuiWindow::EndGroupPanel(0); Ship::GuiWindow::EndGroupPanel(0);
} }
ImGui::EndDisabled(); ImGui::EndDisabled();
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
UIWidgets::PaddedEnhancementCheckbox("Answer Navi Prompt with L Button", "gNaviOnL"); UIWidgets::PaddedEnhancementCheckbox("Answer Navi Prompt with L Button", "gNaviOnL");
UIWidgets::Tooltip("Speak to Navi with L but enter first-person camera with C-Up"); UIWidgets::Tooltip("Speak to Navi with L but enter first-person camera with C-Up");
LUS::GuiWindow::EndGroupPanel(0); Ship::GuiWindow::EndGroupPanel(0);
} }
void SohInputEditorWindow::DrawLinkTab() { void SohInputEditorWindow::DrawLinkTab() {
@ -1749,17 +1749,17 @@ void SohInputEditorWindow::DrawLinkTab() {
} }
if (ImGui::CollapsingHeader("Analog Stick", NULL, ImGuiTreeNodeFlags_DefaultOpen)) { if (ImGui::CollapsingHeader("Analog Stick", NULL, ImGuiTreeNodeFlags_DefaultOpen)) {
DrawAnalogStickDeviceIcons(portIndex, LUS::LEFT_STICK); DrawAnalogStickDeviceIcons(portIndex, Ship::LEFT_STICK);
DrawStickSection(portIndex, LUS::LEFT, 0); DrawStickSection(portIndex, Ship::LEFT, 0);
} else { } else {
DrawAnalogStickDeviceIcons(portIndex, LUS::LEFT_STICK); DrawAnalogStickDeviceIcons(portIndex, Ship::LEFT_STICK);
} }
if (ImGui::CollapsingHeader("Additional (\"Right\") Stick")) { if (ImGui::CollapsingHeader("Additional (\"Right\") Stick")) {
DrawAnalogStickDeviceIcons(portIndex, LUS::RIGHT_STICK); DrawAnalogStickDeviceIcons(portIndex, Ship::RIGHT_STICK);
DrawStickSection(portIndex, LUS::RIGHT, 1, CHIP_COLOR_N64_YELLOW); DrawStickSection(portIndex, Ship::RIGHT, 1, CHIP_COLOR_N64_YELLOW);
} else { } else {
DrawAnalogStickDeviceIcons(portIndex, LUS::RIGHT_STICK); DrawAnalogStickDeviceIcons(portIndex, Ship::RIGHT_STICK);
} }
if (ImGui::CollapsingHeader("Rumble")) { if (ImGui::CollapsingHeader("Rumble")) {
@ -1884,10 +1884,10 @@ void SohInputEditorWindow::DrawIvanTab() {
} }
if (ImGui::CollapsingHeader("Analog Stick", NULL, ImGuiTreeNodeFlags_DefaultOpen)) { if (ImGui::CollapsingHeader("Analog Stick", NULL, ImGuiTreeNodeFlags_DefaultOpen)) {
DrawAnalogStickDeviceIcons(portIndex, LUS::LEFT_STICK); DrawAnalogStickDeviceIcons(portIndex, Ship::LEFT_STICK);
DrawStickSection(portIndex, LUS::LEFT, 0); DrawStickSection(portIndex, Ship::LEFT, 0);
} else { } else {
DrawAnalogStickDeviceIcons(portIndex, LUS::LEFT_STICK); DrawAnalogStickDeviceIcons(portIndex, Ship::LEFT_STICK);
} }
ImGui::PopStyleColor(); ImGui::PopStyleColor();
@ -1942,10 +1942,10 @@ void SohInputEditorWindow::DrawDebugPortTab(uint8_t portIndex, std::string custo
} }
if (ImGui::CollapsingHeader("Analog Stick", NULL, ImGuiTreeNodeFlags_DefaultOpen)) { if (ImGui::CollapsingHeader("Analog Stick", NULL, ImGuiTreeNodeFlags_DefaultOpen)) {
DrawAnalogStickDeviceIcons(portIndex, LUS::LEFT_STICK); DrawAnalogStickDeviceIcons(portIndex, Ship::LEFT_STICK);
DrawStickSection(portIndex, LUS::LEFT, 0); DrawStickSection(portIndex, Ship::LEFT, 0);
} else { } else {
DrawAnalogStickDeviceIcons(portIndex, LUS::LEFT_STICK); DrawAnalogStickDeviceIcons(portIndex, Ship::LEFT_STICK);
} }
ImGui::PopStyleColor(); ImGui::PopStyleColor();
@ -1965,7 +1965,7 @@ void SohInputEditorWindow::DrawClearAllButton(uint8_t portIndex) {
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }
if (ImGui::Button("Clear All")) { if (ImGui::Button("Clear All")) {
LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->ClearAllMappings(); Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->ClearAllMappings();
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }
ImGui::EndPopup(); ImGui::EndPopup();
@ -1983,12 +1983,12 @@ void SohInputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) {
ImGui::PopStyleVar(); ImGui::PopStyleVar();
if (ImGui::BeginPopup(popupId.c_str())) { if (ImGui::BeginPopup(popupId.c_str())) {
std::map<LUS::LUSDeviceIndex, std::pair<std::string, int32_t>> indexMappings; std::map<Ship::ShipDeviceIndex, std::pair<std::string, int32_t>> indexMappings;
for (auto [lusIndex, mapping] : LUS::Context::GetInstance() for (auto [lusIndex, mapping] : Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetDeviceIndexMappingManager() ->GetDeviceIndexMappingManager()
->GetAllDeviceIndexMappings()) { ->GetAllDeviceIndexMappings()) {
auto wiiuIndexMapping = std::static_pointer_cast<LUS::LUSDeviceIndexToWiiUDeviceIndexMapping>(mapping); auto wiiuIndexMapping = std::static_pointer_cast<Ship::ShipDeviceIndexToWiiUDeviceIndexMapping>(mapping);
if (wiiuIndexMapping == nullptr) { if (wiiuIndexMapping == nullptr) {
continue; continue;
} }
@ -2025,11 +2025,11 @@ void SohInputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) {
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }
if (ImGui::Button("Set defaults")) { if (ImGui::Button("Set defaults")) {
LUS::Context::GetInstance() Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(portIndex) ->GetControllerByPort(portIndex)
->ClearAllMappingsForDevice(lusIndex); ->ClearAllMappingsForDevice(lusIndex);
LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->AddDefaultMappings( Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->AddDefaultMappings(
lusIndex); lusIndex);
shouldClose = true; shouldClose = true;
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
@ -2048,12 +2048,12 @@ void SohInputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) {
void SohInputEditorWindow::DrawDevicesTab() { void SohInputEditorWindow::DrawDevicesTab() {
if (ImGui::BeginTabItem("Devices")) { if (ImGui::BeginTabItem("Devices")) {
std::map<LUS::LUSDeviceIndex, std::pair<std::string, int32_t>> indexMappings; std::map<Ship::ShipDeviceIndex, std::pair<std::string, int32_t>> indexMappings;
for (auto [lusIndex, mapping] : LUS::Context::GetInstance() for (auto [lusIndex, mapping] : Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetDeviceIndexMappingManager() ->GetDeviceIndexMappingManager()
->GetAllDeviceIndexMappingsFromConfig()) { ->GetAllDeviceIndexMappingsFromConfig()) {
auto wiiuIndexMapping = std::static_pointer_cast<LUS::LUSDeviceIndexToWiiUDeviceIndexMapping>(mapping); auto wiiuIndexMapping = std::static_pointer_cast<Ship::ShipDeviceIndexToWiiUDeviceIndexMapping>(mapping);
if (wiiuIndexMapping == nullptr) { if (wiiuIndexMapping == nullptr) {
continue; continue;
} }
@ -2061,11 +2061,11 @@ void SohInputEditorWindow::DrawDevicesTab() {
indexMappings[lusIndex] = { wiiuIndexMapping->GetWiiUControllerName(), -1 }; indexMappings[lusIndex] = { wiiuIndexMapping->GetWiiUControllerName(), -1 };
} }
for (auto [lusIndex, mapping] : LUS::Context::GetInstance() for (auto [lusIndex, mapping] : Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetDeviceIndexMappingManager() ->GetDeviceIndexMappingManager()
->GetAllDeviceIndexMappings()) { ->GetAllDeviceIndexMappings()) {
auto wiiuIndexMapping = std::static_pointer_cast<LUS::LUSDeviceIndexToWiiUDeviceIndexMapping>(mapping); auto wiiuIndexMapping = std::static_pointer_cast<Ship::ShipDeviceIndexToWiiUDeviceIndexMapping>(mapping);
if (wiiuIndexMapping == nullptr) { if (wiiuIndexMapping == nullptr) {
continue; continue;
} }
@ -2108,12 +2108,12 @@ void SohInputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) {
} }
if (ImGui::BeginPopup(popupId.c_str())) { if (ImGui::BeginPopup(popupId.c_str())) {
std::map<LUS::LUSDeviceIndex, std::pair<std::string, int32_t>> indexMappings; std::map<Ship::ShipDeviceIndex, std::pair<std::string, int32_t>> indexMappings;
for (auto [lusIndex, mapping] : LUS::Context::GetInstance() for (auto [lusIndex, mapping] : Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetDeviceIndexMappingManager() ->GetDeviceIndexMappingManager()
->GetAllDeviceIndexMappings()) { ->GetAllDeviceIndexMappings()) {
auto sdlIndexMapping = std::static_pointer_cast<LUS::LUSDeviceIndexToSDLDeviceIndexMapping>(mapping); auto sdlIndexMapping = std::static_pointer_cast<Ship::ShipDeviceIndexToSDLDeviceIndexMapping>(mapping);
if (sdlIndexMapping == nullptr) { if (sdlIndexMapping == nullptr) {
continue; continue;
} }
@ -2136,12 +2136,12 @@ void SohInputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) {
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }
if (ImGui::Button("Set defaults")) { if (ImGui::Button("Set defaults")) {
LUS::Context::GetInstance() Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(portIndex) ->GetControllerByPort(portIndex)
->ClearAllMappingsForDevice(LUS::LUSDeviceIndex::Keyboard); ->ClearAllMappingsForDevice(Ship::ShipDeviceIndex::Keyboard);
LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->AddDefaultMappings( Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->AddDefaultMappings(
LUS::LUSDeviceIndex::Keyboard); Ship::ShipDeviceIndex::Keyboard);
shouldClose = true; shouldClose = true;
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }
@ -2171,11 +2171,11 @@ void SohInputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) {
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }
if (ImGui::Button("Set defaults")) { if (ImGui::Button("Set defaults")) {
LUS::Context::GetInstance() Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(portIndex) ->GetControllerByPort(portIndex)
->ClearAllMappingsForDevice(lusIndex); ->ClearAllMappingsForDevice(lusIndex);
LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->AddDefaultMappings( Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(portIndex)->AddDefaultMappings(
lusIndex); lusIndex);
shouldClose = true; shouldClose = true;
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
@ -2194,12 +2194,12 @@ void SohInputEditorWindow::DrawSetDefaultsButton(uint8_t portIndex) {
void SohInputEditorWindow::DrawDevicesTab() { void SohInputEditorWindow::DrawDevicesTab() {
if (ImGui::BeginTabItem("Devices")) { if (ImGui::BeginTabItem("Devices")) {
std::map<LUS::LUSDeviceIndex, std::pair<std::string, int32_t>> indexMappings; std::map<Ship::ShipDeviceIndex, std::pair<std::string, int32_t>> indexMappings;
for (auto [lusIndex, mapping] : LUS::Context::GetInstance() for (auto [lusIndex, mapping] : Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetDeviceIndexMappingManager() ->GetDeviceIndexMappingManager()
->GetAllDeviceIndexMappingsFromConfig()) { ->GetAllDeviceIndexMappingsFromConfig()) {
auto sdlIndexMapping = std::static_pointer_cast<LUS::LUSDeviceIndexToSDLDeviceIndexMapping>(mapping); auto sdlIndexMapping = std::static_pointer_cast<Ship::ShipDeviceIndexToSDLDeviceIndexMapping>(mapping);
if (sdlIndexMapping == nullptr) { if (sdlIndexMapping == nullptr) {
continue; continue;
} }
@ -2207,11 +2207,11 @@ void SohInputEditorWindow::DrawDevicesTab() {
indexMappings[lusIndex] = { sdlIndexMapping->GetSDLControllerName(), -1 }; indexMappings[lusIndex] = { sdlIndexMapping->GetSDLControllerName(), -1 };
} }
for (auto [lusIndex, mapping] : LUS::Context::GetInstance() for (auto [lusIndex, mapping] : Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetDeviceIndexMappingManager() ->GetDeviceIndexMappingManager()
->GetAllDeviceIndexMappings()) { ->GetAllDeviceIndexMappings()) {
auto sdlIndexMapping = std::static_pointer_cast<LUS::LUSDeviceIndexToSDLDeviceIndexMapping>(mapping); auto sdlIndexMapping = std::static_pointer_cast<Ship::ShipDeviceIndexToSDLDeviceIndexMapping>(mapping);
if (sdlIndexMapping == nullptr) { if (sdlIndexMapping == nullptr) {
continue; continue;
} }

View File

@ -20,7 +20,7 @@ typedef struct {
N64ButtonMask defaultBtn; N64ButtonMask defaultBtn;
} CustomButtonMap; } CustomButtonMap;
class SohInputEditorWindow : public LUS::GuiWindow { class SohInputEditorWindow : public Ship::GuiWindow {
public: public:
using GuiWindow::GuiWindow; using GuiWindow::GuiWindow;
~SohInputEditorWindow(); ~SohInputEditorWindow();
@ -38,14 +38,14 @@ class SohInputEditorWindow : public LUS::GuiWindow {
void UpdateElement() override; void UpdateElement() override;
private: private:
void DrawStickDirectionLine(const char* axisDirectionName, uint8_t port, uint8_t stick, LUS::Direction direction, void DrawStickDirectionLine(const char* axisDirectionName, uint8_t port, uint8_t stick, Ship::Direction direction,
ImVec4 color); ImVec4 color);
void DrawButtonLine(const char* buttonName, uint8_t port, uint16_t bitmask, ImVec4 color); void DrawButtonLine(const char* buttonName, uint8_t port, uint16_t bitmask, ImVec4 color);
void DrawButtonLineEditMappingButton(uint8_t port, uint16_t bitmask, std::string id); void DrawButtonLineEditMappingButton(uint8_t port, uint16_t bitmask, std::string id);
void DrawButtonLineAddMappingButton(uint8_t port, uint16_t bitmask); void DrawButtonLineAddMappingButton(uint8_t port, uint16_t bitmask);
void DrawStickDirectionLineEditMappingButton(uint8_t port, uint8_t stick, LUS::Direction direction, std::string id); void DrawStickDirectionLineEditMappingButton(uint8_t port, uint8_t stick, Ship::Direction direction, std::string id);
void DrawStickDirectionLineAddMappingButton(uint8_t port, uint8_t stick, LUS::Direction direction); void DrawStickDirectionLineAddMappingButton(uint8_t port, uint8_t stick, Ship::Direction direction);
void DrawStickSection(uint8_t port, uint8_t stick, int32_t id, ImVec4 color); void DrawStickSection(uint8_t port, uint8_t stick, int32_t id, ImVec4 color);
void DrawRumbleSection(uint8_t port); void DrawRumbleSection(uint8_t port);
@ -74,20 +74,20 @@ class SohInputEditorWindow : public LUS::GuiWindow {
int32_t mGameInputBlockTimer; int32_t mGameInputBlockTimer;
int32_t mMappingInputBlockTimer; int32_t mMappingInputBlockTimer;
int32_t mRumbleTimer; int32_t mRumbleTimer;
std::shared_ptr<LUS::ControllerRumbleMapping> mRumbleMappingToTest; std::shared_ptr<Ship::ControllerRumbleMapping> mRumbleMappingToTest;
// mBitmaskToMappingIds[port][bitmask] = { id0, id1, ... } // mBitmaskToMappingIds[port][bitmask] = { id0, id1, ... }
std::unordered_map<uint8_t, std::unordered_map<uint16_t, std::vector<std::string>>> mBitmaskToMappingIds; std::unordered_map<uint8_t, std::unordered_map<uint16_t, std::vector<std::string>>> mBitmaskToMappingIds;
// mStickDirectionToMappingIds[port][stick][direction] = { id0, id1, ... } // mStickDirectionToMappingIds[port][stick][direction] = { id0, id1, ... }
std::unordered_map<uint8_t, std::unordered_map<uint8_t,
std::unordered_map<uint8_t, std::unordered_map<LUS::Direction, std::vector<std::string>>>> std::unordered_map<uint8_t, std::unordered_map<Ship::Direction, std::vector<std::string>>>>
mStickDirectionToMappingIds; mStickDirectionToMappingIds;
void UpdateBitmaskToMappingIds(uint8_t port); void UpdateBitmaskToMappingIds(uint8_t port);
void UpdateStickDirectionToMappingIds(uint8_t port); void UpdateStickDirectionToMappingIds(uint8_t port);
void GetButtonColorsForLUSDeviceIndex(LUS::LUSDeviceIndex lusIndex, ImVec4& buttonColor, void GetButtonColorsForLUSDeviceIndex(Ship::ShipDeviceIndex lusIndex, ImVec4& buttonColor,
ImVec4& buttonHoveredColor); ImVec4& buttonHoveredColor);
void DrawLinkTab(); void DrawLinkTab();
void DrawIvanTab(); void DrawIvanTab();
@ -97,7 +97,7 @@ class SohInputEditorWindow : public LUS::GuiWindow {
std::set<uint16_t> mDpadBitmasks; std::set<uint16_t> mDpadBitmasks;
std::set<uint16_t> mModifierButtonsBitmasks; std::set<uint16_t> mModifierButtonsBitmasks;
void DrawButtonDeviceIcons(uint8_t portIndex, std::set<uint16_t> bitmasks); void DrawButtonDeviceIcons(uint8_t portIndex, std::set<uint16_t> bitmasks);
void DrawAnalogStickDeviceIcons(uint8_t portIndex, LUS::Stick stick); void DrawAnalogStickDeviceIcons(uint8_t portIndex, Ship::Stick stick);
void DrawRumbleDeviceIcons(uint8_t portIndex); void DrawRumbleDeviceIcons(uint8_t portIndex);
void DrawGyroDeviceIcons(uint8_t portIndex); void DrawGyroDeviceIcons(uint8_t portIndex);
void DrawLEDDeviceIcons(uint8_t portIndex); void DrawLEDDeviceIcons(uint8_t portIndex);

View File

@ -1322,7 +1322,7 @@ void Draw_Placements(){
if (ImGui::Button("Reset##EnemyHealthBarWidth")) { if (ImGui::Button("Reset##EnemyHealthBarWidth")) {
CVarClear(CVAR_COSMETIC("HUD.EnemyHealthBarWidth.Value")); CVarClear(CVAR_COSMETIC("HUD.EnemyHealthBarWidth.Value"));
CVarClear(CVAR_COSMETIC("HUD.EnemyHealthBarWidth.Changed")); CVarClear(CVAR_COSMETIC("HUD.EnemyHealthBarWidth.Changed"));
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
ImGui::NewLine(); ImGui::NewLine();
ImGui::EndTable(); ImGui::EndTable();
@ -1333,7 +1333,7 @@ void Reset_Option_Single(const char* Button_Title, const char* name) {
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(Button_Title)) { if (ImGui::Button(Button_Title)) {
CVarClear(name); CVarClear(name);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
} }
void Reset_Option_Double(const char* Button_Title, const char* name) { void Reset_Option_Double(const char* Button_Title, const char* name) {
@ -1341,14 +1341,14 @@ void Reset_Option_Double(const char* Button_Title, const char* name) {
if (ImGui::Button(Button_Title)) { if (ImGui::Button(Button_Title)) {
CVarClear((std::string(name) + ".Value").c_str()); CVarClear((std::string(name) + ".Value").c_str());
CVarClear((std::string(name) + ".Changed").c_str()); CVarClear((std::string(name) + ".Changed").c_str());
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
} }
void DrawSillyTab() { void DrawSillyTab() {
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0)); ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
if (CVarGetInteger("gLetItSnow", 0)) { if (CVarGetInteger("gLetItSnow", 0)) {
if (UIWidgets::EnhancementCheckbox("Let It Snow", "gLetItSnow")) { if (UIWidgets::EnhancementCheckbox("Let It Snow", "gLetItSnow")) {
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
} }
if (UIWidgets::EnhancementSliderFloat("Link Body Scale: %.3fx", "##Link_BodyScale", CVAR_COSMETIC("Link.BodyScale.Value"), 0.001f, 0.025f, "", 0.01f, true)) { if (UIWidgets::EnhancementSliderFloat("Link Body Scale: %.3fx", "##Link_BodyScale", CVAR_COSMETIC("Link.BodyScale.Value"), 0.001f, 0.025f, "", 0.01f, true)) {
@ -1358,7 +1358,7 @@ void DrawSillyTab() {
if (ImGui::Button("Reset##Link_BodyScale")) { if (ImGui::Button("Reset##Link_BodyScale")) {
CVarClear(CVAR_COSMETIC("Link.BodyScale.Value")); CVarClear(CVAR_COSMETIC("Link.BodyScale.Value"));
CVarClear(CVAR_COSMETIC("Link.BodyScale.Changed")); CVarClear(CVAR_COSMETIC("Link.BodyScale.Changed"));
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
if (gPlayState != nullptr) { if (gPlayState != nullptr) {
static Player* player = GET_PLAYER(gPlayState); static Player* player = GET_PLAYER(gPlayState);
player->actor.scale.x = 0.01f; player->actor.scale.x = 0.01f;
@ -1612,7 +1612,7 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) {
CVarSetInteger((cosmeticOption.changedCvar), 1); CVarSetInteger((cosmeticOption.changedCvar), 1);
ApplySideEffects(cosmeticOption); ApplySideEffects(cosmeticOption);
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text("%s", cosmeticOption.label.c_str()); ImGui::Text("%s", cosmeticOption.label.c_str());
@ -1620,7 +1620,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();
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
if (cosmeticOption.supportsRainbow) { if (cosmeticOption.supportsRainbow) {
ImGui::SameLine(); ImGui::SameLine();
@ -1630,21 +1630,21 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) {
CVarSetInteger((cosmeticOption.changedCvar), 1); CVarSetInteger((cosmeticOption.changedCvar), 1);
ApplySideEffects(cosmeticOption); ApplySideEffects(cosmeticOption);
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
} }
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);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
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();
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
} }
} }
@ -1660,7 +1660,7 @@ void DrawCosmeticGroup(CosmeticGroup cosmeticGroup) {
} }
} }
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(("Reset##" + label).c_str())) { if (ImGui::Button(("Reset##" + label).c_str())) {
@ -1670,7 +1670,7 @@ void DrawCosmeticGroup(CosmeticGroup cosmeticGroup) {
} }
} }
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
for (auto& [id, cosmeticOption] : cosmeticOptions) { for (auto& [id, cosmeticOption] : cosmeticOptions) {
if (cosmeticOption.group == cosmeticGroup && (!cosmeticOption.advancedOption || CVarGetInteger(CVAR_COSMETIC("AdvancedMode"), 0))) { if (cosmeticOption.group == cosmeticGroup && (!cosmeticOption.advancedOption || CVarGetInteger(CVAR_COSMETIC("AdvancedMode"), 0))) {
@ -1706,7 +1706,7 @@ void CosmeticsEditorWindow::DrawElement() {
CVarSetInteger(cosmeticOption.lockedCvar, 1); CVarSetInteger(cosmeticOption.lockedCvar, 1);
} }
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
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))) {
@ -1715,7 +1715,7 @@ void CosmeticsEditorWindow::DrawElement() {
CVarSetInteger(cosmeticOption.lockedCvar, 0); CVarSetInteger(cosmeticOption.lockedCvar, 0);
} }
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
} }
UIWidgets::EnhancementCheckbox("Sync Rainbow colors", CVAR_COSMETIC("RainbowSync")); UIWidgets::EnhancementCheckbox("Sync Rainbow colors", CVAR_COSMETIC("RainbowSync"));
@ -1734,7 +1734,7 @@ void CosmeticsEditorWindow::DrawElement() {
} }
} }
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
if (ImGui::Button("Lock All", ImVec2(ImGui::GetContentRegionAvail().x / 2, 30.0f))) { if (ImGui::Button("Lock All", ImVec2(ImGui::GetContentRegionAvail().x / 2, 30.0f))) {
@ -1743,7 +1743,7 @@ void CosmeticsEditorWindow::DrawElement() {
CVarSetInteger(cosmeticOption.lockedCvar, 1); CVarSetInteger(cosmeticOption.lockedCvar, 1);
} }
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
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))) {
@ -1752,7 +1752,7 @@ void CosmeticsEditorWindow::DrawElement() {
CVarSetInteger(cosmeticOption.lockedCvar, 0); CVarSetInteger(cosmeticOption.lockedCvar, 0);
} }
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
if (ImGui::BeginTabBar("CosmeticsContextTabBar", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) { if (ImGui::BeginTabBar("CosmeticsContextTabBar", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) {
@ -1777,7 +1777,7 @@ void CosmeticsEditorWindow::DrawElement() {
if (ImGui::Button("Reset##Trails_Duration")) { if (ImGui::Button("Reset##Trails_Duration")) {
CVarClear(CVAR_COSMETIC("Trails.Duration.Value")); CVarClear(CVAR_COSMETIC("Trails.Duration.Value"));
CVarClear(CVAR_COSMETIC("Trails.Duration.Changed")); CVarClear(CVAR_COSMETIC("Trails.Duration.Changed"));
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
@ -1843,7 +1843,7 @@ void CosmeticsEditorWindow::InitElement() {
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;
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
ApplyAuthenticGfxPatches(); ApplyAuthenticGfxPatches();
@ -1860,7 +1860,7 @@ void CosmeticsEditor_RandomizeAll() {
} }
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
} }
@ -1873,7 +1873,7 @@ void CosmeticsEditor_RandomizeGroup(CosmeticGroup group) {
} }
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
} }
@ -1884,7 +1884,7 @@ void CosmeticsEditor_ResetAll() {
} }
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
} }
@ -1895,6 +1895,6 @@ void CosmeticsEditor_ResetGroup(CosmeticGroup group) {
} }
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
} }

View File

@ -54,7 +54,7 @@ void CosmeticsEditor_ResetAll();
void CosmeticsEditor_ResetGroup(CosmeticGroup group); void CosmeticsEditor_ResetGroup(CosmeticGroup group);
void ApplyOrResetCustomGfxPatches(bool manualChange = true); void ApplyOrResetCustomGfxPatches(bool manualChange = true);
class CosmeticsEditorWindow : public LUS::GuiWindow { class CosmeticsEditorWindow : public Ship::GuiWindow {
public: public:
using GuiWindow::GuiWindow; using GuiWindow::GuiWindow;

View File

@ -36,12 +36,12 @@ extern PlayState* gPlayState;
#include <libultraship/bridge.h> #include <libultraship/bridge.h>
#include <libultraship/libultraship.h> #include <libultraship/libultraship.h>
#define CMD_REGISTER LUS::Context::GetInstance()->GetConsole()->AddCommand #define CMD_REGISTER Ship::Context::GetInstance()->GetConsole()->AddCommand
// TODO: Commands should be using the output passed in. // TODO: Commands should be using the output passed in.
#define ERROR_MESSAGE std::reinterpret_pointer_cast<LUS::ConsoleWindow>(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->SendErrorMessage #define ERROR_MESSAGE std::reinterpret_pointer_cast<Ship::ConsoleWindow>(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->SendErrorMessage
#define INFO_MESSAGE std::reinterpret_pointer_cast<LUS::ConsoleWindow>(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->SendInfoMessage #define INFO_MESSAGE std::reinterpret_pointer_cast<Ship::ConsoleWindow>(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->SendInfoMessage
static bool ActorSpawnHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool ActorSpawnHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if ((args.size() != 9) && (args.size() != 3) && (args.size() != 6)) { if ((args.size() != 9) && (args.size() != 3) && (args.size() != 6)) {
ERROR_MESSAGE("Not enough arguments passed to actorspawn"); ERROR_MESSAGE("Not enough arguments passed to actorspawn");
return 1; return 1;
@ -101,7 +101,7 @@ static bool ActorSpawnHandler(std::shared_ptr<LUS::Console> Console, const std::
return 0; return 0;
} }
static bool KillPlayerHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>&, std::string* output) { static bool KillPlayerHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>&, std::string* output) {
GameInteractionEffectBase* effect = new GameInteractionEffect::SetPlayerHealth(); GameInteractionEffectBase* effect = new GameInteractionEffect::SetPlayerHealth();
dynamic_cast<ParameterizedGameInteractionEffect*>(effect)->parameters[0] = 0; dynamic_cast<ParameterizedGameInteractionEffect*>(effect)->parameters[0] = 0;
GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect);
@ -114,7 +114,7 @@ static bool KillPlayerHandler(std::shared_ptr<LUS::Console> Console, const std::
} }
} }
static bool SetPlayerHealthHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool SetPlayerHealthHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -145,7 +145,7 @@ static bool SetPlayerHealthHandler(std::shared_ptr<LUS::Console> Console, const
} }
} }
static bool LoadSceneHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>&, std::string* output) { static bool LoadSceneHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>&, std::string* output) {
gSaveContext.respawnFlag = 0; gSaveContext.respawnFlag = 0;
gSaveContext.seqId = 0xFF; gSaveContext.seqId = 0xFF;
gSaveContext.gameMode = 0; gSaveContext.gameMode = 0;
@ -153,7 +153,7 @@ static bool LoadSceneHandler(std::shared_ptr<LUS::Console> Console, const std::v
return 0; return 0;
} }
static bool RupeeHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool RupeeHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
return 1; return 1;
} }
@ -178,7 +178,7 @@ static bool RupeeHandler(std::shared_ptr<LUS::Console> Console, const std::vecto
return 0; return 0;
} }
static bool SetPosHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string> args, std::string* output) { static bool SetPosHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string> args, std::string* output) {
if (gPlayState == nullptr) { if (gPlayState == nullptr) {
ERROR_MESSAGE("PlayState == nullptr"); ERROR_MESSAGE("PlayState == nullptr");
return 1; return 1;
@ -205,7 +205,7 @@ static bool SetPosHandler(std::shared_ptr<LUS::Console> Console, const std::vect
return 0; return 0;
} }
static bool ResetHandler(std::shared_ptr<LUS::Console> Console, std::vector<std::string> args, std::string* output) { static bool ResetHandler(std::shared_ptr<Ship::Console> Console, std::vector<std::string> args, std::string* output) {
if (gPlayState == nullptr) { if (gPlayState == nullptr) {
ERROR_MESSAGE("PlayState == nullptr"); ERROR_MESSAGE("PlayState == nullptr");
return 1; return 1;
@ -225,7 +225,7 @@ const static std::map<std::string, uint16_t> ammoItems{
{ "beans", ITEM_BEAN } { "beans", ITEM_BEAN }
}; };
static bool AddAmmoHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool AddAmmoHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 3) { if (args.size() < 3) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -264,7 +264,7 @@ static bool AddAmmoHandler(std::shared_ptr<LUS::Console> Console, const std::vec
} }
} }
static bool TakeAmmoHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool TakeAmmoHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 3) { if (args.size() < 3) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -311,7 +311,7 @@ const static std::map<std::string, uint16_t> bottleItems{
{ "big_poe", ITEM_BIG_POE }, { "blue_fire", ITEM_BLUE_FIRE }, { "rutos_letter", ITEM_LETTER_RUTO }, { "big_poe", ITEM_BIG_POE }, { "blue_fire", ITEM_BLUE_FIRE }, { "rutos_letter", ITEM_LETTER_RUTO },
}; };
static bool BottleHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool BottleHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 3) { if (args.size() < 3) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -343,7 +343,7 @@ static bool BottleHandler(std::shared_ptr<LUS::Console> Console, const std::vect
return 0; return 0;
} }
static bool BHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool BHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -353,7 +353,7 @@ static bool BHandler(std::shared_ptr<LUS::Console> Console, const std::vector<st
return 0; return 0;
} }
static bool ItemHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool ItemHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 3) { if (args.size() < 3) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -364,7 +364,7 @@ static bool ItemHandler(std::shared_ptr<LUS::Console> Console, const std::vector
return 0; return 0;
} }
static bool GiveItemHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string> args, std::string* output) { static bool GiveItemHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string> args, std::string* output) {
if (args.size() < 3) { if (args.size() < 3) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -385,7 +385,7 @@ static bool GiveItemHandler(std::shared_ptr<LUS::Console> Console, const std::ve
return 0; return 0;
} }
static bool EntranceHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool EntranceHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -406,7 +406,7 @@ static bool EntranceHandler(std::shared_ptr<LUS::Console> Console, const std::ve
gSaveContext.nextTransitionType = TRANS_TYPE_INSTANT; gSaveContext.nextTransitionType = TRANS_TYPE_INSTANT;
} }
static bool VoidHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool VoidHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (gPlayState != nullptr) { if (gPlayState != nullptr) {
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempSwchFlags = gPlayState->actorCtx.flags.tempSwch; gSaveContext.respawn[RESPAWN_MODE_DOWN].tempSwchFlags = gPlayState->actorCtx.flags.tempSwch;
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempCollectFlags = gPlayState->actorCtx.flags.tempCollect; gSaveContext.respawn[RESPAWN_MODE_DOWN].tempCollectFlags = gPlayState->actorCtx.flags.tempCollect;
@ -422,7 +422,7 @@ static bool VoidHandler(std::shared_ptr<LUS::Console> Console, const std::vector
return 0; return 0;
} }
static bool ReloadHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool ReloadHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (gPlayState != nullptr) { if (gPlayState != nullptr) {
gPlayState->nextEntranceIndex = gSaveContext.entranceIndex; gPlayState->nextEntranceIndex = gSaveContext.entranceIndex;
gPlayState->transitionTrigger = TRANS_TRIGGER_START; gPlayState->transitionTrigger = TRANS_TRIGGER_START;
@ -439,7 +439,7 @@ const static std::map<std::string, uint16_t> fw_options {
{ "clear", 0}, {"warp", 1}, {"backup", 2} { "clear", 0}, {"warp", 1}, {"backup", 2}
}; };
static bool FWHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool FWHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -491,7 +491,7 @@ static bool FWHandler(std::shared_ptr<LUS::Console> Console, const std::vector<s
return 0; return 0;
} }
static bool FileSelectHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool FileSelectHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (gPlayState != nullptr) { if (gPlayState != nullptr) {
SET_NEXT_GAMESTATE(&gPlayState->state, FileChoose_Init, FileChooseContext); SET_NEXT_GAMESTATE(&gPlayState->state, FileChoose_Init, FileChooseContext);
gPlayState->state.running = 0; gPlayState->state.running = 0;
@ -502,12 +502,12 @@ static bool FileSelectHandler(std::shared_ptr<LUS::Console> Console, const std::
return 0; return 0;
} }
static bool QuitHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool QuitHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
LUS::Context::GetInstance()->GetWindow()->Close(); Ship::Context::GetInstance()->GetWindow()->Close();
return 0; return 0;
} }
static bool SaveStateHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool SaveStateHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
unsigned int slot = OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot(); unsigned int slot = OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot();
const SaveStateReturn rtn = OTRGlobals::Instance->gSaveStateMgr->AddRequest({ slot, RequestType::SAVE }); const SaveStateReturn rtn = OTRGlobals::Instance->gSaveStateMgr->AddRequest({ slot, RequestType::SAVE });
@ -521,7 +521,7 @@ static bool SaveStateHandler(std::shared_ptr<LUS::Console> Console, const std::v
} }
} }
static bool LoadStateHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool LoadStateHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
unsigned int slot = OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot(); unsigned int slot = OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot();
const SaveStateReturn rtn = OTRGlobals::Instance->gSaveStateMgr->AddRequest({ slot, RequestType::LOAD }); const SaveStateReturn rtn = OTRGlobals::Instance->gSaveStateMgr->AddRequest({ slot, RequestType::LOAD });
@ -542,7 +542,7 @@ static bool LoadStateHandler(std::shared_ptr<LUS::Console> Console, const std::v
} }
static bool StateSlotSelectHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool StateSlotSelectHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -567,7 +567,7 @@ static bool StateSlotSelectHandler(std::shared_ptr<LUS::Console> Console, const
return 0; return 0;
} }
static bool InvisibleHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool InvisibleHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -594,7 +594,7 @@ static bool InvisibleHandler(std::shared_ptr<LUS::Console> Console, const std::v
} }
} }
static bool GiantLinkHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool GiantLinkHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -622,7 +622,7 @@ static bool GiantLinkHandler(std::shared_ptr<LUS::Console> Console, const std::v
} }
} }
static bool MinishLinkHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool MinishLinkHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -650,7 +650,7 @@ static bool MinishLinkHandler(std::shared_ptr<LUS::Console> Console, const std::
} }
} }
static bool AddHeartContainerHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool AddHeartContainerHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -681,7 +681,7 @@ static bool AddHeartContainerHandler(std::shared_ptr<LUS::Console> Console, cons
} }
} }
static bool RemoveHeartContainerHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool RemoveHeartContainerHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -712,7 +712,7 @@ static bool RemoveHeartContainerHandler(std::shared_ptr<LUS::Console> Console, c
} }
} }
static bool GravityHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool GravityHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -721,7 +721,7 @@ static bool GravityHandler(std::shared_ptr<LUS::Console> Console, const std::vec
GameInteractionEffectBase* effect = new GameInteractionEffect::ModifyGravity(); GameInteractionEffectBase* effect = new GameInteractionEffect::ModifyGravity();
try { try {
dynamic_cast<ParameterizedGameInteractionEffect*>(effect)->parameters[0] = LUS::Math::clamp(std::stoi(args[1], nullptr, 10), GI_GRAVITY_LEVEL_LIGHT, GI_GRAVITY_LEVEL_HEAVY); dynamic_cast<ParameterizedGameInteractionEffect*>(effect)->parameters[0] = Ship::Math::clamp(std::stoi(args[1], nullptr, 10), GI_GRAVITY_LEVEL_LIGHT, GI_GRAVITY_LEVEL_HEAVY);
} catch (std::invalid_argument const& ex) { } catch (std::invalid_argument const& ex) {
ERROR_MESSAGE("[SOH] Gravity value must be a number."); ERROR_MESSAGE("[SOH] Gravity value must be a number.");
return 1; return 1;
@ -737,7 +737,7 @@ static bool GravityHandler(std::shared_ptr<LUS::Console> Console, const std::vec
} }
} }
static bool NoUIHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool NoUIHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -765,7 +765,7 @@ static bool NoUIHandler(std::shared_ptr<LUS::Console> Console, const std::vector
} }
} }
static bool FreezeHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool FreezeHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
GameInteractionEffectBase* effect = new GameInteractionEffect::FreezePlayer(); GameInteractionEffectBase* effect = new GameInteractionEffect::FreezePlayer();
GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect);
@ -778,7 +778,7 @@ static bool FreezeHandler(std::shared_ptr<LUS::Console> Console, const std::vect
} }
} }
static bool DefenseModifierHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool DefenseModifierHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -802,7 +802,7 @@ static bool DefenseModifierHandler(std::shared_ptr<LUS::Console> Console, const
} }
} }
static bool DamageHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool DamageHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -832,7 +832,7 @@ static bool DamageHandler(std::shared_ptr<LUS::Console> Console, const std::vect
} }
} }
static bool HealHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool HealHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -862,7 +862,7 @@ static bool HealHandler(std::shared_ptr<LUS::Console> Console, const std::vector
} }
} }
static bool FillMagicHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool FillMagicHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
GameInteractionEffectBase* effect = new GameInteractionEffect::FillMagic(); GameInteractionEffectBase* effect = new GameInteractionEffect::FillMagic();
GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect);
@ -875,7 +875,7 @@ static bool FillMagicHandler(std::shared_ptr<LUS::Console> Console, const std::v
} }
} }
static bool EmptyMagicHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool EmptyMagicHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
GameInteractionEffectBase* effect = new GameInteractionEffect::EmptyMagic(); GameInteractionEffectBase* effect = new GameInteractionEffect::EmptyMagic();
GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect);
@ -888,7 +888,7 @@ static bool EmptyMagicHandler(std::shared_ptr<LUS::Console> Console, const std::
} }
} }
static bool NoZHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool NoZHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -916,7 +916,7 @@ static bool NoZHandler(std::shared_ptr<LUS::Console> Console, const std::vector<
} }
} }
static bool OneHitKOHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool OneHitKOHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -944,7 +944,7 @@ static bool OneHitKOHandler(std::shared_ptr<LUS::Console> Console, const std::ve
} }
} }
static bool PacifistHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool PacifistHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -972,7 +972,7 @@ static bool PacifistHandler(std::shared_ptr<LUS::Console> Console, const std::ve
} }
} }
static bool PaperLinkHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool PaperLinkHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -1001,7 +1001,7 @@ static bool PaperLinkHandler(std::shared_ptr<LUS::Console> Console, const std::v
} }
} }
static bool RainstormHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool RainstormHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -1029,7 +1029,7 @@ static bool RainstormHandler(std::shared_ptr<LUS::Console> Console, const std::v
} }
} }
static bool ReverseControlsHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool ReverseControlsHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -1058,7 +1058,7 @@ static bool ReverseControlsHandler(std::shared_ptr<LUS::Console> Console, const
} }
} }
static bool UpdateRupeesHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool UpdateRupeesHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -1082,7 +1082,7 @@ static bool UpdateRupeesHandler(std::shared_ptr<LUS::Console> Console, const std
} }
} }
static bool SpeedModifierHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool SpeedModifierHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -1112,7 +1112,7 @@ const static std::map<std::string, uint16_t> boots {
{ "hover", EQUIP_VALUE_BOOTS_HOVER }, { "hover", EQUIP_VALUE_BOOTS_HOVER },
}; };
static bool BootsHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool BootsHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -1143,7 +1143,7 @@ const static std::map<std::string, uint16_t> shields {
{ "mirror", ITEM_SHIELD_MIRROR }, { "mirror", ITEM_SHIELD_MIRROR },
}; };
static bool GiveShieldHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool GiveShieldHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -1168,7 +1168,7 @@ static bool GiveShieldHandler(std::shared_ptr<LUS::Console> Console, const std::
} }
} }
static bool TakeShieldHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool TakeShieldHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -1193,7 +1193,7 @@ static bool TakeShieldHandler(std::shared_ptr<LUS::Console> Console, const std::
} }
} }
static bool KnockbackHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool KnockbackHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -1223,7 +1223,7 @@ static bool KnockbackHandler(std::shared_ptr<LUS::Console> Console, const std::v
} }
} }
static bool ElectrocuteHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool ElectrocuteHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
GameInteractionEffectBase* effect = new GameInteractionEffect::ElectrocutePlayer(); GameInteractionEffectBase* effect = new GameInteractionEffect::ElectrocutePlayer();
GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect);
@ -1236,7 +1236,7 @@ static bool ElectrocuteHandler(std::shared_ptr<LUS::Console> Console, const std:
} }
} }
static bool BurnHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool BurnHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
GameInteractionEffectBase* effect = new GameInteractionEffect::BurnPlayer(); GameInteractionEffectBase* effect = new GameInteractionEffect::BurnPlayer();
GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect); GameInteractionEffectQueryResult result = GameInteractor::ApplyEffect(effect);
@ -1249,7 +1249,7 @@ static bool BurnHandler(std::shared_ptr<LUS::Console> Console, const std::vector
} }
} }
static bool CuccoStormHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool CuccoStormHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
GameInteractionEffectQueryResult result = GameInteractor::RawAction::SpawnActor(ACTOR_EN_NIW, 0); GameInteractionEffectQueryResult result = GameInteractor::RawAction::SpawnActor(ACTOR_EN_NIW, 0);
if (result == GameInteractionEffectQueryResult::Possible) { if (result == GameInteractionEffectQueryResult::Possible) {
@ -1261,7 +1261,7 @@ static bool CuccoStormHandler(std::shared_ptr<LUS::Console> Console, const std::
} }
} }
static bool GenerateRandoHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool GenerateRandoHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() == 1) { if (args.size() == 1) {
if (GenerateRandomizer()) { if (GenerateRandomizer()) {
return 0; return 0;
@ -1309,7 +1309,7 @@ static constexpr std::array<std::pair<const char*, CosmeticGroup>, COSMETICS_GRO
{"ivan", COSMETICS_GROUP_IVAN}, {"ivan", COSMETICS_GROUP_IVAN},
}}; }};
static bool CosmeticsHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool CosmeticsHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -1361,7 +1361,7 @@ static std::map<std::string, SeqType> sfx_groups = {
{"custom", SEQ_BGM_CUSTOM}, {"custom", SEQ_BGM_CUSTOM},
}; };
static bool SfxHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) { static bool SfxHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (args.size() < 2) { if (args.size() < 2) {
ERROR_MESSAGE("[SOH] Unexpected arguments passed"); ERROR_MESSAGE("[SOH] Unexpected arguments passed");
return 1; return 1;
@ -1411,17 +1411,17 @@ void DebugConsole_Init(void) {
CMD_REGISTER("save_state", {SaveStateHandler, "Save a state."}); CMD_REGISTER("save_state", {SaveStateHandler, "Save a state."});
CMD_REGISTER("load_state", {LoadStateHandler, "Load a state."}); CMD_REGISTER("load_state", {LoadStateHandler, "Load a state."});
CMD_REGISTER("set_slot", {StateSlotSelectHandler, "Selects a SaveState slot", { CMD_REGISTER("set_slot", {StateSlotSelectHandler, "Selects a SaveState slot", {
{"Slot number", LUS::ArgumentType::NUMBER,} {"Slot number", Ship::ArgumentType::NUMBER,}
}}); }});
// Map & Location // Map & Location
CMD_REGISTER("void", {VoidHandler, "Voids out of the current map."}); CMD_REGISTER("void", {VoidHandler, "Voids out of the current map."});
CMD_REGISTER("reload", {ReloadHandler, "Reloads the current map."}); CMD_REGISTER("reload", {ReloadHandler, "Reloads the current map."});
CMD_REGISTER("fw", {FWHandler, "Spawns the player where Farore's Wind is set.", { CMD_REGISTER("fw", {FWHandler, "Spawns the player where Farore's Wind is set.", {
{"clear|warp|backup", LUS::ArgumentType::TEXT} {"clear|warp|backup", Ship::ArgumentType::TEXT}
}}); }});
CMD_REGISTER("entrance", {EntranceHandler, "Sends player to the entered entrance (hex)", { CMD_REGISTER("entrance", {EntranceHandler, "Sends player to the entered entrance (hex)", {
{"entrance", LUS::ArgumentType::NUMBER} {"entrance", Ship::ArgumentType::NUMBER}
}}); }});
// Gameplay // Gameplay
@ -1430,64 +1430,64 @@ void DebugConsole_Init(void) {
CMD_REGISTER("map", {LoadSceneHandler, "Load up kak?"}); CMD_REGISTER("map", {LoadSceneHandler, "Load up kak?"});
CMD_REGISTER("rupee", {RupeeHandler, "Set your rupee counter.", { CMD_REGISTER("rupee", {RupeeHandler, "Set your rupee counter.", {
{"amount", LUS::ArgumentType::NUMBER} {"amount", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("bItem", {BHandler, "Set an item to the B button.", { CMD_REGISTER("bItem", {BHandler, "Set an item to the B button.", {
{"Item ID", LUS::ArgumentType::NUMBER} {"Item ID", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("spawn", { ActorSpawnHandler, "Spawn an actor.", { { "actor name/id", LUS::ArgumentType::NUMBER }, // TODO there should be an actor_id arg type CMD_REGISTER("spawn", { ActorSpawnHandler, "Spawn an actor.", { { "actor name/id", Ship::ArgumentType::NUMBER }, // TODO there should be an actor_id arg type
{"data", LUS::ArgumentType::NUMBER}, {"data", Ship::ArgumentType::NUMBER},
{"x", LUS::ArgumentType::NUMBER, true}, {"x", Ship::ArgumentType::NUMBER, true},
{"y", LUS::ArgumentType::NUMBER, true}, {"y", Ship::ArgumentType::NUMBER, true},
{"z", LUS::ArgumentType::NUMBER, true}, {"z", Ship::ArgumentType::NUMBER, true},
{"rx", LUS::ArgumentType::NUMBER, true}, {"rx", Ship::ArgumentType::NUMBER, true},
{"ry", LUS::ArgumentType::NUMBER, true}, {"ry", Ship::ArgumentType::NUMBER, true},
{"rz", LUS::ArgumentType::NUMBER, true} {"rz", Ship::ArgumentType::NUMBER, true}
}}); }});
CMD_REGISTER("pos", {SetPosHandler, "Sets the position of the player.", { CMD_REGISTER("pos", {SetPosHandler, "Sets the position of the player.", {
{"x", LUS::ArgumentType::NUMBER, true}, {"x", Ship::ArgumentType::NUMBER, true},
{"y", LUS::ArgumentType::NUMBER, true}, {"y", Ship::ArgumentType::NUMBER, true},
{"z", LUS::ArgumentType::NUMBER, true} {"z", Ship::ArgumentType::NUMBER, true}
}}); }});
CMD_REGISTER("addammo", {AddAmmoHandler, "Adds ammo of an item.", { CMD_REGISTER("addammo", {AddAmmoHandler, "Adds ammo of an item.", {
{"sticks|nuts|bombs|seeds|arrows|bombchus|beans", LUS::ArgumentType::TEXT}, {"sticks|nuts|bombs|seeds|arrows|bombchus|beans", Ship::ArgumentType::TEXT},
{"count", LUS::ArgumentType::NUMBER} {"count", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("takeammo", {TakeAmmoHandler, "Removes ammo of an item.", { CMD_REGISTER("takeammo", {TakeAmmoHandler, "Removes ammo of an item.", {
{"sticks|nuts|bombs|seeds|arrows|bombchus|beans", LUS::ArgumentType::TEXT}, {"sticks|nuts|bombs|seeds|arrows|bombchus|beans", Ship::ArgumentType::TEXT},
{"count", LUS::ArgumentType::NUMBER} {"count", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("bottle", {BottleHandler, "Changes item in a bottle slot.", { CMD_REGISTER("bottle", {BottleHandler, "Changes item in a bottle slot.", {
{"item", LUS::ArgumentType::TEXT}, {"item", Ship::ArgumentType::TEXT},
{"slot", LUS::ArgumentType::NUMBER} {"slot", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("give_item", {GiveItemHandler, "Gives an item to the player as if it was given from an actor", { CMD_REGISTER("give_item", {GiveItemHandler, "Gives an item to the player as if it was given from an actor", {
{"vanilla|randomizer", LUS::ArgumentType::TEXT}, {"vanilla|randomizer", Ship::ArgumentType::TEXT},
{"giveItemID", LUS::ArgumentType::NUMBER} {"giveItemID", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("item", {ItemHandler, "Sets item ID in arg 1 into slot arg 2. No boundary checks. Use with caution.", { CMD_REGISTER("item", {ItemHandler, "Sets item ID in arg 1 into slot arg 2. No boundary checks. Use with caution.", {
{"slot", LUS::ArgumentType::NUMBER}, {"slot", Ship::ArgumentType::NUMBER},
{"item id", LUS::ArgumentType::NUMBER} {"item id", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("invisible", {InvisibleHandler, "Activate Link's Elvish cloak, making him appear invisible.", { CMD_REGISTER("invisible", {InvisibleHandler, "Activate Link's Elvish cloak, making him appear invisible.", {
{"value", LUS::ArgumentType::NUMBER} {"value", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("giant_link", {GiantLinkHandler, "Turn Link into a giant Lonky boi.", { CMD_REGISTER("giant_link", {GiantLinkHandler, "Turn Link into a giant Lonky boi.", {
{"value", LUS::ArgumentType::NUMBER} {"value", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("minish_link", {MinishLinkHandler, "Turn Link into a minish boi.", { CMD_REGISTER("minish_link", {MinishLinkHandler, "Turn Link into a minish boi.", {
{"value", LUS::ArgumentType::NUMBER} {"value", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("add_heart_container", CMD_REGISTER("add_heart_container",
@ -1497,25 +1497,25 @@ void DebugConsole_Init(void) {
{RemoveHeartContainerHandler, "Remove a heart from Link. The minimal amount of hearts is 3."}); {RemoveHeartContainerHandler, "Remove a heart from Link. The minimal amount of hearts is 3."});
CMD_REGISTER("gravity", {GravityHandler, "Set gravity level.", { CMD_REGISTER("gravity", {GravityHandler, "Set gravity level.", {
{"value", LUS::ArgumentType::NUMBER} {"value", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("no_ui", {NoUIHandler, "Disables the UI.", { CMD_REGISTER("no_ui", {NoUIHandler, "Disables the UI.", {
{"value", LUS::ArgumentType::NUMBER} {"value", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("freeze", {FreezeHandler, "Freezes Link in place"}); CMD_REGISTER("freeze", {FreezeHandler, "Freezes Link in place"});
CMD_REGISTER("defense_modifier", {DefenseModifierHandler, "Sets the defense modifier.", { CMD_REGISTER("defense_modifier", {DefenseModifierHandler, "Sets the defense modifier.", {
{"value", LUS::ArgumentType::NUMBER} {"value", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("damage", {DamageHandler, "Deal damage to Link.", { CMD_REGISTER("damage", {DamageHandler, "Deal damage to Link.", {
{"value", LUS::ArgumentType::NUMBER} {"value", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("heal", {HealHandler, "Heals Link.", { CMD_REGISTER("heal", {HealHandler, "Heals Link.", {
{"value", LUS::ArgumentType::NUMBER} {"value", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("fill_magic", {FillMagicHandler, "Fills magic."}); CMD_REGISTER("fill_magic", {FillMagicHandler, "Fills magic."});
@ -1523,50 +1523,50 @@ void DebugConsole_Init(void) {
CMD_REGISTER("empty_magic", {EmptyMagicHandler, "Empties magic."}); CMD_REGISTER("empty_magic", {EmptyMagicHandler, "Empties magic."});
CMD_REGISTER("no_z", {NoZHandler, "Disables Z-button presses.", { CMD_REGISTER("no_z", {NoZHandler, "Disables Z-button presses.", {
{"value", LUS::ArgumentType::NUMBER} {"value", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("ohko", {OneHitKOHandler, CMD_REGISTER("ohko", {OneHitKOHandler,
"Activates one hit KO. Any damage kills Link and he cannot gain health in this mode.", { "Activates one hit KO. Any damage kills Link and he cannot gain health in this mode.", {
{"value", LUS::ArgumentType::NUMBER} {"value", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("pacifist", {PacifistHandler, "Activates pacifist mode. Prevents Link from using his weapon.", { CMD_REGISTER("pacifist", {PacifistHandler, "Activates pacifist mode. Prevents Link from using his weapon.", {
{"value", LUS::ArgumentType::NUMBER} {"value", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("paper_link", {PaperLinkHandler, "Link but made out of paper.", { CMD_REGISTER("paper_link", {PaperLinkHandler, "Link but made out of paper.", {
{"value", LUS::ArgumentType::NUMBER} {"value", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("rainstorm", {RainstormHandler, "Activates rainstorm."}); CMD_REGISTER("rainstorm", {RainstormHandler, "Activates rainstorm."});
CMD_REGISTER("reverse_controls", {ReverseControlsHandler, "Reverses the controls.", { CMD_REGISTER("reverse_controls", {ReverseControlsHandler, "Reverses the controls.", {
{"value", LUS::ArgumentType::NUMBER} {"value", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("update_rupees", {UpdateRupeesHandler, "Adds rupees.", { CMD_REGISTER("update_rupees", {UpdateRupeesHandler, "Adds rupees.", {
{"value", LUS::ArgumentType::NUMBER} {"value", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("speed_modifier", {SpeedModifierHandler, "Sets the speed modifier.", { CMD_REGISTER("speed_modifier", {SpeedModifierHandler, "Sets the speed modifier.", {
{"value", LUS::ArgumentType::NUMBER} {"value", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("boots", {BootsHandler, "Activates boots.", { CMD_REGISTER("boots", {BootsHandler, "Activates boots.", {
{"kokiri|iron|hover", LUS::ArgumentType::TEXT}, {"kokiri|iron|hover", Ship::ArgumentType::TEXT},
}}); }});
CMD_REGISTER("giveshield", {GiveShieldHandler, "Gives a shield and equips it when Link is the right age for it.", { CMD_REGISTER("giveshield", {GiveShieldHandler, "Gives a shield and equips it when Link is the right age for it.", {
{"deku|hylian|mirror", LUS::ArgumentType::TEXT}, {"deku|hylian|mirror", Ship::ArgumentType::TEXT},
}}); }});
CMD_REGISTER("takeshield", {TakeShieldHandler, "Takes a shield and unequips it if Link is wearing it.", { CMD_REGISTER("takeshield", {TakeShieldHandler, "Takes a shield and unequips it if Link is wearing it.", {
{"deku|hylian|mirror", LUS::ArgumentType::TEXT}, {"deku|hylian|mirror", Ship::ArgumentType::TEXT},
}}); }});
CMD_REGISTER("knockback", {KnockbackHandler, "Knocks Link back.", { CMD_REGISTER("knockback", {KnockbackHandler, "Knocks Link back.", {
{"value", LUS::ArgumentType::NUMBER} {"value", Ship::ArgumentType::NUMBER}
}}); }});
CMD_REGISTER("electrocute", {ElectrocuteHandler, "Electrocutes Link."}); CMD_REGISTER("electrocute", {ElectrocuteHandler, "Electrocutes Link."});
@ -1576,18 +1576,18 @@ void DebugConsole_Init(void) {
CMD_REGISTER("cucco_storm", {CuccoStormHandler, "Cucco Storm"}); CMD_REGISTER("cucco_storm", {CuccoStormHandler, "Cucco Storm"});
CMD_REGISTER("gen_rando", {GenerateRandoHandler, "Generate a randomizer seed", { CMD_REGISTER("gen_rando", {GenerateRandoHandler, "Generate a randomizer seed", {
{"seed|count", LUS::ArgumentType::NUMBER, true}, {"seed|count", Ship::ArgumentType::NUMBER, true},
{"testing", LUS::ArgumentType::NUMBER, true}, {"testing", Ship::ArgumentType::NUMBER, true},
}}); }});
CMD_REGISTER("cosmetics", {CosmeticsHandler, "Change cosmetics.", { CMD_REGISTER("cosmetics", {CosmeticsHandler, "Change cosmetics.", {
{"reset|randomize", LUS::ArgumentType::TEXT}, {"reset|randomize", Ship::ArgumentType::TEXT},
{"group name", LUS::ArgumentType::TEXT, true}, {"group name", Ship::ArgumentType::TEXT, true},
}}); }});
CMD_REGISTER("sfx", {SfxHandler, "Change SFX.", { CMD_REGISTER("sfx", {SfxHandler, "Change SFX.", {
{"reset|randomize", LUS::ArgumentType::TEXT}, {"reset|randomize", Ship::ArgumentType::TEXT},
{"group_name", LUS::ArgumentType::TEXT, true}, {"group_name", Ship::ArgumentType::TEXT, true},
}}); }});
CVarSave(); CVarSave();

View File

@ -26,7 +26,7 @@ void MessageDebug_DisplayCustomMessage(const char* customMessage);
} }
class MessageViewer : public LUS::GuiWindow { class MessageViewer : public Ship::GuiWindow {
public: public:
static inline const char* TABLE_ID = "MessageViewer"; static inline const char* TABLE_ID = "MessageViewer";
using GuiWindow::GuiWindow; using GuiWindow::GuiWindow;

View File

@ -2,7 +2,7 @@
#include <libultraship/libultraship.h> #include <libultraship/libultraship.h>
class ActorViewerWindow : public LUS::GuiWindow { class ActorViewerWindow : public Ship::GuiWindow {
public: public:
using GuiWindow::GuiWindow; using GuiWindow::GuiWindow;

View File

@ -14,7 +14,7 @@ typedef enum {
} ColViewerRenderSetting; } ColViewerRenderSetting;
#ifdef __cplusplus #ifdef __cplusplus
class ColViewerWindow : public LUS::GuiWindow { class ColViewerWindow : public Ship::GuiWindow {
public: public:
using GuiWindow::GuiWindow; using GuiWindow::GuiWindow;

View File

@ -614,7 +614,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(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1)); ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->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;
@ -656,7 +656,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(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), if (ImGui::ImageButton(Ship::Context::GetInstance()->GetWindow()->GetGui()->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);
@ -704,7 +704,7 @@ void DrawInventoryTab() {
ImGui::SameLine(); ImGui::SameLine();
} }
const ItemMapEntry& slotEntry = possibleItems[pickerIndex]; const ItemMapEntry& slotEntry = possibleItems[pickerIndex];
if (ImGui::ImageButton(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), if (ImGui::ImageButton(Ship::Context::GetInstance()->GetWindow()->GetGui()->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
@ -742,7 +742,7 @@ void DrawInventoryTab() {
ImGui::PushItemWidth(32.0f); ImGui::PushItemWidth(32.0f);
ImGui::BeginGroup(); ImGui::BeginGroup();
ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(itemMapping[item].name), ImVec2(32.0f, 32.0f)); ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->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();
@ -1157,7 +1157,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(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), if (ImGui::ImageButton(Ship::Context::GetInstance()->GetWindow()->GetGui()->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);
} }
@ -1185,7 +1185,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(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), if (ImGui::ImageButton(Ship::Context::GetInstance()->GetWindow()->GetGui()->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();
@ -1222,7 +1222,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(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasEquip ? entry.name : entry.nameFaded), if (ImGui::ImageButton(Ship::Context::GetInstance()->GetWindow()->GetGui()->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;
@ -1321,7 +1321,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(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded), if (ImGui::ImageButton(Ship::Context::GetInstance()->GetWindow()->GetGui()->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;
@ -1339,7 +1339,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(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasItem ? entry.name : entry.nameFaded), if (ImGui::ImageButton(Ship::Context::GetInstance()->GetWindow()->GetGui()->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;
@ -1386,7 +1386,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(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded), if (ImGui::ImageButton(Ship::Context::GetInstance()->GetWindow()->GetGui()->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;
@ -1449,7 +1449,7 @@ void DrawQuestStatusTab() {
if (dungeonItemsScene != SCENE_JABU_JABU_BOSS) { if (dungeonItemsScene != SCENE_JABU_JABU_BOSS) {
float lineHeight = ImGui::GetTextLineHeightWithSpacing(); float lineHeight = ImGui::GetTextLineHeightWithSpacing();
ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(itemMapping[ITEM_KEY_SMALL].name), ImVec2(lineHeight, lineHeight)); ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->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];
@ -1793,34 +1793,34 @@ void SaveEditorWindow::DrawElement() {
void SaveEditorWindow::InitElement() { void SaveEditorWindow::InitElement() {
// Load item icons into ImGui // Load item icons into ImGui
for (const auto& entry : itemMapping) { for (const auto& entry : itemMapping) {
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1)); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1));
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f)); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(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;
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, gregGreen); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, gregGreen);
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, gregFadedGreen); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, gregFadedGreen);
} }
for (const auto& entry : triforcePieceMapping) { for (const auto& entry : triforcePieceMapping) {
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1)); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1));
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f)); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
} }
for (const auto& entry : questMapping) { for (const auto& entry : questMapping) {
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1)); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1));
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f)); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
} }
for (const auto& entry : songMapping) { for (const auto& entry : songMapping) {
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.name, gSongNoteTex, entry.color); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.name, gSongNoteTex, entry.color);
ImVec4 fadedCol = entry.color; ImVec4 fadedCol = entry.color;
fadedCol.w = 0.3f; fadedCol.w = 0.3f;
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.nameFaded, gSongNoteTex, fadedCol); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.nameFaded, gSongNoteTex, fadedCol);
} }
for (const auto& entry : vanillaSongMapping) { for (const auto& entry : vanillaSongMapping) {
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.name, gSongNoteTex, entry.color); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.name, gSongNoteTex, entry.color);
ImVec4 fadedCol = entry.color; ImVec4 fadedCol = entry.color;
fadedCol.w = 0.3f; fadedCol.w = 0.3f;
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.nameFaded, gSongNoteTex, fadedCol); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.nameFaded, gSongNoteTex, fadedCol);
} }
} }

View File

@ -590,7 +590,7 @@ const std::vector<std::string> state3 = {
"Travelling to Hook Target" "Travelling to Hook Target"
}; };
class SaveEditorWindow : public LUS::GuiWindow { class SaveEditorWindow : public Ship::GuiWindow {
public: public:
using GuiWindow::GuiWindow; using GuiWindow::GuiWindow;

View File

@ -65,7 +65,7 @@ std::map<int, std::string> cmdMap = {
}; };
void PerformDisplayListSearch() { void PerformDisplayListSearch() {
auto result = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles("*" + std::string(searchString) + "*DL*"); auto result = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles("*" + std::string(searchString) + "*DL*");
displayListSearchResults.clear(); displayListSearchResults.clear();
@ -127,7 +127,7 @@ void DLViewerWindow::DrawElement() {
} }
try { try {
auto res = std::static_pointer_cast<LUS::DisplayList>(LUS::Context::GetInstance()->GetResourceManager()->LoadResource(activeDisplayList)); auto res = std::static_pointer_cast<LUS::DisplayList>(Ship::Context::GetInstance()->GetResourceManager()->LoadResource(activeDisplayList));
if (res->GetInitData()->Type != static_cast<uint32_t>(LUS::ResourceType::DisplayList)) { if (res->GetInitData()->Type != static_cast<uint32_t>(LUS::ResourceType::DisplayList)) {
ImGui::Text("Resource type is not a Display List. Please choose another."); ImGui::Text("Resource type is not a Display List. Please choose another.");

View File

@ -2,7 +2,7 @@
#include <libultraship/libultraship.h> #include <libultraship/libultraship.h>
class DLViewerWindow : public LUS::GuiWindow { class DLViewerWindow : public Ship::GuiWindow {
public: public:
using GuiWindow::GuiWindow; using GuiWindow::GuiWindow;

View File

@ -33,7 +33,7 @@ typedef struct {
uint32_t y; uint32_t y;
} ValueTableElement; } ValueTableElement;
class ValueViewerWindow : public LUS::GuiWindow { class ValueViewerWindow : public Ship::GuiWindow {
public: public:
using GuiWindow::GuiWindow; using GuiWindow::GuiWindow;

View File

@ -459,7 +459,7 @@ void GameInteractor::RawAction::SetCosmeticsColor(uint8_t cosmeticCategory, uint
break; break;
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
ApplyOrResetCustomGfxPatches(); ApplyOrResetCustomGfxPatches();
} }

View File

@ -66,7 +66,7 @@ void GameInteractorSail::HandleRemoteJson(nlohmann::json payload) {
} }
std::string command = payload["command"].get<std::string>(); std::string command = payload["command"].get<std::string>();
std::reinterpret_pointer_cast<LUS::ConsoleWindow>(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch(command); std::reinterpret_pointer_cast<Ship::ConsoleWindow>(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch(command);
responsePayload["status"] = "success"; responsePayload["status"] = "success";
GameInteractor::Instance->TransmitJsonToRemote(responsePayload); GameInteractor::Instance->TransmitJsonToRemote(responsePayload);
return; return;
@ -88,7 +88,7 @@ void GameInteractorSail::HandleRemoteJson(nlohmann::json payload) {
} }
std::string command = payload["effect"]["command"].get<std::string>(); std::string command = payload["effect"]["command"].get<std::string>();
std::reinterpret_pointer_cast<LUS::ConsoleWindow>(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch(command); std::reinterpret_pointer_cast<Ship::ConsoleWindow>(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch(command);
responsePayload["status"] = "success"; responsePayload["status"] = "success";
GameInteractor::Instance->TransmitJsonToRemote(responsePayload); GameInteractor::Instance->TransmitJsonToRemote(responsePayload);
return; return;

View File

@ -1,7 +1,7 @@
#include <libultraship/libultraship.h> #include <libultraship/libultraship.h>
#include "gameplaystats.h" #include "gameplaystats.h"
class GameplayStatsWindow : public LUS::GuiWindow { class GameplayStatsWindow : public Ship::GuiWindow {
public: public:
using GuiWindow::GuiWindow; using GuiWindow::GuiWindow;

View File

@ -462,7 +462,7 @@ void RegisterDeleteFileOnDeath() {
if (gPlayState->gameOverCtx.state == GAMEOVER_DEATH_MENU && gPlayState->pauseCtx.state == 9) { if (gPlayState->gameOverCtx.state == GAMEOVER_DEATH_MENU && gPlayState->pauseCtx.state == 9) {
SaveManager::Instance->DeleteZeldaFile(gSaveContext.fileNum); SaveManager::Instance->DeleteZeldaFile(gSaveContext.fileNum);
hasAffectedHealth = false; hasAffectedHealth = false;
std::reinterpret_pointer_cast<LUS::ConsoleWindow>(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch("reset"); std::reinterpret_pointer_cast<Ship::ConsoleWindow>(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch("reset");
} }
}); });
} }

View File

@ -70,7 +70,7 @@ void DrawPresetSelector(PresetType presetTypeId) {
if (selectedPresetId != 0) { if (selectedPresetId != 0) {
applyPreset(selectedPresetDef.entries); applyPreset(selectedPresetDef.entries);
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
ImGui::PopStyleVar(1); ImGui::PopStyleVar(1);
} }

View File

@ -18,7 +18,7 @@ void RandoMain::GenerateRando(std::unordered_map<RandomizerSettingKey, u8> cvarS
// std::string settingsFileName = "./randomizer/latest_settings.json"; // std::string settingsFileName = "./randomizer/latest_settings.json";
// CVarSetString("gLoadedPreset", settingsFileName.c_str()); // CVarSetString("gLoadedPreset", settingsFileName.c_str());
std::string fileName = LUS::Context::GetPathRelativeToAppDirectory(GenerateRandomizer(cvarSettings, excludedLocations, enabledTricks, seedString).c_str()); std::string fileName = Ship::Context::GetPathRelativeToAppDirectory(GenerateRandomizer(cvarSettings, excludedLocations, enabledTricks, seedString).c_str());
CVarSetString("gSpoilerLog", fileName.c_str()); CVarSetString("gSpoilerLog", fileName.c_str());
CVarSave(); CVarSave();

View File

@ -895,8 +895,8 @@ const char* SpoilerLog_Write(int language) {
WriteAllLocations(language); WriteAllLocations(language);
//WriteHintData(language); //WriteHintData(language);
if (!std::filesystem::exists(LUS::Context::GetPathRelativeToAppDirectory("Randomizer"))) { if (!std::filesystem::exists(Ship::Context::GetPathRelativeToAppDirectory("Randomizer"))) {
std::filesystem::create_directory(LUS::Context::GetPathRelativeToAppDirectory("Randomizer")); std::filesystem::create_directory(Ship::Context::GetPathRelativeToAppDirectory("Randomizer"));
} }
std::string jsonString = jsonData.dump(4); std::string jsonString = jsonData.dump(4);
@ -911,7 +911,7 @@ const char* SpoilerLog_Write(int language) {
fileNameStream << std::to_string(Settings::hashIconIndexes[i]); fileNameStream << std::to_string(Settings::hashIconIndexes[i]);
} }
std::string fileName = fileNameStream.str(); std::string fileName = fileNameStream.str();
std::ofstream jsonFile(LUS::Context::GetPathRelativeToAppDirectory( std::ofstream jsonFile(Ship::Context::GetPathRelativeToAppDirectory(
(std::string("Randomizer/") + fileName + std::string(".json")).c_str())); (std::string("Randomizer/") + fileName + std::string(".json")).c_str()));
jsonFile << std::setw(4) << jsonString << std::endl; jsonFile << std::setw(4) << jsonString << std::endl;
jsonFile.close(); jsonFile.close();

View File

@ -4683,7 +4683,7 @@ void RandomizerSettingsWindow::DrawElement() {
excludedLocationString += ","; excludedLocationString += ",";
} }
CVarSetString(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), excludedLocationString.c_str()); CVarSetString(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), excludedLocationString.c_str());
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text("%s", rcObject->rcShortName.c_str()); ImGui::Text("%s", rcObject->rcShortName.c_str());
@ -4728,7 +4728,7 @@ void RandomizerSettingsWindow::DrawElement() {
} else { } else {
CVarSetString(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), excludedLocationString.c_str()); CVarSetString(CVAR_RANDOMIZER_SETTING("ExcludedLocations"), excludedLocationString.c_str());
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text("%s", rcObject->rcShortName.c_str()); ImGui::Text("%s", rcObject->rcShortName.c_str());
@ -4914,7 +4914,7 @@ void RandomizerSettingsWindow::DrawElement() {
enabledTrickString += ","; enabledTrickString += ",";
} }
CVarClear(CVAR_RANDOMIZER_SETTING("EnabledTricks")); CVarClear(CVAR_RANDOMIZER_SETTING("EnabledTricks"));
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Enable All")) { if (ImGui::Button("Enable All")) {
@ -4931,7 +4931,7 @@ void RandomizerSettingsWindow::DrawElement() {
enabledTrickString += ","; enabledTrickString += ",";
} }
CVarSetString(CVAR_RANDOMIZER_SETTING("EnabledTricks"), enabledTrickString.c_str()); CVarSetString(CVAR_RANDOMIZER_SETTING("EnabledTricks"), enabledTrickString.c_str());
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
} }
if (ImGui::BeginTable("trickTags", showTag.size(), ImGuiTableFlags_Resizable | ImGuiTableFlags_NoSavedSettings | ImGuiTableFlags_Borders)) { if (ImGui::BeginTable("trickTags", showTag.size(), ImGuiTableFlags_Resizable | ImGuiTableFlags_NoSavedSettings | ImGuiTableFlags_Borders)) {
@ -5008,7 +5008,7 @@ void RandomizerSettingsWindow::DrawElement() {
enabledTrickString += ","; enabledTrickString += ",";
} }
CVarSetString(CVAR_RANDOMIZER_SETTING("EnabledTricks"), enabledTrickString.c_str()); CVarSetString(CVAR_RANDOMIZER_SETTING("EnabledTricks"), enabledTrickString.c_str());
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
ImGui::BeginChild("ChildTricksDisabled", ImVec2(0, -8), false, ImGuiWindowFlags_HorizontalScrollbar); ImGui::BeginChild("ChildTricksDisabled", ImVec2(0, -8), false, ImGuiWindowFlags_HorizontalScrollbar);
@ -5044,7 +5044,7 @@ void RandomizerSettingsWindow::DrawElement() {
enabledTrickString += ","; enabledTrickString += ",";
} }
CVarSetString(CVAR_RANDOMIZER_SETTING("EnabledTricks"), enabledTrickString.c_str()); CVarSetString(CVAR_RANDOMIZER_SETTING("EnabledTricks"), enabledTrickString.c_str());
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
DrawTagChips(*rtObject.rtTags); DrawTagChips(*rtObject.rtTags);
ImGui::SameLine(); ImGui::SameLine();
@ -5118,7 +5118,7 @@ void RandomizerSettingsWindow::DrawElement() {
enabledTrickString += ","; enabledTrickString += ",";
} }
CVarClear(CVAR_RANDOMIZER_SETTING("EnabledTricks")); CVarClear(CVAR_RANDOMIZER_SETTING("EnabledTricks"));
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
ImGui::BeginChild("ChildTricksEnabled", ImVec2(0, -8), false, ImGuiWindowFlags_HorizontalScrollbar); ImGui::BeginChild("ChildTricksEnabled", ImVec2(0, -8), false, ImGuiWindowFlags_HorizontalScrollbar);
@ -5160,7 +5160,7 @@ void RandomizerSettingsWindow::DrawElement() {
} else { } else {
CVarSetString(CVAR_RANDOMIZER_SETTING("EnabledTricks"), enabledTrickString.c_str()); CVarSetString(CVAR_RANDOMIZER_SETTING("EnabledTricks"), enabledTrickString.c_str());
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
DrawTagChips(*rtObject.rtTags); DrawTagChips(*rtObject.rtTags);
ImGui::SameLine(); ImGui::SameLine();

View File

@ -877,7 +877,7 @@ void CheckTrackerWindow::DrawElement() {
if (CVarGetInteger(CVAR_TRACKER_CHECK("DisplayType"), TRACKER_DISPLAY_ALWAYS) == TRACKER_DISPLAY_COMBO_BUTTON) { if (CVarGetInteger(CVAR_TRACKER_CHECK("DisplayType"), TRACKER_DISPLAY_ALWAYS) == TRACKER_DISPLAY_COMBO_BUTTON) {
int comboButton1Mask = buttons[CVarGetInteger(CVAR_TRACKER_CHECK("ComboButton1"), TRACKER_COMBO_BUTTON_L)]; int comboButton1Mask = buttons[CVarGetInteger(CVAR_TRACKER_CHECK("ComboButton1"), TRACKER_COMBO_BUTTON_L)];
int comboButton2Mask = buttons[CVarGetInteger(CVAR_TRACKER_CHECK("ComboButton2"), TRACKER_COMBO_BUTTON_R)]; int comboButton2Mask = buttons[CVarGetInteger(CVAR_TRACKER_CHECK("ComboButton2"), TRACKER_COMBO_BUTTON_R)];
OSContPad* trackerButtonsPressed = LUS::Context::GetInstance()->GetControlDeck()->GetPads(); OSContPad* trackerButtonsPressed = Ship::Context::GetInstance()->GetControlDeck()->GetPads();
bool comboButtonsHeld = trackerButtonsPressed != nullptr && bool comboButtonsHeld = trackerButtonsPressed != nullptr &&
trackerButtonsPressed[0].button & comboButton1Mask && trackerButtonsPressed[0].button & comboButton1Mask &&
trackerButtonsPressed[0].button & comboButton2Mask; trackerButtonsPressed[0].button & comboButton2Mask;

View File

@ -7,9 +7,9 @@
namespace CheckTracker { namespace CheckTracker {
class CheckTrackerSettingsWindow : public LUS::GuiWindow { class CheckTrackerSettingsWindow : public Ship::GuiWindow {
public: public:
using LUS::GuiWindow::GuiWindow; using GuiWindow::GuiWindow;
~CheckTrackerSettingsWindow() {}; ~CheckTrackerSettingsWindow() {};
protected: protected:
@ -18,9 +18,9 @@ class CheckTrackerSettingsWindow : public LUS::GuiWindow {
void UpdateElement() override {}; void UpdateElement() override {};
}; };
class CheckTrackerWindow : public LUS::GuiWindow { class CheckTrackerWindow : public Ship::GuiWindow {
public: public:
using LUS::GuiWindow::GuiWindow; using GuiWindow::GuiWindow;
~CheckTrackerWindow() {}; ~CheckTrackerWindow() {};
protected: protected:

View File

@ -85,7 +85,7 @@ s16 GetLastEntranceOverride();
s16 GetCurrentGrottoId(); s16 GetCurrentGrottoId();
const EntranceData* GetEntranceData(s16); const EntranceData* GetEntranceData(s16);
class EntranceTrackerWindow : public LUS::GuiWindow { class EntranceTrackerWindow : public Ship::GuiWindow {
public: public:
using GuiWindow::GuiWindow; using GuiWindow::GuiWindow;

View File

@ -560,7 +560,7 @@ void DrawItemCount(ItemTrackerItem item, bool hideMax) {
void DrawEquip(ItemTrackerItem item) { void DrawEquip(ItemTrackerItem item) {
bool hasEquip = HasEquipment(item); bool hasEquip = HasEquipment(item);
int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36); int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36);
ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasEquip && IsValidSaveFile() ? item.name : item.nameFaded), ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->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));
@ -570,7 +570,7 @@ void DrawQuest(ItemTrackerItem item) {
bool hasQuestItem = HasQuestItem(item); bool hasQuestItem = HasQuestItem(item);
int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36); int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36);
ImGui::BeginGroup(); ImGui::BeginGroup();
ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasQuestItem && IsValidSaveFile() ? item.name : item.nameFaded), ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->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) {
@ -640,7 +640,7 @@ void DrawItem(ItemTrackerItem item) {
ImGui::BeginGroup(); ImGui::BeginGroup();
ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->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, false); DrawItemCount(item, false);
@ -662,7 +662,7 @@ void DrawBottle(ItemTrackerItem item) {
} }
int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36); int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36);
ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->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));
@ -677,11 +677,11 @@ void DrawDungeonItem(ItemTrackerItem item) {
bool hasSmallKey = GameInteractor::IsSaveLoaded() ? ((gSaveContext.inventory.dungeonKeys[item.data]) >= 0) : false; bool hasSmallKey = GameInteractor::IsSaveLoaded() ? ((gSaveContext.inventory.dungeonKeys[item.data]) >= 0) : false;
ImGui::BeginGroup(); ImGui::BeginGroup();
if (itemId == ITEM_KEY_SMALL) { if (itemId == ITEM_KEY_SMALL) {
ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasSmallKey && IsValidSaveFile() ? item.name : item.nameFaded), ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->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(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->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));
} }
@ -722,7 +722,7 @@ void DrawSong(ItemTrackerItem item) {
ImVec2 p = ImGui::GetCursorScreenPos(); ImVec2 p = ImGui::GetCursorScreenPos();
bool hasSong = HasSong(item); bool hasSong = HasSong(item);
ImGui::SetCursorScreenPos(ImVec2(p.x + 6, p.y)); ImGui::SetCursorScreenPos(ImVec2(p.x + 6, p.y));
ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasSong && IsValidSaveFile() ? item.name : item.nameFaded), ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->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));
} }
@ -1013,7 +1013,7 @@ void ItemTrackerWindow::DrawElement() {
int iconSpacing = CVarGetInteger(CVAR_TRACKER_ITEM("IconSpacing"), 12); int iconSpacing = CVarGetInteger(CVAR_TRACKER_ITEM("IconSpacing"), 12);
int comboButton1Mask = buttonMap[CVarGetInteger(CVAR_TRACKER_ITEM("ComboButton1"), TRACKER_COMBO_BUTTON_L)]; int comboButton1Mask = buttonMap[CVarGetInteger(CVAR_TRACKER_ITEM("ComboButton1"), TRACKER_COMBO_BUTTON_L)];
int comboButton2Mask = buttonMap[CVarGetInteger(CVAR_TRACKER_ITEM("ComboButton2"), TRACKER_COMBO_BUTTON_R)]; int comboButton2Mask = buttonMap[CVarGetInteger(CVAR_TRACKER_ITEM("ComboButton2"), TRACKER_COMBO_BUTTON_R)];
OSContPad* buttonsPressed = LUS::Context::GetInstance()->GetControlDeck()->GetPads(); OSContPad* buttonsPressed = Ship::Context::GetInstance()->GetControlDeck()->GetPads();
bool comboButtonsHeld = buttonsPressed != nullptr && buttonsPressed[0].button & comboButton1Mask && buttonsPressed[0].button & comboButton2Mask; bool comboButtonsHeld = buttonsPressed != nullptr && buttonsPressed[0].button & comboButton1Mask && buttonsPressed[0].button & comboButton2Mask;
bool isPaused = CVarGetInteger(CVAR_TRACKER_ITEM("ShowOnlyPaused"), 0) == 0 || gPlayState != nullptr && gPlayState->pauseCtx.state > 0; bool isPaused = CVarGetInteger(CVAR_TRACKER_ITEM("ShowOnlyPaused"), 0) == 0 || gPlayState != nullptr && gPlayState->pauseCtx.state > 0;
@ -1144,7 +1144,7 @@ void ItemTrackerSettingsWindow::DrawElement() {
CVarSetFloat(CVAR_TRACKER_ITEM("BgColorG"), ChromaKeyBackground.y); CVarSetFloat(CVAR_TRACKER_ITEM("BgColorG"), ChromaKeyBackground.y);
CVarSetFloat(CVAR_TRACKER_ITEM("BgColorB"), ChromaKeyBackground.z); CVarSetFloat(CVAR_TRACKER_ITEM("BgColorB"), ChromaKeyBackground.z);
CVarSetFloat(CVAR_TRACKER_ITEM("BgColorA"), ChromaKeyBackground.w); CVarSetFloat(CVAR_TRACKER_ITEM("BgColorA"), ChromaKeyBackground.w);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
ImGui::PopItemWidth(); ImGui::PopItemWidth();

View File

@ -29,7 +29,7 @@ typedef struct ItemTrackerDungeon {
std::vector<uint32_t> items; std::vector<uint32_t> items;
} ItemTrackerDungeon; } ItemTrackerDungeon;
class ItemTrackerSettingsWindow : public LUS::GuiWindow { class ItemTrackerSettingsWindow : public Ship::GuiWindow {
public: public:
using GuiWindow::GuiWindow; using GuiWindow::GuiWindow;
@ -39,7 +39,7 @@ class ItemTrackerSettingsWindow : public LUS::GuiWindow {
void UpdateElement() override {}; void UpdateElement() override {};
}; };
class ItemTrackerWindow : public LUS::GuiWindow { class ItemTrackerWindow : public Ship::GuiWindow {
public: public:
using GuiWindow::GuiWindow; using GuiWindow::GuiWindow;

View File

@ -1,6 +1,6 @@
#include <libultraship/libultraship.h> #include <libultraship/libultraship.h>
class RandomizerSettingsWindow : public LUS::GuiWindow { class RandomizerSettingsWindow : public Ship::GuiWindow {
public: public:
using GuiWindow::GuiWindow; using GuiWindow::GuiWindow;

View File

@ -117,7 +117,7 @@ void AdvancedResolutionSettingsWindow::DrawElement() {
CVarGetInteger("gLowResMode", 0); CVarGetInteger("gLowResMode", 0);
if (UIWidgets::EnhancementSliderFloat("Internal Resolution: %.1f%%", "##IMul", "gInternalResolution", 0.5f, if (UIWidgets::EnhancementSliderFloat("Internal Resolution: %.1f%%", "##IMul", "gInternalResolution", 0.5f,
2.0f, "", 1.0f, true, true, disabled_resolutionSlider)) { 2.0f, "", 1.0f, true, true, disabled_resolutionSlider)) {
LUS::Context::GetInstance()->GetWindow()->SetResolutionMultiplier( Ship::Context::GetInstance()->GetWindow()->SetResolutionMultiplier(
CVarGetFloat("gInternalResolution", 1)); CVarGetFloat("gInternalResolution", 1));
} }
UIWidgets::Tooltip("Multiplies your output resolution by the value entered."); UIWidgets::Tooltip("Multiplies your output resolution by the value entered.");
@ -126,7 +126,7 @@ void AdvancedResolutionSettingsWindow::DrawElement() {
#ifndef __WIIU__ #ifndef __WIIU__
if (UIWidgets::PaddedEnhancementSliderInt("MSAA: %d", "##IMSAA", "gMSAAValue", 1, 8, "", 1, true, true, if (UIWidgets::PaddedEnhancementSliderInt("MSAA: %d", "##IMSAA", "gMSAAValue", 1, 8, "", 1, true, true,
false)) { false)) {
LUS::Context::GetInstance()->GetWindow()->SetMsaaLevel(CVarGetInteger("gMSAAValue", 1)); Ship::Context::GetInstance()->GetWindow()->SetMsaaLevel(CVarGetInteger("gMSAAValue", 1));
}; };
UIWidgets::Tooltip( UIWidgets::Tooltip(
"Activates multi-sample anti-aliasing when above 1x, up to 8x for 8 samples for every pixel.\n\n" "Activates multi-sample anti-aliasing when above 1x, up to 8x for 8 samples for every pixel.\n\n"

View File

@ -2,12 +2,12 @@
#include <libultraship/libultraship.h> #include <libultraship/libultraship.h>
namespace AdvancedResolutionSettings { namespace AdvancedResolutionSettings {
class AdvancedResolutionSettingsWindow : public LUS::GuiWindow { class AdvancedResolutionSettingsWindow : public Ship::GuiWindow {
private: private:
bool IsDroppingFrames(); bool IsDroppingFrames();
public: public:
using LUS::GuiWindow::GuiWindow; using GuiWindow::GuiWindow;
void InitElement() override; void InitElement() override;
void DrawElement() override; void DrawElement() override;

View File

@ -837,7 +837,7 @@ extern "C" void ProcessSaveStateRequests(void) {
} }
void SaveStateMgr::SetCurrentSlot(unsigned int slot) { void SaveStateMgr::SetCurrentSlot(unsigned int slot) {
LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "slot %u set", slot); Ship::Context::GetInstance()->GetWindow()->GetGui()->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();
LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "saved state %u", request.slot); Ship::Context::GetInstance()->GetWindow()->GetGui()->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();
LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "loaded state %u", request.slot); Ship::Context::GetInstance()->GetWindow()->GetGui()->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\"");
LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "states not available here", request.slot); Ship::Context::GetInstance()->GetWindow()->GetGui()->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);
LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(1.0f, true, "state slot %u empty", request.slot); Ship::Context::GetInstance()->GetWindow()->GetGui()->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

@ -1039,22 +1039,22 @@ void InitTTSBank() {
break; break;
} }
auto initData = std::make_shared<LUS::ResourceInitData>(); auto initData = std::make_shared<Ship::ResourceInitData>();
initData->Format = RESOURCE_FORMAT_BINARY; initData->Format = RESOURCE_FORMAT_BINARY;
initData->Type = static_cast<uint32_t>(LUS::ResourceType::Json); initData->Type = static_cast<uint32_t>(Ship::ResourceType::Json);
initData->ResourceVersion = 0; initData->ResourceVersion = 0;
sceneMap = std::static_pointer_cast<LUS::Json>( sceneMap = std::static_pointer_cast<Ship::Json>(
LUS::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/scenes" + languageSuffix, true, initData))->Data; Ship::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/scenes" + languageSuffix, true, initData))->Data;
miscMap = std::static_pointer_cast<LUS::Json>( miscMap = std::static_pointer_cast<Ship::Json>(
LUS::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/misc" + languageSuffix, true, initData))->Data; Ship::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/misc" + languageSuffix, true, initData))->Data;
kaleidoMap = std::static_pointer_cast<LUS::Json>( kaleidoMap = std::static_pointer_cast<Ship::Json>(
LUS::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/kaleidoscope" + languageSuffix, true, initData))->Data; Ship::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/kaleidoscope" + languageSuffix, true, initData))->Data;
fileChooseMap = std::static_pointer_cast<LUS::Json>( fileChooseMap = std::static_pointer_cast<Ship::Json>(
LUS::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/filechoose" + languageSuffix, true, initData))->Data; Ship::Context::GetInstance()->GetResourceManager()->LoadResource("accessibility/texts/filechoose" + languageSuffix, true, initData))->Data;
} }
void RegisterOnSetGameLanguageHook() { void RegisterOnSetGameLanguageHook() {

View File

@ -248,19 +248,19 @@ const char* constCameraStrings[] = {
OTRGlobals::OTRGlobals() { OTRGlobals::OTRGlobals() {
std::vector<std::string> OTRFiles; std::vector<std::string> OTRFiles;
std::string mqPath = LUS::Context::LocateFileAcrossAppDirs("oot-mq.otr", appShortName); std::string mqPath = Ship::Context::LocateFileAcrossAppDirs("oot-mq.otr", appShortName);
if (std::filesystem::exists(mqPath)) { if (std::filesystem::exists(mqPath)) {
OTRFiles.push_back(mqPath); OTRFiles.push_back(mqPath);
} }
std::string ootPath = LUS::Context::LocateFileAcrossAppDirs("oot.otr", appShortName); std::string ootPath = Ship::Context::LocateFileAcrossAppDirs("oot.otr", appShortName);
if (std::filesystem::exists(ootPath)) { if (std::filesystem::exists(ootPath)) {
OTRFiles.push_back(ootPath); OTRFiles.push_back(ootPath);
} }
std::string sohOtrPath = LUS::Context::GetPathRelativeToAppBundle("soh.otr"); std::string sohOtrPath = Ship::Context::GetPathRelativeToAppBundle("soh.otr");
if (std::filesystem::exists(sohOtrPath)) { if (std::filesystem::exists(sohOtrPath)) {
OTRFiles.push_back(sohOtrPath); OTRFiles.push_back(sohOtrPath);
} }
std::string patchesPath = LUS::Context::LocateFileAcrossAppDirs("mods", appShortName); std::string patchesPath = Ship::Context::LocateFileAcrossAppDirs("mods", appShortName);
std::vector<std::string> patchOTRs = {}; std::vector<std::string> patchOTRs = {};
if (patchesPath.length() > 0 && std::filesystem::exists(patchesPath)) { if (patchesPath.length() > 0 && std::filesystem::exists(patchesPath)) {
if (std::filesystem::is_directory(patchesPath)) { if (std::filesystem::is_directory(patchesPath)) {
@ -302,7 +302,7 @@ OTRGlobals::OTRGlobals() {
OOT_PAL_GC_DBG2 OOT_PAL_GC_DBG2
}; };
context = LUS::Context::CreateUninitializedInstance("Ship of Harkinian", appShortName, "shipofharkinian.json"); context = Ship::Context::CreateUninitializedInstance("Ship of Harkinian", appShortName, "shipofharkinian.json");
context->InitLogging(); context->InitLogging();
context->InitGfxDebugger(); context->InitGfxDebugger();
@ -378,7 +378,7 @@ OTRGlobals::OTRGlobals() {
#if defined(__SWITCH__) #if defined(__SWITCH__)
SPDLOG_ERROR("Invalid OTR File!"); SPDLOG_ERROR("Invalid OTR File!");
#elif defined(__WIIU__) #elif defined(__WIIU__)
LUS::WiiU::ThrowInvalidOTR(); Ship::WiiU::ThrowInvalidOTR();
#else #else
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Invalid OTR File", SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Invalid OTR File",
"Attempted to load an invalid OTR file. Try regenerating.", nullptr); "Attempted to load an invalid OTR file. Try regenerating.", nullptr);
@ -450,15 +450,15 @@ bool OTRGlobals::HasOriginal() {
} }
uint32_t OTRGlobals::GetInterpolationFPS() { uint32_t OTRGlobals::GetInterpolationFPS() {
if (LUS::Context::GetInstance()->GetWindow()->GetWindowBackend() == LUS::WindowBackend::DX11) { if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::DX11) {
return CVarGetInteger("gInterpolationFPS", 20); return CVarGetInteger("gInterpolationFPS", 20);
} }
if (CVarGetInteger("gMatchRefreshRate", 0)) { if (CVarGetInteger("gMatchRefreshRate", 0)) {
return LUS::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); return Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate();
} }
return std::min<uint32_t>(LUS::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(), CVarGetInteger("gInterpolationFPS", 20)); return std::min<uint32_t>(Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(), CVarGetInteger("gInterpolationFPS", 20));
} }
struct ExtensionEntry { struct ExtensionEntry {
@ -853,7 +853,7 @@ extern "C" RandomizerGet RetrieveRandomizerGetFromItemID(ItemID itemID) {
} }
extern "C" void OTRExtScanner() { extern "C" void OTRExtScanner() {
auto lst = *LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles().get(); auto lst = *Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles().get();
for (auto& rPath : lst) { for (auto& rPath : lst) {
std::vector<std::string> raw = StringHelper::Split(rPath, "."); std::vector<std::string> raw = StringHelper::Split(rPath, ".");
@ -876,13 +876,13 @@ OTRVersion ReadPortVersionFromOTR(std::string otrPath) {
OTRVersion version = {}; OTRVersion version = {};
// Use a temporary archive instance to load the otr and read the version file // Use a temporary archive instance to load the otr and read the version file
auto archive = LUS::OtrArchive(otrPath); auto archive = Ship::OtrArchive(otrPath);
if (archive.Open()) { if (archive.Open()) {
auto t = archive.LoadFile("portVersion", std::make_shared<LUS::ResourceInitData>()); auto t = archive.LoadFile("portVersion", std::make_shared<Ship::ResourceInitData>());
if (t != nullptr && t->IsLoaded) { if (t != nullptr && t->IsLoaded) {
auto stream = std::make_shared<LUS::MemoryStream>(t->Buffer->data(), t->Buffer->size()); auto stream = std::make_shared<Ship::MemoryStream>(t->Buffer->data(), t->Buffer->size());
auto reader = std::make_shared<LUS::BinaryReader>(stream); auto reader = std::make_shared<Ship::BinaryReader>(stream);
LUS::Endianness endianness = (LUS::Endianness)reader->ReadUByte(); Ship::Endianness endianness = (Ship::Endianness)reader->ReadUByte();
reader->SetEndianness(endianness); reader->SetEndianness(endianness);
version.major = reader->ReadUInt16(); version.major = reader->ReadUInt16();
version.minor = reader->ReadUInt16(); version.minor = reader->ReadUInt16();
@ -913,7 +913,7 @@ void CheckSoHOTRVersion(std::string otrPath) {
Extractor::ShowErrorBox("soh.otr file is missing", msg.c_str()); Extractor::ShowErrorBox("soh.otr file is missing", msg.c_str());
exit(1); exit(1);
#elif defined(__SWITCH__) #elif defined(__SWITCH__)
LUS::Switch::PrintErrorMessageToScreen(("\x1b[2;2HYou are missing the soh.otr file." + msg).c_str()); Ship::Switch::PrintErrorMessageToScreen(("\x1b[2;2HYou are missing the soh.otr file." + msg).c_str());
#elif defined(__WIIU__) #elif defined(__WIIU__)
OSFatal(("You are missing the soh.otr file\n\n" + msg).c_str()); OSFatal(("You are missing the soh.otr file\n\n" + msg).c_str());
#endif #endif
@ -926,7 +926,7 @@ void CheckSoHOTRVersion(std::string otrPath) {
Extractor::ShowErrorBox("soh.otr file version does not match", msg.c_str()); Extractor::ShowErrorBox("soh.otr file version does not match", msg.c_str());
exit(1); exit(1);
#elif defined(__SWITCH__) #elif defined(__SWITCH__)
LUS::Switch::PrintErrorMessageToScreen(("\x1b[2;2HYou have an old soh.otr file." + msg).c_str()); Ship::Switch::PrintErrorMessageToScreen(("\x1b[2;2HYou have an old soh.otr file." + msg).c_str());
#elif defined(__WIIU__) #elif defined(__WIIU__)
OSFatal(("You have an old soh.otr file\n\n" + msg).c_str()); OSFatal(("You have an old soh.otr file\n\n" + msg).c_str());
#endif #endif
@ -937,7 +937,7 @@ void CheckSoHOTRVersion(std::string otrPath) {
// For Windows/Mac/Linux if the version doesn't match, offer to // For Windows/Mac/Linux if the version doesn't match, offer to
void DetectOTRVersion(std::string fileName, bool isMQ) { void DetectOTRVersion(std::string fileName, bool isMQ) {
bool isOtrOld = false; bool isOtrOld = false;
std::string otrPath = LUS::Context::LocateFileAcrossAppDirs(fileName, appShortName); std::string otrPath = Ship::Context::LocateFileAcrossAppDirs(fileName, appShortName);
// Doesn't exist so nothing to do here // Doesn't exist so nothing to do here
if (!std::filesystem::exists(otrPath)) { if (!std::filesystem::exists(otrPath)) {
@ -967,7 +967,7 @@ void DetectOTRVersion(std::string fileName, bool isMQ) {
fileName.c_str(), version); fileName.c_str(), version);
if (Extractor::ShowYesNoBox("Old OTR File Found", msgBuf) == IDYES) { if (Extractor::ShowYesNoBox("Old OTR File Found", msgBuf) == IDYES) {
std::string installPath = LUS::Context::GetAppBundlePath(); std::string installPath = Ship::Context::GetAppBundlePath();
if (!std::filesystem::exists(installPath + "/assets/extractor")) { if (!std::filesystem::exists(installPath + "/assets/extractor")) {
Extractor::ShowErrorBox("Extractor assets not found", Extractor::ShowErrorBox("Extractor assets not found",
"Unable to regenerate. Missing assets/extractor folder needed to generate OTR file.\n\nExiting..."); "Unable to regenerate. Missing assets/extractor folder needed to generate OTR file.\n\nExiting...");
@ -975,17 +975,17 @@ void DetectOTRVersion(std::string fileName, bool isMQ) {
} }
Extractor extract; Extractor extract;
if (!extract.Run(LUS::Context::GetAppDirectoryPath(appShortName), isMQ ? RomSearchMode::MQ : RomSearchMode::Vanilla)) { if (!extract.Run(Ship::Context::GetAppDirectoryPath(appShortName), isMQ ? RomSearchMode::MQ : RomSearchMode::Vanilla)) {
Extractor::ShowErrorBox("Error", "An error occured, no OTR file was generated.\n\nExiting..."); Extractor::ShowErrorBox("Error", "An error occured, no OTR file was generated.\n\nExiting...");
exit(1); exit(1);
} }
extract.CallZapd(installPath, LUS::Context::GetAppDirectoryPath(appShortName)); extract.CallZapd(installPath, Ship::Context::GetAppDirectoryPath(appShortName));
} else { } else {
exit(1); exit(1);
} }
#elif defined(__SWITCH__) #elif defined(__SWITCH__)
LUS::Switch::PrintErrorMessageToScreen("\x1b[2;2HYou've launched the Ship with an old game OTR file." Ship::Switch::PrintErrorMessageToScreen("\x1b[2;2HYou've launched the Ship with an old game OTR file."
"\x1b[4;2HPlease regenerate a new game OTR and relaunch." "\x1b[4;2HPlease regenerate a new game OTR and relaunch."
"\x1b[6;2HPress the Home button to exit..."); "\x1b[6;2HPress the Home button to exit...");
#elif defined(__WIIU__) #elif defined(__WIIU__)
@ -1013,9 +1013,9 @@ bool PathTestCleanup(FILE* tfile) {
extern "C" void InitOTR() { extern "C" void InitOTR() {
#ifdef __SWITCH__ #ifdef __SWITCH__
LUS::Switch::Init(LUS::PreInitPhase); Ship::Switch::Init(Ship::PreInitPhase);
#elif defined(__WIIU__) #elif defined(__WIIU__)
LUS::WiiU::Init(appShortName); Ship::WiiU::Init(appShortName);
#endif #endif
#ifdef _WIN32 #ifdef _WIN32
@ -1055,13 +1055,13 @@ extern "C" void InitOTR() {
} }
#endif #endif
CheckSoHOTRVersion(LUS::Context::GetPathRelativeToAppBundle("soh.otr")); CheckSoHOTRVersion(Ship::Context::GetPathRelativeToAppBundle("soh.otr"));
if (!std::filesystem::exists(LUS::Context::LocateFileAcrossAppDirs("oot-mq.otr", appShortName)) && if (!std::filesystem::exists(Ship::Context::LocateFileAcrossAppDirs("oot-mq.otr", appShortName)) &&
!std::filesystem::exists(LUS::Context::LocateFileAcrossAppDirs("oot.otr", appShortName))){ !std::filesystem::exists(Ship::Context::LocateFileAcrossAppDirs("oot.otr", appShortName))){
#if not defined(__SWITCH__) && not defined(__WIIU__) #if not defined(__SWITCH__) && not defined(__WIIU__)
std::string installPath = LUS::Context::GetAppBundlePath(); std::string installPath = Ship::Context::GetAppBundlePath();
if (!std::filesystem::exists(installPath + "/assets/extractor")) { if (!std::filesystem::exists(installPath + "/assets/extractor")) {
Extractor::ShowErrorBox("Extractor assets not found", Extractor::ShowErrorBox("Extractor assets not found",
"No OTR files found. Missing assets/extractor folder needed to generate OTR file.\n\nExiting..."); "No OTR files found. Missing assets/extractor folder needed to generate OTR file.\n\nExiting...");
@ -1071,26 +1071,26 @@ extern "C" void InitOTR() {
bool generatedOtrIsMQ = false; bool generatedOtrIsMQ = false;
if (Extractor::ShowYesNoBox("No OTR Files", "No OTR files found. Generate one now?") == IDYES) { if (Extractor::ShowYesNoBox("No OTR Files", "No OTR files found. Generate one now?") == IDYES) {
Extractor extract; Extractor extract;
if (!extract.Run(LUS::Context::GetAppDirectoryPath(appShortName))) { if (!extract.Run(Ship::Context::GetAppDirectoryPath(appShortName))) {
Extractor::ShowErrorBox("Error", "An error occured, no OTR file was generated.\n\nExiting..."); Extractor::ShowErrorBox("Error", "An error occured, no OTR file was generated.\n\nExiting...");
exit(1); exit(1);
} }
extract.CallZapd(installPath, LUS::Context::GetAppDirectoryPath(appShortName)); extract.CallZapd(installPath, Ship::Context::GetAppDirectoryPath(appShortName));
generatedOtrIsMQ = extract.IsMasterQuest(); generatedOtrIsMQ = extract.IsMasterQuest();
} else { } else {
exit(1); 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;
if (!extract.Run(LUS::Context::GetAppDirectoryPath(appShortName), generatedOtrIsMQ ? RomSearchMode::Vanilla : RomSearchMode::MQ)) { if (!extract.Run(Ship::Context::GetAppDirectoryPath(appShortName), generatedOtrIsMQ ? RomSearchMode::Vanilla : RomSearchMode::MQ)) {
Extractor::ShowErrorBox("Error", "An error occured, an OTR file may have been generated by a different step.\n\nContinuing..."); Extractor::ShowErrorBox("Error", "An error occured, an OTR file may have been generated by a different step.\n\nContinuing...");
} else { } else {
extract.CallZapd(installPath, LUS::Context::GetAppDirectoryPath(appShortName)); extract.CallZapd(installPath, Ship::Context::GetAppDirectoryPath(appShortName));
} }
} }
#elif defined(__SWITCH__) #elif defined(__SWITCH__)
LUS::Switch::PrintErrorMessageToScreen("\x1b[2;2HYou've launched the Ship without a game OTR file." Ship::Switch::PrintErrorMessageToScreen("\x1b[2;2HYou've launched the Ship without a game OTR file."
"\x1b[4;2HPlease generate a game OTR and relaunch." "\x1b[4;2HPlease generate a game OTR and relaunch."
"\x1b[6;2HPress the Home button to exit..."); "\x1b[6;2HPress the Home button to exit...");
#elif defined(__WIIU__) #elif defined(__WIIU__)
@ -1165,9 +1165,9 @@ extern "C" void InitOTR() {
} }
#endif #endif
std::shared_ptr<LUS::Config> conf = OTRGlobals::Instance->context->GetConfig(); std::shared_ptr<Ship::Config> conf = OTRGlobals::Instance->context->GetConfig();
conf->RegisterConfigVersionUpdater(std::make_shared<LUS::ConfigVersion1Updater>()); conf->RegisterConfigVersionUpdater(std::make_shared<SOH::ConfigVersion1Updater>());
conf->RegisterConfigVersionUpdater(std::make_shared<LUS::ConfigVersion2Updater>()); conf->RegisterConfigVersionUpdater(std::make_shared<SOH::ConfigVersion2Updater>());
conf->RunVersionUpdates(); conf->RunVersionUpdates();
} }
@ -1245,14 +1245,14 @@ extern bool ToggleAltAssetsAtEndOfFrame;
extern "C" void Graph_StartFrame() { extern "C" void Graph_StartFrame() {
#ifndef __WIIU__ #ifndef __WIIU__
using LUS::KbScancode; using Ship::KbScancode;
int32_t dwScancode = OTRGlobals::Instance->context->GetWindow()->GetLastScancode(); int32_t dwScancode = OTRGlobals::Instance->context->GetWindow()->GetLastScancode();
OTRGlobals::Instance->context->GetWindow()->SetLastScancode(-1); OTRGlobals::Instance->context->GetWindow()->SetLastScancode(-1);
switch (dwScancode) { switch (dwScancode) {
case KbScancode::LUS_KB_F5: { case KbScancode::LUS_KB_F5: {
if (CVarGetInteger(CVAR_CHEAT("SaveStatesEnabled"), 0) == 0) { if (CVarGetInteger(CVAR_CHEAT("SaveStatesEnabled"), 0) == 0) {
LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()-> Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->
TextDrawNotification(6.0f, true, "Save states not enabled. Check Cheats Menu."); TextDrawNotification(6.0f, true, "Save states not enabled. Check Cheats Menu.");
return; return;
} }
@ -1274,7 +1274,7 @@ extern "C" void Graph_StartFrame() {
} }
case KbScancode::LUS_KB_F6: { case KbScancode::LUS_KB_F6: {
if (CVarGetInteger(CVAR_CHEAT("SaveStatesEnabled"), 0) == 0) { if (CVarGetInteger(CVAR_CHEAT("SaveStatesEnabled"), 0) == 0) {
LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()-> Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->
TextDrawNotification(6.0f, true, "Save states not enabled. Check Cheats Menu."); TextDrawNotification(6.0f, true, "Save states not enabled. Check Cheats Menu.");
return; return;
} }
@ -1289,7 +1289,7 @@ extern "C" void Graph_StartFrame() {
} }
case KbScancode::LUS_KB_F7: { case KbScancode::LUS_KB_F7: {
if (CVarGetInteger(CVAR_CHEAT("SaveStatesEnabled"), 0) == 0) { if (CVarGetInteger(CVAR_CHEAT("SaveStatesEnabled"), 0) == 0) {
LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()-> Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->
TextDrawNotification(6.0f, true, "Save states not enabled. Check Cheats Menu."); TextDrawNotification(6.0f, true, "Save states not enabled. Check Cheats Menu.");
return; return;
} }
@ -1431,15 +1431,15 @@ extern "C" uint16_t OTRGetPixelDepth(float x, float y) {
} }
extern "C" uint32_t ResourceMgr_GetNumGameVersions() { extern "C" uint32_t ResourceMgr_GetNumGameVersions() {
return LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions().size(); return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions().size();
} }
extern "C" uint32_t ResourceMgr_GetGameVersion(int index) { extern "C" uint32_t ResourceMgr_GetGameVersion(int index) {
return LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index];
} }
extern "C" uint32_t ResourceMgr_GetGamePlatform(int index) { extern "C" uint32_t ResourceMgr_GetGamePlatform(int index) {
uint32_t version = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; uint32_t version = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index];
switch (version) { switch (version) {
case OOT_NTSC_US_10: case OOT_NTSC_US_10:
@ -1462,7 +1462,7 @@ extern "C" uint32_t ResourceMgr_GetGamePlatform(int index) {
} }
extern "C" uint32_t ResourceMgr_GetGameRegion(int index) { extern "C" uint32_t ResourceMgr_GetGameRegion(int index) {
uint32_t version = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; uint32_t version = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index];
switch (version) { switch (version) {
case OOT_NTSC_US_10: case OOT_NTSC_US_10:
@ -1531,10 +1531,10 @@ extern "C" uint32_t ResourceMgr_IsGameMasterQuest() {
} }
extern "C" void ResourceMgr_LoadDirectory(const char* resName) { extern "C" void ResourceMgr_LoadDirectory(const char* resName) {
LUS::Context::GetInstance()->GetResourceManager()->LoadDirectory(resName); Ship::Context::GetInstance()->GetResourceManager()->LoadDirectory(resName);
} }
extern "C" void ResourceMgr_DirtyDirectory(const char* resName) { extern "C" void ResourceMgr_DirtyDirectory(const char* resName) {
LUS::Context::GetInstance()->GetResourceManager()->DirtyDirectory(resName); Ship::Context::GetInstance()->GetResourceManager()->DirtyDirectory(resName);
} }
extern "C" void ResourceMgr_UnloadResource(const char* resName) { extern "C" void ResourceMgr_UnloadResource(const char* resName) {
@ -1542,13 +1542,13 @@ extern "C" void ResourceMgr_UnloadResource(const char* resName) {
if (path.substr(0, 7) == "__OTR__") { if (path.substr(0, 7) == "__OTR__") {
path = path.substr(7); path = path.substr(7);
} }
auto res = LUS::Context::GetInstance()->GetResourceManager()->UnloadResource(path); auto res = Ship::Context::GetInstance()->GetResourceManager()->UnloadResource(path);
} }
// OTRTODO: There is probably a more elegant way to go about this... // OTRTODO: There is probably a more elegant way to go about this...
// Kenix: This is definitely leaking memory when it's called. // Kenix: This is definitely leaking memory when it's called.
extern "C" char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize) { extern "C" char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize) {
auto lst = LUS::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles(searchMask); auto lst = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles(searchMask);
char** result = (char**)malloc(lst->size() * sizeof(char*)); char** result = (char**)malloc(lst->size() * sizeof(char*));
for (size_t i = 0; i < lst->size(); i++) { for (size_t i = 0; i < lst->size(); i++) {
@ -1592,7 +1592,7 @@ extern "C" void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName) {
} }
} }
std::shared_ptr<LUS::IResource> GetResourceByNameHandlingMQ(const char* path) { std::shared_ptr<Ship::IResource> GetResourceByNameHandlingMQ(const char* path) {
std::string Path = path; std::string Path = path;
if (ResourceMgr_IsGameMasterQuest()) { if (ResourceMgr_IsGameMasterQuest()) {
size_t pos = 0; size_t pos = 0;
@ -1600,7 +1600,7 @@ std::shared_ptr<LUS::IResource> GetResourceByNameHandlingMQ(const char* path) {
Path.replace(pos, 7, "/mq/"); Path.replace(pos, 7, "/mq/");
} }
} }
return LUS::Context::GetInstance()->GetResourceManager()->LoadResource(Path.c_str()); return Ship::Context::GetInstance()->GetResourceManager()->LoadResource(Path.c_str());
} }
extern "C" char* GetResourceDataByNameHandlingMQ(const char* path) { extern "C" char* GetResourceDataByNameHandlingMQ(const char* path) {
@ -1728,7 +1728,7 @@ std::unordered_map<std::string, std::unordered_map<std::string, GfxPatch>> origi
// instead (When that is available). Index can be found using the commented out section below. // instead (When that is available). Index can be found using the commented out section below.
extern "C" void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction) { extern "C" void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction) {
auto res = std::static_pointer_cast<LUS::DisplayList>( auto res = std::static_pointer_cast<LUS::DisplayList>(
LUS::Context::GetInstance()->GetResourceManager()->LoadResource(path)); Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path));
// Leaving this here for people attempting to find the correct Dlist index to patch // Leaving this here for people attempting to find the correct Dlist index to patch
/*if (strcmp("__OTR__objects/object_gi_longsword/gGiBiggoronSwordDL", path) == 0) { /*if (strcmp("__OTR__objects/object_gi_longsword/gGiBiggoronSwordDL", path) == 0) {
@ -1767,7 +1767,7 @@ extern "C" void ResourceMgr_PatchGfxByName(const char* path, const char* patchNa
extern "C" void ResourceMgr_PatchGfxCopyCommandByName(const char* path, const char* patchName, int destinationIndex, int sourceIndex) { extern "C" void ResourceMgr_PatchGfxCopyCommandByName(const char* path, const char* patchName, int destinationIndex, int sourceIndex) {
auto res = std::static_pointer_cast<LUS::DisplayList>( auto res = std::static_pointer_cast<LUS::DisplayList>(
LUS::Context::GetInstance()->GetResourceManager()->LoadResource(path)); Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path));
// Do not patch custom assets as they most likely do not have the same instructions as authentic assets // Do not patch custom assets as they most likely do not have the same instructions as authentic assets
if (res->GetInitData()->IsCustom) { if (res->GetInitData()->IsCustom) {
@ -1790,7 +1790,7 @@ extern "C" void ResourceMgr_PatchGfxCopyCommandByName(const char* path, const ch
extern "C" void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName) { extern "C" void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName) {
if (originalGfx.contains(path) && originalGfx[path].contains(patchName)) { if (originalGfx.contains(path) && originalGfx[path].contains(patchName)) {
auto res = std::static_pointer_cast<LUS::DisplayList>( auto res = std::static_pointer_cast<LUS::DisplayList>(
LUS::Context::GetInstance()->GetResourceManager()->LoadResource(path)); Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path));
Gfx* gfx = (Gfx*)&res->Instructions[originalGfx[path][patchName].index]; Gfx* gfx = (Gfx*)&res->Instructions[originalGfx[path][patchName].index];
*gfx = originalGfx[path][patchName].instruction; *gfx = originalGfx[path][patchName].instruction;
@ -1850,7 +1850,7 @@ extern "C" SoundFontSample* ReadCustomSample(const char* path) {
ExtensionEntry entry = ExtensionCache[path]; ExtensionEntry entry = ExtensionCache[path];
auto sampleRaw = LUS::Context::GetInstance()->GetResourceManager()->LoadFile(entry.path); auto sampleRaw = Ship::Context::GetInstance()->GetResourceManager()->LoadFile(entry.path);
uint32_t* strem = (uint32_t*)sampleRaw->Buffer.get(); uint32_t* strem = (uint32_t*)sampleRaw->Buffer.get();
uint8_t* strem2 = (uint8_t*)strem; uint8_t* strem2 = (uint8_t*)strem;
@ -1941,7 +1941,7 @@ extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, Skel
bool isAlt = CVarGetInteger("gAltAssets", 0); bool isAlt = CVarGetInteger("gAltAssets", 0);
if (isAlt) { if (isAlt) {
pathStr = LUS::IResource::gAltAssetPrefix + pathStr; pathStr = Ship::IResource::gAltAssetPrefix + pathStr;
} }
SkeletonHeader* skelHeader = (SkeletonHeader*) ResourceGetDataByName(pathStr.c_str()); SkeletonHeader* skelHeader = (SkeletonHeader*) ResourceGetDataByName(pathStr.c_str());
@ -1975,8 +1975,8 @@ extern "C" s32* ResourceMgr_LoadCSByName(const char* path) {
return (s32*)GetResourceDataByNameHandlingMQ(path); return (s32*)GetResourceDataByNameHandlingMQ(path);
} }
std::filesystem::path GetSaveFile(std::shared_ptr<LUS::Config> Conf) { std::filesystem::path GetSaveFile(std::shared_ptr<Ship::Config> Conf) {
const std::string fileName = Conf->GetString("Game.SaveName", LUS::Context::GetPathRelativeToAppDirectory("oot_save.sav")); const std::string fileName = Conf->GetString("Game.SaveName", Ship::Context::GetPathRelativeToAppDirectory("oot_save.sav"));
std::filesystem::path saveFile = std::filesystem::absolute(fileName); std::filesystem::path saveFile = std::filesystem::absolute(fileName);
if (!exists(saveFile.parent_path())) { if (!exists(saveFile.parent_path())) {
@ -1987,13 +1987,13 @@ std::filesystem::path GetSaveFile(std::shared_ptr<LUS::Config> Conf) {
} }
std::filesystem::path GetSaveFile() { std::filesystem::path GetSaveFile() {
const std::shared_ptr<LUS::Config> pConf = OTRGlobals::Instance->context->GetConfig(); const std::shared_ptr<Ship::Config> pConf = OTRGlobals::Instance->context->GetConfig();
return GetSaveFile(pConf); return GetSaveFile(pConf);
} }
void OTRGlobals::CheckSaveFile(size_t sramSize) const { void OTRGlobals::CheckSaveFile(size_t sramSize) const {
const std::shared_ptr<LUS::Config> pConf = Instance->context->GetConfig(); const std::shared_ptr<Ship::Config> pConf = Instance->context->GetConfig();
std::filesystem::path savePath = GetSaveFile(pConf); std::filesystem::path savePath = GetSaveFile(pConf);
std::fstream saveFile(savePath, std::fstream::in | std::fstream::out | std::fstream::binary); std::fstream saveFile(savePath, std::fstream::in | std::fstream::out | std::fstream::binary);
@ -2210,19 +2210,19 @@ Color_RGB8 GetColorForControllerLED() {
extern "C" void OTRControllerCallback(uint8_t rumble) { extern "C" void OTRControllerCallback(uint8_t rumble) {
// We call this every tick, SDL accounts for this use and prevents driver spam // We call this every tick, SDL accounts for this use and prevents driver spam
// https://github.com/libsdl-org/SDL/blob/f17058b562c8a1090c0c996b42982721ace90903/src/joystick/SDL_joystick.c#L1114-L1144 // https://github.com/libsdl-org/SDL/blob/f17058b562c8a1090c0c996b42982721ace90903/src/joystick/SDL_joystick.c#L1114-L1144
LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(0)->GetLED()->SetLEDColor(GetColorForControllerLED()); Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(0)->GetLED()->SetLEDColor(GetColorForControllerLED());
static std::shared_ptr<SohInputEditorWindow> controllerConfigWindow = nullptr; static std::shared_ptr<SohInputEditorWindow> controllerConfigWindow = nullptr;
if (controllerConfigWindow == nullptr) { if (controllerConfigWindow == nullptr) {
controllerConfigWindow = std::dynamic_pointer_cast<SohInputEditorWindow>(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Input Editor")); controllerConfigWindow = std::dynamic_pointer_cast<SohInputEditorWindow>(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Input Editor"));
} else if (controllerConfigWindow->TestingRumble()) { } else if (controllerConfigWindow->TestingRumble()) {
return; return;
} }
if (rumble) { if (rumble) {
LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(0)->GetRumble()->StartRumble(); Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(0)->GetRumble()->StartRumble();
} else { } else {
LUS::Context::GetInstance()->GetControlDeck()->GetControllerByPort(0)->GetRumble()->StopRumble(); Ship::Context::GetInstance()->GetControlDeck()->GetControllerByPort(0)->GetRumble()->StopRumble();
} }
} }
@ -2262,7 +2262,7 @@ extern "C" void AudioPlayer_Play(const uint8_t* buf, uint32_t len) {
} }
extern "C" int Controller_ShouldRumble(size_t slot) { extern "C" int Controller_ShouldRumble(size_t slot) {
for (auto [id, mapping] : LUS::Context::GetInstance() for (auto [id, mapping] : Ship::Context::GetInstance()
->GetControlDeck() ->GetControlDeck()
->GetControllerByPort(static_cast<uint8_t>(slot)) ->GetControllerByPort(static_cast<uint8_t>(slot))
->GetRumble() ->GetRumble()
@ -2650,12 +2650,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) {
LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(duration, true, text); Ship::Context::GetInstance()->GetWindow()->GetGui()->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;
LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(duration, true, text); Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(duration, true, text);
} }
extern "C" void Entrance_ClearEntranceTrackingData(void) { extern "C" void Entrance_ClearEntranceTrackingData(void) {
@ -2741,14 +2741,14 @@ void SoH_ProcessDroppedFiles(std::string filePath) {
} }
} }
auto gui = LUS::Context::GetInstance()->GetWindow()->GetGui(); auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui();
gui->GetGuiWindow("Console")->Hide(); gui->GetGuiWindow("Console")->Hide();
gui->GetGuiWindow("Actor Viewer")->Hide(); gui->GetGuiWindow("Actor Viewer")->Hide();
gui->GetGuiWindow("Collision Viewer")->Hide(); gui->GetGuiWindow("Collision Viewer")->Hide();
gui->GetGuiWindow("Save Editor")->Hide(); gui->GetGuiWindow("Save Editor")->Hide();
gui->GetGuiWindow("Display List Viewer")->Hide(); gui->GetGuiWindow("Display List Viewer")->Hide();
gui->GetGuiWindow("Stats")->Hide(); gui->GetGuiWindow("Stats")->Hide();
std::dynamic_pointer_cast<LUS::ConsoleWindow>(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->ClearBindings(); std::dynamic_pointer_cast<Ship::ConsoleWindow>(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->ClearBindings();
gui->SaveConsoleVariablesOnNextTick(); gui->SaveConsoleVariablesOnNextTick();
@ -2756,12 +2756,12 @@ void SoH_ProcessDroppedFiles(std::string filePath) {
gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Configuration Loaded. Hash: %d", finalHash); gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Configuration Loaded. Hash: %d", finalHash);
} catch (std::exception& e) { } catch (std::exception& e) {
SPDLOG_ERROR("Failed to load config file: {}", e.what()); SPDLOG_ERROR("Failed to load config file: {}", e.what());
auto gui = LUS::Context::GetInstance()->GetWindow()->GetGui(); auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui();
gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Failed to load config file"); gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Failed to load config file");
return; return;
} catch (...) { } catch (...) {
SPDLOG_ERROR("Failed to load config file"); SPDLOG_ERROR("Failed to load config file");
auto gui = LUS::Context::GetInstance()->GetWindow()->GetGui(); auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui();
gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Failed to load config file"); gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Failed to load config file");
return; return;
} }

View File

@ -37,7 +37,7 @@ class OTRGlobals
public: public:
static OTRGlobals* Instance; static OTRGlobals* Instance;
std::shared_ptr<LUS::Context> context; std::shared_ptr<Ship::Context> context;
std::shared_ptr<SaveStateMgr> gSaveStateMgr; std::shared_ptr<SaveStateMgr> gSaveStateMgr;
std::shared_ptr<Randomizer> gRandomizer; std::shared_ptr<Randomizer> gRandomizer;

View File

@ -44,12 +44,12 @@ void SaveManager::ReadSaveFile(std::filesystem::path savePath, uintptr_t addr, v
} }
std::filesystem::path SaveManager::GetFileName(int fileNum) { std::filesystem::path SaveManager::GetFileName(int fileNum) {
const std::filesystem::path sSavePath(LUS::Context::GetPathRelativeToAppDirectory("Save")); const std::filesystem::path sSavePath(Ship::Context::GetPathRelativeToAppDirectory("Save"));
return sSavePath / ("file" + std::to_string(fileNum + 1) + ".sav"); return sSavePath / ("file" + std::to_string(fileNum + 1) + ".sav");
} }
std::filesystem::path SaveManager::GetFileTempName(int fileNum) { std::filesystem::path SaveManager::GetFileTempName(int fileNum) {
const std::filesystem::path sSavePath(LUS::Context::GetPathRelativeToAppDirectory("Save")); const std::filesystem::path sSavePath(Ship::Context::GetPathRelativeToAppDirectory("Save"));
return sSavePath / ("file" + std::to_string(fileNum + 1) + ".temp"); return sSavePath / ("file" + std::to_string(fileNum + 1) + ".temp");
} }
@ -371,10 +371,10 @@ void SaveManager::SaveRandomizer(SaveContext* saveContext, int sectionID, bool f
void SaveManager::Init() { void SaveManager::Init() {
// Wait on saves that snuck through the Wait in OnExitGame // Wait on saves that snuck through the Wait in OnExitGame
ThreadPoolWait(); ThreadPoolWait();
const std::filesystem::path sSavePath(LUS::Context::GetPathRelativeToAppDirectory("Save")); const std::filesystem::path sSavePath(Ship::Context::GetPathRelativeToAppDirectory("Save"));
const std::filesystem::path sGlobalPath = sSavePath / std::string("global.sav"); const std::filesystem::path sGlobalPath = sSavePath / std::string("global.sav");
auto sOldSavePath = LUS::Context::GetPathRelativeToAppDirectory("oot_save.sav"); auto sOldSavePath = Ship::Context::GetPathRelativeToAppDirectory("oot_save.sav");
auto sOldBackupSavePath = LUS::Context::GetPathRelativeToAppDirectory("oot_save.bak"); auto sOldBackupSavePath = Ship::Context::GetPathRelativeToAppDirectory("oot_save.bak");
// If the save directory does not exist, create it // If the save directory does not exist, create it
if (!std::filesystem::exists(sSavePath)) { if (!std::filesystem::exists(sSavePath)) {
@ -1017,7 +1017,7 @@ void SaveManager::SaveGlobal() {
globalBlock["zTargetSetting"] = gSaveContext.zTargetSetting; globalBlock["zTargetSetting"] = gSaveContext.zTargetSetting;
globalBlock["language"] = gSaveContext.language; globalBlock["language"] = gSaveContext.language;
const std::filesystem::path sSavePath(LUS::Context::GetPathRelativeToAppDirectory("Save")); const std::filesystem::path sSavePath(Ship::Context::GetPathRelativeToAppDirectory("Save"));
const std::filesystem::path sGlobalPath = sSavePath / std::string("global.sav"); const std::filesystem::path sGlobalPath = sSavePath / std::string("global.sav");
std::ofstream output(sGlobalPath); std::ofstream output(sGlobalPath);
@ -1076,7 +1076,7 @@ void SaveManager::LoadFile(int fileNum) {
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnLoadFile>(fileNum); GameInteractor::Instance->ExecuteHooks<GameInteractor::OnLoadFile>(fileNum);
} catch (const std::exception& e) { } catch (const std::exception& e) {
input.close(); input.close();
std::filesystem::path newFile(LUS::Context::GetPathRelativeToAppDirectory("Save") + ("/file" + std::to_string(fileNum + 1) + "-" + std::to_string(GetUnixTimestamp()) + ".bak")); std::filesystem::path newFile(Ship::Context::GetPathRelativeToAppDirectory("Save") + ("/file" + std::to_string(fileNum + 1) + "-" + std::to_string(GetUnixTimestamp()) + ".bak"));
#if defined(__SWITCH__) || defined(__WIIU__) #if defined(__SWITCH__) || defined(__WIIU__)
copy_file(fileName.c_str(), newFile.c_str()); copy_file(fileName.c_str(), newFile.c_str());
#else #else

View File

@ -112,9 +112,9 @@ namespace SohGui {
std::shared_ptr<SohMenuBar> mSohMenuBar; std::shared_ptr<SohMenuBar> mSohMenuBar;
std::shared_ptr<LUS::GuiWindow> mConsoleWindow; std::shared_ptr<Ship::GuiWindow> mConsoleWindow;
std::shared_ptr<LUS::GuiWindow> mStatsWindow; std::shared_ptr<Ship::GuiWindow> mStatsWindow;
std::shared_ptr<LUS::GuiWindow> mInputEditorWindow; std::shared_ptr<Ship::GuiWindow> mInputEditorWindow;
std::shared_ptr<AudioEditor> mAudioEditorWindow; std::shared_ptr<AudioEditor> mAudioEditorWindow;
std::shared_ptr<InputViewer> mInputViewer; std::shared_ptr<InputViewer> mInputViewer;
@ -137,10 +137,10 @@ namespace SohGui {
std::shared_ptr<SohModalWindow> mModalWindow; std::shared_ptr<SohModalWindow> mModalWindow;
void SetupGuiElements() { void SetupGuiElements() {
auto gui = LUS::Context::GetInstance()->GetWindow()->GetGui(); auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui();
mSohMenuBar = std::make_shared<SohMenuBar>("gOpenMenuBar", CVarGetInteger("gOpenMenuBar", 0)); mSohMenuBar = std::make_shared<SohMenuBar>("gOpenMenuBar", CVarGetInteger("gOpenMenuBar", 0));
gui->SetMenuBar(std::reinterpret_pointer_cast<LUS::GuiMenuBar>(mSohMenuBar)); gui->SetMenuBar(std::reinterpret_pointer_cast<Ship::GuiMenuBar>(mSohMenuBar));
if (gui->GetMenuBar() && !gui->GetMenuBar()->IsVisible()) { if (gui->GetMenuBar() && !gui->GetMenuBar()->IsVisible()) {
#if defined(__SWITCH__) || defined(__WIIU__) #if defined(__SWITCH__) || defined(__WIIU__)

View File

@ -106,11 +106,11 @@ namespace SohGui {
void DrawMenuBarIcon() { void DrawMenuBarIcon() {
static bool gameIconLoaded = false; static bool gameIconLoaded = false;
if (!gameIconLoaded) { if (!gameIconLoaded) {
LUS::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Game_Icon", "textures/icons/gIcon.png"); Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Game_Icon", "textures/icons/gIcon.png");
gameIconLoaded = true; gameIconLoaded = true;
} }
if (LUS::Context::GetInstance()->GetWindow()->GetGui()->HasTextureByName("Game_Icon")) { if (Ship::Context::GetInstance()->GetWindow()->GetGui()->HasTextureByName("Game_Icon")) {
#ifdef __SWITCH__ #ifdef __SWITCH__
ImVec2 iconSize = ImVec2(20.0f, 20.0f); ImVec2 iconSize = ImVec2(20.0f, 20.0f);
float posScale = 1.0f; float posScale = 1.0f;
@ -122,7 +122,7 @@ void DrawMenuBarIcon() {
float posScale = 1.0f; float posScale = 1.0f;
#endif #endif
ImGui::SetCursorPos(ImVec2(5, 2.5f) * posScale); ImGui::SetCursorPos(ImVec2(5, 2.5f) * posScale);
ImGui::Image(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Game_Icon"), iconSize); ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Game_Icon"), iconSize);
ImGui::SameLine(); ImGui::SameLine();
ImGui::SetCursorPos(ImVec2(25, 0) * posScale); ImGui::SetCursorPos(ImVec2(25, 0) * posScale);
} }
@ -137,12 +137,12 @@ void DrawShipMenu() {
"[-]" "[-]"
#endif #endif
)) { )) {
LUS::Context::GetInstance()->GetWindow()->GetGui()->GetMenuBar()->ToggleVisibility(); Ship::Context::GetInstance()->GetWindow()->GetGui()->GetMenuBar()->ToggleVisibility();
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
#if !defined(__SWITCH__) && !defined(__WIIU__) #if !defined(__SWITCH__) && !defined(__WIIU__)
if (ImGui::MenuItem("Toggle Fullscreen", "F11")) { if (ImGui::MenuItem("Toggle Fullscreen", "F11")) {
LUS::Context::GetInstance()->GetWindow()->ToggleFullscreen(); Ship::Context::GetInstance()->GetWindow()->ToggleFullscreen();
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
#endif #endif
@ -155,25 +155,25 @@ void DrawShipMenu() {
"" ""
#endif #endif
)) { )) {
std::reinterpret_pointer_cast<LUS::ConsoleWindow>(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch("reset"); std::reinterpret_pointer_cast<Ship::ConsoleWindow>(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch("reset");
} }
#if !defined(__SWITCH__) && !defined(__WIIU__) #if !defined(__SWITCH__) && !defined(__WIIU__)
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::MenuItem("Open App Files Folder")) { if (ImGui::MenuItem("Open App Files Folder")) {
std::string filesPath = LUS::Context::GetInstance()->GetAppDirectoryPath(); std::string filesPath = Ship::Context::GetInstance()->GetAppDirectoryPath();
SDL_OpenURL(std::string("file:///" + std::filesystem::absolute(filesPath).string()).c_str()); SDL_OpenURL(std::string("file:///" + std::filesystem::absolute(filesPath).string()).c_str());
} }
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::MenuItem("Quit")) { if (ImGui::MenuItem("Quit")) {
LUS::Context::GetInstance()->GetWindow()->Close(); Ship::Context::GetInstance()->GetWindow()->Close();
} }
#endif #endif
ImGui::EndMenu(); ImGui::EndMenu();
} }
} }
extern std::shared_ptr<LUS::GuiWindow> mInputEditorWindow; extern std::shared_ptr<Ship::GuiWindow> mInputEditorWindow;
extern std::shared_ptr<InputViewer> mInputViewer; extern std::shared_ptr<InputViewer> mInputViewer;
extern std::shared_ptr<InputViewerSettingsWindow> mInputViewerSettings; extern std::shared_ptr<InputViewerSettingsWindow> mInputViewerSettings;
extern std::shared_ptr<AdvancedResolutionSettings::AdvancedResolutionSettingsWindow> mAdvancedResolutionSettingsWindow; extern std::shared_ptr<AdvancedResolutionSettings::AdvancedResolutionSettingsWindow> mAdvancedResolutionSettingsWindow;
@ -196,27 +196,27 @@ void DrawSettingsMenu() {
Audio_SetGameVolume(SEQ_PLAYER_FANFARE, CVarGetFloat("gFanfareVolume", 1.0f)); Audio_SetGameVolume(SEQ_PLAYER_FANFARE, CVarGetFloat("gFanfareVolume", 1.0f));
} }
static std::unordered_map<LUS::AudioBackend, const char*> audioBackendNames = { static std::unordered_map<Ship::AudioBackend, const char*> audioBackendNames = {
{ LUS::AudioBackend::WASAPI, "Windows Audio Session API" }, { Ship::AudioBackend::WASAPI, "Windows Audio Session API" },
{ LUS::AudioBackend::SDL, "SDL" } { Ship::AudioBackend::SDL, "SDL" }
}; };
ImGui::Text("Audio API (Needs reload)"); ImGui::Text("Audio API (Needs reload)");
auto currentAudioBackend = LUS::Context::GetInstance()->GetAudio()->GetAudioBackend(); auto currentAudioBackend = Ship::Context::GetInstance()->GetAudio()->GetAudioBackend();
if (LUS::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size() <= 1) { if (Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size() <= 1) {
UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f); UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f);
} }
if (ImGui::BeginCombo("##AApi", audioBackendNames[currentAudioBackend])) { if (ImGui::BeginCombo("##AApi", audioBackendNames[currentAudioBackend])) {
for (uint8_t i = 0; i < LUS::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size(); i++) { for (uint8_t i = 0; i < Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size(); i++) {
auto backend = LUS::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->data()[i]; auto backend = Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->data()[i];
if (ImGui::Selectable(audioBackendNames[backend], backend == currentAudioBackend)) { if (ImGui::Selectable(audioBackendNames[backend], backend == currentAudioBackend)) {
LUS::Context::GetInstance()->GetAudio()->SetAudioBackend(backend); Ship::Context::GetInstance()->GetAudio()->SetAudioBackend(backend);
} }
} }
ImGui::EndCombo(); ImGui::EndCombo();
} }
if (LUS::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size() <= 1) { if (Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size() <= 1) {
UIWidgets::ReEnableComponent(""); UIWidgets::ReEnableComponent("");
} }
@ -274,7 +274,7 @@ void DrawSettingsMenu() {
CVarGetInteger("gAdvancedResolution.Enabled", 0); CVarGetInteger("gAdvancedResolution.Enabled", 0);
if (UIWidgets::EnhancementSliderFloat("Internal Resolution: %.1f %%", "##IMul", "gInternalResolution", 0.5f, if (UIWidgets::EnhancementSliderFloat("Internal Resolution: %.1f %%", "##IMul", "gInternalResolution", 0.5f,
2.0f, "", 1.0f, true, true, disabled_resolutionSlider)) { 2.0f, "", 1.0f, true, true, disabled_resolutionSlider)) {
LUS::Context::GetInstance()->GetWindow()->SetResolutionMultiplier(CVarGetFloat("gInternalResolution", 1)); Ship::Context::GetInstance()->GetWindow()->SetResolutionMultiplier(CVarGetFloat("gInternalResolution", 1));
} }
UIWidgets::Tooltip("Resolution scale. Multiplies output resolution by this value, on each axis relative to window size.\n" UIWidgets::Tooltip("Resolution scale. Multiplies output resolution by this value, on each axis relative to window size.\n"
"Lower values may improve performance.\n" "Lower values may improve performance.\n"
@ -307,7 +307,7 @@ void DrawSettingsMenu() {
if (UIWidgets::PaddedEnhancementSliderInt( if (UIWidgets::PaddedEnhancementSliderInt(
(CVarGetInteger("gMSAAValue", 1) == 1) ? "Anti-aliasing (MSAA): Off" : "Anti-aliasing (MSAA): %d", (CVarGetInteger("gMSAAValue", 1) == 1) ? "Anti-aliasing (MSAA): Off" : "Anti-aliasing (MSAA): %d",
"##IMSAA", "gMSAAValue", 1, 8, "", 1, true, true, false)) { "##IMSAA", "gMSAAValue", 1, 8, "", 1, true, true, false)) {
LUS::Context::GetInstance()->GetWindow()->SetMsaaLevel(CVarGetInteger("gMSAAValue", 1)); Ship::Context::GetInstance()->GetWindow()->SetMsaaLevel(CVarGetInteger("gMSAAValue", 1));
} }
UIWidgets::Tooltip("Activates MSAA (multi-sample anti-aliasing) from 2x up to 8x, to smooth the edges of rendered geometry.\n" UIWidgets::Tooltip("Activates MSAA (multi-sample anti-aliasing) from 2x up to 8x, to smooth the edges of rendered geometry.\n"
"Higher sample count will result in smoother edges on models, but may reduce performance.\n\n" "Higher sample count will result in smoother edges on models, but may reduce performance.\n\n"
@ -318,10 +318,10 @@ void DrawSettingsMenu() {
{ // FPS Slider { // FPS Slider
const int minFps = 20; const int minFps = 20;
static int maxFps; static int maxFps;
if (LUS::Context::GetInstance()->GetWindow()->GetWindowBackend() == LUS::WindowBackend::DX11) { if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::DX11) {
maxFps = 360; maxFps = 360;
} else { } else {
maxFps = LUS::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); maxFps = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate();
} }
int currentFps = fmax(fmin(OTRGlobals::Instance->GetInterpolationFPS(), maxFps), minFps); int currentFps = fmax(fmin(OTRGlobals::Instance->GetInterpolationFPS(), maxFps), minFps);
#ifdef __WIIU__ #ifdef __WIIU__
@ -383,15 +383,15 @@ void DrawSettingsMenu() {
currentFps = 60; currentFps = 60;
} }
CVarSetInteger("gInterpolationFPS", currentFps); CVarSetInteger("gInterpolationFPS", currentFps);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
#else #else
bool matchingRefreshRate = bool matchingRefreshRate =
CVarGetInteger("gMatchRefreshRate", 0) && LUS::Context::GetInstance()->GetWindow()->GetWindowBackend() != LUS::WindowBackend::DX11; CVarGetInteger("gMatchRefreshRate", 0) && Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() != Ship::WindowBackend::DX11;
UIWidgets::PaddedEnhancementSliderInt( UIWidgets::PaddedEnhancementSliderInt(
(currentFps == 20) ? "Frame Rate: Original (20 fps)" : "Frame Rate: %d fps", (currentFps == 20) ? "Frame Rate: Original (20 fps)" : "Frame Rate: %d fps",
"##FPSInterpolation", "gInterpolationFPS", minFps, maxFps, "", 20, true, true, false, matchingRefreshRate); "##FPSInterpolation", "gInterpolationFPS", minFps, maxFps, "", 20, true, true, false, matchingRefreshRate);
#endif #endif
if (LUS::Context::GetInstance()->GetWindow()->GetWindowBackend() == LUS::WindowBackend::DX11) { if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::DX11) {
UIWidgets::Tooltip( UIWidgets::Tooltip(
"Uses Matrix Interpolation to create extra frames, resulting in smoother graphics.\n" "Uses Matrix Interpolation to create extra frames, resulting in smoother graphics.\n"
"This is purely visual and does not impact game logic, execution of glitches etc.\n" "This is purely visual and does not impact game logic, execution of glitches etc.\n"
@ -406,13 +406,13 @@ void DrawSettingsMenu() {
} }
} // END FPS Slider } // END FPS Slider
if (LUS::Context::GetInstance()->GetWindow()->GetWindowBackend() == LUS::WindowBackend::DX11) { if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::DX11) {
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
if (ImGui::Button("Match Frame Rate to Refresh Rate")) { if (ImGui::Button("Match Frame Rate to Refresh Rate")) {
int hz = LUS::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); int hz = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate();
if (hz >= 20 && hz <= 360) { if (hz >= 20 && hz <= 360) {
CVarSetInteger("gInterpolationFPS", hz); CVarSetInteger("gInterpolationFPS", hz);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
} }
} else { } else {
@ -420,7 +420,7 @@ void DrawSettingsMenu() {
} }
UIWidgets::Tooltip("Matches interpolation value to the game window's current refresh rate."); UIWidgets::Tooltip("Matches interpolation value to the game window's current refresh rate.");
if (LUS::Context::GetInstance()->GetWindow()->GetWindowBackend() == LUS::WindowBackend::DX11) { if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::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( UIWidgets::Tooltip(
@ -442,52 +442,52 @@ void DrawSettingsMenu() {
UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f);
static std::unordered_map<LUS::WindowBackend, const char*> windowBackendNames = { static std::unordered_map<Ship::WindowBackend, const char*> windowBackendNames = {
{ LUS::WindowBackend::DX11, "DirectX" }, { Ship::WindowBackend::DX11, "DirectX" },
{ LUS::WindowBackend::SDL_OPENGL, "OpenGL"}, { Ship::WindowBackend::SDL_OPENGL, "OpenGL"},
{ LUS::WindowBackend::SDL_METAL, "Metal" }, { Ship::WindowBackend::SDL_METAL, "Metal" },
{ LUS::WindowBackend::GX2, "GX2"} { Ship::WindowBackend::GX2, "GX2"}
}; };
ImGui::Text("Renderer API (Needs reload)"); ImGui::Text("Renderer API (Needs reload)");
LUS::WindowBackend runningWindowBackend = LUS::Context::GetInstance()->GetWindow()->GetWindowBackend(); Ship::WindowBackend runningWindowBackend = Ship::Context::GetInstance()->GetWindow()->GetWindowBackend();
LUS::WindowBackend configWindowBackend; Ship::WindowBackend configWindowBackend;
int configWindowBackendId = LUS::Context::GetInstance()->GetConfig()->GetInt("Window.Backend.Id", -1); int configWindowBackendId = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.Backend.Id", -1);
if (configWindowBackendId != -1 && configWindowBackendId < static_cast<int>(LUS::WindowBackend::BACKEND_COUNT)) { if (configWindowBackendId != -1 && configWindowBackendId < static_cast<int>(Ship::WindowBackend::BACKEND_COUNT)) {
configWindowBackend = static_cast<LUS::WindowBackend>(configWindowBackendId); configWindowBackend = static_cast<Ship::WindowBackend>(configWindowBackendId);
} else { } else {
configWindowBackend = runningWindowBackend; configWindowBackend = runningWindowBackend;
} }
if (LUS::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size() <= 1) { if (Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size() <= 1) {
UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f); UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f);
} }
if (ImGui::BeginCombo("##RApi", windowBackendNames[configWindowBackend])) { if (ImGui::BeginCombo("##RApi", windowBackendNames[configWindowBackend])) {
for (size_t i = 0; i < LUS::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size(); i++) { for (size_t i = 0; i < Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size(); i++) {
auto backend = LUS::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->data()[i]; auto backend = Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->data()[i];
if (ImGui::Selectable(windowBackendNames[backend], backend == configWindowBackend)) { if (ImGui::Selectable(windowBackendNames[backend], backend == configWindowBackend)) {
LUS::Context::GetInstance()->GetConfig()->SetInt("Window.Backend.Id", static_cast<int>(backend)); Ship::Context::GetInstance()->GetConfig()->SetInt("Window.Backend.Id", static_cast<int>(backend));
LUS::Context::GetInstance()->GetConfig()->SetString("Window.Backend.Name", Ship::Context::GetInstance()->GetConfig()->SetString("Window.Backend.Name",
windowBackendNames[backend]); windowBackendNames[backend]);
LUS::Context::GetInstance()->GetConfig()->Save(); Ship::Context::GetInstance()->GetConfig()->Save();
} }
} }
ImGui::EndCombo(); ImGui::EndCombo();
} }
if (LUS::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size() <= 1) { if (Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size() <= 1) {
UIWidgets::ReEnableComponent(""); UIWidgets::ReEnableComponent("");
} }
if (LUS::Context::GetInstance()->GetWindow()->CanDisableVerticalSync()) { if (Ship::Context::GetInstance()->GetWindow()->CanDisableVerticalSync()) {
UIWidgets::PaddedEnhancementCheckbox("Enable Vsync", "gVsyncEnabled", true, false); UIWidgets::PaddedEnhancementCheckbox("Enable Vsync", "gVsyncEnabled", true, false);
UIWidgets::Tooltip("Activate vertical sync, to prevent screen tearing."); UIWidgets::Tooltip("Activate vertical sync, to prevent screen tearing.");
} }
if (LUS::Context::GetInstance()->GetWindow()->SupportsWindowedFullscreen()) { if (Ship::Context::GetInstance()->GetWindow()->SupportsWindowedFullscreen()) {
UIWidgets::PaddedEnhancementCheckbox("Windowed fullscreen", "gSdlWindowedFullscreen", true, false); UIWidgets::PaddedEnhancementCheckbox("Windowed fullscreen", "gSdlWindowedFullscreen", true, false);
} }
if (LUS::Context::GetInstance()->GetWindow()->GetGui()->SupportsViewports()) { if (Ship::Context::GetInstance()->GetWindow()->GetGui()->SupportsViewports()) {
UIWidgets::PaddedEnhancementCheckbox("Allow multi-windows (Needs reload)", "gEnableMultiViewports", true, false, false, "", UIWidgets::CheckboxGraphics::Cross, true); UIWidgets::PaddedEnhancementCheckbox("Allow multi-windows (Needs reload)", "gEnableMultiViewports", true, false, false, "", UIWidgets::CheckboxGraphics::Cross, true);
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.");
} }
@ -503,7 +503,7 @@ void DrawSettingsMenu() {
UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f);
// Draw LUS settings menu (such as Overlays Text Font) // Draw LUS settings menu (such as Overlays Text Font)
LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->DrawSettings(); Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->DrawSettings();
ImGui::EndMenu(); ImGui::EndMenu();
} }
@ -1417,9 +1417,9 @@ void DrawEnhancementsMenu() {
#ifdef __SWITCH__ #ifdef __SWITCH__
UIWidgets::Spacer(0); UIWidgets::Spacer(0);
ImGui::Text("Switch performance mode"); ImGui::Text("Switch performance mode");
if (UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("SwitchPerfMode"), SWITCH_CPU_PROFILES, (int)LUS::SwitchProfiles::STOCK)) { if (UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("SwitchPerfMode"), SWITCH_CPU_PROFILES, (int)Ship::SwitchProfiles::STOCK)) {
SPDLOG_INFO("Profile:: %s", SWITCH_CPU_PROFILES[CVarGetInteger(CVAR_ENHANCEMENT("SwitchPerfMode"), (int)LUS::SwitchProfiles::STOCK)]); SPDLOG_INFO("Profile:: %s", SWITCH_CPU_PROFILES[CVarGetInteger(CVAR_ENHANCEMENT("SwitchPerfMode"), (int)Ship::SwitchProfiles::STOCK)]);
LUS::Switch::ApplyOverclock(); Ship::Switch::ApplyOverclock();
} }
#endif #endif
@ -1504,7 +1504,7 @@ void DrawCheatsMenu() {
if (UIWidgets::PaddedEnhancementCheckbox("I promise I have read the warning", CVAR_CHEAT("SaveStatePromise"), true, if (UIWidgets::PaddedEnhancementCheckbox("I promise I have read the warning", CVAR_CHEAT("SaveStatePromise"), true,
false)) { false)) {
CVarSetInteger(CVAR_CHEAT("SaveStatesEnabled"), 0); CVarSetInteger(CVAR_CHEAT("SaveStatesEnabled"), 0);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
if (CVarGetInteger(CVAR_CHEAT("SaveStatePromise"), 0) == 1) { if (CVarGetInteger(CVAR_CHEAT("SaveStatePromise"), 0) == 1) {
UIWidgets::PaddedEnhancementCheckbox("I understand, enable save states", CVAR_CHEAT("SaveStatesEnabled"), true, UIWidgets::PaddedEnhancementCheckbox("I understand, enable save states", CVAR_CHEAT("SaveStatesEnabled"), true,
@ -1598,8 +1598,8 @@ void DrawCheatsMenu() {
CVarSetInteger(CVAR_CHEAT("EnableBetaQuest"), betaQuestEnabled); CVarSetInteger(CVAR_CHEAT("EnableBetaQuest"), betaQuestEnabled);
CVarSetInteger(CVAR_CHEAT("BetaQuestWorld"), betaQuestWorld); CVarSetInteger(CVAR_CHEAT("BetaQuestWorld"), betaQuestWorld);
std::reinterpret_pointer_cast<LUS::ConsoleWindow>(LUS::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch("reset"); std::reinterpret_pointer_cast<Ship::ConsoleWindow>(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch("reset");
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
if (!isBetaQuestEnabled) { if (!isBetaQuestEnabled) {
@ -1613,8 +1613,8 @@ void DrawCheatsMenu() {
} }
} }
extern std::shared_ptr<LUS::GuiWindow> mStatsWindow; extern std::shared_ptr<Ship::GuiWindow> mStatsWindow;
extern std::shared_ptr<LUS::GuiWindow> mConsoleWindow; extern std::shared_ptr<Ship::GuiWindow> mConsoleWindow;
extern std::shared_ptr<SaveEditorWindow> mSaveEditorWindow; extern std::shared_ptr<SaveEditorWindow> mSaveEditorWindow;
extern std::shared_ptr<ColViewerWindow> mColViewerWindow; extern std::shared_ptr<ColViewerWindow> mColViewerWindow;
extern std::shared_ptr<ActorViewerWindow> mActorViewerWindow; extern std::shared_ptr<ActorViewerWindow> mActorViewerWindow;
@ -1772,7 +1772,7 @@ void DrawRemoteControlMenu() {
port = 43384; port = 43384;
break; break;
} }
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
switch (CVarGetInteger(CVAR_REMOTE("Scheme"), GI_SCHEME_SAIL)) { switch (CVarGetInteger(CVAR_REMOTE("Scheme"), GI_SCHEME_SAIL)) {
case GI_SCHEME_SAIL: case GI_SCHEME_SAIL:
@ -1808,14 +1808,14 @@ void DrawRemoteControlMenu() {
ImGui::Text("Remote IP & Port"); ImGui::Text("Remote IP & Port");
if (ImGui::InputText("##gRemote.IP", (char*)ip.c_str(), ip.capacity() + 1)) { if (ImGui::InputText("##gRemote.IP", (char*)ip.c_str(), ip.capacity() + 1)) {
CVarSetString(CVAR_REMOTE("IP"), ip.c_str()); CVarSetString(CVAR_REMOTE("IP"), ip.c_str());
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushItemWidth(ImGui::GetFontSize() * 5); ImGui::PushItemWidth(ImGui::GetFontSize() * 5);
if (ImGui::InputScalar("##gRemote.Port", ImGuiDataType_U16, &port)) { if (ImGui::InputScalar("##gRemote.Port", ImGuiDataType_U16, &port)) {
CVarSetInteger(CVAR_REMOTE("Port"), port); CVarSetInteger(CVAR_REMOTE("Port"), port);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
ImGui::PopItemWidth(); ImGui::PopItemWidth();
@ -1828,7 +1828,7 @@ void DrawRemoteControlMenu() {
if (ImGui::Button(buttonLabel, ImVec2(-1.0f, 0.0f))) { if (ImGui::Button(buttonLabel, ImVec2(-1.0f, 0.0f))) {
if (GameInteractor::Instance->isRemoteInteractorEnabled) { if (GameInteractor::Instance->isRemoteInteractorEnabled) {
CVarSetInteger(CVAR_REMOTE("Enabled"), 0); CVarSetInteger(CVAR_REMOTE("Enabled"), 0);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
switch (CVarGetInteger(CVAR_REMOTE("Scheme"), GI_SCHEME_SAIL)) { switch (CVarGetInteger(CVAR_REMOTE("Scheme"), GI_SCHEME_SAIL)) {
case GI_SCHEME_SAIL: case GI_SCHEME_SAIL:
GameInteractorSail::Instance->Disable(); GameInteractorSail::Instance->Disable();
@ -1839,7 +1839,7 @@ void DrawRemoteControlMenu() {
} }
} else { } else {
CVarSetInteger(CVAR_REMOTE("Enabled"), 1); CVarSetInteger(CVAR_REMOTE("Enabled"), 1);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
switch (CVarGetInteger(CVAR_REMOTE("Scheme"), GI_SCHEME_SAIL)) { switch (CVarGetInteger(CVAR_REMOTE("Scheme"), GI_SCHEME_SAIL)) {
case GI_SCHEME_SAIL: case GI_SCHEME_SAIL:
GameInteractorSail::Instance->Enable(); GameInteractorSail::Instance->Enable();

View File

@ -5,9 +5,9 @@
#include "window/gui/GuiElement.h" #include "window/gui/GuiElement.h"
namespace SohGui { namespace SohGui {
class SohMenuBar : public LUS::GuiMenuBar { class SohMenuBar : public Ship::GuiMenuBar {
public: public:
using LUS::GuiMenuBar::GuiMenuBar; using Ship::GuiMenuBar::GuiMenuBar;
protected: protected:
void DrawElement() override; void DrawElement() override;
void InitElement() override {}; void InitElement() override {};

View File

@ -4,9 +4,9 @@
#include "window/gui/GuiMenuBar.h" #include "window/gui/GuiMenuBar.h"
#include "window/gui/GuiElement.h" #include "window/gui/GuiElement.h"
class SohModalWindow : public LUS::GuiWindow { class SohModalWindow : public Ship::GuiWindow {
public: public:
using LUS::GuiWindow::GuiWindow; using GuiWindow::GuiWindow;
void InitElement() override {}; void InitElement() override {};
void DrawElement() override; void DrawElement() override;

View File

@ -208,7 +208,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);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
changed = true; changed = true;
} }
@ -248,7 +248,7 @@ namespace UIWidgets {
CVarSetInteger(cvarName, i); CVarSetInteger(cvarName, i);
selected = i; selected = i;
changed = true; changed = true;
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
} }
} }
@ -261,7 +261,7 @@ namespace UIWidgets {
if (disabledValue >= 0 && selected != disabledValue) { if (disabledValue >= 0 && selected != disabledValue) {
CVarSetInteger(cvarName, disabledValue); CVarSetInteger(cvarName, disabledValue);
changed = true; changed = true;
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} }
} }
@ -351,7 +351,7 @@ namespace UIWidgets {
if (changed && (oldVal != val)) { if (changed && (oldVal != val)) {
CVarSetInteger(cvarName, val); CVarSetInteger(cvarName, val);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} else { } else {
changed = false; changed = false;
} }
@ -452,7 +452,7 @@ namespace UIWidgets {
ss << std::setprecision(ticks + 1) << std::setiosflags(std::ios_base::fixed) << val; ss << std::setprecision(ticks + 1) << std::setiosflags(std::ios_base::fixed) << val;
val = std::stof(ss.str()); val = std::stof(ss.str());
CVarSetFloat(cvarName, val); CVarSetFloat(cvarName, val);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
} else { } else {
changed = false; changed = false;
} }
@ -501,7 +501,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);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
ret = true; ret = true;
} }
ImGui::SameLine(); ImGui::SameLine();
@ -528,7 +528,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.
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
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");
@ -553,7 +553,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.
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
changed = true; changed = true;
} }
Tooltip("Chooses a random color\nOverwrites previously chosen color"); Tooltip("Chooses a random color\nOverwrites previously chosen color");
@ -614,7 +614,7 @@ namespace UIWidgets {
colors.a = 255.0; colors.a = 255.0;
CVarSetColor(cvarName, colors); CVarSetColor(cvarName, colors);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
changed = true; changed = true;
} }
} }
@ -630,7 +630,7 @@ namespace UIWidgets {
colors.a = ColorRGBA.w * 255.0; colors.a = ColorRGBA.w * 255.0;
CVarSetColor(cvarName, colors); CVarSetColor(cvarName, colors);
LUS::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
changed = true; changed = true;
} }
} }

View File

@ -1,11 +1,11 @@
#include "ConfigUpdaters.h" #include "ConfigUpdaters.h"
#include "soh/Enhancements/audio/AudioCollection.h" #include "soh/Enhancements/audio/AudioCollection.h"
namespace LUS { namespace SOH {
ConfigVersion1Updater::ConfigVersion1Updater() : ConfigVersionUpdater(1) {} ConfigVersion1Updater::ConfigVersion1Updater() : ConfigVersionUpdater(1) {}
ConfigVersion2Updater::ConfigVersion2Updater() : ConfigVersionUpdater(2) {} ConfigVersion2Updater::ConfigVersion2Updater() : ConfigVersionUpdater(2) {}
void ConfigVersion1Updater::Update(Config* conf) { void ConfigVersion1Updater::Update(Ship::Config* conf) {
if (conf->GetInt("Window.Width", 640) == 640) { if (conf->GetInt("Window.Width", 640) == 640) {
conf->Erase("Window.Width"); conf->Erase("Window.Width");
} }
@ -36,10 +36,10 @@ namespace LUS {
if (conf->GetInt("Window.Fullscreen.Height", 1080) == 1080) { if (conf->GetInt("Window.Fullscreen.Height", 1080) == 1080) {
conf->Erase("Window.Fullscreen.Height"); conf->Erase("Window.Fullscreen.Height");
} }
if (conf->GetInt("Shortcuts.Fullscreen", KbScancode::LUS_KB_F11) == KbScancode::LUS_KB_F10) { if (conf->GetInt("Shortcuts.Fullscreen", Ship::KbScancode::LUS_KB_F11) == Ship::KbScancode::LUS_KB_F10) {
conf->Erase("Shortcuts.Fullscreen"); conf->Erase("Shortcuts.Fullscreen");
} }
if (conf->GetInt("Shortcuts.Console", KbScancode::LUS_KB_OEM_3) == KbScancode::LUS_KB_OEM_3) { if (conf->GetInt("Shortcuts.Console", Ship::KbScancode::LUS_KB_OEM_3) == Ship::KbScancode::LUS_KB_OEM_3) {
conf->Erase("Shortcuts.Console"); conf->Erase("Shortcuts.Console");
} }
if (conf->GetString("Game.SaveName", "") == "") { if (conf->GetString("Game.SaveName", "") == "") {
@ -63,7 +63,7 @@ namespace LUS {
CVarClear("gSeededRandomizedEnemies"); CVarClear("gSeededRandomizedEnemies");
} }
void ConfigVersion2Updater::Update(Config* conf) { void ConfigVersion2Updater::Update(Ship::Config* conf) {
for (auto seq : AudioCollection::Instance->GetAllSequences()) { for (auto seq : AudioCollection::Instance->GetAllSequences()) {
CVarClear(std::string("gAudioEditor.ReplacedSequences." + seq.second.sfxKey).c_str()); CVarClear(std::string("gAudioEditor.ReplacedSequences." + seq.second.sfxKey).c_str());
} }

View File

@ -1,15 +1,15 @@
#include "libultraship/libultraship.h" #include "libultraship/libultraship.h"
namespace LUS { namespace SOH {
class ConfigVersion1Updater : public ConfigVersionUpdater { class ConfigVersion1Updater : public Ship::ConfigVersionUpdater {
public: public:
ConfigVersion1Updater(); ConfigVersion1Updater();
void Update(Config* conf); void Update(Ship::Config* conf);
}; };
class ConfigVersion2Updater : public ConfigVersionUpdater { class ConfigVersion2Updater : public Ship::ConfigVersionUpdater {
public: public:
ConfigVersion2Updater(); ConfigVersion2Updater();
void Update(Config* conf); void Update(Ship::Config* conf);
}; };
} }

View File

@ -3,13 +3,13 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> ResourceFactoryBinaryAnimationV0::ReadResource(std::shared_ptr<LUS::File> file) { std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAnimationV0::ReadResource(std::shared_ptr<Ship::File> file) {
if (!FileHasValidFormatAndReader(file)) { if (!FileHasValidFormatAndReader(file)) {
return nullptr; return nullptr;
} }
auto animation = std::make_shared<Animation>(file->InitData); auto animation = std::make_shared<Animation>(file->InitData);
auto reader = std::get<std::shared_ptr<LUS::BinaryReader>>(file->Reader); auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
AnimationType animType = (AnimationType)reader->ReadUInt32(); AnimationType animType = (AnimationType)reader->ReadUInt32();
animation->type = animType; animation->type = animType;

View File

@ -4,8 +4,8 @@
#include "ResourceFactoryBinary.h" #include "ResourceFactoryBinary.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryAnimationV0 : public LUS::ResourceFactoryBinary { class ResourceFactoryBinaryAnimationV0 : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -3,13 +3,13 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> ResourceFactoryBinaryAudioSampleV2::ReadResource(std::shared_ptr<LUS::File> file) { std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAudioSampleV2::ReadResource(std::shared_ptr<Ship::File> file) {
if (!FileHasValidFormatAndReader(file)) { if (!FileHasValidFormatAndReader(file)) {
return nullptr; return nullptr;
} }
auto audioSample = std::make_shared<AudioSample>(file->InitData); auto audioSample = std::make_shared<AudioSample>(file->InitData);
auto reader = std::get<std::shared_ptr<LUS::BinaryReader>>(file->Reader); auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
audioSample->sample.codec = reader->ReadUByte(); audioSample->sample.codec = reader->ReadUByte();
audioSample->sample.medium = reader->ReadUByte(); audioSample->sample.medium = reader->ReadUByte();
@ -71,7 +71,7 @@ extern "C" SoundFontSample* ReadCustomSample(const char* path) {
ExtensionEntry entry = ExtensionCache[path]; ExtensionEntry entry = ExtensionCache[path];
auto sampleRaw = LUS::Context::GetInstance()->GetResourceManager()->LoadFile(entry.path); auto sampleRaw = Ship::Context::GetInstance()->GetResourceManager()->LoadFile(entry.path);
uint32_t* strem = (uint32_t*)sampleRaw->Buffer.get(); uint32_t* strem = (uint32_t*)sampleRaw->Buffer.get();
uint8_t* strem2 = (uint8_t*)strem; uint8_t* strem2 = (uint8_t*)strem;

View File

@ -4,8 +4,8 @@
#include "ResourceFactoryBinary.h" #include "ResourceFactoryBinary.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryAudioSampleV2 : public LUS::ResourceFactoryBinary { class ResourceFactoryBinaryAudioSampleV2 : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -3,13 +3,13 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> ResourceFactoryBinaryAudioSequenceV2::ReadResource(std::shared_ptr<LUS::File> file) { std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAudioSequenceV2::ReadResource(std::shared_ptr<Ship::File> file) {
if (!FileHasValidFormatAndReader(file)) { if (!FileHasValidFormatAndReader(file)) {
return nullptr; return nullptr;
} }
auto audioSequence = std::make_shared<AudioSequence>(file->InitData); auto audioSequence = std::make_shared<AudioSequence>(file->InitData);
auto reader = std::get<std::shared_ptr<LUS::BinaryReader>>(file->Reader); auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
audioSequence->sequence.seqDataSize = reader->ReadInt32(); audioSequence->sequence.seqDataSize = reader->ReadInt32();
audioSequence->sequenceData.reserve(audioSequence->sequence.seqDataSize); audioSequence->sequenceData.reserve(audioSequence->sequence.seqDataSize);

View File

@ -4,8 +4,8 @@
#include "ResourceFactoryBinary.h" #include "ResourceFactoryBinary.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryAudioSequenceV2 : public LUS::ResourceFactoryBinary { class ResourceFactoryBinaryAudioSequenceV2 : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -4,13 +4,13 @@
#include "libultraship/libultraship.h" #include "libultraship/libultraship.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> ResourceFactoryBinaryAudioSoundFontV2::ReadResource(std::shared_ptr<LUS::File> file) { std::shared_ptr<Ship::IResource> ResourceFactoryBinaryAudioSoundFontV2::ReadResource(std::shared_ptr<Ship::File> file) {
if (!FileHasValidFormatAndReader(file)) { if (!FileHasValidFormatAndReader(file)) {
return nullptr; return nullptr;
} }
auto audioSoundFont = std::make_shared<AudioSoundFont>(file->InitData); auto audioSoundFont = std::make_shared<AudioSoundFont>(file->InitData);
auto reader = std::get<std::shared_ptr<LUS::BinaryReader>>(file->Reader); auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
audioSoundFont->soundFont.fntIndex = reader->ReadInt32(); audioSoundFont->soundFont.fntIndex = reader->ReadInt32();
audioSoundFont->medium = reader->ReadInt8(); audioSoundFont->medium = reader->ReadInt8();
@ -67,7 +67,7 @@ std::shared_ptr<LUS::IResource> ResourceFactoryBinaryAudioSoundFontV2::ReadResou
if (sampleFileName.empty()) { if (sampleFileName.empty()) {
drum.sound.sample = nullptr; drum.sound.sample = nullptr;
} else { } else {
auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str());
drum.sound.sample = static_cast<Sample*>(res ? res->GetRawPointer() : nullptr); drum.sound.sample = static_cast<Sample*>(res ? res->GetRawPointer() : nullptr);
} }
@ -111,7 +111,7 @@ std::shared_ptr<LUS::IResource> ResourceFactoryBinaryAudioSoundFontV2::ReadResou
bool hasSampleRef = reader->ReadInt8(); bool hasSampleRef = reader->ReadInt8();
std::string sampleFileName = reader->ReadString(); std::string sampleFileName = reader->ReadString();
instrument.lowNotesSound.tuning = reader->ReadFloat(); instrument.lowNotesSound.tuning = reader->ReadFloat();
auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str());
instrument.lowNotesSound.sample = static_cast<Sample*>(res ? res->GetRawPointer() : nullptr); instrument.lowNotesSound.sample = static_cast<Sample*>(res ? res->GetRawPointer() : nullptr);
} else { } else {
instrument.lowNotesSound.sample = nullptr; instrument.lowNotesSound.sample = nullptr;
@ -123,7 +123,7 @@ std::shared_ptr<LUS::IResource> ResourceFactoryBinaryAudioSoundFontV2::ReadResou
bool hasSampleRef = reader->ReadInt8(); bool hasSampleRef = reader->ReadInt8();
std::string sampleFileName = reader->ReadString(); std::string sampleFileName = reader->ReadString();
instrument.normalNotesSound.tuning = reader->ReadFloat(); instrument.normalNotesSound.tuning = reader->ReadFloat();
auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str());
instrument.normalNotesSound.sample = static_cast<Sample*>(res ? res->GetRawPointer() : nullptr); instrument.normalNotesSound.sample = static_cast<Sample*>(res ? res->GetRawPointer() : nullptr);
} else { } else {
instrument.normalNotesSound.sample = nullptr; instrument.normalNotesSound.sample = nullptr;
@ -135,7 +135,7 @@ std::shared_ptr<LUS::IResource> ResourceFactoryBinaryAudioSoundFontV2::ReadResou
bool hasSampleRef = reader->ReadInt8(); bool hasSampleRef = reader->ReadInt8();
std::string sampleFileName = reader->ReadString(); std::string sampleFileName = reader->ReadString();
instrument.highNotesSound.tuning = reader->ReadFloat(); instrument.highNotesSound.tuning = reader->ReadFloat();
auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str());
instrument.highNotesSound.sample = static_cast<Sample*>(res ? res->GetRawPointer() : nullptr); instrument.highNotesSound.sample = static_cast<Sample*>(res ? res->GetRawPointer() : nullptr);
} else { } else {
instrument.highNotesSound.sample = nullptr; instrument.highNotesSound.sample = nullptr;
@ -160,7 +160,7 @@ std::shared_ptr<LUS::IResource> ResourceFactoryBinaryAudioSoundFontV2::ReadResou
bool hasSampleRef = reader->ReadInt8(); bool hasSampleRef = reader->ReadInt8();
std::string sampleFileName = reader->ReadString(); std::string sampleFileName = reader->ReadString();
soundEffect.tuning = reader->ReadFloat(); soundEffect.tuning = reader->ReadFloat();
auto res = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str()); auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(sampleFileName.c_str());
soundEffect.sample = static_cast<Sample*>(res ? res->GetRawPointer() : nullptr); soundEffect.sample = static_cast<Sample*>(res ? res->GetRawPointer() : nullptr);
} }

View File

@ -4,8 +4,8 @@
#include "ResourceFactoryBinary.h" #include "ResourceFactoryBinary.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryAudioSoundFontV2 : public LUS::ResourceFactoryBinary { class ResourceFactoryBinaryAudioSoundFontV2 : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -3,13 +3,13 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> ResourceFactoryBinaryBackgroundV0::ReadResource(std::shared_ptr<LUS::File> file) { std::shared_ptr<Ship::IResource> ResourceFactoryBinaryBackgroundV0::ReadResource(std::shared_ptr<Ship::File> file) {
if (!FileHasValidFormatAndReader(file)) { if (!FileHasValidFormatAndReader(file)) {
return nullptr; return nullptr;
} }
auto background = std::make_shared<Background>(file->InitData); auto background = std::make_shared<Background>(file->InitData);
auto reader = std::get<std::shared_ptr<LUS::BinaryReader>>(file->Reader); auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
uint32_t dataSize = reader->ReadUInt32(); uint32_t dataSize = reader->ReadUInt32();

View File

@ -4,8 +4,8 @@
#include "resource/ResourceFactoryBinary.h" #include "resource/ResourceFactoryBinary.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryBackgroundV0 : public LUS::ResourceFactoryBinary { class ResourceFactoryBinaryBackgroundV0 : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -3,13 +3,13 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> ResourceFactoryBinaryCollisionHeaderV0::ReadResource(std::shared_ptr<LUS::File> file) { std::shared_ptr<Ship::IResource> ResourceFactoryBinaryCollisionHeaderV0::ReadResource(std::shared_ptr<Ship::File> file) {
if (!FileHasValidFormatAndReader(file)) { if (!FileHasValidFormatAndReader(file)) {
return nullptr; return nullptr;
} }
auto collisionHeader = std::make_shared<CollisionHeader>(file->InitData); auto collisionHeader = std::make_shared<CollisionHeader>(file->InitData);
auto reader = std::get<std::shared_ptr<LUS::BinaryReader>>(file->Reader); auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
collisionHeader->collisionHeaderData.minBounds.x = reader->ReadInt16(); collisionHeader->collisionHeaderData.minBounds.x = reader->ReadInt16();
collisionHeader->collisionHeaderData.minBounds.y = reader->ReadInt16(); collisionHeader->collisionHeaderData.minBounds.y = reader->ReadInt16();
@ -123,7 +123,7 @@ std::shared_ptr<LUS::IResource> ResourceFactoryBinaryCollisionHeaderV0::ReadReso
return collisionHeader; return collisionHeader;
} }
std::shared_ptr<LUS::IResource> ResourceFactoryXMLCollisionHeaderV0::ReadResource(std::shared_ptr<LUS::File> file) { std::shared_ptr<Ship::IResource> ResourceFactoryXMLCollisionHeaderV0::ReadResource(std::shared_ptr<Ship::File> file) {
if (!FileHasValidFormatAndReader(file)) { if (!FileHasValidFormatAndReader(file)) {
return nullptr; return nullptr;
} }

View File

@ -5,13 +5,13 @@
#include "ResourceFactoryXML.h" #include "ResourceFactoryXML.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryCollisionHeaderV0 : public LUS::ResourceFactoryBinary { class ResourceFactoryBinaryCollisionHeaderV0 : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
}; };
class ResourceFactoryXMLCollisionHeaderV0 : public LUS::ResourceFactoryXML { class ResourceFactoryXMLCollisionHeaderV0 : public Ship::ResourceFactoryXML {
public: public:
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -2,19 +2,19 @@
#include "soh/resource/type/Cutscene.h" #include "soh/resource/type/Cutscene.h"
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
static inline uint32_t read_CMD_BBBB(std::shared_ptr<LUS::BinaryReader> reader) { static inline uint32_t read_CMD_BBBB(std::shared_ptr<Ship::BinaryReader> reader) {
uint32_t v; uint32_t v;
reader->Read((char*)&v, sizeof(uint32_t)); reader->Read((char*)&v, sizeof(uint32_t));
return v; return v;
} }
static inline uint32_t read_CMD_BBH(std::shared_ptr<LUS::BinaryReader> reader) { static inline uint32_t read_CMD_BBH(std::shared_ptr<Ship::BinaryReader> reader) {
uint32_t v; uint32_t v;
reader->Read((char*)&v, sizeof(uint32_t)); reader->Read((char*)&v, sizeof(uint32_t));
// swap the half word to match endianness // swap the half word to match endianness
if (reader->GetEndianness() != LUS::Endianness::Native) { if (reader->GetEndianness() != Ship::Endianness::Native) {
uint8_t* b = (uint8_t*)&v; uint8_t* b = (uint8_t*)&v;
uint8_t tmp = b[2]; uint8_t tmp = b[2];
b[2] = b[3]; b[2] = b[3];
@ -24,12 +24,12 @@ static inline uint32_t read_CMD_BBH(std::shared_ptr<LUS::BinaryReader> reader) {
return v; return v;
} }
static inline uint32_t read_CMD_HBB(std::shared_ptr<LUS::BinaryReader> reader) { static inline uint32_t read_CMD_HBB(std::shared_ptr<Ship::BinaryReader> reader) {
uint32_t v; uint32_t v;
reader->Read((char*)&v, sizeof(uint32_t)); reader->Read((char*)&v, sizeof(uint32_t));
// swap the half word to match endianness // swap the half word to match endianness
if (reader->GetEndianness() != LUS::Endianness::Native) { if (reader->GetEndianness() != Ship::Endianness::Native) {
uint8_t* b = (uint8_t*)&v; uint8_t* b = (uint8_t*)&v;
uint8_t tmp = b[0]; uint8_t tmp = b[0];
b[0] = b[1]; b[0] = b[1];
@ -39,12 +39,12 @@ static inline uint32_t read_CMD_HBB(std::shared_ptr<LUS::BinaryReader> reader) {
return v; return v;
} }
static inline uint32_t read_CMD_HH(std::shared_ptr<LUS::BinaryReader> reader) { static inline uint32_t read_CMD_HH(std::shared_ptr<Ship::BinaryReader> reader) {
uint32_t v; uint32_t v;
reader->Read((char*)&v, sizeof(uint32_t)); reader->Read((char*)&v, sizeof(uint32_t));
// swap the half words to match endianness // swap the half words to match endianness
if (reader->GetEndianness() != LUS::Endianness::Native) { if (reader->GetEndianness() != Ship::Endianness::Native) {
uint8_t* b = (uint8_t*)&v; uint8_t* b = (uint8_t*)&v;
uint8_t tmp = b[0]; uint8_t tmp = b[0];
b[0] = b[1]; b[0] = b[1];
@ -58,13 +58,13 @@ static inline uint32_t read_CMD_HH(std::shared_ptr<LUS::BinaryReader> reader) {
} }
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> ResourceFactoryBinaryCutsceneV0::ReadResource(std::shared_ptr<LUS::File> file) { std::shared_ptr<Ship::IResource> ResourceFactoryBinaryCutsceneV0::ReadResource(std::shared_ptr<Ship::File> file) {
if (!FileHasValidFormatAndReader(file)) { if (!FileHasValidFormatAndReader(file)) {
return nullptr; return nullptr;
} }
auto cutscene = std::make_shared<Cutscene>(file->InitData); auto cutscene = std::make_shared<Cutscene>(file->InitData);
auto reader = std::get<std::shared_ptr<LUS::BinaryReader>>(file->Reader); auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
uint32_t numEntries = reader->ReadUInt32(); uint32_t numEntries = reader->ReadUInt32();
cutscene->commands.reserve(numEntries); cutscene->commands.reserve(numEntries);

View File

@ -4,8 +4,8 @@
#include "ResourceFactoryBinary.h" #include "ResourceFactoryBinary.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryCutsceneV0 : public LUS::ResourceFactoryBinary { class ResourceFactoryBinaryCutsceneV0 : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -3,13 +3,13 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> ResourceFactoryBinaryPathV0::ReadResource(std::shared_ptr<LUS::File> file) { std::shared_ptr<Ship::IResource> ResourceFactoryBinaryPathV0::ReadResource(std::shared_ptr<Ship::File> file) {
if (!FileHasValidFormatAndReader(file)) { if (!FileHasValidFormatAndReader(file)) {
return nullptr; return nullptr;
} }
auto path = std::make_shared<Path>(file->InitData); auto path = std::make_shared<Path>(file->InitData);
auto reader = std::get<std::shared_ptr<LUS::BinaryReader>>(file->Reader); auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
path->numPaths = reader->ReadUInt32(); path->numPaths = reader->ReadUInt32();
path->paths.reserve(path->numPaths); path->paths.reserve(path->numPaths);

View File

@ -4,8 +4,8 @@
#include "ResourceFactoryBinary.h" #include "ResourceFactoryBinary.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryPathV0 : public LUS::ResourceFactoryBinary { class ResourceFactoryBinaryPathV0 : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -3,13 +3,13 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> ResourceFactoryBinaryPlayerAnimationV0::ReadResource(std::shared_ptr<LUS::File> file) { std::shared_ptr<Ship::IResource> ResourceFactoryBinaryPlayerAnimationV0::ReadResource(std::shared_ptr<Ship::File> file) {
if (!FileHasValidFormatAndReader(file)) { if (!FileHasValidFormatAndReader(file)) {
return nullptr; return nullptr;
} }
auto playerAnimation = std::make_shared<PlayerAnimation>(file->InitData); auto playerAnimation = std::make_shared<PlayerAnimation>(file->InitData);
auto reader = std::get<std::shared_ptr<LUS::BinaryReader>>(file->Reader); auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
uint32_t numEntries = reader->ReadUInt32(); uint32_t numEntries = reader->ReadUInt32();
playerAnimation->limbRotData.reserve(numEntries); playerAnimation->limbRotData.reserve(numEntries);

View File

@ -4,8 +4,8 @@
#include "ResourceFactoryBinary.h" #include "ResourceFactoryBinary.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryPlayerAnimationV0 : public LUS::ResourceFactoryBinary { class ResourceFactoryBinaryPlayerAnimationV0 : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -58,7 +58,7 @@ ResourceFactoryBinarySceneV0::ResourceFactoryBinarySceneV0() {
sceneCommandFactories[SceneCommandID::SetMesh] = std::make_shared<SetMeshFactory>(); sceneCommandFactories[SceneCommandID::SetMesh] = std::make_shared<SetMeshFactory>();
} }
void ResourceFactoryBinarySceneV0::ParseSceneCommands(std::shared_ptr<Scene> scene, std::shared_ptr<LUS::BinaryReader> reader) { void ResourceFactoryBinarySceneV0::ParseSceneCommands(std::shared_ptr<Scene> scene, std::shared_ptr<Ship::BinaryReader> reader) {
uint32_t commandCount = reader->ReadUInt32(); uint32_t commandCount = reader->ReadUInt32();
scene->commands.reserve(commandCount); scene->commands.reserve(commandCount);
@ -68,16 +68,16 @@ void ResourceFactoryBinarySceneV0::ParseSceneCommands(std::shared_ptr<Scene> sce
} }
std::shared_ptr<ISceneCommand> ResourceFactoryBinarySceneV0::ParseSceneCommand(std::shared_ptr<Scene> scene, std::shared_ptr<ISceneCommand> ResourceFactoryBinarySceneV0::ParseSceneCommand(std::shared_ptr<Scene> scene,
std::shared_ptr<LUS::BinaryReader> reader, uint32_t index) { std::shared_ptr<Ship::BinaryReader> reader, uint32_t index) {
SceneCommandID cmdID = (SceneCommandID)reader->ReadInt32(); SceneCommandID cmdID = (SceneCommandID)reader->ReadInt32();
reader->Seek(-sizeof(int32_t), LUS::SeekOffsetType::Current); reader->Seek(-sizeof(int32_t), Ship::SeekOffsetType::Current);
std::shared_ptr<ISceneCommand> result = nullptr; std::shared_ptr<ISceneCommand> result = nullptr;
auto commandFactory = ResourceFactoryBinarySceneV0::sceneCommandFactories[cmdID]; auto commandFactory = ResourceFactoryBinarySceneV0::sceneCommandFactories[cmdID];
if (commandFactory != nullptr) { if (commandFactory != nullptr) {
auto initData = std::make_shared<LUS::ResourceInitData>(); auto initData = std::make_shared<Ship::ResourceInitData>();
initData->Id = scene->GetInitData()->Id; initData->Id = scene->GetInitData()->Id;
initData->Type = static_cast<uint32_t>(SOH::ResourceType::SOH_SceneCommand); initData->Type = static_cast<uint32_t>(SOH::ResourceType::SOH_SceneCommand);
initData->Path = scene->GetInitData()->Path + "/SceneCommand" + std::to_string(index); initData->Path = scene->GetInitData()->Path + "/SceneCommand" + std::to_string(index);
@ -93,13 +93,13 @@ std::shared_ptr<ISceneCommand> ResourceFactoryBinarySceneV0::ParseSceneCommand(s
return result; return result;
} }
std::shared_ptr<LUS::IResource> ResourceFactoryBinarySceneV0::ReadResource(std::shared_ptr<LUS::File> file) { std::shared_ptr<Ship::IResource> ResourceFactoryBinarySceneV0::ReadResource(std::shared_ptr<Ship::File> file) {
if (!FileHasValidFormatAndReader(file)) { if (!FileHasValidFormatAndReader(file)) {
return nullptr; return nullptr;
} }
auto scene = std::make_shared<Scene>(file->InitData); auto scene = std::make_shared<Scene>(file->InitData);
auto reader = std::get<std::shared_ptr<LUS::BinaryReader>>(file->Reader); auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
ParseSceneCommands(scene, reader); ParseSceneCommands(scene, reader);
@ -200,7 +200,7 @@ std::shared_ptr<ISceneCommand> ResourceFactoryXMLSceneV0::ParseSceneCommand(std:
auto commandFactory = ResourceFactoryXMLSceneV0::sceneCommandFactories[cmdID]; auto commandFactory = ResourceFactoryXMLSceneV0::sceneCommandFactories[cmdID];
if (commandFactory != nullptr) { if (commandFactory != nullptr) {
auto initData = std::make_shared<LUS::ResourceInitData>(); auto initData = std::make_shared<Ship::ResourceInitData>();
initData->Id = scene->GetInitData()->Id; initData->Id = scene->GetInitData()->Id;
initData->Type = static_cast<uint32_t>(ResourceType::SOH_SceneCommand); initData->Type = static_cast<uint32_t>(ResourceType::SOH_SceneCommand);
initData->Path = scene->GetInitData()->Path + "/SceneCommand" + std::to_string(index); initData->Path = scene->GetInitData()->Path + "/SceneCommand" + std::to_string(index);
@ -216,7 +216,7 @@ std::shared_ptr<ISceneCommand> ResourceFactoryXMLSceneV0::ParseSceneCommand(std:
return result; return result;
} }
std::shared_ptr<LUS::IResource> ResourceFactoryXMLSceneV0::ReadResource(std::shared_ptr<LUS::File> file) { std::shared_ptr<Ship::IResource> ResourceFactoryXMLSceneV0::ReadResource(std::shared_ptr<Ship::File> file) {
if (!FileHasValidFormatAndReader(file)) { if (!FileHasValidFormatAndReader(file)) {
return nullptr; return nullptr;
} }

View File

@ -8,12 +8,12 @@
#include "ResourceFactoryXML.h" #include "ResourceFactoryXML.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinarySceneV0 : public LUS::ResourceFactoryBinary { class ResourceFactoryBinarySceneV0 : public Ship::ResourceFactoryBinary {
public: public:
ResourceFactoryBinarySceneV0(); ResourceFactoryBinarySceneV0();
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
void ParseSceneCommands(std::shared_ptr<Scene> scene, std::shared_ptr<LUS::BinaryReader> reader); void ParseSceneCommands(std::shared_ptr<Scene> scene, std::shared_ptr<Ship::BinaryReader> reader);
// Doing something very similar to what we do on the ResourceLoader. // Doing something very similar to what we do on the ResourceLoader.
// Eventually, scene commands should be moved up to the ResourceLoader as well. // Eventually, scene commands should be moved up to the ResourceLoader as well.
@ -21,14 +21,14 @@ class ResourceFactoryBinarySceneV0 : public LUS::ResourceFactoryBinary {
// and the exporter does not export the commands with a proper OTR header. // and the exporter does not export the commands with a proper OTR header.
static inline std::unordered_map<SceneCommandID, std::shared_ptr<SceneCommandFactoryBinaryV0>> sceneCommandFactories; static inline std::unordered_map<SceneCommandID, std::shared_ptr<SceneCommandFactoryBinaryV0>> sceneCommandFactories;
protected: protected:
std::shared_ptr<ISceneCommand> ParseSceneCommand(std::shared_ptr<Scene> scene, std::shared_ptr<LUS::BinaryReader> reader, uint32_t index); std::shared_ptr<ISceneCommand> ParseSceneCommand(std::shared_ptr<Scene> scene, std::shared_ptr<Ship::BinaryReader> reader, uint32_t index);
}; };
class ResourceFactoryXMLSceneV0 : public LUS::ResourceFactoryXML { class ResourceFactoryXMLSceneV0 : public Ship::ResourceFactoryXML {
public: public:
ResourceFactoryXMLSceneV0(); ResourceFactoryXMLSceneV0();
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
void ParseSceneCommands(std::shared_ptr<Scene> scene, std::shared_ptr<tinyxml2::XMLDocument> reader); void ParseSceneCommands(std::shared_ptr<Scene> scene, std::shared_ptr<tinyxml2::XMLDocument> reader);
// Doing something very similar to what we do on the ResourceLoader. // Doing something very similar to what we do on the ResourceLoader.

View File

@ -4,13 +4,13 @@
#include <libultraship/libultraship.h> #include <libultraship/libultraship.h>
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> ResourceFactoryBinarySkeletonV0::ReadResource(std::shared_ptr<LUS::File> file) { std::shared_ptr<Ship::IResource> ResourceFactoryBinarySkeletonV0::ReadResource(std::shared_ptr<Ship::File> file) {
if (!FileHasValidFormatAndReader(file)) { if (!FileHasValidFormatAndReader(file)) {
return nullptr; return nullptr;
} }
auto skeleton = std::make_shared<Skeleton>(file->InitData); auto skeleton = std::make_shared<Skeleton>(file->InitData);
auto reader = std::get<std::shared_ptr<LUS::BinaryReader>>(file->Reader); auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
skeleton->type = (SkeletonType)reader->ReadInt8(); skeleton->type = (SkeletonType)reader->ReadInt8();
skeleton->limbType = (LimbType)reader->ReadInt8(); skeleton->limbType = (LimbType)reader->ReadInt8();
@ -43,7 +43,7 @@ std::shared_ptr<LUS::IResource> ResourceFactoryBinarySkeletonV0::ReadResource(st
for (size_t i = 0; i < skeleton->limbTable.size(); i++) { for (size_t i = 0; i < skeleton->limbTable.size(); i++) {
std::string limbStr = skeleton->limbTable[i]; std::string limbStr = skeleton->limbTable[i];
auto limb = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(limbStr.c_str()); auto limb = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(limbStr.c_str());
skeleton->skeletonHeaderSegments.push_back(limb ? limb->GetRawPointer() : nullptr); skeleton->skeletonHeaderSegments.push_back(limb ? limb->GetRawPointer() : nullptr);
} }
@ -62,7 +62,7 @@ std::shared_ptr<LUS::IResource> ResourceFactoryBinarySkeletonV0::ReadResource(st
return skeleton; return skeleton;
} }
std::shared_ptr<LUS::IResource> ResourceFactoryXMLSkeletonV0::ReadResource(std::shared_ptr<LUS::File> file) { std::shared_ptr<Ship::IResource> ResourceFactoryXMLSkeletonV0::ReadResource(std::shared_ptr<Ship::File> file) {
if (!FileHasValidFormatAndReader(file)) { if (!FileHasValidFormatAndReader(file)) {
return nullptr; return nullptr;
} }
@ -112,7 +112,7 @@ std::shared_ptr<LUS::IResource> ResourceFactoryXMLSkeletonV0::ReadResource(std::
std::string limbName = child->Attribute("Path"); std::string limbName = child->Attribute("Path");
skel->limbTable.push_back(limbName); skel->limbTable.push_back(limbName);
auto limb = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(limbName.c_str()); auto limb = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(limbName.c_str());
skel->skeletonHeaderSegments.push_back(limb ? limb->GetRawPointer() : nullptr); skel->skeletonHeaderSegments.push_back(limb ? limb->GetRawPointer() : nullptr);
} }

View File

@ -5,13 +5,13 @@
#include "ResourceFactoryXML.h" #include "ResourceFactoryXML.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinarySkeletonV0 : public LUS::ResourceFactoryBinary { class ResourceFactoryBinarySkeletonV0 : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
}; };
class ResourceFactoryXMLSkeletonV0 : public LUS::ResourceFactoryXML { class ResourceFactoryXMLSkeletonV0 : public Ship::ResourceFactoryXML {
public: public:
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -4,13 +4,13 @@
#include "libultraship/libultraship.h" #include "libultraship/libultraship.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> ResourceFactoryBinarySkeletonLimbV0::ReadResource(std::shared_ptr<LUS::File> file) { std::shared_ptr<Ship::IResource> ResourceFactoryBinarySkeletonLimbV0::ReadResource(std::shared_ptr<Ship::File> file) {
if (!FileHasValidFormatAndReader(file)) { if (!FileHasValidFormatAndReader(file)) {
return nullptr; return nullptr;
} }
auto skeletonLimb = std::make_shared<SkeletonLimb>(file->InitData); auto skeletonLimb = std::make_shared<SkeletonLimb>(file->InitData);
auto reader = std::get<std::shared_ptr<LUS::BinaryReader>>(file->Reader); auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
skeletonLimb->limbType = (LimbType)reader->ReadInt8(); skeletonLimb->limbType = (LimbType)reader->ReadInt8();
skeletonLimb->skinSegmentType = (ZLimbSkinType)reader->ReadInt8(); skeletonLimb->skinSegmentType = (ZLimbSkinType)reader->ReadInt8();
@ -184,7 +184,7 @@ std::shared_ptr<LUS::IResource> ResourceFactoryBinarySkeletonLimbV0::ReadResourc
return skeletonLimb; return skeletonLimb;
} }
std::shared_ptr<LUS::IResource> ResourceFactoryXMLSkeletonLimbV0::ReadResource(std::shared_ptr<LUS::File> file) { std::shared_ptr<Ship::IResource> ResourceFactoryXMLSkeletonLimbV0::ReadResource(std::shared_ptr<Ship::File> file) {
if (!FileHasValidFormatAndReader(file)) { if (!FileHasValidFormatAndReader(file)) {
return nullptr; return nullptr;
} }

View File

@ -5,13 +5,13 @@
#include "ResourceFactoryXML.h" #include "ResourceFactoryXML.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinarySkeletonLimbV0 : public LUS::ResourceFactoryBinary { class ResourceFactoryBinarySkeletonLimbV0 : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
}; };
class ResourceFactoryXMLSkeletonLimbV0 : public LUS::ResourceFactoryXML { class ResourceFactoryXMLSkeletonLimbV0 : public Ship::ResourceFactoryXML {
public: public:
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -3,13 +3,13 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> ResourceFactoryBinaryTextV0::ReadResource(std::shared_ptr<LUS::File> file) { std::shared_ptr<Ship::IResource> ResourceFactoryBinaryTextV0::ReadResource(std::shared_ptr<Ship::File> file) {
if (!FileHasValidFormatAndReader(file)) { if (!FileHasValidFormatAndReader(file)) {
return nullptr; return nullptr;
} }
auto text = std::make_shared<Text>(file->InitData); auto text = std::make_shared<Text>(file->InitData);
auto reader = std::get<std::shared_ptr<LUS::BinaryReader>>(file->Reader); auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
uint32_t msgCount = reader->ReadUInt32(); uint32_t msgCount = reader->ReadUInt32();
text->messages.reserve(msgCount); text->messages.reserve(msgCount);
@ -27,7 +27,7 @@ std::shared_ptr<LUS::IResource> ResourceFactoryBinaryTextV0::ReadResource(std::s
return text; return text;
} }
std::shared_ptr<LUS::IResource> ResourceFactoryXMLTextV0::ReadResource(std::shared_ptr<LUS::File> file) { std::shared_ptr<Ship::IResource> ResourceFactoryXMLTextV0::ReadResource(std::shared_ptr<Ship::File> file) {
if (!FileHasValidFormatAndReader(file)) { if (!FileHasValidFormatAndReader(file)) {
return nullptr; return nullptr;
} }

View File

@ -5,13 +5,13 @@
#include "ResourceFactoryXML.h" #include "ResourceFactoryXML.h"
namespace SOH { namespace SOH {
class ResourceFactoryBinaryTextV0 : public LUS::ResourceFactoryBinary { class ResourceFactoryBinaryTextV0 : public Ship::ResourceFactoryBinary {
public: public:
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
}; };
class ResourceFactoryXMLTextV0 : public LUS::ResourceFactoryXML { class ResourceFactoryXMLTextV0 : public Ship::ResourceFactoryXML {
public: public:
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::File> file) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -4,8 +4,8 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
EndMarkerFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) { EndMarkerFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) {
auto endMarker = std::make_shared<EndMarker>(initData); auto endMarker = std::make_shared<EndMarker>(initData);
ReadCommandId(endMarker, reader); ReadCommandId(endMarker, reader);
@ -17,7 +17,7 @@ EndMarkerFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData,
return endMarker; return endMarker;
} }
std::shared_ptr<LUS::IResource> EndMarkerFactoryXML::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<Ship::IResource> EndMarkerFactoryXML::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) { tinyxml2::XMLElement* reader) {
auto endMarker = std::make_shared<EndMarker>(initData); auto endMarker = std::make_shared<EndMarker>(initData);

View File

@ -5,12 +5,12 @@
namespace SOH { namespace SOH {
class EndMarkerFactory : public SceneCommandFactoryBinaryV0 { class EndMarkerFactory : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) override; std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class EndMarkerFactoryXML : public SceneCommandFactoryXMLV0 { class EndMarkerFactoryXML : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, tinyxml2::XMLElement* reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, tinyxml2::XMLElement* reader) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -3,7 +3,7 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
void SceneCommandFactoryBinaryV0::ReadCommandId(std::shared_ptr<ISceneCommand> command, std::shared_ptr<LUS::BinaryReader> reader) { void SceneCommandFactoryBinaryV0::ReadCommandId(std::shared_ptr<ISceneCommand> command, std::shared_ptr<Ship::BinaryReader> reader) {
command->cmdId = (SceneCommandID)reader->ReadInt32(); command->cmdId = (SceneCommandID)reader->ReadInt32();
} }
} // namespace SOH } // namespace SOH

View File

@ -9,15 +9,15 @@
namespace SOH { namespace SOH {
class SceneCommandFactoryBinaryV0 { class SceneCommandFactoryBinaryV0 {
public: public:
virtual std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) = 0; virtual std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) = 0;
protected: protected:
void ReadCommandId(std::shared_ptr<ISceneCommand> command, std::shared_ptr<LUS::BinaryReader> reader); void ReadCommandId(std::shared_ptr<ISceneCommand> command, std::shared_ptr<Ship::BinaryReader> reader);
}; };
class SceneCommandFactoryXMLV0 { class SceneCommandFactoryXMLV0 {
public: public:
virtual std::shared_ptr<LUS::IResource> ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, tinyxml2::XMLElement* reader) = 0; virtual std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, tinyxml2::XMLElement* reader) = 0;
protected: protected:
void ReadCommandId(std::shared_ptr<ISceneCommand> command, tinyxml2::XMLElement* reader); void ReadCommandId(std::shared_ptr<ISceneCommand> command, tinyxml2::XMLElement* reader);

View File

@ -4,8 +4,8 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
SetActorListFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) { SetActorListFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) {
auto setActorList = std::make_shared<SetActorList>(initData); auto setActorList = std::make_shared<SetActorList>(initData);
ReadCommandId(setActorList, reader); ReadCommandId(setActorList, reader);
@ -34,7 +34,7 @@ SetActorListFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initDat
return setActorList; return setActorList;
} }
std::shared_ptr<LUS::IResource> SetActorListFactoryXML::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<Ship::IResource> SetActorListFactoryXML::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) { tinyxml2::XMLElement* reader) {
auto setActorList = std::make_shared<SetActorList>(initData); auto setActorList = std::make_shared<SetActorList>(initData);

View File

@ -5,13 +5,13 @@
namespace SOH { namespace SOH {
class SetActorListFactory : public SceneCommandFactoryBinaryV0 { class SetActorListFactory : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetActorListFactoryXML : public SceneCommandFactoryXMLV0 { class SetActorListFactoryXML : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, tinyxml2::XMLElement* reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, tinyxml2::XMLElement* reader) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -5,8 +5,8 @@
#include "libultraship/libultraship.h" #include "libultraship/libultraship.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> SetAlternateHeadersFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<Ship::IResource> SetAlternateHeadersFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<LUS::BinaryReader> reader) { std::shared_ptr<Ship::BinaryReader> reader) {
auto setAlternateHeaders = std::make_shared<SetAlternateHeaders>(initData); auto setAlternateHeaders = std::make_shared<SetAlternateHeaders>(initData);
ReadCommandId(setAlternateHeaders, reader); ReadCommandId(setAlternateHeaders, reader);
@ -16,7 +16,7 @@ std::shared_ptr<LUS::IResource> SetAlternateHeadersFactory::ReadResource(std::sh
for (uint32_t i = 0; i < setAlternateHeaders->numHeaders; i++) { for (uint32_t i = 0; i < setAlternateHeaders->numHeaders; i++) {
auto headerName = reader->ReadString(); auto headerName = reader->ReadString();
if (!headerName.empty()) { if (!headerName.empty()) {
setAlternateHeaders->headers.push_back(std::static_pointer_cast<Scene>(LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(headerName.c_str()))); setAlternateHeaders->headers.push_back(std::static_pointer_cast<Scene>(Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(headerName.c_str())));
} else { } else {
setAlternateHeaders->headers.push_back(nullptr); setAlternateHeaders->headers.push_back(nullptr);
} }
@ -29,7 +29,7 @@ std::shared_ptr<LUS::IResource> SetAlternateHeadersFactory::ReadResource(std::sh
return setAlternateHeaders; return setAlternateHeaders;
} }
std::shared_ptr<LUS::IResource> SetAlternateHeadersFactoryXML::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<Ship::IResource> SetAlternateHeadersFactoryXML::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) { tinyxml2::XMLElement* reader) {
auto setAlternateHeaders = std::make_shared<SetAlternateHeaders>(initData); auto setAlternateHeaders = std::make_shared<SetAlternateHeaders>(initData);
@ -43,7 +43,7 @@ std::shared_ptr<LUS::IResource> SetAlternateHeadersFactoryXML::ReadResource(std:
for (uint32_t i = 0; i < setAlternateHeaders->numHeaders; i++) { for (uint32_t i = 0; i < setAlternateHeaders->numHeaders; i++) {
auto headerName = std::string(child->Attribute("HeaderName")); auto headerName = std::string(child->Attribute("HeaderName"));
if (!headerName.empty()) { if (!headerName.empty()) {
setAlternateHeaders->headers.push_back(std::static_pointer_cast<Scene>(LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(headerName.c_str()))); setAlternateHeaders->headers.push_back(std::static_pointer_cast<Scene>(Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(headerName.c_str())));
} else { } else {
setAlternateHeaders->headers.push_back(nullptr); setAlternateHeaders->headers.push_back(nullptr);
} }

View File

@ -5,13 +5,13 @@
namespace SOH { namespace SOH {
class SetAlternateHeadersFactory : public SceneCommandFactoryBinaryV0 { class SetAlternateHeadersFactory : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetAlternateHeadersFactoryXML : public SceneCommandFactoryXMLV0 { class SetAlternateHeadersFactoryXML : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, tinyxml2::XMLElement* reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, tinyxml2::XMLElement* reader) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -4,8 +4,8 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> SetCameraSettingsFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<Ship::IResource> SetCameraSettingsFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<LUS::BinaryReader> reader) { std::shared_ptr<Ship::BinaryReader> reader) {
auto setCameraSettings = std::make_shared<SetCameraSettings>(initData); auto setCameraSettings = std::make_shared<SetCameraSettings>(initData);
ReadCommandId(setCameraSettings, reader); ReadCommandId(setCameraSettings, reader);
@ -20,7 +20,7 @@ std::shared_ptr<LUS::IResource> SetCameraSettingsFactory::ReadResource(std::shar
return setCameraSettings; return setCameraSettings;
} }
std::shared_ptr<LUS::IResource> SetCameraSettingsFactoryXML::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<Ship::IResource> SetCameraSettingsFactoryXML::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) { tinyxml2::XMLElement* reader) {
auto setCameraSettings = std::make_shared<SetCameraSettings>(initData); auto setCameraSettings = std::make_shared<SetCameraSettings>(initData);

View File

@ -5,13 +5,13 @@
namespace SOH { namespace SOH {
class SetCameraSettingsFactory : public SceneCommandFactoryBinaryV0 { class SetCameraSettingsFactory : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetCameraSettingsFactoryXML : public SceneCommandFactoryXMLV0 { class SetCameraSettingsFactoryXML : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, tinyxml2::XMLElement* reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, tinyxml2::XMLElement* reader) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -5,14 +5,14 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> SetCollisionHeaderFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<Ship::IResource> SetCollisionHeaderFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<LUS::BinaryReader> reader) { std::shared_ptr<Ship::BinaryReader> reader) {
auto setCollisionHeader = std::make_shared<SetCollisionHeader>(initData); auto setCollisionHeader = std::make_shared<SetCollisionHeader>(initData);
ReadCommandId(setCollisionHeader, reader); ReadCommandId(setCollisionHeader, reader);
setCollisionHeader->fileName = reader->ReadString(); setCollisionHeader->fileName = reader->ReadString();
setCollisionHeader->collisionHeader = std::static_pointer_cast<CollisionHeader>(LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCollisionHeader->fileName.c_str())); setCollisionHeader->collisionHeader = std::static_pointer_cast<CollisionHeader>(Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCollisionHeader->fileName.c_str()));
if (CVarGetInteger(CVAR_DEVELOPER_TOOLS("ResourceLogging"), 0)) { if (CVarGetInteger(CVAR_DEVELOPER_TOOLS("ResourceLogging"), 0)) {
LogSetCollisionHeaderAsXML(setCollisionHeader); LogSetCollisionHeaderAsXML(setCollisionHeader);
@ -21,14 +21,14 @@ std::shared_ptr<LUS::IResource> SetCollisionHeaderFactory::ReadResource(std::sha
return setCollisionHeader; return setCollisionHeader;
} }
std::shared_ptr<LUS::IResource> SetCollisionHeaderFactoryXML::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<Ship::IResource> SetCollisionHeaderFactoryXML::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) { tinyxml2::XMLElement* reader) {
auto setCollisionHeader = std::make_shared<SetCollisionHeader>(initData); auto setCollisionHeader = std::make_shared<SetCollisionHeader>(initData);
setCollisionHeader->cmdId = SceneCommandID::SetCollisionHeader; setCollisionHeader->cmdId = SceneCommandID::SetCollisionHeader;
setCollisionHeader->fileName = reader->Attribute("FileName"); setCollisionHeader->fileName = reader->Attribute("FileName");
setCollisionHeader->collisionHeader = std::static_pointer_cast<CollisionHeader>(LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCollisionHeader->fileName.c_str())); setCollisionHeader->collisionHeader = std::static_pointer_cast<CollisionHeader>(Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCollisionHeader->fileName.c_str()));
return setCollisionHeader; return setCollisionHeader;
} }

View File

@ -5,13 +5,13 @@
namespace SOH { namespace SOH {
class SetCollisionHeaderFactory : public SceneCommandFactoryBinaryV0 { class SetCollisionHeaderFactory : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetCollisionHeaderFactoryXML : public SceneCommandFactoryXMLV0 { class SetCollisionHeaderFactoryXML : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, tinyxml2::XMLElement* reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, tinyxml2::XMLElement* reader) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -4,8 +4,8 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
SetCsCameraFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) { SetCsCameraFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) {
auto setCsCamera = std::make_shared<SetCsCamera>(initData); auto setCsCamera = std::make_shared<SetCsCamera>(initData);
ReadCommandId(setCsCamera, reader); ReadCommandId(setCsCamera, reader);
@ -22,7 +22,7 @@ SetCsCameraFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData
return setCsCamera; return setCsCamera;
} }
std::shared_ptr<LUS::IResource> SetCsCameraFactoryXML::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<Ship::IResource> SetCsCameraFactoryXML::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) { tinyxml2::XMLElement* reader) {
auto setCsCamera = std::make_shared<SetCsCamera>(initData); auto setCsCamera = std::make_shared<SetCsCamera>(initData);

View File

@ -5,13 +5,13 @@
namespace SOH { namespace SOH {
class SetCsCameraFactory : public SceneCommandFactoryBinaryV0 { class SetCsCameraFactory : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetCsCameraFactoryXML : public SceneCommandFactoryXMLV0 { class SetCsCameraFactoryXML : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, tinyxml2::XMLElement* reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, tinyxml2::XMLElement* reader) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -5,14 +5,14 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
SetCutscenesFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) { SetCutscenesFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) {
auto setCutscenes = std::make_shared<SetCutscenes>(initData); auto setCutscenes = std::make_shared<SetCutscenes>(initData);
ReadCommandId(setCutscenes, reader); ReadCommandId(setCutscenes, reader);
setCutscenes->fileName = reader->ReadString(); setCutscenes->fileName = reader->ReadString();
setCutscenes->cutscene = std::static_pointer_cast<Cutscene>(LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCutscenes->fileName.c_str())); setCutscenes->cutscene = std::static_pointer_cast<Cutscene>(Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCutscenes->fileName.c_str()));
if (CVarGetInteger(CVAR_DEVELOPER_TOOLS("ResourceLogging"), 0)) { if (CVarGetInteger(CVAR_DEVELOPER_TOOLS("ResourceLogging"), 0)) {
LogCutscenesAsXML(setCutscenes); LogCutscenesAsXML(setCutscenes);
@ -21,14 +21,14 @@ SetCutscenesFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initDat
return setCutscenes; return setCutscenes;
} }
std::shared_ptr<LUS::IResource> SetCutscenesFactoryXML::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<Ship::IResource> SetCutscenesFactoryXML::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) { tinyxml2::XMLElement* reader) {
auto setCutscenes = std::make_shared<SetCutscenes>(initData); auto setCutscenes = std::make_shared<SetCutscenes>(initData);
setCutscenes->cmdId = SceneCommandID::SetCutscenes; setCutscenes->cmdId = SceneCommandID::SetCutscenes;
setCutscenes->fileName = reader->Attribute("FileName"); setCutscenes->fileName = reader->Attribute("FileName");
setCutscenes->cutscene = std::static_pointer_cast<Cutscene>(LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCutscenes->fileName.c_str())); setCutscenes->cutscene = std::static_pointer_cast<Cutscene>(Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(setCutscenes->fileName.c_str()));
return setCutscenes; return setCutscenes;
} }

View File

@ -5,13 +5,13 @@
namespace SOH { namespace SOH {
class SetCutscenesFactory : public SceneCommandFactoryBinaryV0 { class SetCutscenesFactory : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetCutscenesFactoryXML : public SceneCommandFactoryXMLV0 { class SetCutscenesFactoryXML : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, tinyxml2::XMLElement* reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, tinyxml2::XMLElement* reader) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -4,8 +4,8 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
SetEchoSettingsFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) { SetEchoSettingsFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) {
auto setEchoSettings = std::make_shared<SetEchoSettings>(initData); auto setEchoSettings = std::make_shared<SetEchoSettings>(initData);
ReadCommandId(setEchoSettings, reader); ReadCommandId(setEchoSettings, reader);
@ -19,7 +19,7 @@ SetEchoSettingsFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> init
return setEchoSettings; return setEchoSettings;
} }
std::shared_ptr<LUS::IResource> SetEchoSettingsFactoryXML::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<Ship::IResource> SetEchoSettingsFactoryXML::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) { tinyxml2::XMLElement* reader) {
auto setEchoSettings = std::make_shared<SetEchoSettings>(initData); auto setEchoSettings = std::make_shared<SetEchoSettings>(initData);

View File

@ -5,13 +5,13 @@
namespace SOH { namespace SOH {
class SetEchoSettingsFactory : public SceneCommandFactoryBinaryV0 { class SetEchoSettingsFactory : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetEchoSettingsFactoryXML : public SceneCommandFactoryXMLV0 { class SetEchoSettingsFactoryXML : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, tinyxml2::XMLElement* reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, tinyxml2::XMLElement* reader) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -4,8 +4,8 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
SetEntranceListFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) { SetEntranceListFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) {
auto setEntranceList = std::make_shared<SetEntranceList>(initData); auto setEntranceList = std::make_shared<SetEntranceList>(initData);
ReadCommandId(setEntranceList, reader); ReadCommandId(setEntranceList, reader);
@ -28,7 +28,7 @@ SetEntranceListFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> init
return setEntranceList; return setEntranceList;
} }
std::shared_ptr<LUS::IResource> SetEntranceListFactoryXML::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<Ship::IResource> SetEntranceListFactoryXML::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) { tinyxml2::XMLElement* reader) {
auto setEntranceList = std::make_shared<SetEntranceList>(initData); auto setEntranceList = std::make_shared<SetEntranceList>(initData);

View File

@ -5,13 +5,13 @@
namespace SOH { namespace SOH {
class SetEntranceListFactory : public SceneCommandFactoryBinaryV0 { class SetEntranceListFactory : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetEntranceListFactoryXML : public SceneCommandFactoryXMLV0 { class SetEntranceListFactoryXML : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, tinyxml2::XMLElement* reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, tinyxml2::XMLElement* reader) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -4,8 +4,8 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
SetExitListFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) { SetExitListFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) {
auto setExitList = std::make_shared<SetExitList>( initData); auto setExitList = std::make_shared<SetExitList>( initData);
ReadCommandId(setExitList, reader); ReadCommandId(setExitList, reader);
@ -23,7 +23,7 @@ SetExitListFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData
return setExitList; return setExitList;
} }
std::shared_ptr<LUS::IResource> SetExitListFactoryXML::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<Ship::IResource> SetExitListFactoryXML::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) { tinyxml2::XMLElement* reader) {
auto setExitList = std::make_shared<SetExitList>(initData); auto setExitList = std::make_shared<SetExitList>(initData);

View File

@ -5,13 +5,13 @@
namespace SOH { namespace SOH {
class SetExitListFactory : public SceneCommandFactoryBinaryV0 { class SetExitListFactory : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetExitListFactoryXML : public SceneCommandFactoryXMLV0 { class SetExitListFactoryXML : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, tinyxml2::XMLElement* reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, tinyxml2::XMLElement* reader) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -4,8 +4,8 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
SetLightListFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) { SetLightListFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) {
auto setLightList = std::make_shared<SetLightList>(initData); auto setLightList = std::make_shared<SetLightList>(initData);
ReadCommandId(setLightList, reader); ReadCommandId(setLightList, reader);
@ -38,7 +38,7 @@ SetLightListFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initDat
return setLightList; return setLightList;
} }
std::shared_ptr<LUS::IResource> SetLightListFactoryXML::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<Ship::IResource> SetLightListFactoryXML::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) { tinyxml2::XMLElement* reader) {
auto setLightList = std::make_shared<SetLightList>(initData); auto setLightList = std::make_shared<SetLightList>(initData);

View File

@ -5,13 +5,13 @@
namespace SOH { namespace SOH {
class SetLightListFactory : public SceneCommandFactoryBinaryV0 { class SetLightListFactory : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetLightListFactoryXML : public SceneCommandFactoryXMLV0 { class SetLightListFactoryXML : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, tinyxml2::XMLElement* reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, tinyxml2::XMLElement* reader) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -4,8 +4,8 @@
#include "spdlog/spdlog.h" #include "spdlog/spdlog.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> SetLightingSettingsFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<Ship::IResource> SetLightingSettingsFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
std::shared_ptr<LUS::BinaryReader> reader) { std::shared_ptr<Ship::BinaryReader> reader) {
auto setLightingSettings = std::make_shared<SetLightingSettings>(initData); auto setLightingSettings = std::make_shared<SetLightingSettings>(initData);
ReadCommandId(setLightingSettings, reader); ReadCommandId(setLightingSettings, reader);
@ -51,7 +51,7 @@ std::shared_ptr<LUS::IResource> SetLightingSettingsFactory::ReadResource(std::sh
return setLightingSettings; return setLightingSettings;
} }
std::shared_ptr<LUS::IResource> SetLightingSettingsFactoryXML::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<Ship::IResource> SetLightingSettingsFactoryXML::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) { tinyxml2::XMLElement* reader) {
auto setLightingSettings = std::make_shared<SetLightingSettings>(initData); auto setLightingSettings = std::make_shared<SetLightingSettings>(initData);

View File

@ -5,13 +5,13 @@
namespace SOH { namespace SOH {
class SetLightingSettingsFactory : public SceneCommandFactoryBinaryV0 { class SetLightingSettingsFactory : public SceneCommandFactoryBinaryV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) override;
}; };
class SetLightingSettingsFactoryXML : public SceneCommandFactoryXMLV0 { class SetLightingSettingsFactoryXML : public SceneCommandFactoryXMLV0 {
public: public:
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, tinyxml2::XMLElement* reader) override; ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, tinyxml2::XMLElement* reader) override;
}; };
} // namespace SOH } // namespace SOH

View File

@ -5,8 +5,8 @@
#include "libultraship/libultraship.h" #include "libultraship/libultraship.h"
namespace SOH { namespace SOH {
std::shared_ptr<LUS::IResource> std::shared_ptr<Ship::IResource>
SetMeshFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<LUS::BinaryReader> reader) { SetMeshFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData, std::shared_ptr<Ship::BinaryReader> reader) {
auto setMesh = std::make_shared<SetMesh>(initData); auto setMesh = std::make_shared<SetMesh>(initData);
ReadCommandId(setMesh, reader); ReadCommandId(setMesh, reader);
@ -41,8 +41,8 @@ SetMeshFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, st
std::string meshOpa = reader->ReadString(); std::string meshOpa = reader->ReadString();
std::string meshXlu = reader->ReadString(); std::string meshXlu = reader->ReadString();
auto opaRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()); auto opaRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str());
auto xluRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()); auto xluRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str());
dlist.opa = meshOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0; dlist.opa = meshOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0;
dlist.xlu = meshXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0; dlist.xlu = meshXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0;
@ -56,8 +56,8 @@ SetMeshFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, st
std::string imgOpa = reader->ReadString(); std::string imgOpa = reader->ReadString();
std::string imgXlu = reader->ReadString(); std::string imgXlu = reader->ReadString();
auto opaRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(imgOpa.c_str()); auto opaRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(imgOpa.c_str());
auto xluRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(imgXlu.c_str()); auto xluRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(imgXlu.c_str());
pType.opa = imgOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0; pType.opa = imgOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0;
pType.xlu = imgXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0; pType.xlu = imgXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0;
@ -104,8 +104,8 @@ SetMeshFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, st
std::string meshOpa = reader->ReadString(); std::string meshOpa = reader->ReadString();
std::string meshXlu = reader->ReadString(); std::string meshXlu = reader->ReadString();
opaRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()); opaRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str());
xluRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()); xluRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str());
pType.opa = meshOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0; pType.opa = meshOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0;
pType.xlu = meshXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0; pType.xlu = meshXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0;
@ -124,8 +124,8 @@ SetMeshFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, st
std::string meshOpa = reader->ReadString(); std::string meshOpa = reader->ReadString();
std::string meshXlu = reader->ReadString(); std::string meshXlu = reader->ReadString();
auto opaRes = meshOpa != "" ? LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()) : nullptr; auto opaRes = meshOpa != "" ? Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()) : nullptr;
auto xluRes = meshXlu != "" ? LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()) : nullptr; auto xluRes = meshXlu != "" ? Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()) : nullptr;
dlist.opa = (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr); dlist.opa = (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr);
dlist.xlu = (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr); dlist.xlu = (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr);
@ -155,7 +155,7 @@ SetMeshFactory::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, st
return setMesh; return setMesh;
} }
std::shared_ptr<LUS::IResource> SetMeshFactoryXML::ReadResource(std::shared_ptr<LUS::ResourceInitData> initData, std::shared_ptr<Ship::IResource> SetMeshFactoryXML::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
tinyxml2::XMLElement* reader) { tinyxml2::XMLElement* reader) {
auto setMesh = std::make_shared<SetMesh>(initData); auto setMesh = std::make_shared<SetMesh>(initData);
@ -199,8 +199,8 @@ std::shared_ptr<LUS::IResource> SetMeshFactoryXML::ReadResource(std::shared_ptr<
std::string meshOpa = child->Attribute("MeshOpa"); std::string meshOpa = child->Attribute("MeshOpa");
std::string meshXlu = child->Attribute("MeshXlu"); std::string meshXlu = child->Attribute("MeshXlu");
auto opaRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()); auto opaRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str());
auto xluRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()); auto xluRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str());
dlist.opa = meshOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0; dlist.opa = meshOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0;
dlist.xlu = meshXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0; dlist.xlu = meshXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0;
@ -214,8 +214,8 @@ std::shared_ptr<LUS::IResource> SetMeshFactoryXML::ReadResource(std::shared_ptr<
std::string imgOpa = child->Attribute("ImgOpa"); std::string imgOpa = child->Attribute("ImgOpa");
std::string imgXlu = child->Attribute("ImgXlu"); std::string imgXlu = child->Attribute("ImgXlu");
auto opaRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(imgOpa.c_str()); auto opaRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(imgOpa.c_str());
auto xluRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(imgXlu.c_str()); auto xluRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(imgXlu.c_str());
pType.opa = imgOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0; pType.opa = imgOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0;
pType.xlu = imgXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0; pType.xlu = imgXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0;
@ -271,8 +271,8 @@ std::shared_ptr<LUS::IResource> SetMeshFactoryXML::ReadResource(std::shared_ptr<
std::string meshOpa = child->Attribute("MeshOpa"); std::string meshOpa = child->Attribute("MeshOpa");
std::string meshXlu = child->Attribute("MeshXlu"); std::string meshXlu = child->Attribute("MeshXlu");
opaRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()); opaRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str());
xluRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()); xluRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str());
pType.opa = meshOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0; pType.opa = meshOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0;
pType.xlu = meshXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0; pType.xlu = meshXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0;
@ -291,8 +291,8 @@ std::shared_ptr<LUS::IResource> SetMeshFactoryXML::ReadResource(std::shared_ptr<
std::string meshOpa = child->Attribute("MeshOpa"); std::string meshOpa = child->Attribute("MeshOpa");
std::string meshXlu = child->Attribute("MeshXlu"); std::string meshXlu = child->Attribute("MeshXlu");
auto opaRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str()); auto opaRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str());
auto xluRes = LUS::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str()); auto xluRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str());
dlist.opa = meshOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0; dlist.opa = meshOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0;
dlist.xlu = meshXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0; dlist.xlu = meshXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0;

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