Kategorie: GUI
Ab Engineversion: 7.0 OC
GuiAction_Call
Beschreibung
Action for a GUI window event such as OnClick. The function that will be called will get the "value" parameter as the first parameter. Additional parameters are: player, gui_id, subwindow_id, target.
Syntax
array GuiAction_Call(proplist target, string function, any value);
Parameter
- target:
- The target object or definition that the callback will be called on.
- function:
- The name of the function that will be called.
- value:
- A custom parameter value that will be passed to your function. If you need more custom values, use an array or a proplist.
Anmerkung
See the GUI documentation for further explanations.
Beispiel
func Initialize() { var menu = { BackgroundColor = RGB(255, 0, 0), OnClick = GuiAction_Call(this, "DoTheScream", nil) }; var menuID = GuiOpen(menu); } func DoTheScream(data, int player, int gui_id, int subwindow_id, object target) { Sound("Scream"); }
Defines a new GUI window that screams when you click it. This could be a scenario script.