App

Struct App 

Source
pub struct App {
    pub config: Config,
    pub app_text: AppText,
    pub rust_constructor_resource: Vec<RCR>,
    pub render_resource_list: Vec<RenderResource>,
    pub problem_list: Vec<Problem>,
    pub vertrefresh: f32,
    pub page: String,
    pub timer: Timer,
    pub frame_times: Vec<f32>,
    pub last_frame_time: Option<f64>,
    pub tray_icon: Option<TrayIcon>,
    pub tray_icon_created: bool,
}
Expand description

程序主体。

Fields§

§config: Config

配置项。

§app_text: AppText

文本。

§rust_constructor_resource: Vec<RCR>

RC资源。

§render_resource_list: Vec<RenderResource>

渲染资源列表。

§problem_list: Vec<Problem>

问题列表。

§vertrefresh: f32

RC资源刷新率。

§page: String

当前页面。

§timer: Timer

计时器。

§frame_times: Vec<f32>

帧时间。

§last_frame_time: Option<f64>

上一帧时间。

§tray_icon: Option<TrayIcon>

托盘图标。

§tray_icon_created: bool

托盘图标是否已创建。

Implementations§

Source§

impl App

Source

pub fn new(config: Config, app_text: AppText) -> Self

初始化程序。

Source

pub fn page_handler(&mut self, ctx: &Context)

整合所有页面需要一次性处理的功能。

Source

pub fn add_page(&mut self, page_data: PageData)

运行时添加新页面。

Source

pub fn switch_page(&mut self, page: &str)

切换页面。

Source

pub fn tray_icon_init( &mut self, icon_path: &str, tooltip: &str, menu: Box<Menu>, )

初始化托盘图标。

Source

pub fn check_resource_exists( &mut self, resource_type: &str, resource_name: &str, ) -> bool

检查是否存在特定资源。

Source

pub fn get_resource_index( &mut self, resource_type: &str, resource_name: &str, ) -> Result<usize, RustConstructorError>

获取资源索引。

Source

pub fn add_fonts(&mut self, font: Font)

添加字体资源。

Source

pub fn font( &mut self, name: &str, ) -> Result<FontDefinitions, RustConstructorError>

输出字体资源。

Source

pub fn register_all_fonts(&mut self, ctx: &Context)

将所有已添加到RC的字体资源添加到egui中。

Source

pub fn problem_report( &mut self, problem_type: RustConstructorError, severity_level: SeverityLevel, )

发生问题时推送报告。

Source

pub fn check_updated( &mut self, name: &str, ) -> Result<bool, RustConstructorError>

检查页面是否已完成首次加载。

Source

pub fn check_enter_updated( &mut self, name: &str, ) -> Result<bool, RustConstructorError>

检查页面是否已完成加载。

Source

pub fn new_page_update(&mut self, name: &str)

进入新页面时的更新。

Source

pub fn update_frame_stats(&mut self, ctx: &Context)

更新帧数。

Source

pub fn current_fps(&self) -> f32

更新帧数显示。

Source

pub fn add_split_time(&mut self, split_time: SplitTime)

添加分段时间。

Source

pub fn reset_split_time(&mut self, name: &str)

重置分段时间。

Source

pub fn split_time( &mut self, name: &str, ) -> Result<[f32; 2], RustConstructorError>

输出分段时间。

Source

pub fn update_timer(&mut self)

更新计时器。

Source

pub fn add_custom_rect(&mut self, custom_rect: CustomRect)

添加矩形资源。

Source

pub fn custom_rect(&mut self, ui: &mut Ui, name: &str, ctx: &Context)

显示矩形资源。

Source

pub fn add_text(&mut self, text: Text)

添加文本资源。

Source

pub fn text(&mut self, ui: &mut Ui, name: &str, ctx: &Context)

显示文本资源。

Source

pub fn get_text_size( &mut self, resource_name: &str, ui: &mut Ui, ) -> Result<[f32; 2], RustConstructorError>

获取文本大小。

Source

pub fn add_var(&mut self, variable: Variable)

添加变量资源。

Source

pub fn modify_var<T: Into<Value>>(&mut self, name: &str, value: T)

修改变量资源。

Source

pub fn var(&mut self, name: &str) -> Result<Value, RustConstructorError>

取出Value变量。

Source

pub fn var_i(&mut self, name: &str) -> Result<i32, RustConstructorError>

取出i32变量。

Source

pub fn var_u(&mut self, name: &str) -> Result<u32, RustConstructorError>

取出u32资源。

Source

pub fn var_f(&mut self, name: &str) -> Result<f32, RustConstructorError>

取出f32资源。

Source

pub fn var_b(&mut self, name: &str) -> Result<bool, RustConstructorError>

取出布尔值资源。

Source

pub fn var_v(&mut self, name: &str) -> Result<Vec<Value>, RustConstructorError>

取出包含Value的Vec资源。

Source

pub fn var_s(&mut self, name: &str) -> Result<String, RustConstructorError>

取出字符串资源。

Source

pub fn var_decode_b( &mut self, target: Value, ) -> Result<bool, RustConstructorError>

尝试将Value转换成布尔值。

Source

pub fn var_decode_i( &mut self, target: Value, ) -> Result<i32, RustConstructorError>

尝试将Value转换成i32。

Source

pub fn var_decode_u( &mut self, target: Value, ) -> Result<u32, RustConstructorError>

尝试将Value转换成u32。

Source

pub fn var_decode_f( &mut self, target: Value, ) -> Result<f32, RustConstructorError>

尝试将Value转换成f32。

Source

pub fn var_decode_s( &mut self, target: Value, ) -> Result<String, RustConstructorError>

尝试将Value转换成字符串。

Source

pub fn var_decode_v( &mut self, target: Value, ) -> Result<Vec<Value>, RustConstructorError>

尝试将Value转换成Vec。

Source

pub fn add_image_texture( &mut self, image_texture: ImageTexture, path: &str, flip: [bool; 2], ctx: &Context, )

添加图片纹理资源。

Source

pub fn image_texture( &mut self, name: &str, ) -> Result<Option<TextureHandle>, RustConstructorError>

输出图片纹理。

Source

pub fn reset_image_texture( &mut self, name: &str, path: &str, flip: [bool; 2], ctx: &Context, )

重置图片纹理。

Source

pub fn add_image(&mut self, image: Image, image_texture_name: &str)

添加图片资源。

Source

pub fn image(&mut self, ui: &mut Ui, name: &str, ctx: &Context)

显示图片资源。

Source

pub fn add_message_box( &mut self, message_box: MessageBox, title_name: &str, content_name: &str, image_name: &str, sound_path: &str, )

添加消息框资源(重要事项:你需要添加一个CloseMessageBox图片纹理资源才可正常使用!)。

Source

pub fn message_box_display(&mut self, ctx: &Context, ui: &mut Ui)

处理所有已添加的消息框资源。

Source

pub fn add_switch(&mut self, switch: Switch, image_name: &str, text_name: &str)

添加开关资源。

Source

pub fn switch( &mut self, name: &str, ui: &mut Ui, ctx: &Context, enable: bool, play_sound: bool, ) -> Result<[usize; 2], RustConstructorError>

显示开关资源并返回点击方法和开关状态。

Trait Implementations§

Source§

impl Clone for App

Source§

fn clone(&self) -> App

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Freeze for App

§

impl !RefUnwindSafe for App

§

impl !Send for App

§

impl !Sync for App

§

impl Unpin for App

§

impl !UnwindSafe for App

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

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
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,