Merge pull request #57 from iAmAsval/discord_rpc_setting

Add a toggle for the user to override Discord Rich Presence
This commit is contained in:
Valentin 2020-05-15 01:44:06 +02:00 committed by GitHub
commit 8fdff9e32d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 356 additions and 320 deletions

View File

@ -1,5 +1,6 @@
using FModel.Discord;
using FModel.Logger;
using FModel.Properties;
using FModel.Utils;
using FModel.ViewModels.StatusBar;
using FModel.Windows.DarkMessageBox;
@ -37,7 +38,11 @@ namespace FModel
DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[Culture]", Thread.CurrentThread.CurrentUICulture);
StatusBarVm.statusBarViewModel.Set(FModel.Properties.Resources.Initializing, FModel.Properties.Resources.Loading);
DiscordIntegration.StartClient();
if (FModel.Properties.Settings.Default.EnableDiscordRPC)
{
DiscordIntegration.StartClient();
}
base.OnStartup(e);
}

File diff suppressed because it is too large Load Diff

View File

@ -1081,4 +1081,8 @@ It's now the most used free software to leak on Fortnite.</value>
<data name="UpdateAvailableConfirm" xml:space="preserve">
<value>FModel {0} is available. You are using version {1}. Do you want to update the application now?</value>
</data>
<data name="EnableDiscordRPC" xml:space="preserve">
<value>Enable Discord RPC</value>
<comment>Should Discord Rich Presence be enabled?</comment>
</data>
</root>

View File

@ -1,10 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Ce code a été généré par un outil.
// Version du runtime :4.0.30319.42000
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
// le code est régénéré.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@ -83,6 +83,18 @@ namespace FModel.Properties {
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool EnableDiscordRPC {
get {
return ((bool)(this["EnableDiscordRPC"]));
}
set {
this["EnableDiscordRPC"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]

View File

@ -17,6 +17,9 @@
<Setting Name="AutoOpenSounds" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="EnableDiscordRPC" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="AudioPlayerDevice" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>

View File

@ -106,7 +106,7 @@
<RowDefinition Height="*" />
<RowDefinition Height="10" />
</Grid.RowDefinitions>
<TextBlock Text="{x:Static properties:Resources.FyiTitle}"
FontWeight="Bold" Foreground="White" Grid.Row="1"
FontFamily="Calibri" FontSize="18"/>
@ -120,13 +120,16 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<CheckBox Grid.Row="0" Margin="5"
Content="{x:Static properties:Resources.ReloadAesKeysAtLaunch}"
IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=ReloadAesKeys, Mode=TwoWay}"/>
<CheckBox Grid.Row="1" Margin="5"
Content="{x:Static properties:Resources.AutoOpenSounds}"
IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=AutoOpenSounds, Mode=TwoWay}"/>
<CheckBox Grid.Row="1" Margin="5,29,5,-19"
Content="{x:Static properties:Resources.EnableDiscordRPC}"
IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=EnableDiscordRPC, Mode=TwoWay}"/>
</Grid>
</Grid>
</GroupBox>