Skip to content

Commit

Permalink
Better method and now use the reset flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Baoulettes committed Sep 1, 2022
1 parent 65e76dc commit 2aafcc1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
19 changes: 14 additions & 5 deletions soh/soh/Enhancements/debugconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,12 @@ static bool GiantLinkHandler(std::shared_ptr<Ship::Console> Console, const std::

try {
giantLink = std::stoi(args[1], nullptr, 10) == 0 ? 0 : 1;
if (giantLink)
if (giantLink) {
paperLink = 0;
minishLink = 0;
else
} else {
resetLinkScale = 1;
}

return CMD_SUCCESS;
} catch (std::invalid_argument const& ex) {
Expand All @@ -487,13 +489,14 @@ static bool MinishLinkHandler(std::shared_ptr<Ship::Console> Console, const std:
}

try {
resetLinkScale = 1;
minishLink = std::stoi(args[1], nullptr, 10) == 0 ? 0 : 1;

if (minishLink)
if (minishLink) {
paperLink = 0;
giantLink = 0;
else
} else {
resetLinkScale = 1;
}

return CMD_SUCCESS;
} catch (std::invalid_argument const& ex) {
Expand Down Expand Up @@ -659,6 +662,12 @@ static bool PaperLinkHandler(std::shared_ptr<Ship::Console> Console, const std::

try {
paperLink = Ship::Math::clamp(std::stoi(args[1], nullptr, 10), 0.0f, 2.0f);
if (paperLink) {
minishLink = 0;
giantLink = 0;
} else {
resetLinkScale = 1;
}
return CMD_SUCCESS;
} catch (std::invalid_argument const& ex) {
SohImGui::console->SendErrorMessage("[SOH] Paper Link value must be a number.");
Expand Down
12 changes: 3 additions & 9 deletions soh/src/overlays/actors/ovl_player_actor/z_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -11118,16 +11118,10 @@ void Player_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actor.scale.z = 0.001f;
}

if (paperLink == 1) {
this->actor.scale.x = 0.001f;
if (paperLink != 0) {
this->actor.scale.x = paperLink == 1 ? 0.001f : 0.01f;
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;
this->actor.scale.z = paperLink == 2 ? 0.001f : 0.01f;
}

if (resetLinkScale == 1) {
Expand Down

0 comments on commit 2aafcc1

Please sign in to comment.