From 8b9846d712846b5e350ee80ba58dfea6e6074057 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sun, 17 Jun 2018 21:02:42 -0400 Subject: [PATCH] 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. --- korman/properties/prop_world.py | 1 - korman/ui/ui_world.py | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/korman/properties/prop_world.py b/korman/properties/prop_world.py index fdcfb95..5e4308d 100644 --- a/korman/properties/prop_world.py +++ b/korman/properties/prop_world.py @@ -193,7 +193,6 @@ class PlasmaAge(bpy.types.PropertyGroup): default=True) age_name = StringProperty(name="Age Name", description="Name of the Age to be used for data files", - default="Korman Age", options=set()) # Implementation details diff --git a/korman/ui/ui_world.py b/korman/ui/ui_world.py index 695449c..6452855 100644 --- a/korman/ui/ui_world.py +++ b/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.filepath = active_game.path op.game_index = active_game_index + row = row.row(align=True) row.operator_context = "EXEC_DEFAULT" + row.enabled = bool(age.age_name.strip()) op = row.operator("export.plasma_age", icon="EXPORT") 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.label("Age Settings:") col.prop(age, "seq_prefix", text="ID") + col.alert = not age.age_name.strip() col.prop(age, "age_name", text="") layout.separator()