summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
Diffstat (limited to 'src/script')
-rw-r--r--src/script/script_config.hpp1
-rw-r--r--src/script/script_info.cpp9
2 files changed, 10 insertions, 0 deletions
diff --git a/src/script/script_config.hpp b/src/script/script_config.hpp
index 9ae6fba70..23822de88 100644
--- a/src/script/script_config.hpp
+++ b/src/script/script_config.hpp
@@ -44,6 +44,7 @@ struct ScriptConfigItem {
int step_size; ///< The step size in the gui.
ScriptConfigFlags flags; ///< Flags for the configuration setting.
LabelMapping *labels; ///< Text labels for the integer values.
+ bool complete_labels; ///< True if all values have a label.
};
typedef std::list<ScriptConfigItem> ScriptConfigItemList; ///< List of ScriptConfig items.
diff --git a/src/script/script_info.cpp b/src/script/script_info.cpp
index 779236ebc..b5a83ccb2 100644
--- a/src/script/script_info.cpp
+++ b/src/script/script_info.cpp
@@ -263,6 +263,15 @@ SQInteger ScriptInfo::AddLabels(HSQUIRRELVM vm)
}
sq_pop(vm, 1);
+ /* Check labels for completeness */
+ config->complete_labels = true;
+ for (int value = config->min_value; value <= config->max_value; value++) {
+ if (!config->labels->Contains(value)) {
+ config->complete_labels = false;
+ break;
+ }
+ }
+
return 0;
}