Skip to content

Commit

Permalink
Fix issues adding custom protos
Browse files Browse the repository at this point in the history
  • Loading branch information
limoka committed Dec 18, 2023
1 parent 3502a8a commit bbe02ff
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CommonAPI/CommonAPIPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class CommonAPIPlugin : BaseUnityPlugin, IModCanSave
internal static SubmoduleHandler submoduleHandler;

public static Dictionary<string, Registry> registries = new Dictionary<string, Registry>();
public static readonly Version buildFor = GameVersionUtil.GetVersion(0,9,27,14659);
public static readonly Version buildFor = GameVersionUtil.GetVersion(0,10,28,20829);

public static bool iconShotMenuEnabled;
public static KeyCode openIconShotMenuButton;
Expand Down
9 changes: 9 additions & 0 deletions CommonAPI/Systems/ProtoRegistrySystem/ProtoRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,20 @@ private static void OnPostAdd()
kv.Value.Preload();
kv.Value.description = kv.Value.description.Translate();
}

CommonAPIPlugin.logger.LogInfo("Reinit cached data!");

ItemProto.InitFuelNeeds();
ItemProto.InitFluids();
ItemProto.InitItemIds();
ItemProto.InitItemIndices();

SpaceSector.PrefabDescByModelIndex = null;
SpaceSector.InitPrefabDescArray();

PlanetFactory.PrefabDescByModelIndex = null;
PlanetFactory.InitPrefabDescArray();

onLoadingFinished?.Invoke();

CommonAPIPlugin.logger.LogInfo("Post loading is complete!");
Expand Down
4 changes: 4 additions & 0 deletions Staging/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### v1.6.1
- Fix errors when adding custom protos
- Fix warnings about Common API not being built for 0.10.28.20729

### v1.6.0
- Updated to work with game version 0.10.28.20729 or higher
- Added Localization Module to support custom localizations.
Expand Down

0 comments on commit bbe02ff

Please sign in to comment.