mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2024-12-22 20:17:24 +08:00
add show_success lua binding (#3249)
This commit is contained in:
parent
1f32884af8
commit
1b25bdc866
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Table containing functions for modifying the menu GUI.
|
Table containing functions for modifying the menu GUI.
|
||||||
|
|
||||||
## Functions (7)
|
## Functions (8)
|
||||||
|
|
||||||
### `get_tab(tab_name)`
|
### `get_tab(tab_name)`
|
||||||
|
|
||||||
@ -30,6 +30,19 @@ tab = gui.get_tab(tab_name)
|
|||||||
tab = gui.add_tab(tab_name)
|
tab = gui.add_tab(tab_name)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `show_success(title, message)`
|
||||||
|
|
||||||
|
Shows a success to the user with the given title and message.
|
||||||
|
|
||||||
|
- **Parameters:**
|
||||||
|
- `title` (string)
|
||||||
|
- `message` (string)
|
||||||
|
|
||||||
|
**Example Usage:**
|
||||||
|
```lua
|
||||||
|
gui.show_success(title, message)
|
||||||
|
```
|
||||||
|
|
||||||
### `show_message(title, message)`
|
### `show_message(title, message)`
|
||||||
|
|
||||||
Shows a message to the user with the given title and message.
|
Shows a message to the user with the given title and message.
|
||||||
|
@ -243,6 +243,17 @@ namespace lua::gui
|
|||||||
return new_tab;
|
return new_tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Lua API: Function
|
||||||
|
// Table: gui
|
||||||
|
// Name: show_success
|
||||||
|
// Param: title: string
|
||||||
|
// Param: message: string
|
||||||
|
// Shows a success to the user with the given title and message.
|
||||||
|
static void show_success(const std::string& title, const std::string& message)
|
||||||
|
{
|
||||||
|
big::g_notification_service.push_success(title, message);
|
||||||
|
}
|
||||||
|
|
||||||
// Lua API: Function
|
// Lua API: Function
|
||||||
// Table: gui
|
// Table: gui
|
||||||
// Name: show_message
|
// Name: show_message
|
||||||
@ -317,6 +328,7 @@ namespace lua::gui
|
|||||||
auto ns = state["gui"].get_or_create<sol::table>();
|
auto ns = state["gui"].get_or_create<sol::table>();
|
||||||
ns["get_tab"] = get_tab;
|
ns["get_tab"] = get_tab;
|
||||||
ns["add_tab"] = add_tab;
|
ns["add_tab"] = add_tab;
|
||||||
|
ns["show_success"] = show_success;
|
||||||
ns["show_message"] = show_message;
|
ns["show_message"] = show_message;
|
||||||
ns["show_warning"] = show_warning;
|
ns["show_warning"] = show_warning;
|
||||||
ns["show_error"] = show_error;
|
ns["show_error"] = show_error;
|
||||||
|
Loading…
Reference in New Issue
Block a user