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