diff options
| author | troido <troido@protonmail.com> | 2019-09-25 18:49:25 +0200 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2019-09-25 18:49:25 +0200 |
| commit | 207e51fc5b308d5ef967967ba2eec61a30a80057 (patch) | |
| tree | 578e480f876d8f019767344b1e024b3147772fb9 | |
| parent | 7e472308a5ee127aab78fe6325dbce3d055fbcdc (diff) | |
healthbar doesn't have title anymore; made this with textbox
| -rw-r--r-- | asciifarm/client/display.py | 1 | ||||
| -rw-r--r-- | asciifarm/client/layout.xml | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/asciifarm/client/display.py b/asciifarm/client/display.py index a2c142e..fbcd34a 100644 --- a/asciifarm/client/display.py +++ b/asciifarm/client/display.py @@ -105,6 +105,7 @@ class Display: maxHealth = 0 self.getWidget("health").set_total(maxHealth) self.getWidget("health").set_filled(health) + self.getWidget("healthtitle").format({"filled": health, "total":maxHealth}) def showInfo(self, infostring): diff --git a/asciifarm/client/layout.xml b/asciifarm/client/layout.xml index bf176d7..f945382 100644 --- a/asciifarm/client/layout.xml +++ b/asciifarm/client/layout.xml @@ -1,7 +1,8 @@ <?xml version="1.0"?> <hbox> <vbox width="20" align="right"> - <bar id="health" height="2" full-char="#" empty-char="_" full-style="fg:2; bg:2" empty-style="fg:1; bg: 1;"></bar> + <textbox id="healthtitle" height="1" format="true">Health ({filled}/{total})</textbox> + <bar id="health" height="1" full-char="#" empty-char="_" full-style="fg:2; bg:2" empty-style="fg:1; bg: 1;"></bar> <listing id="switchtitles" height="0"></listing> <switchbox id="switch" height="50%"> <vbox key="inventory"> |
