Skip to content

Commit

Permalink
aaaaaaa (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhailrake authored Nov 13, 2024
1 parent aaa75e7 commit 5c3211b
Show file tree
Hide file tree
Showing 5 changed files with 288 additions and 83 deletions.
292 changes: 214 additions & 78 deletions Content.Client/Launcher/LauncherConnectingGui.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,106 +5,242 @@
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:serversHub="clr-namespace:Content.Client._Sunrise.ServersHub">
<parallax:ParallaxControl />

<BoxContainer Orientation="Vertical"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="40 0 0 0">
<PanelContainer StyleClasses="AngleRect" MinWidth="200">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#1a1a1a"
BorderColor="#3E3E4A"
BorderThickness="2"/>
</PanelContainer.PanelOverride>
<BoxContainer Orientation="Vertical" Margin="0 5">
<controls:StripeBack>
<BoxContainer Orientation="Vertical" Margin="0 8">
<Label Text="Наше сообщество!"
StyleClasses="LabelHeadingBigger"
HorizontalAlignment="Center"/>
<Label Text="Присоединяйтесь к нам!"
StyleClasses="LabelSubText"
HorizontalAlignment="Center"/>
</BoxContainer>
</controls:StripeBack>

<PanelContainer Margin="0 10">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#464966"
BorderColor="#A88B5E"
BorderThickness="2"/>
</PanelContainer.PanelOverride>
<Button Name="Forum"
Text="Forum"
StyleClasses="SocialButton SocialButtonForum"/>
</PanelContainer>

<PanelContainer Margin="0 5">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#5865F2"/>
</PanelContainer.PanelOverride>
<Button Name="Discord"
Text="Discord"
StyleClasses="SocialButton SocialButtonDiscord"/>
</PanelContainer>

<PanelContainer Margin="0 10">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#0088cc"/>
</PanelContainer.PanelOverride>
<Button Name="Telegram"
Text="Telegram"
StyleClasses="SocialButton SocialButtonTelegram"/>
</PanelContainer>
</BoxContainer>
</PanelContainer>
</BoxContainer>

<Control HorizontalAlignment="Center" VerticalAlignment="Center">
<BoxContainer Orientation="Vertical">
<PanelContainer StyleClasses="AngleRect" />
<BoxContainer Orientation="Vertical" MinSize="300 200">
<BoxContainer Orientation="Horizontal">
<Label Margin="8 0 0 0" Text="{Loc 'connecting-title'}"
StyleClasses="LabelHeading" VAlign="Center" />
<Button Name="ExitButton" Text="{Loc 'connecting-exit'}"
HorizontalAlignment="Right" HorizontalExpand="True" />
</BoxContainer>
<controls:HighDivider />
<BoxContainer Orientation="Vertical" VerticalExpand="True" Margin="4 4 4 0">
<Control VerticalExpand="True" Margin="0 0 0 8">
<BoxContainer Orientation="Vertical" Name="ConnectingStatus">
<Label Text="{Loc 'connecting-in-progress'}" Align="Center" />
<Label Name="ConnectStatus" StyleClasses="LabelSubText" Align="Center" />
<PanelContainer StyleClasses="AngleRect">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#1a1a1a"
BorderColor="#2ecc71"
BorderThickness="2"/>
</PanelContainer.PanelOverride>
<BoxContainer Orientation="Vertical" MinSize="400 250">
<!-- Header -->
<controls:StripeBack>
<BoxContainer Orientation="Horizontal" Margin="10 5">
<Label Text="{Loc 'connecting-title'}"
StyleClasses="LabelBigger"
VAlign="Center" />
<Button Name="ExitButton"
Text="{Loc 'connecting-exit'}"
StyleClasses="ButtonColorRed"
HorizontalAlignment="Right"
HorizontalExpand="True" />
</BoxContainer>
<BoxContainer Orientation="Vertical" Name="ConnectFail" Visible="False" SeparationOverride="10">
<RichTextLabel Name="ConnectFailReason" VerticalAlignment="Stretch"/>
<BoxContainer Orientation="Horizontal" Align="Center">
<Button Name="RetryButton"
Text="{Loc 'connecting-retry'}"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
StyleClasses="OpenRight"/>
<Button Name="CopyButton"
Text="{Loc 'connecting-copy'}"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
StyleClasses="OpenLeft"/>
</controls:StripeBack>

<controls:HighDivider />

<!-- Connection Status Area -->
<BoxContainer Orientation="Vertical"
VerticalExpand="True"
Margin="10 15">
<Control VerticalExpand="True" Margin="0 0 0 8">
<!-- Connecting Status -->
<BoxContainer Orientation="Vertical"
Name="ConnectingStatus"
Margin="0 10">
<Label Text="{Loc 'connecting-in-progress'}"
Align="Center"
StyleClasses="LabelBigger"/>
<Label Name="ConnectStatus"
StyleClasses="LabelSubText"
Align="Center"
Margin="0 10"/>
</BoxContainer>
</BoxContainer>
<BoxContainer Orientation="Vertical" Name="Disconnected" Visible="False" SeparationOverride="10">
<Label Text="{Loc 'connecting-disconnected'}" Align="Center" />
<Label Name="DisconnectReason" Align="Center" />
<BoxContainer Orientation="Horizontal" Align="Center" VerticalAlignment="Bottom">
<Button Name="ReconnectButton"
Text="{Loc 'connecting-reconnect'}"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
StyleClasses="OpenRight"/>
<Button Name="CopyButtonDisconnected"
Text="{Loc 'connecting-copy'}"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
StyleClasses="OpenLeft"/>
<!-- Sunrise edit start. -->
<Button Name="Forum"
Text="Forum"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
StyleClasses="OpenLeft"/>
<Button Name="Discord"
Text="Discord"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
StyleClasses="OpenLeft"/>
<!-- Sunrise edit end. -->

<!-- Connection Failed -->
<BoxContainer Orientation="Vertical"
Name="ConnectFail"
Visible="False"
SeparationOverride="15">
<RichTextLabel Name="ConnectFailReason"
VerticalAlignment="Stretch"
StyleClasses="LabelBigger"/>
<BoxContainer Orientation="Horizontal"
Align="Center"
Margin="0 10">
<Button Name="RetryButton"
Text="{Loc 'connecting-retry'}"
StyleClasses="ButtonColorGreen OpenRight"
MinWidth="120"
MinHeight="35"/>
<Button Name="CopyButton"
Text="{Loc 'connecting-copy'}"
StyleClasses="ButtonColorBlue OpenLeft"
MinWidth="120"
MinHeight="35"/>
</BoxContainer>
</BoxContainer>

<!-- Disconnected State -->
<BoxContainer Orientation="Vertical"
Name="Disconnected"
Visible="False"
SeparationOverride="15">
<Label Text="{Loc 'connecting-disconnected'}"
Align="Center"
StyleClasses="LabelBigger"/>
<Label Name="DisconnectReason"
Align="Center"
StyleClasses="LabelSubText"/>
<BoxContainer Orientation="Horizontal"
Align="Center"
Margin="0 10">
<Button Name="ReconnectButton"
Text="{Loc 'connecting-reconnect'}"
StyleClasses="ButtonColorGreen OpenRight"
MinWidth="120"
MinHeight="35"/>
<Button Name="CopyButtonDisconnected"
Text="{Loc 'connecting-copy'}"
StyleClasses="ButtonColorBlue OpenLeft"
MinWidth="120"
MinHeight="35"/>
</BoxContainer>
</BoxContainer>
</Control>
<Label Name="ConnectingAddress"
StyleClasses="LabelSubText"
HorizontalAlignment="Center" />
</BoxContainer>

<!-- Footer -->
<PanelContainer>
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#222"
ContentMarginTopOverride="2" />
</PanelContainer.PanelOverride>
<BoxContainer Orientation="Horizontal"
Margin="12 8"
VerticalAlignment="Bottom">
<Label Text="{Loc 'connecting-tip'}"
StyleClasses="LabelSubText" />
<Label Text="{Loc 'connecting-version'}"
StyleClasses="LabelSubText"
HorizontalAlignment="Right"
HorizontalExpand="True" />
</BoxContainer>
</Control>
<Label Name="ConnectingAddress" StyleClasses="LabelSubText" HorizontalAlignment="Center" />
</PanelContainer>
</BoxContainer>
<PanelContainer>
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#444" ContentMarginTopOverride="2" />
</PanelContainer.PanelOverride>
</PanelContainer>
</PanelContainer>

<BoxContainer Orientation="Horizontal" Margin="12 0 4 0" VerticalAlignment="Bottom">
<Label Text="{Loc 'connecting-tip'}" StyleClasses="LabelSubText" />
<Label Text="{Loc 'connecting-version'}" StyleClasses="LabelSubText"
HorizontalAlignment="Right" HorizontalExpand="True" />
</BoxContainer>
</BoxContainer>
<PanelContainer StyleClasses="AngleRect" HorizontalExpand="True" Margin="0 10 0 0" Visible="False" Name="ServersHub" MinWidth="600" MinHeight="220">
<BoxContainer Orientation="Vertical" VerticalExpand="True" HorizontalExpand="True" Margin="3 3 3 3">
<PanelContainer StyleClasses="AngleRect"
HorizontalExpand="True"
Margin="0 15 0 0"
Visible="False"
Name="ServersHub"
MinWidth="600"
MinHeight="220">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#1a1a1a"
BorderColor="#e74c3c"
BorderThickness="2"/>
</PanelContainer.PanelOverride>
<BoxContainer Orientation="Vertical"
VerticalExpand="True"
HorizontalExpand="True"
Margin="5">
<controls:StripeBack>
<BoxContainer Orientation="Horizontal">
<Label HorizontalExpand="True" Text="Сейчас играет: 0/0" Name="ServersHubHeaderLabel" VAlign="Center"
StyleClasses="LabelHeading" Align="Center"/>
<Label HorizontalExpand="True"
Text="Сейчас играет: 0/0"
Name="ServersHubHeaderLabel"
VAlign="Center"
StyleClasses="LabelBigger"
Align="Center"/>
</BoxContainer>
</controls:StripeBack>
<ScrollContainer VerticalExpand="True" HScrollEnabled="False" HorizontalExpand="True">
<ScrollContainer VerticalExpand="True"
HScrollEnabled="False"
HorizontalExpand="True">
<serversHub:ServersHub Name="ServersHubBody" Access="Public" />
</ScrollContainer>
</BoxContainer>
</PanelContainer>
</BoxContainer>
</Control>
<!-- Bottom window for tips -->
<PanelContainer Name="LoginTips" StyleClasses="AngleRect" Margin="0 10" MaxWidth="600" VerticalExpand="True" VerticalAlignment="Bottom">

<PanelContainer Name="LoginTips"
StyleClasses="AngleRect"
Margin="0 15"
MaxWidth="600"
VerticalExpand="True"
VerticalAlignment="Bottom">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#1a1a1a"
BorderColor="#f1c40f"
BorderThickness="2"/>
</PanelContainer.PanelOverride>
<BoxContainer Orientation="Vertical" VerticalExpand="True">
<controls:StripeBack>
<BoxContainer Orientation="Horizontal" HorizontalAlignment="Center">
<Label Name="LoginTipTitle" Text="Tip" StyleClasses="LabelHeading" Align="Center"/>
<BoxContainer Orientation="Horizontal"
HorizontalAlignment="Center"
Margin="0 5">
<Label Name="LoginTipTitle"
Text="Tip"
StyleClasses="LabelBigger"
Align="Center"/>
</BoxContainer>
</controls:StripeBack>
<BoxContainer Orientation="Vertical" Margin="5 5 5 5" >
<RichTextLabel Name="LoginTip" VerticalExpand="True" />
<BoxContainer Orientation="Vertical" Margin="8">
<RichTextLabel Name="LoginTip"
VerticalExpand="True"
StyleClasses="LabelSubText"/>
</BoxContainer>
</BoxContainer>
</PanelContainer>
Expand Down
3 changes: 3 additions & 0 deletions Content.Client/Launcher/LauncherConnectingGui.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public sealed partial class LauncherConnectingGui : Control

private string _forumLink = ""; // Sunrise-Edit
private string _discordLink = ""; // Sunrise-Edit
private string _telegramLink = ""; // Sunrise-Edit

public LauncherConnectingGui(LauncherConnecting state, IRobustRandom random,
IPrototypeManager prototype, IConfigurationManager config, IClipboardManager clipboard,
Expand Down Expand Up @@ -67,9 +68,11 @@ public LauncherConnectingGui(LauncherConnecting state, IRobustRandom random,

_cfg.OnValueChanged(SunriseCCVars.BanForumLink, s => _forumLink = s, true); // Sunrise-Edit
_cfg.OnValueChanged(SunriseCCVars.BanDiscordLink, s => _discordLink = s, true); // Sunrise-Edit
_cfg.OnValueChanged(SunriseCCVars.BanTelegramLink, s => _telegramLink = s, true); // Sunrise-Edit

Forum.OnPressed += _ => _uri.OpenUri(_forumLink); // Sunrise-Edit
Discord.OnPressed += _ => _uri.OpenUri(_discordLink); // Sunrise-Edit
Telegram.OnPressed += _ => _uri.OpenUri(_telegramLink); // Sunrise-Edit

var addr = state.Address;
if (addr != null)
Expand Down
Loading

0 comments on commit 5c3211b

Please sign in to comment.