Update LUS to build in GCC 16 (#6601)

This commit is contained in:
Pepper0ni
2026-05-30 14:38:58 +01:00
committed by GitHub
parent a3ab0e2bdf
commit 004adaae14
18 changed files with 348 additions and 257 deletions
@@ -6,6 +6,8 @@
#include "assets/soh_assets.h"
#include "soh/SohGui/ImGuiUtils.h"
#include <fast/Fast3dGui.h>
extern "C" {
#include "macros.h"
#include "functions.h"
@@ -83,18 +85,19 @@ static void TimeDisplayGetTimer(uint32_t timeID) {
Player* player = GET_PLAYER(gPlayState);
uint32_t timer1 = gSaveContext.timerSeconds;
auto gui = std::dynamic_pointer_cast<Fast::Fast3dGui>(
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui()));
switch (timeID) {
case DISPLAY_IN_GAME_TIMER:
textureDisplay = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("GAMEPLAY_TIMER");
textureDisplay = gui->GetTextureByName("GAMEPLAY_TIMER");
timeDisplayTime = formatTimeDisplay(GAMEPLAYSTAT_TOTAL_TIME).c_str();
break;
case DISPLAY_TIME_OF_DAY:
if (gSaveContext.dayTime >= DAY_BEGINS && gSaveContext.dayTime < NIGHT_BEGINS) {
textureDisplay =
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("DAY_TIME_TIMER");
textureDisplay = gui->GetTextureByName("DAY_TIME_TIMER");
} else {
textureDisplay =
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("NIGHT_TIME_TIMER");
textureDisplay = gui->GetTextureByName("NIGHT_TIME_TIMER");
}
timeDisplayTime = convertDayTime(gSaveContext.dayTime).c_str();
break;
@@ -107,18 +110,16 @@ static void TimeDisplayGetTimer(uint32_t timeID) {
: COLOR_LIGHT_BLUE)
: COLOR_WHITE;
if (gSaveContext.timerState <= TIMER_STATE_ENV_HAZARD_TICK) {
textureDisplay = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
gPlayState->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3
? itemMapping[ITEM_TUNIC_GORON].name
: itemMapping[ITEM_TUNIC_ZORA].name);
textureDisplay =
gui->GetTextureByName(gPlayState->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3
? itemMapping[ITEM_TUNIC_GORON].name
: itemMapping[ITEM_TUNIC_ZORA].name);
}
if (gSaveContext.timerState >= TIMER_STATE_DOWN_PREVIEW) {
textureDisplay = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
itemMapping[ITEM_SWORD_MASTER].name);
textureDisplay = gui->GetTextureByName(itemMapping[ITEM_SWORD_MASTER].name);
}
} else {
textureDisplay = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
itemMapping[ITEM_TUNIC_KOKIRI].name);
textureDisplay = gui->GetTextureByName(itemMapping[ITEM_TUNIC_KOKIRI].name);
timeDisplayTime = "-:--";
}
break;
@@ -132,7 +133,7 @@ static void TimeDisplayGetTimer(uint32_t timeID) {
timeDisplayTime = convertNaviTime(NAVI_COOLDOWN - gSaveContext.naviTimer).c_str();
textColor = COLOR_GREY;
}
textureDisplay = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("NAVI_TIMER");
textureDisplay = gui->GetTextureByName("NAVI_TIMER");
break;
default:
break;
@@ -203,13 +204,15 @@ void TimeDisplayWindow::Draw() {
}
if (textToDecode[i] == '.') {
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (8.0f * fontScale));
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
digitList[textureIndex].first),
ImGui::Image(std::dynamic_pointer_cast<Fast::Fast3dGui>(
Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(digitList[textureIndex].first),
ImVec2(8.0f * fontScale, 8.0f * fontScale), ImVec2(0, 0.5f), ImVec2(1, 1),
textColor, ImVec4(0, 0, 0, 0));
} else {
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
digitList[textureIndex].first),
ImGui::Image(std::dynamic_pointer_cast<Fast::Fast3dGui>(
Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(digitList[textureIndex].first),
ImVec2(8.0f * fontScale, 16.0f * fontScale), ImVec2(0, 0), ImVec2(1, 1), textColor,
ImVec4(0, 0, 0, 0));
}
@@ -247,17 +250,18 @@ static void TimeDisplayInitTimers() {
}
void TimeDisplayWindow::InitElement() {
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("GAMEPLAY_TIMER", gClockIconTex,
ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("DAY_TIME_TIMER", gSunIconTex,
ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("NIGHT_TIME_TIMER", gMoonIconTex,
ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("NAVI_TIMER", gNaviIconTex, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture("GAMEPLAY_TIMER", gClockIconTex, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture("DAY_TIME_TIMER", gSunIconTex, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture("NIGHT_TIME_TIMER", gMoonIconTex, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture("NAVI_TIMER", gNaviIconTex, ImVec4(1, 1, 1, 1));
for (auto& load : digitList) {
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(load.first.c_str(), load.second,
ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture(load.first.c_str(), load.second, ImVec4(1, 1, 1, 1));
}
TimeDisplayInitSettings();
+98 -86
View File
@@ -13,6 +13,8 @@
#include "soh/SohGui/UIWidgets.hpp"
#include "soh/SohGui/SohGui.hpp"
#include <fast/Fast3dGui.h>
using namespace UIWidgets;
// Text colors
@@ -47,15 +49,17 @@ void InputViewer::RenderButton(std::string btnTexture, std::string btnOutlineTex
// Render Outline based on settings
if (outlineMode == BUTTON_OUTLINE_ALWAYS_SHOWN || (outlineMode == BUTTON_OUTLINE_NOT_PRESSED && !state) ||
(outlineMode == BUTTON_OUTLINE_PRESSED && state)) {
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(btnOutlineTexture), size,
ImVec2(0, 0), ImVec2(1.0f, 1.0f));
ImGui::Image(std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(btnOutlineTexture),
size, ImVec2(0, 0), ImVec2(1.0f, 1.0f));
}
// Render button if pressed
if (state) {
ImGui::SetCursorPos(pos);
ImGui::SetNextItemAllowOverlap();
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(btnTexture), size,
ImVec2(0, 0), ImVec2(1.0f, 1.0f));
ImGui::Image(std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(btnTexture),
size, ImVec2(0, 0), ImVec2(1.0f, 1.0f));
}
}
@@ -72,80 +76,80 @@ void InputViewer::DrawElement() {
if (CVarGetInteger(CVAR_WINDOW("InputViewer"), 0)) {
static bool sButtonTexturesLoaded = false;
if (!sButtonTexturesLoaded) {
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"Input-Viewer-Background", "textures/buttons/InputViewerBackground.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("A-Btn",
"textures/buttons/ABtn.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("B-Btn",
"textures/buttons/BBtn.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("L-Btn",
"textures/buttons/LBtn.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("R-Btn",
"textures/buttons/RBtn.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Z-Btn",
"textures/buttons/ZBtn.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"Start-Btn", "textures/buttons/StartBtn.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Left",
"textures/buttons/CLeft.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Right",
"textures/buttons/CRight.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Up",
"textures/buttons/CUp.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("C-Down",
"textures/buttons/CDown.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"Analog-Stick", "textures/buttons/AnalogStick.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"Dpad-Left", "textures/buttons/DPadLeft.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"Dpad-Right", "textures/buttons/DPadRight.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Dpad-Up",
"textures/buttons/DPadUp.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"Dpad-Down", "textures/buttons/DPadDown.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Modifier-1",
"textures/buttons/Mod1.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage("Modifier-2",
"textures/buttons/Mod2.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"Right-Stick", "textures/buttons/RightStick.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"A-Btn Outline", "textures/buttons/ABtnOutline.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"B-Btn Outline", "textures/buttons/BBtnOutline.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"L-Btn Outline", "textures/buttons/LBtnOutline.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"R-Btn Outline", "textures/buttons/RBtnOutline.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"Z-Btn Outline", "textures/buttons/ZBtnOutline.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"Start-Btn Outline", "textures/buttons/StartBtnOutline.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"C-Left Outline", "textures/buttons/CLeftOutline.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"C-Right Outline", "textures/buttons/CRightOutline.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"C-Up Outline", "textures/buttons/CUpOutline.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"C-Down Outline", "textures/buttons/CDownOutline.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"Analog-Stick Outline", "textures/buttons/AnalogStickOutline.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"Dpad-Left Outline", "textures/buttons/DPadLeftOutline.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"Dpad-Right Outline", "textures/buttons/DPadRightOutline.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"Dpad-Up Outline", "textures/buttons/DPadUpOutline.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"Dpad-Down Outline", "textures/buttons/DPadDownOutline.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"Modifier-1 Outline", "textures/buttons/Mod1Outline.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"Modifier-2 Outline", "textures/buttons/Mod2Outline.png");
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
"Right-Stick Outline", "textures/buttons/RightStickOutline.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Input-Viewer-Background", "textures/buttons/InputViewerBackground.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("A-Btn", "textures/buttons/ABtn.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("B-Btn", "textures/buttons/BBtn.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("L-Btn", "textures/buttons/LBtn.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("R-Btn", "textures/buttons/RBtn.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Z-Btn", "textures/buttons/ZBtn.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Start-Btn", "textures/buttons/StartBtn.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("C-Left", "textures/buttons/CLeft.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("C-Right", "textures/buttons/CRight.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("C-Up", "textures/buttons/CUp.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("C-Down", "textures/buttons/CDown.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Analog-Stick", "textures/buttons/AnalogStick.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Dpad-Left", "textures/buttons/DPadLeft.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Dpad-Right", "textures/buttons/DPadRight.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Dpad-Up", "textures/buttons/DPadUp.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Dpad-Down", "textures/buttons/DPadDown.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Modifier-1", "textures/buttons/Mod1.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Modifier-2", "textures/buttons/Mod2.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Right-Stick", "textures/buttons/RightStick.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("A-Btn Outline", "textures/buttons/ABtnOutline.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("B-Btn Outline", "textures/buttons/BBtnOutline.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("L-Btn Outline", "textures/buttons/LBtnOutline.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("R-Btn Outline", "textures/buttons/RBtnOutline.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Z-Btn Outline", "textures/buttons/ZBtnOutline.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Start-Btn Outline", "textures/buttons/StartBtnOutline.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("C-Left Outline", "textures/buttons/CLeftOutline.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("C-Right Outline", "textures/buttons/CRightOutline.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("C-Up Outline", "textures/buttons/CUpOutline.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("C-Down Outline", "textures/buttons/CDownOutline.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Analog-Stick Outline", "textures/buttons/AnalogStickOutline.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Dpad-Left Outline", "textures/buttons/DPadLeftOutline.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Dpad-Right Outline", "textures/buttons/DPadRightOutline.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Dpad-Up Outline", "textures/buttons/DPadUpOutline.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Dpad-Down Outline", "textures/buttons/DPadDownOutline.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Modifier-1 Outline", "textures/buttons/Mod1Outline.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Modifier-2 Outline", "textures/buttons/Mod2Outline.png");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadTextureFromRawImage("Right-Stick Outline", "textures/buttons/RightStickOutline.png");
sButtonTexturesLoaded = true;
}
@@ -162,7 +166,8 @@ void InputViewer::DrawElement() {
CVarGetInteger(CVAR_INPUT_VIEWER("ButtonOutlineMode"), BUTTON_OUTLINE_NOT_PRESSED);
const bool useGlobalOutlineMode = CVarGetInteger(CVAR_INPUT_VIEWER("UseGlobalButtonOutlineMode"), 1);
ImVec2 bgSize = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureSize("Input-Viewer-Background");
ImVec2 bgSize = std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureSize("Input-Viewer-Background");
ImVec2 scaledBGSize = ImVec2(bgSize.x * scale, bgSize.y * scale);
ImGui::SetNextWindowSize(
@@ -199,7 +204,8 @@ void InputViewer::DrawElement() {
ImGui::SetNextItemAllowOverlap();
// Background
ImGui::Image(
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Input-Viewer-Background"),
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName("Input-Viewer-Background"),
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f));
}
@@ -350,7 +356,8 @@ void InputViewer::DrawElement() {
ImGui::SetNextItemAllowOverlap();
ImGui::SetCursorPos(aPos);
ImGui::Image(
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Analog-Stick Outline"),
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName("Analog-Stick Outline"),
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f));
}
const int analogStickMode =
@@ -361,8 +368,10 @@ void InputViewer::DrawElement() {
ImGui::SetCursorPos(
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));
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Analog-Stick"),
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f));
ImGui::Image(
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName("Analog-Stick"),
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f));
}
// Right Stick
@@ -374,7 +383,8 @@ void InputViewer::DrawElement() {
ImGui::SetNextItemAllowOverlap();
ImGui::SetCursorPos(aPos);
ImGui::Image(
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Right-Stick Outline"),
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName("Right-Stick Outline"),
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f));
}
const int rightStickMode =
@@ -385,8 +395,10 @@ void InputViewer::DrawElement() {
ImGui::SetCursorPos(
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));
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Right-Stick"),
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f));
ImGui::Image(
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName("Right-Stick"),
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f));
}
// Analog stick angle text
@@ -1,4 +1,5 @@
#include "text.h"
#include <functional>
Text::Text() = default;
@@ -17,6 +17,8 @@
#include <libultraship/libultraship.h>
#include <soh_assets.h>
#include <fast/Fast3dGui.h>
extern "C" {
#include <z64.h>
#include "variables.h"
@@ -519,7 +521,8 @@ void DrawInfoTab() {
void DrawBGSItemFlag(uint8_t itemID) {
const ItemMapEntry& slotEntry = itemMapping[itemID];
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name),
ImGui::Image(std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(slotEntry.name),
ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1));
}
@@ -547,7 +550,8 @@ void DrawInventoryTab() {
if (item == ITEM_ROCS_FEATHER) {
auto ret = ImGui::ImageButton(
"ROCS_FEATHER",
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("ROCS_FEATHER"),
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName("ROCS_FEATHER"),
ImVec2(48.0f, 48.0f), ImVec2(0, 0), ImVec2(1, 1));
if (ret) {
selectedIndex = index;
@@ -557,7 +561,8 @@ void DrawInventoryTab() {
const ItemMapEntry& slotEntry = itemMapping.find(item)->second;
auto ret = ImGui::ImageButton(
slotEntry.name.c_str(),
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name),
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(slotEntry.name),
ImVec2(48.0f, 48.0f), ImVec2(0, 0), ImVec2(1, 1));
if (ret) {
selectedIndex = index;
@@ -608,7 +613,8 @@ void DrawInventoryTab() {
PushStyleButton(Colors::DarkGray);
auto ret = ImGui::ImageButton(
slotEntry.name.c_str(),
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name),
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(slotEntry.name),
ImVec2(IMAGE_SIZE, IMAGE_SIZE), ImVec2(0, 0), ImVec2(1, 1));
PopStyleButton();
if (ret) {
@@ -641,7 +647,8 @@ void DrawInventoryTab() {
ImGui::PushItemWidth(IMAGE_SIZE);
ImGui::BeginGroup();
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(itemMapping[item].name),
ImGui::Image(std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(itemMapping[item].name),
ImVec2(IMAGE_SIZE, IMAGE_SIZE));
PushStyleInput(THEME_COLOR);
ImGui::InputScalar("##ammoInput", ImGuiDataType_S8, &AMMO(item));
@@ -1233,9 +1240,11 @@ void DrawUpgradeIcon(const std::string& categoryName, int32_t categoryId, const
uint8_t item = value < items.size() ? items[value] : ITEM_NONE;
if (item != ITEM_NONE) {
const ItemMapEntry& slotEntry = itemMapping[item];
if (ImGui::ImageButton(slotEntry.name.c_str(),
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name),
ImVec2(IMAGE_SIZE, IMAGE_SIZE), ImVec2(0, 0), ImVec2(1, 1))) {
if (ImGui::ImageButton(
slotEntry.name.c_str(),
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(slotEntry.name),
ImVec2(IMAGE_SIZE, IMAGE_SIZE), ImVec2(0, 0), ImVec2(1, 1))) {
ImGui::OpenPopup(upgradePopupPicker);
}
} else {
@@ -1264,7 +1273,8 @@ void DrawUpgradeIcon(const std::string& categoryName, int32_t categoryId, const
const ItemMapEntry& slotEntry = itemMapping[items[pickerIndex]];
auto ret = ImGui::ImageButton(
slotEntry.name.c_str(),
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(slotEntry.name),
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(slotEntry.name),
ImVec2(IMAGE_SIZE, IMAGE_SIZE), ImVec2(0, 0), ImVec2(1, 1));
if (ret) {
Inventory_ChangeUpgrade(categoryId, pickerIndex);
@@ -1300,10 +1310,11 @@ void DrawEquipmentTab() {
bool hasEquip = (bitMask & gSaveContext.inventory.equipment) != 0;
const ItemMapEntry& entry = itemMapping[equipmentValues[i]];
PushStyleButton(Colors::DarkGray);
auto ret = ImGui::ImageButton(entry.name.c_str(),
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
hasEquip ? entry.name : entry.nameFaded),
ImVec2(IMAGE_SIZE, IMAGE_SIZE), ImVec2(0, 0), ImVec2(1, 1));
auto ret = ImGui::ImageButton(
entry.name.c_str(),
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(hasEquip ? entry.name : entry.nameFaded),
ImVec2(IMAGE_SIZE, IMAGE_SIZE), ImVec2(0, 0), ImVec2(1, 1));
if (ret) {
if (hasEquip) {
gSaveContext.inventory.equipment &= ~bitMask;
@@ -1435,10 +1446,11 @@ void DrawQuestItemButton(uint32_t item) {
uint32_t bitMask = 1 << entry.id;
bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 0;
PushStyleButton(Colors::DarkGray);
auto ret = ImGui::ImageButton(entry.name.c_str(),
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
hasQuestItem ? entry.name : entry.nameFaded),
ImVec2(IMAGE_SIZE, IMAGE_SIZE), ImVec2(0, 0), ImVec2(1, 1));
auto ret = ImGui::ImageButton(
entry.name.c_str(),
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded),
ImVec2(IMAGE_SIZE, IMAGE_SIZE), ImVec2(0, 0), ImVec2(1, 1));
if (ret) {
if (hasQuestItem) {
gSaveContext.inventory.questItems &= ~bitMask;
@@ -1458,7 +1470,8 @@ void DrawDungeonItemButton(uint32_t item, uint32_t scene) {
PushStyleButton(Colors::DarkGray);
auto ret = ImGui::ImageButton(
entry.name.c_str(),
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(hasItem ? entry.name : entry.nameFaded),
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(hasItem ? entry.name : entry.nameFaded),
ImVec2(IMAGE_SIZE, IMAGE_SIZE), ImVec2(0, 0), ImVec2(1, 1));
if (ret) {
if (hasItem) {
@@ -1504,10 +1517,11 @@ void DrawQuestStatusTab() {
uint32_t bitMask = 1 << entry.id;
bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 0;
PushStyleButton(Colors::DarkGray);
auto ret = ImGui::ImageButton(entry.name.c_str(),
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
hasQuestItem ? entry.name : entry.nameFaded),
ImVec2(32.0f, 48.0f), ImVec2(0, 0), ImVec2(1, 1));
auto ret = ImGui::ImageButton(
entry.name.c_str(),
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded),
ImVec2(32.0f, 48.0f), ImVec2(0, 0), ImVec2(1, 1));
if (ret) {
if (hasQuestItem) {
gSaveContext.inventory.questItems &= ~bitMask;
@@ -1584,9 +1598,10 @@ void DrawQuestStatusTab() {
if (dungeonItemsScene != SCENE_JABU_JABU_BOSS) {
float lineHeight = ImGui::GetTextLineHeightWithSpacing();
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
itemMapping[ITEM_KEY_SMALL].name),
ImVec2(lineHeight, lineHeight));
ImGui::Image(
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(itemMapping[ITEM_KEY_SMALL].name),
ImVec2(lineHeight, lineHeight));
ImGui::SameLine();
PushStyleInput(THEME_COLOR);
if (ImGui::InputScalar("##Keys", ImGuiDataType_S8,
@@ -1975,6 +1990,6 @@ void SaveEditorWindow::DrawElement() {
}
void SaveEditorWindow::InitElement() {
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("ROCS_FEATHER", gRocsFeatherTex,
ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture("ROCS_FEATHER", gRocsFeatherTex, ImVec4(1, 1, 1, 1));
}
+44 -33
View File
@@ -18,6 +18,8 @@
#include "soh/Enhancements/randomizer/Traps.h"
#include "soh/Enhancements/randomizer/3drando/shops.hpp"
#include <fast/Fast3dGui.h>
extern "C" {
#include "include/z64item.h"
#include "objects/gameplay_keep/gameplay_keep.h"
@@ -306,8 +308,8 @@ ImVec4 plandomizerGetItemColor(Rando::Item randoItem) {
}
if (randoItem.GetItemType() == ITEMTYPE_SONG) {
uint32_t questID = Rando::Logic::RandoGetToQuestItem[randoItem.GetRandomizerGet()];
textureID = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
songMapping.at((QuestItem)questID).name);
textureID = std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(songMapping.at((QuestItem)questID).name);
itemColor = songMapping.at((QuestItem)questID).color;
imageSize = ImVec2(24.0f, 32.0f);
imagePadding = 6.0f;
@@ -380,17 +382,20 @@ void PlandomizerItemImageCorrection(Rando::Item randoItem) {
itemColor = plandomizerGetItemColor(randoItem);
if (randoItem.GetItemType() == ITEMTYPE_SMALLKEY || randoItem.GetItemType() == ITEMTYPE_FORTRESS_SMALLKEY) {
textureID = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("ITEM_KEY_SMALL");
textureID = std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName("ITEM_KEY_SMALL");
return;
}
if (randoItem.GetItemType() == ITEMTYPE_BOSSKEY) {
textureID = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("ITEM_KEY_BOSS");
textureID = std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName("ITEM_KEY_BOSS");
return;
}
for (auto& map : itemImageMap) {
if (map.first == randoItem.GetRandomizerGet()) {
textureID = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(map.second.c_str());
textureID = std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(map.second.c_str());
if (map.second.find("ITEM_ARROWS") != std::string::npos) {
textureUV0 = ImVec2(0, 1);
textureUV1 = ImVec2(1, 0);
@@ -404,17 +409,19 @@ void PlandomizerItemImageCorrection(Rando::Item randoItem) {
}
if (randoItem.GetRandomizerGet() >= RG_GOHMA_SOUL && randoItem.GetRandomizerGet() <= RG_GANON_SOUL) {
textureID = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("BOSS_SOUL");
textureID = std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName("BOSS_SOUL");
}
if (randoItem.GetRandomizerGet() >= RG_OCARINA_A_BUTTON &&
randoItem.GetRandomizerGet() <= RG_OCARINA_C_RIGHT_BUTTON) {
textureID = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("ITEM_OCARINA_TIME");
textureID = std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName("ITEM_OCARINA_TIME");
}
if (textureID == 0) {
textureID = Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
itemMapping[randoItem.GetGIEntry()->itemId].name);
textureID = std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(itemMapping[randoItem.GetGIEntry()->itemId].name);
}
}
@@ -974,11 +981,13 @@ void PlandomizerDrawOptions() {
for (auto& hash : plandoHash) {
ImGui::PushID(index);
textureID =
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(gSeedTextures[hash].tex);
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(gSeedTextures[hash].tex);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 2.0f));
auto upRet = ImGui::ImageButton(
"HASH_ARROW_UP",
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("HASH_ARROW_UP"),
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName("HASH_ARROW_UP"),
ImVec2(35.0f, 18.0f), ImVec2(1, 1), ImVec2(0, 0), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1));
ImGui::PopStyleVar();
if (upRet) {
@@ -992,7 +1001,8 @@ void PlandomizerDrawOptions() {
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 2.0f));
auto downRet = ImGui::ImageButton(
"HASH_ARROW_DWN",
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("HASH_ARROW_DWN"),
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName("HASH_ARROW_DWN"),
ImVec2(35.0f, 18.0f), ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1));
ImGui::PopStyleVar();
if (downRet) {
@@ -1171,25 +1181,26 @@ void PlandomizerWindow::DrawElement() {
}
void PlandomizerWindow::InitElement() {
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("ITEM_RUPEE_GRAYSCALE", gRupeeCounterIconTex,
ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("ITEM_HEART_GRAYSCALE", gHeartFullTex,
ImVec4(0.87f, 0.10f, 0.10f, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("ITEM_SEEDS", gItemIconDekuSeedsTex,
ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("ITEM_ARROWS_SMALL", gDropArrows1Tex,
ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("ITEM_ARROWS_MEDIUM", gDropArrows2Tex,
ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("ITEM_ARROWS_LARGE", gDropArrows3Tex,
ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("ITEM_ICE_TRAP", gMagicArrowEquipEffectTex,
ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("HASH_ARROW_UP", gEmptyCDownArrowTex,
ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("HASH_ARROW_DWN", gEmptyCDownArrowTex,
ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("BOSS_SOUL", gBossSoulTex, ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("TRIFORCE_PIECE", gTriforcePieceTex,
ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture("ITEM_RUPEE_GRAYSCALE", gRupeeCounterIconTex, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture("ITEM_HEART_GRAYSCALE", gHeartFullTex, ImVec4(0.87f, 0.10f, 0.10f, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture("ITEM_SEEDS", gItemIconDekuSeedsTex, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture("ITEM_ARROWS_SMALL", gDropArrows1Tex, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture("ITEM_ARROWS_MEDIUM", gDropArrows2Tex, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture("ITEM_ARROWS_LARGE", gDropArrows3Tex, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture("ITEM_ICE_TRAP", gMagicArrowEquipEffectTex, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture("HASH_ARROW_UP", gEmptyCDownArrowTex, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture("HASH_ARROW_DWN", gEmptyCDownArrowTex, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture("BOSS_SOUL", gBossSoulTex, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture("TRIFORCE_PIECE", gTriforcePieceTex, ImVec4(1, 1, 1, 1));
}
@@ -20,6 +20,8 @@
#include "soh/util.h"
#include "soh/Enhancements/randomizer/randomizer.h"
#include <fast/Fast3dGui.h>
extern "C" {
#include <z64.h>
#include "variables.h"
@@ -806,8 +808,8 @@ void DrawItemCount(ItemTrackerItem item, bool hideMax) {
void DrawEquip(ItemTrackerItem item) {
bool hasEquip = HasEquipment(item);
float iconSize = static_cast<float>(CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36));
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
hasEquip && IsValidSaveFile() ? item.name : item.nameFaded),
ImGui::Image(std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(hasEquip && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize, iconSize), ImVec2(0.0f, 0.0f), ImVec2(1, 1));
Tooltip(SohUtils::GetItemName(item.id).c_str());
@@ -817,8 +819,8 @@ void DrawQuest(ItemTrackerItem item) {
bool hasQuestItem = HasQuestItem(item);
float iconSize = static_cast<float>(CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36));
ImGui::BeginGroup();
ImGui::ImageWithBg(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
hasQuestItem && IsValidSaveFile() ? item.name : item.nameFaded),
ImGui::ImageWithBg(std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(hasQuestItem && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
if (item.id == QUEST_SKULL_TOKEN) {
@@ -1216,8 +1218,8 @@ void DrawItem(ItemTrackerItem item) {
ImGui::BeginGroup();
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
hasItem && IsValidSaveFile() ? item.name : item.nameFaded),
ImGui::Image(std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
DrawItemCount(item, false);
@@ -1302,8 +1304,8 @@ void DrawBottle(ItemTrackerItem item) {
}
float iconSize = static_cast<float>(CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36));
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
hasItem && IsValidSaveFile() ? item.name : item.nameFaded),
ImGui::Image(std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
Tooltip(SohUtils::GetItemName(item.id).c_str());
@@ -1318,12 +1320,12 @@ void DrawDungeonItem(ItemTrackerItem item) {
bool hasSmallKey = GameInteractor::IsSaveLoaded() ? ((gSaveContext.inventory.dungeonKeys[item.data]) >= 0) : false;
ImGui::BeginGroup();
if (itemId == ITEM_KEY_SMALL) {
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
hasSmallKey && IsValidSaveFile() ? item.name : item.nameFaded),
ImGui::Image(std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(hasSmallKey && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
} else {
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
hasItem && IsValidSaveFile() ? item.name : item.nameFaded),
ImGui::Image(std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
}
@@ -1368,8 +1370,8 @@ void DrawSong(ItemTrackerItem item) {
ImVec2 p = ImGui::GetCursorScreenPos();
bool hasSong = HasSong(item);
ImGui::SetCursorScreenPos(ImVec2(p.x + 6, p.y));
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
hasSong && IsValidSaveFile() ? item.name : item.nameFaded),
ImGui::Image(std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(hasSong && IsValidSaveFile() ? item.name : item.nameFaded),
ImVec2(iconSize / 1.5f, iconSize), ImVec2(0, 0), ImVec2(1, 1));
Tooltip(SohUtils::GetQuestItemName(item.id).c_str());
}
+19 -12
View File
@@ -10,6 +10,8 @@
#include <soh/SohGui/SohGui.hpp>
#include "soh/SohGui/UIWidgets.hpp"
#include <fast/Fast3dGui.h>
extern "C" {
#include "z64item.h"
#include "macros.h"
@@ -435,7 +437,8 @@ void TimeSplitsPopUpContext() {
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 2.0f));
ImGui::ImageButton(
"QUEST_SKULL_TOKEN",
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("QUEST_SKULL_TOKEN"),
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName("QUEST_SKULL_TOKEN"),
ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0));
ImGui::PopStyleVar();
ImGui::TableNextColumn();
@@ -488,7 +491,8 @@ void TimeSplitsPopUpContext() {
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 2.0f));
auto ret = ImGui::ImageButton(
popupObject.splitImage.c_str(),
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(popupObject.splitImage),
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(popupObject.splitImage),
ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), popupObject.splitTint);
ImGui::PopStyleVar();
if (ret) {
@@ -664,8 +668,9 @@ void TimeSplitsDrawSplitsList() {
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(imagePadding, imagePadding));
auto ret = ImGui::ImageButton(
split.splitImage.c_str(),
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(split.splitImage), imageSize,
ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), split.splitTint);
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(split.splitImage),
imageSize, ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), split.splitTint);
ImGui::PopStyleVar();
if (ret) {
TimeSplitsSkipSplit(dragIndex);
@@ -748,8 +753,9 @@ void TimeSplitsDrawItemList(uint32_t type) {
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(imagePadding, imagePadding));
auto ret = ImGui::ImageButton(
split.splitImage.c_str(),
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(split.splitImage), imageSize,
ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), split.splitTint);
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(split.splitImage),
imageSize, ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), split.splitTint);
ImGui::PopStyleVar();
if (ret) {
if (popupList.contains(split.splitID) && (split.splitType < SPLIT_TYPE_BOSS)) {
@@ -891,8 +897,9 @@ void TimeSplitsDrawManageList() {
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(imagePadding, imagePadding));
auto ret = ImGui::ImageButton(
data.splitImage.c_str(),
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(data.splitImage), imageSize,
ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), data.splitTint);
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(data.splitImage),
imageSize, ImVec2(0, 0), ImVec2(1, 1), ImVec4(0, 0, 0, 0), data.splitTint);
ImGui::PopStyleVar();
if (ret) {
removeIndex = index;
@@ -976,10 +983,10 @@ void TimeSplitWindow::DrawElement() {
void TimeSplitWindow::InitElement() {
TimeSplitsUpdateWindowSize();
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("SPECIAL_TRIFORCE_PIECE_WHITE",
gWTriforcePieceTex, ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("SPECIAL_SPLIT_ENTRANCE", gSplitEntranceTex,
ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture("SPECIAL_TRIFORCE_PIECE_WHITE", gWTriforcePieceTex, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture("SPECIAL_SPLIT_ENTRANCE", gSplitEntranceTex, ImVec4(1, 1, 1, 1));
Color_RGBA8 defaultColour = { 0, 0, 0, 255 };
windowColor = VecFromRGBA8(CVarGetColor(CVAR_ENHANCEMENT("TimeSplits.WindowColor.Value"), defaultColour));
+4 -1
View File
@@ -3,6 +3,8 @@
#include <libultraship/libultraship.h>
#include "soh/OTRGlobals.h"
#include <fast/Fast3dGui.h>
extern "C" {
#include "functions.h"
#include "macros.h"
@@ -88,7 +90,8 @@ void Window::Draw() {
ImGui::SetWindowPos(notificationPos);
if (notification.itemIcon != nullptr) {
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(notification.itemIcon),
ImGui::Image(std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetTextureByName(notification.itemIcon),
ImVec2(24, 24));
ImGui::SameLine();
}
+37 -13
View File
@@ -48,6 +48,9 @@
#include "Enhancements/custom-message/CustomMessageManager.h"
#include "util.h"
#include <fast/Fast3dGui.h>
#include <fast/debug/GfxDebugger.h>
#if not defined(__SWITCH__) && not defined(__WIIU__)
#include "Extractor/Extract.h"
#endif
@@ -777,6 +780,21 @@ void OTRGlobals::RunExtract(int argc, char* argv[]) {
#endif
}
void InitGfxDebugger() {
auto dbg =
std::dynamic_pointer_cast<Fast::Fast3dWindow>(Ship::Context::GetInstance()->GetWindow())->GetGfxDebugger();
if (dbg != nullptr) {
return;
}
dbg = std::make_shared<Fast::GfxDebugger>();
if (dbg != nullptr) {
SPDLOG_ERROR("Failed to initialize gfx debugger");
}
}
void OTRGlobals::Initialize() {
std::string mqPath = Ship::Context::LocateFileAcrossAppDirs("oot-mq.o2r", appShortName);
if (std::filesystem::exists(mqPath)) {
@@ -805,7 +823,7 @@ void OTRGlobals::Initialize() {
context->InitLogging(logLevel, logLevel);
Ship::Context::GetInstance()->GetLogger()->set_pattern("[%H:%M:%S.%e] [%s:%#] [%l] %v");
context->InitGfxDebugger();
InitGfxDebugger();
context->InitFileDropMgr();
// tell LUS to reserve 3 SoH specific threads (Game, Audio, Save)
@@ -1606,7 +1624,8 @@ extern "C" void Graph_StartFrame() {
switch (dwScancode) {
case KbScancode::LUS_KB_F1: {
std::shared_ptr<SohModalWindow> modal = static_pointer_cast<SohModalWindow>(
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Modal Window"));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetGuiWindow("Modal Window"));
if (modal->IsPopupOpen("Menu Moved")) {
modal->DismissPopup();
} else {
@@ -1619,8 +1638,9 @@ extern "C" void Graph_StartFrame() {
}
case KbScancode::LUS_KB_F5: {
if (CVarGetInteger(CVAR_CHEAT("SaveStatesEnabled"), 0) == 0) {
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(
6.0f, true, "Save states not enabled. Check Cheats Menu.");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetGameOverlay()
->TextDrawNotification(6.0f, true, "Save states not enabled. Check Cheats Menu.");
return;
}
const unsigned int slot = OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot();
@@ -1640,8 +1660,9 @@ extern "C" void Graph_StartFrame() {
}
case KbScancode::LUS_KB_F6: {
if (CVarGetInteger(CVAR_CHEAT("SaveStatesEnabled"), 0) == 0) {
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(
6.0f, true, "Save states not enabled. Check Cheats Menu.");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetGameOverlay()
->TextDrawNotification(6.0f, true, "Save states not enabled. Check Cheats Menu.");
return;
}
unsigned int slot = OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot();
@@ -1655,8 +1676,9 @@ extern "C" void Graph_StartFrame() {
}
case KbScancode::LUS_KB_F7: {
if (CVarGetInteger(CVAR_CHEAT("SaveStatesEnabled"), 0) == 0) {
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(
6.0f, true, "Save states not enabled. Check Cheats Menu.");
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetGameOverlay()
->TextDrawNotification(6.0f, true, "Save states not enabled. Check Cheats Menu.");
return;
}
const unsigned int slot = OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot();
@@ -2106,7 +2128,8 @@ extern "C" void OTRControllerCallback(uint8_t rumble) {
static std::shared_ptr<SohInputEditorWindow> controllerConfigWindow = nullptr;
if (controllerConfigWindow == nullptr) {
controllerConfigWindow = std::dynamic_pointer_cast<SohInputEditorWindow>(
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Controller Configuration"));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetGuiWindow("Controller Configuration"));
} else if (controllerConfigWindow->TestingRumble()) {
return;
}
@@ -2420,7 +2443,7 @@ bool SoH_HandleConfigDrop(char* filePath) {
}
}
auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui();
auto gui = std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui());
gui->GetGuiWindow("Console")->Hide();
gui->GetGuiWindow("Actor Viewer")->Hide();
gui->GetGuiWindow("Collision Viewer")->Hide();
@@ -2428,7 +2451,8 @@ bool SoH_HandleConfigDrop(char* filePath) {
gui->GetGuiWindow("Display List Viewer")->Hide();
gui->GetGuiWindow("Stats")->Hide();
std::dynamic_pointer_cast<Ship::ConsoleWindow>(
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->GetGuiWindow("Console"))
->ClearBindings();
Rando::Settings::GetInstance()->UpdateAllOptions();
@@ -2440,12 +2464,12 @@ bool SoH_HandleConfigDrop(char* filePath) {
return true;
} catch (std::exception& e) {
SPDLOG_ERROR("Failed to load config file: {}", e.what());
auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui();
auto gui = std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui());
gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Failed to load config file");
return false;
} catch (...) {
SPDLOG_ERROR("Failed to load config file");
auto gui = Ship::Context::GetInstance()->GetWindow()->GetGui();
auto gui = std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui());
gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Failed to load config file");
return false;
}
+2
View File
@@ -16,6 +16,8 @@
#include <fast/resource/ResourceType.h>
#include <fast/resource/type/DisplayList.h>
#include <stb_image.h>
extern "C" PlayState* gPlayState;
extern "C" uint32_t ResourceMgr_GetNumGameVersions() {
+1
View File
@@ -4,6 +4,7 @@
#include <libultraship/libultraship.h>
#ifdef __cplusplus
#include <set>
void LoadGuiTextures();
+36 -29
View File
@@ -5,6 +5,8 @@
#include "soh/Enhancements/randomizer/rando_hash.h"
#include "soh/Enhancements/randomizer/randomizerTypes.h"
#include <fast/Fast3dGui.h>
std::map<uint32_t, ItemMapEntry> itemMapping = {
ITEM_MAP_ENTRY(ITEM_STICK),
ITEM_MAP_ENTRY(ITEM_NUT),
@@ -215,68 +217,73 @@ const char* GetTextureForItemId(uint32_t itemId) {
void RegisterImGuiItemIcons() {
for (const auto& entry : itemMapping) {
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath,
ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(
entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
}
for (const auto& entry : gregMapping) {
ImVec4 gregGreen = ImVec4(42.0f / 255.0f, 169.0f / 255.0f, 40.0f / 255.0f, 1.0f);
ImVec4 gregFadedGreen = gregGreen;
gregFadedGreen.w = 0.3f;
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath,
gregGreen);
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded,
entry.second.texturePath, gregFadedGreen);
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture(entry.second.name, entry.second.texturePath, gregGreen);
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, gregFadedGreen);
}
for (const auto& entry : actionShuffleMapping) {
ImVec4 aButtonBlue = ImVec4(90.f / 255.f, 90.f / 250.f, 255.f / 255.f, 255.f / 255.f);
ImVec4 aButtonBlueFaded = aButtonBlue;
aButtonBlueFaded.w = 0.3f;
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath,
aButtonBlue);
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded,
entry.second.texturePath, aButtonBlueFaded);
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture(entry.second.name, entry.second.texturePath, aButtonBlue);
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, aButtonBlueFaded);
}
for (const auto& entry : customItemsMapping) {
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath,
ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(
entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
}
for (const auto& entry : jabbernutMapping) {
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath,
ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(
entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
}
for (const auto& entry : questMapping) {
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.name, entry.second.texturePath,
ImVec4(1, 1, 1, 1));
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(
entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture(entry.second.name, entry.second.texturePath, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
}
for (const auto& [quest, entry] : songMapping) {
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.name, gSongNoteTex, entry.color);
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture(entry.name, gSongNoteTex, entry.color);
ImVec4 fadedCol = entry.color;
fadedCol.w = 0.3f;
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.nameFaded, gSongNoteTex, fadedCol);
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture(entry.nameFaded, gSongNoteTex, fadedCol);
}
for (const auto& entry : vanillaSongMapping) {
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.name, gSongNoteTex, entry.color);
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture(entry.name, gSongNoteTex, entry.color);
ImVec4 fadedCol = entry.color;
fadedCol.w = 0.3f;
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.nameFaded, gSongNoteTex, fadedCol);
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture(entry.nameFaded, gSongNoteTex, fadedCol);
}
for (const auto& entry : gSeedTextures) {
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.tex, entry.tex, ImVec4(1, 1, 1, 1));
std::dynamic_pointer_cast<Fast::Fast3dGui>(Ship::Context::GetInstance()->GetWindow()->GetGui())
->LoadGuiTexture(entry.tex, entry.tex, ImVec4(1, 1, 1, 1));
}
}
+4 -3
View File
@@ -99,17 +99,18 @@ void Menu::RemoveSidebarSearch() {
}
void Menu::UpdateWindowBackendObjects() {
Ship::WindowBackend runningWindowBackend = Ship::Context::GetInstance()->GetWindow()->GetWindowBackend();
Fast::WindowBackend runningWindowBackend =
(Fast::WindowBackend)Ship::Context::GetInstance()->GetWindow()->GetWindowBackend();
int32_t configWindowBackendId = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.Backend.Id", -1);
if (Ship::Context::GetInstance()->GetWindow()->IsAvailableWindowBackend(configWindowBackendId)) {
configWindowBackend = static_cast<Ship::WindowBackend>(configWindowBackendId);
configWindowBackend = static_cast<Fast::WindowBackend>(configWindowBackendId);
} else {
configWindowBackend = runningWindowBackend;
}
availableWindowBackends = Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends();
for (auto& backend : *availableWindowBackends) {
availableWindowBackendsMap[backend] = windowBackendsMap.at(backend);
availableWindowBackendsMap[(Fast::WindowBackend)backend] = windowBackendsMap.at((Fast::WindowBackend)backend);
}
}
+3 -3
View File
@@ -39,9 +39,9 @@ class Menu : public GuiWindow {
ImGuiTextFilter menuSearch;
uint8_t searchSidebarIndex;
UIWidgets::Colors defaultThemeIndex;
std::shared_ptr<std::vector<Ship::WindowBackend>> availableWindowBackends;
std::map<Ship::WindowBackend, const char*> availableWindowBackendsMap;
Ship::WindowBackend configWindowBackend;
std::shared_ptr<std::vector<int32_t>> availableWindowBackends;
std::map<Fast::WindowBackend, const char*> availableWindowBackendsMap;
Fast::WindowBackend configWindowBackend;
std::unordered_map<uint32_t, disabledInfo> disabledMap;
std::vector<disabledInfo> disabledVector;
+5 -4
View File
@@ -2,6 +2,7 @@
#define MENUTYPES_H
#include <libultraship/libultraship.h>
#include <fast/Fast3dWindow.h>
#include "UIWidgets.hpp"
typedef enum {
@@ -271,10 +272,10 @@ static const std::map<Ship::AudioBackend, const char*> audioBackendsMap = {
{ Ship::AudioBackend::NUL, "Null" },
};
static const std::map<Ship::WindowBackend, const char*> windowBackendsMap = {
{ Ship::WindowBackend::FAST3D_DXGI_DX11, "DirectX" },
{ Ship::WindowBackend::FAST3D_SDL_OPENGL, "OpenGL" },
{ Ship::WindowBackend::FAST3D_SDL_METAL, "Metal" },
static const std::map<Fast::WindowBackend, const char*> windowBackendsMap = {
{ Fast::WindowBackend::FAST3D_DXGI_DX11, "DirectX" },
{ Fast::WindowBackend::FAST3D_SDL_OPENGL, "OpenGL" },
{ Fast::WindowBackend::FAST3D_SDL_METAL, "Metal" },
};
struct MenuInit {
+2 -2
View File
@@ -124,13 +124,13 @@ void SohMenu::InitElement() {
{ DISABLE_FOR_NOT_DIRECTX,
{ [](disabledInfo& info) -> bool {
return Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() !=
Ship::WindowBackend::FAST3D_DXGI_DX11;
Fast::WindowBackend::FAST3D_DXGI_DX11;
},
"Available Only on DirectX" } },
{ DISABLE_FOR_DIRECTX,
{ [](disabledInfo& info) -> bool {
return Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() ==
Ship::WindowBackend::FAST3D_DXGI_DX11;
Fast::WindowBackend::FAST3D_DXGI_DX11;
},
"Not Available on DirectX" } },
{ DISABLE_FOR_MATCH_REFRESH_RATE_ON,
+2 -2
View File
@@ -26,7 +26,7 @@ GameState* gGameState;
// Forward declared, because this in a C++ header.
int gfx_create_framebuffer(uint32_t width, uint32_t height, uint32_t native_width, uint32_t native_height,
uint8_t resize);
uint8_t resize, bool forceFixedAspect);
void gfx_texture_cache_clear();
void GameState_FaultPrint(void) {
@@ -260,7 +260,7 @@ void GameState_Update(GameState* gameState) {
if (gPauseLinkFrameBuffer == -1) {
gPauseLinkFrameBuffer = gfx_create_framebuffer(PAUSE_EQUIP_PLAYER_WIDTH, PAUSE_EQUIP_PLAYER_HEIGHT,
PAUSE_EQUIP_PLAYER_WIDTH, PAUSE_EQUIP_PLAYER_HEIGHT, true);
PAUSE_EQUIP_PLAYER_WIDTH, PAUSE_EQUIP_PLAYER_HEIGHT, true, true);
}
GameState_SetFrameBuffer(gfxCtx);