omp-gdk 2.1.0

Rust SDK for developing open.mp gamemodes
Documentation
use omp_codegen::native;
use std::ffi::c_void;

use crate::players::Player;

use super::{PlayerTextDraw, TextDraw};

native!(TextDraw_Create, x: f32, y: f32, text: str, id: mut i32, -> struct TextDraw);
native!(TextDraw_Destroy, textdraw: struct TextDraw, -> bool);
native!(TextDraw_FromID, textdrawid: i32, -> struct TextDraw);
native!(TextDraw_GetID, textdraw: struct TextDraw, -> i32);
native!(TextDraw_IsValid, textdraw: struct TextDraw, -> bool);
native!(TextDraw_IsVisibleForPlayer, player: struct Player, textdraw: struct TextDraw, -> bool);
native!(TextDraw_SetLetterSize, textdraw: struct TextDraw, sizeX: f32, sizeY: f32, -> bool);
native!(TextDraw_SetTextSize, textdraw: struct TextDraw, sizeX: f32, sizeY: f32, -> bool);
native!(TextDraw_SetAlignment, textdraw: struct TextDraw, alignment: i32, -> bool);
native!(TextDraw_SetColor, textdraw: struct TextDraw, color: u32, -> bool);
native!(TextDraw_SetUseBox, textdraw: struct TextDraw, use_box: bool, -> bool);
native!(TextDraw_SetBoxColor, textdraw: struct TextDraw, color: u32, -> bool);
native!(TextDraw_SetShadow, textdraw: struct TextDraw, size: i32, -> bool);
native!(TextDraw_SetOutline, textdraw: struct TextDraw, size: i32, -> bool);
native!(TextDraw_SetBackgroundColor, textdraw: struct TextDraw, color: u32, -> bool);
native!(TextDraw_SetFont, textdraw: struct TextDraw, font: i32, -> bool);
native!(TextDraw_SetSetProportional, textdraw: struct TextDraw, set: bool, -> bool);
native!(TextDraw_SetSelectable, textdraw: struct TextDraw, set: bool, -> bool);
native!(TextDraw_ShowForPlayer, player: struct Player, textdraw: struct TextDraw, -> bool);
native!(TextDraw_HideForPlayer, player: struct Player, textdraw: struct TextDraw, -> bool);
native!(TextDraw_ShowForAll, textdraw: struct TextDraw, -> bool);
native!(TextDraw_HideForAll, textdraw: struct TextDraw, -> bool);
native!(TextDraw_SetString, textdraw: struct TextDraw, text: str, -> bool);
native!(TextDraw_SetPreviewModel, textdraw: struct TextDraw, model: i32, -> bool);
native!(TextDraw_SetPreviewRot, textdraw: struct TextDraw, rotationX: f32, rotationY: f32, rotationZ: f32, zoom: f32, -> bool);
native!(TextDraw_SetPreviewVehCol, textdraw: struct TextDraw, color1: i32, color2: i32, -> bool);
native!(TextDraw_SetPos, textdraw: struct TextDraw, x: f32, y: f32, -> bool);
native!(TextDraw_GetString, textdraw: struct TextDraw, text: mut str, text_len: usize, -> bool);
native!(TextDraw_GetLetterSize, textdraw: struct TextDraw, sizeX: mut f32, sizeY: mut f32, -> bool);
native!(TextDraw_GetTextSize, textdraw: struct TextDraw, sizeX: mut f32, sizeY: mut f32, -> bool);
native!(TextDraw_GetPos, textdraw: struct TextDraw, x: mut f32, y: mut f32, -> bool);
native!(TextDraw_GetColor, textdraw: struct TextDraw, -> i32);
native!(TextDraw_GetBoxColor, textdraw: struct TextDraw, -> i32);
native!(TextDraw_GetBackgroundColor, textdraw: struct TextDraw, -> i32);
native!(TextDraw_GetShadow, textdraw: struct TextDraw, -> i32);
native!(TextDraw_GetOutline, textdraw: struct TextDraw, -> i32);
native!(TextDraw_GetFont, textdraw: struct TextDraw, -> i32);
native!(TextDraw_IsBox, textdraw: struct TextDraw, -> bool);
native!(TextDraw_IsProportional, textdraw: struct TextDraw, -> bool);
native!(TextDraw_IsSelectable, textdraw: struct TextDraw, -> bool);
native!(TextDraw_GetAlignment, textdraw: struct TextDraw, -> i32);
native!(TextDraw_GetPreviewModel, textdraw: struct TextDraw, -> i32);
native!(TextDraw_GetPreviewRot, textdraw: struct TextDraw, x: mut f32, y: mut f32, z: mut f32, zoom: mut f32, -> bool);
native!(TextDraw_GetPreviewVehColor, textdraw: struct TextDraw, color1: mut i32, color2: mut i32, -> bool);
native!(TextDraw_SetStringForPlayer, textdraw: struct TextDraw, player: struct Player, text: str, -> bool);

