Browse Source

Add Type selector for postable or visitor imager

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

24
korman/properties/modifiers/logic.py

@ -189,6 +189,11 @@ class PlasmaImager(PlasmaModifierProperties, PlasmaModifierLogicWiz):
description="Texture slot used for the imager.",
type=bpy.types.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)",
description="Activation region for postable imager.",
options=set(),
@ -246,7 +251,7 @@ class PlasmaImager(PlasmaModifierProperties, PlasmaModifierLogicWiz):
imagertext.link_output(imagernode, "pfm", "ImagerMap")
# Region Object if we want one
if self.imager_region:
if self.imager_region and self.imager_type == "POSTABLE":
imagerregion = nodes.new("PlasmaVolumeSensorNode")
imagerregion.region_object = self.imager_region
for i in imagerregion.inputs:
@ -260,7 +265,10 @@ class PlasmaImager(PlasmaModifierProperties, PlasmaModifierLogicWiz):
# Members only?
imagermember = nodes.new("PlasmaAttribBoolNode")
imagermember.value = self.imager_membersonly
if self.imager_type == "POSTABLE":
imagermember.value = self.imager_membersonly
else:
imagermember.value = True
imagermember.link_output(imagernode, "pfm", "ImagerMembersOnly")
# Imager Mesh Object
@ -274,16 +282,20 @@ class PlasmaImager(PlasmaModifierProperties, PlasmaModifierLogicWiz):
imagermax.link_output(imagernode, "pfm", "ImagerMax")
# Optional SDL placeholder (needed?)
imagersdl = nodes.new("PlasmaAttribStringNode")
imagersdl.link_output(imagernode, "pfm", "ImagerInboxVariable")
if self.imager_type == "POSTABLE":
imagersdl = nodes.new("PlasmaAttribStringNode")
imagersdl.link_output(imagernode, "pfm", "ImagerInboxVariable")
# Pellet Imager?
imagerpellet = nodes.new("PlasmaAttribBoolNode")
imagerpellet.value = self.imager_pellets
if self.imager_type == "POSTABLE":
imagerpellet.value = self.imager_pellets
else:
imagerpellet.value = False
imagerpellet.link_output(imagernode, "pfm", "ImagerPelletUpload")
# 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.target_object = self.imager_clueobject
imagerclueobj.link_output(imagernode, "pfm", "ImagerClueObject")

19
korman/ui/modifiers/logic.py

@ -45,16 +45,13 @@ def maintainersmarker(modifier, layout, context):
def imager(modifier, layout, context):
layout.prop(modifier, "imager_object")
if modifier.imager_object:
layout.prop(modifier, "imager_material")
if modifier.imager_material is not None:
layout.prop(modifier, "imager_texture")
else:
layout.label(text="Choose a Material Slot")
if modifier.imager_material and modifier.imager_texture:
layout.prop(modifier, "imager_name")
layout.prop(modifier, "imager_material")
layout.prop(modifier, "imager_texture")
if modifier.imager_material and modifier.imager_texture:
layout.prop(modifier, "imager_name")
layout.prop(modifier, "imager_type")
if modifier.imager_type == "POSTABLE":
layout.separator()
layout.label(text="For Postable Imagers:")
layout.prop(modifier, "imager_region")
split = layout.split()
col = split.column()
@ -75,8 +72,4 @@ def imager(modifier, layout, context):
col = split.column()
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