-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
345 lines (318 loc) · 23 KB
/
Copy pathMainWindow.xaml
File metadata and controls
345 lines (318 loc) · 23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
<Window x:Class="AutoClicker.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:engine="clr-namespace:AutoClicker.Engine"
mc:Ignorable="d"
Title="Auto Clicker" Height="560" Width="640"
MinHeight="480" MinWidth="580"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
AllowsTransparency="False"
Background="{StaticResource BgDark}">
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="32"
ResizeBorderThickness="4"
GlassFrameThickness="0"
CornerRadius="0"/>
</WindowChrome.WindowChrome>
<Grid>
<Grid.RowDefinitions>
<!-- TOP BAR (32px) -->
<RowDefinition Height="32"/>
<!-- MAIN CONTENT AREA -->
<RowDefinition Height="*"/>
<!-- BOTTOM CONTROL BAR (50px) -->
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<!-- 1. TOP BAR -->
<Border Grid.Row="0" Background="{StaticResource HeaderBg}" BorderBrush="{StaticResource BorderColor}" BorderThickness="0,0,0,1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- Window Title & Icon -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="10,0,0,0">
<Image Source="icon.png" Width="16" Height="16" Margin="0,0,8,0" VerticalAlignment="Center"/>
<TextBlock Text="Auto Clicker" FontSize="12" FontWeight="SemiBold" Foreground="{StaticResource TextPrimary}" VerticalAlignment="Center"/>
</StackPanel>
<!-- Window Caption Buttons (Minimize, Maximize, Close) -->
<StackPanel Grid.Column="1" Orientation="Horizontal" WindowChrome.IsHitTestVisibleInChrome="True">
<Button Click="MinimizeButton_Click" Width="44" Height="31" Background="Transparent" Foreground="{StaticResource TextSecondary}" BorderThickness="0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border x:Name="border" Background="{TemplateBinding Background}">
<TextBlock Text="─" FontSize="10" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{TemplateBinding Foreground}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="{StaticResource ControlHoverBg}"/>
<Setter Property="Foreground" Value="{StaticResource TextPrimary}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
<Button Click="MaximizeButton_Click" Width="44" Height="31" Background="Transparent" Foreground="{StaticResource TextSecondary}" BorderThickness="0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border x:Name="border" Background="{TemplateBinding Background}">
<TextBlock Text="□" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{TemplateBinding Foreground}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="{StaticResource ControlHoverBg}"/>
<Setter Property="Foreground" Value="{StaticResource TextPrimary}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
<Button Click="CloseButton_Click" Width="44" Height="31" Background="Transparent" Foreground="{StaticResource TextSecondary}" BorderThickness="0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border x:Name="border" Background="{TemplateBinding Background}">
<TextBlock Text="✕" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{TemplateBinding Foreground}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#C42B1C"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
</StackPanel>
</Grid>
</Border>
<!-- 2. MAIN CONTENT AREA (FULL WIDTH) -->
<Grid Grid.Row="1" Margin="12,10,2,10">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel>
<!-- SECTION: Interval Configuration -->
<Border Background="{StaticResource CardBg}" BorderBrush="{StaticResource BorderColor}" BorderThickness="1" CornerRadius="4" Padding="12" Margin="0,0,0,10">
<StackPanel>
<DockPanel Margin="0,0,0,10">
<TextBlock Text="Interval Configuration" FontWeight="Bold" FontSize="13" Foreground="{StaticResource TextPrimary}"/>
<TextBlock Text="{Binding CalculatedCpsText}" HorizontalAlignment="Right" FontSize="11" Foreground="{StaticResource TextSecondary}"/>
</DockPanel>
<!-- Hours, Minutes, Seconds, Milliseconds inputs -->
<Grid Margin="0,0,0,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="8"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="8"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="8"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Hours -->
<StackPanel Grid.Column="0">
<TextBlock Text="Hours" FontSize="11" Foreground="{StaticResource TextSecondary}" Margin="0,0,0,3"/>
<TextBox Text="{Binding IntervalHours, UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel>
<!-- Minutes -->
<StackPanel Grid.Column="2">
<TextBlock Text="Minutes" FontSize="11" Foreground="{StaticResource TextSecondary}" Margin="0,0,0,3"/>
<TextBox Text="{Binding IntervalMinutes, UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel>
<!-- Seconds -->
<StackPanel Grid.Column="4">
<TextBlock Text="Seconds" FontSize="11" Foreground="{StaticResource TextSecondary}" Margin="0,0,0,3"/>
<TextBox Text="{Binding IntervalSeconds, UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel>
<!-- Milliseconds -->
<StackPanel Grid.Column="6">
<TextBlock Text="Milliseconds" FontSize="11" Foreground="{StaticResource TextSecondary}" Margin="0,0,0,3"/>
<TextBox Text="{Binding IntervalMilliseconds, UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel>
</Grid>
<!-- Random Offset Toggle -->
<CheckBox IsChecked="{Binding RandomizeCps, Mode=TwoWay}" Content="Random Offset (Humanized Min/Max CPS Jitter)" Margin="0,2,0,0"/>
<Grid Margin="0,8,0,0">
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding RandomizeCps}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="12"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<DockPanel Margin="0,0,0,2">
<TextBlock Text="Min CPS" FontSize="11" Foreground="{StaticResource TextSecondary}"/>
<TextBlock Text="{Binding MinCps, StringFormat={}{0:F1}}" HorizontalAlignment="Right" FontSize="11"/>
</DockPanel>
<Slider Minimum="1.0" Maximum="50.0" Value="{Binding MinCps, Mode=TwoWay}"/>
</StackPanel>
<StackPanel Grid.Column="2">
<DockPanel Margin="0,0,0,2">
<TextBlock Text="Max CPS" FontSize="11" Foreground="{StaticResource TextSecondary}"/>
<TextBlock Text="{Binding MaxCps, StringFormat={}{0:F1}}" HorizontalAlignment="Right" FontSize="11"/>
</DockPanel>
<Slider Minimum="1.0" Maximum="50.0" Value="{Binding MaxCps, Mode=TwoWay}"/>
</StackPanel>
</Grid>
</StackPanel>
</Border>
<!-- SECTION: Click Options -->
<Border Background="{StaticResource CardBg}" BorderBrush="{StaticResource BorderColor}" BorderThickness="1" CornerRadius="4" Padding="12" Margin="0,0,0,10">
<StackPanel>
<TextBlock Text="Click Options" FontWeight="Bold" FontSize="13" Foreground="{StaticResource TextPrimary}" Margin="0,0,0,10"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="16"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Mouse Button -->
<StackPanel Grid.Column="0">
<TextBlock Text="Mouse Button" FontSize="11" Foreground="{StaticResource TextSecondary}" Margin="0,0,0,4"/>
<ComboBox SelectedIndex="{Binding SelectedButtonIndex, Mode=TwoWay}">
<ComboBoxItem Content="Left"/>
<ComboBoxItem Content="Right"/>
<ComboBoxItem Content="Middle"/>
</ComboBox>
</StackPanel>
<!-- Click Type -->
<StackPanel Grid.Column="2">
<TextBlock Text="Click Type" FontSize="11" Foreground="{StaticResource TextSecondary}" Margin="0,0,0,4"/>
<ComboBox SelectedIndex="{Binding SelectedClickTypeIndex, Mode=TwoWay}">
<ComboBoxItem Content="Single"/>
<ComboBoxItem Content="Double"/>
</ComboBox>
</StackPanel>
</Grid>
</StackPanel>
</Border>
<!-- SECTION: Click Repeat -->
<Border Background="{StaticResource CardBg}" BorderBrush="{StaticResource BorderColor}" BorderThickness="1" CornerRadius="4" Padding="12" Margin="0,0,0,10">
<StackPanel>
<TextBlock Text="Click Repeat" FontWeight="Bold" FontSize="13" Foreground="{StaticResource TextPrimary}" Margin="0,0,0,10"/>
<StackPanel>
<RadioButton IsChecked="{Binding RepeatUntilStopped, Mode=TwoWay}" Content="Repeat until stopped" Margin="0,0,0,8"/>
<StackPanel Orientation="Horizontal">
<RadioButton IsChecked="{Binding RepeatCountMode, Mode=TwoWay}" Content="Repeat" VerticalAlignment="Center"/>
<TextBox Text="{Binding RepeatCount, Mode=TwoWay}" Width="70" Margin="8,0,8,0" VerticalAlignment="Center"/>
<TextBlock Text="times" VerticalAlignment="Center" Foreground="{StaticResource TextSecondary}"/>
</StackPanel>
</StackPanel>
</StackPanel>
</Border>
<!-- SECTION: Cursor Position -->
<Border Background="{StaticResource CardBg}" BorderBrush="{StaticResource BorderColor}" BorderThickness="1" CornerRadius="4" Padding="12" Margin="0,0,0,10">
<StackPanel>
<TextBlock Text="Cursor Position" FontWeight="Bold" FontSize="13" Foreground="{StaticResource TextPrimary}" Margin="0,0,0,10"/>
<StackPanel>
<RadioButton IsChecked="{Binding IsCurrentLocation, Mode=TwoWay}" Content="Current Cursor Location" Margin="0,0,0,8"/>
<StackPanel Orientation="Horizontal" Margin="0,0,0,8">
<RadioButton IsChecked="{Binding IsFixedLocation, Mode=TwoWay}" Content="Fixed Location" VerticalAlignment="Center"/>
<TextBlock Text="X:" Margin="12,0,4,0" VerticalAlignment="Center" Foreground="{StaticResource TextSecondary}"/>
<TextBox Text="{Binding FixedX, Mode=TwoWay}" Width="50" VerticalAlignment="Center"/>
<TextBlock Text="Y:" Margin="8,0,4,0" VerticalAlignment="Center" Foreground="{StaticResource TextSecondary}"/>
<TextBox Text="{Binding FixedY, Mode=TwoWay}" Width="50" VerticalAlignment="Center"/>
<Button Content="Pick Location" Command="{Binding PickLocationCommand}" Style="{StaticResource UtilityButton}" Margin="10,0,0,0" VerticalAlignment="Center"/>
</StackPanel>
<RadioButton IsChecked="{Binding IsFindImage, Mode=TwoWay}" Content="Find Image"/>
</StackPanel>
</StackPanel>
</Border>
<!-- SECTION: Target & Trigger Options -->
<Border Background="{StaticResource CardBg}" BorderBrush="{StaticResource BorderColor}" BorderThickness="1" CornerRadius="4" Padding="12">
<StackPanel>
<TextBlock Text="Target & Trigger Options" FontWeight="Bold" FontSize="13" Foreground="{StaticResource TextPrimary}" Margin="0,0,0,10"/>
<TextBlock Text="Hotkey Activation Mode:" FontSize="11" Foreground="{StaticResource TextSecondary}" Margin="0,0,0,4"/>
<StackPanel Margin="0,0,0,10">
<RadioButton IsChecked="{Binding IsHotkeyToggleMode, Mode=TwoWay}" Content="Toggle Mode (Press hotkey to Start / Stop)" Margin="0,0,0,6"/>
<RadioButton IsChecked="{Binding IsHotkeyHoldMode, Mode=TwoWay}" Content="Hold Mode (Autoclicker active ONLY while holding key)"/>
</StackPanel>
<DockPanel Margin="0,4,0,0">
<CheckBox IsChecked="{Binding MinecraftOnly, Mode=TwoWay}" Content="Minecraft Window Only Filter" VerticalAlignment="Center"/>
<CheckBox IsChecked="{Binding EnableSoundFeedback, Mode=TwoWay}" Content="Audio Feedback" VerticalAlignment="Center" Margin="20,0,0,0"/>
</DockPanel>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</Grid>
<!-- 3. BOTTOM CONTROL BAR -->
<Border Grid.Row="2" Background="{StaticResource HeaderBg}" BorderBrush="{StaticResource BorderColor}" BorderThickness="0,1,0,0" Padding="12,8">
<Grid>
<!-- Left: Start/Stop Button & Hotkey Badge -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<!-- Compact Play / Stop Action Button -->
<Button Command="{Binding ToggleCommand}" Style="{StaticResource UtilityButton}" Padding="14,6">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="▶" FontSize="10" Margin="0,0,6,0" VerticalAlignment="Center">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding IsRunning}" Value="True">
<Setter Property="Text" Value="■"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock VerticalAlignment="Center" FontWeight="Bold">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Text" Value="Start Clicker"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsRunning}" Value="True">
<Setter Property="Text" Value="Stop Clicker"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</StackPanel>
</Button>
<!-- Hotkey Badge -->
<Border Background="{StaticResource BadgeBg}" BorderBrush="{StaticResource BorderColor}" BorderThickness="1" CornerRadius="3" Padding="8,4" Margin="10,0,0,0" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Hotkey: " FontSize="11" Foreground="{StaticResource TextSecondary}"/>
<TextBlock Text="{Binding HotKeyName}" FontSize="11" FontWeight="Bold" Foreground="{StaticResource TextPrimary}"/>
</StackPanel>
</Border>
<!-- Rebind Hotkey Action Button -->
<Button Command="{Binding BindHotkeyCommand}" Style="{StaticResource UtilityButton}" Margin="8,0,0,0" Padding="8,4">
<Button.Content>
<TextBlock FontSize="11">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Text" Value="Change Hotkey"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsBindingHotkey}" Value="True">
<Setter Property="Text" Value="[ Press Key... ]"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Button.Content>
</Button>
</StackPanel>
<!-- Right: Status / Session Counters -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right">
<TextBlock Text="{Binding StatusText}" FontSize="12" Foreground="{StaticResource TextSecondary}" VerticalAlignment="Center"/>
<Border Width="1" Height="14" Background="{StaticResource BorderColor}" Margin="10,0"/>
<TextBlock Text="{Binding MeasuredCps, StringFormat={}{0:F1} CPS}" FontSize="12" FontWeight="SemiBold" Foreground="{StaticResource TextPrimary}" VerticalAlignment="Center"/>
<Border Width="1" Height="14" Background="{StaticResource BorderColor}" Margin="10,0"/>
<TextBlock Text="{Binding TotalClicks, StringFormat={}{0} Clicks}" FontSize="12" Foreground="{StaticResource TextSecondary}" VerticalAlignment="Center"/>
</StackPanel>
</Grid>
</Border>
</Grid>
</Window>