// player textdraws

native!(PlayerTextDraw_Create, player: struct Player, x: f32, y: f32, text: str, id: mut i32, -> struct PlayerTextDraw);
native!(PlayerTextDraw_Destroy, player: struct Player, textdraw: struct PlayerTextDraw, -> bool);
native!(PlayerTextDraw_FromID, player: struct Player, textdrawid: i32, -> struct PlayerTextDraw);
native!(PlayerTextDraw_GetID, player: struct Player, textdraw: struct PlayerTextDraw, -> i32);
native!(PlayerTextDraw_IsValid, player: struct Player, textdraw: struct PlayerTextDraw, -> bool);
native!(PlayerTextDraw_IsVisible, player: struct Player, textdraw: struct PlayerTextDraw, -> bool);
native!(PlayerTextDraw_SetLetterSize, player: struct Player, textdraw: struct PlayerTextDraw, x: f32, y: f32, -> bool);
native!(PlayerTextDraw_SetTextSize, player: struct Player, textdraw: struct PlayerTextDraw, x: f32, y: f32, -> bool);
native!(PlayerTextDraw_SetAlignment, player: struct Player, textdraw: struct PlayerTextDraw, alignment: i32, -> bool);
native!(PlayerTextDraw_SetColor, player: struct Player, textdraw: struct PlayerTextDraw, color: u32, -> bool);
native!(PlayerTextDraw_UseBox, player: struct Player, textdraw: struct PlayerTextDraw, use_box: bool, -> bool);
native!(PlayerTextDraw_SetBoxColor, player: struct Player, textdraw: struct PlayerTextDraw, color: u32, -> bool);
native!(PlayerTextDraw_SetShadow, player: struct Player, textdraw: struct PlayerTextDraw, size: i32, -> bool);
native!(PlayerTextDraw_SetOutline, player: struct Player, textdraw: struct PlayerTextDraw, size: i32, -> bool);
native!(PlayerTextDraw_SetBackgroundColor, player: struct Player, textdraw: struct PlayerTextDraw, color: u32, -> bool);
native!(PlayerTextDraw_SetFont, player: struct Player, textdraw: struct PlayerTextDraw, font: i32, -> bool);
native!(PlayerTextDraw_SetProportional, player: struct Player, textdraw: struct PlayerTextDraw, set: bool, -> bool);
native!(PlayerTextDraw_SetSelectable, player: struct Player, textdraw: struct PlayerTextDraw, set: bool, -> bool);
native!(PlayerTextDraw_Show, player: struct Player, textdraw: struct PlayerTextDraw, -> bool);
native!(PlayerTextDraw_Hide, player: struct Player, textdraw: struct PlayerTextDraw, -> bool);
native!(PlayerTextDraw_SetString, player: struct Player, textdraw: struct PlayerTextDraw, text: str, -> bool);
native!(PlayerTextDraw_SetPreviewModel, player: struct Player, textdraw: struct PlayerTextDraw, model: i32, -> bool);
native!(PlayerTextDraw_SetPreviewRot, player: struct Player, textdraw: struct PlayerTextDraw, rx: f32, ry: f32, rz: f32, zoom: f32, -> bool);
native!(PlayerTextDraw_SetPreviewVehCol, player: struct Player, textdraw: struct PlayerTextDraw, color1: i32, color2: i32, -> bool);
native!(PlayerTextDraw_SetPos, player: struct Player, textdraw: struct PlayerTextDraw, x: f32, y: f32, -> bool);
native!(PlayerTextDraw_GetString, player: struct Player, textdraw: struct PlayerTextDraw, text: mut str, text_len: usize, -> bool);
native!(PlayerTextDraw_GetLetterSize, player: struct Player, textdraw: struct PlayerTextDraw, x: mut f32, y: mut f32, -> bool);
native!(PlayerTextDraw_GetTextSize, player: struct Player, textdraw: struct PlayerTextDraw, x: mut f32, y: mut f32, -> bool);
native!(PlayerTextDraw_GetPos, player: struct Player, textdraw: struct PlayerTextDraw, x: mut f32, y: mut f32, -> bool);
native!(PlayerTextDraw_GetColor, player: struct Player, textdraw: struct PlayerTextDraw, -> i32);
native!(PlayerTextDraw_GetBoxColor, player: struct Player, textdraw: struct PlayerTextDraw, -> i32);
native!(PlayerTextDraw_GetBackgroundColor, player: struct Player, textdraw: struct PlayerTextDraw, -> i32);
native!(PlayerTextDraw_GetShadow, player: struct Player, textdraw: struct PlayerTextDraw, -> i32);
native!(PlayerTextDraw_GetOutline, player: struct Player, textdraw: struct PlayerTextDraw, -> i32);
native!(PlayerTextDraw_GetFont, player: struct Player, textdraw: struct PlayerTextDraw, -> i32);
native!(PlayerTextDraw_IsBox, player: struct Player, textdraw: struct PlayerTextDraw, -> bool);
native!(PlayerTextDraw_IsProportional, player: struct Player, textdraw: struct PlayerTextDraw, -> bool);
native!(PlayerTextDraw_IsSelectable, player: struct Player, textdraw: struct PlayerTextDraw, -> bool);
native!(PlayerTextDraw_GetAlignment, player: struct Player, textdraw: struct PlayerTextDraw, -> i32);
native!(PlayerTextDraw_GetPreviewModel, player: struct Player, textdraw: struct PlayerTextDraw, -> i32);
native!(PlayerTextDraw_GetPreviewRot, player: struct Player, textdraw: struct PlayerTextDraw, rx: mut f32, ry: mut f32, rz: mut f32, zoom: mut f32, -> bool);
native!(PlayerTextDraw_GetPreviewVehColor, player: struct Player, textdraw: struct PlayerTextDraw, color1: mut i32, color2: mut i32, -> bool);

