Skip to content

Commit

Permalink
Fix AgeRequirement Showing Int32 Maximum (#1732)
Browse files Browse the repository at this point in the history
I did separate locales because it'd be messy otherwise.

:cl:
- fix: Loadouts will no longer show the integer limit.
  • Loading branch information
sleepyyapril authored Feb 7, 2025
1 parent bfed410 commit ef5d0e7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public sealed partial class CharacterAgeRequirement : CharacterRequirement
public int Min;

[DataField]
public int Max = 2147483647;
public int Max = Int32.MaxValue;

public override bool IsValid(
JobPrototype job,
Expand All @@ -41,8 +41,15 @@ public override bool IsValid(
int depth = 0
)
{
var localeString = "";

if (Max == Int32.MaxValue || Min <= 0)
localeString = Max == Int32.MaxValue ? "character-age-requirement-minimum-only" : "character-age-requirement-maximum-only";
else
localeString = "character-age-requirement-range";

reason = Loc.GetString(
"character-age-requirement",
localeString,
("inverted", Inverted),
("min", Min),
("max", Max));
Expand Down
12 changes: 11 additions & 1 deletion Resources/Locale/en-US/customization/character-requirements.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,21 @@ character-logic-xor-requirement = You must{$inverted ->
## Profile
character-age-requirement = You must{$inverted ->
character-age-requirement-range = You must{$inverted ->
[true]{" "}not
*[other]{""}
} be within [color=yellow]{$min}[/color] and [color=yellow]{$max}[/color] years old
character-age-requirement-minimum-only = You must{$inverted ->
[true]{" "}not
*[other]{""}
} be at least [color=yellow]{$min}[/color] years old
character-age-requirement-maximum-only = You must{$inverted ->
[true]{""}
*[other]{" "}not
} be older than [color=yellow]{$max}[/color] years old
character-backpack-type-requirement = You must {$inverted ->
[true] not use
*[other] use
Expand Down

0 comments on commit ef5d0e7

Please sign in to comment.