Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better connection ui #616

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
292 changes: 214 additions & 78 deletions Content.Client/Launcher/LauncherConnectingGui.xaml
Original file line number Diff line number Diff line change
@@ -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="Наше сообщество!"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Где локализация?

StyleClasses="LabelHeadingBigger"
HorizontalAlignment="Center"/>
<Label Text="Присоединяйтесь к нам!"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Где локализация?

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Где локализация?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

там так и было

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

хочешь сделай епта

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

хочешь сделай епта

Ну так потом сплик будет просить ибо англ сервер хочет, я этого делать не буду просто потому что ушел ПСЖ. И только делаю апстримы локализации

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>
3 changes: 3 additions & 0 deletions Content.Client/Launcher/LauncherConnectingGui.xaml.cs
Original file line number Diff line number Diff line change
@@ -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,
@@ -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)
63 changes: 63 additions & 0 deletions Content.Client/Stylesheets/StyleNano.cs
Original file line number Diff line number Diff line change
@@ -88,6 +88,19 @@ public sealed class StyleNano : StyleBase
public const string StyleClassPopupMessageLarge = "PopupMessageLarge";
public const string StyleClassPopupMessageLargeCaution = "PopupMessageLargeCaution";

// Sunrise-Edit
public const string StyleClassSocialBox = "SocialBox";
public const string StyleClassSocialButton = "SocialButton";
public const string StyleClassSocialButtonForum = "SocialButtonForum";
public const string StyleClassSocialButtonDiscord = "SocialButtonDiscord";
public const string StyleClassSocialButtonTelegram = "SocialButtonTelegram";

public static readonly Color SocialBoxBackground = Color.FromHex("#1E1E24");
public static readonly Color ForumButtonColor = Color.FromHex("#A88B5E");
public static readonly Color DiscordButtonColor = Color.FromHex("#5865F2");
public static readonly Color TelegramButtonColor = Color.FromHex("#0088cc");
// Sunrise-Edit

public static readonly Color PanelDark = Color.FromHex("#1E1E22");

public static readonly Color NanoGold = Color.FromHex("#A88B5E");
@@ -1627,6 +1640,56 @@ public StyleNano(IResourceCache resCache) : base(resCache)
BackgroundColor = FancyTreeSelectedRowColor,
}),

// Sunrise-Edit
Element<PanelContainer>().Class(StyleClassSocialBox)
.Prop(PanelContainer.StylePropertyPanel,
new StyleBoxFlat
{
BackgroundColor = new Color(30, 30, 36),
BorderColor = new Color(62, 62, 74),
BorderThickness = new Thickness(2),
ContentMarginLeftOverride = 10,
ContentMarginRightOverride = 10,
ContentMarginTopOverride = 5,
ContentMarginBottomOverride = 5
}),

Element<Button>().Class(StyleClassSocialButton)
.Prop(Button.StylePropertyStyleBox, new StyleBoxFlat
{
BackgroundColor = new Color(42, 42, 48),
ContentMarginLeftOverride = 15,
ContentMarginRightOverride = 15,
ContentMarginTopOverride = 8,
ContentMarginBottomOverride = 8
})
.Prop("font", notoSansBold16),

Element<Button>().Class(StyleClassSocialButtonForum)
.Pseudo(ContainerButton.StylePseudoClassNormal)
.Prop(Control.StylePropertyModulateSelf, new Color(168, 139, 94)),

Element<Button>().Class(StyleClassSocialButtonForum)
.Pseudo(ContainerButton.StylePseudoClassHover)
.Prop(Control.StylePropertyModulateSelf, new Color(188, 159, 114)),

Element<Button>().Class(StyleClassSocialButtonDiscord)
.Pseudo(ContainerButton.StylePseudoClassNormal)
.Prop(Control.StylePropertyModulateSelf, new Color(88, 101, 242)),

Element<Button>().Class(StyleClassSocialButtonDiscord)
.Pseudo(ContainerButton.StylePseudoClassHover)
.Prop(Control.StylePropertyModulateSelf, new Color(108, 121, 255)),

Element<Button>().Class(StyleClassSocialButtonTelegram)
.Pseudo(ContainerButton.StylePseudoClassNormal)
.Prop(Control.StylePropertyModulateSelf, new Color(0, 136, 204)),

Element<Button>().Class(StyleClassSocialButtonTelegram)
.Pseudo(ContainerButton.StylePseudoClassHover)
.Prop(Control.StylePropertyModulateSelf, new Color(20, 156, 224)),
// Sunrise-Edit

// Silicon law edit ui
Element<Label>().Class(SiliconLawContainer.StyleClassSiliconLawPositionLabel)
.Prop(Label.StylePropertyFontColor, NanoGold),
11 changes: 7 additions & 4 deletions Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs
Original file line number Diff line number Diff line change
@@ -280,13 +280,13 @@ public static readonly CVarDef<bool>
public static readonly CVarDef<bool> RunMapVoteAfterRestart = CVarDef.Create("vote.run_map_vote_after_restart", false);

public static readonly CVarDef<bool> RunPresetVoteAfterRestart = CVarDef.Create("vote.run_preset_vote_after_restart", false);

public static readonly CVarDef<int> VotingsDelay = CVarDef.Create("vote.votings_delay", 90);

public static readonly CVarDef<int> MapVotingCount = CVarDef.Create("vote.map_voting_count", 3);

public static readonly CVarDef<int> RoundVotingCount = CVarDef.Create("vote.round_voting_count", 3);

public static readonly CVarDef<string> RoundVotingChancesPrototype = CVarDef.Create("vote.round_voting_chances_prototype", "");

/*
@@ -304,4 +304,7 @@ public static readonly CVarDef<bool>

public static readonly CVarDef<string> BanDiscordLink =
CVarDef.Create("cl.discord_link", "", CVar.SERVER | CVar.REPLICATED | CVar.ARCHIVE);

public static readonly CVarDef<string> BanTelegramLink =
CVarDef.Create("cl.telegram_link", "", CVar.SERVER | CVar.REPLICATED | CVar.ARCHIVE);
}
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ connecting-redial = Перезапустить
connecting-redial-wait = Пожалуйста подождите: { TOSTRING($time, "G3") }
connecting-in-progress = Подключение к серверу...
connecting-disconnected = Отключён от сервера:
connecting-tip = Не умирай!
connecting-tip = Мяу!
connecting-window-tip = Совет { $numberTip }
connecting-version = версия 0.1
connecting-fail-reason =