From ef5d0e770f390c38dfd4ba173886598de1e96572 Mon Sep 17 00:00:00 2001 From: sleepyyapril <123355664+sleepyyapril@users.noreply.github.com> Date: Fri, 7 Feb 2025 02:52:55 -0400 Subject: [PATCH] Fix AgeRequirement Showing Int32 Maximum (#1732) I did separate locales because it'd be messy otherwise. :cl: - fix: Loadouts will no longer show the integer limit. --- .../Systems/CharacterRequirements.Profile.cs | 11 +++++++++-- .../en-US/customization/character-requirements.ftl | 12 +++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Content.Shared/Customization/Systems/CharacterRequirements.Profile.cs b/Content.Shared/Customization/Systems/CharacterRequirements.Profile.cs index 2ba8bfb2f92..bf6dff7a041 100644 --- a/Content.Shared/Customization/Systems/CharacterRequirements.Profile.cs +++ b/Content.Shared/Customization/Systems/CharacterRequirements.Profile.cs @@ -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 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)); diff --git a/Resources/Locale/en-US/customization/character-requirements.ftl b/Resources/Locale/en-US/customization/character-requirements.ftl index 900e15ea66e..ddddbc7440f 100644 --- a/Resources/Locale/en-US/customization/character-requirements.ftl +++ b/Resources/Locale/en-US/customization/character-requirements.ftl @@ -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