Spindash helper warning

This commit is contained in:
Antonio Martinez 2025-08-30 03:40:19 -04:00
parent ca8e46b0ea
commit 2fbc8346e5

View file

@ -415,7 +415,7 @@ std::optional<TargetTracking::Tooltip> object_tooltip(const mobj_t* mobj)
auto conditional = [](bool val, auto&& f) { return val ? std::optional<Tooltip> {f()} : std::nullopt; }; auto conditional = [](bool val, auto&& f) { return val ? std::optional<Tooltip> {f()} : std::nullopt; };
Draw::Font splitfont = (r_splitscreen > 1) ? Draw::Font::kThin : Draw::Font::kMenu; Draw::Font splitfont = (r_splitscreen > 1) ? Draw::Font::kThin : Draw::Font::kMedium;
switch (mobj->type) switch (mobj->type)
{ {
@ -457,7 +457,7 @@ std::optional<TargetTracking::Tooltip> object_tooltip(const mobj_t* mobj)
case MT_GARDENTOP: case MT_GARDENTOP:
return conditional( return conditional(
mobj->tracer == stplyr->mo && Obj_GardenTopPlayerNeedsHelp(mobj), mobj->tracer == stplyr->mo && Obj_GardenTopPlayerNeedsHelp(mobj),
[&] { return TextElement().parse("Try <r>!").font(splitfont); } [&] { return TextElement().parse("TRY <r_animated>").font(splitfont); }
); );
case MT_PLAYER: case MT_PLAYER:
@ -482,11 +482,31 @@ std::optional<TargetTracking::Tooltip> object_tooltip(const mobj_t* mobj)
.offset3d(0, 0, 32 * mobj->scale * P_MobjFlip(mobj)); .offset3d(0, 0, 32 * mobj->scale * P_MobjFlip(mobj));
} }
if (mobj->player == stplyr && K_ApplyOffroad(stplyr) && stplyr->offroad == FRACUNIT && !stplyr->spindash
&& stplyr->boostpower < FRACUNIT && stplyr->speed < 2*K_GetKartSpeed(stplyr, false, false)/3)
{
if (stplyr->itemamount &&
(stplyr->itemtype == KITEM_SNEAKER || stplyr->itemtype == KITEM_INVINCIBILITY || stplyr->itemtype == KITEM_ROCKETSNEAKER
|| stplyr->itemtype == KITEM_FLAMESHIELD || stplyr->itemtype == KITEM_GROW)
)
return Tooltip(
TextElement(
TextElement().parse("BOOST <l_animated>").font(splitfont))
)
.offset3d(0, 0, 64 * mobj->scale * P_MobjFlip(mobj));
return Tooltip(
TextElement(
TextElement().parse("HOLD <c_animated>").font(splitfont))
)
.offset3d(0, 0, 64 * mobj->scale * P_MobjFlip(mobj));
}
return conditional( return conditional(
mobj->player == stplyr && stplyr->icecube.frozen, mobj->player == stplyr && stplyr->icecube.frozen,
[&] { return Tooltip(TextElement( [&] { return Tooltip(TextElement(
(leveltime/(TICRATE/2)%2) ? (leveltime/(TICRATE/2)%2) ?
TextElement().parse("<r_animated>").font(splitfont) : TextElement().parse("<r_animated>").font(splitfont) :
TextElement().parse("<a_animated>").font(splitfont) TextElement().parse("<a_animated>").font(splitfont)
)).offset3d(0, 0, 64 * mobj->scale * P_MobjFlip(mobj)); } )).offset3d(0, 0, 64 * mobj->scale * P_MobjFlip(mobj)); }
// I will be trying to figure out why the return value didn't accept a straightforward call to parse() for the rest of my life (apprx. 15 seconds) // I will be trying to figure out why the return value didn't accept a straightforward call to parse() for the rest of my life (apprx. 15 seconds)
@ -924,7 +944,7 @@ void K_drawTargetHUD(const vector3_t* origin, player_t* player)
else else
{ {
pos.z += itemOffset; pos.z += itemOffset;
} }
} }
K_ObjectTracking(&tr.result, &pos, false); K_ObjectTracking(&tr.result, &pos, false);