mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 18:11:27 -07:00
Clean up sloppiness in notification area icon
This commit is contained in:
parent
ab2f5f589a
commit
de82349e5e
@ -337,6 +337,16 @@ namespace Bloxstrap
|
||||
|
||||
App.NotifyIcon?.SetActivityWatcher(activityWatcher);
|
||||
|
||||
if (App.Settings.Prop.UseDisableAppPatch)
|
||||
{
|
||||
activityWatcher.OnAppClose += (_, _) =>
|
||||
{
|
||||
App.Logger.WriteLine(LOG_IDENT, "Received desktop app exit, closing Roblox");
|
||||
using var process = Process.GetProcessById(gameClientPid);
|
||||
process.CloseMainWindow();
|
||||
};
|
||||
}
|
||||
|
||||
if (App.Settings.Prop.UseDiscordRichPresence)
|
||||
{
|
||||
App.Logger.WriteLine(LOG_IDENT, "Using Discord Rich Presence");
|
||||
|
@ -27,6 +27,7 @@
|
||||
public event EventHandler<string>? OnLogEntry;
|
||||
public event EventHandler? OnGameJoin;
|
||||
public event EventHandler? OnGameLeave;
|
||||
public event EventHandler? OnAppClose;
|
||||
public event EventHandler<Message>? OnRPCMessage;
|
||||
|
||||
private readonly Dictionary<string, string> GeolocationCache = new();
|
||||
@ -135,13 +136,8 @@
|
||||
else if (_logEntriesRead % 100 == 0)
|
||||
App.Logger.WriteLine(LOG_IDENT, $"Read {_logEntriesRead} log entries");
|
||||
|
||||
|
||||
if (App.Settings.Prop.UseDisableAppPatch && entry.Contains(GameLeavingEntry))
|
||||
{
|
||||
App.Logger.WriteLine(LOG_IDENT, "Received desktop app exit, closing Roblox");
|
||||
using var process = Process.GetProcessById(_gameClientPid);
|
||||
process.CloseMainWindow();
|
||||
}
|
||||
if (entry.Contains(GameLeavingEntry))
|
||||
OnAppClose?.Invoke(this, new EventArgs());
|
||||
|
||||
if (!ActivityInGame && ActivityPlaceId == 0)
|
||||
{
|
||||
|
26
Bloxstrap/Resources/Strings.Designer.cs
generated
26
Bloxstrap/Resources/Strings.Designer.cs
generated
@ -666,7 +666,7 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Located at {0}
|
||||
/// Looks up a localized string similar to Location: {0}
|
||||
///Click for more information.
|
||||
/// </summary>
|
||||
public static string ContextMenu_ServerInformation_Notification_Text {
|
||||
@ -676,11 +676,29 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Connected to {0} server.
|
||||
/// Looks up a localized string similar to Connected to private server.
|
||||
/// </summary>
|
||||
public static string ContextMenu_ServerInformation_Notification_Title {
|
||||
public static string ContextMenu_ServerInformation_Notification_Title_Private {
|
||||
get {
|
||||
return ResourceManager.GetString("ContextMenu.ServerInformation.Notification.Title", resourceCulture);
|
||||
return ResourceManager.GetString("ContextMenu.ServerInformation.Notification.Title.Private", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Connected to public server.
|
||||
/// </summary>
|
||||
public static string ContextMenu_ServerInformation_Notification_Title_Public {
|
||||
get {
|
||||
return ResourceManager.GetString("ContextMenu.ServerInformation.Notification.Title.Public", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Connected to reserved server.
|
||||
/// </summary>
|
||||
public static string ContextMenu_ServerInformation_Notification_Title_Reserved {
|
||||
get {
|
||||
return ResourceManager.GetString("ContextMenu.ServerInformation.Notification.Title.Reserved", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -287,12 +287,11 @@ Your ReShade configuration files will still be saved, and you can locate them by
|
||||
<value>Location</value>
|
||||
</data>
|
||||
<data name="ContextMenu.ServerInformation.Notification.Text" xml:space="preserve">
|
||||
<value>Located at {0}
|
||||
<value>Location: {0}
|
||||
Click for more information</value>
|
||||
</data>
|
||||
<data name="ContextMenu.ServerInformation.Notification.Title" xml:space="preserve">
|
||||
<value>Connected to {0} server</value>
|
||||
<comment>Enums.ServerType fills in {0} and is dynamically converted to lowercase when inserted here</comment>
|
||||
<data name="ContextMenu.ServerInformation.Notification.Title.Public" xml:space="preserve">
|
||||
<value>Connected to public server</value>
|
||||
</data>
|
||||
<data name="ContextMenu.ServerInformation.Title" xml:space="preserve">
|
||||
<value>Server information</value>
|
||||
@ -1114,4 +1113,10 @@ If not, then please report this exception to the maintainers of this fork. Do NO
|
||||
<data name="Menu.Shortcuts.Function.Description" xml:space="preserve">
|
||||
<value>Create shortcuts for quick access to specific functions. These will all be placed on the Desktop.</value>
|
||||
</data>
|
||||
<data name="ContextMenu.ServerInformation.Notification.Title.Private" xml:space="preserve">
|
||||
<value>Connected to private server</value>
|
||||
</data>
|
||||
<data name="ContextMenu.ServerInformation.Notification.Title.Reserved" xml:space="preserve">
|
||||
<value>Connected to reserved server</value>
|
||||
</data>
|
||||
</root>
|
@ -87,9 +87,15 @@ namespace Bloxstrap.UI
|
||||
public async void OnGameJoin()
|
||||
{
|
||||
string serverLocation = await _activityWatcher!.GetServerLocation();
|
||||
string title = _activityWatcher.ActivityServerType switch
|
||||
{
|
||||
ServerType.Public => Resources.Strings.ContextMenu_ServerInformation_Notification_Title_Public,
|
||||
ServerType.Private => Resources.Strings.ContextMenu_ServerInformation_Notification_Title_Private,
|
||||
ServerType.Reserved => Resources.Strings.ContextMenu_ServerInformation_Notification_Title_Reserved
|
||||
};
|
||||
|
||||
ShowAlert(
|
||||
String.Format(Resources.Strings.ContextMenu_ServerInformation_Notification_Title, _activityWatcher.ActivityServerType.ToTranslatedString().ToLower()),
|
||||
title,
|
||||
String.Format(Resources.Strings.ContextMenu_ServerInformation_Notification_Text, serverLocation),
|
||||
10,
|
||||
(_, _) => _menuContainer?.ShowServerInformationWindow()
|
||||
|
Loading…
Reference in New Issue
Block a user