-
Notifications
You must be signed in to change notification settings - Fork 31
Updare StationRecords #478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
cfa306b
8c73227
becbcd9
d626c21
d847a12
9ec21b9
867d9b4
4297bd9
2608f37
ca1db0b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -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>() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Конфедерация Орионских Государств", "СоцКон", "Межвидовой Альянс", "Священная Империя Эдема" }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private SingleMarkingPicker _underwearPicker => CUnderwearPicker; // WL-Underwear | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private SingleMarkingPicker _undershirtPicker => CUndershirtPicker; // WL-Underwear | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private SingleMarkingPicker _socksPicker => CSocksPicker; // WL-Underwear | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -743,6 +753,12 @@ public HumanoidProfileEditor( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RefreshFlavorText(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RefreshRecords(); // WL-Records | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //_confederationButton.OnItemSelected += args => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| RefreshVoiceTab(); // Corvax-TTS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #region Dummy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -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) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, let's understand the project structure
git ls-files | grep -E "\.(xaml|xaml\.cs)$" | head -20Repository: corvax-team/ss14-wl Length of output: 1256 🏁 Script executed: # Find OptionButton definition
rg "class OptionButton" -A 10Repository: corvax-team/ss14-wl Length of output: 1104 🏁 Script executed: # Look for SelectId method definition
rg "void SelectId|SelectId\(" -B 2 -A 5Repository: 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 5Repository: corvax-team/ss14-wl Length of output: 2389 🏁 Script executed: # Find OptionButton class definition
rg "class OptionButton" -A 30 --type csRepository: 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 -100Repository: 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/nullRepository: 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 -50Repository: 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/nullRepository: 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.csRepository: 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 3Repository: 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 2Repository: 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 3Repository: 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 -50Repository: 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.csRepository: 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 -80Repository: 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 csRepository: 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 -60Repository: 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: 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // WL-Records-End | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Corvax-TTS-Start | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #region Voice | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# First, let's find and examine the HumanoidProfileEditor.xaml.cs file
fd -t f "HumanoidProfileEditor.xaml.cs" | head -5Repository: 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.csRepository: 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 -30Repository: 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 -5Repository: 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 -100Repository: 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 -oRepository: 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 -3Repository: 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 2Repository: 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 -20Repository: 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 Note: The suggested diff in the original comment assumes index 0 is a "None/—" entry, but 🔧 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
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // WL-Records-End | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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"/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нужен метафронт, дальние земли и отсутствтует