Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 96 additions & 1 deletion Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
using Robust.Shared.Utility;
using Direction = Robust.Shared.Maths.Direction;
using static Content.Client.Corvax.SponsorOnlyHelpers; // Corvax-Sponsors
using Content.Client.Corvax.TTS; // Corvax-TTS
using Content.Client.Corvax.TTS;
using Content.Client.Lathe.UI; // Corvax-TTS

namespace Content.Client.Lobby.UI
{
Expand Down Expand Up @@ -195,6 +196,15 @@ public sealed partial class HumanoidProfileEditor : BoxContainer
private TextEdit? _securityRecordEdit; // WL-Records
private TextEdit? _employmentRecordEdit; // WL-Records

private LineEdit? _generalRecordNameEdit;
private LineEdit? _generalRecordAgeEdit;
private LineEdit? _generalRecordCountryEdit;

private OptionButton? _confederationButton; // WL-Recordss

private List<string> _confederations = new List<string>() {
"Конфедерация Орионских Государств", "СоцКон", "Межвидовой Альянс", "Священная Империя Эдема" };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужен метафронт, дальние земли и отсутствтует


private SingleMarkingPicker _underwearPicker => CUnderwearPicker; // WL-Underwear
private SingleMarkingPicker _undershirtPicker => CUndershirtPicker; // WL-Underwear
private SingleMarkingPicker _socksPicker => CSocksPicker; // WL-Underwear
Expand Down Expand Up @@ -743,6 +753,12 @@ public HumanoidProfileEditor(
RefreshFlavorText();

RefreshRecords(); // WL-Records

//_confederationButton.OnItemSelected += args =>
//{

//};

RefreshVoiceTab(); // Corvax-TTS

#region Dummy
Expand Down Expand Up @@ -822,9 +838,31 @@ public void RefreshRecords()
_securityRecordEdit = _recordsTab.SecurityRecordInput;
_employmentRecordEdit = _recordsTab.EmploymentRecordInput;

_generalRecordNameEdit = _recordsTab.NameEdit;
_generalRecordAgeEdit = _recordsTab.AgeEdit;
_generalRecordCountryEdit = _recordsTab.CountryEdit;

_confederationButton = _recordsTab.ConfederationButton;

_recordsTab.OnMedicalRecordChanged += OnMedicalRecordChange;
_recordsTab.OnSecurityRecordChanged += OnSecurityRecordChange;
_recordsTab.OnEmploymentRecordChanged += OnEmploymentRecordChange;

_recordsTab.OnGeneralRecordNameChanged += OnGeneralRecordNameChanged;
_recordsTab.OnGeneralRecordAgeChanged += OnGeneralRecordDateOfBirthChanged;
_recordsTab.OnGeneralRecordCountryChanged += OnGeneralRecordCountryChanged;

_recordsTab.OnGeneralRecordConfederationChanged += SetConfederation;

_confederations.Sort((a, b) => string.Compare(a, b, StringComparison.CurrentCultureIgnoreCase));

for (var i = 0; i < _confederations.Count; i++)
{
var name = _confederations[i];


_recordsTab.ConfederationButton.AddItem(name, i);
}
}

private void OnMedicalRecordChange(string content)
Expand Down Expand Up @@ -853,6 +891,44 @@ private void OnEmploymentRecordChange(string content)
Profile = Profile.WithEmploymentRecord(content);
SetDirty();
}

private void OnGeneralRecordNameChanged(string content)
{
if (Profile is null)
return;

Profile = Profile.WithFullName(content);
SetDirty();
}
private void OnGeneralRecordDateOfBirthChanged(string content)
{
if (Profile is null)
return;

Profile = Profile.WithDateOfBirth(content);
SetDirty();
}
private void OnGeneralRecordCountryChanged(string content)
{
if (Profile is null)
return;

Profile = Profile.WithCountry(content);
SetDirty();
}
private void SetConfederation(OptionButton.ItemSelectedEventArgs args)
{
if (_confederationButton is null)
return;

if (Profile is null)
return;

_confederationButton.SelectId(args.Id);
Profile = Profile.WithConfederation(_confederations[args.Id]);
SetDirty();
}
Comment on lines +902 to +937
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, let's understand the project structure
git ls-files | grep -E "\.(xaml|xaml\.cs)$" | head -20

