App

Struct App 

Source
pub struct App {
Show 13 fields pub config: Config, pub game_text: GameText, pub rust_constructor_resource: Vec<RCR>, pub render_resource_list: Vec<RenderResource>, pub problem_list: Vec<Problem>, pub frame: Frame, 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

配置项。

§game_text: GameText

文本。

§rust_constructor_resource: Vec<RCR>

RC资源。

§render_resource_list: Vec<RenderResource>

渲染资源列表。

§problem_list: Vec<Problem>

问题列表。

§frame: Frame

窗口样式。

§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_path: &str, game_text_path: &str) -> Self

初始化程序。

Source

pub fn add_page(&mut self, name: &str, forced_update: bool)

运行时添加新页面。

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_name: &str, font_path: &str)

添加字体资源。

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, name: &str, reset: bool)

添加分段时间。

Source

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

输出分段时间。

Source

pub fn update_timer(&mut self)

更新计时器。

Source

pub fn add_rect( &mut self, name: &str, position_size_and_rounding: [f32; 5], grid: [u32; 4], center_display: [bool; 4], color: [u8; 8], border_width: f32, )

添加矩形资源。

Source

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

显示矩形资源。

Source

pub fn add_text( &mut self, name_content_and_font: [&str; 3], position_font_size_wrap_width_rounding: [f32; 5], color: [u8; 8], center_display_write_background_and_enable_copy: [bool; 6], grid: [u32; 4], hyperlink_text: Vec<(usize, usize, &str)>, )

添加文本资源。

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<T: Into<Value>>(&mut self, name: &str, value: T)

添加变量资源。

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 add_scroll_background( &mut self, name: &str, image_name: Vec<String>, horizontal_or_vertical: bool, left_and_top_or_right_and_bottom: bool, scroll_speed: u32, size_position_boundary: [f32; 5], )

添加滚动背景资源。

Source

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

显示滚动背景。

Source

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

添加图片纹理资源。

Source

pub fn add_image( &mut self, name: &str, position_size: [f32; 4], grid: [u32; 4], center_display_and_use_overlay: [bool; 5], alpha_and_overlay_color: [u8; 5], 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, box_itself_title_content_image_name_and_sound_path: [&str; 5], box_size: [f32; 2], box_keep_existing: bool, box_existing_time: f32, box_normal_and_restore_speed: [f32; 2], )

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

Source

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

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

Source

pub fn add_switch( &mut self, name_switch_image_name_text_name_and_sound_path: [&str; 4], appearance: Vec<SwitchData>, enable_hover_click_image_and_use_overlay: [bool; 3], switch_amounts_state: u32, click_method: Vec<SwitchClickAction>, )

添加开关资源。

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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
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,