Skip to content

Commit

Permalink
Updated the game lobby tab layout +text cleanup (#2227)
Browse files Browse the repository at this point in the history
* closes #2152 #2153 redesigned play/spectate tab + other text improvements

* added a dropshadow to the chat box to make the text easier to read on different coloured backgrounds

---------

Co-authored-by: Kelly Elton <[email protected]>
  • Loading branch information
brine and kellyelton authored Apr 23, 2024
1 parent 195f075 commit 57a0329
Show file tree
Hide file tree
Showing 13 changed files with 291 additions and 372 deletions.
6 changes: 0 additions & 6 deletions octgnFX/Octgn.Core/Prefs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -587,12 +587,6 @@ public static int ContextFontSize
set { Config.Instance.WriteValue("ContextFontSize", value); }
}

public static bool SpectateGames
{
get { return Config.Instance.ReadValue("SpectateGames", false); }
set { Config.Instance.WriteValue("SpectateGames", value); }
}

public static bool UnderstandsChat
{
get { return Config.Instance.ReadValue("UnderstandsChat", false); }
Expand Down
20 changes: 13 additions & 7 deletions octgnFX/Octgn.JodsEngine/Controls/PreGameLobby.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@
<CheckBox.Template>
<ControlTemplate TargetType="CheckBox">
<Border Padding="2" SnapsToDevicePixels="True" BorderBrush="#eee" BorderThickness="1" Background="Transparent">
<TextBlock x:Name="spectateLabel" Text="Play" TextAlignment="Center" Foreground="#eee" FontWeight="Bold" Width="54" />
<TextBlock x:Name="spectateLabel" Text="Player" TextAlignment="Center" Foreground="#eee" FontWeight="Bold" Width="58" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Trigger.Setters>
<Setter Property="Text" TargetName="spectateLabel" Value="Spectate" />
<Setter Property="Text" TargetName="spectateLabel" Value="Spectator" />
</Trigger.Setters>
</Trigger>
</ControlTemplate.Triggers>
Expand Down Expand Up @@ -184,19 +184,25 @@
<toggleSwitch:HorizontalToggleSwitch Width="170" DataContext="{x:Static o:Program.GameSettings}" IsChecked="{Binding UseTwoSidedTable, Mode=TwoWay}" Visibility="{Binding ChangeTwoSidedTable, Converter={StaticResource BooleanToVisibilityConverter}}"
IsEnabled="{Binding ElementName=me,Path=CanChangeSettings}">
<toggleSwitch:HorizontalToggleSwitch.CheckedContent>
<TextBlock Text="Two Sided Table" TextWrapping="Wrap"></TextBlock>
<TextBlock Text="Two-Sided Table" TextWrapping="Wrap"></TextBlock>
</toggleSwitch:HorizontalToggleSwitch.CheckedContent>
<toggleSwitch:HorizontalToggleSwitch.UncheckedContent>
<TextBlock Text="One Sided Table" TextWrapping="Wrap"></TextBlock>
<TextBlock Text="One-Sided Table" TextWrapping="Wrap"></TextBlock>
</toggleSwitch:HorizontalToggleSwitch.UncheckedContent>
<toggleSwitch:HorizontalToggleSwitch.UncheckedBackground>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF3EB3EC"/>
<GradientStop Color="#FF349BE6" Offset="1"/>
</LinearGradientBrush>
</toggleSwitch:HorizontalToggleSwitch.UncheckedBackground>
</toggleSwitch:HorizontalToggleSwitch>
<toggleSwitch:HorizontalToggleSwitch Width="170" DataContext="{x:Static o:Program.GameSettings}" IsChecked="{Binding AllowSpectators, Mode=TwoWay}" Margin="10,0,0,0"
<toggleSwitch:HorizontalToggleSwitch Width="190" DataContext="{x:Static o:Program.GameSettings}" IsChecked="{Binding AllowSpectators, Mode=TwoWay}" Margin="10,0,0,0"
IsEnabled="{Binding ElementName=me,Path=CanChangeSettings}">
<toggleSwitch:HorizontalToggleSwitch.CheckedContent>
<TextBlock Text="Allow Spectators" TextWrapping="Wrap"></TextBlock>
</toggleSwitch:HorizontalToggleSwitch.CheckedContent>
<toggleSwitch:HorizontalToggleSwitch.UncheckedContent>
<TextBlock Text="No Spectators" TextWrapping="Wrap"></TextBlock>
<TextBlock Text="Disable Spectators" TextWrapping="Wrap"></TextBlock>
</toggleSwitch:HorizontalToggleSwitch.UncheckedContent>
</toggleSwitch:HorizontalToggleSwitch>
<toggleSwitch:HorizontalToggleSwitch Width="170" DataContext="{x:Static o:Program.GameSettings}" IsChecked="{Binding AllowCardList, Mode=TwoWay}" Margin="10,0,0,0"
Expand All @@ -205,7 +211,7 @@
<TextBlock Text="Allow Card List" TextWrapping="Wrap"></TextBlock>
</toggleSwitch:HorizontalToggleSwitch.CheckedContent>
<toggleSwitch:HorizontalToggleSwitch.UncheckedContent>
<TextBlock Text="Hidden Card List" TextWrapping="Wrap"></TextBlock>
<TextBlock Text="Disable Card List" TextWrapping="Wrap"></TextBlock>
</toggleSwitch:HorizontalToggleSwitch.UncheckedContent>
</toggleSwitch:HorizontalToggleSwitch>
<toggleSwitch:HorizontalToggleSwitch Width="190" DataContext="{x:Static o:Program.GameSettings}" IsChecked="{Binding AllowDiscordGameInvite, Mode=TwoWay}" Margin="10,0,0,0"
Expand Down
2 changes: 1 addition & 1 deletion octgnFX/Octgn.JodsEngine/Networking/ClientHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ public void CreateCardAt(int[] id, Guid[] modelId, int[] x, int[] y, bool faceUp
public void Leave(Player player)
{
WriteReplayAction(player.Id);
Program.GameMess.System("{0} has closed their game window left the game. They did not crash or lose connection, they left on purpose.", player);
Program.GameMess.System("{0} has voluntarily left the game.", player);
if( !Program.InPreGame ) {
Program.GameEngine.EventProxy.OnPlayerLeaveGame_3_1_0_1( player );
Program.GameEngine.EventProxy.OnPlayerQuit_3_1_0_2( player );
Expand Down
3 changes: 3 additions & 0 deletions octgnFX/Octgn.JodsEngine/Play/Gui/ChatControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@

<RichTextBox x:Name="output" AutomationProperties.Name="Chat/Game Log" IsReadOnly="True" ScrollViewer.VerticalScrollBarVisibility="Visible"
BorderThickness="0" Background="Transparent" Grid.Row="1" FontSize="{Binding ElementName=Me, Path=ChatFontSize}">
<RichTextBox.Effect>
<DropShadowEffect ShadowDepth="1" Direction="315" Color="Black" Opacity="0.5" BlurRadius="1"/>
</RichTextBox.Effect>
<RichTextBox.Resources>
<Style TargetType="{x:Type Paragraph}">
<Setter Property="Margin" Value="0"/>
Expand Down
2 changes: 1 addition & 1 deletion octgnFX/Octgn.Library/Localization/ILanguageDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public string UpdateMessage__UpdatingGame_Format

public string LoginMessage__UnknownError => "An unknown error occured. Please try again.";

public string ConnectionStatus__Disconnected => "Offline";
public string ConnectionStatus__Disconnected => "Not Logged In";

public string ConnectionStatus__Connecting => "Connecting...";

Expand Down
2 changes: 2 additions & 0 deletions octgnFX/Octgn/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
</ResourceDictionary>
<ResourceDictionary Source="/Resources/Themes/Global.xaml">
</ResourceDictionary>
<ResourceDictionary Source="/Resources/Themes/GridSplitter.xaml">
</ResourceDictionary>
<ResourceDictionary Source="/Resources/Themes/NumericUpDown.xaml">
</ResourceDictionary>
<ResourceDictionary Source="/Resources/Themes/ChildWindow.xaml">
Expand Down
4 changes: 4 additions & 0 deletions octgnFX/Octgn/Octgn.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Resources\Themes\GridSplitter.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Tabs\GameHistory\GameHistoryTab.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down
36 changes: 36 additions & 0 deletions octgnFX/Octgn/Resources/Themes/GridSplitter.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ctrl="clr-namespace:Octgn.Controls">
<Style x:Key="HorizontalGridSplitter" TargetType="{x:Type GridSplitter}">
<Setter Property="ResizeDirection" Value="Rows"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="BorderBrush" Value="WhiteSmoke"/>
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Margin" Value="1" />
<Setter Property="Background" Value="{StaticResource ControlBackgroundBrush}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GridSplitter}">
<Border BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Padding="9,2,9,1"
CornerRadius="5">
<Canvas RenderOptions.EdgeMode="Aliased" UseLayoutRounding="True"
Height="6" VerticalAlignment="Center"
Width="50" HorizontalAlignment="Center">
<Line X1="0" X2="50" Y1="0" Y2="0"
Stroke="WhiteSmoke" StrokeThickness="1"/>
<Line X1="0" X2="50" Y1="1" Y2="1"
Stroke="#A0A0A0" StrokeThickness="1"/>
<Line X1="0" X2="50" Y1="4" Y2="4"
Stroke="WhiteSmoke" StrokeThickness="1"/>
<Line X1="0" X2="50" Y1="5" Y2="5"
Stroke="#A0A0A0" StrokeThickness="1"/>
</Canvas>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
Loading

0 comments on commit 57a0329

Please sign in to comment.