Browse Source

Add Type selector for postable or visitor imager

pull/348/head
Patrick Dulebohn 2 years ago
parent
commit
5fc00dcdf0
  1. 16
      korman/properties/modifiers/logic.py
  2. 11
      korman/ui/modifiers/logic.py

16
korman/properties/modifiers/logic.py

@ -189,6 +189,11 @@ class PlasmaImager(PlasmaModifierProperties, PlasmaModifierLogicWiz):
description="Texture slot used for the imager.", description="Texture slot used for the imager.",
type=bpy.types.Texture, type=bpy.types.Texture,
poll=_poll_texture) poll=_poll_texture)
imager_type = EnumProperty(name="Imager Type",
description="Type of imager object will be.",
items=[("POSTABLE", "Postable", "Imager to post pictures and text."),
("VISITOR", "Visitor", "Imager to display visitors to your Age.")],
options=set())
imager_region = PointerProperty(name="Imager Region (optional)", imager_region = PointerProperty(name="Imager Region (optional)",
description="Activation region for postable imager.", description="Activation region for postable imager.",
options=set(), options=set(),
@ -246,7 +251,7 @@ class PlasmaImager(PlasmaModifierProperties, PlasmaModifierLogicWiz):
imagertext.link_output(imagernode, "pfm", "ImagerMap") imagertext.link_output(imagernode, "pfm", "ImagerMap")
# Region Object if we want one # Region Object if we want one
if self.imager_region: if self.imager_region and self.imager_type == "POSTABLE":
imagerregion = nodes.new("PlasmaVolumeSensorNode") imagerregion = nodes.new("PlasmaVolumeSensorNode")
imagerregion.region_object = self.imager_region imagerregion.region_object = self.imager_region
for i in imagerregion.inputs: for i in imagerregion.inputs:
@ -260,7 +265,10 @@ class PlasmaImager(PlasmaModifierProperties, PlasmaModifierLogicWiz):
# Members only? # Members only?
imagermember = nodes.new("PlasmaAttribBoolNode") imagermember = nodes.new("PlasmaAttribBoolNode")
if self.imager_type == "POSTABLE":
imagermember.value = self.imager_membersonly imagermember.value = self.imager_membersonly
else:
imagermember.value = True
imagermember.link_output(imagernode, "pfm", "ImagerMembersOnly") imagermember.link_output(imagernode, "pfm", "ImagerMembersOnly")
# Imager Mesh Object # Imager Mesh Object
@ -274,16 +282,20 @@ class PlasmaImager(PlasmaModifierProperties, PlasmaModifierLogicWiz):
imagermax.link_output(imagernode, "pfm", "ImagerMax") imagermax.link_output(imagernode, "pfm", "ImagerMax")
# Optional SDL placeholder (needed?) # Optional SDL placeholder (needed?)
if self.imager_type == "POSTABLE":
imagersdl = nodes.new("PlasmaAttribStringNode") imagersdl = nodes.new("PlasmaAttribStringNode")
imagersdl.link_output(imagernode, "pfm", "ImagerInboxVariable") imagersdl.link_output(imagernode, "pfm", "ImagerInboxVariable")
# Pellet Imager? # Pellet Imager?
imagerpellet = nodes.new("PlasmaAttribBoolNode") imagerpellet = nodes.new("PlasmaAttribBoolNode")
if self.imager_type == "POSTABLE":
imagerpellet.value = self.imager_pellets imagerpellet.value = self.imager_pellets
else:
imagerpellet.value = False
imagerpellet.link_output(imagernode, "pfm", "ImagerPelletUpload") imagerpellet.link_output(imagernode, "pfm", "ImagerPelletUpload")
# Puzzle Imager Object if we have one # Puzzle Imager Object if we have one
if self.imager_clueobject: if self.imager_clueobject and self.imager_type == "POSTABLE":
imagerclueobj = nodes.new("PlasmaAttribObjectNode") imagerclueobj = nodes.new("PlasmaAttribObjectNode")
imagerclueobj.target_object = self.imager_clueobject imagerclueobj.target_object = self.imager_clueobject
imagerclueobj.link_output(imagernode, "pfm", "ImagerClueObject") imagerclueobj.link_output(imagernode, "pfm", "ImagerClueObject")

11
korman/ui/modifiers/logic.py

@ -45,16 +45,13 @@ def maintainersmarker(modifier, layout, context):
def imager(modifier, layout, context): def imager(modifier, layout, context):
layout.prop(modifier, "imager_object") layout.prop(modifier, "imager_object")
if modifier.imager_object:
layout.prop(modifier, "imager_material") layout.prop(modifier, "imager_material")
if modifier.imager_material is not None:
layout.prop(modifier, "imager_texture") layout.prop(modifier, "imager_texture")
else:
layout.label(text="Choose a Material Slot")
if modifier.imager_material and modifier.imager_texture: if modifier.imager_material and modifier.imager_texture:
layout.prop(modifier, "imager_name") layout.prop(modifier, "imager_name")
layout.prop(modifier, "imager_type")
if modifier.imager_type == "POSTABLE":
layout.separator() layout.separator()
layout.label(text="For Postable Imagers:")
layout.prop(modifier, "imager_region") layout.prop(modifier, "imager_region")
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@ -75,8 +72,4 @@ def imager(modifier, layout, context):
col = split.column() col = split.column()
col.prop(modifier, "imager_randomtime") col.prop(modifier, "imager_randomtime")
else:
layout.label(text="Choose a Texture Slot")
else:
layout.label(text="Choose an imager mesh object!", icon="ERROR")

Loading…
Cancel
Save