Skip to content

Commit

Permalink
Stellaris CS 3.14 update
Browse files Browse the repository at this point in the history
  • Loading branch information
bcssov committed Oct 30, 2024
1 parent 1d0f16c commit 7662095
Show file tree
Hide file tree
Showing 18 changed files with 674 additions and 312 deletions.
3 changes: 1 addition & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ Check the [Wiki](https://github.com/bcssov/IronyModManager/wiki)
All instructions are for Windows.
1. Install Visual Studio 2022 (required for .NET6)
1. Clone the repo to your local machine
1. Open the LocalizationResourceGenerator solution file located in \Tools\LocalizationResourceGenerator\src
* Build the solution and copy the binaries to the Tools\LocalizationResourceGenerator folder
1. Run cmd\build-tools.bat to build the LocalizationResourceGenerator
1. If you don't already have one, create a folder for local NuGet packages and unzip the [CWTools.Irony-Private.0.4.0-alpha8](https://github.com/bcssov/IronyModManager/files/7798143/CWTools.Irony-Private.0.4.0-alpha8.zip) package to it
* This is just an up to date version of CWTools, the one on the public NuGet is older
* Example path: C:\Users\username\code\LocalNuGet
Expand Down
7 changes: 2 additions & 5 deletions References/CopyAll/Maps/HeartsofIronIVParserMap.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,6 @@
}, {
"DirectoryPath": "history\\units",
"PreferredParser": "HOI4WholeTextParser"
}, {
"DirectoryPath": "interface",
"PreferredParser": "GenericGraphicsParser"
}, {
"DirectoryPath": "integrated_dlc\\dlc018_together_for_victory\\gfx\\entities",
"PreferredParser": "GenericGraphicsParser"
Expand Down Expand Up @@ -363,9 +360,9 @@
"PreferredParser": "DefaultParser"
}, {
"DirectoryPath": "interface",
"PreferredParser": "DefaultParser"
"PreferredParser": "GenericGraphicsParser"
}, {
"DirectoryPath": "launcher-assets",
"DirectoryPath": "interface",
"PreferredParser": "DefaultParser"
}, {
"DirectoryPath": "localisation",
Expand Down
48 changes: 48 additions & 0 deletions References/CopyAll/Maps/StellarisParserMap.json
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,24 @@
}, {
"DirectoryPath": "common\\inline_scripts\\events",
"PreferredParser": "StellarisWholeTextParser"
}, {
"DirectoryPath": "common\\inline_scripts\\grand_archive",
"PreferredParser": "StellarisWholeTextParser"
}, {
"DirectoryPath": "common\\inline_scripts\\grand_archive\\collection",
"PreferredParser": "StellarisWholeTextParser"
}, {
"DirectoryPath": "common\\inline_scripts\\grand_archive\\mutations",
"PreferredParser": "StellarisWholeTextParser"
}, {
"DirectoryPath": "common\\inline_scripts\\grand_archive\\mutations\\camouflage",
"PreferredParser": "StellarisWholeTextParser"
}, {
"DirectoryPath": "common\\inline_scripts\\grand_archive\\mutations\\core_components",
"PreferredParser": "StellarisWholeTextParser"
}, {
"DirectoryPath": "common\\inline_scripts\\grand_archive\\specimen_upkeeps",
"PreferredParser": "StellarisWholeTextParser"
}, {
"DirectoryPath": "common\\inline_scripts\\jobs",
"PreferredParser": "StellarisWholeTextParser"
Expand All @@ -292,6 +310,9 @@
}, {
"DirectoryPath": "common\\inline_scripts\\ship_components\\weights",
"PreferredParser": "StellarisWholeTextParser"
}, {
"DirectoryPath": "common\\inline_scripts\\starbase_modules",
"PreferredParser": "StellarisWholeTextParser"
}, {
"DirectoryPath": "common\\inline_scripts\\technologies",
"PreferredParser": "StellarisWholeTextParser"
Expand Down Expand Up @@ -337,6 +358,9 @@
}, {
"DirectoryPath": "common\\missions",
"PreferredParser": "DefaultParser"
}, {
"DirectoryPath": "common\\mutations",
"PreferredParser": "DefaultParser"
}, {
"DirectoryPath": "common\\named_colors",
"PreferredParser": "DefaultParser"
Expand Down Expand Up @@ -433,6 +457,9 @@
}, {
"DirectoryPath": "common\\ship_behaviors",
"PreferredParser": "GenericKeyParser"
}, {
"DirectoryPath": "common\\ship_categories",
"PreferredParser": "DefaultParser"
}, {
"DirectoryPath": "common\\ship_sizes",
"PreferredParser": "StellarisOverwrittenObjectSingleFileParser"
Expand Down Expand Up @@ -484,6 +511,9 @@
}, {
"DirectoryPath": "common\\species_rights\\slavery_types",
"PreferredParser": "StellarisOverwrittenParser"
}, {
"DirectoryPath": "common\\specimens",
"PreferredParser": "DefaultParser"
}, {
"DirectoryPath": "common\\starbase_buildings",
"PreferredParser": "DefaultParser"
Expand Down Expand Up @@ -649,6 +679,9 @@
}, {
"DirectoryPath": "gfx\\shipview",
"PreferredParser": "DefaultParser"
}, {
"DirectoryPath": "gfx\\vivariumview",
"PreferredParser": "DefaultParser"
}, {
"DirectoryPath": "gfx\\worldgfx",
"PreferredParser": "GenericKeyParser"
Expand Down Expand Up @@ -808,6 +841,21 @@
}, {
"DirectoryPath": "sound\\firstcontact\\ui",
"PreferredParser": "GenericWholeTextParser"
}, {
"DirectoryPath": "sound\\grand_archive\\events",
"PreferredParser": "GenericWholeTextParser"
}, {
"DirectoryPath": "sound\\grand_archive\\relics",
"PreferredParser": "GenericWholeTextParser"
}, {
"DirectoryPath": "sound\\grand_archive\\ships",
"PreferredParser": "GenericWholeTextParser"
}, {
"DirectoryPath": "sound\\grand_archive\\ui",
"PreferredParser": "GenericWholeTextParser"
}, {
"DirectoryPath": "sound\\grand_archive\\weapons",
"PreferredParser": "GenericWholeTextParser"
}, {
"DirectoryPath": "sound\\guardians",
"PreferredParser": "GenericWholeTextParser"
Expand Down
20 changes: 11 additions & 9 deletions src/IronyModManager.DI/MessageBus/MessageBusDependencyResolver.cs
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@

// ***********************************************************************
// ***********************************************************************
// Assembly : IronyModManager.DI
// Author : Mario
// Created : 06-10-2020
//
// Last Modified By : Mario
// Last Modified On : 06-26-2023
// Last Modified On : 10-29-2024
// ***********************************************************************
// <copyright file="MessageBusDependencyResolver.cs" company="Mario">
// Mario
// </copyright>
// <summary></summary>
// ***********************************************************************

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using SlimMessageBus.Host;

namespace IronyModManager.DI.MessageBus
{

/// <summary>
/// Class MessageBusDependencyResolver.
/// Implements the <see cref="SlimMessageBus.Host.DependencyResolver.IDependencyResolver" />
Expand All @@ -34,6 +34,7 @@ internal class MessageBusDependencyResolver : IServiceProvider
/// The message type resolver
/// </summary>
private readonly MessageTypeResolver messageTypeResolver;

/// <summary>
/// The resolved collections
/// </summary>
Expand Down Expand Up @@ -75,18 +76,19 @@ public object GetService(Type serviceType)
{
return messageTypeResolver;
}
else if (typeof(System.Collections.IEnumerable).IsAssignableFrom(serviceType) && typeof(SlimMessageBus.Host.Interceptor.IMessageBusLifecycleInterceptor).IsAssignableFrom(serviceType.GetGenericArguments()[0]))
{
return null;
}

if (DIContainer.Container.IsLocked)
{
var obj = DIResolver.Get(serviceType);
return obj;
}
else
{
if (resolvedCollections.TryGetValue(serviceType, out var instance))
{
return instance();
}
return null;
return resolvedCollections.TryGetValue(serviceType, out var instance) ? instance() : null;
}
}

Expand Down
11 changes: 10 additions & 1 deletion src/IronyModManager.Parser.Common/Parsers/BaseParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 02-17-2020
//
// Last Modified By : Mario
// Last Modified On : 10-17-2024
// Last Modified On : 10-29-2024
// ***********************************************************************
// <copyright file="BaseParser.cs" company="Mario">
// Mario
Expand Down Expand Up @@ -309,6 +309,15 @@ protected virtual IEnumerable<IDefinition> ParseComplexTypes(IEnumerable<IScript
definition.OriginalId = isFirstLevel ? TrimId(item.Key) : TrimId(parent);
definition.ValueType = ValueType.Object;
definition.OriginalCode = definition.Code = FormatCode(item, parent);
if (item.Values != null && item.Values.Count() == 1)
{
if (item.Values.FirstOrDefault()!.Key.Equals(Constants.Stellaris.InlineScriptId, StringComparison.OrdinalIgnoreCase))
{
// Yay, paradox
definition.ContainsInlineIdentifier = true;
}
}

if (!isFirstLevel)
{
definition.OriginalCode = FormatCode(item, skipVariables: true);
Expand Down
Loading

0 comments on commit 7662095

Please sign in to comment.