Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WpfClicker
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mgok
is223
SmyslovAlexey
WpfClicker
Commits
5d2984db
Commit
5d2984db
authored
4 months ago
by
itpark.team
Browse files
Options
Downloads
Patches
Plain Diff
done clicker
parent
d30c76fb
Branches
master
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
WpfAppFirstProj/MainWindow.xaml
+2
-2
2 additions, 2 deletions
WpfAppFirstProj/MainWindow.xaml
WpfAppFirstProj/MainWindow.xaml.cs
+24
-1
24 additions, 1 deletion
WpfAppFirstProj/MainWindow.xaml.cs
with
26 additions
and
3 deletions
WpfAppFirstProj/MainWindow.xaml
+
2
−
2
View file @
5d2984db
...
...
@@ -14,10 +14,10 @@
<TextBlock x:Name="textBlockScoreIncrement" HorizontalAlignment="Left" Margin="104,109,0,0" TextWrapping="Wrap" Text="Очков за клик: 1" VerticalAlignment="Top"/>
<Button x:Name="buttonBuyUpgrade" Content="Купить обновление" HorizontalAlignment="Left" Margin="108,155,0,0" VerticalAlignment="Top" Click="buttonBuyUpgrade_Click"/>
<TextBlock x:Name="textBlockTimerScoreIncrement" HorizontalAlignment="Left" Margin="111,229,0,0" TextWrapping="Wrap" Text="Очки за тик:
1
" VerticalAlignment="Top"/>
<TextBlock x:Name="textBlockTimerScoreIncrement" HorizontalAlignment="Left" Margin="111,229,0,0" TextWrapping="Wrap" Text="Очки за тик:
0
" VerticalAlignment="Top"/>
<TextBlock x:Name="textBlockTimerUpgradeCost" HorizontalAlignment="Left" Margin="110,249,0,0" TextWrapping="Wrap" Text="Стоимость обновления: 20" VerticalAlignment="Top"/>
<TextBlock HorizontalAlignment="Left" Margin="111,268,0,0" TextWrapping="Wrap" Text="Интервал таймера: 5 сек." VerticalAlignment="Top"/>
<Button x:Name="buttonBuyTimerUpgrade" Content="Купить обновление таймера" HorizontalAlignment="Left" Margin="115,294,0,0" VerticalAlignment="Top"/>
<Button x:Name="buttonBuyTimerUpgrade" Content="Купить обновление таймера" HorizontalAlignment="Left" Margin="115,294,0,0" VerticalAlignment="Top"
Click="buttonBuyTimerUpgrade_Click"
/>
</Grid>
</Window>
This diff is collapsed.
Click to expand it.
WpfAppFirstProj/MainWindow.xaml.cs
+
24
−
1
View file @
5d2984db
...
...
@@ -38,7 +38,7 @@ namespace WpfAppFirstProj
clickScoreIncrement
=
1
;
clickUpgradeCost
=
2
;
timerScoreIncrement
=
1
;
timerScoreIncrement
=
0
;
timerUpgradeCost
=
20
;
timer
=
new
DispatcherTimer
();
...
...
@@ -75,5 +75,28 @@ namespace WpfAppFirstProj
textBlockScore
.
Text
=
score
.
ToString
();
}
private
void
buttonBuyTimerUpgrade_Click
(
object
sender
,
RoutedEventArgs
e
)
{
if
(
score
<
timerUpgradeCost
)
{
MessageBox
.
Show
(
"У вас недостаточно очков для покупки"
);
return
;
}
if
(
timer
.
IsEnabled
==
false
)
{
timer
.
Start
();
}
timerScoreIncrement
++;
score
-=
timerUpgradeCost
;
timerUpgradeCost
*=
2
;
textBlockTimerScoreIncrement
.
Text
=
$"Очки за тик:
{
timerScoreIncrement
}
"
;
textBlockTimerUpgradeCost
.
Text
=
$"Стоимость обновления:
{
timerUpgradeCost
}
"
;
textBlockScore
.
Text
=
score
.
ToString
();
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment