Skip to content

Commit

Permalink
Add ST Infinite support
Browse files Browse the repository at this point in the history
  • Loading branch information
bcssov committed Oct 12, 2023
1 parent b65adbf commit 4387560
Show file tree
Hide file tree
Showing 10 changed files with 125 additions and 43 deletions.
34 changes: 32 additions & 2 deletions src/IronyModManager.Services/Registrations/GameRegistration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created : 02-12-2020
//
// Last Modified By : Mario
// Last Modified On : 10-03-2023
// Last Modified On : 10-12-2023
// ***********************************************************************
// <copyright file="GameRegistration.cs" company="Mario">
// Mario
Expand Down Expand Up @@ -40,7 +40,7 @@ public class GameRegistration : PostStartup
/// <summary>
/// The hoi4 cache version
/// </summary>
private const int HOI4CacheVersion = 12;
private const int HOI4CacheVersion = 13;

/// <summary>
/// The stellaris cache version
Expand Down Expand Up @@ -70,6 +70,7 @@ public override void OnPostStartup()
storage.RegisterGame(GetImperator(userDir));
storage.RegisterGame(GetCK3(userDir));
storage.RegisterGame(GetVicky3(userDir));
storage.RegisterGame(GetSTInfinite(userDir));
}

/// <summary>
Expand Down Expand Up @@ -265,6 +266,35 @@ private IGameType GetStellaris(string baseUserDir)
return game;
}

/// <summary>
/// Gets the st infinite.
/// </summary>
/// <param name="baseUserDir">The base user dir.</param>
/// <returns>IGameType.</returns>
private IGameType GetSTInfinite(string baseUserDir)
{
var game = DIResolver.Get<IGameType>();
game.DLCContainer = Shared.Constants.GamesTypes.DLCContainer;
game.ChecksumFolders = Shared.Constants.GamesTypes.STInfinite.ChecksumFolders;
game.GameFolders = Shared.Constants.GamesTypes.STInfinite.GameFolders;
game.LogLocation = Path.Combine(Path.Combine(baseUserDir, Shared.Constants.GamesTypes.STInfinite.DocsPath), Shared.Constants.GamesTypes.LogLocation).StandardizeDirectorySeparator();
game.Name = Shared.Constants.GamesTypes.STInfinite.Id;
game.Abrv = Shared.Constants.GamesTypes.STInfinite.Abrv;
game.SteamAppId = Shared.Constants.GamesTypes.STInfinite.SteamAppId;
game.UserDirectory = Path.Combine(baseUserDir, Shared.Constants.GamesTypes.STInfinite.DocsPath).StandardizeDirectorySeparator();
game.WorkshopDirectory = SteamDirectory.GetWorkshopDirectory(Shared.Constants.GamesTypes.STInfinite.SteamAppId).Select(p => p.StandardizeDirectorySeparator()).ToList();
game.BaseSteamGameDirectory = SteamDirectory.GetGameDirectory(Shared.Constants.GamesTypes.STInfinite.SteamAppId).StandardizeDirectorySeparator();
game.LauncherSettingsFileName = Shared.Constants.GamesTypes.LauncherSettingsFileName;
game.RemoteSteamUserDirectory = SteamDirectory.GetUserDataFolders(game.SteamAppId).Select(p => p.StandardizeDirectorySeparator()).ToList();
game.AdvancedFeatures = IronyModManager.Models.Common.GameAdvancedFeatures.None;
game.ParadoxGameId = Shared.Constants.GamesTypes.STInfinite.ParadoxGameId;
game.SupportedMergeTypes = IronyModManager.Models.Common.SupportedMergeTypes.Zip | IronyModManager.Models.Common.SupportedMergeTypes.Basic;
game.ModDescriptorType = IronyModManager.Models.Common.ModDescriptorType.DescriptorMod;
game.GameIndexCacheVersion = 1;
MapGameSettings(game, GetExecutableSettings(game));
return game;
}

/// <summary>
/// Gets the vicky3.
/// </summary>
Expand Down
112 changes: 78 additions & 34 deletions src/IronyModManager.Shared/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// ***********************************************************************

// ***********************************************************************
// Assembly : IronyModManager.Shared
// Author : Mario
// Created : 01-17-2020
//
// Last Modified By : Mario
// Last Modified On : 09-13-2023
// Last Modified On : 10-12-2023
// ***********************************************************************
// <copyright file="Constants.cs" company="Mario">
// Mario
Expand All @@ -17,12 +18,12 @@

namespace IronyModManager.Shared
{

/// <summary>
/// Class Constants.
/// </summary>
public class Constants
{

#region Fields

/// <summary>
Expand Down Expand Up @@ -154,15 +155,13 @@ public class Constants
/// </summary>
public static class CodeSeparators
{

#region Classes

/// <summary>
/// Class ClosingSeparators.
/// </summary>
public static class ClosingSeparators
{

#region Fields

/// <summary>
Expand All @@ -176,15 +175,13 @@ public static class ClosingSeparators
public static readonly Dictionary<string, string> Map = new() { { CurlyBracket, "}" } };

#endregion Fields

}

/// <summary>
/// Class NonClosingSeparators.
/// </summary>
public static class NonClosingSeparators
{

#region Fields

/// <summary>
Expand All @@ -198,19 +195,16 @@ public static class NonClosingSeparators
public static readonly string[] Map = new string[] { ColonSign };

#endregion Fields

}

#endregion Classes

}

/// <summary>
/// Class GamesTypes.
/// </summary>
public static class GamesTypes
{

#region Fields

/// <summary>
Expand All @@ -237,7 +231,6 @@ public static class GamesTypes
/// </summary>
public static class CrusaderKings3
{

#region Fields

/// <summary>
Expand Down Expand Up @@ -273,8 +266,11 @@ public static class CrusaderKings3
/// <summary>
/// The game folders
/// </summary>
public static readonly string[] GameFolders = new string[] { "common", "content_source", "dlc", "events", "fonts", "gfx", "gui", "history", "localization",
"map_data", "music", "notifications", "sound", "tests", "tools", "tweakergui_assets" };
public static readonly string[] GameFolders = new string[]
{
"common", "content_source", "dlc", "events", "fonts", "gfx", "gui", "history", "localization",
"map_data", "music", "notifications", "sound", "tests", "tools", "tweakergui_assets"
};

/// <summary>
/// The launcher settings file name
Expand All @@ -292,15 +288,13 @@ public static class CrusaderKings3
public static readonly string ParadoxGameId = "ck3";

#endregion Fields

}

/// <summary>
/// Class EuropaUniversalis4.
/// </summary>
public static class EuropaUniversalis4
{

#region Fields

/// <summary>
Expand Down Expand Up @@ -331,24 +325,25 @@ public static class EuropaUniversalis4
/// <summary>
/// The game folders
/// </summary>
public static readonly string[] GameFolders = new string[] { "common", "customizable_localization", "decisions", "events", "gfx", "hints",
"history", "interface", "localisation", "map", "missions", "music", "sound", "tutorial", "tweakergui_assets" };
public static readonly string[] GameFolders = new string[]
{
"common", "customizable_localization", "decisions", "events", "gfx", "hints",
"history", "interface", "localisation", "map", "missions", "music", "sound", "tutorial", "tweakergui_assets"
};

/// <summary>
/// The paradox game identifier
/// </summary>
public static readonly string ParadoxGameId = "eu4";

#endregion Fields

}

/// <summary>
/// Class HeartsOfIron4.
/// </summary>
public static class HeartsOfIron4
{

#region Fields

/// <summary>
Expand Down Expand Up @@ -379,24 +374,25 @@ public static class HeartsOfIron4
/// <summary>
/// The game folders
/// </summary>
public static readonly string[] GameFolders = new string[] { "common", "events", "gfx", "history", "interface", "localisation",
"map", "music", "portraits", "previewer_assets", "script", "sound", "tutorial", "tweakergui_assets" };
public static readonly string[] GameFolders = new string[]
{
"common", "events", "gfx", "history", "interface", "localisation",
"map", "music", "portraits", "previewer_assets", "script", "sound", "tutorial", "tweakergui_assets"
};

/// <summary>
/// The paradox game identifier
/// </summary>
public static readonly string ParadoxGameId = "hoi4";

#endregion Fields

}

/// <summary>
/// Class ImperatorRome.
/// </summary>
public static class ImperatorRome
{

#region Fields

/// <summary>
Expand Down Expand Up @@ -437,8 +433,11 @@ public static class ImperatorRome
/// <summary>
/// The game folders
/// </summary>
public static readonly string[] GameFolders = new string[] { "common", "content_source", "decisions", "events", "fonts", "gfx",
"gui", "localization", "map_data", "music", "setup", "sound", "tutorial", "tweakergui_assets" };
public static readonly string[] GameFolders = new string[]
{
"common", "content_source", "decisions", "events", "fonts", "gfx",
"gui", "localization", "map_data", "music", "setup", "sound", "tutorial", "tweakergui_assets"
};

/// <summary>
/// The launcher settings file name
Expand All @@ -456,15 +455,13 @@ public static class ImperatorRome
public static readonly string ParadoxGameId = "imperator_rome";

#endregion Fields

}

/// <summary>
/// Class Stellaris.
/// </summary>
public static class Stellaris
{

#region Fields

/// <summary>
Expand Down Expand Up @@ -500,9 +497,11 @@ public static class Stellaris
/// <summary>
/// The game folders
/// </summary>
public static readonly string[] GameFolders = new string[] { "pdx_launcher", "pdx_online_assets", "prescripted_countries", "previewer_assets", "sound",
"tools", "tweakergui_assets", "unchecked_defines", "common", "crash_reporter", "curated_save_games", "dlc", "dlc_metadata",
"events", "flags", "fonts", "gfx", "interface", "launcher-assets", "licenses", "locales", "localisation", "map", "music", "pdx_browser"
public static readonly string[] GameFolders = new string[]
{
"pdx_launcher", "pdx_online_assets", "prescripted_countries", "previewer_assets", "sound",
"tools", "tweakergui_assets", "unchecked_defines", "common", "crash_reporter", "curated_save_games", "dlc", "dlc_metadata",
"events", "flags", "fonts", "gfx", "interface", "launcher-assets", "licenses", "locales", "localisation", "map", "music", "pdx_browser"
};

/// <summary>
Expand All @@ -511,15 +510,63 @@ public static class Stellaris
public static readonly string ParadoxGameId = "stellaris";

#endregion Fields
}

/// <summary>
/// Class STInfinite.
/// </summary>
public static class STInfinite
{
#region Fields

/// <summary>
/// The abrv
/// </summary>
public const string Abrv = "STInfinite";

/// <summary>
/// The docs path
/// </summary>
public const string DocsPath = "Infinite";

/// <summary>
/// The identifier
/// </summary>
public const string Id = "STInfinite";

/// <summary>
/// The steam application identifier
/// </summary>
public const int SteamAppId = 1622900;

/// <summary>
/// The checksum folders
/// </summary>
public static readonly string[] ChecksumFolders = new string[] { "common", "events", "map", "localisation_synced" };

/// <summary>
/// The game folders
/// </summary>
public static readonly string[] GameFolders = new string[]
{
"common", "crash_reporter", "dlc", "dlc_metadata", "events", "flags", "fonts", "gfx", "interface",
"launcher-assets", "licenses", "locales", "localisation", "localisation_synced", "map", "music", "pdx_launcher",
"pdx_online_assets", "prescripted_countries", "previewer_assets", "sound", "tools", "tweakergui_assets"
};

/// <summary>
/// The paradox game identifier
/// </summary>
public static readonly string ParadoxGameId = "infinite";

#endregion Fields
}

/// <summary>
/// Class Victoria3.
/// </summary>
public static class Victoria3
{

#region Fields

/// <summary>
Expand Down Expand Up @@ -573,14 +620,11 @@ public static class Victoria3
public static readonly string ParadoxGameId = "victoria3";

#endregion Fields

}

#endregion Classes

}

#endregion Classes

}
}
1 change: 1 addition & 0 deletions src/IronyModManager.Shared/LocalizationResources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public static class Games
public const string ImperatorRome = Prefix + "ImperatorRome";
public const string CrusaderKings3 = Prefix + "CrusaderKings3";
public const string Victoria3 = Prefix + "Victoria3";
public const string STInfinite = Prefix + "STInfinite";
}
public static class Installed_Mods
{
Expand Down
3 changes: 2 additions & 1 deletion src/IronyModManager/Localization/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
"HeartsofIronIV": "Hearts of Iron IV",
"ImperatorRome": "Imperator Rome",
"CrusaderKings3": "Crusader Kings III",
"Victoria3": "Victoria 3"
"Victoria3": "Victoria 3",
"STInfinite": "Star Trek: Infinite"
},
"Installed_Mods": {
"Name": "Installierte Mods",
Expand Down
3 changes: 2 additions & 1 deletion src/IronyModManager/Localization/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
"HeartsofIronIV": "Hearts of Iron IV",
"ImperatorRome": "Imperator Rome",
"CrusaderKings3": "Crusader Kings III",
"Victoria3": "Victoria 3"
"Victoria3": "Victoria 3",
"STInfinite": "Star Trek: Infinite"
},
"Installed_Mods": {
"Name": "Installed Mods",
Expand Down
Loading

0 comments on commit 4387560

Please sign in to comment.