ui.ui -> ui.kui

This commit is contained in:
griffi-gh 2023-11-25 16:18:40 +01:00
parent cb22f4db59
commit f7f0ca4547
2 changed files with 5 additions and 5 deletions

View file

@ -4,7 +4,7 @@ use crate::rendering::{Renderer, RenderTarget, WindowSize};
#[derive(Unique)] #[derive(Unique)]
pub struct UiState { pub struct UiState {
pub ui: KubiUi, pub kui: KubiUi,
pub renderer: GliumUiRenderer, pub renderer: GliumUiRenderer,
} }
@ -13,7 +13,7 @@ pub fn kubi_ui_init(
) { ) {
let renderer = storages.borrow::<NonSendSync<UniqueView<Renderer>>>().unwrap(); let renderer = storages.borrow::<NonSendSync<UniqueView<Renderer>>>().unwrap();
storages.add_unique_non_send_sync(UiState { storages.add_unique_non_send_sync(UiState {
ui: KubiUi::new(), kui: KubiUi::new(),
renderer: GliumUiRenderer::new(&renderer.display) renderer: GliumUiRenderer::new(&renderer.display)
}); });
} }
@ -21,14 +21,14 @@ pub fn kubi_ui_init(
pub fn kubi_ui_begin( pub fn kubi_ui_begin(
mut ui: NonSendSync<UniqueViewMut<UiState>> mut ui: NonSendSync<UniqueViewMut<UiState>>
) { ) {
ui.ui.begin(); ui.kui.begin();
} }
pub fn kubi_ui_end( pub fn kubi_ui_end(
mut ui: NonSendSync<UniqueViewMut<UiState>> mut ui: NonSendSync<UniqueViewMut<UiState>>
) { ) {
let ui: &mut UiState = &mut ui; let ui: &mut UiState = &mut ui;
let UiState { ui, renderer } = ui; let UiState { kui: ui, renderer } = ui;
ui.end(); ui.end();
let (upload_needed, plan) = ui.draw_plan(); let (upload_needed, plan) = ui.draw_plan();
if upload_needed { if upload_needed {

View file

@ -21,7 +21,7 @@ fn render_progressbar(
let total = world.chunks.len(); let total = world.chunks.len();
loaded as f32 / total as f32 loaded as f32 / total as f32
}; };
ui.ui.add( ui.kui.add(
ProgressBar { value, ..Default::default() }, ProgressBar { value, ..Default::default() },
size.0.as_vec2() size.0.as_vec2()
); );