Skip to content

Commit 71be1e8

Browse files
authored
Merge pull request #932 from dlamkins/fix/many-mini
Small fixes.
2 parents 1459439 + 89e788f commit 71be1e8

14 files changed

+130
-13
lines changed

Blish HUD/ApplicationSettings.cs

+11
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ private void InitDebug() {
4545
* P, pid - The PID of the process to overlay.
4646
* r, ref - The path to the ref.dat file.
4747
* s, settings - The path where Blish HUD will save settings and other files.
48+
* a, progdata - The path where Blish HUD will save non-user data.
4849
* w, window - The name of the window to overlay.
4950
* g, startgw2 - The start mode for Gw2 (0 = don't start, 1 = start gw2, 2 = start gw2 autologin).
5051
*/
@@ -116,6 +117,16 @@ private void InitDebug() {
116117
]
117118
public string UserSettingsPath { get; private set; }
118119

120+
public const string OPTION_PROGRAMDATA = "progdata";
121+
/// <summary>
122+
/// The path used by Blish HUD to store non-user data related to the application.
123+
/// </summary>
124+
[
125+
OptionParameter(OPTION_PROGRAMDATA, 'a'),
126+
Help("The path used by Blish HUD to store non-user data related to the application.")
127+
]
128+
public string ProgramDataPath { get; private set; }
129+
119130
public const string OPTION_REFPATH = "ref";
120131
/// <summary>
121132
/// The path to the ref.dat file.

Blish HUD/Controls/Control.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,12 @@ private static void OnFocusedControlChanged(ControlActivatedEventArgs e) {
191191
/// </summary>
192192
protected virtual void OnLeftMouseButtonPressed(MouseEventArgs e) {
193193
this.LeftMouseButtonPressed?.Invoke(this, e);
194+
195+
_clickPrimed = true;
194196
}
195197

196198
private double _lastClickTime = 0;
197-
199+
private bool _clickPrimed = false;
198200

199201
/// <summary>
200202
/// Called when a left mouse button release occurs on the <see cref="Control"/>.
@@ -203,7 +205,7 @@ protected virtual void OnLeftMouseButtonPressed(MouseEventArgs e) {
203205
protected virtual void OnLeftMouseButtonReleased(MouseEventArgs e) {
204206
this.LeftMouseButtonReleased?.Invoke(this, e);
205207

206-
if (_enabled) {
208+
if (_enabled && _clickPrimed) {
207209
// Distinguish click from double-click
208210
if (GameService.Overlay.CurrentGameTime.TotalGameTime.TotalMilliseconds - _lastClickTime < SystemInformation.DoubleClickTime) {
209211
OnClick(new MouseEventArgs(e.EventType, true));
@@ -260,6 +262,8 @@ protected virtual void OnMouseEntered(MouseEventArgs e) {
260262
/// </summary>
261263
protected virtual void OnMouseLeft(MouseEventArgs e) {
262264
this.MouseLeft?.Invoke(this, e);
265+
266+
_clickPrimed = false;
263267
}
264268

265269
/// <summary>

Blish HUD/GameServices/Debug/ContingencyChecks.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private static void CheckNvidiaControlPanelSettings() {
102102
SettingValue<uint> settingValue = settingMeta.DwordValues.FirstOrDefault(val => val.Value == value);
103103
string val = settingValue?.ValueName ?? value.ToString();
104104

105-
errors.Add($"'{settingMeta.SettingName}' is '{val}'");
105+
errors.Add(string.Format(Strings.GameServices.Debug.ContingencyMessages.NvidiaSettings_Error, settingMeta.SettingName, val));
106106
}
107107
}
108108

Blish HUD/GameServices/GameIntegration/WinFormsIntegration.cs

+10
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public sealed class WinFormsIntegration : ServiceModule<GameIntegrationService>
1919
private ToolStripItem _launchGw2Tsi;
2020
private ToolStripItem _launchGw2AutoTsi;
2121
private ToolStripItem _openBlishSettingsFolder;
22+
private ToolStripItem _openBlishProgramDataFolder;
2223
private ToolStripItem _exitTsi;
2324

2425
/// <summary>
@@ -76,12 +77,21 @@ private void BuildTrayIcon() {
7677

7778
this.TrayIconMenu.Items.Add(new ToolStripSeparator());
7879

80+
// Open Settings Folder
7981
_openBlishSettingsFolder = this.TrayIconMenu.Items.Add(Strings.GameServices.GameIntegrationService.TrayIcon_OpenSettingsFolder);
8082

8183
_openBlishSettingsFolder.Click += delegate {
8284
Process.Start(DirectoryUtil.BasePath);
8385
};
8486

87+
// Open ProgamData Folder
88+
_openBlishProgramDataFolder = this.TrayIconMenu.Items.Add(Strings.GameServices.GameIntegrationService.TrayIcon_OpenProgramDataFolder);
89+
90+
_openBlishProgramDataFolder.Click += delegate {
91+
Process.Start(DirectoryUtil.ProgramData);
92+
};
93+
94+
// ------- & Exit
8595
this.TrayIconMenu.Items.Add(new ToolStripSeparator());
8696
_exitTsi = this.TrayIconMenu.Items.Add(string.Format(Strings.Common.Action_Exit, Strings.Common.BlishHUD));
8797

Blish HUD/GameServices/Input/Keyboard/KeyBinding.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private void StopFiring() {
136136
}
137137

138138
private void CheckTrigger(ModifierKeys activeModifiers, IEnumerable<Keys> pressedKeys) {
139-
if ((this.ModifierKeys & activeModifiers) == this.ModifierKeys) {
139+
if (activeModifiers == this.ModifierKeys) {
140140
if (this.BlockSequenceFromGw2) {
141141
GameService.Input.Keyboard.StageKeyBinding(this);
142142
}

Blish HUD/Strings/GameServices/Debug/ContingencyMessages.Designer.cs

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Blish HUD/Strings/GameServices/Debug/ContingencyMessages.de.resx

+25
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,29 @@ Wenn du ein Antivirus Programm oder eine Firewall verwendest, dann füge Blish H
176176
<data name="CoreUpdateFailed_Description_Timeout" xml:space="preserve">
177177
<value>Eine weitere Instanz von Blish HUD läuft bereits. Bitte schließe diese und versuche dann erneut Blish HUD zu aktualisieren.</value>
178178
</data>
179+
<data name="NvidiaSettings_Description" xml:space="preserve">
180+
<value>Eine Ihrer NVIDIA-Einstellungen wurde auf eine Weise geändert, die nicht mit Blish HUD kompatibel ist (Blish HUD wird einen schwarzen Hintergrund haben).
181+
182+
Diese Einstellungen müssen auf die Standardeinstellungen zurückgesetzt werden:
183+
{0}
184+
185+
Siehe den verlinkten Fehlerbehebungsleitfaden für weitere Informationen zur Behebung dieses Problems.</value>
186+
</data>
187+
<data name="NvidiaSettings_Error" xml:space="preserve">
188+
<value>'{0}' sollte nicht '{1}' sein</value>
189+
</data>
190+
<data name="NvidiaSettings_OpenControlPanelAction" xml:space="preserve">
191+
<value>NVIDIA-Systemsteuerung öffnen</value>
192+
</data>
193+
<data name="NvidiaSettings_Title" xml:space="preserve">
194+
<value>Inkompatible NVIDIA-Einstellungen</value>
195+
</data>
196+
<data name="CfaBlocking_Description" xml:space="preserve">
197+
<value>Blish HUD wurde aktiv daran gehindert, in '{0}' zu speichern, was auf die Kontrollierte Ordnerzugriff-Funktion von Windows zurückzuführen zu sein scheint.
198+
199+
Bitte erlauben Sie Blish HUD ausdrücklich in Ihren Einstellungen für den Kontrollierten Ordnerzugriff oder beachten Sie den unten verlinkten Fehlerbehebungsleitfaden.</value>
200+
</data>
201+
<data name="CfaBlocking_Title" xml:space="preserve">
202+
<value>Blish HUD Blockiert!</value>
203+
</data>
179204
</root>

Blish HUD/Strings/GameServices/Debug/ContingencyMessages.fr.resx

+26-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Relancez Blish HUD en tant qu'administrateur, ou relancez Guild Wars 2 sans le m
138138
<value>Blish HUD a besoin d'être re-extrait !</value>
139139
</data>
140140
<data name="MissingRef_Description" xml:space="preserve">
141-
<value>Blish HUD a été incapable de localiser le fichier ref.dat. Quand vous téléchargez Blish HUD, faites attention à bien extraire tous les fichiers du zip et que tous les fichiers soient bien dans le même dossier que Blish HUD.exe</value>
141+
<value>Blish HUD a été incapable de localiser le fichier ref.dat. Quand vous téléchargez Blish HUD, faites attention à bien extraire tous les fichiers du zip et que tous les fichiers soient bien dans le même dossier que Blish HUD.exe.</value>
142142
</data>
143143
<data name="FileSaveAccessDenied_Title" xml:space="preserve">
144144
<value>Blish HUD a été bloqué lors de la sauvegarde de données !</value>
@@ -176,4 +176,29 @@ Si vous avez un anti-virus ou utilisez un pare-feu tiers, merci de vérifier que
176176
<data name="CoreUpdateFailed_Description_Timeout" xml:space="preserve">
177177
<value>Il y a d'autres instances de Blish HUD de lancée. Merci de fermer les autres instances avant de relancer Blish HUD pour finir la mise à jour.</value>
178178
</data>
179+
<data name="NvidiaSettings_Error" xml:space="preserve">
180+
<value>'{0}' ne devrait pas être '{1}'</value>
181+
</data>
182+
<data name="NvidiaSettings_Description" xml:space="preserve">
183+
<value>Un de vos paramètres NVIDIA a été modifié de manière incompatible avec Blish HUD (Blish HUD aura un fond noir).
184+
185+
Ces paramètres doivent être réinitialisés par défaut :
186+
{0}
187+
188+
Consultez le guide de dépannage lié pour plus d'informations sur la façon de résoudre ce problème.</value>
189+
</data>
190+
<data name="NvidiaSettings_OpenControlPanelAction" xml:space="preserve">
191+
<value>Ouvrir le panneau de contrôle NVIDIA</value>
192+
</data>
193+
<data name="NvidiaSettings_Title" xml:space="preserve">
194+
<value>Paramètres NVIDIA Incompatibles</value>
195+
</data>
196+
<data name="CfaBlocking_Description" xml:space="preserve">
197+
<value>Blish HUD a été bloqué activement pour enregistrer dans '{0}' par ce qui semble être la fonctionnalité d'accès aux dossiers contrôlés de Windows.
198+
199+
Veuillez autoriser explicitement Blish HUD dans vos paramètres d'accès aux dossiers contrôlés ou consultez le guide de dépannage ci-dessous.</value>
200+
</data>
201+
<data name="CfaBlocking_Title" xml:space="preserve">
202+
<value>Blish HUD Bloqué !</value>
203+
</data>
179204
</root>

Blish HUD/Strings/GameServices/Debug/ContingencyMessages.resx

+3
Original file line numberDiff line numberDiff line change
@@ -209,4 +209,7 @@ See the linked troubleshooting guide for more information on how to resolve this
209209

210210
You can reference the guide linked below for further assistance.</value>
211211
</data>
212+
<data name="NvidiaSettings_Error" xml:space="preserve">
213+
<value>'{0}' should not be '{1}'</value>
214+
</data>
212215
</root>

Blish HUD/Strings/GameServices/GameIntegrationService.Designer.cs

+10-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Blish HUD/Strings/GameServices/GameIntegrationService.de.resx

+3
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,7 @@
126126
<data name="TrayIcon_OpenSettingsFolder" xml:space="preserve">
127127
<value>Öffne Einstellungsverzeichnis</value>
128128
</data>
129+
<data name="TrayIcon_OpenProgramDataFolder" xml:space="preserve">
130+
<value>ProgramData-Ordner öffnen</value>
131+
</data>
129132
</root>

Blish HUD/Strings/GameServices/GameIntegrationService.fr.resx

+3
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,7 @@
126126
<data name="TrayIcon_OpenSettingsFolder" xml:space="preserve">
127127
<value>Ouvrir le dossier des paramètres</value>
128128
</data>
129+
<data name="TrayIcon_OpenProgramDataFolder" xml:space="preserve">
130+
<value>Ouvrir le dossier ProgramData</value>
131+
</data>
129132
</root>

Blish HUD/Strings/GameServices/GameIntegrationService.resx

+3
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,7 @@
126126
<data name="TrayIcon_OpenSettingsFolder" xml:space="preserve">
127127
<value>Open settings folder</value>
128128
</data>
129+
<data name="TrayIcon_OpenProgramDataFolder" xml:space="preserve">
130+
<value>Open ProgramData folder</value>
131+
</data>
129132
</root>

Blish HUD/_Utils/DirectoryUtil.cs

+19-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ public static class DirectoryUtil {
1414

1515
private const string MUSIC_DIR = @"Guild Wars 2\Music";
1616

17-
private const string CACHE_DIR = @"Blish HUD\cache";
17+
private const string PROGRAMDATA_DIR = "Blish HUD";
18+
19+
private const string CACHE_DIR = @"cache";
1820

1921
/// <summary>
2022
/// The current root application save path used for saving settings, letting modules save data, etc.
@@ -35,15 +37,21 @@ public static class DirectoryUtil {
3537
public static string MusicPath { get; }
3638

3739
/// <summary>
38-
/// The path used by Blish HUD to store shared cache data. This is kept in %ProgramData% by default.
40+
/// The path used by Blish HUD to store non-user data related to the application. This is kept in '%ProgramData%\Blish HUD' by default.
41+
/// This directory should likely not contain module data.
42+
/// </summary>
43+
public static string ProgramData { get; set; }
44+
45+
/// <summary>
46+
/// The path used by Blish HUD to store shared cache data. This is kept in \cache under <see cref="ProgramData"/>.
3947
/// </summary>
4048
public static string CachePath { get; }
4149

4250
static DirectoryUtil() {
4351
// Prepare user documents directory
4452
// Check if Blish directory contains "Settings" folder
4553
// in that case override MyDocuments location as default for portability
46-
// --settings cli argument has still priority
54+
// --settings cli argument still has priority
4755
if (Directory.Exists(Path.Combine(Directory.GetCurrentDirectory(), "Settings"))) {
4856
BasePath = ApplicationSettings.Instance.UserSettingsPath
4957
?? Path.Combine(Directory.GetCurrentDirectory(), "Settings");
@@ -54,11 +62,15 @@ static DirectoryUtil() {
5462
ADDON_DIR);
5563
}
5664

57-
CreateDir(BasePath);
65+
// Directories under ProgramData
66+
CreateDir(ProgramData = ApplicationSettings.Instance.ProgramDataPath
67+
?? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData,
68+
Environment.SpecialFolderOption.DoNotVerify), PROGRAMDATA_DIR));
69+
70+
CreateDir(CachePath = Path.Combine(ProgramData, CACHE_DIR));
5871

59-
// Cache path is shared and not kept within the standard settings folder.
60-
CreateDir(CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData,
61-
Environment.SpecialFolderOption.DoNotVerify), CACHE_DIR));
72+
// Directories under documents
73+
CreateDir(BasePath);
6274

6375
CreateDir(ScreensPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments,
6476
Environment.SpecialFolderOption.DoNotVerify), SCREENS_DIR));

0 commit comments

Comments
 (0)