mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-03 19:10:19 -04:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 92d11863f6 | |||
| 81caa89e12 | |||
| bc3cdcc955 | |||
| bf0dc85468 | |||
| 656346a900 | |||
| 5269eadfaf |
Vendored
+1
-1
Submodule extern/aurora updated: cb2c340d6c...7dd107e1a4
@@ -1442,6 +1442,8 @@ set(DUSK_FILES
|
||||
src/dusk/speedrun.cpp
|
||||
src/dusk/string.cpp
|
||||
src/dusk/stubs.cpp
|
||||
include/dusk/texture_replacements.hpp
|
||||
src/dusk/texture_replacements.cpp
|
||||
src/dusk/update_check.cpp
|
||||
src/dusk/update_check.hpp
|
||||
#src/dusk/m_Do_ext_dusk.cpp
|
||||
|
||||
@@ -230,7 +230,6 @@ struct UserSettings {
|
||||
ConfigVar<bool> fastSpinner;
|
||||
ConfigVar<bool> freeMagicArmor;
|
||||
ConfigVar<bool> invincibleEnemies;
|
||||
ConfigVar<bool> transformWithoutShadowCrystal;
|
||||
|
||||
// Technical
|
||||
ConfigVar<bool> restoreWiiGlitches;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef DUSK_TEXTURE_REPLACEMENTS_HPP
|
||||
#define DUSK_TEXTURE_REPLACEMENTS_HPP
|
||||
|
||||
namespace dusk::texture_replacements {
|
||||
|
||||
void reload();
|
||||
void set_enabled(bool enabled);
|
||||
void shutdown();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -72,7 +72,7 @@ void daAlink_c::handleQuickTransform() {
|
||||
}
|
||||
|
||||
// Check to see if Link has the ability to transform.
|
||||
if (!dComIfGs_isEventBit(dSv_event_flag_c::M_077) && !dusk::getSettings().game.transformWithoutShadowCrystal) {
|
||||
if (!dComIfGs_isEventBit(dSv_event_flag_c::M_077)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ void daAlink_c::handleQuickTransform() {
|
||||
}
|
||||
|
||||
// Ensure that the Z Button is not dimmed
|
||||
if (meterDrawPtr->getButtonZAlpha() != 1.f && !dusk::getSettings().game.transformWithoutShadowCrystal) {
|
||||
if (meterDrawPtr->getButtonZAlpha() != 1.f) {
|
||||
Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
|
||||
return;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ void daAlink_c::handleQuickTransform() {
|
||||
bool canTransform = false;
|
||||
|
||||
if (mLinkAcch.ChkGroundHit() && !checkModeFlg(MODE_PLAYER_FLY) && !checkMagneBootsOn()) {
|
||||
if (checkMidnaRide() || dusk::getSettings().game.transformWithoutShadowCrystal) {
|
||||
if (checkMidnaRide()) {
|
||||
if ((checkWolf() &&
|
||||
(checkModeFlg(MODE_UNK_1000) || dComIfGp_checkPlayerStatus0(0, 0x10))) ||
|
||||
(!checkWolf() &&
|
||||
|
||||
@@ -3106,18 +3106,14 @@ void daMidna_c::setMidnaNoDrawFlg() {
|
||||
|
||||
BOOL daMidna_c::checkMetamorphoseEnableBase() {
|
||||
BOOL tmp;
|
||||
if (!daAlink_getAlinkActorClass()->checkMidnaRide() || (g_env_light.mEvilInitialized & 0x80) ||
|
||||
/* dSv_event_flag_c::M_077 - Main Event - Get shadow crystal (can now transform) */
|
||||
!dComIfGs_isEventBit(0xD04) ||
|
||||
#if TARGET_PC
|
||||
if (((!daAlink_getAlinkActorClass()->checkMidnaRide() || (g_env_light.mEvilInitialized & 0x80) ||
|
||||
/* dSv_event_flag_c::M_077 - Main Event - Get shadow crystal (can now transform) */
|
||||
!dComIfGs_isEventBit(0xD04)) &&
|
||||
!dusk::getSettings().game.transformWithoutShadowCrystal) ||
|
||||
(fopAcIt_Judge((fopAcIt_JudgeFunc)daMidna_searchNpc, &tmp) &&
|
||||
!dusk::getSettings().game.canTransformAnywhere)
|
||||
(fopAcIt_Judge((fopAcIt_JudgeFunc)daMidna_searchNpc, &tmp) &&
|
||||
!dusk::getSettings().game.canTransformAnywhere)
|
||||
#else
|
||||
if (!daAlink_getAlinkActorClass()->checkMidnaRide() || (g_env_light.mEvilInitialized & 0x80) ||
|
||||
/* dSv_event_flag_c::M_077 - Main Event - Get shadow crystal (can now transform) */
|
||||
!dComIfGs_isEventBit(0xD04) ||
|
||||
fopAcIt_Judge((fopAcIt_JudgeFunc)daMidna_searchNpc, &tmp)
|
||||
fopAcIt_Judge((fopAcIt_JudgeFunc)daMidna_searchNpc, &tmp)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
|
||||
@@ -2843,11 +2843,7 @@ BOOL dComIfGs_Wolf_Change_Check() {
|
||||
BOOL is_wolf = false;
|
||||
|
||||
// Transforming Unlocked
|
||||
if (dComIfGs_isEventBit(0x0D04)
|
||||
#if TARGET_PC
|
||||
|| dusk::getSettings().game.transformWithoutShadowCrystal
|
||||
#endif
|
||||
) {
|
||||
if (dComIfGs_isEventBit(0x0D04)) {
|
||||
is_wolf = dComIfGs_getTransformStatus();
|
||||
} else if (dComIfGs_isTransformLV(0) && !dComIfGs_isDarkClearLV(0)) {
|
||||
is_wolf = true;
|
||||
|
||||
@@ -61,7 +61,7 @@ std::string release_name() {
|
||||
}
|
||||
|
||||
std::filesystem::path sentry_database_path() {
|
||||
return dusk::CachePath / "sentry";
|
||||
return dusk::ConfigPath / "sentry";
|
||||
}
|
||||
|
||||
std::filesystem::path log_attachment_path() {
|
||||
|
||||
@@ -123,7 +123,6 @@ UserSettings g_userSettings = {
|
||||
.fastSpinner {"game.fastSpinner", false},
|
||||
.freeMagicArmor {"game.freeMagicArmor", false},
|
||||
.invincibleEnemies {"game.invincibleEnemies", false},
|
||||
.transformWithoutShadowCrystal {"game.transformWithoutShadowCrystal", false},
|
||||
|
||||
// Technical
|
||||
.restoreWiiGlitches {"game.restoreWiiGlitches", false},
|
||||
@@ -209,7 +208,6 @@ void registerSettings() {
|
||||
// Game
|
||||
Register(g_userSettings.game.language);
|
||||
Register(g_userSettings.game.enableQuickTransform);
|
||||
Register(g_userSettings.game.transformWithoutShadowCrystal);
|
||||
Register(g_userSettings.game.hideTvSettingsScreen);
|
||||
Register(g_userSettings.game.biggerWallets);
|
||||
Register(g_userSettings.game.noReturnRupees);
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
#include "dusk/texture_replacements.hpp"
|
||||
|
||||
#include <aurora/texture.hpp>
|
||||
|
||||
#include "dusk/logging.h"
|
||||
#include "dusk/main.h"
|
||||
#include "dusk/settings.h"
|
||||
|
||||
namespace dusk::texture_replacements {
|
||||
namespace {
|
||||
aurora::texture::ReplacementGroup s_directoryGroup;
|
||||
}
|
||||
|
||||
void reload() {
|
||||
aurora::texture::unregister_replacements(s_directoryGroup);
|
||||
s_directoryGroup.registrations.clear();
|
||||
|
||||
if (!getSettings().game.enableTextureReplacements) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto root = ConfigPath / "texture_replacements";
|
||||
s_directoryGroup = aurora::texture::load_replacement_directory(root);
|
||||
DuskLog.info("Texture replacement directory loaded: {} registration(s)",
|
||||
s_directoryGroup.registrations.size());
|
||||
}
|
||||
|
||||
void set_enabled(bool enabled) {
|
||||
getSettings().game.enableTextureReplacements.setValue(enabled);
|
||||
reload();
|
||||
}
|
||||
|
||||
void shutdown() {
|
||||
aurora::texture::unregister_replacements(s_directoryGroup);
|
||||
s_directoryGroup.registrations.clear();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include "dusk/config.hpp"
|
||||
#include "dusk/settings.h"
|
||||
#include "dusk/texture_replacements.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
@@ -98,8 +99,7 @@ void set_value(GraphicsOption option, int value) {
|
||||
getSettings().game.bloomMultiplier.setValue(std::clamp(value, 0, 100) / 100.0f);
|
||||
break;
|
||||
case GraphicsOption::TextureReplacements:
|
||||
getSettings().game.enableTextureReplacements.setValue(static_cast<bool>(value));
|
||||
aurora_set_texture_replacements_enabled(static_cast<bool>(value));
|
||||
texture_replacements::set_enabled(static_cast<bool>(value));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1294,8 +1294,6 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) {
|
||||
"Lets the magic armor work without consuming rupees.");
|
||||
addCheat("Invincible Enemies", getSettings().game.invincibleEnemies,
|
||||
"Prevents enemies from taking damage.");
|
||||
addCheat("Transform without Shadow Crystal", getSettings().game.transformWithoutShadowCrystal,
|
||||
"Allows Link to transform without the Shadow Crystal (Only using Quick Transform.)");
|
||||
});
|
||||
|
||||
add_tab("Interface", [this](Rml::Element* content) {
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
#include "dusk/config.hpp"
|
||||
#include "dusk/speedrun.h"
|
||||
#include "dusk/settings.h"
|
||||
#include "dusk/texture_replacements.hpp"
|
||||
#include "dusk/io.hpp"
|
||||
#include "dusk/version.hpp"
|
||||
#include "dusk/discord_presence.hpp"
|
||||
@@ -585,7 +586,6 @@ int game_main(int argc, char* argv[]) {
|
||||
config.allowJoystickBackgroundEvents = dusk::getSettings().game.allowBackgroundInput;
|
||||
config.pauseOnFocusLost = dusk::getSettings().game.pauseOnFocusLost;
|
||||
config.imGuiInitCallback = &aurora_imgui_init_callback;
|
||||
config.allowTextureReplacements = dusk::getSettings().game.enableTextureReplacements;
|
||||
config.allowTextureDumps = false;
|
||||
auroraInfo = aurora_initialize(argc, argv, &config);
|
||||
}
|
||||
@@ -635,6 +635,7 @@ int game_main(int argc, char* argv[]) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
dusk::texture_replacements::reload();
|
||||
dusk::ui::initialize();
|
||||
dusk::ui::push_document(std::make_unique<dusk::ui::Overlay>(), true, true);
|
||||
dusk::ui::push_document(std::make_unique<dusk::ui::MenuBar>(), false);
|
||||
@@ -783,6 +784,7 @@ int game_main(int argc, char* argv[]) {
|
||||
dusk::discord::shutdown();
|
||||
#endif
|
||||
dusk::ui::shutdown();
|
||||
dusk::texture_replacements::shutdown();
|
||||
aurora_shutdown();
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user