From 65e76dcfeec3924ca9977c931703b4c3232a9733 Mon Sep 17 00:00:00 2001 From: Baoulettes Date: Sat, 27 Aug 2022 17:45:09 +0200 Subject: [PATCH] few fix and paper Link --- soh/CMakeLists.txt | 2 +- soh/soh/Enhancements/debugconsole.cpp | 12 ++++++++++-- soh/soh/Enhancements/debugconsole.h | 1 + soh/src/overlays/actors/ovl_player_actor/z_player.c | 12 ++++++++++++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index aa91b1c23..d0faf11dd 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -1688,7 +1688,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows") "_DEBUG;" "_CRT_SECURE_NO_WARNINGS;" "ENABLE_DX11;" - "ENABLE_CROWD_CONTROL" + #"ENABLE_CROWD_CONTROL" ">" "$<$:" "NDEBUG" diff --git a/soh/soh/Enhancements/debugconsole.cpp b/soh/soh/Enhancements/debugconsole.cpp index 253a57741..a610f9cdf 100644 --- a/soh/soh/Enhancements/debugconsole.cpp +++ b/soh/soh/Enhancements/debugconsole.cpp @@ -33,7 +33,8 @@ extern GlobalContext* gGlobalCtx; uint32_t giantLink; uint32_t minishLink; -uint32_t gravityLevel; +uint32_t paperLink; +uint32_t gravityLevel = 1; uint32_t resetLinkScale; uint32_t invisibleLink; uint32_t oneHitKO; @@ -656,11 +657,18 @@ static bool PaperLinkHandler(std::shared_ptr Console, const std:: return CMD_FAILED; } - // TODO: Implement + try { + paperLink = Ship::Math::clamp(std::stoi(args[1], nullptr, 10), 0.0f, 2.0f); + return CMD_SUCCESS; + } catch (std::invalid_argument const& ex) { + SohImGui::console->SendErrorMessage("[SOH] Paper Link value must be a number."); + return CMD_FAILED; + } } static bool RainstormHandler(std::shared_ptr Console, const std::vector& args) { // TODO: Implement + return CMD_FAILED; } static bool ReverseControlsHandler(std::shared_ptr Console, const std::vector& args) { diff --git a/soh/soh/Enhancements/debugconsole.h b/soh/soh/Enhancements/debugconsole.h index 2ffe2f432..09463e7c4 100644 --- a/soh/soh/Enhancements/debugconsole.h +++ b/soh/soh/Enhancements/debugconsole.h @@ -7,6 +7,7 @@ extern "C" { #endif extern uint32_t giantLink; extern uint32_t minishLink; +extern uint32_t paperLink; extern uint32_t gravityLevel; extern uint32_t resetLinkScale; extern uint32_t invisibleLink; diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index d9994bed6..ffdcc9456 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -11118,6 +11118,18 @@ void Player_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.scale.z = 0.001f; } + if (paperLink == 1) { + this->actor.scale.x = 0.001f; + this->actor.scale.y = 0.01f; + this->actor.scale.z = 0.01f; + } + + if (paperLink == 2) { + this->actor.scale.x = 0.01f; + this->actor.scale.y = 0.01f; + this->actor.scale.z = 0.001f; + } + if (resetLinkScale == 1) { this->actor.scale.x = 0.01f; this->actor.scale.y = 0.01f;