GuiReady: Difference between revisions
(Created page with "{{ClientsideCsEvent}}") |
mNo edit summary |
||
| (5 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
{{ | Gets triggered when RAGE.Ui.DefaultWindow gets loaded and ready. | ||
{{ClientsideCsJsEvent}} | |||
{{CSharpContainer| | |||
<syntaxhighlight lang="csharp"> | |||
public delegate void OnGuiReadyDelegate(); | |||
</syntaxhighlight> | |||
{{Parameters}} | |||
''This event requires no parameters'' | |||
{{Example}} | |||
<syntaxhighlight lang="csharp"> | |||
Events.OnGuiReady += OnGuiReady; | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="csharp"> | |||
public void OnGuiReady() | |||
{ | |||
RAGE.Chat.Output("Default window ready"); | |||
} | |||
</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]] | |||
Latest 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");
});