Minor cleanup

master
Mark 2024-02-04 22:43:02 -08:00
parent 39f52ddafc
commit d4bd7e82bd
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
9 changed files with 3 additions and 31 deletions

View File

@ -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
});
}
}

View File

@ -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};

View File

@ -3,7 +3,7 @@ mod event;
mod executor;
mod state;
mod util;
mod elements;
pub(crate) use executor::UiScriptExecutor;
pub(crate) use state::*;

View File

@ -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)]