1.0.0.4
This commit is contained in:
STAM 2022-04-15 21:18:05 +03:00 committed by GitHub
commit 2a5d07df9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 59 additions and 9 deletions

View File

@ -10,6 +10,13 @@
# Changelog
## 1.0.0.4
#### Whats new
* Fixed `SteamInit` on program initialization and added tries to launch `Steam`
* Fixed `Run project` option
* Added support of new engines
* Added some default addons, but not linked with any engines
## 1.0.0.3
#### Whats new
* Migrated to @Facepunch [Steamworks](https://github.com/Facepunch/Facepunch.Steamworks)

View File

@ -1,5 +1,7 @@
using Steamworks;
using Microsoft.Win32;
using Steamworks;
using System;
using System.Diagnostics;
using System.Windows.Forms;
using UniversalValveToolbox.Model.Provider;
using UniversalValveToolbox.Utils;
@ -14,12 +16,47 @@ namespace UniversalValveToolbox {
var dataProvide = new DataProvider();
var currSettings = dataProvide.Settings;
LanguageManager.UpdateLanguage(currSettings.Language);
SteamClient.Init(currSettings.ToolsAppId);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
LanguageManager.UpdateLanguage(currSettings.Language);
try { SteamClient.Init(currSettings.ToolsAppId); }
catch (Exception ex) {
DialogResult result = MessageBox.Show(@"Some error was occurred when trying to init Steam API:" + Environment.NewLine +
"---------------------------------------------------------------------------" + Environment.NewLine +
ex.Message + Environment.NewLine +
"---------------------------------------------------------------------------" + Environment.NewLine +
"Try to launch Steam?",
"Error!", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
if (result == DialogResult.Yes)
{
try {
string steamPATH = "";
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Valve\Steam");
steamPATH = key.GetValue("SteamExe").ToString();
Process.Start(steamPATH);
key.Close();
}
catch (Exception exs) {
MessageBox.Show(@"Sorry. Steam launch failed because:" + Environment.NewLine +
"---------------------------------------------------------------------------" + Environment.NewLine +
exs.Message + Environment.NewLine +
"---------------------------------------------------------------------------" + Environment.NewLine +
"Application will be terminated.",
"Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
Application.Exit();
}
}
else
{
MessageBox.Show("Application will be terminated.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
Application.Exit();
}
}
Application.Run(new FormMain());
}
}

View File

@ -33,5 +33,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.3")]
[assembly: AssemblyFileVersion("1.0.0.3")]
[assembly: AssemblyVersion("1.0.0.4")]
[assembly: AssemblyFileVersion("1.0.0.4")]

View File

@ -456,8 +456,14 @@ namespace UniversalValveToolbox
{
if (RUN_PROJECT_ID.Equals(selectItem.Tag) && SelectedProject != null)
{
var pathEngineBin = Path.Combine(SteamApps.AppInstallDir(SelectedEngine.Appid), SelectedEngine.Bin);
//var pathEngineBin = Path.Combine(SteamApps.AppInstallDir(SelectedEngine.Appid), SelectedEngine.Bin);
var pathEngineBin = dataProvider.Settings.ToolboxMod switch
{
ToolboxMod.retail => Path.Combine(SteamApps.AppInstallDir(SelectedEngine.Appid), SelectedEngine.Bin),
ToolboxMod.bundle => Path.Combine(SteamApps.AppInstallDir(dataProvider.Settings.BundleAppID), SelectedEngine.Bin),
ToolboxMod.dev => Path.Combine(dataProvider.Settings.DevEnginePath, SelectedEngine.Bin),
_ => throw new Exception($"Unrecognised engine type: {dataProvider.Settings.ToolboxMod}")
};
Process.Start(pathEngineBin, $"-steam -game \"{SelectedProject?.Path ?? string.Empty}\" {SelectedProject.Args}");
}