Skip to content

Commit e953bf5

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into develop
2 parents 3193fd0 + 39a072e commit e953bf5

205 files changed

Lines changed: 6185 additions & 3702 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
55

66
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
77
set(GAME_STR "MM")
8-
project(2s2h VERSION 3.0.2 LANGUAGES C CXX)
8+
project(2s2h VERSION 4.0.0 LANGUAGES C CXX)
99
include(CMake/2ship-cvars.cmake)
1010
include(CMake/lus-cvars.cmake)
1111
set(SPDLOG_LEVEL_TRACE 0)
1212
set(SPDLOG_LEVEL_OFF 6)
1313
set(SPDLOG_MIN_CUTOFF SPDLOG_LEVEL_TRACE CACHE STRING "cutoff at trace")
14-
set(PROJECT_BUILD_NAME "Mion Charlie" CACHE STRING "" FORCE)
14+
set(PROJECT_BUILD_NAME "Keiichi Alfa" CACHE STRING "" FORCE)
1515
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "" FORCE)
1616

1717
execute_process(

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,10 @@ If you're interested in creating and/or packing your own custom asset `.o2r`/`.o
8383
* [**fast64 - Blender plugin (Note that MM is not fully supported at this time)**](https://github.com/HarbourMasters/fast64)
8484

8585
# Development
86-
### Building
8786

8887
If you want to manually compile 2S2H, please consult the [building instructions](docs/BUILDING.md).
8988

90-
91-
### Playtesting
89+
# Nightly Builds
9290
If you want to playtest a continuous integration build, you can find them at the links below. Keep in mind that these are for playtesting only, and you will likely encounter bugs and possibly crashes.
9391

9492
* [Windows](https://nightly.link/HarbourMasters/2ship2harkinian/workflows/main/develop/2ship-windows.zip)

mm/2s2h/BenGui/BenInputEditorWindow.cpp

Lines changed: 21 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
using namespace UIWidgets;
1717

18+
static s32 heldInputs = 0;
19+
1820
BenInputEditorWindow::~BenInputEditorWindow() {
1921
}
2022

@@ -447,6 +449,9 @@ void BenInputEditorWindow::DrawButtonLine(const char* buttonName, uint8_t port,
447449
ImVec4 color = CHIP_COLOR_N64_GREY) {
448450
ImGui::NewLine();
449451
ImGui::SameLine(SCALE_IMGUI_SIZE(32.0f));
452+
if (heldInputs & bitmask) {
453+
color.w = 0.5f;
454+
}
450455
DrawInputChip(buttonName, color);
451456
ImGui::SameLine(SCALE_IMGUI_SIZE(86.0f));
452457
for (auto id : mBitmaskToMappingIds[port][bitmask]) {
@@ -1201,65 +1206,6 @@ void BenInputEditorWindow::DrawGyroSection(uint8_t port) {
12011206
}
12021207
}
12031208

1204-
void BenInputEditorWindow::DrawModifierButtonsSection(uint8_t port) {
1205-
DrawButtonLine("M1", port, BTN_CUSTOM_MODIFIER1);
1206-
DrawButtonLine("M2", port, BTN_CUSTOM_MODIFIER2);
1207-
1208-
ImGui::BeginDisabled(CVarGetInteger("gSettings.DisableChanges", 0));
1209-
CVarCheckbox("Enable Speed Modifiers", "gSettings.SpeedModifier.Enable",
1210-
CheckboxOptions()
1211-
.Color(THEME_COLOR)
1212-
.Tooltip("Hold the assigned button to change the maximum walking or swimming speed."));
1213-
if (CVarGetInteger("gSettings.SpeedModifier.Enable", 0)) {
1214-
UIWidgets::Spacer(5);
1215-
Ship::GuiWindow::BeginGroupPanel("Speed Modifier", ImGui::GetContentRegionAvail());
1216-
CVarCheckbox("Toggle modifier instead of holding", "gSettings.SpeedModifier.Toggle",
1217-
CheckboxOptions().Color(THEME_COLOR));
1218-
Ship::GuiWindow::BeginGroupPanel("Walk Modifier", ImGui::GetContentRegionAvail());
1219-
CVarCheckbox("Enable Walk Speed Modifier", "gSettings.SpeedModifier.WalkEnable",
1220-
CheckboxOptions().Color(THEME_COLOR));
1221-
CVarSliderFloat("Walk Modifier 1: %.0f %%", "gSettings.SpeedModifier.WalkMapping1",
1222-
FloatSliderOptions()
1223-
.Color(THEME_COLOR)
1224-
.IsPercentage()
1225-
.Min(0.0f)
1226-
.Max(15.0f)
1227-
.DefaultValue(1.0f)
1228-
.ShowAdjustmentButtons(true));
1229-
CVarSliderFloat("Walk Modifier 2: %.0f %%", "gSettings.SpeedModifier.WalkMapping2",
1230-
FloatSliderOptions()
1231-
.Color(THEME_COLOR)
1232-
.IsPercentage()
1233-
.Min(0.0f)
1234-
.Max(15.0f)
1235-
.DefaultValue(1.0f)
1236-
.ShowAdjustmentButtons(true));
1237-
Ship::GuiWindow::EndGroupPanel(0);
1238-
Ship::GuiWindow::BeginGroupPanel("Swim Modifier", ImGui::GetContentRegionAvail());
1239-
CVarCheckbox("Enable Swim Speed Modifier", "gSettings.SpeedModifier.SwimEnable",
1240-
CheckboxOptions().Color(THEME_COLOR));
1241-
CVarSliderFloat("Swim Modifier 1: %.0f %%", "gSettings.SpeedModifier.SwimMapping1",
1242-
FloatSliderOptions()
1243-
.Color(THEME_COLOR)
1244-
.IsPercentage()
1245-
.Min(0.0f)
1246-
.Max(8.75f)
1247-
.DefaultValue(1.0f)
1248-
.ShowAdjustmentButtons(true));
1249-
CVarSliderFloat("Swim Modifier 2: %.0f %%", "gSettings.SpeedModifier.SwimMapping2",
1250-
FloatSliderOptions()
1251-
.Color(THEME_COLOR)
1252-
.IsPercentage()
1253-
.Min(0.0f)
1254-
.Max(8.75f)
1255-
.DefaultValue(1.0f)
1256-
.ShowAdjustmentButtons(true));
1257-
Ship::GuiWindow::EndGroupPanel(0);
1258-
Ship::GuiWindow::EndGroupPanel(0);
1259-
}
1260-
ImGui::EndDisabled();
1261-
}
1262-
12631209
const ImGuiTableFlags PANEL_TABLE_FLAGS = ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV;
12641210
const ImGuiTableColumnFlags PANEL_TABLE_COLUMN_FLAGS =
12651211
ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_NoSort;
@@ -1440,6 +1386,13 @@ void BenInputEditorWindow::DrawPortTabContents(uint8_t portIndex) {
14401386
DrawButtonLine(StringHelper::Sprintf("%s##DPad", ICON_FA_ARROW_RIGHT).c_str(), portIndex, BTN_DRIGHT);
14411387
}
14421388

1389+
if (ImGui::CollapsingHeader("Modifier Buttons", NULL, ImGuiTreeNodeFlags_DefaultOpen)) {
1390+
ImGui::TextWrapped("These can be bound to physical buttons and be selected for use in various\nenhancements, "
1391+
"but otherwise have no use on their own.");
1392+
DrawButtonLine("M1", portIndex, BTN_CUSTOM_MODIFIER1);
1393+
DrawButtonLine("M2", portIndex, BTN_CUSTOM_MODIFIER2);
1394+
}
1395+
14431396
if (ImGui::CollapsingHeader("Analog Stick", NULL, ImGuiTreeNodeFlags_DefaultOpen)) {
14441397
DrawStickSection(portIndex, Ship::LEFT);
14451398
}
@@ -1460,10 +1413,6 @@ void BenInputEditorWindow::DrawPortTabContents(uint8_t portIndex) {
14601413
DrawLEDSection(portIndex);
14611414
}
14621415

1463-
if (ImGui::CollapsingHeader("Modifier Buttons")) {
1464-
DrawModifierButtonsSection(portIndex);
1465-
}
1466-
14671416
ImGui::PopStyleColor();
14681417
ImGui::PopStyleColor();
14691418
ImGui::PopStyleColor();
@@ -1561,3 +1510,12 @@ void BenInputEditorWindow::OffsetMappingPopup() {
15611510
pos.x += HORIZONTAL_OFFSET;
15621511
ImGui::SetNextWindowPos(pos);
15631512
}
1513+
1514+
static RegisterShipInitFunc initFunc(
1515+
[]() {
1516+
COND_HOOK(OnGameStateMainStart, true, []() {
1517+
Input* input = CONTROLLER1(gGameState);
1518+
heldInputs = input->cur.button;
1519+
});
1520+
},
1521+
{});

0 commit comments

Comments
 (0)