mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Merge branch 'main' into user-pfp-discord-rpc
This commit is contained in:
commit
cf11cd87ce
@ -8,11 +8,28 @@ namespace Bloxstrap.Extensions
|
||||
{
|
||||
public static Icon GetSized(this Icon icon, int width, int height) => new(icon, new Size(width, height));
|
||||
|
||||
public static ImageSource GetImageSource(this Icon icon)
|
||||
public static ImageSource GetImageSource(this Icon icon, bool handleException = true)
|
||||
{
|
||||
using MemoryStream stream = new();
|
||||
icon.Save(stream);
|
||||
return BitmapFrame.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad);
|
||||
|
||||
if (handleException)
|
||||
{
|
||||
try
|
||||
{
|
||||
return BitmapFrame.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
App.Logger.WriteException("IconEx::GetImageSource", ex);
|
||||
Frontend.ShowMessageBox(String.Format(Strings.Dialog_IconLoadFailed, ex.Message));
|
||||
return BootstrapperIcon.IconBloxstrap.GetIcon().GetImageSource(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return BitmapFrame.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ namespace Bloxstrap.Integrations
|
||||
|
||||
_currentPresence = new DiscordRPC.RichPresence
|
||||
{
|
||||
Details = $"Playing {universeName}",
|
||||
Details = universeName,
|
||||
State = status,
|
||||
Timestamps = new Timestamps { Start = timeStarted.ToUniversalTime() },
|
||||
Buttons = GetButtons(),
|
||||
|
11
Bloxstrap/Resources/Strings.Designer.cs
generated
11
Bloxstrap/Resources/Strings.Designer.cs
generated
@ -976,6 +976,17 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The chosen bootstrapper icon could not be loaded.
|
||||
///
|
||||
///{0}.
|
||||
/// </summary>
|
||||
public static string Dialog_IconLoadFailed {
|
||||
get {
|
||||
return ResourceManager.GetString("Dialog.IconLoadFailed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Choose preferred language.
|
||||
/// </summary>
|
||||
|
@ -1204,4 +1204,9 @@ Please manually delete Bloxstrap.exe from the install location or try restarting
|
||||
<data name="Bootstrapper.JsonManagerSaveFailed" xml:space="preserve">
|
||||
<value>Failed to save {0}: {1}</value>
|
||||
</data>
|
||||
<data name="Dialog.IconLoadFailed" xml:space="preserve">
|
||||
<value>The chosen bootstrapper icon could not be loaded.
|
||||
|
||||
{0}</value>
|
||||
</data>
|
||||
</root>
|
||||
|
@ -172,6 +172,7 @@
|
||||
<controls:Expander Grid.Column="0" Margin="0,0,4,0" HeaderIcon="Code24" HeaderText="{x:Static resources:Strings.Menu_About_Contributors_Code}" IsExpanded="True">
|
||||
<StackPanel>
|
||||
<controls:MarkdownTextBlock MarkdownText="[Matt](https://github.com/bluepilledgreat)" />
|
||||
<controls:MarkdownTextBlock MarkdownText="[lolmanurfunny](https://github.com/lolmanurfunny)" />
|
||||
<controls:MarkdownTextBlock MarkdownText="[1011025m](https://github.com/1011025m)" />
|
||||
<controls:MarkdownTextBlock MarkdownText="[EasternBloxxer](https://github.com/EasternBloxxer)" />
|
||||
<controls:MarkdownTextBlock MarkdownText="[sitiom](https://github.com/sitiom)" />
|
||||
|
Loading…
Reference in New Issue
Block a user