Skip to content

Commit

Permalink
T-Panel/Basics tab: don't draw empty categories
Browse files Browse the repository at this point in the history
  • Loading branch information
ohlidalp committed Sep 24, 2024
1 parent b0092a4 commit 720c78b
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 196 deletions.
13 changes: 13 additions & 0 deletions source/main/gfx/GfxActor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3338,6 +3338,19 @@ int RoR::GfxActor::FetchNumBeams () const { retur
int RoR::GfxActor::FetchNumNodes () const { return m_actor->ar_num_nodes; }
int RoR::GfxActor::FetchNumWheelNodes () const { return m_actor->getWheelNodeCount(); }

int RoR::GfxActor::countBeaconProps() const
{
int count = 0;
for (const Prop& prop : m_props)
{
if (prop.pp_beacon_type != 0)
{
count++;
}
}
return count;
}

void RoR::GfxActor::SetNodeHot(NodeNum_t nodenum, bool value)
{
for (NodeGfx& nfx : m_gfx_nodes)
Expand Down
3 changes: 2 additions & 1 deletion source/main/gfx/GfxActor.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,12 @@ class GfxActor
bool HasDriverSeatProp() const { return m_driverseat_prop_index != -1; }
void CalcPropAnimation(PropAnim& anim, float& cstate, int& div, float dt);
std::vector<Prop>& getProps() { return m_props; }
bool hasCamera() { return m_videocameras.size() > 0; }
size_t getNumVideoCameras() const { return m_videocameras.size(); }
SurveyMapEntity& getSurveyMapEntity() { return m_surveymap_entity; }
WheelSide getWheelSide(WheelID_t wheel_id) { return (wheel_id >= 0 && (size_t)wheel_id < m_wheels.size()) ? m_wheels[wheel_id].wx_side : WheelSide::INVALID; }
std::string getWheelRimMeshName(WheelID_t wheel_id) { return (wheel_id >= 0 && (size_t)wheel_id < m_wheels.size()) ? m_wheels[wheel_id].wx_rim_mesh_name : ""; }
const ActorPtr& getOwningActor() { return m_actor; }
int countBeaconProps() const;

private:

Expand Down
Loading

0 comments on commit 720c78b

Please sign in to comment.