X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fui%2Fui.cpp;h=746be3e5295e1fc71fb7e5bbc82217405936964c;hb=refs%2Fheads%2Fmaster;hp=35242d339c69c11f48e49e71168e49621779af6d;hpb=3989da924c4e33c52f500aead5ae62bb40294781;p=blobs.git diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp index 35242d3..746be3e 100644 --- a/src/ui/ui.cpp +++ b/src/ui/ui.cpp @@ -8,6 +8,7 @@ #include "Meter.hpp" #include "../app/Assets.hpp" #include "../creature/Creature.hpp" +#include "../creature/Goal.hpp" #include "../graphics/Viewport.hpp" #include "../math/const.hpp" #include "../world/Body.hpp" @@ -222,7 +223,11 @@ void CreaturePanel::Hide() noexcept { void CreaturePanel::Draw(graphics::Viewport &viewport) noexcept { if (!c) return; - name->Text(c->Name()); + std::string name_str(c->Name()); + if (c->Dead()) { + name_str += " (deceased)"; + } + name->Text(name_str); age->Text(TimeString(c->Age())); mass->Text(MassString(c->Mass())); size->Text(LengthString(c->Size())); @@ -545,7 +550,7 @@ void TimePanel::Draw(graphics::Viewport &viewport) noexcept { live->Text(NumberString(sim.LiveCreatures().size())); time->Text(TimeString(sim.Time())); if (body) { - clock->Text(TimeString(std::fmod(sim.Time(), body->RotationalPeriod()))); + clock->Text(TimeString(std::fmod(sim.Time(), body->DayLength())) + " / " + TimeString(body->DayLength())); } else { clock->Text("no reference"); } @@ -568,7 +573,8 @@ std::ostream &custom_fixed(std::ostream &out, double n, int d) { if (p > 0) { out << std::fixed << std::setprecision(p) << n; } else { - out << std::defaultfloat << std::setprecision(d) << n; + out.unsetf(std::ios_base::floatfield); + out << std::setprecision(d) << n; } return out; }