Repository: corvax-team/ss14-wl

Length of output: 1256


🏁 Script executed:

# Find OptionButton definition
rg "class OptionButton" -A 10

Repository: corvax-team/ss14-wl

Length of output: 1104


🏁 Script executed:

# Look for SelectId method definition
rg "void SelectId|SelectId\(" -B 2 -A 5

Repository: corvax-team/ss14-wl

Length of output: 50375


🏁 Script executed:

# Search for OnItemSelected handler in the HumanoidProfileEditor file
rg "OnItemSelected|SetConfederation" Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs -B 2 -A 5

Repository: corvax-team/ss14-wl

Length of output: 2389


🏁 Script executed:

# Find OptionButton class definition
rg "class OptionButton" -A 30 --type cs

Repository: corvax-team/ss14-wl

Length of output: 2175


🏁 Script executed:

# Search for SelectId method implementation
rg "void SelectId|SelectId\(" --type cs -B 2 -A 10 | head -100

Repository: corvax-team/ss14-wl

Length of output: 9087


🏁 Script executed:

# Look for OptionButton in the UI framework
find . -name "*.cs" -type f | xargs grep -l "class OptionButton" 2>/dev/null

Repository: corvax-team/ss14-wl

Length of output: 127


🏁 Script executed:

# Look for OptionButton usage to understand the Select vs SelectId pattern
rg "\.Select\(|\.SelectId\(" --type cs | head -50

Repository: corvax-team/ss14-wl

Length of output: 7466


🏁 Script executed:

# Check if there's a RobustToolbox or external reference
find . -name "*.csproj" -type f | head -5 | xargs grep -l "RobustToolbox\|OptionButton" 2>/dev/null

Repository: corvax-team/ss14-wl

Length of output: 256


🏁 Script executed:

# Look at the HumanoidProfileEditor file directly around the SetConfederation method
sed -n '890,935p' Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs

Repository: corvax-team/ss14-wl

Length of output: 1285


🏁 Script executed:

# Check for bounds checking patterns in the codebase with _confederations
rg "_confederations\[" Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs -B 3 -A 3

Repository: corvax-team/ss14-wl

Length of output: 713


🏁 Script executed:

# Check the .csproj file for RobustToolbox reference
cat Content.Client/Content.Client.csproj | grep -A 5 -B 5 "RobustToolbox\|OptionButton"

Repository: corvax-team/ss14-wl

Length of output: 1109


🏁 Script executed:

# Look for more context on how confederations is populated and used
rg "_confederations" Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs -B 2 -A 2

Repository: corvax-team/ss14-wl

Length of output: 1087


🏁 Script executed:

# Check if there's any validation before indexing _confederations anywhere else in this file
rg "args.Id|args\.Id" Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs -B 3 -A 3

Repository: corvax-team/ss14-wl

Length of output: 1673


🏁 Script executed:

# Search for OptionButton in RobustToolbox directory if it exists
find . -name "OptionButton.cs" -o -name "*OptionButton*" -type f 2>/dev/null | grep -v ".xaml\|StyleSheetlets"

Repository: corvax-team/ss14-wl

Length of output: 125


🏁 Script executed:

# Check if RobustToolbox is a submodule or external
ls -la RobustToolbox 2>/dev/null || echo "RobustToolbox not found as directory"

Repository: corvax-team/ss14-wl

Length of output: 175


🏁 Script executed:

# Look at other similar validation patterns in the codebase for args.Id
rg "args\.Id.*>=" --type cs -B 2 -A 2 | head -50

Repository: corvax-team/ss14-wl

Length of output: 45


🏁 Script executed:

# Check the Options.OnItemSelected pattern in the same file to see if there's validation
sed -n '700,750p' Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs

Repository: corvax-team/ss14-wl

Length of output: 2081


🏁 Script executed:

# Look for bounds validation pattern with ItemSelectedEventArgs
rg "ItemSelectedEventArgs" --type cs -B 5 -A 8 | head -80

Repository: corvax-team/ss14-wl

Length of output: 6927


🏁 Script executed:

