From e29ebc3b7dff8577472845d20c166fbfb92ca129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schr=C3=B6dinger?= <132720404+Schrodinger71@users.noreply.github.com> Date: Sat, 1 Feb 2025 00:08:38 +0300 Subject: [PATCH 1/6] [Bug FIX] fix bug Language --- .../Language/UI/HumanoidProfileEditor.Languages.cs | 2 +- Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Content.Client/ADT/Language/UI/HumanoidProfileEditor.Languages.cs b/Content.Client/ADT/Language/UI/HumanoidProfileEditor.Languages.cs index 94a3297645e..ea2a8f37c2b 100644 --- a/Content.Client/ADT/Language/UI/HumanoidProfileEditor.Languages.cs +++ b/Content.Client/ADT/Language/UI/HumanoidProfileEditor.Languages.cs @@ -73,7 +73,7 @@ public void SelectLanguage(string protoId) RefreshLanguages(); } - private void SetDefaultLanguages(BaseButton.ButtonEventArgs args) + public void SetDefaultLanguages(BaseButton.ButtonEventArgs args) { if (Profile == null) return; diff --git a/Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs b/Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs index a1134112e1f..933848eb5be 100644 --- a/Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs +++ b/Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs @@ -13,6 +13,7 @@ using Robust.Client.UserInterface.XAML; using Robust.Shared.ContentPack; using Robust.Shared.Prototypes; +using Content.Client.Lobby.UI; namespace Content.Client.ADT.Lobby.UI; @@ -27,6 +28,7 @@ public sealed partial class SpeciesWindow : FancyWindow private readonly IPrototypeManager _proto; private readonly LobbyUIController _uIController; private readonly IResourceManager _resMan; + private readonly HumanoidProfileEditor _humanoidProfileEditor; [Dependency] private readonly DocumentParsingManager _parsingMan = default!; public SpeciesWindow(HumanoidCharacterProfile profile, @@ -34,7 +36,8 @@ public SpeciesWindow(HumanoidCharacterProfile profile, IEntityManager entMan, LobbyUIController uIController, IResourceManager resManager, - DocumentParsingManager parsing) + DocumentParsingManager parsing, + HumanoidProfileEditor humanoidProfileEditor) { RobustXamlLoader.Load(this); IoCManager.InjectDependencies(this); @@ -46,6 +49,7 @@ public SpeciesWindow(HumanoidCharacterProfile profile, _proto = proto; _uIController = uIController; _resMan = resManager; + _humanoidProfileEditor = humanoidProfileEditor; var protoList = _proto.EnumeratePrototypes().Where(x => x.RoundStart).ToList(); protoList.Sort((x, y) => Loc.GetString(x.Name)[0].CompareTo(Loc.GetString(y.Name)[0])); @@ -177,7 +181,11 @@ public void SelectSpecies(ProtoId protoId) JobLoadout.SetEntity(loadoutMob); Select.Disabled = Profile.Species == protoId; - Select.OnPressed += args => ChooseAction?.Invoke(protoId); + Select.OnPressed += args => + { + ChooseAction?.Invoke(protoId); + _humanoidProfileEditor.SetDefaultLanguages(args); + }; // Тут у нас идёт штука для создание контейнера плюсов и минусов. Я не уверен, зачем я впихнул это сюда, но мне уже лень переделывать var prosConsContainer = new BoxContainer() From 2b36fde4983e480ae934672a0e76d18a790abb4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schr=C3=B6dinger?= <132720404+Schrodinger71@users.noreply.github.com> Date: Sat, 1 Feb 2025 00:14:01 +0300 Subject: [PATCH 2/6] fix? --- Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs b/Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs index 933848eb5be..f8185519ab3 100644 --- a/Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs +++ b/Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs @@ -28,7 +28,7 @@ public sealed partial class SpeciesWindow : FancyWindow private readonly IPrototypeManager _proto; private readonly LobbyUIController _uIController; private readonly IResourceManager _resMan; - private readonly HumanoidProfileEditor _humanoidProfileEditor; + [Dependency] private readonly HumanoidProfileEditor _humanoidProfileEditor = default!; [Dependency] private readonly DocumentParsingManager _parsingMan = default!; public SpeciesWindow(HumanoidCharacterProfile profile, @@ -36,8 +36,7 @@ public SpeciesWindow(HumanoidCharacterProfile profile, IEntityManager entMan, LobbyUIController uIController, IResourceManager resManager, - DocumentParsingManager parsing, - HumanoidProfileEditor humanoidProfileEditor) + DocumentParsingManager parsing) { RobustXamlLoader.Load(this); IoCManager.InjectDependencies(this); @@ -49,7 +48,6 @@ public SpeciesWindow(HumanoidCharacterProfile profile, _proto = proto; _uIController = uIController; _resMan = resManager; - _humanoidProfileEditor = humanoidProfileEditor; var protoList = _proto.EnumeratePrototypes().Where(x => x.RoundStart).ToList(); protoList.Sort((x, y) => Loc.GetString(x.Name)[0].CompareTo(Loc.GetString(y.Name)[0])); From 4597909d9f4d5e9656f1888b602dc67793056374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schr=C3=B6dinger?= <132720404+Schrodinger71@users.noreply.github.com> Date: Sat, 1 Feb 2025 00:25:51 +0300 Subject: [PATCH 3/6] fix? --- Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs b/Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs index f8185519ab3..933848eb5be 100644 --- a/Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs +++ b/Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs @@ -28,7 +28,7 @@ public sealed partial class SpeciesWindow : FancyWindow private readonly IPrototypeManager _proto; private readonly LobbyUIController _uIController; private readonly IResourceManager _resMan; - [Dependency] private readonly HumanoidProfileEditor _humanoidProfileEditor = default!; + private readonly HumanoidProfileEditor _humanoidProfileEditor; [Dependency] private readonly DocumentParsingManager _parsingMan = default!; public SpeciesWindow(HumanoidCharacterProfile profile, @@ -36,7 +36,8 @@ public SpeciesWindow(HumanoidCharacterProfile profile, IEntityManager entMan, LobbyUIController uIController, IResourceManager resManager, - DocumentParsingManager parsing) + DocumentParsingManager parsing, + HumanoidProfileEditor humanoidProfileEditor) { RobustXamlLoader.Load(this); IoCManager.InjectDependencies(this); @@ -48,6 +49,7 @@ public SpeciesWindow(HumanoidCharacterProfile profile, _proto = proto; _uIController = uIController; _resMan = resManager; + _humanoidProfileEditor = humanoidProfileEditor; var protoList = _proto.EnumeratePrototypes().Where(x => x.RoundStart).ToList(); protoList.Sort((x, y) => Loc.GetString(x.Name)[0].CompareTo(Loc.GetString(y.Name)[0])); From 13a79dd10db3ff3b1455b9cf0ce1333f1a5f0eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schr=C3=B6dinger?= <132720404+Schrodinger71@users.noreply.github.com> Date: Sat, 1 Feb 2025 00:27:23 +0300 Subject: [PATCH 4/6] help --- Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs index 565f99e8a91..ceb7a0d6a31 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs @@ -272,7 +272,7 @@ public HumanoidProfileEditor( } else { - _speciesWindow = new(Profile, prototypeManager, entManager, _controller, _resManager, _parsingMan); + _speciesWindow = new(Profile, prototypeManager, entManager, _controller, _resManager, _parsingMan); // СЮда его ещё добавить _speciesWindow.OpenCenteredLeft(); var oldProfile = Profile.Clone(); _speciesWindow.ChooseAction += args => From e50e2d32c5d6db42168b9c4d784e214e274bd2a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schr=C3=B6dinger?= <132720404+Schrodinger71@users.noreply.github.com> Date: Sat, 1 Feb 2025 00:38:09 +0300 Subject: [PATCH 5/6] FIXIT --- Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs index ceb7a0d6a31..7435e7afbdd 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs @@ -272,7 +272,15 @@ public HumanoidProfileEditor( } else { - _speciesWindow = new(Profile, prototypeManager, entManager, _controller, _resManager, _parsingMan); // СЮда его ещё добавить + _speciesWindow = new( + Profile, + prototypeManager, + entManager, + _controller, + _resManager, + _parsingMan, + this); + _speciesWindow.OpenCenteredLeft(); var oldProfile = Profile.Clone(); _speciesWindow.ChooseAction += args => From ed20678c356d1cada74ec413b10a2445f2c7c076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schr=C3=B6dinger?= <132720404+Schrodinger71@users.noreply.github.com> Date: Sat, 1 Feb 2025 01:20:35 +0300 Subject: [PATCH 6/6] =?UTF-8?q?=D0=BD=D1=83=20=D0=B4=D0=BE=D0=BF=D1=83?= =?UTF-8?q?=D1=81=D1=82=D0=B8=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Language/UI/HumanoidProfileEditor.Languages.cs | 4 ++-- Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs | 12 ++---------- .../Lobby/UI/HumanoidProfileEditor.xaml.cs | 4 ++-- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/Content.Client/ADT/Language/UI/HumanoidProfileEditor.Languages.cs b/Content.Client/ADT/Language/UI/HumanoidProfileEditor.Languages.cs index ea2a8f37c2b..e5c6ea9af8f 100644 --- a/Content.Client/ADT/Language/UI/HumanoidProfileEditor.Languages.cs +++ b/Content.Client/ADT/Language/UI/HumanoidProfileEditor.Languages.cs @@ -12,7 +12,7 @@ public void RefreshLanguages() { LanguagesList.DisposeAllChildren(); TabContainer.SetTabTitle(1, Loc.GetString("humanoid-profile-editor-languages-tab")); - SetDefaultLanguagesButton.OnPressed += SetDefaultLanguages; + SetDefaultLanguagesButton.OnPressed += _ => SetDefaultLanguages(); if (Profile == null) return; @@ -73,7 +73,7 @@ public void SelectLanguage(string protoId) RefreshLanguages(); } - public void SetDefaultLanguages(BaseButton.ButtonEventArgs args) + public void SetDefaultLanguages() { if (Profile == null) return; diff --git a/Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs b/Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs index 933848eb5be..a1134112e1f 100644 --- a/Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs +++ b/Content.Client/ADT/Lobby/UI/SpeciesWindow.xaml.cs @@ -13,7 +13,6 @@ using Robust.Client.UserInterface.XAML; using Robust.Shared.ContentPack; using Robust.Shared.Prototypes; -using Content.Client.Lobby.UI; namespace Content.Client.ADT.Lobby.UI; @@ -28,7 +27,6 @@ public sealed partial class SpeciesWindow : FancyWindow private readonly IPrototypeManager _proto; private readonly LobbyUIController _uIController; private readonly IResourceManager _resMan; - private readonly HumanoidProfileEditor _humanoidProfileEditor; [Dependency] private readonly DocumentParsingManager _parsingMan = default!; public SpeciesWindow(HumanoidCharacterProfile profile, @@ -36,8 +34,7 @@ public SpeciesWindow(HumanoidCharacterProfile profile, IEntityManager entMan, LobbyUIController uIController, IResourceManager resManager, - DocumentParsingManager parsing, - HumanoidProfileEditor humanoidProfileEditor) + DocumentParsingManager parsing) { RobustXamlLoader.Load(this); IoCManager.InjectDependencies(this); @@ -49,7 +46,6 @@ public SpeciesWindow(HumanoidCharacterProfile profile, _proto = proto; _uIController = uIController; _resMan = resManager; - _humanoidProfileEditor = humanoidProfileEditor; var protoList = _proto.EnumeratePrototypes().Where(x => x.RoundStart).ToList(); protoList.Sort((x, y) => Loc.GetString(x.Name)[0].CompareTo(Loc.GetString(y.Name)[0])); @@ -181,11 +177,7 @@ public void SelectSpecies(ProtoId protoId) JobLoadout.SetEntity(loadoutMob); Select.Disabled = Profile.Species == protoId; - Select.OnPressed += args => - { - ChooseAction?.Invoke(protoId); - _humanoidProfileEditor.SetDefaultLanguages(args); - }; + Select.OnPressed += args => ChooseAction?.Invoke(protoId); // Тут у нас идёт штука для создание контейнера плюсов и минусов. Я не уверен, зачем я впихнул это сюда, но мне уже лень переделывать var prosConsContainer = new BoxContainer() diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs index 7435e7afbdd..9eb97ffe425 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs @@ -278,8 +278,7 @@ public HumanoidProfileEditor( entManager, _controller, _resManager, - _parsingMan, - this); + _parsingMan); _speciesWindow.OpenCenteredLeft(); var oldProfile = Profile.Clone(); @@ -293,6 +292,7 @@ public HumanoidProfileEditor( var name1 = _prototypeManager.Index(Profile?.Species ?? "Human").Name; NewSpeciesButton.Text = Loc.GetString(name1); NewSpeciesButton.Pressed = false; + this.SetDefaultLanguages(); }; _speciesWindow.OnClose += () => {