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
6 changed files with 356 additions and 320 deletions

View File

@@ -1,5 +1,6 @@
using FModel.Discord; using FModel.Discord;
using FModel.Logger; using FModel.Logger;
using FModel.Properties;
using FModel.Utils; using FModel.Utils;
using FModel.ViewModels.StatusBar; using FModel.ViewModels.StatusBar;
using FModel.Windows.DarkMessageBox; using FModel.Windows.DarkMessageBox;
@@ -37,7 +38,11 @@ namespace FModel
DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[Culture]", Thread.CurrentThread.CurrentUICulture); DebugHelper.WriteLine("{0} {1} {2}", "[FModel]", "[Culture]", Thread.CurrentThread.CurrentUICulture);
StatusBarVm.statusBarViewModel.Set(FModel.Properties.Resources.Initializing, FModel.Properties.Resources.Loading); StatusBarVm.statusBarViewModel.Set(FModel.Properties.Resources.Initializing, FModel.Properties.Resources.Loading);
DiscordIntegration.StartClient();
if (FModel.Properties.Settings.Default.EnableDiscordRPC)
{
DiscordIntegration.StartClient();
}
base.OnStartup(e); 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"> <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> <value>FModel {0} is available. You are using version {1}. Do you want to update the application now?</value>
</data> </data>
<data name="EnableDiscordRPC" xml:space="preserve">
<value>Enable Discord RPC</value>
<comment>Should Discord Rich Presence be enabled?</comment>
</data>
</root> </root>

View File

@@ -1,10 +1,10 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// Ce code a été généré par un outil. // This code was generated by a tool.
// Version du runtime :4.0.30319.42000 // Runtime Version:4.0.30319.42000
// //
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si // Changes to this file may cause incorrect behavior and will be lost if
// le code est régénéré. // the code is regenerated.
// </auto-generated> // </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.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")] [global::System.Configuration.DefaultSettingValueAttribute("")]

View File

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

View File

@@ -127,6 +127,9 @@
<CheckBox Grid.Row="1" Margin="5" <CheckBox Grid.Row="1" Margin="5"
Content="{x:Static properties:Resources.AutoOpenSounds}" Content="{x:Static properties:Resources.AutoOpenSounds}"
IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=AutoOpenSounds, Mode=TwoWay}"/> 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>
</Grid> </Grid>
</GroupBox> </GroupBox>