samp_sdk/omp/generated/player_menus.rs
1//! `IPlayerMenuData` — generated by `cargo xtask gen-omp` from `Server/Components/Menus/menus.hpp`.
2//! Implemented by `PlayerMenuData` in the server's `Menus`.
3//!
4//! Do not edit: change `xtask/omp-wrappers.toml` or the generator and
5//! regenerate. Slots are clang's layout of the header for each ABI, checked
6//! against the official binaries by `cargo xtask check-abi --generated`.
7
8#![allow(unused_imports)]
9
10use crate::omp::containers::{FlatSet, HybridString, Pair, Span};
11use crate::omp::types::{
12 Colour, GTAQuat, Hours, Microseconds, Milliseconds, Minutes, Seconds, StringView, TimePoint,
13 UID, Vector2, Vector3, Vector4, WorldTimePoint,
14};
15use crate::omp::vtable::{call_vtable_small_struct, opaque, slots, virtual_fns};
16use crate::omp::*;
17
18opaque! {
19 /// Opaque handle for `IPlayerMenuData*`.
20 pub IPlayerMenuData;
21}
22
23/// `PlayerMenuData_UID` in `Server/Components/Menus/menus.hpp`.
24pub const PLAYER_MENUS_UID: UID = 0x01d8e934e9791b99;
25
26/// The player's `IPlayerMenuData`, or null when the component providing it is not loaded.
27///
28/// Found by walking the player's extension map for `PLAYER_MENUS_UID` — the
29/// virtual `getExtension` does not consult that map. `IExtension`
30/// is `IPlayerMenuData`'s first base, so the extension pointer is the interface pointer.
31///
32/// # Safety
33/// `player` must be a live `IPlayer`.
34#[must_use]
35pub unsafe fn player_menus(player: *mut IPlayer) -> *mut IPlayerMenuData {
36 unsafe { extension(player.cast::<u8>(), PLAYER_MENUS_UID) }.cast::<IPlayerMenuData>()
37}
38
39slots! {
40 /// `uint8_t IPlayerMenuData::getMenuID()`
41 SLOT_GET_MENU_ID: usize = 3, 3;
42 /// `void IPlayerMenuData::setMenuID(uint8_t)`
43 SLOT_SET_MENU_ID: usize = 4, 4;
44}
45
46virtual_fns! {
47 /// `uint8_t IPlayerMenuData::getMenuID()`.
48 ///
49 /// # Safety
50 /// `data` must be a live `IPlayerMenuData`.
51 #[must_use]
52 pub fn player_menus_menu_id(data: IPlayerMenuData) -> u8 = [0, SLOT_GET_MENU_ID] or 0;
53
54 /// `void IPlayerMenuData::setMenuID(uint8_t)`.
55 ///
56 /// # Safety
57 /// `data` must be a live `IPlayerMenuData`.
58 pub fn player_menus_set_menu_id(data: IPlayerMenuData, id: u8) = [0, SLOT_SET_MENU_ID];
59}