mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-09-26 09:18:40 -04:00
Merge pull request #210 from baxlek/hold-to-mash-refactor
Hold to mash refactor
This commit is contained in:
@@ -185,7 +185,7 @@ int daAlink_c::procSumouMove() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
IF_DUSK(const bool easySumo = DUSK_IF_ELSE(dusk::getSettings().game.holdToMash.sumo, false));
|
||||
IF_DUSK(const bool holdToMash = DUSK_IF_ELSE(dusk::getSettings().game.holdToMash, false));
|
||||
daNpcWrestler_c* wrestler_p = (daNpcWrestler_c*)mCargoCarryAcKeep.getActor();
|
||||
daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl;
|
||||
f32 sp8;
|
||||
@@ -201,7 +201,7 @@ int daAlink_c::procSumouMove() {
|
||||
|
||||
sp8 = frameCtrl_p->getRate();
|
||||
if (mProcVar0.field_0x3008 != 0) {
|
||||
if (easySumo ? doButton() : doTrigger()) {
|
||||
if (holdToMash ? doButton() : doTrigger()) {
|
||||
mProcVar0.field_0x3008--;
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ int daAlink_c::procSumouMove() {
|
||||
field_0x3198 = ANM_SUMOU_PUSH_BACK;
|
||||
}
|
||||
} else if (mProcVar3.field_0x300e == 0) {
|
||||
if (mProcVar2.field_0x300c > 0 && (easySumo ? doButton() : doTrigger())) {
|
||||
if (mProcVar2.field_0x300c > 0 && (holdToMash ? doButton() : doTrigger())) {
|
||||
mProcVar2.field_0x300c--;
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ int daAlink_c::procSumouMove() {
|
||||
if (mSpeedModifier > 0.0f) {
|
||||
sp8 = frameCtrl_p->getRate();
|
||||
|
||||
if (easySumo ? doButton() : doTrigger()) {
|
||||
if (holdToMash ? doButton() : doTrigger()) {
|
||||
cLib_chaseF(&sp8, 1.5f, 0.1f);
|
||||
} else {
|
||||
cLib_addCalc(&sp8, 1.0f, 0.5f, 0.05f, 0.02f);
|
||||
|
||||
@@ -660,11 +660,11 @@ void daAlink_c::setSwimMoveAnime() {
|
||||
field_0x3478 = mpHIO->mSwim.m.mUnderwaterMinAnmSpeed;
|
||||
field_0x347c = mpHIO->mSwim.m.mUnderwaterMaxAnmSpeed;
|
||||
|
||||
IF_DUSK(const bool easySwim = DUSK_IF_ELSE(dusk::getSettings().game.holdToMash.swimming, false));
|
||||
IF_DUSK(const bool holdToMash = DUSK_IF_ELSE(dusk::getSettings().game.holdToMash, false));
|
||||
|
||||
if (mMaxSpeed < mpHIO->mSwim.m.mUnderwaterMaxSpeed) {
|
||||
mMaxSpeed = mpHIO->mSwim.m.mUnderwaterMaxSpeed;
|
||||
} else if (easySwim ? doButton() : doTrigger()) {
|
||||
} else if (holdToMash ? doButton() : doTrigger()) {
|
||||
mMaxSpeed += 0.75f;
|
||||
if (mMaxSpeed > temp_f29) {
|
||||
mMaxSpeed = temp_f29;
|
||||
|
||||
@@ -2947,7 +2947,7 @@ static void demo_camera(b_gnd_class* i_this) {
|
||||
s8 sp8 = false;
|
||||
#if TARGET_PC
|
||||
const s16 entry_demo_cam_mode = i_this->mDemoCamMode;
|
||||
const bool easyGanondorfQTE = DUSK_IF_ELSE(dusk::getSettings().game.holdToMash.ganondorf, false);
|
||||
const bool holdToMash = DUSK_IF_ELSE(dusk::getSettings().game.holdToMash, false);
|
||||
#endif
|
||||
switch (i_this->mDemoCamMode) {
|
||||
case 0:
|
||||
@@ -3406,7 +3406,7 @@ static void demo_camera(b_gnd_class* i_this) {
|
||||
cLib_addCalc2(&i_this->mDemoCamCenter.z, spF0.z + i_this->mDemoCamCenterTarget.z, 0.1f, 5.0f);
|
||||
}
|
||||
|
||||
if ((int)(easyGanondorfQTE ? mDoCPd_c::getHoldA(PAD_1) : mDoCPd_c::getTrigA(PAD_1)) != 0) {
|
||||
if ((int)(holdToMash ? mDoCPd_c::getHoldA(PAD_1) : mDoCPd_c::getTrigA(PAD_1)) != 0) {
|
||||
i_this->mTubazeriPushValue += 0.1f;
|
||||
if (i_this->mTubazeriPushValue > 1.0f) {
|
||||
i_this->mTubazeriPushValue = 1.0f;
|
||||
|
||||
@@ -750,21 +750,21 @@ void daE_GI_c::PushButtonCount() {
|
||||
mPushButtonCount++;
|
||||
}
|
||||
|
||||
IF_DUSK(const bool easyBloatQTE = DUSK_IF_ELSE(dusk::getSettings().game.holdToMash.twilitBloat, false));
|
||||
IF_DUSK(const bool holdToMash = DUSK_IF_ELSE(dusk::getSettings().game.holdToMash, false));
|
||||
|
||||
if (easyBloatQTE ? mDoCPd_c::getHoldA(PAD_1) : mDoCPd_c::getTrigA(PAD_1)) {
|
||||
if (holdToMash ? mDoCPd_c::getHoldA(PAD_1) : mDoCPd_c::getTrigA(PAD_1)) {
|
||||
mPushButtonCount += 2;
|
||||
}
|
||||
|
||||
if (easyBloatQTE ? mDoCPd_c::getHoldB(PAD_1) : mDoCPd_c::getTrigB(PAD_1)) {
|
||||
if (holdToMash ? mDoCPd_c::getHoldB(PAD_1) : mDoCPd_c::getTrigB(PAD_1)) {
|
||||
mPushButtonCount += 2;
|
||||
}
|
||||
|
||||
if (easyBloatQTE ? mDoCPd_c::getHoldL(PAD_1) : mDoCPd_c::getTrigL(PAD_1)) {
|
||||
if (holdToMash ? mDoCPd_c::getHoldL(PAD_1) : mDoCPd_c::getTrigL(PAD_1)) {
|
||||
mPushButtonCount += 2;
|
||||
}
|
||||
|
||||
if (easyBloatQTE ? mDoCPd_c::getHoldR(PAD_1) : mDoCPd_c::getTrigR(PAD_1)) {
|
||||
if (holdToMash ? mDoCPd_c::getHoldR(PAD_1) : mDoCPd_c::getTrigR(PAD_1)) {
|
||||
mPushButtonCount += 2;
|
||||
}
|
||||
|
||||
|
||||
+2
-10
@@ -51,12 +51,7 @@ UserSettings g_userSettings = {
|
||||
.buttonFishing {"game.buttonFishing", false},
|
||||
.instantSaves {"game.instantSaves", false},
|
||||
.instantText {"game.instantText", false},
|
||||
.holdToMash {
|
||||
.sumo {"game.holdToMash.sumo", false},
|
||||
.swimming {"game.holdToMash.swimming", false},
|
||||
.twilitBloat {"game.holdToMash.twilitBloat", false},
|
||||
.ganondorf {"game.holdToMash.ganondorf", false},
|
||||
},
|
||||
.holdToMash {"game.holdToMash", false},
|
||||
.sunsSong {"game.sunsSong", false},
|
||||
.autoSave {"game.autoSave", false},
|
||||
.enhancedMapMenus {"game.enhancedMapMenus", false},
|
||||
@@ -266,10 +261,7 @@ void registerSettings() {
|
||||
Register(g_userSettings.game.buttonFishing);
|
||||
Register(g_userSettings.game.instantSaves);
|
||||
Register(g_userSettings.game.instantText);
|
||||
Register(g_userSettings.game.holdToMash.sumo);
|
||||
Register(g_userSettings.game.holdToMash.swimming);
|
||||
Register(g_userSettings.game.holdToMash.twilitBloat);
|
||||
Register(g_userSettings.game.holdToMash.ganondorf);
|
||||
Register(g_userSettings.game.holdToMash);
|
||||
Register(g_userSettings.game.sunsSong);
|
||||
Register(g_userSettings.game.autoSave);
|
||||
Register(g_userSettings.game.enhancedMapMenus);
|
||||
|
||||
+1
-6
@@ -182,12 +182,7 @@ struct UserSettings {
|
||||
ConfigVar<bool> buttonFishing;
|
||||
ConfigVar<bool> instantSaves;
|
||||
ConfigVar<bool> instantText;
|
||||
struct {
|
||||
ConfigVar<bool> sumo;
|
||||
ConfigVar<bool> swimming;
|
||||
ConfigVar<bool> twilitBloat;
|
||||
ConfigVar<bool> ganondorf;
|
||||
} holdToMash;
|
||||
ConfigVar<bool> holdToMash;
|
||||
ConfigVar<bool> sunsSong;
|
||||
ConfigVar<bool> autoSave;
|
||||
ConfigVar<bool> enhancedMapMenus;
|
||||
|
||||
@@ -56,10 +56,7 @@ void resetForSpeedrunMode() {
|
||||
getSettings().game.damageMultiplier.setSpeedrunValue(1);
|
||||
getSettings().game.instantDeath.setSpeedrunValue(false);
|
||||
getSettings().game.noHeartDrops.setSpeedrunValue(false);
|
||||
getSettings().game.holdToMash.sumo.setSpeedrunValue(false);
|
||||
getSettings().game.holdToMash.swimming.setSpeedrunValue(false);
|
||||
getSettings().game.holdToMash.twilitBloat.setSpeedrunValue(false);
|
||||
getSettings().game.holdToMash.ganondorf.setSpeedrunValue(false);
|
||||
getSettings().game.holdToMash.setSpeedrunValue(false);
|
||||
getSettings().game.autoSave.setSpeedrunValue(false);
|
||||
getSettings().game.sunsSong.setSpeedrunValue(false);
|
||||
|
||||
|
||||
@@ -1214,51 +1214,8 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) {
|
||||
"Skips the delay when writing to the Memory Card.");
|
||||
addOption("Hold B for Instant Text", getSettings().game.instantText,
|
||||
"Makes text scroll immediately by holding B.");
|
||||
leftPane.register_control(
|
||||
leftPane.add_select_button({
|
||||
.key = "Hold Button to Mash",
|
||||
.getValue = [] {
|
||||
int count = 0;
|
||||
int total = 0;
|
||||
auto check = [&](bool enabled) { total++; if (enabled) count++; };
|
||||
check(getSettings().game.holdToMash.sumo);
|
||||
check(getSettings().game.holdToMash.swimming);
|
||||
check(getSettings().game.holdToMash.twilitBloat);
|
||||
check(getSettings().game.holdToMash.ganondorf);
|
||||
static thread_local char buf[12];
|
||||
std::snprintf(buf, sizeof(buf), "%d / %d", count, total);
|
||||
return Rml::String{buf};
|
||||
},
|
||||
.isModified = [] {
|
||||
return getSettings().game.holdToMash.sumo !=
|
||||
getSettings().game.holdToMash.sumo.getDefaultValue()
|
||||
|| getSettings().game.holdToMash.swimming !=
|
||||
getSettings().game.holdToMash.swimming.getDefaultValue()
|
||||
|| getSettings().game.holdToMash.twilitBloat !=
|
||||
getSettings().game.holdToMash.twilitBloat.getDefaultValue()
|
||||
|| getSettings().game.holdToMash.ganondorf !=
|
||||
getSettings().game.holdToMash.ganondorf.getDefaultValue();
|
||||
},
|
||||
}),
|
||||
rightPane, [](Pane& pane) {
|
||||
pane.clear();
|
||||
pane.add_rml(
|
||||
"Hold the indicated button to mash automatically.");
|
||||
auto addSubToggle = [&pane](const Rml::String& text, ConfigVar<bool>& var) {
|
||||
pane.add_button({
|
||||
.text = text,
|
||||
.isSelected = [&var] { return var.getValue(); },
|
||||
}).on_pressed([&var] {
|
||||
mDoAud_seStartMenu(kSoundItemChange);
|
||||
var.setValue(!var.getValue());
|
||||
config::save();
|
||||
});
|
||||
};
|
||||
addSubToggle("Sumo Wrestling", getSettings().game.holdToMash.sumo);
|
||||
addSubToggle("Swimming", getSettings().game.holdToMash.swimming);
|
||||
addSubToggle("Stunned by Twilit Bloat", getSettings().game.holdToMash.twilitBloat);
|
||||
addSubToggle("Ganondorf Chance", getSettings().game.holdToMash.ganondorf);
|
||||
});
|
||||
addSpeedrunDisabledOption("Hold Button to Mash", getSettings().game.holdToMash,
|
||||
"Hold the indicated button to mash automatically.");
|
||||
addOption("No Climbing Miss Animation", getSettings().game.noMissClimbing,
|
||||
"Prevents Link from playing a struggle animation when grabbing ledges or "
|
||||
"climbing on vines.");
|
||||
|
||||
Reference in New Issue
Block a user