Fix AgeRequirement Showing Int32 Maximum (#1732)

I did separate locales because it'd be messy otherwise.

🆑
- fix: Loadouts will no longer show the integer limit.

(cherry picked from commit ef5d0e770f390c38dfd4ba173886598de1e96572)
This commit is contained in:
sleepyyapril
2025-02-07 02:52:55 -04:00
committed by Spatison
parent 382ad97b97
commit ec2e483dd8
2 changed files with 20 additions and 3 deletions

View File

@@ -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,
@@ -41,8 +41,15 @@ public sealed partial class CharacterAgeRequirement : CharacterRequirement
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));

View File

@@ -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