Skip to content

Commit 91f66d7

Browse files
authored
Merge pull request #1280 from ss14Starlight/starlight-dev
Live update
2 parents a2fdcfd + 4edff10 commit 91f66d7

721 files changed

Lines changed: 420463 additions & 28400 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 173 additions & 248 deletions
Large diffs are not rendered by default.

.github/workflows/auto-assign.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Auto Assign Reviewers
22

33
on:
4-
pull_request:
5-
types: [labeled, opened, synchronize]
4+
- pull_request_target
65

76
jobs:
87
assign:

Content.Client/Entry/EntryPoint.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
using Content.Client.UserInterface;
2525
using Content.Client.Viewport;
2626
using Content.Client.Voting;
27+
using Content.Shared._NullLink;
2728
using Content.Shared.Ame.Components;
2829
using Content.Shared.Gravity;
2930
using Content.Shared.Localizations;
@@ -79,6 +80,8 @@ public sealed class EntryPoint : GameClient
7980
[Dependency] private readonly TitleWindowManager _titleWindowManager = default!;
8081
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
8182
[Dependency] private readonly ClientsidePlaytimeTrackingManager _clientsidePlaytimeManager = default!;
83+
[Dependency] private readonly INullLinkPlayerRolesManager _nullLinkPlayerRolesManager = default!; //NullLink
84+
[Dependency] private readonly ISharedNullLinkPlayerRolesReqManager _sharedNullLinkPlayer = default!; //NullLink
8285

8386
public override void Init()
8487
{
@@ -189,6 +192,11 @@ public override void PostInit()
189192
}
190193
};
191194

195+
// NullLink start
196+
_nullLinkPlayerRolesManager.Initialize();
197+
_sharedNullLinkPlayer.Initialize();
198+
// NullLink end
199+
192200
// Disable engine-default viewport since we use our own custom viewport control.
193201
_userInterfaceManager.MainViewport.Visible = false;
194202

Content.Client/Info/LinkBanner.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Content.Client.Info
1515
public sealed class LinkBanner : BoxContainer
1616
{
1717
private readonly IConfigurationManager _cfg;
18-
private readonly IClientPlayerRolesManager _clientPlayerManager;
18+
private readonly INullLinkPlayerRolesManager _playerRoles;// NullLink
1919

2020
private ValueList<(CVarDef<string> cVar, Button button)> _infoLinks;
2121

@@ -29,7 +29,7 @@ public LinkBanner()
2929

3030
var uriOpener = IoCManager.Resolve<IUriOpener>();
3131
_cfg = IoCManager.Resolve<IConfigurationManager>();
32-
_clientPlayerManager = IoCManager.Resolve<IClientPlayerRolesManager>();
32+
_playerRoles = IoCManager.Resolve<INullLinkPlayerRolesManager>(); // NullLink
3333
var rulesButton = new Button() {Text = Loc.GetString("server-info-rules-button")};
3434
rulesButton.OnPressed += args => new RulesAndInfoWindow().Open();
3535
buttons.AddChild(rulesButton);
@@ -40,13 +40,15 @@ public LinkBanner()
4040
AddInfoButton("server-info-forum-button", CCVars.InfoLinksForum);
4141
AddInfoButton("server-info-telegram-button", CCVars.InfoLinksTelegram);
4242

43+
// NullLink start
4344
var button = new Button { Text = Loc.GetString("server-info-connect-discord-button") };
4445
button.OnPressed += _ => {
45-
var link = _clientPlayerManager.GetDiscordLink();
46+
var link = _playerRoles.GetDiscordLink();
4647
if(link != null)
4748
uriOpener.OpenUri(link);
4849
};
4950
buttons.AddChild(button);
51+
// NullLink end
5052

5153
var guidebookController = UserInterfaceManager.GetUIController<GuidebookUIController>();
5254
var guidebookButton = new Button() { Text = Loc.GetString("server-info-guidebook-button") };

Content.Client/IoC/ClientContentIoC.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Content.Client._Starlight.Managers;
12
using Content.Client.Administration.Managers;
23
using Content.Client.Changelog;
34
using Content.Client.Chat.Managers;
@@ -9,24 +10,25 @@
910
using Content.Client.GhostKick;
1011
using Content.Client.Guidebook;
1112
using Content.Client.Launcher;
13+
using Content.Client.Lobby;
1214
using Content.Client.Mapping;
1315
using Content.Client.Parallax.Managers;
1416
using Content.Client.Players.PlayTimeTracking;
1517
using Content.Client.Playtime;
18+
using Content.Client.Players.RateLimiting;
1619
using Content.Client.Replay;
1720
using Content.Client.Screenshot;
1821
using Content.Client.Stylesheets;
1922
using Content.Client.Viewport;
2023
using Content.Client.Voting;
24+
using Content.Shared._NullLink;
2125
using Content.Shared.Administration.Logs;
22-
using Content.Client.Lobby;
23-
using Content.Client.Players.RateLimiting;
2426
using Content.Shared.Administration.Managers;
2527
using Content.Shared.Chat;
2628
using Content.Shared.Players.PlayTimeTracking;
2729
using Content.Shared.Players.RateLimiting;
2830
using Content.Shared.Starlight;
29-
using Content.Client._Starlight.Managers;
31+
using Content.Client._NullLink;
3032

3133
namespace Content.Client.IoC
3234
{
@@ -66,6 +68,11 @@ public static void Register()
6668
collection.Register<SharedPlayerRateLimitManager, PlayerRateLimitManager>();
6769
collection.Register<TitleWindowManager>();
6870
collection.Register<ClientsidePlaytimeTrackingManager>();
71+
72+
// NullLink start
73+
collection.Register<INullLinkPlayerRolesManager, NullLinkPlayerRolesManager>();
74+
collection.Register<ISharedNullLinkPlayerRolesReqManager, PlayerRolesReqManager>();
75+
// NullLink end
6976
}
7077
}
7178
}

Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,7 @@ public void RefreshSpecies()
752752
_species.Clear();
753753

