Minor cleanup
parent
39f52ddafc
commit
d4bd7e82bd
|
@ -1,28 +0,0 @@
|
|||
use rhai::{CustomType, TypeBuilder};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct SceneConfig {
|
||||
pub show_phys: bool,
|
||||
pub show_starfield: bool,
|
||||
}
|
||||
|
||||
impl SceneConfig {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
show_phys: false,
|
||||
show_starfield: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl CustomType for SceneConfig {
|
||||
fn build(mut builder: TypeBuilder<Self>) {
|
||||
builder
|
||||
.with_name("SceneConfig")
|
||||
.with_fn("SceneConfig", Self::new)
|
||||
.with_fn("show_phys", |s: &mut Self, x: bool| s.show_phys = x)
|
||||
.with_fn("show_starfield", |s: &mut Self, x: bool| {
|
||||
s.show_starfield = x
|
||||
});
|
||||
}
|
||||
}
|
|
@ -12,8 +12,8 @@ use std::{cell::RefCell, num::NonZeroU32, rc::Rc, sync::Arc};
|
|||
|
||||
use super::{
|
||||
api::{self, Color, MouseClickEvent, MouseHoverEvent, PlayerShipStateEvent, Rect},
|
||||
elements::{RadialBar, Sprite, TextBox},
|
||||
event::Event,
|
||||
util::{RadialBar, Sprite, TextBox},
|
||||
UiConfig, UiElement, UiState,
|
||||
};
|
||||
use crate::{ui::api::State, RenderInput, RenderState};
|
||||
|
|
|
@ -3,7 +3,7 @@ mod event;
|
|||
mod executor;
|
||||
mod state;
|
||||
|
||||
mod util;
|
||||
mod elements;
|
||||
|
||||
pub(crate) use executor::UiScriptExecutor;
|
||||
pub(crate) use state::*;
|
||||
|
|
|
@ -6,7 +6,7 @@ use std::collections::HashMap;
|
|||
use std::sync::Arc;
|
||||
use winit::window::Window;
|
||||
|
||||
use super::util::{FpsIndicator, RadialBar, Sprite, TextBox};
|
||||
use super::elements::{FpsIndicator, RadialBar, Sprite, TextBox};
|
||||
use crate::{RenderInput, RenderState};
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
Loading…
Reference in New Issue