Browse Source

Fix some usability issues with age names.

Disallow exporting from the World panel if the age name is blank and
draw attention to it in the UI.
pull/92/head
Adam Johnson 7 years ago
parent
commit
8b9846d712
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 1
      korman/properties/prop_world.py
  2. 3
      korman/ui/ui_world.py

1
korman/properties/prop_world.py

@ -193,7 +193,6 @@ class PlasmaAge(bpy.types.PropertyGroup):
default=True) default=True)
age_name = StringProperty(name="Age Name", age_name = StringProperty(name="Age Name",
description="Name of the Age to be used for data files", description="Name of the Age to be used for data files",
default="Korman Age",
options=set()) options=set())
# Implementation details # Implementation details

3
korman/ui/ui_world.py

@ -60,7 +60,9 @@ class PlasmaGamePanel(AgeButtonsPanel, bpy.types.Panel):
op = row.operator("world.plasma_game_add", icon="FILE_FOLDER", text="Change Path") op = row.operator("world.plasma_game_add", icon="FILE_FOLDER", text="Change Path")
op.filepath = active_game.path op.filepath = active_game.path
op.game_index = active_game_index op.game_index = active_game_index
row = row.row(align=True)
row.operator_context = "EXEC_DEFAULT" row.operator_context = "EXEC_DEFAULT"
row.enabled = bool(age.age_name.strip())
op = row.operator("export.plasma_age", icon="EXPORT") op = row.operator("export.plasma_age", icon="EXPORT")
op.filepath = str((Path(active_game.path) / "dat" / age.age_name).with_suffix(".age")) op.filepath = str((Path(active_game.path) / "dat" / age.age_name).with_suffix(".age"))
@ -121,6 +123,7 @@ class PlasmaAgePanel(AgeButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.label("Age Settings:") col.label("Age Settings:")
col.prop(age, "seq_prefix", text="ID") col.prop(age, "seq_prefix", text="ID")
col.alert = not age.age_name.strip()
col.prop(age, "age_name", text="") col.prop(age, "age_name", text="")
layout.separator() layout.separator()

Loading…
Cancel
Save