mirror of
https://github.com/ncblakely/GiantsTools
synced 2024-11-21 13:45:37 +01:00
Support configuring master server URI from file.
This commit is contained in:
parent
d621c45a9d
commit
9a751ddc64
71
Giants.Launcher/Config.cs
Normal file
71
Giants.Launcher/Config.cs
Normal file
@ -0,0 +1,71 @@
|
||||
namespace Giants.Launcher
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class Config
|
||||
{
|
||||
private const string defaultConfigFileName = "GiantsDefault.config";
|
||||
private const string playerConfigFileName = "Giants.config";
|
||||
|
||||
private IDictionary<string, dynamic> defaultConfig = new Dictionary<string, dynamic>();
|
||||
private IDictionary<string, dynamic> userConfig = new Dictionary<string, dynamic>();
|
||||
|
||||
public void Read()
|
||||
{
|
||||
string defaultConfigFilePath = this.GetDefaultConfigPath();
|
||||
if (!File.Exists(defaultConfigFilePath))
|
||||
{
|
||||
string message = string.Format(Resources.ErrorNoConfigFile, defaultConfigFilePath);
|
||||
MessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Environment.Exit(-1);
|
||||
return;
|
||||
}
|
||||
|
||||
this.defaultConfig = ReadConfig(defaultConfigFilePath);
|
||||
|
||||
string userConfigFilePath = this.GetUserConfigPath();
|
||||
if (File.Exists(userConfigFilePath))
|
||||
{
|
||||
this.userConfig = ReadConfig(userConfigFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
public string GetString(string section, string key)
|
||||
{
|
||||
if (this.userConfig.ContainsKey(section))
|
||||
{
|
||||
dynamic sectionObject = this.userConfig[section];
|
||||
if (sectionObject != null)
|
||||
{
|
||||
return sectionObject.ContainsKey(key) ? (string)sectionObject[key] : "";
|
||||
}
|
||||
}
|
||||
|
||||
return this.defaultConfig[section][key];
|
||||
}
|
||||
|
||||
// TODO: other accessors unimplemented as we only need master server host name for now
|
||||
|
||||
private static IDictionary<string, dynamic> ReadConfig(string filePath)
|
||||
{
|
||||
string fileContents = File.ReadAllText(filePath);
|
||||
return JsonConvert.DeserializeObject<IDictionary<string, object>>(fileContents);
|
||||
}
|
||||
|
||||
private string GetDefaultConfigPath()
|
||||
{
|
||||
return defaultConfigFileName;
|
||||
}
|
||||
|
||||
private string GetUserConfigPath()
|
||||
{
|
||||
string applicationDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
|
||||
|
||||
return Path.Combine(applicationDataPath, "Giants", playerConfigFileName);
|
||||
}
|
||||
}
|
||||
}
|
8
Giants.Launcher/ConfigKeys.cs
Normal file
8
Giants.Launcher/ConfigKeys.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace Giants.Launcher
|
||||
{
|
||||
public static class ConfigKeys
|
||||
{
|
||||
public const string MasterServerHostName = "masterServerHostName";
|
||||
public const string BannedPlayers = "bannedPlayers";
|
||||
}
|
||||
}
|
7
Giants.Launcher/ConfigSections.cs
Normal file
7
Giants.Launcher/ConfigSections.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace Giants.Launcher
|
||||
{
|
||||
public static class ConfigSections
|
||||
{
|
||||
public const string Network = "network";
|
||||
}
|
||||
}
|
@ -26,9 +26,10 @@ namespace Giants.Launcher
|
||||
private readonly VersionClient versionHttpClient;
|
||||
private readonly CommunityClient communityHttpClient;
|
||||
|
||||
private string commandLine = String.Empty;
|
||||
private string commandLine;
|
||||
private string gamePath = null;
|
||||
private Updater updater;
|
||||
private Config config;
|
||||
private string communityAppUri;
|
||||
|
||||
public LauncherForm()
|
||||
@ -40,6 +41,12 @@ namespace Giants.Launcher
|
||||
// Set window title
|
||||
this.Text = GameName;
|
||||
|
||||
// Read newer file-based game settings
|
||||
this.config = new Config();
|
||||
this.config.Read();
|
||||
|
||||
string baseUrl = this.config.GetString(ConfigSections.Network, ConfigKeys.MasterServerHostName);
|
||||
|
||||
this.httpClient = new HttpClient(
|
||||
new HttpClientHandler()
|
||||
{
|
||||
@ -47,12 +54,12 @@ namespace Giants.Launcher
|
||||
});
|
||||
this.versionHttpClient = new VersionClient(this.httpClient)
|
||||
{
|
||||
BaseUrl = BaseUrl
|
||||
};
|
||||
BaseUrl = baseUrl
|
||||
};
|
||||
this.communityHttpClient = new CommunityClient(this.httpClient)
|
||||
{
|
||||
BaseUrl = BaseUrl
|
||||
};
|
||||
BaseUrl = baseUrl
|
||||
};
|
||||
}
|
||||
|
||||
private void btnExit_Click(object sender, EventArgs e)
|
@ -40,7 +40,7 @@ namespace Giants.Launcher
|
||||
.ToArray());
|
||||
|
||||
RendererInfo renderer = GameSettings.CompatibleRenderers.Find(
|
||||
r => StringComparer.OrdinalIgnoreCase.Compare(Path.GetFileName(r.FilePath), GameSettings.Get<string>(SettingKeys.Renderer)) == 0);
|
||||
r => StringComparer.OrdinalIgnoreCase.Compare(Path.GetFileName(r.FilePath), GameSettings.Get<string>(RegistryKeys.Renderer)) == 0);
|
||||
|
||||
if (renderer != null)
|
||||
{
|
||||
@ -56,21 +56,21 @@ namespace Giants.Launcher
|
||||
private void SetOptions()
|
||||
{
|
||||
var resolutions = (List<ScreenResolution>)this.cmbResolution.DataSource;
|
||||
this.cmbResolution.SelectedItem = resolutions.Find(r => r.Width == GameSettings.Get<int>(SettingKeys.VideoWidth) && r.Height == GameSettings.Get<int>(SettingKeys.VideoHeight));
|
||||
this.cmbResolution.SelectedItem = resolutions.Find(r => r.Width == GameSettings.Get<int>(RegistryKeys.VideoWidth) && r.Height == GameSettings.Get<int>(RegistryKeys.VideoHeight));
|
||||
if (this.cmbResolution.SelectedItem == null)
|
||||
this.cmbResolution.SelectedIndex = 0;
|
||||
|
||||
var antialiasingOptions = (List<KeyValuePair<string, int>>)this.cmbAntialiasing.DataSource;
|
||||
this.cmbAntialiasing.SelectedItem = antialiasingOptions.Find(o => o.Value == GameSettings.Get<int>(SettingKeys.Antialiasing));
|
||||
this.cmbAntialiasing.SelectedItem = antialiasingOptions.Find(o => o.Value == GameSettings.Get<int>(RegistryKeys.Antialiasing));
|
||||
if (this.cmbAntialiasing.SelectedItem == null)
|
||||
this.cmbAntialiasing.SelectedIndex = 0;
|
||||
|
||||
var anisotropyOptions = (List<KeyValuePair<string, int>>)this.cmbAnisotropy.DataSource;
|
||||
this.cmbAnisotropy.SelectedItem = anisotropyOptions.Find(o => o.Value == GameSettings.Get<int>(SettingKeys.AnisotropicFiltering));
|
||||
this.cmbAnisotropy.SelectedItem = anisotropyOptions.Find(o => o.Value == GameSettings.Get<int>(RegistryKeys.AnisotropicFiltering));
|
||||
if (this.cmbAnisotropy.SelectedItem == null)
|
||||
this.cmbAnisotropy.SelectedIndex = 0;
|
||||
|
||||
this.chkUpdates.Checked = GameSettings.Get<int>(SettingKeys.NoAutoUpdate) != 1;
|
||||
this.chkUpdates.Checked = GameSettings.Get<int>(RegistryKeys.NoAutoUpdate) != 1;
|
||||
}
|
||||
|
||||
private void PopulateAntialiasing()
|
||||
@ -178,10 +178,10 @@ namespace Giants.Launcher
|
||||
|
||||
private void cmbRenderer_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
bool windowed = GameSettings.Get<int>(SettingKeys.Windowed) == 1;
|
||||
bool windowed = GameSettings.Get<int>(RegistryKeys.Windowed) == 1;
|
||||
if (windowed)
|
||||
{
|
||||
bool borderless = GameSettings.Get<int>(SettingKeys.BorderlessWindow) == 1;
|
||||
bool borderless = GameSettings.Get<int>(RegistryKeys.BorderlessWindow) == 1;
|
||||
if (borderless)
|
||||
this.cmbMode.SelectedIndex = 2;
|
||||
else
|
||||
@ -199,7 +199,7 @@ namespace Giants.Launcher
|
||||
}
|
||||
else
|
||||
{
|
||||
this.chkVSync.Checked = GameSettings.Get<int>(SettingKeys.VerticalSync) == 1;
|
||||
this.chkVSync.Checked = GameSettings.Get<int>(RegistryKeys.VerticalSync) == 1;
|
||||
this.chkVSync.Enabled = true;
|
||||
}
|
||||
|
||||
@ -210,7 +210,7 @@ namespace Giants.Launcher
|
||||
}
|
||||
else
|
||||
{
|
||||
this.chkTripleBuffering.Checked = GameSettings.Get<int>(SettingKeys.TripleBuffering) == 1;
|
||||
this.chkTripleBuffering.Checked = GameSettings.Get<int>(RegistryKeys.TripleBuffering) == 1;
|
||||
this.chkTripleBuffering.Enabled = true;
|
||||
}
|
||||
}
|
||||
@ -220,25 +220,25 @@ namespace Giants.Launcher
|
||||
var renderer = this.cmbRenderer.SelectedItem as RendererInfo;
|
||||
if (renderer != null)
|
||||
{
|
||||
GameSettings.Modify(SettingKeys.Renderer, renderer.FileName);
|
||||
GameSettings.Modify(RegistryKeys.Renderer, renderer.FileName);
|
||||
}
|
||||
|
||||
var resolution = (ScreenResolution)this.cmbResolution.SelectedItem;
|
||||
if (resolution != null)
|
||||
{
|
||||
GameSettings.Modify(SettingKeys.VideoWidth, resolution.Width);
|
||||
GameSettings.Modify(SettingKeys.VideoHeight, resolution.Height);
|
||||
GameSettings.Modify(RegistryKeys.VideoWidth, resolution.Width);
|
||||
GameSettings.Modify(RegistryKeys.VideoHeight, resolution.Height);
|
||||
}
|
||||
|
||||
GameSettings.Modify(SettingKeys.Antialiasing, this.cmbAntialiasing.SelectedValue);
|
||||
GameSettings.Modify(SettingKeys.AnisotropicFiltering, this.cmbAnisotropy.SelectedValue);
|
||||
GameSettings.Modify(RegistryKeys.Antialiasing, this.cmbAntialiasing.SelectedValue);
|
||||
GameSettings.Modify(RegistryKeys.AnisotropicFiltering, this.cmbAnisotropy.SelectedValue);
|
||||
bool windowed = (WindowType)this.cmbMode.SelectedIndex == WindowType.Windowed || (WindowType)this.cmbMode.SelectedIndex == WindowType.Borderless;
|
||||
GameSettings.Modify(SettingKeys.Windowed, windowed == true ? 1 : 0);
|
||||
GameSettings.Modify(RegistryKeys.Windowed, windowed == true ? 1 : 0);
|
||||
bool borderless = (WindowType)this.cmbMode.SelectedIndex == WindowType.Borderless;
|
||||
GameSettings.Modify(SettingKeys.BorderlessWindow, borderless == true ? 1 : 0);
|
||||
GameSettings.Modify(SettingKeys.VerticalSync, this.chkVSync.Checked == true ? 1 : 0);
|
||||
GameSettings.Modify(SettingKeys.TripleBuffering, this.chkTripleBuffering.Checked == true ? 1 : 0);
|
||||
GameSettings.Modify(SettingKeys.NoAutoUpdate, this.chkUpdates.Checked == false ? 1 : 0);
|
||||
GameSettings.Modify(RegistryKeys.BorderlessWindow, borderless == true ? 1 : 0);
|
||||
GameSettings.Modify(RegistryKeys.VerticalSync, this.chkVSync.Checked == true ? 1 : 0);
|
||||
GameSettings.Modify(RegistryKeys.TripleBuffering, this.chkTripleBuffering.Checked == true ? 1 : 0);
|
||||
GameSettings.Modify(RegistryKeys.NoAutoUpdate, this.chkUpdates.Checked == false ? 1 : 0);
|
||||
|
||||
GameSettings.Save();
|
||||
|
@ -43,15 +43,15 @@ namespace Giants.Launcher
|
||||
public static void SetDefaults(string gamePath)
|
||||
{
|
||||
// Set default settings:
|
||||
Settings[SettingKeys.Renderer] = "gg_dx7r.dll";
|
||||
Settings[SettingKeys.Antialiasing] = 0;
|
||||
Settings[SettingKeys.AnisotropicFiltering] = 0;
|
||||
Settings[SettingKeys.VideoDepth] = 32;
|
||||
Settings[SettingKeys.Windowed] = 0;
|
||||
Settings[SettingKeys.BorderlessWindow] = 0;
|
||||
Settings[SettingKeys.VerticalSync] = 1;
|
||||
Settings[SettingKeys.TripleBuffering] = 1;
|
||||
Settings[SettingKeys.NoAutoUpdate] = 0;
|
||||
Settings[RegistryKeys.Renderer] = "gg_dx7r.dll";
|
||||
Settings[RegistryKeys.Antialiasing] = 0;
|
||||
Settings[RegistryKeys.AnisotropicFiltering] = 0;
|
||||
Settings[RegistryKeys.VideoDepth] = 32;
|
||||
Settings[RegistryKeys.Windowed] = 0;
|
||||
Settings[RegistryKeys.BorderlessWindow] = 0;
|
||||
Settings[RegistryKeys.VerticalSync] = 1;
|
||||
Settings[RegistryKeys.TripleBuffering] = 1;
|
||||
Settings[RegistryKeys.NoAutoUpdate] = 0;
|
||||
|
||||
// Get a list of renderers compatible with the user's system
|
||||
if (!CompatibleRenderers.Any())
|
||||
@ -70,33 +70,33 @@ namespace Giants.Launcher
|
||||
// Select the highest priority renderer
|
||||
if (CompatibleRenderers.Any())
|
||||
{
|
||||
Settings[SettingKeys.Renderer] = Path.GetFileName(CompatibleRenderers.Max().FilePath);
|
||||
Settings[RegistryKeys.Renderer] = Path.GetFileName(CompatibleRenderers.Max().FilePath);
|
||||
}
|
||||
|
||||
// Set the current desktop resolution, leaving bit depth at the default 32:
|
||||
Settings[SettingKeys.VideoWidth] = Screen.PrimaryScreen.Bounds.Width;
|
||||
Settings[SettingKeys.VideoHeight] = Screen.PrimaryScreen.Bounds.Height;
|
||||
Settings[RegistryKeys.VideoWidth] = Screen.PrimaryScreen.Bounds.Width;
|
||||
Settings[RegistryKeys.VideoHeight] = Screen.PrimaryScreen.Bounds.Height;
|
||||
}
|
||||
|
||||
public static void Load(string gamePath)
|
||||
{
|
||||
SetDefaults(gamePath);
|
||||
|
||||
if ((int)Registry.GetValue(RegistryKey, SettingKeys.GameOptionsVersion, 0) == OptionsVersion)
|
||||
if ((int)Registry.GetValue(RegistryKey, RegistryKeys.GameOptionsVersion, 0) == OptionsVersion)
|
||||
{
|
||||
try
|
||||
{
|
||||
Settings[SettingKeys.Renderer] = RegistryExtensions.GetValue(RegistryKey, SettingKeys.Renderer, SettingKeys.Renderer, typeof(string));
|
||||
Settings[SettingKeys.Antialiasing] = RegistryExtensions.GetValue(RegistryKey, SettingKeys.Antialiasing, Settings[SettingKeys.Antialiasing], typeof(int));
|
||||
Settings[SettingKeys.AnisotropicFiltering] = RegistryExtensions.GetValue(RegistryKey, SettingKeys.AnisotropicFiltering, Settings[SettingKeys.AnisotropicFiltering], typeof(int));
|
||||
Settings[SettingKeys.VideoWidth] = RegistryExtensions.GetValue(RegistryKey, SettingKeys.VideoWidth, Settings[SettingKeys.VideoWidth], typeof(int));
|
||||
Settings[SettingKeys.VideoHeight] = RegistryExtensions.GetValue(RegistryKey, SettingKeys.VideoHeight, Settings[SettingKeys.VideoHeight], typeof(int));
|
||||
Settings[SettingKeys.VideoDepth] = RegistryExtensions.GetValue(RegistryKey, SettingKeys.VideoDepth, Settings[SettingKeys.VideoDepth], typeof(int));
|
||||
Settings[SettingKeys.Windowed] = RegistryExtensions.GetValue(RegistryKey, SettingKeys.Windowed, Settings[SettingKeys.Windowed], typeof(int));
|
||||
Settings[SettingKeys.BorderlessWindow] = RegistryExtensions.GetValue(RegistryKey, SettingKeys.BorderlessWindow, Settings[SettingKeys.BorderlessWindow], typeof(int));
|
||||
Settings[SettingKeys.VerticalSync] = RegistryExtensions.GetValue(RegistryKey, SettingKeys.VerticalSync, Settings[SettingKeys.VerticalSync], typeof(int));
|
||||
Settings[SettingKeys.TripleBuffering] = RegistryExtensions.GetValue(RegistryKey, SettingKeys.TripleBuffering, Settings[SettingKeys.TripleBuffering], typeof(int));
|
||||
Settings[SettingKeys.NoAutoUpdate] = RegistryExtensions.GetValue(RegistryKey, SettingKeys.NoAutoUpdate, Settings[SettingKeys.NoAutoUpdate], typeof(int));
|
||||
Settings[RegistryKeys.Renderer] = RegistryExtensions.GetValue(RegistryKey, RegistryKeys.Renderer, RegistryKeys.Renderer, typeof(string));
|
||||
Settings[RegistryKeys.Antialiasing] = RegistryExtensions.GetValue(RegistryKey, RegistryKeys.Antialiasing, Settings[RegistryKeys.Antialiasing], typeof(int));
|
||||
Settings[RegistryKeys.AnisotropicFiltering] = RegistryExtensions.GetValue(RegistryKey, RegistryKeys.AnisotropicFiltering, Settings[RegistryKeys.AnisotropicFiltering], typeof(int));
|
||||
Settings[RegistryKeys.VideoWidth] = RegistryExtensions.GetValue(RegistryKey, RegistryKeys.VideoWidth, Settings[RegistryKeys.VideoWidth], typeof(int));
|
||||
Settings[RegistryKeys.VideoHeight] = RegistryExtensions.GetValue(RegistryKey, RegistryKeys.VideoHeight, Settings[RegistryKeys.VideoHeight], typeof(int));
|
||||
Settings[RegistryKeys.VideoDepth] = RegistryExtensions.GetValue(RegistryKey, RegistryKeys.VideoDepth, Settings[RegistryKeys.VideoDepth], typeof(int));
|
||||
Settings[RegistryKeys.Windowed] = RegistryExtensions.GetValue(RegistryKey, RegistryKeys.Windowed, Settings[RegistryKeys.Windowed], typeof(int));
|
||||
Settings[RegistryKeys.BorderlessWindow] = RegistryExtensions.GetValue(RegistryKey, RegistryKeys.BorderlessWindow, Settings[RegistryKeys.BorderlessWindow], typeof(int));
|
||||
Settings[RegistryKeys.VerticalSync] = RegistryExtensions.GetValue(RegistryKey, RegistryKeys.VerticalSync, Settings[RegistryKeys.VerticalSync], typeof(int));
|
||||
Settings[RegistryKeys.TripleBuffering] = RegistryExtensions.GetValue(RegistryKey, RegistryKeys.TripleBuffering, Settings[RegistryKeys.TripleBuffering], typeof(int));
|
||||
Settings[RegistryKeys.NoAutoUpdate] = RegistryExtensions.GetValue(RegistryKey, RegistryKeys.NoAutoUpdate, Settings[RegistryKeys.NoAutoUpdate], typeof(int));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -113,18 +113,18 @@ namespace Giants.Launcher
|
||||
{
|
||||
try
|
||||
{
|
||||
Registry.SetValue(RegistryKey, SettingKeys.GameOptionsVersion, OptionsVersion, RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, SettingKeys.Renderer, Settings[SettingKeys.Renderer], RegistryValueKind.String);
|
||||
Registry.SetValue(RegistryKey, SettingKeys.Antialiasing, Settings[SettingKeys.Antialiasing], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, SettingKeys.AnisotropicFiltering, Settings[SettingKeys.AnisotropicFiltering], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, SettingKeys.VideoWidth, Settings[SettingKeys.VideoWidth], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, SettingKeys.VideoHeight, Settings[SettingKeys.VideoHeight], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, SettingKeys.VideoDepth, Settings[SettingKeys.VideoDepth], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, SettingKeys.Windowed, Settings[SettingKeys.Windowed], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, SettingKeys.BorderlessWindow, Settings[SettingKeys.BorderlessWindow], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, SettingKeys.VerticalSync, Settings[SettingKeys.VerticalSync], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, SettingKeys.TripleBuffering, Settings[SettingKeys.TripleBuffering], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, SettingKeys.NoAutoUpdate, Settings[SettingKeys.NoAutoUpdate], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, RegistryKeys.GameOptionsVersion, OptionsVersion, RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, RegistryKeys.Renderer, Settings[RegistryKeys.Renderer], RegistryValueKind.String);
|
||||
Registry.SetValue(RegistryKey, RegistryKeys.Antialiasing, Settings[RegistryKeys.Antialiasing], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, RegistryKeys.AnisotropicFiltering, Settings[RegistryKeys.AnisotropicFiltering], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, RegistryKeys.VideoWidth, Settings[RegistryKeys.VideoWidth], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, RegistryKeys.VideoHeight, Settings[RegistryKeys.VideoHeight], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, RegistryKeys.VideoDepth, Settings[RegistryKeys.VideoDepth], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, RegistryKeys.Windowed, Settings[RegistryKeys.Windowed], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, RegistryKeys.BorderlessWindow, Settings[RegistryKeys.BorderlessWindow], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, RegistryKeys.VerticalSync, Settings[RegistryKeys.VerticalSync], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, RegistryKeys.TripleBuffering, Settings[RegistryKeys.TripleBuffering], RegistryValueKind.DWord);
|
||||
Registry.SetValue(RegistryKey, RegistryKeys.NoAutoUpdate, Settings[RegistryKeys.NoAutoUpdate], RegistryValueKind.DWord);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -12,7 +12,7 @@
|
||||
<AssemblyName>Giants</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ApplicationIcon>giants.ico</ApplicationIcon>
|
||||
<ApplicationIcon>Resources\giants.ico</ApplicationIcon>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
@ -58,6 +58,10 @@
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
@ -77,41 +81,44 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ApplicationNames.cs" />
|
||||
<Compile Include="Config.cs" />
|
||||
<Compile Include="ConfigKeys.cs" />
|
||||
<Compile Include="ConfigSections.cs" />
|
||||
<Compile Include="Renderer\RendererInfo.cs" />
|
||||
<Compile Include="Renderer\RenderInfoExtensions.cs" />
|
||||
<Compile Include="SettingKeys.cs" />
|
||||
<Compile Include="RegistryKeys.cs" />
|
||||
<Compile Include="Updater\ApplicationType.cs" />
|
||||
<Compile Include="VersionHelper.cs" />
|
||||
<Compile Include="WindowType.cs" />
|
||||
<Compile Include="GameSettings.cs" />
|
||||
<Compile Include="ImageButton.cs">
|
||||
<Compile Include="Forms\ImageButton.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="LauncherForm.cs">
|
||||
<Compile Include="Forms\LauncherForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
<CustomToolNamespace>Giants.Launcher</CustomToolNamespace>
|
||||
</Compile>
|
||||
<Compile Include="LauncherForm.Designer.cs">
|
||||
<Compile Include="Forms\LauncherForm.Designer.cs">
|
||||
<DependentUpon>LauncherForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Native\NativeMethods.cs" />
|
||||
<Compile Include="Native\RendererInterop.cs" />
|
||||
<Compile Include="OptionsForm.cs">
|
||||
<Compile Include="Forms\OptionsForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
<CustomToolNamespace>Giants.Launcher</CustomToolNamespace>
|
||||
</Compile>
|
||||
<Compile Include="OptionsForm.Designer.cs">
|
||||
<Compile Include="Forms\OptionsForm.Designer.cs">
|
||||
<DependentUpon>OptionsForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ScreenResolution.cs" />
|
||||
<Compile Include="Updater\UpdateInfo.cs" />
|
||||
<EmbeddedResource Include="LauncherForm.resx">
|
||||
<EmbeddedResource Include="Forms\LauncherForm.resx">
|
||||
<DependentUpon>LauncherForm.cs</DependentUpon>
|
||||
<CustomToolNamespace>Giants.Launcher</CustomToolNamespace>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="OptionsForm.resx">
|
||||
<EmbeddedResource Include="Forms\OptionsForm.resx">
|
||||
<DependentUpon>OptionsForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
@ -129,6 +136,7 @@
|
||||
<Compile Include="Updater\Updater.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Resources\LauncherStart.wav" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -163,7 +171,7 @@
|
||||
<None Include="Resources\optionspush.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="giants.ico" />
|
||||
<Content Include="Resources\giants.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
|
@ -30,7 +30,6 @@ namespace Giants.Launcher
|
||||
}
|
||||
|
||||
Application.Exit();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -55,7 +54,6 @@ namespace Giants.Launcher
|
||||
}
|
||||
|
||||
Application.Run(form);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
9
Giants.Launcher/Properties/Resources.Designer.cs
generated
9
Giants.Launcher/Properties/Resources.Designer.cs
generated
@ -106,6 +106,15 @@ namespace Giants.Launcher {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Settings file {0} was not found..
|
||||
/// </summary>
|
||||
internal static string ErrorNoConfigFile {
|
||||
get {
|
||||
return ResourceManager.GetString("ErrorNoConfigFile", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Could not locate any renderers compatible with your system. The most compatible renderer has been selected, but you may experience difficulty running the game..
|
||||
/// </summary>
|
||||
|
@ -202,4 +202,7 @@
|
||||
<data name="CommunityLabel" xml:space="preserve">
|
||||
<value>Join the community on {0}!</value>
|
||||
</data>
|
||||
<data name="ErrorNoConfigFile" xml:space="preserve">
|
||||
<value>Settings file {0} was not found.</value>
|
||||
</data>
|
||||
</root>
|
@ -1,6 +1,6 @@
|
||||
namespace Giants.Launcher
|
||||
{
|
||||
public class SettingKeys
|
||||
public static class RegistryKeys
|
||||
{
|
||||
public const string Antialiasing = "Antialiasing";
|
||||
public const string AnisotropicFiltering = "AnisotropicFiltering";
|
Binary file not shown.
Before Width: | Height: | Size: 2.2 KiB |
4
Giants.Launcher/packages.config
Normal file
4
Giants.Launcher/packages.config
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net472" />
|
||||
</packages>
|
Loading…
Reference in New Issue
Block a user