mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-03 08:23:08 -04:00
Refactor Dusk settings out to common interface used by game and UI code
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
#ifndef DUSK_CONFIG_H
|
||||
#define DUSK_CONFIG_H
|
||||
|
||||
namespace dusk {
|
||||
|
||||
// Persistent user settings
|
||||
|
||||
struct UserSettings {
|
||||
// Program settings
|
||||
|
||||
struct {
|
||||
// Video
|
||||
bool enableFullscreen;
|
||||
} video;
|
||||
|
||||
struct {
|
||||
// Audio
|
||||
float masterVolume;
|
||||
float mainMusicVolume;
|
||||
float subMusicVolume;
|
||||
float soundEffectsVolume;
|
||||
float fanfareVolume;
|
||||
} audio;
|
||||
|
||||
// Game settings
|
||||
|
||||
struct {
|
||||
// QoL
|
||||
bool enableQuickTransform;
|
||||
|
||||
// Preferences
|
||||
bool enableMirrorMode;
|
||||
bool invertCameraXAxis;
|
||||
|
||||
// Graphics
|
||||
bool enableBloom;
|
||||
bool useWaterProjectionOffset;
|
||||
|
||||
// Cheats
|
||||
bool enableFastIronBoots;
|
||||
|
||||
// Technical
|
||||
bool restoreWiiGlitches;
|
||||
} game;
|
||||
};
|
||||
|
||||
UserSettings& getSettings();
|
||||
|
||||
// Transient settings
|
||||
|
||||
struct CollisionViewSettings {
|
||||
bool enableTerrainView;
|
||||
bool enableWireframe;
|
||||
bool enableAtView;
|
||||
bool enableTgView;
|
||||
bool enableCoView;
|
||||
float terrainViewOpacity;
|
||||
float colliderViewOpacity;
|
||||
float drawRange;
|
||||
};
|
||||
|
||||
struct TransientSettings {
|
||||
CollisionViewSettings collisionView;
|
||||
};
|
||||
|
||||
TransientSettings& getTransientSettings();
|
||||
|
||||
}
|
||||
|
||||
#endif // DUSK_CONFIG_H
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
|
||||
#include "JSystem/JUtility/JUTGamePad.h"
|
||||
#include "SSystem/SComponent/c_API_controller_pad.h"
|
||||
|
||||
#include "dusk/imgui/ImGuiMenuEnhancements.hpp"
|
||||
#include "dusk/settings.h"
|
||||
|
||||
// Controller Ports 1 - 4
|
||||
enum { PAD_1, PAD_2, PAD_3, PAD_4 };
|
||||
@@ -57,7 +56,7 @@ public:
|
||||
|
||||
static s16 getStickAngle3D(u32 pad) {
|
||||
#if TARGET_PC
|
||||
if (dusk::ImGuiMenuEnhancements::m_enhancements.mirrorMode) {
|
||||
if (dusk::getSettings().game.enableMirrorMode) {
|
||||
return -getCpadInfo(pad).mMainStickAngle;
|
||||
} else {
|
||||
return getCpadInfo(pad).mMainStickAngle;
|
||||
@@ -69,7 +68,7 @@ public:
|
||||
|
||||
static f32 getSubStickX3D(u32 pad) {
|
||||
#if TARGET_PC
|
||||
if (dusk::ImGuiMenuEnhancements::m_enhancements.mirrorMode) {
|
||||
if (dusk::getSettings().game.enableMirrorMode) {
|
||||
return -getCpadInfo(pad).mCStickPosX;
|
||||
} else {
|
||||
return getCpadInfo(pad).mCStickPosX;
|
||||
|
||||
Reference in New Issue
Block a user