# Search for any error handling or validation of args.Id in handlers
rg "args\.Id.*<|args\.Id.*>=" --type cs

Repository: corvax-team/ss14-wl

Length of output: 45


🏁 Script executed:

# Check if there are any cases where handlers guard against invalid IDs
rg "if.*args\.Id|if.*args\.ButtonId" --type cs -B 2 -A 5 | head -60

Repository: corvax-team/ss14-wl

Length of output: 4621


Add bounds validation before accessing _confederations, but keep SelectId to maintain selection state sync.

The bounds check is good defensive programming: if ((uint) args.Id >= (uint) _confederations.Count) return; before indexing _confederations[args.Id]. However, removing SelectId is inconsistent with the same pattern used in other handlers in this file (e.g., SexButton, SpeciesButton, PreferenceUnavailableButton all call SelectId in their OnItemSelected handlers). The ubiquitous use of SelectId within item selection handlers throughout the codebase indicates it does not re-emit OnItemSelected—this pattern would be broken framework-wide if it did. Keep the SelectId call for proper UI state synchronization; just add the bounds check.

🤖 Prompt for AI Agents
In `@Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs` around lines 895 -
930, Add a bounds check before indexing _confederations in SetConfederation to
avoid out-of-range access while retaining the UI sync call; specifically, in
SetConfederation check that args.Id is within _confederations (e.g., cast to
uint and compare against _confederations.Count) and return early if out of
range, but keep the existing _confederationButton.SelectId(args.Id) and the
Profile = Profile.WithConfederation(_confederations[args.Id]); call order intact
so selection state stays synchronized.


// WL-Records-End
// Corvax-TTS-Start
#region Voice
Expand Down Expand Up @@ -1909,6 +1985,25 @@ private void UpdateRecordsEdit()

if (_employmentRecordEdit != null)
_employmentRecordEdit.TextRope = new Rope.Leaf(Profile?.EmploymentRecord ?? "");

if (_generalRecordNameEdit != null)
_generalRecordNameEdit.Text = Profile?.FullName ?? "";

if (_generalRecordAgeEdit != null)
_generalRecordAgeEdit.Text = Profile?.DateOfBirth ?? "";

if (_generalRecordCountryEdit != null)
_generalRecordCountryEdit.Text = Profile?.Country ?? "";

if (_confederationButton != null)
for (var i = 0; i < _confederations.Count; i++)
{

if (Profile?.Confederation.Equals(_confederations[i]) == true)
{
_confederationButton.SelectId(i);
}
}
Comment on lines +1996 to +2012
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, let's find and examine the HumanoidProfileEditor.xaml.cs file
fd -t f "HumanoidProfileEditor.xaml.cs" | head -5

Repository: corvax-team/ss14-wl

Length of output: 116


🏁 Script executed:

#!/bin/bash
# Read the file around lines 1989-2006
wc -l Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
echo "---"
sed -n '1980,2020p' Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs

Repository: corvax-team/ss14-wl

Length of output: 1642


🏁 Script executed:

#!/bin/bash
# Search for _confederations initialization and usage
echo "=== _confederations initialization ==="
rg "_confederations\s*=" Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs -B 2 -A 2

echo -e "\n=== _confederationButton initialization ==="
rg "_confederationButton\s*=" Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs -B 2 -A 2

echo -e "\n=== OptionButton class/type check ==="
rg "OptionButton" Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs -B 1 -A 1 | head -30

Repository: corvax-team/ss14-wl

Length of output: 862


🏁 Script executed:

#!/bin/bash
# Look at the SetConfederation method and surrounding context
echo "=== SetConfederation method ==="
rg "SetConfederation" Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs -B 2 -A 10

echo -e "\n=== OptionButton definition/API ==="
fd -t f "OptionButton" --extension cs | head -5

Repository: corvax-team/ss14-wl

Length of output: 1082


🏁 Script executed:

#!/bin/bash
# Find and examine OptionButton class
cat -n Content.Client/Stylesheets/Sheetlets/OptionButtonSheetlet.cs | head -100

Repository: corvax-team/ss14-wl

Length of output: 1442


🏁 Script executed:

#!/bin/bash
# Search for OptionButton class definition and methods
echo "=== Searching for OptionButton class ==="
rg "class OptionButton" --type cs

