Skip to content

Commit

Permalink
Minor visual improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
TollyH committed Jan 13, 2022
1 parent f7bec84 commit 104058c
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 20 deletions.
2 changes: 1 addition & 1 deletion App.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Candy Clicker ver. 1.0.1
Candy Clicker ver. 1.0.2
Copyright © 2021 Ptolemy Hill
-->
<Application x:Class="CandyClicker.App"
Expand Down
2 changes: 1 addition & 1 deletion App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Candy Clicker ver. 1.0.1
* Candy Clicker ver. 1.0.2
* Copyright © 2021 Ptolemy Hill
*/

Expand Down
8 changes: 5 additions & 3 deletions CandyClicker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<Description>A simple candy clicking game written in C# and WPF</Description>
<Copyright>Copyright © 2021 Ptolemy Hill</Copyright>
<NeutralLanguage>en-GB</NeutralLanguage>
<AssemblyVersion>1.0.1</AssemblyVersion>
<FileVersion>1.0.1</FileVersion>
<Version>1.0.1</Version>
<AssemblyVersion>1.0.2</AssemblyVersion>
<FileVersion>1.0.2</FileVersion>
<Version>1.0.2</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -30,6 +30,7 @@
<None Remove="candy-reincarnate.png" />
<None Remove="candy-special.png" />
<None Remove="candy.png" />
<None Remove="candy_special_dzI_icon.ico" />
<None Remove="candy_xnp_icon.ico" />
<None Remove="mikachanALL.ttc" />
</ItemGroup>
Expand All @@ -38,6 +39,7 @@
<Resource Include="candy-reincarnate.png" />
<Resource Include="candy-special.png" />
<Resource Include="candy.png" />
<Resource Include="candy_special_dzI_icon.ico" />
<Resource Include="candy_xnp_icon.ico" />
<Resource Include="mikachanALL.ttc" />
</ItemGroup>
Expand Down
16 changes: 8 additions & 8 deletions MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Candy Clicker ver. 1.0.1
Candy Clicker ver. 1.0.2
Copyright © 2021 Ptolemy Hill
-->
<Window x:Name="windowCandyClicker" x:Class="CandyClicker.MainWindow"
Expand Down Expand Up @@ -33,12 +33,12 @@
<Rectangle x:Name="rectangleBonusBackground" Height="10" Margin="0,95,0,0" VerticalAlignment="Top" StrokeThickness="0" Fill="#66000000"/>
<Rectangle x:Name="rectangleBonusProgress" HorizontalAlignment="Left" Height="10" Margin="0,95,0,0" VerticalAlignment="Top" Width="0" StrokeThickness="0" Fill="#FFFF4141"/>
<ScrollViewer Margin="0,300,0,0">
<StackPanel x:Name="stackPanelShop" Background="#22000000"/>
<StackPanel x:Name="stackPanelShop" Background="Transparent"/>
</ScrollViewer>
<TextBlock x:Name="textBlockOverflow" Text="" VerticalAlignment="Top" Margin="10,281,10,0" FontSize="16" FontWeight="Bold" Foreground="#ebba0c" FontFamily="{StaticResource mikachan}"/>
<Grid x:Name="gridReincarnate" Background="#BF000000" Visibility="Collapsed">
<Border Margin="30" BorderBrush="#FFFF4141" BorderThickness="5" CornerRadius="10" Background="#FFF1F1F1">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Border Margin="25" BorderBrush="#FFFF4141" BorderThickness="5" CornerRadius="10" Background="#FFF1F1F1">
<ScrollViewer VerticalScrollBarVisibility="Auto" Margin="5">
<StackPanel>
<TextBlock Margin="10,10,10,0" Foreground="#FFFF4141" TextWrapping="Wrap" FontFamily="{StaticResource mikachan}" FontSize="24" Text="Reincarnation" FontWeight="Bold" TextAlignment="Center"/>
<TextBlock x:Name="textBlockReincarnateDescription" Margin="10,5,10,10" Foreground="#FFFF4141" TextWrapping="Wrap" FontFamily="{StaticResource mikachan}" FontSize="16" FontWeight="Bold"/>
Expand All @@ -49,8 +49,8 @@
</Border>
</Grid>
<Grid x:Name="gridCheat" Background="#BF000000" Visibility="Collapsed">
<Border Margin="30" BorderBrush="#FFFF4141" BorderThickness="5" CornerRadius="10" Background="#FFF1F1F1">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Border Margin="25" BorderBrush="#FFFF4141" BorderThickness="5" CornerRadius="10" Background="#FFF1F1F1">
<ScrollViewer VerticalScrollBarVisibility="Auto" Margin="5">
<StackPanel>
<TextBlock Margin="10,10,10,0" Foreground="#FFFF4141" TextWrapping="Wrap" FontFamily="{StaticResource mikachan}" FontSize="24" Text="Cheat Menu" FontWeight="Bold" TextAlignment="Center"/>
<Button x:Name="buttonCloseCheat" Background="#FFFF4141" BorderBrush="#FFC72323" BorderThickness="3" Content="X" FontFamily="{StaticResource mikachan}" FontSize="18" FontWeight="Bold" Foreground="#FFF9F9F9" Padding="1,1,1,1" Click="ButtonCloseCheat_Click" VerticalAlignment="Top" HorizontalAlignment="Right" Width="{Binding ActualHeight, Mode=OneWay, RelativeSource={RelativeSource Self}}" Margin="0,-30,10,0"/>
Expand Down Expand Up @@ -78,8 +78,8 @@
</Border>
</Grid>
<Grid x:Name="gridHelp" Background="#BF000000" Visibility="Collapsed">
<Border Margin="30" BorderBrush="#FFFF4141" BorderThickness="5" CornerRadius="10" Background="#FFF1F1F1">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Border Margin="25" BorderBrush="#FFFF4141" BorderThickness="5" CornerRadius="10" Background="#FFF1F1F1">
<ScrollViewer VerticalScrollBarVisibility="Auto" Margin="5">
<StackPanel>
<TextBlock Margin="10,10,10,0" Foreground="#FFFF4141" TextWrapping="Wrap" FontFamily="{StaticResource mikachan}" FontSize="24" Text="Help" FontWeight="Bold" TextAlignment="Center"/>
<Button x:Name="buttonCloseHelp" Background="#FFFF4141" BorderBrush="#FFC72323" BorderThickness="3" Content="X" FontFamily="{StaticResource mikachan}" FontSize="18" FontWeight="Bold" Foreground="#FFF9F9F9" Padding="1,1,1,1" Click="ButtonCloseHelp_Click" VerticalAlignment="Top" HorizontalAlignment="Right" Width="{Binding ActualHeight, Mode=OneWay, RelativeSource={RelativeSource Self}}" Margin="0,-30,10,0"/>
Expand Down
67 changes: 66 additions & 1 deletion MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Candy Clicker ver. 1.0.1
* Candy Clicker ver. 1.0.2
* Copyright © 2021 Ptolemy Hill
*/
using System;
Expand Down Expand Up @@ -58,6 +58,7 @@ public ulong CandyPSReincarnationMultiplier

