Struct UI

Source
#[repr(C)]
pub struct UI {
Show 24 fields pub __base: [u8; 8], pub __base1: BSTEventSource<MenuOpenCloseEvent>, pub __base2: BSTEventSource<MenuModeChangeEvent>, pub __base3: BSTEventSource<*mut c_void>, pub menuStack: BSTArray<GPtr<IMenu>>, pub menuMap: BSTHashMap<BSFixedString, UIMenuEntry>, pub processMessagesLock: BSSpinLock, pub numPausesGame: u32, pub numItemMenus: u32, pub numDisablePauseMenu: u32, pub numAllowSaving: u32, pub numDontHideCursorWhenTopmost: u32, pub numCustomRendering: u32, pub numApplicationMenus: u32, pub modal: bool, pub pad17D: u8, pub pad17E: u16, pub uiTimer: BSTimer, pub menuSystemVisible: bool, pub closingAllMenus: bool, pub pad1C2: u16, pub pad1C4: u32, pub unk1C8: u32, pub unk1CA: u32,
}

Fields§

§__base: [u8; 8]§__base1: BSTEventSource<MenuOpenCloseEvent>§__base2: BSTEventSource<MenuModeChangeEvent>§__base3: BSTEventSource<*mut c_void>§menuStack: BSTArray<GPtr<IMenu>>§menuMap: BSTHashMap<BSFixedString, UIMenuEntry>§processMessagesLock: BSSpinLock§numPausesGame: u32§numItemMenus: u32§numDisablePauseMenu: u32§numAllowSaving: u32§numDontHideCursorWhenTopmost: u32§numCustomRendering: u32§numApplicationMenus: u32§modal: bool§pad17D: u8§pad17E: u16§uiTimer: BSTimer§menuSystemVisible: bool§closingAllMenus: bool§pad1C2: u16§pad1C4: u32§unk1C8: u32§unk1CA: u32

Implementations§

Source§

impl UI

Source

pub fn get_singleton() -> Option<&'static UI>

Returns a reference to the singleton instance of UI, if available.

Source

pub fn get_singleton_mut() -> Option<&'static mut UI>

Returns a mutable reference to the singleton instance of UI, if available.

Source

pub const fn game_is_paused(&self) -> bool

Returns true if the game is currently paused.

Source

pub fn get_menu(&self, menu_name: &CStr) -> Option<GPtr<IMenu>>

Gets a pointer to the specified menu if it is currently registered.

Source

pub fn get_movie_view(&self, menu_name: &CStr) -> Option<GPtr<GFxMovieView>>

Gets the GFxMovieView associated with the specified menu.

Source

pub const fn is_cursor_hidden_when_topmost(&self) -> bool

Returns true if the cursor should be hidden when this UI is the topmost.

Source

pub const fn is_item_menu_open(&self) -> bool

Returns true if an inventory/item menu is currently open.

Source

pub fn is_menu_open(&self, menu_name: &CStr) -> bool

Checks whether a given menu is currently open and on the stack.

Source

pub const fn is_modal_menu_open(&self) -> bool

Returns true if any modal menu is currently open.

Source

pub const fn is_pause_menu_disabled(&self) -> bool

Returns true if the pause menu is currently disabled.

Source

pub const fn is_saving_allowed(&self) -> bool

Returns true if saving the game is currently allowed.

Source

pub const fn is_showing_menus(&self) -> bool

Returns true if the menu system is currently being displayed.

Source

pub const fn is_using_custom_rendering(&self) -> bool

Returns true if custom rendering is being used for menus.

Source

pub fn register(&mut self, menu_name: &CStr, creator: fn() -> *mut IMenu)

Registers a new menu with the UI system.

Source

pub const fn show_menus(&mut self, show: bool)

Sets whether the UI system should be visible.

Source

pub fn get_menu_by_name<T>(&self, name: &CStr) -> Option<GPtr<T>>
where T: RefCounted,

Source

pub fn get_menu_as<T>(&self) -> Option<GPtr<T>>

Source§

impl UI

Trait Implementations§

Source§

impl Debug for UI

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for UI

§

impl RefUnwindSafe for UI

§

impl !Send for UI

§

impl !Sync for UI

§

impl Unpin for UI

§

impl UnwindSafe for UI

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more