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!
This commit is contained in:
terrymacdonald 2020-07-22 21:52:36 +12:00
parent 71928a9b44
commit ee7703255e
3 changed files with 23 additions and 12 deletions

View File

@ -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 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) public bool CopyTo(SteamGame steamGame)
{ {
if (!(steamGame is SteamGame)) if (!(steamGame is SteamGame))
return false; 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.GameIconPath = GameIconPath;
steamGame.GameId = GameId; steamGame.GameId = GameId;
steamGame.GameName = GameName; steamGame.GameName = GameName;
steamGame.GamePath = GamePath; steamGame.GamePath = GamePath;
steamGame.IsRunning = IsRunning;
steamGame.IsUpdating = IsUpdating;
return true; return true;
} }

View File

@ -16,7 +16,7 @@ namespace HeliosPlus.GameLibraries
{ {
#region Class Variables #region Class Variables
// Common items to the class // Common items to the class
private static List<SteamGame> _allSteamGames = null; private static List<SteamGame> _allSteamGames = new List<SteamGame>();
private static string steamAppIdRegex = @"/^[0-9A-F]{1,10}$"; private static string steamAppIdRegex = @"/^[0-9A-F]{1,10}$";
private static string _steamExe; private static string _steamExe;
private static string _steamPath; private static string _steamPath;

View File

@ -439,11 +439,11 @@ namespace HeliosPlus.UIForms
_shortcutToEdit.OriginalIconPath = (from steamGame in SteamLibrary.AllInstalledGames where steamGame.GameId == _shortcutToEdit.GameAppId select steamGame.GameIconPath).First(); _shortcutToEdit.OriginalIconPath = (from steamGame in SteamLibrary.AllInstalledGames where steamGame.GameId == _shortcutToEdit.GameAppId select steamGame.GameIconPath).First();
_shortcutToEdit.GameLibrary = SupportedGameLibrary.Steam; _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.OriginalIconPath = (from uplayGame in UplayLibrary.AllInstalledGames where uplayGame.GameId == _shortcutToEdit.GameAppId select uplayGame.GameIconPath).First();
_shortcutToEdit.GameLibrary = SupportedGameLibrary.Uplay; _shortcutToEdit.GameLibrary = SupportedGameLibrary.Uplay;
} }*/
else if (rb_standalone.Checked) else if (rb_standalone.Checked)
_shortcutToEdit.Category = ShortcutCategory.Application; _shortcutToEdit.Category = ShortcutCategory.Application;