Skip to content

Commit a42378c

Browse files
authored
Merge pull request #1 from TheShuEd/ed-04-10-2025-filtering
Initialize baseline
1 parent 690bb5a commit a42378c

File tree

48 files changed

+842
-172
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+842
-172
lines changed

Content.Client/Guidebook/Controls/GuidebookWindow.xaml.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
using Content.Client.UserInterface.Controls;
66
using Content.Client.UserInterface.Controls.FancyTree;
77
using Content.Client.UserInterface.Systems.Info;
8+
using Content.Shared.CCVar;
89
using Content.Shared.Guidebook;
910
using Robust.Client.AutoGenerated;
1011
using Robust.Client.UserInterface;
1112
using Robust.Client.UserInterface.Controls;
1213
using Robust.Client.UserInterface.XAML;
14+
using Robust.Shared.Configuration;
1315
using Robust.Shared.ContentPack;
1416
using Robust.Shared.Prototypes;
1517

@@ -20,6 +22,7 @@ public sealed partial class GuidebookWindow : FancyWindow, ILinkClickHandler, IA
2022
{
2123
[Dependency] private readonly DocumentParsingManager _parsingMan = default!;
2224
[Dependency] private readonly IResourceManager _resourceManager = default!;
25+
[Dependency] private readonly IConfigurationManager _cfg = default!; //Baseline
2326

2427
private Dictionary<ProtoId<GuideEntryPrototype>, GuideEntry> _entries = new();
2528

@@ -208,6 +211,10 @@ private void RepopulateTree(List<ProtoId<GuideEntryPrototype>>? roots = null,
208211
var parent = forcedRoot == null ? null : AddEntry(forcedRoot.Value, null, addedEntries);
209212
foreach (var entry in GetSortedEntries(roots))
210213
{
214+
//Baseline start
215+
if (entry.Hidden) continue;
216+
if (entry.LocFilter is not null && entry.LocFilter != _cfg.GetCVar(CCVars.ServerLanguage)) continue;
217+
//Baseline end
211218
AddEntry(entry.Id, parent, addedEntries);
212219
}
213220

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using Content.Shared.CCVar;
2+
using Robust.Shared;
3+
using Robust.Shared.Configuration;
4+
5+
namespace Content.Client._Baseline.EntityFilter;
6+
7+
/// <summary>
8+
/// On the client side, it automatically enables entity filtering to hide all vanilla ss14 entities
9+
/// not marked with the ForkFiltered category from the spawn menu.
10+
/// </summary>
11+
public sealed class BaselineSystem : EntitySystem
12+
{
13+
[Dependency] private readonly IConfigurationManager _cfg = default!;
14+
15+
public override void Initialize()
16+
{
17+
_cfg.SetCVar(CVars.EntitiesCategoryFilter, "ForkFiltered");
18+
19+
_cfg.OnValueChanged(CCVars.ServerLanguage, OnLanguageChange, true);
20+
_cfg.SetCVar(CVars.LocCultureName, _cfg.GetCVar(CCVars.ServerLanguage));
21+
}
22+
23+
private void OnLanguageChange(string obj)
24+
{
25+
_cfg.SetCVar(CVars.LocCultureName, obj);
26+
}
27+
}

Content.IntegrationTests/Tests/GameRules/AntagPreferenceTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Content.IntegrationTests.Tests.GameRules;
1515
// Lets not let that happen again.
1616
[TestFixture]
1717
public sealed class AntagPreferenceTest
18-
{
18+
{/*
1919
[Test]
2020
public async Task TestLobbyPlayersValid()
2121
{
@@ -72,5 +72,5 @@ public async Task TestLobbyPlayersValid()
7272
7373
await server.WaitPost(() => server.EntMan.DeleteEntity(uid));
7474
await pair.CleanReturnAsync();
75-
}
75+
}*/
7676
}

Content.IntegrationTests/Tests/GameRules/NukeOpsTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace Content.IntegrationTests.Tests.GameRules;
3030

3131
[TestFixture]
3232
public sealed class NukeOpsTest
33-
{
33+
{/*
3434
private static readonly ProtoId<NpcFactionPrototype> SyndicateFaction = "Syndicate";
3535
private static readonly ProtoId<NpcFactionPrototype> NanotrasenFaction = "NanoTrasen";
3636
@@ -258,5 +258,5 @@ await server.WaitAssertion(() =>
258258
259259
ticker.SetGamePreset((GamePresetPrototype?) null);
260260
await pair.CleanReturnAsync();
261-
}
261+
}*/
262262
}

Content.IntegrationTests/Tests/GameRules/TraitorRuleTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace Content.IntegrationTests.Tests.GameRules;
1818

1919
[TestFixture]
2020
public sealed class TraitorRuleTest
21-
{
21+
{/*
2222
private const string TraitorGameRuleProtoId = "Traitor";
2323
private const string TraitorAntagRoleName = "Traitor";
2424
private static readonly ProtoId<NpcFactionPrototype> SyndicateFaction = "Syndicate";
@@ -133,5 +133,5 @@ private static string FormatObjective(Entity<ObjectiveComponent> entity, IEntity
133133
var meta = entMan.GetComponent<MetaDataComponent>(entity);
134134
var objective = entMan.GetComponent<ObjectiveComponent>(entity);
135135
return $"{meta.EntityName} ({objective.Difficulty})";
136-
}
136+
}*/
137137
}

Content.IntegrationTests/Tests/PostMapInitTest.cs

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,23 @@ public sealed class PostMapInitTest
8686
private static readonly string[] GameMaps =
8787
{
8888
"Dev",
89-
"TestTeg",
90-
"Fland",
91-
"Packed",
92-
"Bagel",
93-
"CentComm",
94-
"Box",
95-
"Marathon",
96-
"MeteorArena",
97-
"Saltern",
98-
"Reach",
99-
"Oasis",
100-
"Amber",
101-
"Plasma",
102-
"Elkridge",
103-
"Relic",
104-
"dm01-entryway",
105-
"Exo",
89+
//"TestTeg",
90+
//"Fland",
91+
//"Packed",
92+
//"Bagel",
93+
//"CentComm",
94+
//"Box",
95+
//"Marathon",
96+
//"MeteorArena",
97+
//"Saltern",
98+
//"Reach",
99+
//"Oasis",
100+
//"Amber",
101+
//"Plasma",
102+
//"Elkridge",
103+
//"Relic",
104+
//"dm01-entryway",
105+
//"Exo",
106106
};
107107

108108
private static readonly ProtoId<EntityCategoryPrototype> DoNotMapCategory = "DoNotMap";
@@ -415,6 +415,7 @@ await server.WaitPost(() =>
415415
// Test shuttle can dock.
416416
// This is done inside gamemap test because loading the map takes ages and we already have it.
417417
var station = entManager.GetComponent<StationMemberComponent>(targetGrid!.Value).Station;
418+
/* //Baseline Disable FTL test
418419
if (entManager.TryGetComponent<StationEmergencyShuttleComponent>(station, out var stationEvac))
419420
{
420421
var shuttlePath = stationEvac.EmergencyShuttlePath;
@@ -429,7 +430,7 @@ await server.WaitPost(() =>
429430
}
430431
431432
mapSystem.DeleteMap(shuttleMap);
432-
433+
*/
433434
if (entManager.HasComponent<StationJobsComponent>(station))
434435
{
435436
// Test that the map has valid latejoin spawn points or container spawn points

Content.IntegrationTests/Tests/Power/StationPowerTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Content.IntegrationTests.Tests.Power;
1212

1313
[Explicit]
1414
public sealed class StationPowerTests
15-
{
15+
{/*
1616
/// <summary>
1717
/// How long the station should be able to survive on stored power if nothing is changed from round start.
1818
/// </summary>
@@ -101,5 +101,5 @@ await server.WaitAssertion(() =>
101101
102102
103103
await pair.CleanReturnAsync();
104-
}
104+
}*/
105105
}

Content.IntegrationTests/Tests/Round/JobTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace Content.IntegrationTests.Tests.Round;
1717

1818
[TestFixture]
1919
public sealed class JobTest
20-
{
20+
{ /*
2121
private static readonly ProtoId<JobPrototype> Passenger = "Passenger";
2222
private static readonly ProtoId<JobPrototype> Engineer = "StationEngineer";
2323
private static readonly ProtoId<JobPrototype> Captain = "Captain";
@@ -218,5 +218,5 @@ public async Task JobPriorityTest()
218218
219219
await pair.Server.WaitPost(() => ticker.RestartRound());
220220
await pair.CleanReturnAsync();
221-
}
221+
}*/
222222
}

Content.IntegrationTests/Tests/Station/EvacShuttleTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Content.IntegrationTests.Tests.Station;
1313
[TestFixture]
1414
[TestOf(typeof(EmergencyShuttleSystem))]
1515
public sealed class EvacShuttleTest
16-
{
16+
{/*
1717
/// <summary>
1818
/// Ensure that the emergency shuttle can be called, and that it will travel to centcomm
1919
/// </summary>
@@ -123,5 +123,5 @@ public async Task EmergencyEvacTest()
123123
pair.Server.CfgMan.SetCVar(CCVars.EmergencyShuttleEnabled, false);
124124
pair.Server.CfgMan.SetCVar(CCVars.GameMap, gameMap);
125125
await pair.CleanReturnAsync();
126-
}
126+
}*/
127127
}

Content.IntegrationTests/Tests/Station/StationJobsTest.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,30 @@ public sealed class StationJobsTest
5555
5656
- type: job
5757
id: TAssistant
58+
setPreference: true # Baseline
5859
playTimeTracker: PlayTimeDummyAssistant
5960
6061
- type: job
6162
id: TMime
6263
weight: 20
64+
setPreference: true # Baseline
6365
playTimeTracker: PlayTimeDummyMime
6466
6567
- type: job
6668
id: TClown
6769
weight: -10
70+
setPreference: true # Baseline
6871
playTimeTracker: PlayTimeDummyClown
6972
7073
- type: job
7174
id: TCaptain
7275
weight: 10
76+
setPreference: true # Baseline
7377
playTimeTracker: PlayTimeDummyCaptain
7478
7579
- type: job
7680
id: TChaplain
81+
setPreference: true # Baseline
7782
playTimeTracker: PlayTimeDummyChaplain
7883
";
7984

0 commit comments

Comments
 (0)