forked from HarbourMasters/Ghostship
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGhostshipMenuEnhancements.cpp
More file actions
173 lines (153 loc) · 7.29 KB
/
Copy pathGhostshipMenuEnhancements.cpp
File metadata and controls
173 lines (153 loc) · 7.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#include "GhostshipMenu.h"
#define CVAR_INT_SHIP_INIT(cvar, val) \
CVarSetInteger(cvar, val); \
ShipInit::Init(cvar);
static std::string comboboxTooltip = "";
namespace GhostshipGui {
extern std::shared_ptr<GhostshipMenu> mGhostshipMenu;
static std::unordered_map<int32_t, const char*> hudAspects = {
{ 0, "Expand" },
{ 1, "Custom" },
{ 2, "Original (4:3)" },
{ 3, "Widescreen (16:9)" },
{ 4, "Nintendo 3DS (5:3)" },
{ 5, "16:10 (8:5)" },
{ 6, "Ultrawide (21:9)" },
};
using namespace UIWidgets;
void GhostshipMenu::AddMenuEnhancements() {
// Add Enhancements Menu
AddMenuEntry("Enhancements", CVAR_SETTING("Menu.EnhancementsSidebarSection"));
// Quality of Life
WidgetPath path = { "Enhancements", "Graphics", SECTION_COLUMN_1 };
AddSidebarEntry("Enhancements", "Graphics", 3);
AddWidget(path, "Mods", WIDGET_SEPARATOR_TEXT);
AddWidget(path, "Use Alternate Assets", WIDGET_CVAR_CHECKBOX)
.CVar("gEnhancements.Mods.AlternateAssets")
.Options(CheckboxOptions().Tooltip(
"Toggle between standard assets and alternate assets. Usually mods will indicate if "
"this setting has to be used or not."));
AddWidget(path, "Game", WIDGET_SEPARATOR_TEXT);
AddWidget(path, "Show Power Meter Always", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("AlwaysShowPowerMeter"))
.RaceDisable(false)
.Options(CheckboxOptions().Tooltip("The power meter will always be visible on screen."));
AddWidget(path, "HUD Aspect Ratio", WIDGET_CVAR_COMBOBOX)
.CVar("gHUDAspectRatio.Selection")
.RaceDisable(false)
.Options(ComboboxOptions()
.ComboMap(hudAspects)
.Tooltip("Changes the aspect ratio of the HUD elements.")
.DefaultIndex(0)
.ComponentAlignment(ComponentAlignments::Right)
.LabelPosition(LabelPositions::Far))
.Callback([](WidgetInfo& info) {
CVarSetInteger("gHUDAspectRatio.Enabled", 1);
switch (CVarGetInteger("gHUDAspectRatio.Selection", 0)) {
case 0:
CVarSetInteger("gHUDAspectRatio.Enabled", 0);
CVarSetInteger("gHUDAspectRatio.X", 0);
CVarSetInteger("gHUDAspectRatio.Y", 0);
break;
case 1:
if (CVarGetInteger("gHUDAspectRatio.X", 0) <= 0){
CVarSetInteger("gHUDAspectRatio.X", 1);
}
if (CVarGetInteger("gHUDAspectRatio.Y", 0) <= 0){
CVarSetInteger("gHUDAspectRatio.Y", 1);
}
break;
case 2:
CVarSetInteger("gHUDAspectRatio.X", 4);
CVarSetInteger("gHUDAspectRatio.Y", 3);
break;
case 3:
CVarSetInteger("gHUDAspectRatio.X", 16);
CVarSetInteger("gHUDAspectRatio.Y", 9);
break;
case 4:
CVarSetInteger("gHUDAspectRatio.X", 5);
CVarSetInteger("gHUDAspectRatio.Y", 3);
break;
case 5:
CVarSetInteger("gHUDAspectRatio.X", 8);
CVarSetInteger("gHUDAspectRatio.Y", 5);
break;
case 6:
CVarSetInteger("gHUDAspectRatio.X", 21);
CVarSetInteger("gHUDAspectRatio.Y", 9);
break;
}
});
AddWidget(path, "Custom HUD Aspect Ratio X", WIDGET_CVAR_SLIDER_INT)
.CVar("gHUDAspectRatio.X")
.RaceDisable(false)
.PreFunc([](WidgetInfo& info) {
if (CVarGetInteger("gHUDAspectRatio.Selection", 0) != 1) {
info.isHidden = true;
} else {
info.isHidden = false;
}
})
.Options(IntSliderOptions().Min(1).Max(100).DefaultValue(16).ShowButtons(true).Format("%d"));
AddWidget(path, "Custom HUD Aspect Ratio Y", WIDGET_CVAR_SLIDER_INT)
.CVar("gHUDAspectRatio.Y")
.RaceDisable(false)
.PreFunc([](WidgetInfo& info) {
if (CVarGetInteger("gHUDAspectRatio.Selection", 0) != 1) {
info.isHidden = true;
} else {
info.isHidden = false;
}
})
.Options(IntSliderOptions().Min(1).Max(100).DefaultValue(9).ShowButtons(true).Format("%d"));
path = { "Enhancements", "Gameplay", SECTION_COLUMN_1 };
AddSidebarEntry("Enhancements", path.sidebarName, 1);
path.column = SECTION_COLUMN_1;
AddWidget(path, "Disable LoD", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("DisableLOD"))
.RaceDisable(false)
.Options(CheckboxOptions().Tooltip("Disable Level of Detail (LOD) to avoid models using "
"lower poly versions at a distance"));
AddWidget(path, "Select Any Star", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("SelectAllStars"))
.RaceDisable(false)
.Options(CheckboxOptions().Tooltip("Let's you select any star from the menu regardless "
"of the courses completion status."));
AddWidget(path, "Collecting Stars Will Not Exit Level", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("StarNoExit"))
.RaceDisable(false)
.Options(CheckboxOptions().Tooltip("Collecting Stars will not take you out of the level."));
AddWidget(path, "Skip Intro Peach Cutscene", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("DisablePeachCutscene"))
.RaceDisable(false)
.Options(CheckboxOptions().Tooltip("Skips the Peach cutscene when starting a new game."));
AddWidget(path, "Skip Intro Lakitu", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("DisableLakituCutscene"))
.RaceDisable(false)
.Options(CheckboxOptions().Tooltip("The Lakitu will not appear when Mario reaches the bridge outside Peach's \n"
"Castle. Also skips Bowser's message when Mario first enters the castle."));
path = { "Enhancements", "Fixes", SECTION_COLUMN_1 };
AddSidebarEntry("Enhancements", path.sidebarName, 1);
path.column = SECTION_COLUMN_1;
AddWidget(path, "Fix Koopa Race Music", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("FixKoopaRaceMusic"))
.RaceDisable(false)
.Options(CheckboxOptions().Tooltip("Fixes the Koopa race music on Bob-omb Battlefield and Tiny-Huge Island."));
path = { "Enhancements", "Cheats", SECTION_COLUMN_1 };
AddSidebarEntry("Enhancements", path.sidebarName, 1);
path.column = SECTION_COLUMN_1;
AddWidget(path, "Infinite Health", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_CHEAT("InfiniteHealth"))
.RaceDisable(false)
.Options(CheckboxOptions().Tooltip("Impervious to Damage."));
AddWidget(path, "Infinite Lives", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_CHEAT("InfiniteLives"))
.RaceDisable(false)
.Options(CheckboxOptions().Tooltip("Never run of out Lives."));
AddWidget(path, "Pause Exit Whenever", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_CHEAT("PauseExitWhenever"))
.RaceDisable(false)
.Options(CheckboxOptions().Tooltip("Exit from anywhere using the Pause Menu."));
}
} // namespace GhostshipGui