#[doc(hidden)]
pub fn load_functions() {
    load_function!(TextDraw_Create);
    load_function!(TextDraw_Destroy);
    load_function!(TextDraw_FromID);
    load_function!(TextDraw_GetID);
    load_function!(TextDraw_IsValid);
    load_function!(TextDraw_IsVisibleForPlayer);
    load_function!(TextDraw_SetLetterSize);
    load_function!(TextDraw_SetTextSize);
    load_function!(TextDraw_SetAlignment);
    load_function!(TextDraw_SetColor);
    load_function!(TextDraw_SetUseBox);
    load_function!(TextDraw_SetBoxColor);
    load_function!(TextDraw_SetShadow);
    load_function!(TextDraw_SetOutline);
    load_function!(TextDraw_SetBackgroundColor);
    load_function!(TextDraw_SetFont);
    load_function!(TextDraw_SetSetProportional);
    load_function!(TextDraw_SetSelectable);
    load_function!(TextDraw_ShowForPlayer);
    load_function!(TextDraw_HideForPlayer);
    load_function!(TextDraw_ShowForAll);
    load_function!(TextDraw_HideForAll);
    load_function!(TextDraw_SetString);
    load_function!(TextDraw_SetPreviewModel);
    load_function!(TextDraw_SetPreviewRot);
    load_function!(TextDraw_SetPreviewVehCol);
    load_function!(TextDraw_SetPos);
    load_function!(TextDraw_GetString);
    load_function!(TextDraw_GetLetterSize);
    load_function!(TextDraw_GetTextSize);
    load_function!(TextDraw_GetPos);
    load_function!(TextDraw_GetColor);
    load_function!(TextDraw_GetBoxColor);
    load_function!(TextDraw_GetBackgroundColor);
    load_function!(TextDraw_GetShadow);
    load_function!(TextDraw_GetOutline);
    load_function!(TextDraw_GetFont);
    load_function!(TextDraw_IsBox);
    load_function!(TextDraw_IsProportional);
    load_function!(TextDraw_IsSelectable);
    load_function!(TextDraw_GetAlignment);
    load_function!(TextDraw_GetPreviewModel);
    load_function!(TextDraw_GetPreviewRot);
    load_function!(TextDraw_GetPreviewVehColor);
    load_function!(TextDraw_SetStringForPlayer);

    // player textdraws

    load_function!(PlayerTextDraw_Create);
    load_function!(PlayerTextDraw_Destroy);
    load_function!(PlayerTextDraw_FromID);
    load_function!(PlayerTextDraw_GetID);
    load_function!(PlayerTextDraw_IsValid);
    load_function!(PlayerTextDraw_IsVisible);
    load_function!(PlayerTextDraw_SetLetterSize);
    load_function!(PlayerTextDraw_SetTextSize);
    load_function!(PlayerTextDraw_SetAlignment);
    load_function!(PlayerTextDraw_SetColor);
    load_function!(PlayerTextDraw_UseBox);
    load_function!(PlayerTextDraw_SetBoxColor);
    load_function!(PlayerTextDraw_SetShadow);
    load_function!(PlayerTextDraw_SetOutline);
    load_function!(PlayerTextDraw_SetBackgroundColor);
    load_function!(PlayerTextDraw_SetFont);
    load_function!(PlayerTextDraw_SetProportional);
    load_function!(PlayerTextDraw_SetSelectable);
    load_function!(PlayerTextDraw_Show);
    load_function!(PlayerTextDraw_Hide);
    load_function!(PlayerTextDraw_SetString);
    load_function!(PlayerTextDraw_SetPreviewModel);
    load_function!(PlayerTextDraw_SetPreviewRot);
    load_function!(PlayerTextDraw_SetPreviewVehCol);
    load_function!(PlayerTextDraw_SetPos);
    load_function!(PlayerTextDraw_GetString);
    load_function!(PlayerTextDraw_GetLetterSize);
    load_function!(PlayerTextDraw_GetTextSize);
    load_function!(PlayerTextDraw_GetPos);
    load_function!(PlayerTextDraw_GetColor);
    load_function!(PlayerTextDraw_GetBoxColor);
    load_function!(PlayerTextDraw_GetBackgroundColor);
    load_function!(PlayerTextDraw_GetShadow);
    load_function!(PlayerTextDraw_GetOutline);
    load_function!(PlayerTextDraw_GetFont);
    load_function!(PlayerTextDraw_IsBox);
    load_function!(PlayerTextDraw_IsProportional);
    load_function!(PlayerTextDraw_IsSelectable);
    load_function!(PlayerTextDraw_GetAlignment);
    load_function!(PlayerTextDraw_GetPreviewModel);
    load_function!(PlayerTextDraw_GetPreviewRot);
    load_function!(PlayerTextDraw_GetPreviewVehColor);
}