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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//! `IPlayerTextLabelData` — generated by `cargo xtask gen-omp` from `Server/Components/TextLabels/textlabels.hpp`.
//! Implemented by `PlayerTextLabelData` in the server's `TextLabels`.
//!
//! 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 `IPlayerTextLabelData*`.
pub IPlayerTextLabelData;
}
/// `PlayerTextLabelData_UID` in `Server/Components/TextLabels/textlabels.hpp`.
pub const PLAYER_TEXTLABELS_UID: UID = 0xb9e2bd0dc5148c3c;
/// The player's `IPlayerTextLabelData`, or null when the component providing it is not loaded.
///
/// Found by walking the player's extension map for `PLAYER_TEXTLABELS_UID` — the
/// virtual `getExtension` does not consult that map. `IExtension`
/// is `IPlayerTextLabelData`'s first base, so the extension pointer is the interface pointer.
///
/// # Safety
/// `player` must be a live `IPlayer`.
#[must_use]
pub unsafe fn player_textlabels(player: *mut IPlayer) -> *mut IPlayerTextLabelData {
unsafe { extension(player.cast::<u8>(), PLAYER_TEXTLABELS_UID) }.cast::<IPlayerTextLabelData>()
}
slots! {
/// `IPlayerTextLabel * IPlayerTextLabelData::create(StringView, Colour, Vector3, float, bool)`
SLOT_CREATE: usize = 3, 5;
/// `IPlayerTextLabel * IPlayerTextLabelData::create(StringView, Colour, Vector3, float, bool, IPlayer &)`
SLOT_CREATE_ON_PLAYER: usize = 4, 4;
/// `IPlayerTextLabel * IPlayerTextLabelData::create(StringView, Colour, Vector3, float, bool, IVehicle &)`
SLOT_CREATE_ON_VEHICLE: usize = 5, 3;
}
virtual_fns! {
/// `IPlayerTextLabel * IPlayerTextLabelData::create(StringView, Colour, Vector3, float, bool)`.
///
/// # Safety
/// `data` must be a live `IPlayerTextLabelData`.
#[must_use]
pub fn player_textlabels_create(
data: IPlayerTextLabelData,
text: StringView,
colour: Colour,
pos: Vector3,
draw_dist: f32,
los: bool,
) -> *mut IPlayerTextLabel = [0, SLOT_CREATE] or std::ptr::null_mut();
/// `IPlayerTextLabel * IPlayerTextLabelData::create(StringView, Colour, Vector3, float, bool, IPlayer &)`.
///
/// # Safety
/// `data` must be a live `IPlayerTextLabelData`.
#[must_use]
pub fn player_textlabels_create_on_player(
data: IPlayerTextLabelData,
text: StringView,
colour: Colour,
pos: Vector3,
draw_dist: f32,
los: bool,
attach: *mut IPlayer,
) -> *mut IPlayerTextLabel = [0, SLOT_CREATE_ON_PLAYER] or std::ptr::null_mut();
/// `IPlayerTextLabel * IPlayerTextLabelData::create(StringView, Colour, Vector3, float, bool, IVehicle &)`.
///
/// # Safety
/// `data` must be a live `IPlayerTextLabelData`.
#[must_use]
pub fn player_textlabels_create_on_vehicle(
data: IPlayerTextLabelData,
text: StringView,
colour: Colour,
pos: Vector3,
draw_dist: f32,
los: bool,
attach: *mut IVehicle,
) -> *mut IPlayerTextLabel = [0, SLOT_CREATE_ON_VEHICLE] or std::ptr::null_mut();
}