private uint clicksTowardSpecial = 0;
private bool isSpecialActive = false;
private bool isEndGameVisualActive = false;

private bool doSaveIntegrityChecks = true;
private bool doAutoClickPrevention = true;
Expand Down Expand Up @@ -281,6 +282,62 @@ private async void InitiateSpecial()
isSpecialActive = false;
}

private void EndGameVisualUpdate()
{
isEndGameVisualActive = true;
Icon = new System.Windows.Media.Imaging.BitmapImage(new Uri("pack://application:,,,/candy_special_dzI_icon.ico"));
Storyboard sb = new()
{
Duration = new Duration(TimeSpan.FromSeconds(0.25))
};

ColorAnimation fadeToGold = new()
{
From = ((SolidColorBrush)Background).Color,
To = new Color()
{
R = 0xE5,
G = 0xF1,
B = 0x9E,
A = 0xFF
},
Duration = sb.Duration
};
Storyboard.SetTarget(fadeToGold, windowCandyClicker);
Storyboard.SetTargetProperty(fadeToGold, new PropertyPath("(Button.Background).(SolidColorBrush.Color)"));
sb.Children.Add(fadeToGold);

sb.Begin();
}

private void UndoEndGameVisualUpdate()
{
isEndGameVisualActive = false;
Icon = new System.Windows.Media.Imaging.BitmapImage(new Uri("pack://application:,,,/candy_xnp_icon.ico"));
Storyboard sb = new()
{
Duration = new Duration(TimeSpan.FromSeconds(0.25))
};

ColorAnimation fadeToGold = new()
{
From = ((SolidColorBrush)Background).Color,
To = new Color()
{
R = 0x86,
G = 0xF1,
B = 0xE6,
A = 0xFF
},
Duration = sb.Duration
};
Storyboard.SetTarget(fadeToGold, windowCandyClicker);
Storyboard.SetTargetProperty(fadeToGold, new PropertyPath("(Button.Background).(SolidColorBrush.Color)"));
sb.Children.Add(fadeToGold);

sb.Begin();
}

