@@ -1,12 +1,15 @@
|
|||||||
using Content.Client.Changelog;
|
using Content.Client.Changelog;
|
||||||
|
using Content.Client.UserInterface.Controls;
|
||||||
using Content.Client.UserInterface.Systems.EscapeMenu;
|
using Content.Client.UserInterface.Systems.EscapeMenu;
|
||||||
using Content.Client.UserInterface.Systems.Guidebook;
|
using Content.Client.UserInterface.Systems.Guidebook;
|
||||||
using Content.Client.White.Stalin;
|
using Content.Client.White.Stalin;
|
||||||
|
using Content.Client.White.Stalin.StalinUi;
|
||||||
using Content.Shared.CCVar;
|
using Content.Shared.CCVar;
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Shared.Collections;
|
using Robust.Shared.Collections;
|
||||||
using Robust.Shared.Configuration;
|
using Robust.Shared.Configuration;
|
||||||
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
namespace Content.Client.Info
|
namespace Content.Client.Info
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
using Content.Shared.White.SaltedYayca;
|
using Content.Client.UserInterface.Controls;
|
||||||
|
using Content.Client.White.Stalin.StalinUi;
|
||||||
|
using Content.Shared.White.SaltedYayca;
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Shared.Network;
|
using Robust.Shared.Network;
|
||||||
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
namespace Content.Client.White.Stalin;
|
namespace Content.Client.White.Stalin;
|
||||||
|
|
||||||
@@ -8,6 +12,7 @@ public sealed class StalinManager
|
|||||||
{
|
{
|
||||||
[Dependency] private readonly INetManager _netManager = default!;
|
[Dependency] private readonly INetManager _netManager = default!;
|
||||||
[Dependency] private readonly IUriOpener _uriOpener = default!;
|
[Dependency] private readonly IUriOpener _uriOpener = default!;
|
||||||
|
private StalinLinkWindow _stalinLinkWindow = null!;
|
||||||
|
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
@@ -21,6 +26,12 @@ public sealed class StalinManager
|
|||||||
|
|
||||||
private void OnStalinResponse(DiscordAuthResponse message)
|
private void OnStalinResponse(DiscordAuthResponse message)
|
||||||
{
|
{
|
||||||
_uriOpener.OpenUri(message.Uri);
|
if (_stalinLinkWindow != null)
|
||||||
|
{
|
||||||
|
_stalinLinkWindow.Close();
|
||||||
|
}
|
||||||
|
_stalinLinkWindow = new StalinLinkWindow();
|
||||||
|
_stalinLinkWindow.SetUri(message.Uri);
|
||||||
|
_stalinLinkWindow.OpenCentered();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
15
Content.Client/White/Stalin/StalinUi/StalinLinkWindow.xaml
Normal file
15
Content.Client/White/Stalin/StalinUi/StalinLinkWindow.xaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<controls:FancyWindow xmlns="https://spacestation14.io"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
|
||||||
|
Title="Stalin Linker"
|
||||||
|
Resizable="False"
|
||||||
|
SetWidth="900">
|
||||||
|
|
||||||
|
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
|
||||||
|
<BoxContainer Orientation="Vertical" Margin="10" HorizontalExpand="True" VerticalAlignment="Center">
|
||||||
|
<Label Text="Скопируйте содержимое поля, или нажмите на кнопку ОТКРЫТЬ В БРАУЗЕРЕ" HorizontalExpand="True" HorizontalAlignment="Center"></Label>
|
||||||
|
<LineEdit Editable="False" Name="StalinLinkText" HorizontalExpand="True" Margin="5" MinHeight="25"></LineEdit>
|
||||||
|
<Button Name="OpenInBrowserButton" Text="Открыть в браузере" HorizontalExpand="True"></Button>
|
||||||
|
</BoxContainer>
|
||||||
|
</BoxContainer>
|
||||||
|
</controls:FancyWindow>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using Content.Client.UserInterface.Controls;
|
||||||
|
using Robust.Client.AutoGenerated;
|
||||||
|
using Robust.Client.UserInterface;
|
||||||
|
using Robust.Client.UserInterface.XAML;
|
||||||
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
|
namespace Content.Client.White.Stalin.StalinUi;
|
||||||
|
|
||||||
|
[GenerateTypedNameReferences]
|
||||||
|
public sealed partial class StalinLinkWindow : FancyWindow
|
||||||
|
{
|
||||||
|
[Dependency] private readonly IUriOpener _uriOpener = default!;
|
||||||
|
|
||||||
|
public StalinLinkWindow()
|
||||||
|
{
|
||||||
|
RobustXamlLoader.Load(this);
|
||||||
|
IoCManager.InjectDependencies(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetUri(string uri)
|
||||||
|
{
|
||||||
|
OpenInBrowserButton.OnPressed += args =>
|
||||||
|
{
|
||||||
|
_uriOpener.OpenUri(uri);
|
||||||
|
};
|
||||||
|
|
||||||
|
StalinLinkText.Text = uri;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user