mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-12-26 21:58:20 -06:00
ui.ui
-> ui.kui
This commit is contained in:
parent
356bfa1acb
commit
257f7bb130
|
@ -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 {
|
||||||
|
|
|
@ -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()
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue