add battery-ui #6

Merged
LuckyTurtleDev merged 6 commits from battery-ui into main 2024-07-06 20:45:06 +00:00
Showing only changes of commit b8132bc876 - Show all commits

View file

@ -14,8 +14,8 @@ pub fn draw(state: &State, _engine: &EngineContext<'_>) {
start_positon.y += 0.5 * section_size.y + 0.5 * section_size.y; start_positon.y += 0.5 * section_size.y + 0.5 * section_size.y;
// draw fill level // draw fill level
{ {
let gohst = &state.ghost; let ghost = &state.ghost;
let percent = gohst.charge / gohst.max_charge; let percent = ghost.charge / ghost.max_charge;
let mut size = section_size; let mut size = section_size;
size.y = section_size.y * section_count as f32 * percent; size.y = section_size.y * section_count as f32 * percent;
let mut position = start_positon; let mut position = start_positon;