mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-11-21 22:38:41 -06:00
ui.ui
-> ui.kui
This commit is contained in:
parent
cb22f4db59
commit
f7f0ca4547
|
@ -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