From e7a5951b9586ac231a8646f423660f5a78d9630c Mon Sep 17 00:00:00 2001 From: Patrick Dulebohn Date: Wed, 19 Oct 2022 14:12:56 -0400 Subject: [PATCH] Simplify LogicWiz code using Hoikas' method --- korman/properties/modifiers/logic.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/korman/properties/modifiers/logic.py b/korman/properties/modifiers/logic.py index 22248cc..3e5f71e 100644 --- a/korman/properties/modifiers/logic.py +++ b/korman/properties/modifiers/logic.py @@ -119,7 +119,7 @@ class PlasmaMaintainersMarker(PlasmaModifierProperties): return True -yeeshapage_pfms = { +yeeshapage_pfm = { "filename": "xYeeshaPages.py", "attribs": ( { 'id': 1, 'type': "ptAttribActivator", 'name': "actClickableBook" }, @@ -154,16 +154,14 @@ class PlasmaYeeshaPage(PlasmaModifierProperties, PlasmaModifierLogicWiz): def logicwiz(self, bo, tree): nodes = tree.nodes - yeeshapage_pfm = yeeshapage_pfms - yeeshapagenode = self._create_python_file_node(tree, yeeshapage_pfm["filename"], yeeshapage_pfm["attribs"]) - self._create_clothing_nodes(bo, tree.nodes, yeeshapagenode) + # Create the Python File node + yeeshapagepynode = self._create_python_file_node(tree, yeeshapage_pfm["filename"], yeeshapage_pfm["attribs"]) - def _create_clothing_nodes(self, page_object, nodes, yeeshapagenode): # Clickable yeeshapageclick = nodes.new("PlasmaClickableNode") yeeshapageclick.value = self.page_object yeeshapageclick.allow_simple = False - yeeshapageclick.link_output(yeeshapagenode, "satisfies", "actClickableBook") + yeeshapageclick.link_output(yeeshapagepynode, "satisfies", "actClickableBook") # Region yeeshapageregion = nodes.new("PlasmaClickableRegionNode") @@ -173,4 +171,4 @@ class PlasmaYeeshaPage(PlasmaModifierProperties, PlasmaModifierLogicWiz): # Page Number yeeshapagenum = nodes.new("PlasmaAttribIntNode") yeeshapagenum.value_int = self.page_number - yeeshapagenum.link_output(yeeshapagenode, "pfm", "PageNumbers") + yeeshapagenum.link_output(yeeshapagepynode, "pfm", "PageNumbers")