Skip to content

Commit

Permalink
science: show max hull/shields, hide non-existing systems (#2061)
Browse files Browse the repository at this point in the history
Co-authored-by: Pithlit <[email protected]>
  • Loading branch information
Piglit and Pithlit authored Apr 4, 2024
1 parent 7ebceb9 commit b0958ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/screens/crew6/scienceScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ void ScienceScreen::onDraw(sp::RenderTarget& renderer)
info_type->setValue(ship->getTypeName());
info_type_button->show();
info_shields->setValue(ship->getShieldDataString());
info_hull->setValue(int(ceil(ship->getHull())));
info_hull->setValue(string(int(ceil(ship->getHull()))) + "/" + string(int(ceil(ship->getHullMax()))));
}

// On a full scan, show tactical and systems data (if any), and its
Expand Down Expand Up @@ -422,8 +422,12 @@ void ScienceScreen::onDraw(sp::RenderTarget& renderer)
// Show the status of each subsystem.
for(int n = 0; n < SYS_COUNT; n++)
{
float system_health = ship->systems[n].health;
info_system[n]->setValue(string(int(system_health * 100.0f)) + "%")->setColor(glm::u8vec4(255, 127.5f * (system_health + 1), 127.5f * (system_health + 1), 255));
if (ship->hasSystem(ESystem(n))) {
float system_health = ship->systems[n].health;
info_system[n]->setValue(string(int(system_health * 100.0f)) + "%")->setColor(glm::u8vec4(255, 127.5f * (system_health + 1), 127.5f * (system_health + 1), 255));
} else {
info_system[n]->setValue("-");
}
}
}
}
Expand All @@ -439,7 +443,7 @@ void ScienceScreen::onDraw(sp::RenderTarget& renderer)
{
info_type->setValue(station->template_name);
info_shields->setValue(station->getShieldDataString());
info_hull->setValue(int(ceil(station->getHull())));
info_hull->setValue(string(int(ceil(station->getHull()))) + "/" + string(int(ceil(station->getHullMax()))));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/spaceObjects/shipTemplateBasedObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ string ShipTemplateBasedObject::getShieldDataString()
{
if (n > 0)
data += ":";
data += string(int(shield_level[n]));
data += string(int(shield_level[n])) + "/" + string(int(shield_max[n]));
}
return data;
}

2 comments on commit b0958ea

@daid-tinyci
Copy link

@daid-tinyci daid-tinyci bot commented on b0958ea Apr 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TinyCI build failure:

[ninja -j 2 package] returned [1]:


FAILED: CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyBinder.cpp.o 

/usr/bin/c++  -I/data/tinyci_build/daid/EmptyEpsilon/src -I/data/tinyci_build/daid/EmptyEpsilon/_build_native/include -I/data/tinyci_build/daid/SeriousProton/src -I/data/tinyci_build/daid/EmptyEpsilon/_build_native/SeriousProton/include -I/data/tinyci_build/daid/SeriousProton/libs/Box2D/.. -I/data/tinyci_build/daid/SeriousProton/libs/glad -I/data/tinyci_build/daid/SeriousProton/libs/lua/.. -I/home/tinyci/builds/daid/EmptyEpsilon/_build_native/_deps/glm-src/glm/.. -I/data/tinyci_build/daid/SeriousProton/libs/freetype2/include -I/home/tinyci/builds/daid/EmptyEpsilon/_build_native/_deps/basis-src -I/data/tinyci_build/daid/SeriousProton/libs/libopus/include -I/home/tinyci/builds/daid/EmptyEpsilon/_build_native/_deps/meshoptimizer-src/src -isystem /usr/include/SDL2 -O2 -g -DNDEBUG -fdiagnostics-color -g1 -O3 -flto -funsafe-math-optimizations -Wall -Wextra -Woverloaded-virtual -Wdouble-promotion -Wsuggest-override -Werror=return-type -Wno-unused-parameter -Wno-unused-but-set-parameter -MD -MT CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyBinder.cpp.o -MF CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyBinder.cpp.o.d -o CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyBinder.cpp.o -c /data/tinyci_build/daid/EmptyEpsilon/src/gui/hotkeyBinder.cpp

In file included from /data/tinyci_build/daid/EmptyEpsilon/src/shipTemplate.h:13,

                 from /data/tinyci_build/daid/EmptyEpsilon/src/gui/hotkeyConfig.h:9,

                 from /data/tinyci_build/daid/EmptyEpsilon/src/gui/hotkeyBinder.cpp:3:

/data/tinyci_build/daid/EmptyEpsilon/src/missileWeaponData.h:25:41: error: expected constructor, destructor, or type conversion before ‘;’ token

   25 | REGISTER_MULTIPLAYER_ENUM(EMissileSizes);

      |                                         ^

/data/tinyci_build/daid/EmptyEpsilon/src/shipTemplate.h:209:35: error: expected constructor, destructor, or type conversion before ‘;’ token

  209 | REGISTER_MULTIPLAYER_ENUM(ESystem);

      |                                   ^

[2/175] Building CXX object CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyConfig.cpp.o

FAILED: CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyConfig.cpp.o 

/usr/bin/c++  -I/data/tinyci_build/daid/EmptyEpsilon/src -I/data/tinyci_build/daid/EmptyEpsilon/_build_native/include -I/data/tinyci_build/daid/SeriousProton/src -I/data/tinyci_build/daid/EmptyEpsilon/_build_native/SeriousProton/include -I/data/tinyci_build/daid/SeriousProton/libs/Box2D/.. -I/data/tinyci_build/daid/SeriousProton/libs/glad -I/data/tinyci_build/daid/SeriousProton/libs/lua/.. -I/home/tinyci/builds/daid/EmptyEpsilon/_build_native/_deps/glm-src/glm/.. -I/data/tinyci_build/daid/SeriousProton/libs/freetype2/include -I/home/tinyci/builds/daid/EmptyEpsilon/_build_native/_deps/basis-src -I/data/tinyci_build/daid/SeriousProton/libs/libopus/include -I/home/tinyci/builds/daid/EmptyEpsilon/_build_native/_deps/meshoptimizer-src/src -isystem /usr/include/SDL2 -O2 -g -DNDEBUG -fdiagnostics-color -g1 -O3 -flto -funsafe-math-optimizations -Wall -Wextra -Woverloaded-virtual -Wdouble-promotion -Wsuggest-override -Werror=return-type -Wno-unused-parameter -Wno-unused-but-set-parameter -MD -MT CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyConfig.cpp.o -MF CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyConfig.cpp.o.d -o CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyConfig.cpp.o -c /data/tinyci_build/daid/EmptyEpsilon/src/gui/hotkeyConfig.cpp

In file included from /data/tinyci_build/daid/EmptyEpsilon/src/shipTemplate.h:13,

                 from /data/tinyci_build/daid/EmptyEpsilon/src/gui/hotkeyConfig.h:9,

                 from /data/tinyci_build/daid/EmptyEpsilon/src/gui/hotkeyConfig.cpp:2:

/data/tinyci_build/daid/EmptyEpsilon/src/missileWeaponData.h:25:41: error: expected constructor, destructor, or type conversion before ‘;’ token

   25 | REGISTER_MULTIPLAYER_ENUM(EMissileSizes);

      |                                         ^

/data/tinyci_build/daid/EmptyEpsilon/src/shipTemplate.h:209:35: error: expected constructor, destructor, or type conversion before ‘;’ token

  209 | REGISTER_MULTIPLAYER_ENUM(ESystem);

      |                                   ^

ninja: build stopped: subcommand failed.

@daid-tinyci
Copy link

@daid-tinyci daid-tinyci bot commented on b0958ea Apr 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TinyCI build failure:

[ninja -j 2 package] returned [1]:


FAILED: CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyBinder.cpp.o 

/usr/bin/c++  -I/data/tinyci_build/daid/EmptyEpsilon/src -I/data/tinyci_build/daid/EmptyEpsilon/_build_native/include -I/data/tinyci_build/daid/SeriousProton/src -I/data/tinyci_build/daid/EmptyEpsilon/_build_native/SeriousProton/include -I/data/tinyci_build/daid/SeriousProton/libs/Box2D/.. -I/data/tinyci_build/daid/SeriousProton/libs/glad -I/data/tinyci_build/daid/SeriousProton/libs/lua/.. -I/home/tinyci/builds/daid/EmptyEpsilon/_build_native/_deps/glm-src/glm/.. -I/data/tinyci_build/daid/SeriousProton/libs/freetype2/include -I/home/tinyci/builds/daid/EmptyEpsilon/_build_native/_deps/basis-src -I/data/tinyci_build/daid/SeriousProton/libs/libopus/include -I/home/tinyci/builds/daid/EmptyEpsilon/_build_native/_deps/meshoptimizer-src/src -isystem /usr/include/SDL2 -O2 -g -DNDEBUG -fdiagnostics-color -g1 -O3 -flto -funsafe-math-optimizations -Wall -Wextra -Woverloaded-virtual -Wdouble-promotion -Wsuggest-override -Werror=return-type -Wno-unused-parameter -Wno-unused-but-set-parameter -MD -MT CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyBinder.cpp.o -MF CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyBinder.cpp.o.d -o CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyBinder.cpp.o -c /data/tinyci_build/daid/EmptyEpsilon/src/gui/hotkeyBinder.cpp

