Explorar o código

Merge remote-tracking branch 'upstream/development' into development

marauder2k7 %!s(int64=4) %!d(string=hai) anos
pai
achega
e62ea6517e

+ 3 - 0
engine/source/gui/buttons/guiDropDownCtrl.cc

@@ -50,6 +50,9 @@ void GuiDropDownListBoxCtrl::addSelection(LBItem *item, S32 index)
 {
 	Parent::addSelection(item, index);
 
+	if (mConsoleCommand[0])
+		Con::evaluate(mConsoleCommand, false);
+
 	mDropDownCtrl->closeDropDown();
 }
 #pragma endregion

+ 8 - 0
engine/source/gui/buttons/guiDropDownCtrl_ScriptBinding.h

@@ -338,6 +338,14 @@ ConsoleMethodWithDocs(GuiDropDownCtrl, getItemText, ConsoleString, 3, 3, "(S32 i
 	return object->getList()->getItemText(dAtoi(argv[2]));
 }
 
+/*! Returns the text of the selected item.
+	@return The text of the selected item.
+*/
+ConsoleMethodWithDocs(GuiDropDownCtrl, getText, ConsoleString, 3, 3, "()")
+{
+	return object->getList()->getItemText(object->getList()->getSelectedItem());
+}
+
 /*! Sets the text of the item at the given item index.
 	@param index The zero-based index of the item that will be updated.
 	@param text The text value to update with.