Skip to content

Commit

Permalink
Major UI Update
Browse files Browse the repository at this point in the history
- New Layout
- New Button Style
- Minor TextBox update
- New Color scheme
- Copyright notice
- Custom minimize/close buttons
- New Window style
  • Loading branch information
hovo-hakobyan committed Apr 24, 2024
2 parents 8f977c5 + 57aa6bb commit c224454
Show file tree
Hide file tree
Showing 12 changed files with 512 additions and 77 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ This is what our ```CSVTeamParser.cs``` can handle:

Very simple :)

![Gif3](https://github.com/League-of-DAE-Legends/SquadForger/assets/88614889/73ade216-d078-4258-b2ca-eb73419a3787)
![Gif3](https://github.com/League-of-DAE-Legends/SquadForger/assets/88614889/8c693f03-9d70-4a44-acb6-b2cff3f226af)



### 4. Run the script to generate champion pools.
Expand All @@ -34,7 +35,8 @@ Here we have 2 options:
- Gets the champion info directly from Riot's Data Dragons. Take a look at the [Data Dragons](https://developer.riotgames.com/docs/lol) documentation for more info.
- Needs a valid patch number to do so

![Gif3](https://github.com/League-of-DAE-Legends/SquadForger/assets/88614889/1473c960-2998-4f26-aa63-606f67d53c36)
![Gif3](https://github.com/League-of-DAE-Legends/SquadForger/assets/88614889/4452e50b-61bd-4c55-89af-974c99327cbc)


### 5. Discord integration automatically shares the pools.
- If you didn't specify a Discord webhook in ```PrivateData.config```, then this will do nothing
Expand Down
18 changes: 17 additions & 1 deletion SquadForger/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,24 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SquadForger"
xmlns:viewModel="clr-namespace:SquadForger.ViewModel"
xmlns:view="clr-namespace:SquadForger.View"
StartupUri="MainWindow.xaml">
<Application.Resources>

<ResourceDictionary>

<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Theme/MenuButtonTheme.xaml"/>
<ResourceDictionary Source="Theme/TextBoxTheme.xaml"/>
</ResourceDictionary.MergedDictionaries>

<DataTemplate DataType="{x:Type viewModel:DiscordVM}">
<view:DiscordView />
</DataTemplate>

<DataTemplate DataType="{x:Type viewModel:SquadVM}">
<view:SquadView />
</DataTemplate>
</ResourceDictionary>
</Application.Resources>
</Application>
112 changes: 90 additions & 22 deletions SquadForger/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,98 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SquadForger"
xmlns:vm ="clr-namespace:SquadForger.ViewModel"
xmlns:viewModel ="clr-namespace:SquadForger.ViewModel"
WindowStyle = "None"
WindowStartupLocation="CenterScreen"
ResizeMode="NoResize"
Background = "Transparent"
AllowsTransparency="True"
mc:Ignorable="d"
Title="{Binding WindowTitle}" Height="450" Width="800">
<Window.Background>
<SolidColorBrush Color="SlateGray"/>
</Window.Background>
Title="{Binding WindowTitle}" Height="550" Width="950">

<Window.DataContext>
<vm:MainVM/>
<viewModel:MainVM/>
</Window.DataContext>
<Grid>
<TabControl Background="SlateGray">
<TabItem Header = "Squads" Background="LightGray">
<Frame Content="{Binding SquadPage}" NavigationUIVisibility="Hidden" />
</TabItem>
<TabItem Header = "Post to Discord" Background="LightGray">
<Frame Content="{Binding DiscordPage}" NavigationUIVisibility="Hidden"/>
</TabItem>
<TabItem Header="Info" Background="LightGray">
<TextBlock Margin="10">
<TextBlock Text="Github repository: "/>
<Hyperlink Command="{Binding OpenGithubRepoCommand}">Click here</Hyperlink>
</TextBlock>
</TabItem>
</TabControl>
</Grid>

<Border Background="#272537" CornerRadius="20">
<Grid>

<Grid.ColumnDefinitions>
<ColumnDefinition Width="200"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>

</Grid.ColumnDefinitions>

<Grid.RowDefinitions>
<RowDefinition Height="75"></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
</Grid.RowDefinitions>

<!--Closing and minimize-->
<StackPanel Orientation="Horizontal" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Top">
<Ellipse Fill="Yellow"
Height="15"
Width="15"
Margin="0,10,5,0" MouseLeftButtonDown="minimizeApp"

/>
<Ellipse Fill="red"
Height="15"
Width="15"
Margin="5,10,10,0" MouseLeftButtonDown="CloseApp"
/>

</StackPanel>

<!--Logo area-->
<TextBlock Text="Squad Forger"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Foreground="white"
FontSize="22"
Margin="20,0,0,0"></TextBlock>

<!--Menu area-->
<StackPanel Grid.Row="1">
<RadioButton Content="Squads"
Height="50"
Foreground="White"
FontSize="14"
Style="{StaticResource MenuButtonTheme}"
IsChecked="True"
Command="{Binding SquadViewCommand}"/>

<RadioButton Content="Discord"
Height="50"
Foreground="White"
FontSize="14"
Style="{StaticResource MenuButtonTheme}"
Command="{Binding DiscordViewCommand}"/>

<RadioButton Content="Info"
Height="50"
Foreground="White"
FontSize="14"
Style="{StaticResource MenuButtonTheme}" Checked="RadioButton_Checked">
</RadioButton>
</StackPanel>

<ContentControl Grid.Row="1"
Grid.Column="1"
Margin="10"
Content="{Binding CurrentView}"/>

<Label Grid.Column="1"
Grid.Row="2"
Foreground="white"
Content="Copyright © 2024 by League of DAE Legends"
HorizontalAlignment="center"
FontSize="16"
>

</Label>
</Grid>
</Border>

</Window>
27 changes: 27 additions & 0 deletions SquadForger/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,32 @@ public MainWindow()
InitializeComponent();
//var webhookId = ConfigurationManager.AppSettings["dev_webhook"];
}

private void CloseApp(object sender, MouseButtonEventArgs e)
{
Close();
}

private void minimizeApp(object sender, MouseButtonEventArgs e)
{
this.WindowState = WindowState.Minimized;
}

private void RadioButton_Checked(object sender, RoutedEventArgs e)
{
try
{
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo
{
FileName = "https://github.com/League-of-DAE-Legends/SquadForger",
UseShellExecute = true
});
}
catch (Exception ex)
{
// Handle the error (optional)
MessageBox.Show("Failed to open URL: " + ex.Message);
}
}
}
}
2 changes: 2 additions & 0 deletions SquadForger/SquadForger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="Theme\MenuButtonTheme.xaml" />
<Page Include="Theme\TextBoxTheme.xaml" />
<Page Include="View\DiscordView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
27 changes: 27 additions & 0 deletions SquadForger/Theme/MenuButtonTheme.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style BasedOn="{StaticResource ResourceKey = {x:Type ToggleButton}}"
TargetType="{x:Type RadioButton}"
x:Key="MenuButtonTheme">
<Style.Setters>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="{TemplateBinding Background}">
<TextBlock Text="{TemplateBinding Property=Content}" VerticalAlignment="Center" Margin="50,0,0,0" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />

</Style.Setters>

<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Background" Value="#22202f"/>
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
45 changes: 45 additions & 0 deletions SquadForger/Theme/TextBoxTheme.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="{x:Type TextBox}" x:Key="ModernTextBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Border CornerRadius="5" Background="#353340" Width="150" Height="20">
<Grid>
<Rectangle StrokeThickness="1"/>
<TextBox Margin="1" Text="{TemplateBinding Text}"
BorderThickness="0"
Background="Transparent"
VerticalAlignment="Center"
Padding="5"
Foreground="#CFCFCF"
x:Name="SearchBox"/>

<TextBlock IsHitTestVisible="False"
Text="You can probably type in here :)"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Margin="10,0,0,0"
FontSize="11"
Foreground="DarkGray"
Grid.Column="1">

<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Style.Triggers>
<DataTrigger Binding="{Binding Text,ElementName=SearchBox}" Value="">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
<Setter Property="Visibility" Value="Hidden"/>
</Style>
</TextBlock.Style>

</TextBlock>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
Loading

0 comments on commit c224454

Please sign in to comment.