In file included from /data/tinyci_build/daid/EmptyEpsilon/src/shipTemplate.h:13,

                 from /data/tinyci_build/daid/EmptyEpsilon/src/gui/hotkeyConfig.h:9,

                 from /data/tinyci_build/daid/EmptyEpsilon/src/gui/hotkeyBinder.cpp:3:

/data/tinyci_build/daid/EmptyEpsilon/src/missileWeaponData.h:25:41: error: expected constructor, destructor, or type conversion before ‘;’ token

   25 | REGISTER_MULTIPLAYER_ENUM(EMissileSizes);

      |                                         ^

/data/tinyci_build/daid/EmptyEpsilon/src/shipTemplate.h:209:35: error: expected constructor, destructor, or type conversion before ‘;’ token

  209 | REGISTER_MULTIPLAYER_ENUM(ESystem);

      |                                   ^

[2/175] Building CXX object CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyConfig.cpp.o

FAILED: CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyConfig.cpp.o 

/usr/bin/c++  -I/data/tinyci_build/daid/EmptyEpsilon/src -I/data/tinyci_build/daid/EmptyEpsilon/_build_native/include -I/data/tinyci_build/daid/SeriousProton/src -I/data/tinyci_build/daid/EmptyEpsilon/_build_native/SeriousProton/include -I/data/tinyci_build/daid/SeriousProton/libs/Box2D/.. -I/data/tinyci_build/daid/SeriousProton/libs/glad -I/data/tinyci_build/daid/SeriousProton/libs/lua/.. -I/home/tinyci/builds/daid/EmptyEpsilon/_build_native/_deps/glm-src/glm/.. -I/data/tinyci_build/daid/SeriousProton/libs/freetype2/include -I/home/tinyci/builds/daid/EmptyEpsilon/_build_native/_deps/basis-src -I/data/tinyci_build/daid/SeriousProton/libs/libopus/include -I/home/tinyci/builds/daid/EmptyEpsilon/_build_native/_deps/meshoptimizer-src/src -isystem /usr/include/SDL2 -O2 -g -DNDEBUG -fdiagnostics-color -g1 -O3 -flto -funsafe-math-optimizations -Wall -Wextra -Woverloaded-virtual -Wdouble-promotion -Wsuggest-override -Werror=return-type -Wno-unused-parameter -Wno-unused-but-set-parameter -MD -MT CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyConfig.cpp.o -MF CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyConfig.cpp.o.d -o CMakeFiles/EE_GuiLIB.dir/src/gui/hotkeyConfig.cpp.o -c /data/tinyci_build/daid/EmptyEpsilon/src/gui/hotkeyConfig.cpp

In file included from /data/tinyci_build/daid/EmptyEpsilon/src/shipTemplate.h:13,

                 from /data/tinyci_build/daid/EmptyEpsilon/src/gui/hotkeyConfig.h:9,

                 from /data/tinyci_build/daid/EmptyEpsilon/src/gui/hotkeyConfig.cpp:2:

/data/tinyci_build/daid/EmptyEpsilon/src/missileWeaponData.h:25:41: error: expected constructor, destructor, or type conversion before ‘;’ token

   25 | REGISTER_MULTIPLAYER_ENUM(EMissileSizes);

      |                                         ^

/data/tinyci_build/daid/EmptyEpsilon/src/shipTemplate.h:209:35: error: expected constructor, destructor, or type conversion before ‘;’ token

  209 | REGISTER_MULTIPLAYER_ENUM(ESystem);

      |                                   ^

ninja: build stopped: subcommand failed.

Please sign in to comment.