private void OpenHelpPopUp()
{
timerPerSecond.Stop();
Expand Down Expand Up @@ -614,6 +671,14 @@ private void TimerPerSecond_Elapsed(object sender, System.Timers.ElapsedEventArg
GiveCandy(CandyPerSecond * CandyPSReincarnationMultiplier);
}
}
if (!isEndGameVisualActive && CandyPSReincarnationMultiplier == ulong.MaxValue)
{
EndGameVisualUpdate();
}
else if (isEndGameVisualActive && CandyPSReincarnationMultiplier != ulong.MaxValue)
{
UndoEndGameVisualUpdate();
}
if ((DateTime.Now - lastClickTime).TotalSeconds > 1)
{
// Reset CPS timer as player has not clicked for over a second
Expand Down
2 changes: 1 addition & 1 deletion Shop.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Candy Clicker ver. 1.0.1
* Candy Clicker ver. 1.0.2
* Copyright © 2021 Ptolemy Hill
*/
namespace CandyClicker
Expand Down
8 changes: 4 additions & 4 deletions ShopControl.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Candy Clicker ver. 1.0.1
Candy Clicker ver. 1.0.2
Copyright © 2021 Ptolemy Hill
-->
<UserControl x:Name="userControlShopItem" x:Class="CandyClicker.ShopControl"
Expand All @@ -13,9 +13,9 @@
<Grid>
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF7FE2DE"/>
<GradientStop Color="#FFC6F9F7" Offset="0.5"/>
<GradientStop Color="#FF7FE2DE" Offset="1"/>
<GradientStop Color="#33525252"/>
<GradientStop Color="#55FFFFFF" Offset="0.5"/>
<GradientStop Color="#33525252" Offset="1"/>
</LinearGradientBrush>
</Grid.Background>
<TextBlock x:Name="textBlockName" Text="{Binding ShopItemName, ElementName=userControlShopItem, FallbackValue=XXXXXXXXXXXX, StringFormat=\{0:N0\}, TargetNullValue=0}" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="18" FontWeight="Bold" Foreground="#FFFF4141" Margin="5,0,0,0" FontFamily="{StaticResource mikachan}"/>
Expand Down
2 changes: 1 addition & 1 deletion ShopControl.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Candy Clicker ver. 1.0.1
* Candy Clicker ver. 1.0.2
* Copyright © 2021 Ptolemy Hill
*/
using System;
Expand Down
Binary file added candy_special_dzI_icon.ico
Binary file not shown.

0 comments on commit 104058c

Please sign in to comment.