20#include <QApplication>
22#include <QDialogButtonBox>
30#include <QRadioButton>
77 setWindowFlags(Qt::WindowStaysOnTopHint | Qt::Dialog
78 | Qt::FramelessWindowHint);
92 f_title.setCapitalization(QFont::SmallCaps);
115 if (
event->key() == Qt::Key_Escape) {
120 QWidget::keyPressEvent(
event);
133 if (s1.contains(
'\n')) {
136 i = s1.indexOf(
'\n');
138 cs2 = s1.right(s1.length() - i);
142 w = qMax(w2,
fm_title->horizontalAdvance(s2));
144 w = qMax(
fm_text->horizontalAdvance(s1),
150 spacer =
new QSpacerItem(w, 0, QSizePolicy::Minimum,
151 QSizePolicy::Expanding);
153 layout->addItem(spacer,
layout->rowCount(), 0, 1,
layout->columnCount());
154 spacer =
new QSpacerItem(0, h, QSizePolicy::Expanding,
155 QSizePolicy::Minimum);
156 layout->addItem(spacer, 0, 0, 1,
layout->columnCount());
161 p = QPoint((parentWidget()->
width() - w) / 2,
162 (parentWidget()->
height() - h) / 2);
163 p = parentWidget()->mapToGlobal(p);
170 return (return_exec) ? exec () : 0;
202 rx = QRect(2 , 2,
width() - 4 ,
top);
205 c1 = QColor(palette().
color(QPalette::Highlight));
206 c2 = QColor(palette().
color(QPalette::AlternateBase));
217 p.fillRect(rx, QColor(palette().
color(QPalette::Highlight)));
218 p.fillRect(ry, QColor(palette().
color(QPalette::AlternateBase)));
219 p.fillRect(rfull, g);
241 QWidget *parent) : QWidget(parent)
248 setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint);
251 f_text.setCapitalization(QFont::SmallCaps);
263 setAttribute(Qt::WA_TranslucentBackground);
264 setAttribute(Qt::WA_ShowWithoutActivating);
265 setAttribute(Qt::WA_TransparentForMouseEvents);
266 setFocusPolicy(Qt::NoFocus);
290 p = QPoint((parentWidget()->
width() - w) / 2,
291 parentWidget()->
height() / 20);
331 opacity =
static_cast<float>(5000 -
m_timer.elapsed())/(
timeout * 200);
333 opacity = qMin(1.0f, opacity);
334 opacity = qMax(0.0f, opacity);
336 c1 = QColor(Qt::white);
337 c2 = QColor(35, 35, 35, 175);
338 c1.setAlphaF(c1.alphaF() * opacity);
339 c2.setAlphaF(c2.alphaF() * opacity);
342 p.setPen(QColor(0, 0, 0, 0));
358 setWindowFlags(Qt::WindowStaysOnTopHint | Qt::Dialog
359 | Qt::FramelessWindowHint);
374 f_title.setCapitalization(QFont::SmallCaps);
401 QDialogButtonBox *button_box;
404 button_box =
new QDialogButtonBox(QDialogButtonBox::Ok
405 | QDialogButtonBox::Cancel,
406 Qt::Horizontal,
this);
408 if (s1.contains(
'\n')) {
411 i = s1.indexOf(
'\n');
413 cs2 = s1.right(s1.length() - i);
417 w = qMax(w2,
fm_title->horizontalAdvance(s2));
419 w = qMax(
fm_text->horizontalAdvance(s1),
426 spacer =
new QSpacerItem(w, h, QSizePolicy::Expanding,
427 QSizePolicy::Minimum);
430 layout->addWidget(button_box);
434 QObject::connect(button_box, &QDialogButtonBox::accepted,
this, &QDialog::accept);
435 QObject::connect(button_box, &QDialogButtonBox::rejected,
this, &QDialog::reject);
439 p = QPoint((parentWidget()->
width() - w) / 2,
440 (parentWidget()->
height() - h) / 2);
441 p = parentWidget()->mapToGlobal(p);
482 rx = QRect(2 , 2,
width() - 4 ,
top);
485 c1 = QColor(palette().
color(QPalette::Highlight));
486 c2 = QColor(Qt::transparent);
487 c3 = QColor(palette().
color(QPalette::Highlight)).lighter(145);
494 fstep =
static_cast<float>(
step) / 400;
497 g.setColorAt(fstep, c3);
501 p.fillRect(rx, QColor(palette().
color(QPalette::Highlight)));
502 p.fillRect(ry, QColor(palette().
color(QPalette::AlternateBase)));
527 QVBoxLayout *unit_lab;
532 sp =
new QSpacerItem(50, 2);
533 vbox =
new QVBoxLayout;
534 unit_lab =
new QVBoxLayout;
535 unit_lab->setContentsMargins(6, 9, 0, 3);
541 vbox->addSpacerItem(sp);
549 vbox->setContentsMargins(0, 0, 0, 0);
552 setFocusPolicy(Qt::ClickFocus);
568 gui()->qt_settings.unit_info_pos_fx =
static_cast<float>(
event->pos().x())
569 /
gui()->mapview_wdg->width();
570 gui()->qt_settings.unit_info_pos_fy =
static_cast<float>(
event->pos().y())
571 /
gui()->mapview_wdg->height();
582 int expanded_unit_width;
589 QRect crop, bounding_rect;
592 QString fraction1, fraction2;
593 QString text_str, move_pt_text;
594 struct canvas *tile_pixmap;
595 struct canvas *unit_pixmap;
602 if (
punit ==
nullptr) {
607 font.setCapitalization(QFont::AllUppercase);
609 setFixedHeight(parentWidget()->
height() / 12);
612 move(qRound(
gui()->mapview_wdg->width()
613 *
gui()->qt_settings.unit_info_pos_fx),
614 qRound((
gui()->mapview_wdg->height()
615 *
gui()->qt_settings.unit_info_pos_fy)));
618 setUpdatesEnabled(
false);
629 text_str = QString((
"%1(%2)"))
632 text_str = text_str +
" ";
642 mp = QString(
_(
"MP: ")) + mp;
643 text_str = text_str + mp +
" ";
644 text_str += QString(
_(
"HP:%1/%2")).arg(
652 text_str = text_str + QString(
PL_(
" (Selected %1 unit)",
653 " (Selected %1 units)",
n))
655 }
else if (num > 1) {
658 ut_bytes = snum.toUtf8();
660 text_str = text_str + QString(
PL_(
" +%1 unit",
661 " +%1 units", num-1))
662 .arg(ut_bytes.data());
666 font.setPixelSize((
text_label.height() * 9) / 10);
668 fm =
new QFontMetrics(font);
669 text_label.setFixedWidth(fm->horizontalAdvance(text_str) + 20);
674 unit_pixmap->
map_pixmap.fill(Qt::transparent);
678 cropped_img =
img.copy(crop);
679 img = cropped_img.scaledToHeight(
height(), Qt::SmoothTransformation);
682 pix = QPixmap::fromImage(
img);
685 if (pix.width() < expanded_unit_width) {
686 pix2 = QPixmap(expanded_unit_width, pix.height());
687 pix2.fill(Qt::transparent);
689 p.drawPixmap(expanded_unit_width / 2 - pix.width() / 2, 0, pix);
696 if (move_pt_text.contains(
'/')) {
697 fraction2 = move_pt_text.right(1);
698 move_pt_text.remove(move_pt_text.length() - 2, 2);
699 fraction1 = move_pt_text.right(1);
700 move_pt_text.remove(move_pt_text.length() - 1, 1);
702 crop = QRect(5, 5, pix.width() - 5, pix.height() - 5);
703 font.setCapitalization(QFont::Capitalize);
704 font.setPointSize((pix.height() * 2) / 5);
708 p.drawText(crop, Qt::AlignLeft | Qt::AlignBottom, move_pt_text,
711 bounding_rect.adjust(bounding_rect.width(), 0 ,
712 bounding_rect.width() * 2, 0);
717 font.setPointSize(pix.height() / 4);
721 p.drawText(bounding_rect, Qt::AlignCenter,
722 QString(
"+") + QString::number(fuel));
725 if (move_pt_text.isEmpty()) {
728 bounding_rect = p.boundingRect(crop, Qt::AlignLeft | Qt::AlignBottom,
730 font.setPointSize(pix.height() / 5);
731 fm =
new QFontMetrics(font);
732 font_width = (fm->horizontalAdvance(move_pt_text) * 3) / 5;
735 if (!fraction1.isNull()) {
736 int t = 2 * font.pointSize();
738 crop = QRect(bounding_rect.right() - font_width,
739 bounding_rect.top(), t, (t / 5) * 4);
740 p.drawText(crop, Qt::AlignLeft | Qt::AlignBottom, fraction1);
741 crop = QRect(bounding_rect.right() - font_width,
742 (bounding_rect.bottom() + bounding_rect.top()) / 2,
744 p.drawText(crop, Qt::AlignLeft | Qt::AlignTop, fraction2);
745 crop = QRect(bounding_rect.right() - font_width,
746 (bounding_rect.bottom() + bounding_rect.top()) / 2 - t / 16,
748 p.fillRect(crop, Qt::white);
751 wwidth = 2 * 3 + pix.width();
760 tile_pixmap->
map_pixmap.fill(QColor(0 , 0 , 0 , 0));
764 cropped_img =
img.copy(crop);
765 img = cropped_img.scaledToHeight(
height() - 5, Qt::SmoothTransformation);
766 pix = QPixmap::fromImage(
img);
770 wwidth = wwidth + pix.width();
777 if (tmp !=
nullptr) {
780 setUpdatesEnabled(
true);
800 if (e->button() == Qt::LeftButton) {
810 gui()->game_tab_widget->setCurrentIndex(0);
820 setFocusPolicy(Qt::StrongFocus);
821 setMouseTracking(
true);
846 p.setCompositionMode(QPainter::CompositionMode_Source);
847 p.setRenderHint(QPainter::SmoothPixmapTransform);
849 p.setPen(QColor(palette().
color(QPalette::Text)));
852 p.setCompositionMode(QPainter::CompositionMode_DestinationOver);
853 p.fillRect(rx, QColor(palette().
color(QPalette::Highlight)));
874 if (e->button() == Qt::RightButton) {
876 }
else if (e->button() == Qt::LeftButton) {
897 QWidget::leaveEvent(
event);
911 QWidget::enterEvent(
event);
934 layout =
new QHBoxLayout(
this);
936 layout->setContentsMargins(0, 0, 0, 0);
939 setFocusPolicy(Qt::ClickFocus);
956 QSizePolicy size_fixed_policy(QSizePolicy::MinimumExpanding,
959 setSizePolicy(size_fixed_policy);
985 setUpdatesEnabled(
false);
1164 a->setFixedHeight(
height());
1165 a->setFixedWidth(
height());
1170 setUpdatesEnabled(
true);
1186 setUpdatesEnabled(
false);
1187 for (j = 0; j < i; j++) {
1189 layout->removeWidget(ui);
1195 setUpdatesEnabled(
true);
1203 setProperty(
"showGrid",
"false");
1204 setProperty(
"selectionBehavior",
"SelectRows");
1205 setEditTriggers(QAbstractItemView::NoEditTriggers);
1206 setSelectionMode(QAbstractItemView::SingleSelection);
1207 verticalHeader()->setVisible(
false);
1208 horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
1209 horizontalHeader()->setVisible(
false);
1210 setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
1211 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
1212 connect(selectionModel(),
1213 SIGNAL(selectionChanged(
const QItemSelection &,
1214 const QItemSelection &)),
this,
1216 const QItemSelection &)));
1235 QTableWidgetItem *new_item;
1251 setColumnCount(max_size + 1);
1255 direction8_invalid());
1261 new_item =
new QTableWidgetItem(QIcon(*spite->
pm),
str);
1262 setItem(i, 0, new_item);
1266 direction8_invalid());
1267 new_item =
new QTableWidgetItem(QIcon(*spite->
pm),
"");
1268 setItem(i, j, new_item);
1273 w = verticalHeader()->width() + 4;
1274 for (i = 0; i < columnCount(); i++) {
1275 w += columnWidth(i);
1277 h = horizontalHeader()->height() + 4;
1278 for (i = 0; i < rowCount(); i++) {
1283 setWindowFlags(Qt::WindowStaysOnTopHint | Qt::Dialog
1284 | Qt::FramelessWindowHint);
1292 const QItemSelection& s2)
1296 curr_row = s1.indexes().at(0).row();
1306 QHBoxLayout *hbox, *hibox;
1309 QVBoxLayout *groupbox_layout;
1314 setWindowFlags(Qt::WindowStaysOnTopHint | Qt::Dialog
1315 | Qt::FramelessWindowHint);
1333 no_name =
new QGroupBox();
1334 no_name->setTitle(
_(
"Unit type"));
1335 this_type =
new QRadioButton(
_(
"Selected type"), no_name);
1337 any_type =
new QRadioButton(
_(
"All types"), no_name);
1338 connect(
unit_sel_type, SIGNAL(currentIndexChanged(
int)),
this,
1342 groupbox_layout =
new QVBoxLayout;
1345 groupbox_layout->addWidget(
any_type);
1346 no_name->setLayout(groupbox_layout);
1347 hibox =
new QHBoxLayout;
1348 hibox->addWidget(no_name);
1350 no_name =
new QGroupBox();
1351 no_name->setTitle(
_(
"Unit activity"));
1352 any_activity =
new QRadioButton(
_(
"Any activity"), no_name);
1354 fortified =
new QRadioButton(
_(
"Fortified"), no_name);
1355 idle =
new QRadioButton(
_(
"Idle"), no_name);
1356 sentried =
new QRadioButton(
_(
"Sentried"), no_name);
1361 groupbox_layout =
new QVBoxLayout;
1363 groupbox_layout->addWidget(
idle);
1365 groupbox_layout->addWidget(
sentried);
1366 no_name->setLayout(groupbox_layout);
1367 hibox->addWidget(no_name);
1370 no_name =
new QGroupBox();
1371 no_name->setTitle(
_(
"Unit HP and MP"));
1372 any =
new QRadioButton(
_(
"Any unit"), no_name);
1373 full_hp =
new QRadioButton(
_(
"Full HP"), no_name);
1374 full_mp =
new QRadioButton(
_(
"Full MP"), no_name);
1375 full_hp_mp =
new QRadioButton(
_(
"Full HP and MP"), no_name);
1381 groupbox_layout =
new QVBoxLayout;
1382 groupbox_layout->addWidget(
any);
1383 groupbox_layout->addWidget(
full_hp);
1384 groupbox_layout->addWidget(
full_mp);
1386 no_name->setLayout(groupbox_layout);
1387 hibox =
new QHBoxLayout;
1388 hibox->addWidget(no_name);
1390 no_name =
new QGroupBox();
1391 no_name->setTitle(
_(
"Location"));
1392 anywhere =
new QRadioButton(
_(
"Anywhere"), no_name);
1393 this_tile =
new QRadioButton(
_(
"Current tile"), no_name);
1396 groupbox_layout =
new QVBoxLayout;
1409 groupbox_layout->addWidget(
anywhere);
1411 no_name->setLayout(groupbox_layout);
1412 hibox->addWidget(no_name);
1415 select =
new QPushButton(
_(
"Select"));
1416 cancel =
new QPushButton(
_(
"Cancel"));
1425 hbox =
new QHBoxLayout;
1443 p = QPoint((parentWidget()->
width() - sizeHint().
width()) / 2,
1445 p = parentWidget()->mapToGlobal(p);
1464 const struct player *pplayer;
1491 const struct player *pplayer;
1501 result_label.setText(QString(
PL_(
"%1 unit",
"%1 units", num)).arg(num));
1517 if ((
event->key() == Qt::Key_Return)
1518 || (
event->key() == Qt::Key_Enter)) {
1521 if (
event->key() == Qt::Key_Escape) {
1525 QWidget::keyPressEvent(
event);
1547 if ((
any->isChecked()
1601 utype_id = qvar.toInt();
1621 QString ret, t, move_text;
1622 bool has_road =
false;
1626 ret = ret + QString(
_(
"Food/Prod/Trade: %1\n"))
1630 ret = ret + QString(
_(
"Infrastructure: %1\n")).arg(t);
1632 ret = ret + QString(
_(
"Defense bonus: %1%\n")).arg(terr->
defense_bonus);
1639 if (proad->
move_cost <= movement_cost) {
1648 ret = ret + QString(
_(
"Movement cost: %1")).arg(move_text);
1650 ret = ret + QString(
_(
"Movement cost: %1")).arg(movement_cost);
1663 QList<hud_text *> close_list;
1669 || !
gui()->qt_settings.show_new_turn_text) {
1672 close_list =
gui()->mapview_wdg->findChildren<
hud_text *>();
1673 for (i = 0; i < close_list.size(); ++i) {
1674 close_list.at(i)->close();
1675 close_list.at(i)->deleteLater();
1678 s = QString(
_(
"Year: %1 (Turn: %2)"))
1682 s += QString(
_(
" (observer)"));
1684 s +=
" - " + QString(
_(
"Population: %1"))
1700 s = s + QString(
_(
"Gold: %1 (%2)"))
1711 int attacker_hp,
int defender_hp,
1712 bool make_att_veteran,
bool make_def_veteran,
1713 float scale, QWidget *parent) : QWidget(parent)
1727 if (defender_hp <= 0) {
1740 QImage crdimg, acrimg, at, dt;
1743 struct canvas *defender_pixmap;
1744 struct canvas *attacker_pixmap;
1749 setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
1750 setFixedSize(2 * w, w);
1753 defender_pixmap->
map_pixmap.fill(Qt::transparent);
1762 crdimg =
dimg.copy(dr);
1763 dimg = crdimg.scaledToHeight(w, Qt::SmoothTransformation);
1765 if (
dimg.width() < w) {
1766 dt = QImage(w,
dimg.height(), QImage::Format_ARGB32_Premultiplied);
1767 dt.fill(Qt::transparent);
1769 p.drawImage(w / 2 -
dimg.width() / 2, 0,
dimg);
1773 dimg =
dimg.scaled(w, w, Qt::IgnoreAspectRatio,
1774 Qt::SmoothTransformation);
1777 attacker_pixmap->
map_pixmap.fill(Qt::transparent);
1786 acrimg =
aimg.copy(ar);
1787 aimg = acrimg.scaledToHeight(w, Qt::SmoothTransformation);
1789 if (
aimg.width() < w) {
1790 at = QImage(w,
dimg.height(), QImage::Format_ARGB32_Premultiplied);
1791 at.fill(Qt::transparent);
1793 p.drawImage(w / 2 -
aimg.width() / 2, 0,
aimg);
1797 aimg =
aimg.scaled(w, w, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
1798 delete defender_pixmap;
1799 delete attacker_pixmap;
1845 QString ahploss, dhploss;
1860 c1 = QColor(25, 125, 25, 175);
1861 c2 = QColor(125, 25, 25, 175);
1863 c1 = QColor(125, 25, 25, 175);
1864 c2 = QColor(25, 125, 25, 175);
1868 left = QRect(0 , 0, w , w);
1869 right = QRect(w, 0, w , w);
1870 pen = QPen(QColor(palette().
color(QPalette::AlternateBase)), 2.0);
1876 p.fillRect(left, QColor(palette().
color(QPalette::Highlight)));
1877 p.fillRect(right, QColor(palette().
color(QPalette::Highlight)));
1881 p.fillRect(left, c1);
1882 p.fillRect(right, c2);
1885 p.drawImage(left,
aimg);
1887 p.setPen(QColor(Qt::white));
1889 p.drawText(right, Qt::AlignHCenter | Qt::AlignJustify
1890 | Qt::AlignAbsolute,
"*");
1893 p.drawText(left, Qt::AlignHCenter | Qt::AlignJustify
1894 | Qt::AlignAbsolute,
"*");
1896 p.drawText(left, Qt::AlignHorizontal_Mask, ahploss);
1897 p.drawImage(right,
dimg);
1898 p.drawText(right, Qt::AlignHorizontal_Mask, dhploss);
1937 QWidget* p) : QRubberBand(s, p)
1950 setAttribute(Qt::WA_TransparentForMouseEvents,
false);
1958 QRubberBand::paintEvent(
event);
1962 p.drawPixmap(0, 0,
minus);
1972 if (
event->button() == Qt::LeftButton) {
1982 parentWidget()->update();
1991 setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
1994 setContentsMargins(0, 0, 0, 0);
2017 gui()->qt_settings.battlelog_scale =
scale;
2020 foreach (hudc,
lhuc) {
2025 setFixedSize(2 * w + 10,
lhuc.count() * w + 10);
2054 while (
lhuc.count() > 5) {
2055 hudc =
lhuc.takeLast();
2058 foreach (hudc,
lhuc) {
2062 setFixedSize(2 * w + 10,
lhuc.count() * w + 10);
2092 gui()->qt_settings.battlelog_x =
static_cast<float>(p.x()) /
mapview.
width;
2093 gui()->qt_settings.battlelog_y =
static_cast<float>(p.y())
2107 foreach (hupdate,
lhuc) {
2120 foreach (hudc,
lhuc) {
2129 if (
m_timer.elapsed() >= 5000) {
2141 foreach (hupdate,
lhuc) {
QRect zealous_crop_rect(QImage &p)
void qtg_canvas_free(struct canvas *store)
struct canvas * qtg_canvas_create(int width, int height)
struct canvas int int struct sprite int int int int height
struct canvas int int struct sprite int int int width
const char * city_name_get(const struct city *pcity)
void mousePressEvent(QMouseEvent *e)
static fc_font * instance()
QFont * get_font(QString name)
QPixmap * get_pixmap(const QString &id)
static fc_icons * instance()
void paintEvent(QPaintEvent *event)
void leaveEvent(QEvent *event)
void mousePressEvent(QMouseEvent *e)
void mouseMoveEvent(QMouseEvent *event)
hud_action(QWidget *parent)
void enterEvent(QEnterEvent *event)
shortcut_id action_shortcut
void set_pixmap(QPixmap *p)
QList< hud_unit_combat * > lhuc
void add_combat_info(hud_unit_combat *huc)
hud_battle_log(QWidget *parent)
QVBoxLayout * main_layout
void moveEvent(QMoveEvent *event)
void timerEvent(QTimerEvent *event)
void paintEvent(QPaintEvent *event)
void showEvent(QShowEvent *event)
void timerEvent(QTimerEvent *event)
void paintEvent(QPaintEvent *event)
int set_text_title(QString s1, QString s2, bool return_exec=false)
hud_message_box(QWidget *parent)
void keyPressEvent(QKeyEvent *event)
void timerEvent(QTimerEvent *event)
hud_text(QString s, int time_secs, QWidget *parent)
void paintEvent(QPaintEvent *event)
void set_fading(float fade)
hud_unit_combat(int attacker_unit_id, int defender_unit_id, int attacker_hp, int defender_hp, bool make_att_veteran, bool make_def_veteran, float scale, QWidget *parent)
void leaveEvent(QEvent *event)
void mousePressEvent(QMouseEvent *e)
void paintEvent(QPaintEvent *event)
void init_images(bool redraw=false)
const struct unit_type * type_attacker
void set_scale(float scale)
struct tile * center_tile
const struct unit_type * type_defender
void enterEvent(QEnterEvent *event)
hud_unit_loader(struct unit *pcargo, struct tile *ptile)
void selection_changed(const QItemSelection &, const QItemSelection &)
QList< unit * > transports
void update_actions(unit_list *punits)
hud_units(QWidget *parent)
void moveEvent(QMoveEvent *event)
QHBoxLayout * main_layout
unit_actions * unit_icons
unit_actions(QWidget *parent, unit *punit)
QList< hud_action * > actions
QRadioButton * this_continent
QComboBox * unit_sel_type
void keyPressEvent(QKeyEvent *event)
QVBoxLayout * main_layout
QRadioButton * main_continent
QRadioButton * full_hp_mp
bool island_filter(struct unit *punit)
bool type_filter(struct unit *punit)
unit_hud_selector(QWidget *parent)
void select_units(int x=0)
QRadioButton * any_activity
bool activity_filter(struct unit *punit)
bool hp_filter(struct unit *punit)
bool client_is_observer(void)
bool client_has_player(void)
void request_unit_load(struct unit *pcargo, struct unit *ptrans, struct tile *ptile)
void unit_focus_add(struct unit *punit)
struct unit_list * get_units_in_focus(void)
void request_center_focus_unit(void)
struct unit * head_of_units_in_focus(void)
#define can_unit_do_activity_client(_punit_, _act_)
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
#define PL_(String1, String2, n)
const char * population_to_text(int thousand_citizen)
struct unit * game_unit_by_number(int id)
int civ_population(const struct player *pplayer)
bool goto_is_active(void)
static PangoLayout * layout
void put_terrain(struct tile *ptile, struct canvas *pcanvas, float zoom, int canvas_x, int canvas_y)
void put_unit(const struct unit *punit, struct canvas *pcanvas, float zoom, int canvas_x, int canvas_y)
void put_unittype(const struct unit_type *putype, struct canvas *pcanvas, float zoom, int canvas_x, int canvas_y)
void center_tile_mapcanvas(const struct tile *ptile)
const char * move_points_text(int mp, bool reduce)
bool can_unit_exist_at_tile(const struct civ_map *nmap, const struct unit *punit, const struct tile *ptile)
bool unit_can_load(const struct unit *punit)
bool can_unit_transport(const struct unit *transporter, const struct unit *transported)
const char *const default_font
const char *const notify_label
const char * nation_plural_for_player(const struct player *pplayer)
const char * science_dialog_text(void)
int player_get_expected_income(const struct player *pplayer)
struct city * player_city_by_number(const struct player *pplayer, int city_id)
struct city * player_primary_capital(const struct player *pplayer)
const char * research_advance_name_translation(const struct research *presearch, Tech_type_id tech)
struct research * research_get(const struct player *pplayer)
bool can_build_road(const struct civ_map *nmap, struct road_type *proad, const struct unit *punit, const struct tile *ptile)
struct packet_game_info info
struct player_economic economic
struct research::@75::@77 client
enum unit_activity activity
const struct unit_type * utype
int fc_snprintf(char *str, size_t n, const char *format,...)
const char * get_infrastructure_text(bv_extras extras)
const char * popup_info_text(struct tile *ptile)
const char * get_tile_output_text(const struct tile *ptile)
bool tile_has_road(const struct tile *ptile, const struct road_type *proad)
const char * tile_get_info_text(const struct tile *ptile, bool include_nuisances, int linebreaks)
struct city * tile_city(const struct tile *ptile)
int tileset_unit_width(const struct tileset *t)
int tileset_unit_height(const struct tileset *t)
struct sprite * get_unittype_sprite(const struct tileset *t, const struct unit_type *punittype, enum direction8 facing)
struct tileset * unscaled_tileset
bool tileset_is_isometric(const struct tileset *t)
int tileset_tile_height(const struct tileset *t)
int tileset_full_tile_width(const struct tileset *t)
int get_transporter_occupancy(const struct unit *ptrans)
bool can_unit_change_homecity_to(const struct civ_map *nmap, const struct unit *punit, const struct city *pcity)
bool unit_can_add_or_build_city(const struct civ_map *nmap, const struct unit *punit)
struct unit * unit_transport_get(const struct unit *pcargo)
bool can_unit_do_autosettlers(const struct unit *punit)
bool unit_can_do_action(const struct unit *punit, const action_id act_id)
int get_transporter_capacity(const struct unit *punit)
bool can_unit_paradrop(const struct civ_map *nmap, const struct unit *punit)
enum unit_upgrade_result unit_upgrade_test(const struct civ_map *nmap, const struct unit *punit, bool is_free)
bool unit_transported(const struct unit *pcargo)
bool can_unit_unload(const struct unit *pcargo, const struct unit *ptrans)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const struct unit_type * unit_type_get(const struct unit *punit)
const char * unit_name_translation(const struct unit *punit)
const char * utype_rule_name(const struct unit_type *punittype)
Unit_type_id utype_number(const struct unit_type *punittype)
Unit_type_id utype_index(const struct unit_type *punittype)
const char * utype_name_translation(const struct unit_type *punittype)
#define utype_fuel(ptype)
#define unit_type_iterate(_p)
#define unit_type_iterate_end