GuiReady: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
Gets triggered when RAGE.Ui.DefaultWindow gets loaded and ready. | Gets triggered when RAGE.Ui.DefaultWindow gets loaded and ready. | ||
{{ | |||
{{ClientsideCsJsEvent}} | |||
{{CSharpContainer| | {{CSharpContainer| | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="csharp"> | ||
public delegate void OnGuiReadyDelegate(); | public delegate void OnGuiReadyDelegate(); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Parameters}} | {{Parameters}} | ||
''This event requires no parameters'' | |||
{{Example}} | {{Example}} | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="csharp"> | ||
Events.OnGuiReady += OnGuiReady; | Events.OnGuiReady += OnGuiReady; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="csharp"> | ||
public void OnGuiReady() | public void OnGuiReady() | ||
{ | { | ||
| Line 19: | Line 22: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} | ||
{{JSContainer| | |||
<syntaxhighlight lang="javascript"> | |||
mp.events.add("guiReady", eventHandler); | |||
</syntaxhighlight> | |||
'''eventHandler''' is a function | |||
{{Parameters}} | |||
''This event requires no parameters'' | |||
}} | |||
{{Example}} | |||
<syntaxhighlight lang="javascript"> | |||
mp.events.add("guiReady", () => { | |||
mp.gui.chat.push("GUI Ready"); | |||
}); | |||
</syntaxhighlight> | |||
}} | |||
[[Category:Client-side Event]] | |||
Revision as of 14:13, 24 May 2019
Gets triggered when RAGE.Ui.DefaultWindow gets loaded and ready.
Client-Side Event
C# Syntax
public delegate void OnGuiReadyDelegate();
Parameters
This event requires no parameters
Example
Events.OnGuiReady += OnGuiReady;
public void OnGuiReady()
{
RAGE.Chat.Output("Default window ready");
}
JavaScript Syntax
mp.events.add("guiReady", eventHandler);
eventHandler is a function
Parameters
This event requires no parameters
Example
mp.events.add("guiReady", () => {
mp.gui.chat.push("GUI Ready");
});
}}