Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crusual bugfixes, new functionallity and some cleanup #1

Merged
merged 6 commits into from
Mar 20, 2018
Merged

Crusual bugfixes, new functionallity and some cleanup #1

merged 6 commits into from
Mar 20, 2018

Conversation

Vlad-00003
Copy link
Contributor

Heyo (^^)/
Almost everything is descibed in the commits or with comments in the code

@@ -34,6 +34,7 @@ public static void Patch(HarmonyInstance harmony)
Utility.PatchDictionary(CraftDataType, "harvestTypeList", customHarvestTypeList);
Utility.PatchDictionary(CraftDataType, "itemSizes", customItemSizes);
Utility.PatchDictionary(CraftDataType, "equipmentTypes", customEquipmentTypes);
Utility.PatchDictionary(CraftDataType, "groups", customGroups);
Copy link
Contributor Author

@Vlad-00003 Vlad-00003 Mar 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now this can be used like that (example from your BaseLightSwitch)

        if(!CraftDataPatcher.customGroups.ContainsKey(TechGroup.InteriorModules))
            CraftDataPatcher.customGroups.Add(TechGroup.InteriorModules, new Dictionary<TechCategory, List<TechType>>());
        if(!CraftDataPatcher.customGroups[TechGroup.InteriorModules].ContainsKey(TechCategory.InteriorModule))
            CraftDataPatcher.customGroups[TechGroup.InteriorModules][TechCategory.InteriorModule] = new List<TechType>();
        CraftDataPatcher.customGroups[TechGroup.InteriorModules][TechCategory.InteriorModule].Add(techType);


public static List<TechType> customBuildables = new List<TechType>();

private static readonly Type CraftDataType = typeof(CraftData);

public static void AddToCustomGroup(TechGroup group, TechCategory category, TechType techType)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be easier to use. I don't know if it's necacarry to make customGroups private, but the idea is simpple - don't touch what doesn't need to be touched =)
And new usage example (once again - from your BaseLightSwitch)

        CraftDataPatcher.AddToCustomGroup(TechGroup.InteriorModules, TechCategory.InteriorModule,techType);

Way easier, if you'll ask me =(^^)=

@ahk1221 ahk1221 merged commit e455359 into SubnauticaModding:master Mar 20, 2018
PrimeSonic pushed a commit that referenced this pull request Jun 27, 2018
MrPurple6411 pushed a commit that referenced this pull request Dec 23, 2022
Convert to Bepinex and Fix a few other issues.
toebeann pushed a commit that referenced this pull request May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants