Skip to content

Commit 9e31615

Browse files
committed
Help & Reset button
1 parent ed902a3 commit 9e31615

5 files changed

Lines changed: 25 additions & 0 deletions

File tree

MainWindow.xaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@
126126
<Button Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="50" Height="50" Background="Transparent" BorderBrush="Transparent" Margin="70,10,0,0" Click="EditTargetNumber">
127127
<Image Source="edit.png" Width="44" Height="44"/>
128128
</Button>
129+
<Button Grid.Row="0" HorizontalAlignment="Right" VerticalAlignment="Top" Width="50" Height="50" Background="Transparent" BorderBrush="Transparent" Margin="0,10,10,0" Click="Help">
130+
<Image Source="help.png" Width="44" Height="44"/>
131+
</Button>
132+
<Button Grid.Row="0" HorizontalAlignment="Right" VerticalAlignment="Top" Width="50" Height="50" Background="Transparent" BorderBrush="Transparent" Margin="0,10,70,0" Click="ResetGame">
133+
<Image Source="reset.png" Width="44" Height="44"/>
134+
</Button>
129135

130136
<StackPanel Grid.Row="0">
131137
<Label Name="Target" Content="123" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="90" FontWeight="Black"/>

MainWindow.xaml.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,5 +208,16 @@ private void ExitEditor(UIElement tb)
208208
MainGrid.Children.Remove(tb);
209209
ResetToDefault(setTarget: false);
210210
}
211+
212+
private void ResetGame(object sender, RoutedEventArgs e)
213+
{
214+
CurrentNumber = 0;
215+
Current.Content = CurrentNumber;
216+
}
217+
218+
private void Help(object sender, RoutedEventArgs e)
219+
{
220+
MessageBox.Show("Welcome to Math Game! The goal of the game is to reach the target number using the numbers provided. You can add, subtract, multiply, and divide the numbers to reach the target number. You can also change the target number by clicking on the edit icon in the top left. You can set how many steps are required to reach the target number in the settings which you can open by the wheel icon in the top left. To reset your current number to 0, click the reset icon in the top right. To get a new target number and restart, click the NEW button in the bottom right. Good luck!", "Help", MessageBoxButton.OK, MessageBoxImage.Information);
221+
}
211222
}
212223
}

MathGame.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@
2121
<Resource Include="settings.png">
2222
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2323
</Resource>
24+
<None Remove="reset.png" />
25+
<Resource Include="reset.png">
26+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
27+
</Resource>
28+
<None Remove="help.png" />
29+
<Resource Include="help.png">
30+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
31+
</Resource>
2432
</ItemGroup>
2533

2634
</Project>

help.png

57.8 KB
Loading

reset.png

12.4 KB
Loading

0 commit comments

Comments
 (0)