Skip to content

Commit

Permalink
Merge branch 'locale-validator' of https://github.com/Rinary1/space-s…
Browse files Browse the repository at this point in the history
…unrise into locale-validator
  • Loading branch information
Rinary1 committed Oct 12, 2024
2 parents 7d1b751 + f63e1cd commit b0fb91f
Show file tree
Hide file tree
Showing 21 changed files with 470 additions and 105 deletions.
8 changes: 0 additions & 8 deletions Content.Client/Info/LinkBanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ public LinkBanner()
// Sunrise-Start
roadmapButton.OnPressed += _ => UserInterfaceManager.GetUIController<RoadmapUIController>().ToggleRoadmap();
buttons.AddChild(roadmapButton);

var donateButton = new Button
{
Text = Loc.GetString("server-info-donate-button"),
Disabled = true,
};
//donateButton.OnPressed += args =>
buttons.AddChild(donateButton);
// Sunrise-End

void AddInfoButton(string loc, CVarDef<string> cVar)
Expand Down
118 changes: 72 additions & 46 deletions Content.Client/Lobby/UI/LobbyGui.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
xmlns:info="clr-namespace:Content.Client.Info"
xmlns:widgets="clr-namespace:Content.Client.UserInterface.Systems.Chat.Widgets"
xmlns:serversHub="clr-namespace:Content.Client._Sunrise.ServersHub"
xmlns:changelog="clr-namespace:Content.Client.Changelog">
xmlns:changelog="clr-namespace:Content.Client.Changelog"
xmlns:userProfile="clr-namespace:Content.Client._Sunrise.UserProfile">
<!-- Background -->
<TextureRect Access="Public" VerticalExpand="True" HorizontalExpand="True" Name="Background" Stretch="KeepAspectCovered" />
<BoxContainer Name="MainContainer" VerticalExpand="True" HorizontalExpand="True" Orientation="Horizontal"
Expand Down Expand Up @@ -63,61 +64,86 @@
<BoxContainer Orientation="Vertical" SeparationOverride="4" Name="VoteContainer"
Access="Public" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0 8" />
</BoxContainer>
<BoxContainer Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True"
VerticalAlignment="Bottom" HorizontalAlignment="Left">
<PanelContainer Name="LeftBottomPanel" StyleClasses="AngleRect" VerticalExpand="True" MinWidth="550"
VerticalAlignment="Bottom" HorizontalExpand="True">
<BoxContainer Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Top"
HorizontalExpand="True" VerticalExpand="True">
<BoxContainer Orientation="Vertical" Name="ServersHubBox" VerticalExpand="True"
VerticalAlignment="Bottom" Access="Public">
<controls:StripeBack>
<BoxContainer Orientation="Horizontal" Name="ServersHubHeader" >
<Label HorizontalExpand="True" Name="ServersHubHeaderLabel" Access="Public"
Text="Сейчас играет: 0/0" VAlign="Center" StyleClasses="LabelHeading"
Align="Center"/>
<TextureRect Name="ServersHubHider" VerticalAlignment="Center" SetSize="25 25"
Stretch="KeepAspectCentered" Margin="5 1" MouseFilter="Pass"
HorizontalAlignment="Right" Access="Public">
</TextureRect>
<BoxContainer Orientation="Vertical" HorizontalAlignment="Left" VerticalExpand="True"
SeparationOverride="2" VerticalAlignment="Stretch" HorizontalExpand="True" >
<BoxContainer Orientation="Vertical" HorizontalAlignment="Left" MinWidth="600"
VerticalAlignment="Bottom" VerticalExpand="True">
<PanelContainer Name="LeftBottomPanel" SizeFlagsStretchRatio="3"
StyleClasses="AngleRect" VerticalExpand="True"
VerticalAlignment="Bottom" HorizontalAlignment="Stretch" HorizontalExpand="True">
<BoxContainer Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
HorizontalExpand="True" VerticalExpand="True" SeparationOverride="3">
<BoxContainer Orientation="Vertical" Name="UserProfileBox" VerticalExpand="True"
VerticalAlignment="Stretch" Access="Public" SizeFlagsStretchRatio="4">
<controls:StripeBack>
<BoxContainer Orientation="Horizontal" Name="UserProfileHeader" >
<Label HorizontalExpand="True" Name="UserProfileHeaderLabel" Access="Public"
Text="Профиль" VAlign="Center" StyleClasses="LabelHeading"
Align="Center"/>
<TextureRect Name="UserProfileHider" VerticalAlignment="Center" SetSize="25 25"
Stretch="KeepAspectCentered" Margin="5 1" MouseFilter="Pass"
HorizontalAlignment="Right" Access="Public">
</TextureRect>
</BoxContainer>
</controls:StripeBack>
<BoxContainer Orientation="Vertical" Name="UserProfileContent" HorizontalExpand="True"
VerticalExpand="True"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<userProfile:UserProfile Name="UserProfileBody" Access="Public" HorizontalExpand="True"
VerticalExpand="True" />
</BoxContainer>
</controls:StripeBack>
<BoxContainer Orientation="Vertical" Name="ServersHubContent" HorizontalExpand="True"
VerticalExpand="True"
HorizontalAlignment="Stretch" VerticalAlignment="Top" MinHeight="150">
<serversHub:ServersHub Name="ServersHubBody" Access="Public" HorizontalExpand="True"
VerticalExpand="True" />
</BoxContainer>
</BoxContainer>
<BoxContainer Orientation="Vertical" Name="ChangelogBox" VerticalExpand="True" HorizontalAlignment="Stretch"
MaxWidth="530" VerticalAlignment="Bottom">
<BoxContainer Orientation="Vertical" VerticalExpand="True" VerticalAlignment="Stretch">
<controls:StripeBack VerticalAlignment="Top">
<BoxContainer Orientation="Horizontal" Name="ChangelogHeader">
<Label HorizontalExpand="True" Text="{Loc 'changelog-lobby-window-title'}"
VAlign="Center" StyleClasses="LabelHeading" Align="Center"/>
<TextureRect Name="ChangelogHider" VerticalAlignment="Center" SetSize="25 25"
<BoxContainer Orientation="Vertical" Name="ServersHubBox" VerticalExpand="True"
VerticalAlignment="Bottom" Access="Public" SizeFlagsStretchRatio="2">
<controls:StripeBack>
<BoxContainer Orientation="Horizontal" Name="ServersHubHeader" >
<Label HorizontalExpand="True" Name="ServersHubHeaderLabel" Access="Public"
Text="Сейчас играет: 0/0" VAlign="Center" StyleClasses="LabelHeading"
Align="Center"/>
<TextureRect Name="ServersHubHider" VerticalAlignment="Center" SetSize="25 25"
Stretch="KeepAspectCentered" Margin="5 1" MouseFilter="Pass"
HorizontalAlignment="Right" Access="Public">
</TextureRect>
</BoxContainer>
</controls:StripeBack>
<BoxContainer Orientation="Vertical" MinHeight="200" MaxHeight="250" Name="ChangelogContent" VerticalExpand="True"
HorizontalAlignment="Stretch" VerticalAlignment="Top" >
<changelog:ChangelogTab Name="LocalChangelogBody"
RectClipContent="True" Access="Public"
VerticalExpand="True" VerticalAlignment="Stretch"
MinHeight="200" MaxHeight="250"/>
<BoxContainer Orientation="Vertical" Name="ServersHubContent" HorizontalExpand="True"
VerticalExpand="True"
HorizontalAlignment="Stretch" VerticalAlignment="Top">
<serversHub:ServersHub Name="ServersHubBody" Access="Public" HorizontalExpand="True"
VerticalExpand="True" />
</BoxContainer>
</BoxContainer>
<BoxContainer Orientation="Vertical" Name="ChangelogBox" VerticalExpand="True"
MaxWidth="580"
HorizontalAlignment="Stretch" VerticalAlignment="Bottom"
SizeFlagsStretchRatio="5">
<BoxContainer Orientation="Vertical" VerticalExpand="True" VerticalAlignment="Stretch">
<controls:StripeBack VerticalAlignment="Top">
<BoxContainer Orientation="Horizontal" Name="ChangelogHeader">
<Label HorizontalExpand="True" Text="{Loc 'changelog-lobby-window-title'}"
VAlign="Center" StyleClasses="LabelHeading" Align="Center"/>
<TextureRect Name="ChangelogHider" VerticalAlignment="Center" SetSize="25 25"
Stretch="KeepAspectCentered" Margin="5 1" MouseFilter="Pass"
HorizontalAlignment="Right" Access="Public">
</TextureRect>
</BoxContainer>
</controls:StripeBack>
<BoxContainer Orientation="Vertical" MinHeight="250" MaxHeight="250" Name="ChangelogContent" VerticalExpand="True"
HorizontalAlignment="Stretch" VerticalAlignment="Top" >
<changelog:ChangelogTab Name="LocalChangelogBody"
RectClipContent="True" Access="Public"
VerticalExpand="True" VerticalAlignment="Stretch"/>
</BoxContainer>
</BoxContainer>
</BoxContainer>
</BoxContainer>
</BoxContainer>
</PanelContainer>
<PanelContainer Name="LobbySongPanel" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" HorizontalExpand="True"
StyleClasses="AngleRect" VerticalExpand="True" Margin="0 10 0 0">
<RichTextLabel Name="LobbySong" Access="Public" HorizontalAlignment="Center" VerticalAlignment="Bottom"
VerticalExpand="True" HorizontalExpand="True"/>
</PanelContainer>
</PanelContainer>
<PanelContainer Name="LobbySongPanel" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" HorizontalExpand="True"
StyleClasses="AngleRect" VerticalExpand="True" Margin="0 10 0 0">
<RichTextLabel Name="LobbySong" Access="Public" HorizontalAlignment="Center" VerticalAlignment="Bottom"
VerticalExpand="True" HorizontalExpand="True"/>
</PanelContainer>
</BoxContainer>
</BoxContainer>
<BoxContainer Orientation="Vertical" HorizontalExpand="True" HorizontalAlignment="Right">
<PanelContainer Name="RightPanel" MinWidth="500" StyleClasses="AngleRect" VerticalExpand="True"
Expand Down
11 changes: 11 additions & 0 deletions Content.Client/Lobby/UI/LobbyGui.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ public LobbyGui()
CharacterInfoHider.Texture = CharacterInfoContent.Visible ? IconExpanded : IconCollapsed;
};

