Browse Source

Bugfix: Programatically changing selected element in the list box from script code now works properly

BearishSun 7 years ago
parent
commit
f64ca53afa
1 changed files with 2 additions and 7 deletions
  1. 2 7
      Source/SBansheeEditor/Wrappers/GUI/BsScriptGUIListBoxField.cpp

+ 2 - 7
Source/SBansheeEditor/Wrappers/GUI/BsScriptGUIListBoxField.cpp

@@ -106,13 +106,8 @@ namespace bs
 		if (index >= numElements)
 			return;
 
-		for (UINT32 i = 0; i < numElements; i++)
-		{
-			if (states[i])
-				states[i] = true;
-			else
-				states[i] = false;
-		}
+		std::fill(states.begin(), states.end(), false);
+		states[index] = true;
 
 		field->setElementStates(states);
 	}