Body UI and damage works better now.
This commit is contained in:
parent
f6c8163acd
commit
2dec4ec993
3 changed files with 22 additions and 12 deletions
|
|
@ -29,6 +29,7 @@ namespace gui {
|
|||
auto gui_id = $gui.entity(name);
|
||||
|
||||
$gui.set<Text>(gui_id, {guecs::to_wstring(name)});
|
||||
$gui.set<Rectangle>(gui_id, {1, {255, 0, 0, 255}});
|
||||
$gui.set<Meter>(gui_id, {1.0f, THEME.DARK_MID, {}});
|
||||
}
|
||||
|
||||
|
|
@ -49,8 +50,10 @@ namespace gui {
|
|||
auto gui_id = $gui.entity(key);
|
||||
|
||||
if(auto meter = $gui.get_if<Meter>(gui_id)) {
|
||||
meter->percent = float(value) / 50.0;
|
||||
meter->percent = float(value) / float(player_combat.max_hp);
|
||||
}
|
||||
|
||||
$gui.show_text(key, fmt::format(L"{}: {}", guecs::to_wstring(key), value));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue