Skip to content

Refactor gm-unit: DRY up appearance modifier logic in editor_body.lua#1594

Open
sizzlins wants to merge 5 commits into
DFHack:masterfrom
sizzlins:refactor/gm-unit-editor-body
Open

Refactor gm-unit: DRY up appearance modifier logic in editor_body.lua#1594
sizzlins wants to merge 5 commits into
DFHack:masterfrom
sizzlins:refactor/gm-unit-editor-body

Conversation

@sizzlins

Copy link
Copy Markdown

This PR is a cleanup and refactor of internal/gm-unit/editor_body.lua to remove duplicated code and follow standard DRY

Created unified setModifier and getModifier methods that intelligently handle both "part" and "body" modifications.

Deleted the nearly identical setPartModifier and setBodyModifier methods.

Stripped out the redundant if self.partChoice.type == "part" conditional checks that were scattered inside the selected(), random(), step(), and updateChoices() actions.

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.

1 participant