-
Notifications
You must be signed in to change notification settings - Fork 147
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 Coatmaxxing
- Loading branch information
Showing
736 changed files
with
167,732 additions
and
105,253 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Close PR's on master | ||
name: Close PRs on master | ||
|
||
on: | ||
pull_request_target: | ||
|
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
6 changes: 6 additions & 0 deletions
6
Content.Client/Administration/UI/AdminRemarks/AdminMessagePopupMessage.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,6 @@ | ||
<Control xmlns="https://spacestation14.io" Margin="0 0 0 8"> | ||
<BoxContainer Orientation="Vertical"> | ||
<RichTextLabel Name="Admin" Margin="0 0 0 4" /> | ||
<RichTextLabel Name="Message" Margin="2 0 0 0" /> | ||
</BoxContainer> | ||
</Control> |
23 changes: 23 additions & 0 deletions
23
Content.Client/Administration/UI/AdminRemarks/AdminMessagePopupMessage.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,23 @@ | ||
using Content.Shared.Administration.Notes; | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.UserInterface; | ||
using Robust.Client.UserInterface.XAML; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Client.Administration.UI.AdminRemarks; | ||
|
||
[GenerateTypedNameReferences] | ||
public sealed partial class AdminMessagePopupMessage : Control | ||
{ | ||
public AdminMessagePopupMessage(AdminMessageEuiState.Message message) | ||
{ | ||
RobustXamlLoader.Load(this); | ||
|
||
Admin.SetMessage(FormattedMessage.FromMarkup(Loc.GetString( | ||
"admin-notes-message-admin", | ||
("admin", message.AdminName), | ||
("date", message.AddedOn.ToLocalTime())))); | ||
|
||
Message.SetMessage(message.Text); | ||
} | ||
} |
42 changes: 28 additions & 14 deletions
42
Content.Client/Administration/UI/AdminRemarks/AdminMessagePopupWindow.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 |
---|---|---|
@@ -1,22 +1,36 @@ | ||
<ui:FancyWindow xmlns="https://spacestation14.io" | ||
xmlns:ui="clr-namespace:Content.Client.UserInterface.Controls" | ||
VerticalExpand="True" HorizontalExpand="True" | ||
Title="{Loc admin-notes-message-window-title}" | ||
MinSize="600 170"> | ||
<PanelContainer VerticalExpand="True" HorizontalExpand="True" StyleClasses="BackgroundDark"> | ||
<ScrollContainer HScrollEnabled="False" VerticalExpand="True" HorizontalExpand="True" Margin="4"> | ||
<BoxContainer Orientation="Vertical" SeparationOverride="10" VerticalAlignment="Bottom"> | ||
<Label Name="AdminLabel" Text="Loading..." /> | ||
<RichTextLabel Name="MessageLabel" /> | ||
<Control xmlns="https://spacestation14.io" | ||
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"> | ||
<PanelContainer MouseFilter="Stop"> | ||
<PanelContainer.PanelOverride> | ||
<!-- semi-transparent background --> | ||
<gfx:StyleBoxFlat BackgroundColor="#000000AA" /> | ||
</PanelContainer.PanelOverride> | ||
|
||
<Control HorizontalAlignment="Center" VerticalAlignment="Center" MaxWidth="600"> | ||
<PanelContainer StyleClasses="AngleRect" /> | ||
|
||
<BoxContainer Orientation="Vertical" Margin="4"> | ||
<RichTextLabel Name="Description" /> | ||
|
||
<!-- Contains actual messages --> | ||
<ScrollContainer HScrollEnabled="False" Margin="4" VerticalExpand="True" ReturnMeasure="True" MaxHeight="400"> | ||
<BoxContainer Orientation="Vertical" Name="MessageContainer" Margin="0 2 0 0" /> | ||
</ScrollContainer> | ||
|
||
<Label Name="WaitLabel" /> | ||
<BoxContainer Orientation="Horizontal"> | ||
<Button Name="DismissButton" | ||
Text="{Loc 'admin-notes-message-dismiss'}" /> | ||
Text="{Loc 'admin-notes-message-dismiss'}" | ||
Disabled="True" | ||
HorizontalExpand="True" | ||
StyleClasses="OpenRight" /> | ||
<Button Name="AcceptButton" | ||
Text="{Loc 'admin-notes-message-accept'}" | ||
Disabled="True" /> | ||
Disabled="True" | ||
HorizontalExpand="True" | ||
StyleClasses="OpenLeft" /> | ||
</BoxContainer> | ||
</BoxContainer> | ||
</ScrollContainer> | ||
</Control> | ||
</PanelContainer> | ||
</ui:FancyWindow> | ||
</Control> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<Control xmlns="https://spacestation14.io" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:parallax="clr-namespace:Content.Client.Parallax" | ||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"> | ||
<parallax:ParallaxControl /> | ||
<Control HorizontalAlignment="Center" VerticalAlignment="Center"> | ||
<PanelContainer StyleClasses="AngleRect" /> | ||
<BoxContainer Orientation="Vertical"> | ||
<BoxContainer Orientation="Horizontal"> | ||
<Label Margin="8 0 0 0" Text="{Loc 'discord-auth-title'}" | ||
StyleClasses="LabelHeading" VAlign="Center" /> | ||
<Button Name="QuitButton" Text="{Loc 'discord-auth-quit-btn'}" | ||
HorizontalAlignment="Right" HorizontalExpand="True" /> | ||
</BoxContainer> | ||
<controls:HighDivider /> | ||
<BoxContainer Orientation="Vertical" Margin="50 20 50 20"> | ||
<Label Text="{Loc 'discord-auth-info'}" Align="Center" /> | ||
<Label Text="{Loc 'discord-auth-warn'}" Margin="0 5 0 0" Align="Center" StyleClasses="LabelSubText" /> | ||
</BoxContainer> | ||
<BoxContainer Orientation="Horizontal" VerticalAlignment="Bottom" Margin="10 0 0 0"> | ||
<Label Text="{Loc 'discord-auth-link'}" Align="Center" /> | ||
<Label Text=" " /> | ||
<LineEdit Name="UrlEdit" HorizontalExpand="True" Editable="False"></LineEdit> | ||
</BoxContainer> | ||
<Button Name="OpenUrlButton" Text="{Loc 'discord-auth-browser-btn'}" HorizontalExpand="True" StyleClasses="OpenRight" /> | ||
</BoxContainer> | ||
</Control> | ||
</Control> |
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,36 @@ | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.Console; | ||
using Robust.Client.UserInterface; | ||
using Robust.Client.UserInterface.Controls; | ||
using Robust.Client.UserInterface.XAML; | ||
|
||
namespace Content.Client.DiscordAuth; | ||
|
||
[GenerateTypedNameReferences] | ||
public sealed partial class DiscordAuthGui : Control | ||
{ | ||
[Dependency] private readonly DiscordAuthManager _discordAuth = default!; | ||
[Dependency] private readonly IClientConsoleHost _consoleHost = default!; | ||
|
||
|
||
public DiscordAuthGui() | ||
{ | ||
RobustXamlLoader.Load(this); | ||
IoCManager.InjectDependencies(this); | ||
LayoutContainer.SetAnchorPreset(this, LayoutContainer.LayoutPreset.Wide); | ||
|
||
QuitButton.OnPressed += (_) => | ||
{ | ||
_consoleHost.ExecuteCommand("quit"); | ||
}; | ||
|
||
UrlEdit.Text = _discordAuth.AuthUrl; | ||
OpenUrlButton.OnPressed += (_) => | ||
{ | ||
if (_discordAuth.AuthUrl != string.Empty) | ||
{ | ||
IoCManager.Resolve<IUriOpener>().OpenUri(_discordAuth.AuthUrl); | ||
} | ||
}; | ||
} | ||
} |
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.Shared.DiscordAuth; | ||
using Robust.Client.State; | ||
using Robust.Shared.Network; | ||
|
||
namespace Content.Client.DiscordAuth; | ||
|
||
public sealed class DiscordAuthManager | ||
{ | ||
[Dependency] private readonly IClientNetManager _net = default!; | ||
[Dependency] private readonly IStateManager _state = default!; | ||
|
||
|
||
public string AuthUrl { get; private set; } = string.Empty; | ||
|
||
|
||
public void Initialize() | ||
{ | ||
_net.RegisterNetMessage<DiscordAuthCheckMessage>(); | ||
_net.RegisterNetMessage<DiscordAuthRequiredMessage>(OnDiscordAuthRequired); | ||
} | ||
|
||
|
||
private void OnDiscordAuthRequired(DiscordAuthRequiredMessage message) | ||
{ | ||
if (_state.CurrentState is not DiscordAuthState) | ||
{ | ||
AuthUrl = message.AuthUrl; | ||
_state.RequestStateChange<DiscordAuthState>(); | ||
} | ||
} | ||
} |
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,36 @@ | ||
using System.Threading; | ||
using Content.Shared.DiscordAuth; | ||
using Robust.Client.State; | ||
using Robust.Client.UserInterface; | ||
using Robust.Shared.Network; | ||
using Timer = Robust.Shared.Timing.Timer; | ||
|
||
namespace Content.Client.DiscordAuth; | ||
|
||
public sealed class DiscordAuthState : State | ||
{ | ||
[Dependency] private readonly IUserInterfaceManager _userInterface = default!; | ||
[Dependency] private readonly IClientNetManager _net = default!; | ||
|
||
|
||
private DiscordAuthGui? _gui; | ||
private readonly CancellationTokenSource _checkTimerCancel = new(); | ||
|
||
|
||
protected override void Startup() | ||
{ | ||
_gui = new DiscordAuthGui(); | ||
_userInterface.StateRoot.AddChild(_gui); | ||
|
||
Timer.SpawnRepeating(TimeSpan.FromSeconds(5), () => | ||
{ | ||
_net.ClientSendMessage(new DiscordAuthCheckMessage()); | ||
}, _checkTimerCancel.Token); | ||
} | ||
|
||
protected override void Shutdown() | ||
{ | ||
_checkTimerCancel.Cancel(); | ||
_gui!.Dispose(); | ||
} | ||
} |
Oops, something went wrong.