From ee7703255e84e220f9dce55cb9c178361b0a4ed0 Mon Sep 17 00:00:00 2001 From: terrymacdonald Date: Wed, 22 Jul 2020 21:52:36 +1200 Subject: [PATCH] Fixed SteamGame so it handles copies Fixed SteamGame so it handles copies, and also fixed the SteamLibrary so it works properly and works. HeliosPlus now will run shortcuts and load the game perfectly! --- HeliosPlus/GameLibraries/SteamGame.cs | 29 ++++++++++++++++-------- HeliosPlus/GameLibraries/SteamLibrary.cs | 2 +- HeliosPlus/UIForms/ShortcutForm.cs | 4 ++-- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/HeliosPlus/GameLibraries/SteamGame.cs b/HeliosPlus/GameLibraries/SteamGame.cs index 2d6cfd2..ffe5d1a 100644 --- a/HeliosPlus/GameLibraries/SteamGame.cs +++ b/HeliosPlus/GameLibraries/SteamGame.cs @@ -71,11 +71,19 @@ namespace HeliosPlus.GameLibraries } - public uint GameId { get => _steamGameId; } + public uint GameId { + get => _steamGameId; + set => _steamGameId = value; + } - public SupportedGameLibrary GameLibrary { get => SupportedGameLibrary.Steam; } + public SupportedGameLibrary GameLibrary { + get => SupportedGameLibrary.Steam; + } - public string GameIconPath { get => _steamGameIconPath; } + public string GameIconPath { + get => _steamGameIconPath; + set => _steamGameIconPath = value; + } public bool IsRunning { @@ -147,23 +155,26 @@ namespace HeliosPlus.GameLibraries } } - public string GameName { get => _steamGameName; } + public string GameName { + get => _steamGameName; + set => _steamGameName = value; + } - public string GamePath { get => _steamGamePath; } + public string GamePath { + get => _steamGamePath; + set => _steamGamePath = value; + } public bool CopyTo(SteamGame steamGame) { if (!(steamGame is SteamGame)) return false; - // Copy all the shortcut data over to the other Shortcut + // Copy all the game data over to the other game steamGame.GameIconPath = GameIconPath; steamGame.GameId = GameId; steamGame.GameName = GameName; steamGame.GamePath = GamePath; - steamGame.IsRunning = IsRunning; - steamGame.IsUpdating = IsUpdating; - return true; } diff --git a/HeliosPlus/GameLibraries/SteamLibrary.cs b/HeliosPlus/GameLibraries/SteamLibrary.cs index e42d610..7cba638 100644 --- a/HeliosPlus/GameLibraries/SteamLibrary.cs +++ b/HeliosPlus/GameLibraries/SteamLibrary.cs @@ -16,7 +16,7 @@ namespace HeliosPlus.GameLibraries { #region Class Variables // Common items to the class - private static List _allSteamGames = null; + private static List _allSteamGames = new List(); private static string steamAppIdRegex = @"/^[0-9A-F]{1,10}$"; private static string _steamExe; private static string _steamPath; diff --git a/HeliosPlus/UIForms/ShortcutForm.cs b/HeliosPlus/UIForms/ShortcutForm.cs index f969d3a..fd8f8bb 100644 --- a/HeliosPlus/UIForms/ShortcutForm.cs +++ b/HeliosPlus/UIForms/ShortcutForm.cs @@ -439,11 +439,11 @@ namespace HeliosPlus.UIForms _shortcutToEdit.OriginalIconPath = (from steamGame in SteamLibrary.AllInstalledGames where steamGame.GameId == _shortcutToEdit.GameAppId select steamGame.GameIconPath).First(); _shortcutToEdit.GameLibrary = SupportedGameLibrary.Steam; } - else if (txt_game_launcher.Text == SupportedGameLibrary.Uplay.ToString()) + /*else if (txt_game_launcher.Text == SupportedGameLibrary.Uplay.ToString()) { _shortcutToEdit.OriginalIconPath = (from uplayGame in UplayLibrary.AllInstalledGames where uplayGame.GameId == _shortcutToEdit.GameAppId select uplayGame.GameIconPath).First(); _shortcutToEdit.GameLibrary = SupportedGameLibrary.Uplay; - } + }*/ else if (rb_standalone.Checked) _shortcutToEdit.Category = ShortcutCategory.Application;