Procházet zdrojové kódy

Fix `option_button.cpp` not updating selected when out of bounds

chansoen před 2 měsíci
rodič
revize
cf7e88f6ac
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      scene/gui/option_button.cpp

+ 4 - 0
scene/gui/option_button.cpp

@@ -314,6 +314,10 @@ void OptionButton::set_item_count(int p_count) {
 		return;
 		return;
 	}
 	}
 
 
+	if (current > p_count - 1) {
+		_select(p_count - 1, false);
+	}
+
 	popup->set_item_count(p_count);
 	popup->set_item_count(p_count);
 
 
 	if (p_count > count_old) {
 	if (p_count > count_old) {