Merge pull request #57635 from jmb462/fix-template-optionbutton

Fix OptionButton in create script dialog doesn't select the correct template
This commit is contained in:
Rémi Verschelde 2022-02-05 10:18:21 +01:00 committed by GitHub
commit 2e44778cd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -763,10 +763,10 @@ void ScriptCreateDialog::_update_dialog() {
}
ScriptLanguage::ScriptTemplate ScriptCreateDialog::_get_current_template() const {
int selected_id = template_menu->get_selected_id();
int selected_index = template_menu->get_selected();
for (const ScriptLanguage::ScriptTemplate &t : template_list) {
if (is_using_templates) {
if (t.id == selected_id) {
if (t.id == selected_index) {
return t;
}
} else {