Skip to content

Commit

Permalink
Simplify LogicWiz code using Hoikas' method
Browse files Browse the repository at this point in the history
  • Loading branch information
DoobesURU committed Oct 19, 2022
1 parent c91abff commit 548970d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions korman/properties/modifiers/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def requires_actor(self):
return True


yeeshapage_pfms = {
yeeshapage_pfm = {
"filename": "xYeeshaPages.py",
"attribs": (
{ 'id': 1, 'type': "ptAttribActivator", 'name': "actClickableBook" },
Expand Down Expand Up @@ -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")
Expand All @@ -173,4 +171,4 @@ def _create_clothing_nodes(self, page_object, nodes, yeeshapagenode):
# Page Number
yeeshapagenum = nodes.new("PlasmaAttribIntNode")
yeeshapagenum.value_int = self.page_number
yeeshapagenum.link_output(yeeshapagenode, "pfm", "PageNumbers")
yeeshapagenum.link_output(yeeshapagepynode, "pfm", "PageNumbers")

0 comments on commit 548970d

Please sign in to comment.