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
impl App
Sourcepub fn switch_page(&mut self, page: &str)
pub fn switch_page(&mut self, page: &str)
切换页面。
Sourcepub fn check_resource_exists(
&mut self,
resource_type: &str,
resource_name: &str,
) -> bool
pub fn check_resource_exists( &mut self, resource_type: &str, resource_name: &str, ) -> bool
检查是否存在特定资源。
Sourcepub fn get_resource_index(
&mut self,
resource_type: &str,
resource_name: &str,
) -> Result<usize, RustConstructorError>
pub fn get_resource_index( &mut self, resource_type: &str, resource_name: &str, ) -> Result<usize, RustConstructorError>
获取资源索引。
Sourcepub fn font(
&mut self,
name: &str,
) -> Result<FontDefinitions, RustConstructorError>
pub fn font( &mut self, name: &str, ) -> Result<FontDefinitions, RustConstructorError>
输出字体资源。
Sourcepub fn register_all_fonts(&mut self, ctx: &Context)
pub fn register_all_fonts(&mut self, ctx: &Context)
将所有已添加到RC的字体资源添加到egui中。
Sourcepub fn problem_report(
&mut self,
problem_type: RustConstructorError,
severity_level: SeverityLevel,
)
pub fn problem_report( &mut self, problem_type: RustConstructorError, severity_level: SeverityLevel, )
发生问题时推送报告。
Sourcepub fn check_updated(
&mut self,
name: &str,
) -> Result<bool, RustConstructorError>
pub fn check_updated( &mut self, name: &str, ) -> Result<bool, RustConstructorError>
检查页面是否已完成首次加载。
Sourcepub fn check_enter_updated(
&mut self,
name: &str,
) -> Result<bool, RustConstructorError>
pub fn check_enter_updated( &mut self, name: &str, ) -> Result<bool, RustConstructorError>
检查页面是否已完成加载。
Sourcepub fn new_page_update(&mut self, name: &str)
pub fn new_page_update(&mut self, name: &str)
进入新页面时的更新。
Sourcepub fn update_frame_stats(&mut self, ctx: &Context)
pub fn update_frame_stats(&mut self, ctx: &Context)
更新帧数。
Sourcepub fn current_fps(&self) -> f32
pub fn current_fps(&self) -> f32
更新帧数显示。
Sourcepub fn add_split_time(&mut self, name: &str, reset: bool)
pub fn add_split_time(&mut self, name: &str, reset: bool)
添加分段时间。
Sourcepub fn split_time(
&mut self,
name: &str,
) -> Result<[f32; 2], RustConstructorError>
pub fn split_time( &mut self, name: &str, ) -> Result<[f32; 2], RustConstructorError>
输出分段时间。
Sourcepub fn update_timer(&mut self)
pub fn update_timer(&mut self)
更新计时器。
Sourcepub 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,
)
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, )
添加矩形资源。
Sourcepub 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)>,
)
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)>, )
添加文本资源。
Sourcepub fn get_text_size(
&mut self,
resource_name: &str,
ui: &mut Ui,
) -> Result<[f32; 2], RustConstructorError>
pub fn get_text_size( &mut self, resource_name: &str, ui: &mut Ui, ) -> Result<[f32; 2], RustConstructorError>
获取文本大小。
Sourcepub fn modify_var<T: Into<Value>>(&mut self, name: &str, value: T)
pub fn modify_var<T: Into<Value>>(&mut self, name: &str, value: T)
修改变量资源。
Sourcepub fn var_v(&mut self, name: &str) -> Result<Vec<Value>, RustConstructorError>
pub fn var_v(&mut self, name: &str) -> Result<Vec<Value>, RustConstructorError>
取出包含Value的Vec资源。
Sourcepub fn var_decode_b(
&mut self,
target: Value,
) -> Result<bool, RustConstructorError>
pub fn var_decode_b( &mut self, target: Value, ) -> Result<bool, RustConstructorError>
尝试将Value转换成布尔值。
Sourcepub fn var_decode_i(
&mut self,
target: Value,
) -> Result<i32, RustConstructorError>
pub fn var_decode_i( &mut self, target: Value, ) -> Result<i32, RustConstructorError>
尝试将Value转换成i32。
Sourcepub fn var_decode_u(
&mut self,
target: Value,
) -> Result<u32, RustConstructorError>
pub fn var_decode_u( &mut self, target: Value, ) -> Result<u32, RustConstructorError>
尝试将Value转换成u32。
Sourcepub fn var_decode_f(
&mut self,
target: Value,
) -> Result<f32, RustConstructorError>
pub fn var_decode_f( &mut self, target: Value, ) -> Result<f32, RustConstructorError>
尝试将Value转换成f32。
Sourcepub fn var_decode_s(
&mut self,
target: Value,
) -> Result<String, RustConstructorError>
pub fn var_decode_s( &mut self, target: Value, ) -> Result<String, RustConstructorError>
尝试将Value转换成字符串。
Sourcepub 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],
)
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], )
添加滚动背景资源。
Sourcepub fn scroll_background(&mut self, ui: &mut Ui, name: &str, ctx: &Context)
pub fn scroll_background(&mut self, ui: &mut Ui, name: &str, ctx: &Context)
显示滚动背景。
Sourcepub fn add_image_texture(
&mut self,
name: &str,
path: &str,
flip: [bool; 2],
create_new_resource: bool,
ctx: &Context,
)
pub fn add_image_texture( &mut self, name: &str, path: &str, flip: [bool; 2], create_new_resource: bool, ctx: &Context, )
添加图片纹理资源。
Sourcepub 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,
)
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, )
添加图片资源。
Sourcepub 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],
)
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图片纹理资源才可正常使用!)。
Sourcepub fn message_box_display(&mut self, ctx: &Context, ui: &mut Ui)
pub fn message_box_display(&mut self, ctx: &Context, ui: &mut Ui)
处理所有已添加的消息框资源。
Sourcepub 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>,
)
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>, )
添加开关资源。
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
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>
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)
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)
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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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