-
Notifications
You must be signed in to change notification settings - Fork 37
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
Conversation
@@ -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); |
There was a problem hiding this comment.
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);
…ing techtypes to the groups.
|
||
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) |
There was a problem hiding this comment.
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 =(^^)=
Convert to Bepinex and Fix a few other issues.
Heyo (^^)/
Almost everything is descibed in the commits or with comments in the code