12 #include <QGridLayout>
15 #include <QPushButton>
35 QSize get_spaceship_dimensions()
43 void put_spaceship(QPixmap *pcanvas,
const struct player *pplayer)
51 const int w = spr->width(), h = spr->height();
54 p.fillRect(0, 0, w * 7, h * 7,
72 p.drawPixmap(x, y, *spr);
79 if ((k == 0 && j >= ship->
fuel) || (k == 1 && j >= ship->
propulsion)) {
88 p.drawPixmap(x, y, *spr);
92 p.drawPixmap(x + w, y, *spr);
104 p.drawPixmap(x, y, *spr);
116 setAttribute(Qt::WA_DeleteOnClose);
118 can =
new QPixmap(get_spaceship_dimensions());
120 QGridLayout *layout =
new QGridLayout;
125 layout->addWidget(
ss_label, 0, 3, 3, 1);
195 if (!
queen()->isRepoDlgOpen(QStringLiteral(
"SPS"))) {
201 if (
queen()->game_tab_widget->currentIndex() == i) {
205 ss_rep =
reinterpret_cast<ss_report *
>(w);
226 if (!
queen()->isRepoDlgOpen(QStringLiteral(
"SPS"))) {
232 ss_rep =
reinterpret_cast<ss_report *
>(w);
247 if (!
queen()->isRepoDlgOpen(QStringLiteral(
"SPS"))) {
253 ss_rep =
reinterpret_cast<ss_report *
>(w);
254 ss_rep->deleteLater();
bool BV_ISSET(const BV &bv, int bit)
int gimmeIndexOf(const QString &str)
Returns index on game tab page of given report dialog.
int addGameTab(QWidget *widget)
Inserts tab widget to game view page.
void removeRepoDlg(const QString &str)
Removes report dialog string from the list marking it as closed.
void gimmePlace(QWidget *widget, const QString &str)
Finds not used index on game_view_tab and returns it.
fc_game_tab_widget * game_tab_widget
~ss_report() override
Destructor for spaceship report.
void launch()
Launch spaceship.
QPushButton * launch_button
void update_report()
Updates spaceship report.
ss_report(struct player *pplayer)
Constructor for spaceship report.
void init()
Initializes widget on game_tab_widget.
bool client_is_global_observer()
Returns whether client is global observer.
QColor get_color(const struct tileset *t, enum color_std stdcolor)
Return a pointer to the given "standard" color.
#define fc_assert(condition)
pageGame * queen()
Return game instandce.
const struct sship_part_info structurals_info[NUM_SS_STRUCTURALS]
const struct sship_part_info modules_info[NUM_SS_MODULES]
const struct sship_part_info components_info[NUM_SS_COMPONENTS]
#define NUM_SS_COMPONENTS
#define NUM_SS_STRUCTURALS
void popdown_spaceship_dialog(struct player *pplayer)
Close the spaceship dialog for the given player.
void popdown_all_spaceships_dialogs()
Close all spaceships dialogs.
void popup_spaceship_dialog(struct player *pplayer)
Popup (or raise) the spaceship dialog for the given player.
void refresh_spaceship_dialog(struct player *pplayer)
Refresh (update) the spaceship dialog for the given player.
bv_spaceship_structure structure
enum spaceship_state state
struct player_spaceship spaceship
const QString get_spaceship_descr(struct player_spaceship *pship)
Returns a description of the given spaceship.
const QPixmap * get_spaceship_sprite(const struct tileset *t, enum spaceship_part part)
Return the sprite for drawing the given spaceship part.
bool victory_enabled(enum victory_condition_type victory)
Whether victory condition is enabled.