(svn r24317) -Feature: Add dropdowns to AI configurations, if all values have labels.
This commit is contained in:
@@ -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.
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user