Automatic Open tests (#1142)

* auto eng obt

* Update CP14RoundEndSystem.CBT.cs

* Update CP14EdSystem.cs

* cbt cbt!

* Update CP14RoundEndSystem.CBT.cs
This commit is contained in:
Ed
2025-04-15 23:09:49 +03:00
committed by GitHub
parent c61a76fa69
commit b40cbfb5d7
10 changed files with 141 additions and 45 deletions

View File

@@ -4,11 +4,13 @@ using Content.Client.UserInterface.ControlExtensions;
using Content.Client.UserInterface.Controls;
using Content.Client.UserInterface.Controls.FancyTree;
using Content.Client.UserInterface.Systems.Info;
using Content.Shared.CCVar;
using Content.Shared.Guidebook;
using Content.Shared.Localizations;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Configuration;
using Robust.Shared.ContentPack;
using Robust.Shared.Prototypes;
@@ -19,6 +21,7 @@ public sealed partial class GuidebookWindow : FancyWindow, ILinkClickHandler
{
[Dependency] private readonly DocumentParsingManager _parsingMan = default!;
[Dependency] private readonly IResourceManager _resourceManager = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
private Dictionary<ProtoId<GuideEntryPrototype>, GuideEntry> _entries = new();
@@ -159,7 +162,7 @@ public sealed partial class GuidebookWindow : FancyWindow, ILinkClickHandler
foreach (var entry in GetSortedEntries(roots))
{
if (!entry.CrystallPunkAllowed) continue; //CrystallEdge guidebook filter
if (entry.LocFilter is not null && entry.LocFilter != ContentLocalizationManager.Culture) continue; //CrystallEdge guidebook filter
if (entry.LocFilter is not null && entry.LocFilter != _cfg.GetCVar(CCVars.Language)) continue; //CrystallEdge guidebook filter
AddEntry(entry.Id, parent, addedEntries);
}

View File

@@ -1,10 +1,13 @@
using Content.Shared.CCVar;
using Content.Shared.Localizations;
using Robust.Client.GameObjects;
using Robust.Shared.Configuration;
namespace Content.Client._CP14.Localization;
public sealed class CP14LocalizationVisualsSystem : EntitySystem
{
[Dependency] private readonly IConfigurationManager _cfg = default!;
public override void Initialize()
{
base.Initialize();
@@ -19,7 +22,7 @@ public sealed class CP14LocalizationVisualsSystem : EntitySystem
foreach (var (map, pDictionary) in visuals.Comp.MapStates)
{
if (!pDictionary.TryGetValue(ContentLocalizationManager.Culture, out var state))
if (!pDictionary.TryGetValue(_cfg.GetCVar(CCVars.Language), out var state))
return;
if (sprite.LayerMapTryGet(map, out _))

View File

@@ -1,3 +1,4 @@
using Content.Shared.CCVar;
using Robust.Shared;
using Robust.Shared.Configuration;
@@ -13,5 +14,12 @@ public sealed class CP14EdSystem : EntitySystem
public override void Initialize()
{
_cfg.SetCVar(CVars.EntitiesCategoryFilter, "ForkFiltered");
_cfg.OnValueChanged(CCVars.Language, OnLanguageChange, true);
}
private void OnLanguageChange(string obj)
{
_cfg.SetCVar(CVars.LocCultureName, obj);
}
}