]> git.localhorst.tv Git - blobs.git/blobdiff - src/ui/ui.cpp
remove ability to fly at will
[blobs.git] / src / ui / ui.cpp
index dc17b2be7bba5487f35dcf8a6af3329028e5a242..9d73b925416a4cd4d00a6344a2683647bcf5b684 100644 (file)
@@ -231,24 +231,21 @@ void CreaturePanel::Draw(graphics::Viewport &viewport) noexcept {
        }
 
        pos->Text(VectorString(c->GetSituation().Position(), 2));
-       tile->Text(c->GetSituation().GetTileType().label);
+       tile->Text(c->GetSituation().GetTileType().label + (
+               c->GetSituation().OnGround()
+                       ? (c->GetSituation().Moving() ? " (moving)" : " (standing)")
+                       : (c->GetSituation().Moving() ? " (flying)" : " (hovering)")
+       ));
        head->Text(VectorString(c->GetSituation().Heading(), 2));
 
        const creature::Composition &comp = c->GetComposition();
        if (comp.size() < components.size()) {
+               components.clear();
                composition->Clear();
-               while (comp.size() < components.size()) {
-                       delete components.back();
-                       components.pop_back();
-               }
-               for (auto l : components) {
-                       composition->Add(l);
-               }
-       } else {
-               while (comp.size() > components.size()) {
-                       components.emplace_back(new Label(assets.fonts.medium));
-                       composition->Add(components.back());
-               }
+       }
+       while (comp.size() > components.size()) {
+               components.emplace_back(new Label(assets.fonts.medium));
+               composition->Add(components.back());
        }
        {
                int i = 0;