rust-samp-sdk 3.6.0

Low-level FFI bindings for the SA-MP AMX virtual machine and open.mp native component ABI. Used internally by `rust-samp`; depend on it directly only if you need raw access without the higher-level macros and lifecycle.
Documentation
//! `IPlayerDialogData` — generated by `cargo xtask gen-omp` from `Server/Components/Dialogs/dialogs.hpp`.
//! Implemented by `PlayerDialogData` in the server's `Dialogs`.
//!
//! 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 `IPlayerDialogData*`.
    pub IPlayerDialogData;
}

/// `DialogData_UID` in `Server/Components/Dialogs/dialogs.hpp`.
pub const PLAYER_DIALOGS_UID: UID = 0xbc03376aa3591a11;

/// The player's `IPlayerDialogData`, or null when the component providing it is not loaded.
///
/// Found by walking the player's extension map for `PLAYER_DIALOGS_UID` — the
/// virtual `getExtension` does not consult that map. `IExtension`
/// is `IPlayerDialogData`'s first base, so the extension pointer is the interface pointer.
///
/// # Safety
/// `player` must be a live `IPlayer`.
#[must_use]
pub unsafe fn player_dialogs(player: *mut IPlayer) -> *mut IPlayerDialogData {
    unsafe { extension(player.cast::<u8>(), PLAYER_DIALOGS_UID) }.cast::<IPlayerDialogData>()
}

slots! {
    /// `void IPlayerDialogData::hide(IPlayer &)`
    SLOT_HIDE: usize = 3, 3;
    /// `void IPlayerDialogData::show(IPlayer &, int, DialogStyle, StringView, StringView, StringView, StringView)`
    SLOT_SHOW: usize = 4, 4;
    /// `void IPlayerDialogData::get(int &, DialogStyle &, StringView &, StringView &, StringView &, StringView &)`
    SLOT_GET: usize = 5, 5;
    /// `int IPlayerDialogData::getActiveID()`
    SLOT_GET_ACTIVE_ID: usize = 6, 6;
}

virtual_fns! {
    /// `void IPlayerDialogData::hide(IPlayer &)`.
    ///
    /// # Safety
    /// `data` must be a live `IPlayerDialogData`.
    pub fn player_dialogs_hide(data: IPlayerDialogData, player: *mut IPlayer) = [0, SLOT_HIDE];

    /// `void IPlayerDialogData::show(IPlayer &, int, DialogStyle, StringView, StringView, StringView, StringView)`.
    ///
    /// # Safety
    /// `data` must be a live `IPlayerDialogData`.
    pub fn player_dialogs_show(
        data: IPlayerDialogData,
        player: *mut IPlayer,
        id: i32,
        style: i32,
        title: StringView,
        body: StringView,
        button1: StringView,
        button2: StringView,
    ) = [0, SLOT_SHOW];

    /// `void IPlayerDialogData::get(int &, DialogStyle &, StringView &, StringView &, StringView &, StringView &)`.
    ///
    /// # Safety
    /// `data` must be a live `IPlayerDialogData`.
    pub fn player_dialogs_get(
        data: IPlayerDialogData,
        id: &mut i32,
        style: &mut i32,
        title: &mut StringView,
        body: &mut StringView,
        button1: &mut StringView,
        button2: &mut StringView,
    ) = [0, SLOT_GET];

    /// `int IPlayerDialogData::getActiveID()`.
    ///
    /// # Safety
    /// `data` must be a live `IPlayerDialogData`.
    #[must_use]
    pub fn player_dialogs_active_id(data: IPlayerDialogData) -> i32 = [0, SLOT_GET_ACTIVE_ID] or 0;
}