Browse Source

Implement suggestions:

- syntax improvements
- merge both EAX presets lists into one

Co-authored-by: Adam Johnson <AdamJohnso@gmail.com>
pull/253/head
Jrius 3 years ago
parent
commit
23d0aeb363
  1. 23
      korman/properties/modifiers/region.py
  2. 2
      korman/properties/modifiers/sound.py
  3. 2
      korman/ui/modifiers/sound.py

23
korman/properties/modifiers/region.py

@ -249,15 +249,7 @@ class PlasmaReverbRegion(PlasmaModifierProperties):
("DRUGGED", "Drugged", ""), ("DRUGGED", "Drugged", ""),
("DIZZY", "Drizzy", ""), ("DIZZY", "Drizzy", ""),
("PSYCHOTIC", "Psychotic", ""), ("PSYCHOTIC", "Psychotic", ""),
("MORE", "More choices...", ""), ("CASTLE_SMALLROOM", "Castle - Small room", ""),
("CUSTOM", "Custom", "Setup your own environment")],
default="GENERIC",
options=set())
# Thicc list for annoying users.
preset_more = EnumProperty(name="More Environment Preset",
description="Some more environment presets for your convenience",
items=[("CASTLE_SMALLROOM", "Castle - Small room", ""),
("CASTLE_SHORTPASSAGE", "Castle - Short passage", ""), ("CASTLE_SHORTPASSAGE", "Castle - Short passage", ""),
("CASTLE_MEDIUMROOM", "Castle - Medium room", ""), ("CASTLE_MEDIUMROOM", "Castle - Medium room", ""),
("CASTLE_LONGPASSAGE", "Castle - Long passage", ""), ("CASTLE_LONGPASSAGE", "Castle - Long passage", ""),
@ -343,8 +335,9 @@ class PlasmaReverbRegion(PlasmaModifierProperties):
("CITY_ABANDONED", "City - Abandoned", ""), ("CITY_ABANDONED", "City - Abandoned", ""),
("DUSTYROOM", "Dusty room", ""), ("DUSTYROOM", "Dusty room", ""),
("CHAPEL", "Chapel", ""), ("CHAPEL", "Chapel", ""),
("SMALLWATERROOM", "Small water room", "")], ("SMALLWATERROOM", "Small water room", ""),
default="OUTDOORS_ROLLINGPLAINS", ("CUSTOM", "Custom", "Setup your own environment")],
default="GENERIC",
options=set()) options=set())
environment_size = FloatProperty(name="Environment Size", description="Environment Size", environment_size = FloatProperty(name="Environment Size", description="Environment Size",
@ -405,10 +398,6 @@ class PlasmaReverbRegion(PlasmaModifierProperties):
default=250.0, min=20.0, max=1000.0, default=250.0, min=20.0, max=1000.0,
options=set()) options=set())
# Room rolloff - always at 0 in all presets, so screw it.
# room_rolloff_factor = FloatProperty(name="Room Rolloff Factor", description="Room Rolloff Factor",
# default=0.0, min=0.0, max=1.0)
flags = EnumProperty(name="Flags", flags = EnumProperty(name="Flags",
description="Reverb flags", description="Reverb flags",
items=reverb_flags, items=reverb_flags,
@ -445,10 +434,8 @@ class PlasmaReverbRegion(PlasmaModifierProperties):
for flag in self.flags: for flag in self.flags:
props.flags |= getattr(EAXReverbProperties, flag) props.flags |= getattr(EAXReverbProperties, flag)
eax_listener.listenerProps = props eax_listener.listenerProps = props
elif self.preset == "MORE":
eax_listener.listenerProps = getattr(EAXReverbProperties, "REVERB_PRESET_" + self.preset_more)
else: else:
eax_listener.listenerProps = getattr(EAXReverbProperties, "REVERB_PRESET_" + self.preset) eax_listener.listenerProps = getattr(EAXReverbProperties, "REVERB_PRESET_{}".format(self.preset))
class PlasmaSoftVolume(idprops.IDPropMixin, PlasmaModifierProperties): class PlasmaSoftVolume(idprops.IDPropMixin, PlasmaModifierProperties):

2
korman/properties/modifiers/sound.py

@ -297,7 +297,7 @@ class PlasmaSound(idprops.IDPropMixin, bpy.types.PropertyGroup):
sound.channel = plWin32Sound.kRightChannel sound.channel = plWin32Sound.kRightChannel
# Reverb/EAX # Reverb/EAX
if self.sfx_type in ("kSoundFX", "kNPCVoices") and self.reverb_amount > 0: if self.sfx_type in {"kSoundFX", "kNPCVoices"} and self.reverb_amount > 0:
eax = sound.eaxSettings eax = sound.eaxSettings
eax.enable = True eax.enable = True
# Occlusion: the minimum is -100 dB (but the value is multiplied by 100 in EAX's API) # Occlusion: the minimum is -100 dB (but the value is multiplied by 100 in EAX's API)

2
korman/ui/modifiers/sound.py

@ -83,7 +83,7 @@ def soundemit(modifier, layout, context):
col.separator() col.separator()
_draw_fade_ui(sound.fade_out, col, "Fade Out:") _draw_fade_ui(sound.fade_out, col, "Fade Out:")
if sound.sfx_type in ("kSoundFX", "kNPCVoices"): if sound.sfx_type in {"kSoundFX", "kNPCVoices"}:
col.separator() col.separator()
col.prop(sound, "reverb_amount", text="Reverb Amount") col.prop(sound, "reverb_amount", text="Reverb Amount")

Loading…
Cancel
Save