754754
_species.AddRange(_prototypeManager.EnumeratePrototypes<SpeciesPrototype>().Where(o => o.RoundStart));
755+
_species.Sort((a, b) => string.Compare(a.Name, b.Name, StringComparison.OrdinalIgnoreCase)); // Starlight
755756
var speciesIds = _species.Select(o => o.ID).ToList();
756757

757758
for (var i = 0; i < _species.Count; i++)

Content.Client/Mech/Ui/MechBoundUserInterface.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ protected override void Open()
2424
_menu = this.CreateWindowCenteredLeft<MechMenu>();
2525
_menu.SetEntity(Owner);
2626
_menu.OpenCenteredLeft();
27-
27+
2828
_menu.UpdateMaintenanceButtons();
2929

3030
_menu.OnRemoveButtonPressed += uid =>
3131
{
3232
SendMessage(new MechEquipmentRemoveMessage(EntMan.GetNetEntity(uid)));
3333
};
34-
34+
3535
_menu.OnMaintenanceModeChanged += toggle =>
3636
{
3737
SendMessage(new MechMaintenanceUiMessage(toggle));
@@ -45,8 +45,8 @@ protected override void UpdateState(BoundUserInterfaceState state)
4545
if (state is not MechBoundUiState msg)
4646
return;
4747
UpdateEquipmentControls(msg);
48-
_menu?.UpdateMechStats();
49-
_menu?.UpdateEquipmentView();
48+
_menu?.UpdateMechStats(msg.Equipment.Count); // Starlight-edit: Correct equipment update
49+
_menu?.UpdateEquipmentView(msg.Equipment); // Starlight-edit: Correct equipment update
5050
_menu?.UpdateMaintenanceButtons();
5151
}
5252

Content.Client/Mech/Ui/MechMenu.xaml.cs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public sealed partial class MechMenu : FancyWindow
1717
private EntityUid _mech;
1818

1919
public event Action<EntityUid>? OnRemoveButtonPressed;
20-
20+
2121
public event Action<bool>? OnMaintenanceModeChanged;
2222

2323
public MechMenu()
@@ -32,20 +32,20 @@ public void SetEntity(EntityUid uid)
3232
_mech = uid;
3333
}
3434

35-
public void UpdateMechStats()
35+
public void UpdateMechStats(int EquipmentCount) // Starlight-edit: Correct equipment update
3636
{
3737
if (!_ent.TryGetComponent<MechComponent>(_mech, out var mechComp))
3838
return;
3939

4040
var integrityPercent = mechComp.Integrity / mechComp.MaxIntegrity;
4141
IntegrityDisplayBar.Value = integrityPercent.Float();
42-
IntegrityDisplay.Text = Loc.GetString("mech-integrity-display", ("amount", (integrityPercent*100).Int()));
42+
IntegrityDisplay.Text = Loc.GetString("mech-integrity-display", ("amount", (integrityPercent * 100).Int()));
4343

4444
if (mechComp.MaxEnergy != 0f)
4545
{
4646
var energyPercent = mechComp.Energy / mechComp.MaxEnergy;
4747
EnergyDisplayBar.Value = energyPercent.Float();
48-
EnergyDisplay.Text = Loc.GetString("mech-energy-display", ("amount", (energyPercent*100).Int()));
48+
EnergyDisplay.Text = Loc.GetString("mech-energy-display", ("amount", (energyPercent * 100).Int()));
4949
}
5050
else
5151
{
@@ -54,18 +54,17 @@ public void UpdateMechStats()
5454
}
5555

5656
ActiveSlotDisplay.Text = Loc.GetString("mech-slot-display",
57-
("amount", mechComp.MaxEquipmentAmount - mechComp.EquipmentContainer.ContainedEntities.Count));
57+
("amount", mechComp.MaxEquipmentAmount - EquipmentCount)); // Starlight-edit: Correct equipment update
5858
}
5959

