mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
[Enhancement] Instant Putaway (#547)
* Instant Putaway Enhancement Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com> * Tweak some things and merge with Player Movement --------- Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
This commit is contained in:
co-authored by
Garrett Cox
parent
f8f00e6d9b
commit
d2a11f1476
@@ -591,10 +591,11 @@ void DrawEnhancementsMenu() {
|
||||
}
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
if (UIWidgets::BeginMenu("Player Movement")) {
|
||||
UIWidgets::CVarSliderInt("Climb speed", "gEnhancements.PlayerMovement.ClimbSpeed", 1, 5, 1,
|
||||
if (UIWidgets::BeginMenu("Player")) {
|
||||
UIWidgets::CVarSliderInt("Climb speed", "gEnhancements.Player.ClimbSpeed", 1, 5, 1,
|
||||
{ .tooltip = "Increases the speed at which Link climbs vines and ladders." });
|
||||
|
||||
UIWidgets::CVarCheckbox("Instant Putaway", "gEnhancements.Player.InstantPutaway",
|
||||
{ .tooltip = "Allows Link to instantly puts away held item without waiting." });
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,10 @@ void InitEnhancements() {
|
||||
// Minigames
|
||||
RegisterAlwaysWinDoggyRace();
|
||||
|
||||
// Player
|
||||
RegisterClimbSpeed();
|
||||
RegisterInstantPutaway();
|
||||
|
||||
// Songs
|
||||
RegisterEnableSunsSong();
|
||||
|
||||
@@ -53,7 +57,4 @@ void InitEnhancements() {
|
||||
// Modes
|
||||
RegisterPlayAsKafei();
|
||||
RegisterTimeMovesWhenYouMove();
|
||||
|
||||
// Player Movement
|
||||
RegisterClimbSpeed();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "Restorations/SideRoll.h"
|
||||
#include "Restorations/TatlISG.h"
|
||||
#include "Graphics/PlayAsKafei.h"
|
||||
#include "PlayerMovement/ClimbSpeed.h"
|
||||
#include "Player/Player.h"
|
||||
#include "Songs/EnableSunsSong.h"
|
||||
#include "Saving/SavingEnhancements.h"
|
||||
#include "Graphics/DisableBlackBars.h"
|
||||
|
||||
@@ -42,6 +42,7 @@ typedef enum {
|
||||
GI_VB_PATCH_SIDEROLL,
|
||||
GI_VB_TATL_CONVERSATION_AVAILABLE,
|
||||
GI_VB_PREVENT_MASK_TRANSFORMATION_CS,
|
||||
GI_VB_RESET_PUTAWAY_TIMER,
|
||||
GI_VB_SET_CLIMB_SPEED,
|
||||
GI_VB_PREVENT_CLOCK_DISPLAY,
|
||||
GI_VB_SONG_AVAILABLE_TO_PLAY,
|
||||
|
||||
+2
-2
@@ -3,9 +3,9 @@
|
||||
|
||||
void RegisterClimbSpeed() {
|
||||
REGISTER_VB_SHOULD(GI_VB_SET_CLIMB_SPEED, {
|
||||
if (CVarGetInteger("gEnhancements.PlayerMovement.ClimbSpeed", 1) > 1) {
|
||||
if (CVarGetInteger("gEnhancements.Player.ClimbSpeed", 1) > 1) {
|
||||
f32* speed = static_cast<f32*>(opt);
|
||||
*speed *= CVarGetInteger("gEnhancements.PlayerMovement.ClimbSpeed", 1);
|
||||
*speed *= CVarGetInteger("gEnhancements.Player.ClimbSpeed", 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#include <libultraship/bridge.h>
|
||||
#include "Enhancements/GameInteractor/GameInteractor.h"
|
||||
|
||||
void RegisterInstantPutaway() {
|
||||
REGISTER_VB_SHOULD(GI_VB_RESET_PUTAWAY_TIMER, {
|
||||
if (CVarGetInteger("gEnhancements.Player.InstantPutaway", 0)) {
|
||||
*should = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#ifndef PLAYER_H
|
||||
#define PLAYER_H
|
||||
|
||||
void RegisterClimbSpeed();
|
||||
void RegisterInstantPutaway();
|
||||
|
||||
#endif // PLAYER_H
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef PLAYER_MOVEMENT_CLIMB_SPEED_H
|
||||
#define PLAYER_MOVEMENT_CLIMB_SPEED_H
|
||||
|
||||
void RegisterClimbSpeed();
|
||||
|
||||
#endif // PLAYER_MOVEMENT_CLIMB_SPEED_H
|
||||
@@ -11247,7 +11247,9 @@ void Player_SetDoAction(PlayState* play, Player* this) {
|
||||
}
|
||||
|
||||
if (doActionA != DO_ACTION_PUTAWAY) {
|
||||
this->putAwayCountdown = 20;
|
||||
if (GameInteractor_Should(GI_VB_RESET_PUTAWAY_TIMER, true, NULL)) {
|
||||
this->putAwayCountdown = 20;
|
||||
}
|
||||
} else if (this->putAwayCountdown != 0) {
|
||||
doActionA = DO_ACTION_NONE;
|
||||
this->putAwayCountdown--;
|
||||
|
||||
Reference in New Issue
Block a user