UserProfileHider.OnKeyBindUp += args =>
{
if (args.Function != EngineKeyFunctions.Use)
return;

UserProfileContent.Visible = !UserProfileContent.Visible;
UserProfileHider.Texture = UserProfileContent.Visible ? IconExpanded : IconCollapsed;
};

ServersHubHider.OnKeyBindUp += args =>
{
if (args.Function != EngineKeyFunctions.Use)
Expand Down Expand Up @@ -152,11 +161,13 @@ private void LoadIcons()
ServerInfoHider.Texture = ServerInfoContent.Visible ? IconExpanded : IconCollapsed;
CharacterInfoHider.Texture = CharacterInfoContent.Visible ? IconExpanded : IconCollapsed;
ChatHider.Texture = ChatContent.Visible ? IconExpanded : IconCollapsed;
UserProfileHider.Texture = CharacterInfoContent.Visible ? IconExpanded : IconCollapsed;
ServersHubHider.Modulate = StyleNano.NanoGold;
ChangelogHider.Modulate = StyleNano.NanoGold;
ServerInfoHider.Modulate = StyleNano.NanoGold;
CharacterInfoHider.Modulate = StyleNano.NanoGold;
ChatHider.Modulate = StyleNano.NanoGold;
UserProfileHider.Modulate = StyleNano.NanoGold;
}