60-
public void UpdateEquipmentView()
60+
public void UpdateEquipmentView(List<NetEntity> Equipment) // Starlight-edit: Correct equipment update
6161
{
62-
if (!_ent.TryGetComponent<MechComponent>(_mech, out var mechComp))
63-
return;
64-
6562
ActiveEquipmentContainer.Children.Clear();
6663
PassiveEquipmentContainer.Children.Clear();
67-
foreach (var ent in mechComp.EquipmentContainer.ContainedEntities)
64+
foreach (var netEntity in Equipment) // Starlight-edit: Correct equipment update
6865
{
66+
var ent = _ent.GetEntity(netEntity); // Starlight-edit: Correct equipment update
67+
6968
if (!_ent.TryGetComponent<MetaDataComponent>(ent, out var metaData))
7069
continue;
7170

@@ -85,20 +84,22 @@ public void UpdateEquipmentView()
8584
}
8685
}
8786
}
88-
87+
8988
public void UpdateMaintenanceButtons()
9089
{
9190
if (!_ent.TryGetComponent<MechComponent>(_mech, out var mechComp))
9291
return;
9392

9493
MaintenanceOffButton.Disabled = !mechComp.MaintenanceMode;
95-
MaintenanceOffButton.OnPressed += _ => {
94+
MaintenanceOffButton.OnPressed += _ =>
95+
{
9696
MaintenanceOffButton.Disabled = true;
9797
MaintenanceOnButton.Disabled = false;
9898
OnMaintenanceModeChanged?.Invoke(false);
9999
};
100100
MaintenanceOnButton.Disabled = mechComp.MaintenanceMode;
101-
MaintenanceOnButton.OnPressed += _ => {
101+
MaintenanceOnButton.OnPressed += _ =>
102+
{
102103
MaintenanceOffButton.Disabled = false;
103104
MaintenanceOnButton.Disabled = true;
104105
OnMaintenanceModeChanged?.Invoke(true);

Content.Client/Parallax/Data/GeneratedParallaxTextureSource.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,10 @@ void IParallaxTextureSource.Unload(IDependencyCollection dependencies)
3737
var cache = dependencies.Resolve<GeneratedParallaxCache>();
3838
cache.Unload(Identifier);
3939
}
40+
/// <summary>
41+
/// Controls the speed of the parallax effect for this texture.
42+
/// </summary>
43+
[DataField("slowness")]
44+
public float Slowness { get; private set; }
4045
}
4146

Content.Client/UserInterface/Systems/EscapeMenu/EscapeUIController.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public sealed class EscapeUIController : UIController, IOnStateEntered<GameplayS
2222
{
2323
[Dependency] private readonly IClientConsoleHost _console = default!;
2424
[Dependency] private readonly IClientPlayerRolesManager _player = default!;
25+
[Dependency] private readonly INullLinkPlayerRolesManager _playerRoles = default!; // NullLink
2526
[Dependency] private readonly IUriOpener _uri = default!;
2627
[Dependency] private readonly IConfigurationManager _cfg = default!;
2728
[Dependency] private readonly ChangelogUIController _changelog = default!;
@@ -66,11 +67,13 @@ public void OnStateEntered(GameplayState state)
6667
_escapeWindow.OnClose += DeactivateButton;
6768
_escapeWindow.OnOpen += ActivateButton;
6869

70+
// NullLink start
6971
_escapeWindow.DiscordButton.OnPressed += _ =>
7072
{
71-
if(_player.GetDiscordLink() is string link)
73+
if(_playerRoles.GetDiscordLink() is string link)
7274
_uri.OpenUri(link);
7375
};
76+
// NullLink end
7477

7578
_escapeWindow.ChangelogButton.OnPressed += _ =>
7679
{

0 commit comments

Comments
 (0)