Skip to content

Commit

Permalink
Merge pull request #853 from HarbourMasters/develop-satoko
Browse files Browse the repository at this point in the history
develop-satoko -> develop
  • Loading branch information
Archez authored Nov 14, 2024
2 parents ad50070 + dda4e4b commit 5a73539
Show file tree
Hide file tree
Showing 26 changed files with 243 additions and 179 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")

set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")

project(2s2h VERSION 1.1.0 LANGUAGES C CXX)
project(2s2h VERSION 1.1.1 LANGUAGES C CXX)
include(CMake/2ship-cvars.cmake)
include(CMake/lus-cvars.cmake)
set(PROJECT_BUILD_NAME "Satoko Alfa" CACHE STRING "" FORCE)
set(PROJECT_BUILD_NAME "Satoko Bravo" CACHE STRING "" FORCE)
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "" FORCE)

set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT 2ship)
Expand Down
46 changes: 17 additions & 29 deletions mm/2s2h/BenGui/BenMenuBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,8 @@ void DrawEnhancementsMenu() {
if (UIWidgets::BeginMenu("Camera")) {
ImGui::SeparatorText("Fixes");
UIWidgets::CVarCheckbox(
"Fix Targetting Camera Snap", "gEnhancements.Camera.FixTargettingCameraSnap",
{ .tooltip =
"Fixes the camera snap that occurs when you are moving and press the targetting button." });
"Fix Targeting Camera Snap", "gEnhancements.Camera.FixTargettingCameraSnap",
{ .tooltip = "Fixes the camera snap that occurs when you are moving and press the targeting button." });

ImGui::SeparatorText("First Person");
UIWidgets::CVarCheckbox("Disable Auto-Centering",
Expand Down Expand Up @@ -559,8 +558,9 @@ void DrawEnhancementsMenu() {
if (UIWidgets::BeginMenu("Dialogue")) {
UIWidgets::CVarCheckbox(
"Fast Bank Selection", "gEnhancements.Dialogue.FastBankSelection",
{ .tooltip = "Pressing the Z or R buttons while the Deposit/Withdrawl Rupees dialogue is open will set "
"the Rupees to Links current Rupees or 0 respectively." });
{ .tooltip =
"Pressing the Z or R buttons while the Deposit/Withdrawal Rupees dialogue is open will set "
"the Rupees to Links current Rupees or 0 respectively." });
UIWidgets::CVarCheckbox(
"Fast Text", "gEnhancements.Dialogue.FastText",
{ .tooltip = "Speeds up text rendering, and enables holding of B progress to next message" });
Expand Down Expand Up @@ -651,32 +651,20 @@ void DrawEnhancementsMenu() {
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(255, 255, 0, 255));
ImGui::SeparatorText("Unstable");
ImGui::PopStyleColor();
UIWidgets::CVarCheckbox(
"Disable Scene Geometry Distance Check", "gEnhancements.Graphics.DisableSceneGeometryDistanceCheck",
{ .tooltip =
"Disables the distance check for scene geometry, allowing it to be drawn no matter how far "
"away it is from the player. This may have unintended side effects." });
if (UIWidgets::CVarCheckbox(
"Disable Scene Geometry Distance Check", "gEnhancements.Graphics.DisableSceneGeometryDistanceCheck",
{ .tooltip =
"Disables the distance check for scene geometry, allowing it to be drawn no matter how far "
"away it is from the player. This may have unintended side effects." })) {
GfxPatcher_ApplyGeometryIssuePatches();
}
UIWidgets::CVarCheckbox("Widescreen Actor Culling",
"gEnhancements.Graphics.ActorCullingAccountsForWidescreen",
{ .tooltip = "Adjusts the culling planes to account for widescreen resolutions. "
"This may have unintended side effects." });
if (UIWidgets::CVarSliderInt(
"Increase Actor Draw Distance: %dx", "gEnhancements.Graphics.IncreaseActorDrawDistance", 1, 5, 1,
{ .tooltip =
"Increase the range in which Actors are drawn. This may have unintended side effects." })) {
CVarSetInteger("gEnhancements.Graphics.IncreaseActorUpdateDistance",
MIN(CVarGetInteger("gEnhancements.Graphics.IncreaseActorDrawDistance", 1),
CVarGetInteger("gEnhancements.Graphics.IncreaseActorUpdateDistance", 1)));
}
if (UIWidgets::CVarSliderInt(
"Increase Actor Update Distance: %dx", "gEnhancements.Graphics.IncreaseActorUpdateDistance", 1, 5,
1,
{ .tooltip =
"Increase the range in which Actors are updated. This may have unintended side effects." })) {
CVarSetInteger("gEnhancements.Graphics.IncreaseActorDrawDistance",
MAX(CVarGetInteger("gEnhancements.Graphics.IncreaseActorDrawDistance", 1),
CVarGetInteger("gEnhancements.Graphics.IncreaseActorUpdateDistance", 1)));
}
UIWidgets::CVarSliderInt(
"Increase Actor Draw Distance: %dx", "gEnhancements.Graphics.IncreaseActorDrawDistance", 1, 5, 1,
{ .tooltip = "Increase the range in which Actors are drawn. This may have unintended side effects." });

ImGui::EndMenu();
}
Expand All @@ -688,7 +676,7 @@ void DrawEnhancementsMenu() {
{ .tooltip = "Allow using Fierce Deity's mask outside of boss rooms." });
UIWidgets::CVarCheckbox("No Blast Mask Cooldown", "gEnhancements.Masks.NoBlastMaskCooldown", {});
if (UIWidgets::CVarCheckbox("Persistent Bunny Hood", "gEnhancements.Masks.PersistentBunnyHood.Enabled",
{ .tooltip = "Permanantly toggle a speed boost from the bunny hood by pressing "
{ .tooltip = "Permanently toggle a speed boost from the bunny hood by pressing "
"'A' on it in the mask menu." })) {
UpdatePersistentMasksState();
}
Expand Down Expand Up @@ -902,7 +890,7 @@ void DrawDeveloperToolsMenu() {
"Change the behavior of creating saves while debug mode is enabled:\n\n"
"- Empty Save: The default 3 heart save file in first cycle\n"
"- Vanilla Debug Save: Uses the title screen save info (8 hearts, all items and masks)\n"
"- 100\% Save: All items, equipment, mask, quast status and bombers notebook complete",
"- 100\% Save: All items, equipment, mask, quest status and bombers notebook complete",
.defaultIndex = DEBUG_SAVE_INFO_NONE })) {
RegisterDebugSaveCreate();
}
Expand Down
5 changes: 3 additions & 2 deletions mm/2s2h/BenGui/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void BenMenu::DrawElement() {
ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), windowCond, { 0.5f, 0.5f });
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
}
if (!ImGui::Begin("Main Menu", NULL, windowFlags | ImGuiWindowFlags_NoBringToFrontOnFocus)) {
if (!ImGui::Begin("Main Menu", NULL, windowFlags)) {
if (!popout) {
ImGui::PopStyleVar();
}
Expand Down Expand Up @@ -400,7 +400,8 @@ void BenMenu::DrawElement() {
info.isHidden) {
continue;
}
std::string widgetStr = std::string(info.widgetName) + std::string(info.widgetTooltip);
std::string widgetStr = std::string(info.widgetName) +
std::string(info.widgetTooltip != NULL ? info.widgetTooltip : "");
std::transform(menuSearchText.begin(), menuSearchText.end(), menuSearchText.begin(), ::tolower);
std::transform(widgetStr.begin(), widgetStr.end(), widgetStr.begin(), ::tolower);
widgetStr.erase(std::remove(widgetStr.begin(), widgetStr.end(), ' '), widgetStr.end());
Expand Down
65 changes: 29 additions & 36 deletions mm/2s2h/BenGui/SearchableMenuItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ struct widgetInfo {
// `evaluation` returns a bool which can be determined by whatever code you want that changes its status
// `reason` is the text displayed in the disabledTooltip when a widget is disabled by a particular DisableReason
// `active` is what's referenced when determining disabled status for a widget that uses this This can also be used to
// hold reasons to hide widgets so taht their evaluations are also only run once per frame
// hold reasons to hide widgets so that their evaluations are also only run once per frame
struct disabledInfo {
DisableInfoFunc evaluation;
const char* reason;
Expand Down Expand Up @@ -451,11 +451,10 @@ void AddSettings() {
WIDGET_CVAR_COMBOBOX,
{ .defaultVariant = COLOR_INDIGO, .comboBoxOptions = menuThemeOptions } },
#if not defined(__SWITCH__) and not defined(__WIIU__)
{ "Menubar Controller Navigation", CVAR_IMGUI_CONTROLLER_NAV,
"Allows controller navigation of the SOH menu bar (Settings, Enhancements,...)\nCAUTION: "
{ "Menu Controller Navigation", CVAR_IMGUI_CONTROLLER_NAV,
"Allows controller navigation of the 2Ship menu (Settings, Enhancements,...)\nCAUTION: "
"This will disable game inputs while the menu is visible.\n\nD-pad to move between "
"items, A to select, B to move up in scope. DEV NOTE: SDL is weird currently, pad button only "
"works with menubar open.",
"items, A to select, B to move up in scope.",
WIDGET_CVAR_CHECKBOX },
{ "Cursor Always Visible",
"gSettings.CursorVisibility",
Expand Down Expand Up @@ -778,9 +777,9 @@ void AddEnhancements() {
3,
{ {
{ .widgetName = "Fixes", .widgetType = WIDGET_SEPARATOR_TEXT },
{ "Fix Targetting Camera Snap",
{ "Fix Targeting Camera Snap",
"gEnhancements.Camera.FixTargettingCameraSnap",
"Fixes the camera snap that occurs when you are moving and press the targetting button.",
"Fixes the camera snap that occurs when you are moving and press the targeting button.",
WIDGET_CVAR_CHECKBOX,
{} },
{ .widgetName = "First Person", .widgetType = WIDGET_SEPARATOR_TEXT },
Expand Down Expand Up @@ -1053,7 +1052,7 @@ void AddEnhancements() {
{ "Fierce Deity Putaway", "gEnhancements.Player.FierceDeityPutaway",
"Allows Fierce Deity Link to put away his sword.", WIDGET_CVAR_CHECKBOX },
{ "Climb speed",
"gEnhancements.PlayerMovement.ClimbSpeed",
"gEnhancements.Player.ClimbSpeed",
"Increases the speed at which Link climbs vines and ladders.",
WIDGET_CVAR_SLIDER_INT,
{ 1, 5, 1 } },
Expand Down Expand Up @@ -1167,7 +1166,8 @@ void AddEnhancements() {
enhancementsSidebar.push_back(
{ "Graphics",
3,
{ { { .widgetName = "Clock", .widgetType = WIDGET_SEPARATOR_TEXT },
{ {
{ .widgetName = "Clock", .widgetType = WIDGET_SEPARATOR_TEXT },
{ "Clock Type",
"gEnhancements.Graphics.ClockType",
"Swaps between Graphical and Text only Clock types.",
Expand Down Expand Up @@ -1244,34 +1244,25 @@ void AddEnhancements() {
{ .widgetName = "Unstable",
.widgetType = WIDGET_SEPARATOR_TEXT,
.widgetOptions = { .color = UIWidgets::Colors::Yellow } },
{ "Disable Scene Geometry Distance Check", "gEnhancements.Graphics.DisableSceneGeometryDistanceCheck",
{ "Disable Scene Geometry Distance Check",
"gEnhancements.Graphics.DisableSceneGeometryDistanceCheck",
"Disables the distance check for scene geometry, allowing it to be drawn no matter how far "
"away it is from the player. This may have unintended side effects.",
WIDGET_CVAR_CHECKBOX },
WIDGET_CVAR_CHECKBOX,
{},
[](widgetInfo& info) { GfxPatcher_ApplyGeometryIssuePatches(); } },
{ "Widescreen Actor Culling", "gEnhancements.Graphics.ActorCullingAccountsForWidescreen",
"Adjusts the culling planes to account for widescreen resolutions. "
"This may have unintended side effects.",
WIDGET_CVAR_CHECKBOX },
{ "Increase Actor Draw Distance: %dx",
"gEnhancements.Graphics.IncreaseActorDrawDistance",
"Increase the range in which Actors are drawn. This may have unintended side effects.",
WIDGET_CVAR_SLIDER_INT,
{ 1, 5, 1 },
[](widgetInfo& info) {
CVarSetInteger("gEnhancements.Graphics.IncreaseActorUpdateDistance",
MIN(CVarGetInteger("gEnhancements.Graphics.IncreaseActorDrawDistance", 1),
CVarGetInteger("gEnhancements.Graphics.IncreaseActorUpdateDistance", 1)));
} },
{ "Increase Actor Update Distance: %dx",
"gEnhancements.Graphics.IncreaseActorUpdateDistance",
"Increase the range in which Actors are updated. This may have unintended side effects.",
WIDGET_CVAR_SLIDER_INT,
{ 1, 5, 1 },
[](widgetInfo& info) {
CVarSetInteger("gEnhancements.Graphics.IncreaseActorDrawDistance",
MAX(CVarGetInteger("gEnhancements.Graphics.IncreaseActorDrawDistance", 1),
CVarGetInteger("gEnhancements.Graphics.IncreaseActorUpdateDistance", 1)));
} } } } });
{
"Increase Actor Draw Distance: %dx",
"gEnhancements.Graphics.IncreaseActorDrawDistance",
"Increase the range in which Actors are drawn. This may have unintended side effects.",
WIDGET_CVAR_SLIDER_INT,
{ 1, 5, 1 },
},
} } });
enhancementsSidebar.push_back(
{ "Items/Songs",
3,
Expand All @@ -1280,12 +1271,12 @@ void AddEnhancements() {
{ "Blast Mask has Powder Keg Force", "gEnhancements.Masks.BlastMaskKeg",
"Blast Mask can also destroy objects only the Powder Keg can.", WIDGET_CVAR_CHECKBOX },
{ "Fast Transformation", "gEnhancements.Masks.FastTransformation",
"Removes the delay when using transormation masks.", WIDGET_CVAR_CHECKBOX },
"Removes the delay when using transformation masks.", WIDGET_CVAR_CHECKBOX },
{ "Fierce Deity's Mask Anywhere", "gEnhancements.Masks.FierceDeitysAnywhere",
"Allow using Fierce Deity's mask outside of boss rooms.", WIDGET_CVAR_CHECKBOX },
{ "Persistent Bunny Hood",
"gEnhancements.Masks.PersistentBunnyHood.Enabled",
"Permanantly toggle a speed boost from the bunny hood by pressing "
"Permanently toggle a speed boost from the bunny hood by pressing "
"'A' on it in the mask menu.",
WIDGET_CVAR_CHECKBOX,
{},
Expand Down Expand Up @@ -1352,7 +1343,7 @@ void AddEnhancements() {
// Dialogue Enhancements
{ { .widgetName = "Dialogue", .widgetType = WIDGET_SEPARATOR_TEXT },
{ "Fast Bank Selection", "gEnhancements.Dialogue.FastBankSelection",
"Pressing the Z or R buttons while the Deposit/Withdrawl Rupees dialogue is open will set "
"Pressing the Z or R buttons while the Deposit/Withdrawal Rupees dialogue is open will set "
"the Rupees to Links current Rupees or 0 respectively.",
WIDGET_CVAR_CHECKBOX },
{ "Fast Text", "gEnhancements.Dialogue.FastText",
Expand Down Expand Up @@ -1535,7 +1526,7 @@ void AddDevTools() {
"Change the behavior of creating saves while debug mode is enabled:\n\n"
"- Empty Save: The default 3 heart save file in first cycle\n"
"- Vanilla Debug Save: Uses the title screen save info (8 hearts, all items and masks)\n"
"- 100\% Save: All items, equipment, mask, quast status and bombers notebook complete",
"- 100\% Save: All items, equipment, mask, quest status and bombers notebook complete",
WIDGET_CVAR_COMBOBOX,
{ 0, 0, 0, debugSaveOptions },
[](widgetInfo& info) { RegisterDebugSaveCreate(); },
Expand Down Expand Up @@ -1956,7 +1947,9 @@ void SearchMenuGetItem(widgetInfo& widget) {
info.widgetType == WIDGET_SEPARATOR_TEXT || info.isHidden) {
continue;
}
std::string widgetStr = std::string(info.widgetName) + std::string(info.widgetTooltip);
std::string widgetStr =
std::string(info.widgetName) +
std::string(info.widgetTooltip != NULL ? info.widgetTooltip : "");
std::transform(menuSearchText.begin(), menuSearchText.end(), menuSearchText.begin(),
::tolower);
menuSearchText.erase(std::remove(menuSearchText.begin(), menuSearchText.end(), ' '),
Expand Down
Loading

0 comments on commit 5a73539

Please sign in to comment.