Add Setting for platfrom

This commit is contained in:
miku-666
2025-11-10 04:50:36 +01:00
parent 8e2b363612
commit 7d9f00cb6a
5 changed files with 30 additions and 4 deletions

View File

@@ -80,6 +80,9 @@
<setting name="ValidateImageDimension" serializeAs="String">
<value>True</value>
</setting>
<setting name="Platform" serializeAs="String">
<value>Unknown</value>
</setting>
</PckStudio.Properties.Settings>
</userSettings>
</configuration>

View File

@@ -38,9 +38,7 @@ namespace PckStudio
public MainForm()
{
InitializeComponent();
#if DEBUG
DLCManager.Default.Platform = ConsolePlatform.WiiU;
#endif
Text = Application.ProductName;
labelVersion.Text = $"{Application.ProductName}: {ApplicationScope.CurrentVersion}";

View File

@@ -7,6 +7,8 @@ using System.Linq;
using PckStudio.Internal;
using PckStudio.Core.App;
using PckStudio.Properties;
using PckStudio.Core.DLC;
using PckStudio.Forms.Additional_Popups;
namespace PckStudio
@@ -30,8 +32,16 @@ namespace PckStudio
static void Main(string[] args)
{
Updater.Initialize(RawProjectUrl, Settings.Default.AutoUpdate);
if (Settings.Default.Platform == Core.ConsolePlatform.Unknown)
{
MessageBox.Show("Please choose on which console you're playing on.", "Select Platform", MessageBoxButtons.OK, MessageBoxIcon.Question);
var platformChooser = new ItemSelectionPopUp(Enum.GetNames(typeof(Core.ConsolePlatform)));
if (platformChooser.ShowDialog() == DialogResult.OK && Enum.IsDefined(typeof(Core.ConsolePlatform), platformChooser.SelectedItem))
Settings.Default.Platform = (Core.ConsolePlatform)Enum.Parse(typeof(Core.ConsolePlatform), platformChooser.SelectedItem);
}
ApplicationScope.Initialize();
DLCManager.Default.Platform = Settings.Default.Platform;
Trace.TraceInformation("Startup");
RPC.Initialize();
MainInstance = new MainForm();

View File

@@ -12,7 +12,7 @@ namespace PckStudio.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.10.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -126,5 +126,17 @@ namespace PckStudio.Properties {
this["ValidateImageDimension"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Unknown")]
public global::PckStudio.Core.ConsolePlatform Platform {
get {
return ((global::PckStudio.Core.ConsolePlatform)(this["Platform"]));
}
set {
this["Platform"] = value;
}
}
}
}

View File

@@ -29,5 +29,8 @@
<Setting Name="ValidateImageDimension" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="Platform" Type="PckStudio.Core.ConsolePlatform" Scope="User">
<Value Profile="(Default)">Unknown</Value>
</Setting>
</Settings>
</SettingsFile>