echo -e "\n=== Searching for SelectId method ==="
rg "SelectId\(" Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs -B 1 -A 3

echo -e "\n=== Searching for OptionButton methods in codebase ==="
rg "\.OptionButton\?\." Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs -o

Repository: corvax-team/ss14-wl

Length of output: 2312


🏁 Script executed:

#!/bin/bash
# Look at how other controls handle missing/no match scenarios
echo "=== UpdateGenders/UpdateSpecies patterns ==="
rg "UpdateGenders|UpdateSpecies|UpdateSex" Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs -A 8 | head -60

echo -e "\n=== Profile class to check Confederation property ==="
fd -t f "Profile\\.cs" | head -3

Repository: corvax-team/ss14-wl

Length of output: 1650


🏁 Script executed:

#!/bin/bash
# Get the full UpdateSexControls method
echo "=== Full UpdateSexControls method ==="
rg "private void UpdateSexControls" Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs -A 20

echo -e "\n=== Full UpdateGenderControls method ==="
rg "private void UpdateGenderControls" Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs -A 15

echo -e "\n=== Check Confederation property in Profile ==="
rg "Confederation" Content.Shared/Preferences/HumanoidCharacterProfile.cs -B 2 -A 2

Repository: corvax-team/ss14-wl

Length of output: 3062


🏁 Script executed:

#!/bin/bash
# Search for how Clear() is used with option buttons
echo "=== Clear() usage with buttons ==="
rg "Button\.Clear\(\)" Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs -B 2 -A 2

echo -e "\n=== Check if confederation can be empty in practice ==="
rg "Profile\.Confederation|WithConfederation" Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs | head -20

Repository: corvax-team/ss14-wl

Length of output: 443


Reset confederation selection when profile value is empty or unmatched.

The current logic persists previous selection when Profile?.Confederation is empty (default string.Empty) or unmatched, which can mislead users. Calling _confederationButton.Clear() when no match is found would address this, following the established pattern in UpdateSexControls().

Note: The suggested diff in the original comment assumes index 0 is a "None/—" entry, but _confederations actually contains four real confederations (sorted alphabetically), so that approach would incorrectly select the first confederation for empty profiles. Instead, clear the selection when no match is found:

🔧 Corrected approach
            if (_confederationButton != null)
-                for (var i = 0; i < _confederations.Count; i++)
+            {
+                var idx = _confederations.FindIndex(c =>
+                    string.Equals(Profile?.Confederation, c, StringComparison.CurrentCultureIgnoreCase));
+
+                if (idx >= 0)
+                    _confederationButton.SelectId(idx);
+                else
+                    _confederationButton.Clear();
+            }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (_generalRecordNameEdit != null)
_generalRecordNameEdit.Text = Profile?.FullName ?? "";
if (_generalRecordAgeEdit != null)
_generalRecordAgeEdit.Text = Profile?.DateOfBirth ?? "";
if (_generalRecordCountryEdit != null)
_generalRecordCountryEdit.Text = Profile?.Country ?? "";
if (_confederationButton != null)
for (var i = 0; i < _confederations.Count; i++)
{
if (Profile?.Confederation.Equals(_confederations[i]) == true)
{
_confederationButton.SelectId(i);
}
}
if (_generalRecordNameEdit != null)
_generalRecordNameEdit.Text = Profile?.FullName ?? "";
if (_generalRecordAgeEdit != null)
_generalRecordAgeEdit.Text = Profile?.DateOfBirth ?? "";
if (_generalRecordCountryEdit != null)
_generalRecordCountryEdit.Text = Profile?.Country ?? "";
if (_confederationButton != null)
{
var idx = _confederations.FindIndex(c =>
string.Equals(Profile?.Confederation, c, StringComparison.CurrentCultureIgnoreCase));
if (idx >= 0)
_confederationButton.SelectId(idx);
else
_confederationButton.Clear();
}
🤖 Prompt for AI Agents
In `@Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs` around lines 1989 -
2006, The confederation dropdown can retain a previous selection when
Profile?.Confederation is null/empty or doesn't match any entry; update the loop
controlling _confederationButton so it tracks whether a match was found while
iterating _confederations and, after the loop, call _confederationButton.Clear()
if no match was found (ensure you handle _confederationButton and
_confederations being non-null before operating); mirror the pattern used in
UpdateSexControls() to clear the control when the profile value is empty or
unmatched.

}
// WL-Records-End

