mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-05-24 15:21:22 -04:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4aaad850bd | |||
| cf275b1a6c | |||
| 0014f40676 | |||
| f015a1b339 | |||
| b2090dcf83 | |||
| ebf8a3b47f | |||
| f3b0d8e230 | |||
| 1ba6cf643d | |||
| b30191f369 | |||
| a419b431a7 | |||
| 48f4f56bac | |||
| 1b29c0cad3 | |||
| 74312442d5 | |||
| ad2807ce32 |
@@ -0,0 +1,20 @@
|
||||
set(SPDLOG_LEVEL_TRACE 0)
|
||||
set(SPDLOG_LEVEL_DEBUG 1)
|
||||
set(SPDLOG_LEVEL_INFO 2)
|
||||
set(SPDLOG_LEVEL_WARN 3)
|
||||
set(SPDLOG_LEVEL_ERROR 4)
|
||||
set(SPDLOG_LEVEL_CRITICAL 5)
|
||||
set(SPDLOG_LEVEL_OFF 6)
|
||||
set(LOG_LEVELS "SPDLOG_LEVEL_TRACE;SPDLOG_LEVEL_DEBUG;SPDLOG_LEVEL_INFO;SPDLOG_LEVEL_WARN;SPDLOG_LEVEL_ERROR;SPDLOG_LEVEL_CRITICAL;SPDLOG_LEVEL_OFF")
|
||||
set(LOG_LEVEL SPDLOG_LEVEL_TRACE CACHE STRING "The spdlog level that prints will be logged out. Overridden to SPDLOG_LEVEL_ERROR on Release builds.")
|
||||
set_property(CACHE LOG_LEVEL PROPERTY STRINGS ${LOG_LEVELS})
|
||||
if(NOT LOG_LEVEL IN_LIST LOG_LEVELS)
|
||||
message(FATAL_ERROR "LOG_LEVEL must be one of ${LOG_LEVELS}")
|
||||
endif()
|
||||
set(SPDLOG_ACTIVE_LEVEL ${${LOG_LEVEL}})
|
||||
set(LOG_LEVEL_GAME_PRINTS ${SPDLOG_LEVEL_OFF})
|
||||
|
||||
add_compile_definitions(
|
||||
LOG_LEVEL_GAME_PRINTS=${LOG_LEVEL_GAME_PRINTS}
|
||||
SPDLOG_ACTIVE_LEVEL=${SPDLOG_ACTIVE_LEVEL}
|
||||
)
|
||||
+2
-1
@@ -6,9 +6,10 @@ set(CMAKE_C_STANDARD 23 CACHE STRING "The C standard to use")
|
||||
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
|
||||
|
||||
project(Ship VERSION 9.1.0 LANGUAGES C CXX)
|
||||
project(Ship VERSION 9.1.1 LANGUAGES C CXX)
|
||||
include(CMake/soh-cvars.cmake)
|
||||
include(CMake/lus-cvars.cmake)
|
||||
include(CMake/logging.cmake)
|
||||
|
||||
option(SUPPRESS_WARNINGS "Suppress warnings in LUS and src (decomp)" ON)
|
||||
if(SUPPRESS_WARNINGS)
|
||||
|
||||
+1
-1
Submodule libultraship updated: 5f4be9b6f5...17a0b7939b
@@ -16,6 +16,7 @@
|
||||
"ClimbSpeed": 3,
|
||||
"CrawlSpeed": 2,
|
||||
"CreditsFix": 1,
|
||||
"CuccosToReturn": 1,
|
||||
"CustomizeFishing": 1,
|
||||
"CustomizeFrogsOcarinaGame": 1,
|
||||
"CustomizeOcarinaGame": 1,
|
||||
|
||||
@@ -13,8 +13,8 @@ extern "C"
|
||||
#include <libultraship/log/luslog.h>
|
||||
#include <soh/Enhancements/item-tables/ItemTableTypes.h>
|
||||
|
||||
#if defined(INCLUDE_GAME_PRINTF) && defined(_DEBUG)
|
||||
#define osSyncPrintf(fmt, ...) lusprintf(__FILE__, __LINE__, 0, fmt, ##__VA_ARGS__)
|
||||
#if (LOG_LEVEL_GAME_PRINTS >= SPDLOG_ACTIVE_LEVEL) && !(LOG_LEVEL_GAME_PRINTS >= 6)
|
||||
#define osSyncPrintf(...) lusprintf(__FILE__, __LINE__, LOG_LEVEL_GAME_PRINTS , __VA_ARGS__)
|
||||
#else
|
||||
#define osSyncPrintf(fmt, ...) osSyncPrintfUnused(fmt, ##__VA_ARGS__)
|
||||
#endif
|
||||
@@ -2457,10 +2457,6 @@ void Interface_RandoRestoreSwordless(void);
|
||||
s32 Ship_CalcShouldDrawAndUpdate(PlayState* play, Actor* actor, Vec3f* projectedPos, f32 projectedW, bool* shouldDraw,
|
||||
bool* shouldUpdate);
|
||||
|
||||
//Pause Warp
|
||||
void PauseWarp_HandleSelection();
|
||||
void PauseWarp_Execute();
|
||||
|
||||
// #endregion
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
#include "soh/Enhancements/mods.h"
|
||||
#include "soh/ShipInit.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include "align_asset_macro.h"
|
||||
#include "macros.h"
|
||||
#include "variables.h"
|
||||
#include "soh/ResourceManagerHelpers.h"
|
||||
extern PlayState* gPlayState;
|
||||
}
|
||||
|
||||
static constexpr int32_t CVAR_TOT_MEDALLION_COLORS_DEFAULT = 0;
|
||||
#define CVAR_TOT_MEDALLION_COLORS_NAME CVAR_ENHANCEMENT("ToTMedallionsColors")
|
||||
#define CVAR_TOT_MEDALLION_COLORS_VALUE \
|
||||
CVarGetInteger(CVAR_TOT_MEDALLION_COLORS_NAME, CVAR_TOT_MEDALLION_COLORS_DEFAULT)
|
||||
|
||||
// GreyScaleEndDlist
|
||||
#define dgEndGrayscaleAndEndDlistDL "__OTR__helpers/cosmetics/gEndGrayscaleAndEndDlistDL"
|
||||
static const ALIGN_ASSET(2) char gEndGrayscaleAndEndDlistDL[] = dgEndGrayscaleAndEndDlistDL;
|
||||
|
||||
// This is used for the Temple of Time Medalions' color
|
||||
#define dtokinoma_room_0DL_007A70 "__OTR__scenes/shared/tokinoma_scene/tokinoma_room_0DL_007A70"
|
||||
static const ALIGN_ASSET(2) char tokinoma_room_0DL_007A70[] = dtokinoma_room_0DL_007A70;
|
||||
#define dtokinoma_room_0DL_007FD0 "__OTR__scenes/shared/tokinoma_scene/tokinoma_room_0DL_007FD0"
|
||||
static const ALIGN_ASSET(2) char tokinoma_room_0DL_007FD0[] = dtokinoma_room_0DL_007FD0;
|
||||
|
||||
static Gfx grayscaleWhite = gsDPSetGrayscaleColor(255, 255, 255, 255);
|
||||
|
||||
class ToTPatchSetup {
|
||||
public:
|
||||
ToTPatchSetup(Gfx ifColored, const char* patchName, int index, const char* patchName2 = "", int index2 = 0)
|
||||
: patchName(patchName), index(index), ifColored(ifColored), patchName2(patchName2), index2(index2) {
|
||||
}
|
||||
|
||||
void ApplyPatch(bool colored = true) {
|
||||
Gfx colorGfx = colored ? ifColored : grayscaleWhite;
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007A70, patchName, index, colorGfx);
|
||||
if (patchName2 && *patchName2) {
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007FD0, patchName2, index2, colorGfx);
|
||||
}
|
||||
}
|
||||
|
||||
void RevertPatch() {
|
||||
ResourceMgr_UnpatchGfxByName(tokinoma_room_0DL_007A70, patchName);
|
||||
if (patchName2 && *patchName2) {
|
||||
ResourceMgr_UnpatchGfxByName(tokinoma_room_0DL_007FD0, patchName2);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
const char* patchName;
|
||||
const char* patchName2;
|
||||
int index;
|
||||
int index2;
|
||||
Gfx ifColored;
|
||||
};
|
||||
|
||||
typedef struct MedallionColorPatch {
|
||||
QuestItem questItemId;
|
||||
ToTPatchSetup patch;
|
||||
} MedallionColorPatch;
|
||||
|
||||
static ToTPatchSetup startGrayscale =
|
||||
ToTPatchSetup(gsSPGrayscale(true), "ToTMedallions_StartGrayscale", 7, "ToTMedallions_2_StartGrayscale", 7);
|
||||
|
||||
static MedallionColorPatch medallionColorPatches[] = {
|
||||
{ QUEST_MEDALLION_WATER, ToTPatchSetup(gsDPSetGrayscaleColor(0, 161, 255, 255), "ToTMedallions_MakeBlue", 16) },
|
||||
{ QUEST_MEDALLION_SPIRIT, ToTPatchSetup(gsDPSetGrayscaleColor(255, 135, 0, 255), "ToTMedallions_MakeOrange", 45) },
|
||||
{ QUEST_MEDALLION_LIGHT, ToTPatchSetup(gsDPSetGrayscaleColor(255, 255, 0, 255), "ToTMedallions_MakeYellow", 69,
|
||||
"ToTMedallions_2_MakeYellow", 16) },
|
||||
{ QUEST_MEDALLION_FOREST, ToTPatchSetup(gsDPSetGrayscaleColor(0, 255, 0, 255), "ToTMedallions_MakeGreen", 94) },
|
||||
{ QUEST_MEDALLION_FIRE, ToTPatchSetup(gsDPSetGrayscaleColor(255, 0, 0, 255), "ToTMedallions_MakeRed", 118) },
|
||||
{ QUEST_MEDALLION_SHADOW, ToTPatchSetup(gsDPSetGrayscaleColor(212, 0, 255, 255), "ToTMedallions_MakePurple", 142,
|
||||
"ToTMedallions_2_MakePurple", 27) },
|
||||
};
|
||||
|
||||
static ToTPatchSetup endGrayscale =
|
||||
ToTPatchSetup(gsSPBranchListOTRFilePath(gEndGrayscaleAndEndDlistDL), "ToTMedallions_EndGrayscaleAndEndDlist", 160,
|
||||
"ToTMedallions_2_EndGrayscaleAndEndDlist", 51);
|
||||
|
||||
static void PatchToTMedallions() {
|
||||
// TODO: Refactor the DemoEffect_UpdateJewelAdult and DemoEffect_UpdateJewelChild from z_demo_effect
|
||||
// effects to take effect in there
|
||||
startGrayscale.ApplyPatch();
|
||||
|
||||
for (auto& medallionPatch : medallionColorPatches) {
|
||||
medallionPatch.patch.ApplyPatch(CHECK_QUEST_ITEM(medallionPatch.questItemId));
|
||||
}
|
||||
|
||||
endGrayscale.ApplyPatch();
|
||||
}
|
||||
|
||||
static void ResetToTMedallions() {
|
||||
// Unpatch everything
|
||||
startGrayscale.RevertPatch();
|
||||
|
||||
for (auto& medallionPatch : medallionColorPatches) {
|
||||
medallionPatch.patch.RevertPatch();
|
||||
}
|
||||
|
||||
endGrayscale.RevertPatch();
|
||||
}
|
||||
|
||||
void UpdateToTMedallions() {
|
||||
if (CVAR_TOT_MEDALLION_COLORS_VALUE) {
|
||||
PatchToTMedallions();
|
||||
} else {
|
||||
ResetToTMedallions();
|
||||
}
|
||||
}
|
||||
|
||||
static void CheckTempleOfTime(int16_t sceneNum) {
|
||||
if (sceneNum != SCENE_TEMPLE_OF_TIME) {
|
||||
return;
|
||||
}
|
||||
PatchToTMedallions();
|
||||
}
|
||||
|
||||
static void RegisterToTMedallions() {
|
||||
COND_HOOK(OnItemReceive, CVAR_TOT_MEDALLION_COLORS_VALUE, [](GetItemEntry) {
|
||||
if (gPlayState) {
|
||||
CheckTempleOfTime(gPlayState->sceneNum);
|
||||
}
|
||||
});
|
||||
COND_HOOK(OnSceneInit, CVAR_TOT_MEDALLION_COLORS_VALUE, CheckTempleOfTime);
|
||||
}
|
||||
|
||||
static RegisterShipInitFunc initFunc(RegisterToTMedallions, { CVAR_TOT_MEDALLION_COLORS_NAME });
|
||||
@@ -1,8 +1,21 @@
|
||||
#include "custom-message/CustomMessageTypes.h"
|
||||
#include "global.h"
|
||||
#include "z64.h"
|
||||
#include "game-interactor/GameInteractor.h"
|
||||
#include "soh/OTRGlobals.h"
|
||||
#include <string>
|
||||
#include "soh/Enhancements/custom-message/CustomMessageTypes.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
#include "soh/ShipInit.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include "functions.h"
|
||||
#include "macros.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern PlayState* gPlayState;
|
||||
|
||||
u8 Randomizer_GetSettingValue(RandomizerSettingKey);
|
||||
}
|
||||
|
||||
static constexpr int32_t CVAR_PAUSE_WARP_DEFAULT = 0;
|
||||
#define CVAR_PAUSE_WARP_NAME CVAR_ENHANCEMENT("PauseWarp")
|
||||
#define CVAR_PAUSE_WARP_VALUE CVarGetInteger(CVAR_PAUSE_WARP_NAME, CVAR_PAUSE_WARP_DEFAULT)
|
||||
|
||||
static const int songMessageMap[] = {
|
||||
TEXT_WARP_MINUET_OF_FOREST, TEXT_WARP_BOLERO_OF_FIRE, TEXT_WARP_SERENADE_OF_WATER,
|
||||
@@ -30,7 +43,7 @@ static const int songAudioMap[] = {
|
||||
|
||||
static bool isWarpActive = false;
|
||||
|
||||
void PauseWarp_Execute() {
|
||||
static void PauseWarp_Execute() {
|
||||
if (!isWarpActive || gPlayState->msgCtx.msgMode != MSGMODE_NONE) {
|
||||
return;
|
||||
}
|
||||
@@ -48,13 +61,14 @@ void PauseWarp_Execute() {
|
||||
for (int i = 0; i < ARRAY_COUNT(ocarinaSongMap); i++) {
|
||||
if (gPlayState->msgCtx.lastPlayedSong == ocarinaSongMap[i]) {
|
||||
gPlayState->nextEntranceIndex = entranceIndexMap[i];
|
||||
func_80088AF0(gPlayState);
|
||||
return;
|
||||
}
|
||||
}
|
||||
gPlayState->transitionTrigger = TRANS_TRIGGER_OFF;
|
||||
}
|
||||
|
||||
void ActivateWarp(PauseContext* pauseCtx, int song) {
|
||||
static void ActivateWarp(PauseContext* pauseCtx, int song) {
|
||||
Audio_OcaSetInstrument(0);
|
||||
Interface_SetDoAction(gPlayState, DO_ACTION_NONE);
|
||||
pauseCtx->state = 0x12;
|
||||
@@ -70,7 +84,7 @@ void ActivateWarp(PauseContext* pauseCtx, int song) {
|
||||
isWarpActive = true;
|
||||
}
|
||||
|
||||
void PauseWarp_HandleSelection() {
|
||||
static void PauseWarp_HandleSelection() {
|
||||
if (gSaveContext.inventory.items[SLOT_OCARINA] != ITEM_NONE) {
|
||||
int aButtonPressed = CHECK_BTN_ALL(gPlayState->state.input->press.button, BTN_A);
|
||||
int song = gPlayState->pauseCtx.cursorPoint[PAUSE_QUEST];
|
||||
@@ -122,3 +136,18 @@ void PauseWarp_HandleSelection() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void RegisterPauseMenuHooks() {
|
||||
COND_HOOK(OnKaleidoUpdate, CVAR_PAUSE_WARP_VALUE, [] {
|
||||
if (GameInteractor::IsSaveLoaded()) {
|
||||
PauseWarp_HandleSelection();
|
||||
}
|
||||
});
|
||||
COND_HOOK(OnGameFrameUpdate, CVAR_PAUSE_WARP_VALUE, [] {
|
||||
if (GameInteractor::IsSaveLoaded()) {
|
||||
PauseWarp_Execute();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static RegisterShipInitFunc initFunc(RegisterPauseMenuHooks, { CVAR_PAUSE_WARP_NAME });
|
||||
@@ -55,6 +55,7 @@ void SetEnabledModsCVarValue() {
|
||||
}
|
||||
|
||||
CVarSetString(CVAR_ENABLED_MODS_NAME, s.c_str());
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
|
||||
}
|
||||
|
||||
void AfterModChange() {
|
||||
@@ -128,8 +129,9 @@ void UpdateModFiles(bool init = false, bool reset = false) {
|
||||
disabledModFiles.clear();
|
||||
unsupportedFiles.clear();
|
||||
filePaths.clear();
|
||||
std::string modsPath = Ship::Context::LocateFileAcrossAppDirs("mods", appShortName);
|
||||
bool changed = false;
|
||||
std::string modsPath = Ship::Context::LocateFileAcrossAppDirs("mods", appShortName);
|
||||
std::map<std::string, std::string> tempMods;
|
||||
if (modsPath.length() > 0 && std::filesystem::exists(modsPath)) {
|
||||
std::vector<std::filesystem::path> enabledFiles;
|
||||
if (std::filesystem::is_directory(modsPath)) {
|
||||
@@ -147,11 +149,17 @@ void UpdateModFiles(bool init = false, bool reset = false) {
|
||||
bool enabled =
|
||||
std::find(enabledModFiles.begin(), enabledModFiles.end(), filename) != enabledModFiles.end();
|
||||
if (!enabled) {
|
||||
enabledModFiles.push_back(filename);
|
||||
changed = true;
|
||||
tempMods.emplace(p.path().lexically_normal().generic_string(), filename);
|
||||
}
|
||||
filePaths.emplace(filename, p.path());
|
||||
}
|
||||
if (tempMods.size() > 0) {
|
||||
changed = true;
|
||||
for (auto [path, name] : tempMods) {
|
||||
enabledModFiles.push_back(name);
|
||||
}
|
||||
tempMods.clear();
|
||||
}
|
||||
if (init) {
|
||||
std::vector<std::string> enabledTemp(enabledModFiles);
|
||||
for (std::string mod : enabledTemp) {
|
||||
@@ -159,13 +167,14 @@ void UpdateModFiles(bool init = false, bool reset = false) {
|
||||
GetArchiveManager()->AddArchive(filePaths.at(mod).generic_string());
|
||||
} else {
|
||||
enabledModFiles.erase(std::find(enabledModFiles.begin(), enabledModFiles.end(), mod));
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
SetEnabledModsCVarValue();
|
||||
if (changed) {
|
||||
SetEnabledModsCVarValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +214,7 @@ void DrawMods(bool enabled) {
|
||||
int switchToIndex = -1;
|
||||
uint32_t index = 0;
|
||||
|
||||
for (int i = selectedModFiles.size() - 1; i >= 0; i--) {
|
||||
for (int i = static_cast<int>(selectedModFiles.size()) - 1; i >= 0; i--) {
|
||||
std::string file = selectedModFiles[i];
|
||||
if (enabled) {
|
||||
ImGui::BeginGroup();
|
||||
@@ -365,7 +374,7 @@ void RegisterModMenuWidgets() {
|
||||
auto options = std::static_pointer_cast<UIWidgets::CheckboxOptions>(info.options);
|
||||
options->disabled = editing;
|
||||
});
|
||||
SohGui::mSohMenu->AddSearchWidget({ enableModsWidget, "Settings", "Mod Menu", "Top", "alternat assets" });
|
||||
SohGui::mSohMenu->AddSearchWidget({ enableModsWidget, "Settings", "Mod Menu", "Top", "alternate assets" });
|
||||
|
||||
tabHotkeyWidget = { .name = "Mods Tab Hotkey", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||
tabHotkeyWidget.CVar(CVAR_SETTING("Mods.AlternateAssetsHotkey"))
|
||||
@@ -375,7 +384,7 @@ void RegisterModMenuWidgets() {
|
||||
.Tooltip("Allows pressing the Tab key to toggle mods")
|
||||
.DefaultValue(true));
|
||||
SohGui::mSohMenu->AddSearchWidget(
|
||||
{ enableModsWidget, "Settings", "Mod Menu", "Top", "alternat assets tab hotkey" });
|
||||
{ tabHotkeyWidget, "Settings", "Mod Menu", "Top", "alternate assets tab hotkey" });
|
||||
}
|
||||
|
||||
static RegisterMenuInitFunc menuInitFunc(RegisterModMenuWidgets);
|
||||
|
||||
@@ -49,16 +49,6 @@ extern SaveContext gSaveContext;
|
||||
extern PlayState* gPlayState;
|
||||
}
|
||||
|
||||
// GreyScaleEndDlist
|
||||
#define dgEndGrayscaleAndEndDlistDL "__OTR__helpers/cosmetics/gEndGrayscaleAndEndDlistDL"
|
||||
static const ALIGN_ASSET(2) char gEndGrayscaleAndEndDlistDL[] = dgEndGrayscaleAndEndDlistDL;
|
||||
|
||||
// This is used for the Temple of Time Medalions' color
|
||||
#define dtokinoma_room_0DL_007A70 "__OTR__scenes/shared/tokinoma_scene/tokinoma_room_0DL_007A70"
|
||||
static const ALIGN_ASSET(2) char tokinoma_room_0DL_007A70[] = dtokinoma_room_0DL_007A70;
|
||||
#define dtokinoma_room_0DL_007FD0 "__OTR__scenes/shared/tokinoma_scene/tokinoma_room_0DL_007FD0"
|
||||
static const ALIGN_ASSET(2) char tokinoma_room_0DL_007FD0[] = dtokinoma_room_0DL_007FD0;
|
||||
|
||||
/// Switches Link's age and respawns him at the last entrance he entered.
|
||||
void SwitchAge() {
|
||||
if (gPlayState == NULL)
|
||||
@@ -741,107 +731,6 @@ void RegisterRandomizedEnemySizes() {
|
||||
});
|
||||
}
|
||||
|
||||
void PatchToTMedallions() {
|
||||
// TODO: Refactor the DemoEffect_UpdateJewelAdult and DemoEffect_UpdateJewelChild from z_demo_effect
|
||||
// effects to take effect in there
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("ToTMedallionsColors"), 0)) {
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_StartGrayscale", 7, gsSPGrayscale(true));
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007FD0, "ToTMedallions_2_StartGrayscale", 7, gsSPGrayscale(true));
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER)) {
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_MakeBlue", 16,
|
||||
gsDPSetGrayscaleColor(0, 161, 255, 255));
|
||||
} else {
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_MakeBlue", 16,
|
||||
gsDPSetGrayscaleColor(255, 255, 255, 255));
|
||||
}
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) {
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_MakeOrange", 45,
|
||||
gsDPSetGrayscaleColor(255, 135, 0, 255));
|
||||
} else {
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_MakeOrange", 45,
|
||||
gsDPSetGrayscaleColor(255, 255, 255, 255));
|
||||
}
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_LIGHT)) {
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_MakeYellow", 69,
|
||||
gsDPSetGrayscaleColor(255, 255, 0, 255));
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007FD0, "ToTMedallions_2_MakeYellow", 16,
|
||||
gsDPSetGrayscaleColor(255, 255, 0, 255));
|
||||
} else {
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_MakeYellow", 69,
|
||||
gsDPSetGrayscaleColor(255, 255, 255, 255));
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007FD0, "ToTMedallions_2_MakeYellow", 16,
|
||||
gsDPSetGrayscaleColor(255, 255, 255, 255));
|
||||
}
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST)) {
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_MakeGreen", 94,
|
||||
gsDPSetGrayscaleColor(0, 255, 0, 255));
|
||||
} else {
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_MakeGreen", 94,
|
||||
gsDPSetGrayscaleColor(255, 255, 255, 255));
|
||||
}
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) {
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_MakeRed", 118,
|
||||
gsDPSetGrayscaleColor(255, 0, 0, 255));
|
||||
} else {
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_MakeRed", 118,
|
||||
gsDPSetGrayscaleColor(255, 255, 255, 255));
|
||||
}
|
||||
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW)) {
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_MakePurple", 142,
|
||||
gsDPSetGrayscaleColor(212, 0, 255, 255));
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007FD0, "ToTMedallions_2_MakePurple", 27,
|
||||
gsDPSetGrayscaleColor(212, 0, 255, 255));
|
||||
} else {
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_MakePurple", 142,
|
||||
gsDPSetGrayscaleColor(255, 255, 255, 255));
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007FD0, "ToTMedallions_2_MakePurple", 27,
|
||||
gsDPSetGrayscaleColor(255, 255, 255, 255));
|
||||
}
|
||||
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_EndGrayscaleAndEndDlist", 160,
|
||||
gsSPBranchListOTRFilePath(gEndGrayscaleAndEndDlistDL));
|
||||
ResourceMgr_PatchGfxByName(tokinoma_room_0DL_007FD0, "ToTMedallions_2_EndGrayscaleAndEndDlist", 51,
|
||||
gsSPBranchListOTRFilePath(gEndGrayscaleAndEndDlistDL));
|
||||
} else {
|
||||
// Unpatch everything
|
||||
ResourceMgr_UnpatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_StartGrayscale");
|
||||
ResourceMgr_UnpatchGfxByName(tokinoma_room_0DL_007FD0, "ToTMedallions_2_StartGrayscale");
|
||||
|
||||
ResourceMgr_UnpatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_MakeBlue");
|
||||
ResourceMgr_UnpatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_MakeOrange");
|
||||
ResourceMgr_UnpatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_MakeYellow");
|
||||
ResourceMgr_UnpatchGfxByName(tokinoma_room_0DL_007FD0, "ToTMedallions_2_MakeYellow");
|
||||
ResourceMgr_UnpatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_MakeRed");
|
||||
ResourceMgr_UnpatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_MakePurple");
|
||||
ResourceMgr_UnpatchGfxByName(tokinoma_room_0DL_007FD0, "ToTMedallions_2_MakePurple");
|
||||
|
||||
ResourceMgr_UnpatchGfxByName(tokinoma_room_0DL_007A70, "ToTMedallions_EndGrayscaleAndEndDlist");
|
||||
ResourceMgr_UnpatchGfxByName(tokinoma_room_0DL_007FD0, "ToTMedallions_2_EndGrayscaleAndEndDlist");
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterToTMedallions() {
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnItemReceive>([](GetItemEntry _unused) {
|
||||
if (!CVarGetInteger(CVAR_ENHANCEMENT("ToTMedallionsColors"), 0) || !gPlayState ||
|
||||
gPlayState->sceneNum != SCENE_TEMPLE_OF_TIME) {
|
||||
return;
|
||||
}
|
||||
PatchToTMedallions();
|
||||
});
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnSceneInit>([](int16_t sceneNum) {
|
||||
if (!CVarGetInteger(CVAR_ENHANCEMENT("ToTMedallionsColors"), 0) || sceneNum != SCENE_TEMPLE_OF_TIME) {
|
||||
return;
|
||||
}
|
||||
PatchToTMedallions();
|
||||
});
|
||||
}
|
||||
|
||||
void RegisterFloorSwitchesHook() {
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnActorInit>([](void* refActor) {
|
||||
Actor* actor = static_cast<Actor*>(refActor);
|
||||
@@ -858,23 +747,6 @@ void RegisterFloorSwitchesHook() {
|
||||
});
|
||||
}
|
||||
|
||||
void RegisterPauseMenuHooks() {
|
||||
static bool pauseWarpHooksRegistered = false;
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameFrameUpdate>([&]() {
|
||||
if (!GameInteractor::IsSaveLoaded() || !CVarGetInteger(CVAR_ENHANCEMENT("PauseWarp"), 0)) {
|
||||
pauseWarpHooksRegistered = false;
|
||||
return;
|
||||
}
|
||||
if (!pauseWarpHooksRegistered) {
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnKaleidoUpdate>(
|
||||
[]() { PauseWarp_HandleSelection(); });
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameFrameUpdate>(
|
||||
[]() { PauseWarp_Execute(); });
|
||||
pauseWarpHooksRegistered = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void RegisterCustomSkeletons() {
|
||||
static int8_t previousTunic = -1;
|
||||
|
||||
@@ -913,11 +785,9 @@ void InitMods() {
|
||||
RegisterEnemyDefeatCounts();
|
||||
RegisterBossDefeatTimestamps();
|
||||
RegisterRandomizedEnemySizes();
|
||||
RegisterToTMedallions();
|
||||
RegisterFloorSwitchesHook();
|
||||
RegisterPatchHandHandler();
|
||||
RegisterHurtContainerModeHandler();
|
||||
RegisterPauseMenuHooks();
|
||||
RandoKaleido_RegisterHooks();
|
||||
RegisterCustomSkeletons();
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ extern "C" {
|
||||
void UpdateDirtPathFixState(int32_t sceneNum);
|
||||
void UpdateMirrorModeState(int32_t sceneNum);
|
||||
void UpdateHurtContainerModeState(bool newState);
|
||||
void PatchToTMedallions();
|
||||
void UpdateToTMedallions();
|
||||
void UpdatePermanentHeartLossState();
|
||||
void UpdateHyperEnemiesState();
|
||||
void UpdateHyperBossesState();
|
||||
|
||||
@@ -186,7 +186,6 @@ void Context::GenerateLocationPool() {
|
||||
location.GetRandomizerCheck() == RC_LW_DEKU_SCRUB_NEAR_BRIDGE ||
|
||||
location.GetRandomizerCheck() == RC_HF_DEKU_SCRUB_GROTTO)) ||
|
||||
(location.GetRCType() == RCTYPE_ADULT_TRADE && mOptions[RSK_SHUFFLE_ADULT_TRADE].Is(RO_GENERIC_OFF)) ||
|
||||
(location.GetRCType() == RCTYPE_SONG_LOCATION && mOptions[RSK_SHUFFLE_SONGS].Is(RO_SONG_SHUFFLE_OFF)) ||
|
||||
(location.GetRCType() == RCTYPE_COW && mOptions[RSK_SHUFFLE_COWS].Is(RO_GENERIC_OFF)) ||
|
||||
(location.GetRandomizerCheck() == RC_LH_HYRULE_LOACH &&
|
||||
mOptions[RSK_FISHSANITY].IsNot(RO_FISHSANITY_HYRULE_LOACH)) ||
|
||||
|
||||
@@ -2187,7 +2187,8 @@ void RandomizerOnActorInitHandler(void* actorRef) {
|
||||
}
|
||||
|
||||
// Turn MQ switch into toggle
|
||||
if (actor->id == ACTOR_OBJ_SWITCH && gPlayState->sceneNum == SCENE_BOTTOM_OF_THE_WELL && (actor->params & 7) == 3) {
|
||||
if (actor->id == ACTOR_OBJ_SWITCH && gPlayState->sceneNum == SCENE_BOTTOM_OF_THE_WELL &&
|
||||
(actor->params & 0x3f07) == 0x303) {
|
||||
auto dungeon =
|
||||
OTRGlobals::Instance->gRandoContext->GetDungeons()->GetDungeonFromScene(SCENE_BOTTOM_OF_THE_WELL);
|
||||
if (dungeon->IsMQ()) {
|
||||
|
||||
@@ -133,7 +133,7 @@ void RegionTable_Init_DekuTree() {
|
||||
LOCATION(RC_DEKU_TREE_BASEMENT_TORCHES_GRASS_2, logic->CanCutShrubs()),
|
||||
}, {
|
||||
//Exits
|
||||
Entrance(RR_DEKU_TREE_BASEMENT_WATER_ROOM_BACK, []{return true;}),
|
||||
Entrance(RR_DEKU_TREE_BASEMENT_WATER_ROOM_BACK, []{return Here(RR_DEKU_TREE_BASEMENT_TORCH_ROOM, []{return logic->HasFireSourceWithTorch() || logic->CanUse(RG_FAIRY_BOW);});}),
|
||||
Entrance(RR_DEKU_TREE_BASEMENT_BACK_LOBBY, []{return Here(RR_DEKU_TREE_BASEMENT_TORCH_ROOM, []{return logic->HasFireSourceWithTorch() || logic->CanUse(RG_FAIRY_BOW);});}),
|
||||
});
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ void RegionTable_Init_ZoraRiver() {
|
||||
EventAccess(LOGIC_GOSSIP_STONE_FAIRY, []{return logic->CallGossipFairy();}),
|
||||
EventAccess(LOGIC_BEAN_PLANT_FAIRY, []{return logic->IsChild && logic->CanUse(RG_MAGIC_BEAN) && logic->CanUse(RG_SONG_OF_STORMS);}),
|
||||
EventAccess(LOGIC_BUTTERFLY_FAIRY, []{return logic->CanUse(RG_STICKS);}),
|
||||
EventAccess(LOGIC_BUG_SHRUB, []{return logic->CanCutShrubs();}),
|
||||
EventAccess(LOGIC_BUG_SHRUB, []{return logic->CanCutShrubs() && (logic->IsChild || logic->CanUse(RG_HOVER_BOOTS) || ctx->GetTrickOption(RT_ZR_LOWER));}),
|
||||
}, {
|
||||
//Locations
|
||||
LOCATION(RC_ZR_MAGIC_BEAN_SALESMAN, logic->IsChild),
|
||||
@@ -61,7 +61,7 @@ void RegionTable_Init_ZoraRiver() {
|
||||
LOCATION(RC_ZR_BENEATH_WATERFALL_RIGHT_RUPEE, logic->IsAdult && (logic->HasItem(RG_BRONZE_SCALE) || logic->CanUse(RG_IRON_BOOTS) || logic->CanUse(RG_BOOMERANG))),
|
||||
LOCATION(RC_ZR_NEAR_GROTTOS_GOSSIP_STONE, true),
|
||||
LOCATION(RC_ZR_NEAR_DOMAIN_GOSSIP_STONE, true),
|
||||
LOCATION(RC_ZR_NEAR_FREESTANDING_POH_GRASS, logic->CanCutShrubs()),
|
||||
LOCATION(RC_ZR_NEAR_FREESTANDING_POH_GRASS, (logic->CanCutShrubs() && (logic->IsChild || logic->CanUse(RG_HOVER_BOOTS) || ctx->GetTrickOption(RT_ZR_LOWER))) || logic->CanUse(RG_BOOMERANG)),
|
||||
}, {
|
||||
//Exits
|
||||
Entrance(RR_ZR_FRONT, []{return true;}),
|
||||
|
||||
@@ -2113,7 +2113,7 @@ void RegisterItemTrackerWidgets() {
|
||||
SohGui::mSohMenu->AddSearchWidget({ personalNotesWiget, "Randomizer", "Item Tracker", "General Settings" });
|
||||
|
||||
hookshotIdentWidget = { .name = "Show Hookshot Identifiers", .type = WidgetType::WIDGET_CVAR_CHECKBOX };
|
||||
hookshotIdentWidget.CVar(CVAR_SETTING("FreeLook.Enabled"))
|
||||
hookshotIdentWidget.CVar(CVAR_TRACKER_ITEM("HookshotIdentifier"))
|
||||
.Options(CheckboxOptions()
|
||||
.Color(THEME_COLOR)
|
||||
.Tooltip("Shows an 'H' or an 'L' to more easily distinguish between Hookshot and Longshot."));
|
||||
|
||||
@@ -282,15 +282,15 @@ extern "C" void Randomizer_InitSaveFile() {
|
||||
}
|
||||
|
||||
int startingAge = OTRGlobals::Instance->gRandoContext->GetOption(RSK_SELECTED_STARTING_AGE).Get();
|
||||
gSaveContext.savedSceneNum = -1;
|
||||
switch (startingAge) {
|
||||
case RO_AGE_ADULT: // Adult
|
||||
gSaveContext.linkAge = LINK_AGE_ADULT;
|
||||
gSaveContext.entranceIndex = ENTR_TEMPLE_OF_TIME_WARP_PAD;
|
||||
gSaveContext.savedSceneNum = SCENE_LON_LON_RANCH; // Set scene num manually to ToT.
|
||||
gSaveContext.cutsceneIndex = 0;
|
||||
break;
|
||||
case RO_AGE_CHILD: // Child
|
||||
gSaveContext.linkAge = LINK_AGE_CHILD;
|
||||
gSaveContext.savedSceneNum = -1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -225,7 +225,7 @@ StaticData::PopulateTranslationMap(std::unordered_map<uint32_t, CustomMessage> i
|
||||
if (output.contains(string)) {
|
||||
if (output[string] != key) {
|
||||
// RANDOTODO should this cause an error of some kind?
|
||||
SPDLOG_DEBUG("\tREPEATED STRING IN " + message.GetEnglish(MF_CLEAN) + "\n\n");
|
||||
SPDLOG_DEBUG("REPEATED STRING IN " + message.GetEnglish(MF_CLEAN));
|
||||
}
|
||||
} else {
|
||||
output[string] = key;
|
||||
@@ -244,7 +244,7 @@ StaticData::PopulateTranslationMap(std::unordered_map<uint32_t, RandomizerHintTe
|
||||
if (output.contains(string)) {
|
||||
if (output[string] != key) {
|
||||
// RANDOTODO should this cause an error of some kind?
|
||||
SPDLOG_DEBUG("\tREPEATED STRING WITH " + string + "\n\n");
|
||||
SPDLOG_DEBUG("REPEATED STRING WITH " + string);
|
||||
}
|
||||
} else {
|
||||
output[string] = key;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <fast/resource/type/DisplayList.h>
|
||||
#include <ship/window/Window.h>
|
||||
#include <soh/GameVersions.h>
|
||||
#include <spdlog/sinks/rotating_file_sink.h>
|
||||
|
||||
#include "Enhancements/gameconsole.h"
|
||||
#ifdef _WIN32
|
||||
@@ -319,8 +320,13 @@ void OTRGlobals::Initialize() {
|
||||
context->InitCrashHandler();
|
||||
context->InitConsole();
|
||||
|
||||
#if (_DEBUG)
|
||||
int defaultLogLevel = 0;
|
||||
#else
|
||||
int defaultLogLevel = 2;
|
||||
#endif
|
||||
Ship::Context::GetInstance()->GetLogger()->set_level(
|
||||
(spdlog::level::level_enum)CVarGetInteger(CVAR_DEVELOPER_TOOLS("LogLevel"), 1));
|
||||
(spdlog::level::level_enum)CVarGetInteger(CVAR_DEVELOPER_TOOLS("LogLevel"), defaultLogLevel));
|
||||
Ship::Context::GetInstance()->GetLogger()->set_pattern("[%H:%M:%S.%e] [%s:%#] [%l] %v");
|
||||
|
||||
auto sohInputEditorWindow =
|
||||
|
||||
@@ -334,8 +334,7 @@ void SohMenu::AddMenuEnhancements() {
|
||||
AddWidget(path, "Skip Feeding Jabu-Jabu", WIDGET_CVAR_CHECKBOX)
|
||||
.CVar(CVAR_ENHANCEMENT("TimeSavers.SkipJabuJabuFish"))
|
||||
.PreFunc([](WidgetInfo& info) {
|
||||
info.options->disabled =
|
||||
IS_RANDO && OTRGlobals::Instance->gRandoContext->GetOption(RSK_JABU_OPEN).Is(RO_JABU_OPEN);
|
||||
info.options->disabled = IS_RANDO;
|
||||
info.options->disabledTooltip =
|
||||
"This setting is disabled because a randomizer savefile with \"Jabu-Jabu: Open\" is loaded.";
|
||||
})
|
||||
@@ -603,7 +602,7 @@ void SohMenu::AddMenuEnhancements() {
|
||||
AddWidget(path, "Color Temple of Time's Medallions", WIDGET_CVAR_CHECKBOX)
|
||||
.CVar(CVAR_ENHANCEMENT("ToTMedallionsColors"))
|
||||
.RaceDisable(false)
|
||||
.Callback([](WidgetInfo& info) { PatchToTMedallions(); })
|
||||
.Callback([](WidgetInfo& info) { UpdateToTMedallions(); })
|
||||
.Options(CheckboxOptions().Tooltip(
|
||||
"When Medallions are collected, the Medallion imprints around the Master Sword Pedestal in the Temple "
|
||||
"of Time will become colored-in."));
|
||||
|
||||
Reference in New Issue
Block a user