private void OnServersHubEnableChanged(bool enable)
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Options/UI/EscapeMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<ui:VoteCallMenuButton />
<!-- Sunrise-Sponsor-Start -->
<Button Access="Public" Name="DonateButton" Text="{Loc 'ui-escape-donate'}" />
<Button Access="Public" Name="ForumButton" Text="{Loc 'ui-escape-forum'}" />
<!-- Sunrise-Sponsor-End -->
<Button Access="Public" Name="OptionsButton" Text="{Loc 'ui-escape-options'}" />
<Button Access="Public" Name="RulesButton" Text="{Loc 'ui-escape-rules'}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ public void OnStateEntered(GameplayState state)
{
_uri.OpenUri(_cfg.GetCVar(SunriseCCVars.InfoLinksDonate));
};

_escapeWindow.ForumButton.OnPressed += _ =>
{
_uri.OpenUri(_cfg.GetCVar(CCVars.InfoLinksForum));
};
// Sunrise-end

_escapeWindow.WikiButton.OnPressed += _ =>
Expand Down
51 changes: 51 additions & 0 deletions Content.Client/_Sunrise/UserProfile/UserProfile.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<Control xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls"
MinSize="100 100">
<BoxContainer Orientation="Vertical" >
<customControls:HSeparator/>
<BoxContainer Orientation="Horizontal" SeparationOverride="2" HorizontalExpand="True">
<customControls:VSeparator/>
<BoxContainer Orientation="Vertical" HorizontalExpand="True">
<Label Text="{Loc 'Спонсорство'}" StyleClasses="LabelHeadingBigger" HorizontalAlignment="Center"/>
<GridContainer Columns="2"
HorizontalAlignment="Center"
VerticalExpand="True"
VerticalAlignment="Top"
Margin="5 5 5 5">
<Label Text="{Loc 'Уровень: '}" StyleClasses="LabelKeyText"/>
<Label Name="SponsorTierName" />
</GridContainer>
<GridContainer Columns="2"
HorizontalAlignment="Center"
VerticalExpand="True"
VerticalAlignment="Top">
<Button Name="InfoSponsorButton" Text="Информация" Disabled="True" />
<Button Name="BuySponsorButton" Text="Приобрести" />
</GridContainer>
</BoxContainer>
<customControls:VSeparator/>
<BoxContainer Orientation="Vertical" HorizontalExpand="True">
<Label Text="{Loc 'Соц.сети'}" StyleClasses="LabelHeadingBigger" HorizontalAlignment="Center"/>
<GridContainer Columns="2"
HorizontalAlignment="Center"
VerticalExpand="True"
VerticalAlignment="Top"
Margin="5 5 5 5">
<Label Text="{Loc 'Discord:'}" StyleClasses="LabelKeyText"/>
<BoxContainer Orientation="Horizontal">
<Label Name="LinkedDiscordName" />
<Button Name="LinkDiscordButton" Text="Подвязать"/>
</BoxContainer>
<Label Text="{Loc 'Telegram:'}" StyleClasses="LabelKeyText"/>
<BoxContainer Orientation="Horizontal" >
<Label Name="LinkedTelegramName" />
<Button Name="LinkTelegramButton" Text="Подвязать"/>
</BoxContainer>
</GridContainer>
</BoxContainer>
<customControls:VSeparator/>
</BoxContainer>
<customControls:HSeparator/>
</BoxContainer>
</Control>
Loading

0 comments on commit b0fb91f

Please sign in to comment.