Expand Down
38 changes: 38 additions & 0 deletions Content.Client/_WL/Records/RecordsTab.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,44 @@

<ScrollContainer HScrollEnabled="False" VerticalExpand="True">
<BoxContainer Orientation="Vertical" VerticalExpand="True">

<PanelContainer StyleClasses="AngleRect" HorizontalExpand="True" Margin="0 0 0 5">
<BoxContainer Orientation="Vertical" Margin="5">
<Label Text="ОБЩИЕ СВЕДЕНИЯ" StyleClasses="LabelBig" FontColorOverride="#2196F3"/>
<PanelContainer StyleClasses="Inset" Margin="0 5 0 0" HorizontalExpand="True">
<PanelContainer.PanelOverride>
<graphics:StyleBoxFlat BackgroundColor="#1E1E1E" ContentMarginLeftOverride="5" ContentMarginBottomOverride="5"/>
</PanelContainer.PanelOverride>
<BoxContainer Orientation="Vertical" HorizontalExpand="True">

<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<Label Text="ФИО:" />
<Control MinWidth="10"/>
<LineEdit Name="NameEdit" MinWidth="250" Access="Public"/>
</BoxContainer>

<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<Label Text="Дата рождения:" />
<Control MinWidth="10"/>
<LineEdit Name="AgeEdit" MinWidth="150" Access="Public"/>
</BoxContainer>

<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<Label Text="Конфедерация:" />
<Control MinWidth="10"/>
<OptionButton Name="ConfederationButton" HorizontalAlignment="Right" Access="Public"/>
</BoxContainer>

<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<Label Text="Государство:" />
<Control MinWidth="10"/>
<LineEdit Name="CountryEdit" MinWidth="250" Access="Public"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Localize the new general‑info labels.
Other sections use {Loc ...}; these hard-coded strings won’t translate for non‑Russian locales. Please add localization keys and reference them here.

💡 Suggested XAML change (add matching locale entries)
- <Label Text="ОБЩИЕ СВЕДЕНИЯ" StyleClasses="LabelBig" FontColorOverride="#2196F3"/>
+ <Label Text="{Loc 'records-general-info'}" StyleClasses="LabelBig" FontColorOverride="#2196F3"/>

- <Label Text="ФИО:" />
+ <Label Text="{Loc 'records-full-name'}" />

- <Label Text="Дата рождения:" />
+ <Label Text="{Loc 'records-date-of-birth'}" />

- <Label Text="Конфедерация:" />
+ <Label Text="{Loc 'records-confederation'}" />

