Skip to content

Commit

Permalink
Merge branch 'master' into substation_maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
AwareFoxy authored Oct 18, 2024
2 parents c5fe7d4 + adb7aee commit 18e52e6
Show file tree
Hide file tree
Showing 502 changed files with 31,135 additions and 36,243 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/Resources/engineCommandPerms.yml @moonheart08 @Chief-Engineer
/Resources/clientCommandPerms.yml @moonheart08 @Chief-Engineer

/Resources/Prototypes/Maps/ @Emisse
/Resources/Prototypes/Maps/** @Emisse

/Resources/Prototypes/Body/ @DrSmugleaf # suffering
/Resources/Prototypes/Entities/Mobs/Player/ @DrSmugleaf
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ concurrency:

on:
workflow_dispatch:
schedule:
- cron: '0 10 * * *'
# schedule:
# - cron: '0 10 * * *'

jobs:
build:
Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Clothing/ClientClothingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ private void RenderEquipment(EntityUid equipee, EntityUid equipment, string slot
if (layerData.State is not null && inventory.SpeciesId is not null && layerData.State.EndsWith(inventory.SpeciesId))
continue;

_displacement.TryAddDisplacement(displacementData, sprite, index, key, revealedLayers);
if (_displacement.TryAddDisplacement(displacementData, sprite, index, key, revealedLayers))
index++;
}
}

Expand Down
9 changes: 9 additions & 0 deletions Content.Client/Entry/EntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Content.Client.DebugMon;
using Content.Client.Eui;
using Content.Client.Fullscreen;
using Content.Client.GameTicking.Managers;
using Content.Client.GhostKick;
using Content.Client.Guidebook;
using Content.Client.Input;
Expand Down Expand Up @@ -70,6 +71,7 @@ public sealed class EntryPoint : GameClient
[Dependency] private readonly IReplayLoadManager _replayLoad = default!;
[Dependency] private readonly ILogManager _logManager = default!;
[Dependency] private readonly DebugMonitorManager _debugMonitorManager = default!;
[Dependency] private readonly TitleWindowManager _titleWindowManager = default!;

public override void Init()
{
Expand Down Expand Up @@ -139,6 +141,12 @@ public override void Init()
_configManager.SetCVar("interface.resolutionAutoScaleMinimum", 0.5f);
}

public override void Shutdown()
{
base.Shutdown();
_titleWindowManager.Shutdown();
}

public override void PostInit()
{
base.PostInit();
Expand All @@ -159,6 +167,7 @@ public override void PostInit()
_userInterfaceManager.SetDefaultTheme("SS14DefaultTheme");
_userInterfaceManager.SetActiveTheme(_configManager.GetCVar(CVars.InterfaceTheme));
_documentParsingManager.Initialize();
_titleWindowManager.Initialize();

_baseClient.RunLevelChanged += (_, args) =>
{
Expand Down
62 changes: 62 additions & 0 deletions Content.Client/GameTicking/Managers/TitleWindowManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using Content.Shared.CCVar;
using Robust.Client;
using Robust.Client.Graphics;
using Robust.Shared;
using Robust.Shared.Configuration;

namespace Content.Client.GameTicking.Managers;

public sealed class TitleWindowManager
{
[Dependency] private readonly IBaseClient _client = default!;
[Dependency] private readonly IClyde _clyde = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IGameController _gameController = default!;

public void Initialize()
{
_cfg.OnValueChanged(CVars.GameHostName, OnHostnameChange, true);
_cfg.OnValueChanged(CCVars.GameHostnameInTitlebar, OnHostnameTitleChange, true);

_client.RunLevelChanged += OnRunLevelChangedChange;
}

public void Shutdown()
{
_cfg.UnsubValueChanged(CVars.GameHostName, OnHostnameChange);
_cfg.UnsubValueChanged(CCVars.GameHostnameInTitlebar, OnHostnameTitleChange);
}

private void OnHostnameChange(string hostname)
{
var defaultWindowTitle = _gameController.GameTitle();

// Since the game assumes the server name is MyServer and that GameHostnameInTitlebar CCVar is true by default
// Lets just... not show anything. This also is used to revert back to just the game title on disconnect.
if (_client.RunLevel == ClientRunLevel.Initialize)
{
_clyde.SetWindowTitle(defaultWindowTitle);
return;
}

if (_cfg.GetCVar(CCVars.GameHostnameInTitlebar))
// If you really dislike the dash I guess change it here
_clyde.SetWindowTitle(hostname + " - " + defaultWindowTitle);
else
_clyde.SetWindowTitle(defaultWindowTitle);
}

// Clients by default assume game.hostname_in_titlebar is true
// but we need to clear it as soon as we join and actually receive the servers preference on this.
// This will ensure we rerun OnHostnameChange and set the correct title bar name.
private void OnHostnameTitleChange(bool colonthree)
{
OnHostnameChange(_cfg.GetCVar(CVars.GameHostName));
}

// This is just used we can rerun the hostname change function when we disconnect to revert back to just the games title.
private void OnRunLevelChangedChange(object? sender, RunLevelChangedEventArgs runLevelChangedEventArgs)
{
OnHostnameChange(_cfg.GetCVar(CVars.GameHostName));
}
}
4 changes: 2 additions & 2 deletions Content.Client/Hands/Systems/HandsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ public void ReloadHandButtons()
OnPlayerHandsAdded?.Invoke(hands);
}

public override void DoDrop(EntityUid uid, Hand hand, bool doDropInteraction = true, HandsComponent? hands = null)
public override void DoDrop(EntityUid uid, Hand hand, bool doDropInteraction = true, HandsComponent? hands = null, bool log = true)
{
base.DoDrop(uid, hand, doDropInteraction, hands);
base.DoDrop(uid, hand, doDropInteraction, hands, log);

if (TryComp(hand.HeldEntity, out SpriteComponent? sprite))
sprite.RenderOrder = EntityManager.CurrentTick.Value;
Expand Down
11 changes: 1 addition & 10 deletions Content.Client/Info/PlaytimeStats/PlaytimeStatsEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,10 @@ public PlaytimeStatsEntry(string role, TimeSpan playtime, StyleBox styleBox)

RoleLabel.Text = role;
Playtime = playtime; // store the TimeSpan value directly
PlaytimeLabel.Text = ConvertTimeSpanToHoursMinutes(playtime); // convert to string for display
PlaytimeLabel.Text = playtime.ToString(Loc.GetString("ui-playtime-time-format")); // convert to string for display
BackgroundColorPanel.PanelOverride = styleBox;
}

private static string ConvertTimeSpanToHoursMinutes(TimeSpan timeSpan)
{
var hours = (int)timeSpan.TotalHours;
var minutes = timeSpan.Minutes;

var formattedTimeLoc = Loc.GetString("ui-playtime-time-format", ("hours", hours), ("minutes", minutes));
return formattedTimeLoc;
}

public void UpdateShading(StyleBoxFlat styleBox)
{
BackgroundColorPanel.PanelOverride = styleBox;
Expand Down
11 changes: 1 addition & 10 deletions Content.Client/Info/PlaytimeStats/PlaytimeStatsWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private void PopulatePlaytimeData()
{
var overallPlaytime = _jobRequirementsManager.FetchOverallPlaytime();

var formattedPlaytime = ConvertTimeSpanToHoursMinutes(overallPlaytime);
var formattedPlaytime = overallPlaytime.ToString(Loc.GetString("ui-playtime-time-format"));
OverallPlaytimeLabel.Text = Loc.GetString("ui-playtime-overall", ("time", formattedPlaytime));

var rolePlaytimes = _jobRequirementsManager.FetchPlaytimeByRoles();
Expand Down Expand Up @@ -134,13 +134,4 @@ private void AddRolePlaytimeEntryToTable(string role, string playtimeString)
_sawmill.Error($"The provided playtime string '{playtimeString}' is not in the correct format.");
}
}

private static string ConvertTimeSpanToHoursMinutes(TimeSpan timeSpan)
{
var hours = (int) timeSpan.TotalHours;
var minutes = timeSpan.Minutes;

var formattedTimeLoc = Loc.GetString("ui-playtime-time-format", ("hours", hours), ("minutes", minutes));
return formattedTimeLoc;
}
}
2 changes: 1 addition & 1 deletion Content.Client/Inventory/StrippableBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void UpdateMenu()
}
}

if (EntMan.TryGetComponent<HandsComponent>(Owner, out var handsComp))
if (EntMan.TryGetComponent<HandsComponent>(Owner, out var handsComp) && handsComp.CanBeStripped)
{
// good ol hands shit code. there is a GuiHands comparer that does the same thing... but these are hands
// and not gui hands... which are different...
Expand Down
2 changes: 2 additions & 0 deletions Content.Client/IoC/ClientContentIoC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Content.Client.DebugMon;
using Content.Client.Eui;
using Content.Client.Fullscreen;
using Content.Client.GameTicking.Managers;
using Content.Client.GhostKick;
using Content.Client.Guidebook;
using Content.Client.Launcher;
Expand Down Expand Up @@ -57,6 +58,7 @@ public static void Register()
collection.Register<DebugMonitorManager>();
collection.Register<PlayerRateLimitManager>();
collection.Register<SharedPlayerRateLimitManager, PlayerRateLimitManager>();
collection.Register<TitleWindowManager>();
}
}
}
149 changes: 0 additions & 149 deletions Content.Client/Movement/Systems/WaddleAnimationSystem.cs

This file was deleted.

2 changes: 2 additions & 0 deletions Content.Client/Paper/UI/PaperWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ protected override DragMode GetDragModeFor(Vector2 relativeMousePos)

private void RunOnSaved()
{
// Prevent further saving while text processing still in
SaveButton.Disabled = true;
OnSaved?.Invoke(Rope.Collapse(Input.TextRope));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,15 @@ private void ClientOnRunLevelChanged(object? sender, RunLevelChangedEventArgs e)
{
// Reset on disconnect, just in case.
_roles.Clear();
_jobWhitelists.Clear();
_roleBans.Clear();
}
}

private void RxRoleBans(MsgRoleBans message)
{
_sawmill.Debug($"Received roleban info containing {message.Bans.Count} entries.");

if (_roleBans.Equals(message.Bans))
return;

_roleBans.Clear();
_roleBans.AddRange(message.Bans);
Updated?.Invoke();
Expand Down
Loading

0 comments on commit 18e52e6

Please sign in to comment.