Skip to content

Commit 23ba5e9

Browse files
authored
Merge branch 'dev' into RealFinalAnimation
2 parents 7a0ef5c + b51e5d2 commit 23ba5e9

File tree

7 files changed

+44
-12
lines changed

7 files changed

+44
-12
lines changed

Flow.Launcher/Helper/HotKeyMapper.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using Flow.Launcher.Core.Resource;
77
using System.Windows;
88
using Flow.Launcher.ViewModel;
9-
using System.Threading.Tasks;
10-
using System.Threading;
119

1210
namespace Flow.Launcher.Helper
1311
{
@@ -27,7 +25,8 @@ internal static void Initialize(MainViewModel mainVM)
2725

2826
internal static void OnToggleHotkey(object sender, HotkeyEventArgs args)
2927
{
30-
mainViewModel.ToggleFlowLauncher();
28+
if (!mainViewModel.GameModeStatus)
29+
mainViewModel.ToggleFlowLauncher();
3130
}
3231

3332
private static void SetHotkey(string hotkeyStr, EventHandler<HotkeyEventArgs> action)
@@ -75,7 +74,7 @@ internal static void SetCustomQueryHotkey(CustomPluginHotkey hotkey)
7574
{
7675
SetHotkey(hotkey.Hotkey, (s, e) =>
7776
{
78-
if (mainViewModel.ShouldIgnoreHotkeys())
77+
if (mainViewModel.ShouldIgnoreHotkeys() || mainViewModel.GameModeStatus)
7978
return;
8079

8180
mainViewModel.Show();

Flow.Launcher/Images/gamemode.ico

9.44 KB
Binary file not shown.

Flow.Launcher/Languages/en.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<system:String x:Key="iconTrayAbout">About</system:String>
1616
<system:String x:Key="iconTrayExit">Exit</system:String>
1717
<system:String x:Key="closeWindow">Close</system:String>
18+
<system:String x:Key="GameMode">Game Mode</system:String>
1819

1920
<!-- Setting General -->
2021
<system:String x:Key="flowlauncher_settings">Flow Launcher Settings</system:String>

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,9 @@ private void UpdateNotifyIconText()
166166
{
167167
var menu = contextMenu;
168168
((MenuItem)menu.Items[1]).Header = InternationalizationManager.Instance.GetTranslation("iconTrayOpen");
169-
((MenuItem)menu.Items[2]).Header = InternationalizationManager.Instance.GetTranslation("iconTraySettings");
170-
((MenuItem)menu.Items[3]).Header = InternationalizationManager.Instance.GetTranslation("iconTrayExit");
169+
((MenuItem)menu.Items[2]).Header = InternationalizationManager.Instance.GetTranslation("GameMode");
170+
((MenuItem)menu.Items[3]).Header = InternationalizationManager.Instance.GetTranslation("iconTraySettings");
171+
((MenuItem)menu.Items[4]).Header = InternationalizationManager.Instance.GetTranslation("iconTrayExit");
171172
}
172173

173174
private void InitializeNotifyIcon()
@@ -189,6 +190,10 @@ private void InitializeNotifyIcon()
189190
{
190191
Header = InternationalizationManager.Instance.GetTranslation("iconTrayOpen")
191192
};
193+
var gamemode = new MenuItem
194+
{
195+
Header = InternationalizationManager.Instance.GetTranslation("GameMode")
196+
};
192197
var settings = new MenuItem
193198
{
194199
Header = InternationalizationManager.Instance.GetTranslation("iconTraySettings")
@@ -199,10 +204,12 @@ private void InitializeNotifyIcon()
199204
};
200205

201206
open.Click += (o, e) => _viewModel.ToggleFlowLauncher();
207+
gamemode.Click += (o, e) => ToggleGameMode();
202208
settings.Click += (o, e) => App.API.OpenSettingDialog();
203209
exit.Click += (o, e) => Close();
204210
contextMenu.Items.Add(header);
205211
contextMenu.Items.Add(open);
212+
contextMenu.Items.Add(gamemode);
206213
contextMenu.Items.Add(settings);
207214
contextMenu.Items.Add(exit);
208215

@@ -222,6 +229,19 @@ private void InitializeNotifyIcon()
222229
};
223230
}
224231

232+
private void ToggleGameMode()
233+
{
234+
if (_viewModel.GameModeStatus)
235+
{
236+
_notifyIcon.Icon = Properties.Resources.app;
237+
_viewModel.GameModeStatus = false;
238+
}
239+
else
240+
{
241+
_notifyIcon.Icon = Properties.Resources.gamemode;
242+
_viewModel.GameModeStatus = true;
243+
}
244+
}
225245
private void InitProgressbarAnimation()
226246
{
227247
var da = new DoubleAnimation(ProgressBar.X2, ActualWidth + 150,

Flow.Launcher/Properties/Resources.Designer.cs

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Flow.Launcher/Properties/Resources.resx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,16 @@
112112
<value>2.0</value>
113113
</resheader>
114114
<resheader name="reader">
115-
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
115+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116116
</resheader>
117117
<resheader name="writer">
118-
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
118+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120-
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
120+
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
121121
<data name="app" type="System.Resources.ResXFileRef, System.Windows.Forms">
122122
<value>..\Resources\app.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
123123
</data>
124+
<data name="gamemode" type="System.Resources.ResXFileRef, System.Windows.Forms">
125+
<value>..\Images\gamemode.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
126+
</data>
124127
</root>

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
using Microsoft.VisualStudio.Threading;
2222
using System.Threading.Channels;
2323
using ISavable = Flow.Launcher.Plugin.ISavable;
24-
using System.Windows.Threading;
25-
using NHotkey;
26-
using Windows.Web.Syndication;
2724

2825

2926
namespace Flow.Launcher.ViewModel
@@ -302,9 +299,13 @@ private void InitializeKeyCommands()
302299
#region ViewModel Properties
303300

304301
public ResultsViewModel Results { get; private set; }
302+
305303
public ResultsViewModel ContextMenu { get; private set; }
304+
306305
public ResultsViewModel History { get; private set; }
307306

307+
public bool GameModeStatus { get; set; }
308+
308309
private string _queryText;
309310

310311
public string QueryText

0 commit comments

Comments
 (0)