Sfoglia il codice sorgente

Update guiControl.cc

Added an active and inactive callback for the GuiControl.
Peter Robinson 4 anni fa
parent
commit
8bb6447454
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      engine/source/gui/guiControl.cc

+ 5 - 0
engine/source/gui/guiControl.cc

@@ -1667,6 +1667,11 @@ void GuiControl::setActive( bool value )
 {
    mActive = value;
 
+   if (value && isMethod("onActive"))
+	   Con::executef(this, 1, "onActive");
+	else if (!value && isMethod("onInactive"))
+		Con::executef(this, 1, "onInactive");
+
    if ( !mActive )
       clearFirstResponder();