-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into eddie-old-pulls
- Loading branch information
Showing
873 changed files
with
30,680 additions
and
290 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
Content.Client/ADT/CollectiveMind/Systems/CollectiveMindSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Content.Client.Chat.Managers; | ||
using Content.Shared.Sirena.CollectiveMind; | ||
using Robust.Client.Player; | ||
|
||
namespace Content.Client.Sirena.CollectiveMind; | ||
|
||
public sealed class CollectiveMindSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IChatManager _chatManager = default!; | ||
[Dependency] private readonly IPlayerManager _playerManager = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<CollectiveMindComponent, ComponentInit>(OnInit); | ||
SubscribeLocalEvent<CollectiveMindComponent, ComponentRemove>(OnRemove); | ||
} | ||
|
||
public CollectiveMindComponent? Player => CompOrNull<CollectiveMindComponent>(_playerManager.LocalPlayer?.ControlledEntity); | ||
public bool IsCollectiveMind => Player != null; | ||
|
||
private void OnInit(EntityUid uid, CollectiveMindComponent component, ComponentInit args) | ||
{ | ||
_chatManager.UpdatePermissions(); | ||
} | ||
|
||
private void OnRemove(EntityUid uid, CollectiveMindComponent component, ComponentRemove args) | ||
{ | ||
_chatManager.UpdatePermissions(); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
Content.Client/ADT/UserInterface/Systems/Ghost/Controls/GhostBarRulesWindow.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<DefaultWindow xmlns="https://spacestation14.io" | ||
Title="{Loc 'ghost-target-window-ghostbar'}" | ||
MinSize="550 400" | ||
SetSize="550 400"> | ||
<BoxContainer Orientation="Vertical" | ||
HorizontalExpand="True"> | ||
<RichTextLabel Name="TopBanner" VerticalExpand="True"/> | ||
<Button Name="SpawnButton" | ||
Text="{Loc 'ghost-window-spawn-ghostbar-button'}" | ||
Disabled="True" | ||
TextAlign="Center" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" /> | ||
</BoxContainer> | ||
</DefaultWindow> |
53 changes: 53 additions & 0 deletions
53
Content.Client/ADT/UserInterface/Systems/Ghost/Controls/GhostBarRulesWindow.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using Content.Shared.CCVar; | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.UserInterface.Controls; | ||
using Robust.Client.UserInterface.CustomControls; | ||
using Robust.Client.UserInterface.XAML; | ||
using Robust.Shared.Configuration; | ||
using Robust.Shared.Timing; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Client.ADT.UserInterface.Systems.Ghost.Controls | ||
{ | ||
[GenerateTypedNameReferences] | ||
public sealed partial class GhostBarRulesWindow : DefaultWindow | ||
{ | ||
[Dependency] private readonly IConfigurationManager _cfg = IoCManager.Resolve<IConfigurationManager>(); | ||
private float _timer; | ||
|
||
public event Action? SpawnButtonPressed; | ||
public GhostBarRulesWindow() | ||
{ | ||
RobustXamlLoader.Load(this); | ||
var ghostBarTime = _cfg.GetCVar(CCVars.GhostRoleTime); | ||
_timer = ghostBarTime; | ||
|
||
if (ghostBarTime > 0f) | ||
{ | ||
SpawnButton.Text = Loc.GetString("ghost-window-spawn-ghostbar-button-timer", ("time", $"{_timer:0.0}")); | ||
TopBanner.SetMessage(FormattedMessage.FromMarkupPermissive(Loc.GetString("ghost-bar-rules") + "\n" + Loc.GetString("ghost-roles-window-rules-footer", ("time", ghostBarTime)))); | ||
SpawnButton.Disabled = true; | ||
} | ||
|
||
SpawnButton.OnPressed += _ => SpawnButtonPressed?.Invoke(); | ||
} | ||
|
||
|
||
protected override void FrameUpdate(FrameEventArgs args) | ||
{ | ||
base.FrameUpdate(args); | ||
if (!SpawnButton.Disabled) return; | ||
if (_timer > 0.0) | ||
{ | ||
_timer -= args.DeltaSeconds; | ||
SpawnButton.Text = Loc.GetString("ghost-window-spawn-ghostbar-button-timer", ("time", $"{_timer:0.0}")); | ||
} | ||
else | ||
{ | ||
SpawnButton.Disabled = false; | ||
SpawnButton.Text = Loc.GetString("ghost-window-spawn-ghostbar-button"); | ||
} | ||
} | ||
} | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
Content.Client/ADT/UserInterface/Systems/Ghost/GhostUIController.Ghostbar.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using Content.Client.Gameplay; | ||
using Content.Client.Ghost; | ||
using Content.Client.UserInterface.Systems.Gameplay; | ||
using Content.Client.UserInterface.Systems.Ghost.Widgets; | ||
using Content.Shared.Ghost; | ||
using Robust.Client.UserInterface; | ||
using Robust.Client.UserInterface.Controllers; | ||
using Content.Client.UserInterface.Systems.Ghost; | ||
|
||
namespace Content.Client.UserInterface.Systems.Ghost; | ||
|
||
// TODO hud refactor BEFORE MERGE fix ghost gui being too far up | ||
public sealed partial class GhostUIController | ||
{ | ||
private void GhostBarPressed() | ||
{ | ||
Gui?.GhostBarWindow.OpenCentered(); | ||
} | ||
|
||
private void GhostBarSpawnPressed() | ||
{ | ||
_system?.GhostBarSpawn(); | ||
} | ||
|
||
public void LoadGhostbarGui() | ||
{ | ||
if (Gui == null) | ||
return; | ||
|
||
Gui.GhostBarPressed += GhostBarPressed; | ||
Gui.GhostBarWindow.SpawnButtonPressed += GhostBarSpawnPressed; | ||
} | ||
|
||
public void UnloadGhostbarGui() | ||
{ | ||
if (Gui == null) | ||
return; | ||
|
||
Gui.GhostBarPressed -= GhostBarPressed; | ||
Gui.GhostBarWindow.SpawnButtonPressed -= GhostBarSpawnPressed; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.