Skip to content

Merge current dev branch (A.K.A. "Output workers")#13

Merged
Turnovus merged 16 commits intomainfrom
OutputWorkers
Jul 1, 2023
Merged

Merge current dev branch (A.K.A. "Output workers")#13
Turnovus merged 16 commits intomainfrom
OutputWorkers

Conversation

@Turnovus
Copy link
Copy Markdown
Owner

Technically, this branch is completed, tested, polished, and ready-to-merge. But at the time of me writing this, I have yet to write the wiki docs for the new and altered functionalities, so I'm just preparing the pull request now for when those drafts are finalized.

Notes: Solves issue #9

The base class for Output Workers is now public.  Added null check to PostProcessProduct's call, so that users can return no new products without throwing a NRE. Added null-or-empty checks to references to UseOutputWorkers.ActiveWorkers, for edge cases where the extension is used but no workers are provided. Added null-or-empty check to reference to UseOutputWorkers.outputWorkers for edge cases where the extension is used but no workers are provided. Updated manifest and assembly versions.
Solution build settings now include XML documentation.
Possible, but not-yet-tested solution to issue #9 - Added support for customizing whether HediffComp_MultiplyOtherHediffDuration and HediffComp_MultiplyOtherHediffSeverity affect new conditions, existing conditions, or both.

Also:
 - Fixed XML doc typo in Misc.cs
 - partial documentation and pragma tags in CF_StatDefOf.cs
 - Output workers now have their precept, style, and overrideGraphicIndex passed as ref.

Solution NOT rebuilt.
More documentation, renamed CommunityRecipeUtility.PostProcessProductDelegate to PostProcessProductSignature to reduce ambiguity.

Solution NOT rebuilt.
Removed unused imports from all of the classes that have them.
Added PlaceWorker_NotImpassible, which prevents buildings from being built in the same tile as any impassible building.

Added BlocksImpassibleBuildings mod extension, which prevents impassable buildings being built on top of any building with the extension.

Added Harmony patch to make BlocskImpassibleBuildings extension work.

Small formatting changes, some more documentation.

Solution rebuilt, but some new features added on prior commits to this branch still HAVE NOT been tested.
More XML documentation. Removed some internal comments in favor of auto-doc comments.

Renamed EBuildStage to EBuildableDefStage to avoid ambiguity between things and their defs.

Solution rebuilt.
Replaced UseOutputWorkers's inappropriate type-initializing system with a simple list of OutputWorkers. This means that the OutputWorker system can now actually be used.
Changed the base OutputWorker class's methods from abstract to virtual, so that users don't have to implement them in their own files.
Added two output workers related to randomizing the style of crafted items. OutputWorker_RandomStyleFromDef has been tested and works nominally. OutputWorker_RandomStyleFromList has not been tested yet.
Fixed a bug with LINQ's deferred execution, which made it impossible to properly interact with the collection of things produced by a recipe using an OutputWorker.

Fixed a doc typo.
Classes for extensions related to batteries and electronics. Added patches related to battery charge acceptance and battery short-circuiting. Added a DefModExtension that runs a method whenever a Thing with the attached ThingDef is created, and the patch for it.
Added functionality for the shortCicuitSource field of PowerExtension. Renamed BatteryExtensions to PowerExtensions.  Added a startup util to cache and modify defs at startup (currently only used to cache additional short circuit sources).
Put all of the battery patches into a single class, added a patch to remove the self-discharge readout from the inspect string if self-discharging is disabled. Fixed a bug in HediffComp_MultiplyOtherHediffSeverity that caused severity to be set to only integer values.

Confirmed fix for issue #9

Branch should be ready for merge code-wise, but more documentation is needed.
Finished writing documentation for the classes that didn't have it. Changed the access level for some Harmony patches because it's easier than writing documentation. Minor cosmetic refactorings.
Added translation keys for the new Harmony patches added in this branch.
Changed the version of this branch from 1.3.1 to 1.4.0, because that fits the semantic versioning convention better given the nature of the changes on this branch.
@Turnovus Turnovus merged commit e555ab9 into main Jul 1, 2023
@Turnovus Turnovus deleted the OutputWorkers branch July 1, 2023 14:04
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.

[Feature Request] Additional tags for HediffCompProperties_MultiplyOtherHediff

1 participant