diff --git a/src/screenComponents/shieldFreqencySelect.cpp b/src/screenComponents/shieldFreqencySelect.cpp index d24fdd9a07..f08d642043 100644 --- a/src/screenComponents/shieldFreqencySelect.cpp +++ b/src/screenComponents/shieldFreqencySelect.cpp @@ -38,6 +38,8 @@ void GuiShieldFrequencySelect::onDraw(sp::RenderTarget& renderer) { calibrate_button->setEnable(my_spaceship->shield_calibration_delay <= 0.0f); new_frequency->setEnable(my_spaceship->shield_calibration_delay <= 0.0f); + calibrate_button->setVisible(my_spaceship->hasSystem(SYS_FrontShield) || my_spaceship->hasSystem(SYS_RearShield)); + new_frequency->setVisible(my_spaceship->hasSystem(SYS_FrontShield) || my_spaceship->hasSystem(SYS_RearShield)); } GuiElement::onDraw(renderer); } diff --git a/src/screenComponents/shieldsEnableButton.cpp b/src/screenComponents/shieldsEnableButton.cpp index 313849bdfc..355a456075 100644 --- a/src/screenComponents/shieldsEnableButton.cpp +++ b/src/screenComponents/shieldsEnableButton.cpp @@ -46,6 +46,11 @@ void GuiShieldsEnableButton::onDraw(sp::RenderTarget& target) else button->setText(tr("Shields: {status}").format({{"status", shield_status}})); } + if (!(my_spaceship->hasSystem(SYS_FrontShield) || my_spaceship->hasSystem(SYS_RearShield))) + { + button->hide(); + bar->hide(); + } } } diff --git a/src/screens/crew4/engineeringAdvancedScreen.cpp b/src/screens/crew4/engineeringAdvancedScreen.cpp index a9eb13276a..a23d1e3a48 100644 --- a/src/screens/crew4/engineeringAdvancedScreen.cpp +++ b/src/screens/crew4/engineeringAdvancedScreen.cpp @@ -15,11 +15,14 @@ EngineeringAdvancedScreen::EngineeringAdvancedScreen(GuiContainer* owner) //The shield frequency selection includes a shield enable button. (new GuiShieldFrequencySelect(this, "SHIELD_FREQ"))->setPosition(20, 310, sp::Alignment::TopLeft)->setSize(240, 100); - GuiElement* beam_info_box = new GuiElement(this, "BEAM_INFO_BOX"); - beam_info_box->setPosition(20, 410, sp::Alignment::TopLeft)->setSize(240, 50); - (new GuiLabel(beam_info_box, "BEAM_INFO_LABEL", tr("Beams"), 30))->addBackground()->setPosition(20, 0, sp::Alignment::TopLeft)->setSize(80, 50); - (new GuiBeamFrequencySelector(beam_info_box, "BEAM_FREQUENCY_SELECTOR"))->setPosition(120, 0, sp::Alignment::TopLeft)->setSize(120, 50); - (new GuiPowerDamageIndicator(beam_info_box, "", SYS_BeamWeapons, sp::Alignment::CenterLeft))->setPosition(0, 0, sp::Alignment::BottomLeft)->setSize(240, 50); + if (my_spaceship->hasSystem(SYS_BeamWeapons)) + { + GuiElement* beam_info_box = new GuiElement(this, "BEAM_INFO_BOX"); + beam_info_box->setPosition(20, 410, sp::Alignment::TopLeft)->setSize(240, 50); + (new GuiLabel(beam_info_box, "BEAM_INFO_LABEL", tr("Beams"), 30))->addBackground()->setPosition(20, 0, sp::Alignment::TopLeft)->setSize(80, 50); + (new GuiBeamFrequencySelector(beam_info_box, "BEAM_FREQUENCY_SELECTOR"))->setPosition(120, 0, sp::Alignment::TopLeft)->setSize(120, 50); + (new GuiPowerDamageIndicator(beam_info_box, "", SYS_BeamWeapons, sp::Alignment::CenterLeft))->setPosition(0, 0, sp::Alignment::BottomLeft)->setSize(240, 50); + } }else{ (new GuiShieldsEnableButton(this, "SHIELDS_ENABLE"))->setPosition(20, 310, sp::Alignment::TopLeft)->setSize(240, 50); }