Skip to content

Commit

Permalink
hangar: if station labels refer to "ship" instead of fighter
Browse files Browse the repository at this point in the history
  • Loading branch information
Piglit committed Jul 12, 2024
1 parent f53239e commit 84815ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/screens/extra/hangar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ HangarScreen::HangarScreen(GuiContainer* owner)
}
});
create_fighter_button->setSize(GuiElement::GuiSizeMax, 40);
if (my_spaceship && my_spaceship->getPlayerShipType() == PST_Station)
create_fighter_button->setText(tr("Create new ship"));
if (!gameGlobalInfo->allow_new_player_ships)
create_fighter_button->hide();

Expand Down Expand Up @@ -264,6 +266,8 @@ HangarScreen::HangarScreen(GuiContainer* owner)
select_fighter_label->show();
});
create_ship_button->setSize(150,50);
if (my_spaceship && my_spaceship->getPlayerShipType() == PST_Station)
create_ship_button->setText(tr("Build Ship"));

fighter_create_dialog->hide();
select_fighter_label->show();
Expand Down
2 changes: 1 addition & 1 deletion src/spaceObjects/shipTemplateBasedObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class ShipTemplateBasedObject : public SpaceObject, public Updatable
ERestockMissileBehaviour getRestocksMissilesDocked() { return restocks_missiles_docked; }
void setRestocksMissilesDocked(ERestockMissileBehaviour behaviour) { restocks_missiles_docked = behaviour; }

bool getPlayerShipType() { return player_ship_type; }
EPlayerShipType getPlayerShipType() { return player_ship_type; }
void setPlayerShipType(EPlayerShipType type) { player_ship_type = type; }
void onTakingDamage(ScriptSimpleCallback callback);
void onDestruction(ScriptSimpleCallback callback);
Expand Down

0 comments on commit 84815ef

Please sign in to comment.