- <Label Text="Государство:" />
+ <Label Text="{Loc 'records-country'}" />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Label Text="ОБЩИЕ СВЕДЕНИЯ" StyleClasses="LabelBig" FontColorOverride="#2196F3"/>
<PanelContainer StyleClasses="Inset" Margin="0 5 0 0" HorizontalExpand="True">
<PanelContainer.PanelOverride>
<graphics:StyleBoxFlat BackgroundColor="#1E1E1E" ContentMarginLeftOverride="5" ContentMarginBottomOverride="5"/>
</PanelContainer.PanelOverride>
<BoxContainer Orientation="Vertical" HorizontalExpand="True">
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<Label Text="ФИО:" />
<Control MinWidth="10"/>
<LineEdit Name="NameEdit" MinWidth="250" Access="Public"/>
</BoxContainer>
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<Label Text="Дата рождения:" />
<Control MinWidth="10"/>
<LineEdit Name="AgeEdit" MinWidth="150" Access="Public"/>
</BoxContainer>
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<Label Text="Конфедерация:" />
<Control MinWidth="10"/>
<OptionButton Name="ConfederationButton" HorizontalAlignment="Right" Access="Public"/>
</BoxContainer>
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<Label Text="Государство:" />
<Control MinWidth="10"/>
<LineEdit Name="CountryEdit" MinWidth="250" Access="Public"/>
<Label Text="{Loc 'records-general-info'}" StyleClasses="LabelBig" FontColorOverride="#2196F3"/>
<PanelContainer StyleClasses="Inset" Margin="0 5 0 0" HorizontalExpand="True">
<PanelContainer.PanelOverride>
<graphics:StyleBoxFlat BackgroundColor="#1E1E1E" ContentMarginLeftOverride="5" ContentMarginBottomOverride="5"/>
</PanelContainer.PanelOverride>
<BoxContainer Orientation="Vertical" HorizontalExpand="True">
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<Label Text="{Loc 'records-full-name'}" />
<Control MinWidth="10"/>
<LineEdit Name="NameEdit" MinWidth="250" Access="Public"/>
</BoxContainer>
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<Label Text="{Loc 'records-date-of-birth'}" />
<Control MinWidth="10"/>
<LineEdit Name="AgeEdit" MinWidth="150" Access="Public"/>
</BoxContainer>
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<Label Text="{Loc 'records-confederation'}" />
<Control MinWidth="10"/>
<OptionButton Name="ConfederationButton" HorizontalAlignment="Right" Access="Public"/>
</BoxContainer>
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<Label Text="{Loc 'records-country'}" />
<Control MinWidth="10"/>
<LineEdit Name="CountryEdit" MinWidth="250" Access="Public"/>
🤖 Prompt for AI Agents
In `@Content.Client/_WL/Records/RecordsTab.xaml` around lines 10 - 38, Replace the
hard-coded Russian label texts with localization tokens (use the {Loc <Key>}
syntax) for the header Label ("ОБЩИЕ СВЕДЕНИЯ") and the field Labels "ФИО:",
"Дата рождения:", "Конфедерация:", and "Государство:" (refer to UI elements
Label, NameEdit, AgeEdit, ConfederationButton, CountryEdit to locate them) and
add corresponding entries to the app locale resource(s) with matching keys and
Russian values so the UI can be translated for other locales.

</BoxContainer>

</BoxContainer>
</PanelContainer>
</BoxContainer>
</PanelContainer>

<PanelContainer StyleClasses="AngleRect" HorizontalExpand="True" Margin="0 0 0 5">
<BoxContainer Orientation="Vertical" Margin="5">
Expand Down
11 changes: 11 additions & 0 deletions Content.Client/_WL/Records/RecordsTab.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Localization;
using Robust.Shared.Utility;
Expand All @@ -12,6 +13,10 @@ public sealed partial class RecordsTab : Control
public Action<string>? OnMedicalRecordChanged;
public Action<string>? OnSecurityRecordChanged;
public Action<string>? OnEmploymentRecordChanged;
public Action<string>? OnGeneralRecordNameChanged;
public Action<string>? OnGeneralRecordAgeChanged;
public Action<OptionButton.ItemSelectedEventArgs>? OnGeneralRecordConfederationChanged;
public Action<string>? OnGeneralRecordCountryChanged;

public RecordsTab()
{
Expand All @@ -26,6 +31,12 @@ public RecordsTab()
SecurityRecordInput.OnTextChanged += _ => OnSecurityRecordChanged?.Invoke(Rope.Collapse(SecurityRecordInput.TextRope).Trim());
EmploymentRecordInput.OnTextChanged += _ => OnEmploymentRecordChanged?.Invoke(Rope.Collapse(EmploymentRecordInput.TextRope).Trim());

NameEdit.OnTextChanged += _ => OnGeneralRecordNameChanged?.Invoke(NameEdit.Text.Trim());
AgeEdit.OnTextChanged += _ => OnGeneralRecordAgeChanged?.Invoke(AgeEdit.Text.Trim());
CountryEdit.OnTextChanged += _ => OnGeneralRecordCountryChanged?.Invoke(CountryEdit.Text.Trim());

ConfederationButton.OnItemSelected += _ => OnGeneralRecordConfederationChanged?.Invoke(_);

MedicalTemplateButton.OnPressed += _ => LoadMedicalTemplate();
SecurityTemplateButton.OnPressed += _ => LoadSecurityTemplate();
EmploymentTemplateButton.OnPressed += _ => LoadEmploymentTemplate();
Expand Down
Loading
Loading