19#include <QApplication>
20#include <QButtonGroup>
28#include <QPainterPath>
29#include <QRadioButton>
31#include <QTableWidgetItem>
68#define BUTTON_WAIT (ACTION_COUNT + 1)
69#define BUTTON_CANCEL (BUTTON_WAIT + 1)
70#define BUTTON_COUNT (BUTTON_CANCEL + 1)
86static void spy_steal(QVariant data1, QVariant data2);
91static void spy_poison(QVariant data1, QVariant data2);
99static void nuke_city(QVariant data1, QVariant data2);
100static void destroy_city(QVariant data1, QVariant data2);
102static void spy_embassy(QVariant data1, QVariant data2);
115static void nuke_units(QVariant data1, QVariant data2);
116static void expel_unit(QVariant data1, QVariant data2);
117static void bombard(QVariant data1, QVariant data2);
118static void bombard2(QVariant data1, QVariant data2);
119static void bombard3(QVariant data1, QVariant data2);
120static void found_city(QVariant data1, QVariant data2);
122static void cultivate(QVariant data1, QVariant data2);
123static void plant(QVariant data1, QVariant data2);
124static void pillage(QVariant data1, QVariant data2);
127static void road(QVariant data1, QVariant data2);
128static void base(QVariant data1, QVariant data2);
129static void mine(QVariant data1, QVariant data2);
130static void irrigate(QVariant data1, QVariant data2);
131static void nuke(QVariant data1, QVariant data2);
132static void attack(QVariant data1, QVariant data2);
134static void paradrop(QVariant data1, QVariant data2);
140static void disembark1(QVariant data1, QVariant data2);
141static void disembark2(QVariant data1, QVariant data2);
142static void enter_hut(QVariant data1, QVariant data2);
143static void enter_hut2(QVariant data1, QVariant data2);
144static void frighten_hut(QVariant data1, QVariant data2);
146static void regular_move(QVariant data1, QVariant data2);
147static void convert_unit(QVariant data1, QVariant data2);
148static void fortify(QVariant data1, QVariant data2);
149static void disband_unit(QVariant data1, QVariant data2);
150static void homeless(QVariant data1, QVariant data2);
151static void join_city(QVariant data1, QVariant data2);
153static void unit_upgrade(QVariant data1, QVariant data2);
154static void airlift(QVariant data1, QVariant data2);
155static void conquer_city(QVariant data1, QVariant data2);
159static void heal_unit(QVariant data1, QVariant data2);
160static void heal_unit2(QVariant data1, QVariant data2);
167static void keep_moving(QVariant data1, QVariant data2);
173 QVariant data1, QVariant data2);
198 QHash<action_id, pfcn_void> action_function;
201 action_function[ACTION_ESTABLISH_EMBASSY] =
spy_embassy;
205 action_function[ACTION_SPY_POISON] =
spy_poison;
211 action_function[ACTION_SPY_TARGETED_SABOTAGE_CITY] =
213 action_function[ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC] =
217 action_function[ACTION_SPY_TARGETED_STEAL_TECH] =
spy_steal;
218 action_function[ACTION_SPY_TARGETED_STEAL_TECH_ESC] =
spy_steal_esc;
224 action_function[ACTION_JOIN_CITY] =
join_city;
233 action_function[ACTION_AIRLIFT] =
airlift;
237 action_function[ACTION_NUKE_CITY] =
nuke_city;
243 action_function[ACTION_EXPEL_UNIT] =
expel_unit;
244 action_function[ACTION_HEAL_UNIT] =
heal_unit;
245 action_function[ACTION_HEAL_UNIT2] =
heal_unit2;
255 action_function[ACTION_BOMBARD] =
bombard;
256 action_function[ACTION_BOMBARD2] =
bombard2;
257 action_function[ACTION_BOMBARD3] =
bombard3;
258 action_function[ACTION_NUKE_UNITS] =
nuke_units;
261 action_function[ACTION_FOUND_CITY] =
found_city;
262 action_function[ACTION_NUKE] =
nuke;
263 action_function[ACTION_PARADROP] =
paradrop;
268 action_function[ACTION_PARADROP_FRIGHTEN_CONQUER]
270 action_function[ACTION_ATTACK] =
attack;
273 action_function[ACTION_CULTIVATE] =
cultivate;
274 action_function[ACTION_PLANT] =
plant;
275 action_function[ACTION_PILLAGE] =
pillage;
278 action_function[ACTION_ROAD] =
road;
279 action_function[ACTION_BASE] =
base;
280 action_function[ACTION_MINE] =
mine;
281 action_function[ACTION_IRRIGATE] =
irrigate;
282 action_function[ACTION_TRANSPORT_DISEMBARK1] =
disembark1;
283 action_function[ACTION_TRANSPORT_DISEMBARK2] =
disembark2;
284 action_function[ACTION_HUT_ENTER] =
enter_hut;
285 action_function[ACTION_HUT_ENTER2] =
enter_hut2;
296 action_function[ACTION_FORTIFY] =
fortify;
298 action_function[ACTION_HOMELESS] =
homeless;
300 return action_function;
311 Qt::FramelessWindowHint)
315 setSizeGripEnabled(
true);
335 QStyleOptionTitleBar tbar_opt;
336 QStyleOption win_opt;
337 QStyle *style = this->style();
338 QRect active_area = this->rect();
340 QRect close_rect, text_rect;
342 qpal.setColor(QPalette::Active, QPalette::ToolTipText, Qt::white);
343 tbar_opt.initFrom(
this);
345 &tbar_opt,
this) + 2;
349 close_rect = QRect(this->
width() -
close_pix.width(), 0, this->width(),
351 tbar_opt.titleBarState = this->windowState();
352 tbar_opt.text = tbar_opt.fontMetrics.elidedText(this->windowTitle(),
355 style->drawComplexControl(QStyle::CC_TitleBar, &tbar_opt, &p,
this);
356 style->drawItemText(&p, text_rect, Qt::AlignCenter, qpal,
357 true, tbar_opt.text, QPalette::ToolTipText);
358 style->drawItemPixmap(&p, close_rect, Qt::AlignLeft,
363 win_opt.initFrom(
this);
364 win_opt.rect = active_area;
365 style->drawPrimitive(QStyle::PE_Widget, &win_opt, &p,
this);
383 QPoint
pos =
event->pos();
391 setCursor(Qt::SizeAllCursor);
404 setCursor(Qt::ArrowCursor);
414 QGridLayout *qgroupbox_layout;
416 QTableWidgetItem *
item;
423 setAttribute(Qt::WA_DeleteOnClose);
428 styles =
new QTableWidget;
431 ns_label =
new QLabel;
436 setWindowTitle(
_(
"Select Nation"));
449 nation_tabs->setSelectionMode(QAbstractItemView::SingleSelection);
451 nation_tabs->horizontalHeader()->setVisible(
false);
453 nation_tabs->setEditTriggers(QAbstractItemView::NoEditTriggers);
455 ns_label->setText(
_(
"Nation Set:"));
457 styles->setColumnCount(2);
458 styles->setSelectionMode(QAbstractItemView::SingleSelection);
459 styles->verticalHeader()->setVisible(
false);
460 styles->horizontalHeader()->setVisible(
false);
461 styles->setProperty(
"showGrid",
"false");
462 styles->setProperty(
"selectionBehavior",
"SelectRows");
463 styles->setEditTriggers(QAbstractItemView::NoEditTriggers);
464 styles->setShowGrid(
false);
466 qgroupbox_layout =
new QGridLayout;
467 no_name =
new QGroupBox(parent);
470 is_male =
new QRadioButton(no_name);
476 qgroupbox_layout->addWidget(
leader_name, 1, 0, 1, 2);
477 qgroupbox_layout->addWidget(
is_male, 2, 1);
478 qgroupbox_layout->addWidget(
is_female, 2, 0);
481 no_name->setLayout(qgroupbox_layout);
486 no_name->setTitle(
_(
"Your leader name"));
496 item =
new QTableWidgetItem;
499 item->setData(Qt::DecorationRole, *pix);
501 size.setWidth(pix->width());
502 size.setHeight(pix->height());
505 item =
new QTableWidgetItem;
511 header =
styles->horizontalHeader();
512 header->setSectionResizeMode(QHeaderView::Stretch);
513 header->resizeSections(QHeaderView::ResizeToContents);
514 header =
styles->verticalHeader();
515 header->resizeSections(QHeaderView::ResizeToContents);
523 connect(
styles->selectionModel(),
524 SIGNAL(selectionChanged(
const QItemSelection &,
525 const QItemSelection &)),
527 const QItemSelection &)));
529 SIGNAL(selectionChanged(
const QItemSelection &,
530 const QItemSelection &)),
532 const QItemSelection &)));
533 connect(
leader_name, SIGNAL(currentIndexChanged(
int)),
535 connect(
leader_name->lineEdit(), &QLineEdit::returnPressed,
537 connect(
qnation_set, SIGNAL(currentIndexChanged(
int)),
540 SIGNAL(selectionChanged(
const QItemSelection &,
541 const QItemSelection &)),
543 const QItemSelection &)));
575 title =
_(
"What Nation Will You Be?");
581 setWindowTitle(
title);
598 QTableWidgetItem *
item;
606 item =
new QTableWidgetItem;
607 item->setText(
_(
"All nations"));
608 item->setData(Qt::UserRole, -99);
630 item =
new QTableWidgetItem;
631 item->setData(Qt::UserRole, i - 1);
636 header->resizeSections(QHeaderView::Stretch);
638 header->resizeSections(QHeaderView::ResizeToContents);
662 const QItemSelection &ds)
664 QModelIndexList indexes = sl.indexes();
667 if (indexes.isEmpty()) {
670 index = indexes.at(0);
680 QTableWidgetItem *
item;
694 index =
item->data(Qt::UserRole).toInt();
707 item =
new QTableWidgetItem;
710 if (pnation->player) {
712 f.setStrikeOut(
true);
716 item->setData(Qt::DecorationRole, *pix);
724 header->resizeSections(QHeaderView::Stretch);
726 header->resizeSections(QHeaderView::ResizeToContents);
733 const QItemSelection &deselcted)
738 QModelIndexList indexes = selected.indexes();
740 QTableWidgetItem *
item;
743 if (indexes.isEmpty()) {
747 index = indexes.at(0);
748 if (indexes.isEmpty()) {
751 qvar = index.data(Qt::UserRole);
771 qvar = qvar.fromValue<
int>(style);
773 for (ind = 0; ind <
styles->rowCount(); ind++) {
776 if (
item->data(Qt::UserRole) == qvar) {
786 const QItemSelection &deselcted)
790 QModelIndexList indexes = selected.indexes();
792 if (indexes.isEmpty()) {
796 index = indexes.at(0);
797 qvar = index.data(Qt::UserRole);
841 _(
"Nation has been chosen by other player"));
858 const char *
lines, QWidget *parent)
864 setAttribute(Qt::WA_DeleteOnClose);
865 setCursor(Qt::ArrowCursor);
867 setFrameStyle(QFrame::Box);
873 qlines = QString(
lines);
874 qlist = qlines.split(
"\n");
880 gui()->mapview_wdg->find_place(
gui()->mapview_wdg->width() - x - 4, 4,
894 QByteArray capt_bytes;
898 for (i = 0; i <
qlist.size(); ++i) {
901 if (i <
qlist.size() - 1) {
907 qb_bytes = q.toUtf8();
922 QStringList str_list;
927 for (i = 0; i < str_list.count(); i++) {
928 x = qMax(x, fm.horizontalAdvance(str_list.at(i)));
929 y = y + 3 + fm.height();
939 QPainter painter(
this);
946 pen.setColor(palette().
color(QPalette::Text));
949 painter.drawText(10, fm.height() + 3,
qcaption);
950 painter.drawText(10, 2 * fm.height() + 6,
qheadline);
951 for (i = 0; i <
qlist.count(); i++) {
952 painter.drawText(10, 3 + (fm.height() + 3) * (i + 3),
qlist[i]);
964 if (
event->button() == Qt::RightButton) {
977 setCursor(Qt::SizeAllCursor);
985 setCursor(Qt::ArrowCursor);
1093 const struct text_tag_list *tags,
tile *ptile,
1094 QWidget *parent): QMessageBox(parent)
1097 setAttribute(Qt::WA_DeleteOnClose);
1098 goto_but = this->addButton(
_(
"Goto Location"), QMessageBox::ActionRole);
1100 inspect_but = this->addButton(
_(
"Inspect City"), QMessageBox::ActionRole);
1103 close_but = this->addButton(QMessageBox::Close);
1115 qlines.replace(
"\n",
" ");
1119 connect(
close_but, &QAbstractButton::pressed,
this, &QWidget::close);
1150 QByteArray rn_bytes;
1154 rule_name =
qnation_set->currentData().toString();
1155 rn_bytes = rule_name.toUtf8();
1158 rn = rn_bytes.data();
1171 const struct text_tag_list *tags,
1175 gui()->central_wdg);
1184 QMessageBox *msg =
new QMessageBox(
gui()->central_wdg);
1187 msg->setStandardButtons(QMessageBox::Ok);
1189 msg->setAttribute(Qt::WA_DeleteOnClose);
1200 gui()->mapview_wdg);
1235 && (unit_list_size(ptile->
units) > 1
1237 gui()->toggle_unit_sel_widget(ptile);
1246 gui()->update_unit_sel();
1291 ask->setStandardButtons(QMessageBox::Cancel | QMessageBox::Ok);
1292 ask->setDefaultButton(QMessageBox::Cancel);
1295 ask->setAttribute(Qt::WA_DeleteOnClose);
1296 QObject::connect(ask, &hud_message_box::accepted, [=]() {
1297 if (government_id ==
G_LAST) {
1320 : QPushButton(
title)
1374 void (*run_on_close_in)(
int)): QWidget(parent)
1376 QLabel *l =
new QLabel(text);
1378 setProperty(
"themed_choice",
true);
1379 layout =
new QVBoxLayout(
this);
1383 setWindowFlags(Qt::Dialog);
1384 setWindowTitle(
title);
1385 setAttribute(Qt::WA_DeleteOnClose);
1386 gui()->set_diplo_dialog(
this);
1414 gui()->set_diplo_dialog(NULL);
1432 QPushButton *next, *prev;
1434 next =
new QPushButton();
1436 next->setIconSize(QSize(32, 32));
1437 next->setFixedSize(QSize(36, 36));
1438 prev =
new QPushButton();
1440 prev->setIconSize(QSize(32, 32));
1441 prev->setFixedSize(QSize(36, 36));
1452 unit_skip->addWidget(prev, Qt::AlignCenter);
1454 unit_skip->addWidget(next, Qt::AlignCenter);
1468 QVariant data2, QString tool_tip =
"",
1469 const int button_id = -1)
1475 QObject::connect(button, &QPushButton::clicked,
1482 if (!tool_tip.isEmpty()) {
1483 button->setToolTip(tool_tip);
1486 if (0 <= button_id) {
1491 layout->addWidget(button);
1501 p = mapFromGlobal(QCursor::pos());
1502 p.setY(p.y()-this->height());
1503 p.setX(p.x()-this->width());
1570 struct unit *new_target =
nullptr;
1571 bool break_next =
false;
1610 struct unit *new_target =
nullptr;
1697 layout->removeWidget(button);
1714 layout->addWidget(button);
1724 int target_city_id = data2.toInt();
1729 target_city_id, 0,
"");
1739 int target_city_id = data2.toInt();
1744 target_city_id, 0,
"");
1753 int caravan_id = data1.toInt();
1754 int caravan_target_id = data2.toInt();
1759 caravan_id, caravan_target_id, 0,
"");
1768 int actor_id = data1.toInt();
1769 int tgt_city_id = data2.toInt();
1774 actor_id, tgt_city_id, 0,
"");
1783 int actor_id = data1.toInt();
1784 int tgt_city_id = data2.toInt();
1789 actor_id, tgt_city_id, 0,
"");
1800 int actor_id = data1.toInt();
1801 int tgt_city_id = data2.toInt();
1805 struct unit_list *as_list;
1807 as_list = unit_list_new();
1808 unit_list_append(as_list,
punit);
1810 unit_list_destroy(as_list);
1817static void airlift(QVariant data1, QVariant data2)
1819 int actor_id = data1.toInt();
1820 int tgt_city_id = data2.toInt();
1825 actor_id, tgt_city_id, 0,
"");
1834 int actor_id = data1.toInt();
1835 int tgt_city_id = data2.toInt();
1840 actor_id, tgt_city_id, 0,
"");
1849 int actor_id = data1.toInt();
1850 int tgt_city_id = data2.toInt();
1855 actor_id, tgt_city_id, 0,
"");
1864 int actor_id = data1.toInt();
1865 int target_id = data2.toInt();
1869 actor_id, target_id, 0,
"");
1878 int actor_id = data1.toInt();
1879 int target_id = data2.toInt();
1883 actor_id, target_id, 0,
"");
1993 struct city *actor_homecity;
2000 foreach (caras,
gui()->trade_gen.lines) {
2009 i =
gui()->trade_gen.lines.indexOf(caras);
2010 gui()->trade_gen.lines.takeAt(i);
2031 "Diplomat queue problem. Is another diplomat window open?");
2040 _(
"Choose Your %s's Strategy"),
2045 _(
"Your %s from %s reaches the city of %s.\nWhat now?"),
2051 _(
"Your %s has arrived at %s.\nWhat is your command?"),
2057 _(
"Your %s is ready to act against %s %s."),
2063 "No target specified.");
2067 _(
"Your %s is waiting for your command."),
2071 cd =
gui()->get_diplo_dialog();
2077 gui()->game_tab_widget,
2258 switch ((
enum gen_action)tgt_action_id) {
2259 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
2260 return ACTION_SPY_SABOTAGE_CITY;
2261 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
2262 return ACTION_SPY_SABOTAGE_CITY_ESC;
2263 case ACTION_SPY_TARGETED_STEAL_TECH:
2264 return ACTION_SPY_STEAL_TECH;
2265 case ACTION_SPY_TARGETED_STEAL_TECH_ESC:
2266 return ACTION_SPY_STEAL_TECH_ESC;
2281 switch ((
enum gen_action)tgt_action_id) {
2282 case ACTION_SPY_TARGETED_SABOTAGE_CITY:
2283 return ACTION_SPY_SABOTAGE_CITY_PRODUCTION;
2284 case ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC:
2285 return ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC;
2286 case ACTION_STRIKE_BUILDING:
2287 return ACTION_STRIKE_PRODUCTION;
2301 QVariant data1, QVariant data2)
2306 if (!
af_map.contains(act)) {
2334 QVariant data1, QVariant data2)
2352 button->setText(
title);
2353 button->setToolTip(tool_tip);
2361 int actor_id = data1.toInt();
2362 int target_id = data2.toInt();
2371static void fortify(QVariant data1, QVariant data2)
2373 int actor_id = data1.toInt();
2374 int target_id = data2.toInt();
2387 int actor_id = data1.toInt();
2388 int target_id = data2.toInt();
2399 int actor_id = data1.toInt();
2400 int target_id = data2.toInt();
2413 int diplomat_id = data1.toInt();
2414 int diplomat_target_id = data2.toInt();
2422 diplomat_target_id);
2431 int diplomat_id = data1.toInt();
2432 int diplomat_target_id = data2.toInt();
2435 diplomat_target_id, 0,
"");
2443 int diplomat_id = data1.toInt();
2444 int diplomat_target_id = data2.toInt();
2447 diplomat_target_id, 0,
"");
2455 int actor_id = data1.toInt();
2456 int target_id = data2.toInt();
2466 int actor_id = data1.toInt();
2467 int target_id = data2.toInt();
2477 int actor_id = data1.toInt();
2478 int target_id = data2.toInt();
2488 int actor_id = data1.toInt();
2489 int target_id = data2.toInt();
2499 int actor_id = data1.toInt();
2500 int target_id = data2.toInt();
2510 int actor_id = data1.toInt();
2511 int target_id = data2.toInt();
2521 int actor_id = data1.toInt();
2522 int target_id = data2.toInt();
2532 int actor_id = data1.toInt();
2533 int target_id = data2.toInt();
2543 int actor_id = data1.toInt();
2544 int target_id = data2.toInt();
2549 actor_id, target_id, 0,
"");
2558 int actor_id = data1.toInt();
2559 int target_id = data2.toInt();
2564 actor_id, target_id, 0,
"");
2573 int actor_id = data1.toInt();
2574 int target_id = data2.toInt();
2579 actor_id, target_id, 0,
"");
2588 int actor_id = data1.toInt();
2589 int target_id = data2.toInt();
2594 actor_id, target_id, 0,
"");
2603 int actor_id = data1.toInt();
2604 int target_id = data2.toInt();
2609 actor_id, target_id, 0,
"");
2618 int actor_id = data1.toInt();
2619 int target_id = data2.toInt();
2624 actor_id, target_id, 0,
"");
2633 int actor_id = data1.toInt();
2634 int target_id = data2.toInt();
2645 int actor_id = data1.toInt();
2646 int target_id = data2.toInt();
2657 int actor_id = data1.toInt();
2658 int target_id = data2.toInt();
2667static void bombard(QVariant data1, QVariant data2)
2669 int actor_id = data1.toInt();
2670 int target_id = data2.toInt();
2681 int actor_id = data1.toInt();
2682 int target_id = data2.toInt();
2693 int actor_id = data1.toInt();
2694 int target_id = data2.toInt();
2705 int actor_id = data1.toInt();
2708 actor_id, actor_id);
2716 int actor_id = data1.toInt();
2717 int target_id = data2.toInt();
2722 actor_id, target_id, 0,
"");
2731 int actor_id = data1.toInt();
2732 int target_id = data2.toInt();
2737 actor_id, target_id, 0,
"");
2744static void plant(QVariant data1, QVariant data2)
2746 int actor_id = data1.toInt();
2747 int target_id = data2.toInt();
2752 actor_id, target_id, 0,
"");
2759static void pillage(QVariant data1, QVariant data2)
2761 int actor_id = data1.toInt();
2762 int target_id = data2.toInt();
2767 actor_id, target_id,
2781 int actor_id = data1.toInt();
2782 int target_id = data2.toInt();
2787 actor_id, target_id,
2801 int actor_id = data1.toInt();
2802 int target_id = data2.toInt();
2807 actor_id, target_id,
2819static void road(QVariant data1, QVariant data2)
2821 int actor_id = data1.toInt();
2822 int target_id = data2.toInt();
2828 actor_id, target_id,
2840static void base(QVariant data1, QVariant data2)
2842 int actor_id = data1.toInt();
2843 int target_id = data2.toInt();
2849 actor_id, target_id,
2861static void mine(QVariant data1, QVariant data2)
2863 int actor_id = data1.toInt();
2864 int target_id = data2.toInt();
2870 actor_id, target_id,
2884 int actor_id = data1.toInt();
2885 int target_id = data2.toInt();
2891 actor_id, target_id,
2903static void nuke(QVariant data1, QVariant data2)
2905 int diplomat_id = data1.toInt();
2906 int diplomat_target_id = data2.toInt();
2911 diplomat_id, diplomat_target_id, 0,
"");
2918static void attack(QVariant data1, QVariant data2)
2920 int diplomat_id = data1.toInt();
2921 int diplomat_target_id = data2.toInt();
2926 diplomat_id, diplomat_target_id, 0,
"");
2935 int diplomat_id = data1.toInt();
2936 int diplomat_target_id = data2.toInt();
2941 diplomat_id, diplomat_target_id, 0,
"");
2950 int actor_id = data1.toInt();
2951 int target_id = data2.toInt();
2956 actor_id, target_id, 0,
"");
2965 int actor_id = data1.toInt();
2966 int target_id = data2.toInt();
2971 actor_id, target_id, 0,
"");
2980 int actor_id = data1.toInt();
2981 int target_id = data2.toInt();
2986 actor_id, target_id, 0,
"");
2995 int actor_id = data1.toInt();
2996 int target_id = data2.toInt();
3001 actor_id, target_id, 0,
"");
3010 int actor_id = data1.toInt();
3011 int target_id = data2.toInt();
3016 actor_id, target_id, 0,
"");
3025 int actor_id = data1.toInt();
3026 int target_id = data2.toInt();
3031 actor_id, target_id, 0,
"");
3040 int actor_id = data1.toInt();
3041 int target_id = data2.toInt();
3046 actor_id, target_id, 0,
"");
3059 int diplomat_id = data1.toInt();
3060 int diplomat_target_id = data2.toInt();
3063 struct player *pvictim = NULL;
3065 QList<QVariant> actor_and_target;
3067 cd =
gui()->get_diplo_dialog();
3072 if (pvcity ==
nullptr) {
3083 gui()->game_tab_widget,
3087 actor_and_target.append(diplomat_id);
3088 actor_and_target.append(diplomat_target_id);
3089 actor_and_target.append(act_id);
3090 qv1 = QVariant::fromValue(actor_and_target);
3104 .replace(
"&",
"&&");
3111 astr_set(&stra,
_(
"At %s's Discretion"),
3114 str = QString(
astr_str(&stra)).replace(
"&",
"&&");
3145 int diplomat_id = data1.toList().at(0).toInt();
3146 int diplomat_target_id = data1.toList().at(1).toInt();
3147 action_id act_id = data1.toList().at(2).toInt();
3151 if (data2.toInt() ==
A_UNSET) {
3154 diplomat_id, diplomat_target_id, data2.toInt(),
"");
3158 diplomat_target_id, data2.toInt(),
"");
3168 int actor_id = data1.toInt();
3169 int target_id = data2.toInt();
3185 int diplomat_id = data1.toInt();
3186 int diplomat_target_id = data2.toInt();
3194 diplomat_target_id);
3203 int diplomat_id = data1.toInt();
3204 int diplomat_target_id = data2.toInt();
3213 diplomat_id, diplomat_target_id);
3222 int diplomat_id = data1.toInt();
3223 int diplomat_target_id = data2.toInt();
3228 diplomat_id, diplomat_target_id, 0,
"");
3237 int diplomat_id = data1.toInt();
3238 int diplomat_target_id = data2.toInt();
3243 diplomat_id, diplomat_target_id, 0,
"");
3252 int diplomat_id = data1.toInt();
3253 int diplomat_target_id = data2.toInt();
3258 diplomat_id, diplomat_target_id, 0,
"");
3267 int diplomat_id = data1.toInt();
3268 int diplomat_target_id = data2.toInt();
3273 diplomat_id, diplomat_target_id, 0,
"");
3282 int actor_id = data1.toInt();
3283 int target_id = data2.toInt();
3288 actor_id, target_id, 0,
"");
3297 int diplomat_id = data1.toInt();
3298 int diplomat_target_id = data2.toInt();
3303 diplomat_id, diplomat_target_id, 0,
"");
3312 int diplomat_id = data1.toInt();
3313 int diplomat_target_id = data2.toInt();
3318 diplomat_id, diplomat_target_id, 0,
"");
3327 int diplomat_id = data1.toInt();
3328 int diplomat_target_id = data2.toInt();
3333 diplomat_id, diplomat_target_id, 0,
"");
3342 int diplomat_id = data1.toInt();
3343 int diplomat_target_id = data2.toInt();
3348 diplomat_id, diplomat_target_id, 0,
"");
3357 int diplomat_id = data1.toInt();
3358 int diplomat_target_id = data2.toInt();
3363 diplomat_id, diplomat_target_id, 0,
"");
3372 int diplomat_id = data1.toInt();
3373 int diplomat_target_id = data2.toInt();
3378 diplomat_target_id, 0,
"");
3387 int diplomat_id = data1.toInt();
3388 int diplomat_target_id = data2.toInt();
3393 diplomat_target_id, 0,
"");
3402 int diplomat_id = data1.toInt();
3403 int diplomat_target_id = data2.toInt();
3408 diplomat_target_id, 0,
"");
3417 int diplomat_id = data1.toInt();
3418 int diplomat_target_id = data2.toInt();
3423 diplomat_target_id, 0,
"");
3432 int diplomat_id = data1.toInt();
3433 int diplomat_target_id = data2.toInt();
3438 diplomat_target_id,
B_LAST + 1,
"");
3447 int diplomat_id = data1.toInt();
3448 int diplomat_target_id = data2.toInt();
3453 diplomat_target_id,
B_LAST + 1,
"");
3462 int diplomat_id = data1.toInt();
3463 int diplomat_target_id = data2.toInt();
3468 diplomat_target_id,
A_UNSET,
"");
3477 int diplomat_id = data1.toInt();
3478 int diplomat_target_id = data2.toInt();
3483 diplomat_target_id,
A_UNSET,
"");
3492 int diplomat_id = data1.toInt();
3493 int diplomat_target_id = data2.toInt();
3501 diplomat_target_id);
3510 int diplomat_id = data1.toInt();
3511 int diplomat_target_id = data2.toInt();
3519 diplomat_target_id);
3528 int actor_id = data1.toInt();
3529 int target_id = data2.toInt();
3534 actor_id, target_id, 0,
"");
3543 const struct action *paction)
3548 int diplomat_target_id = tcity->
id;
3549 const int act_id = paction->
id;
3555 "Treasury contains %d gold.",
3565 impossible->setStandardButtons(QMessageBox::Ok);
3566 impossible->setAttribute(Qt::WA_DeleteOnClose);
3572 PL_(
"Incite a revolt for %d gold?\n%s",
3573 "Incite a revolt for %d gold?\n%s",
cost),
cost, buf);
3574 ask->setStandardButtons(QMessageBox::Cancel | QMessageBox::Ok);
3575 ask->setDefaultButton(QMessageBox::Cancel);
3577 ask->setAttribute(Qt::WA_DeleteOnClose);
3578 QObject::connect(ask, &hud_message_box::accepted, [=]() {
3588 PL_(
"Inciting a revolt costs %d gold.\n%s",
3589 "Inciting a revolt costs %d gold.\n%s",
cost),
cost,
3592 too_much->setStandardButtons(QMessageBox::Ok);
3593 too_much->setAttribute(Qt::WA_DeleteOnClose);
3605 const struct action *paction)
3611 int diplomat_target_id = tunit->
id;
3612 const int act_id = paction->
id;
3618 "Treasury contains %d gold.",
3624 "Bribe unit for %d gold?\n%s",
3627 ask->setStandardButtons(QMessageBox::Cancel | QMessageBox::Ok);
3628 ask->setDefaultButton(QMessageBox::Cancel);
3629 ask->setAttribute(Qt::WA_DeleteOnClose);
3630 QObject::connect(ask, &hud_message_box::accepted, [=]() {
3638 PL_(
"Bribing the unit costs %d gold.\n%s",
3639 "Bribing the unit costs %d gold.\n%s",
cost),
cost, buf);
3641 ask->setAttribute(Qt::WA_DeleteOnClose);
3658 what = data1.toInt();
3659 punit_id = data2.toInt();
3673 int diplomat_id = data1.toList().at(0).toInt();
3674 int diplomat_target_id = data1.toList().at(1).toInt();
3675 action_id act_id = data1.toList().at(2).toInt();
3679 if (data2.toInt() ==
B_LAST) {
3682 diplomat_id, diplomat_target_id, data2.toInt(),
3684 }
else if (data2.toInt() == -1) {
3687 diplomat_id, diplomat_target_id, data2.toInt(),
3692 diplomat_target_id, data2.toInt(),
"");
3702 const struct action *paction)
3707 int diplomat_target_id = tcity->
id;
3710 _(
"Select Improvement to Sabotage"),
3711 gui()->game_tab_widget,
3715 QList<QVariant> actor_and_target;
3721 actor_and_target.append(diplomat_id);
3722 actor_and_target.append(diplomat_target_id);
3723 actor_and_target.append(paction->
id);
3724 qv1 = QVariant::fromValue(actor_and_target);
3734 if (pimprove->sabotage > 0) {
3738 .replace(
"&",
"&&");
3747 astr_set(&stra,
_(
"At %s's Discretion"),
3750 str = QString(
astr_str(&stra)).replace(
"&",
"&&");
3774 cd =
new choice_dialog(
_(
"What To Pillage"),
_(
"Select what to pillage:"),
3775 gui()->game_tab_widget);
3802 setAttribute(Qt::WA_DeleteOnClose);
3809 str = QString(
PL_(
"Are you sure you want to disband that %1 unit?",
3810 "Are you sure you want to disband those %1 units?",
3811 unit_list_size(punits))).arg(unit_list_size(punits));
3812 pb = addButton(
_(
"Yes"), QMessageBox::AcceptRole);
3813 addButton(
_(
"No"), QMessageBox::RejectRole);
3815 setDefaultButton(pb);
3858 title = QString(
_(
"Modpack suggests using %1 tileset."))
3860 text = QString(
"It might not work with other tilesets.\n"
3861 "You are currently using tileset %1.")
3863 ask->addButton(
_(
"Keep current tileset"), QMessageBox::RejectRole);
3864 ask->addButton(
_(
"Load tileset"), QMessageBox::AcceptRole);
3866 ask->setAttribute(Qt::WA_DeleteOnClose);
3868 QObject::connect(ask, &hud_message_box::accepted, [=]() {
3871 gui()->map_scale)) {
3873 _(
"Can't load requested tileset."));
3889 title = QString(
_(
"Modpack suggests using %1 soundset."))
3891 text = QString(
"It might not work with other tilesets.\n"
3892 "You are currently using soundset %1.")
3894 ask->addButton(
_(
"Keep current soundset"), QMessageBox::RejectRole);
3895 ask->addButton(
_(
"Load soundset"), QMessageBox::AcceptRole);
3897 ask->setAttribute(Qt::WA_DeleteOnClose);
3898 QObject::connect(ask, &hud_message_box::accepted, [=]() {
3914 title = QString(
_(
"Modpack suggests using %1 musicset."))
3916 text = QString(
"It might not work with other tilesets.\n"
3917 "You are currently using musicset %1.")
3919 ask->addButton(
_(
"Keep current musicset"), QMessageBox::RejectRole);
3920 ask->addButton(
_(
"Load musicset"), QMessageBox::AcceptRole);
3922 ask->setAttribute(Qt::WA_DeleteOnClose);
3923 QObject::connect(ask, &hud_message_box::accepted, [=]() {
3944 QList<notify_dialog *> nd_list;
3948 for (i = 0; i < nd_list.count(); i++) {
3961 QList <choice_dialog *> cd_list;
3962 QList <notify_dialog *> nd_list;
3965 QApplication::alert(
gui()->central_wdg);
3967 for (i = 0; i < cd_list.count(); i++) {
3968 cd_list[i]->close();
3971 for (i = 0; i < nd_list.count(); i++) {
3972 nd_list[i]->close();
3983 gui()->popdown_unit_sel();
3987 if (gtd !=
nullptr) {
4091 asd =
gui()->get_diplo_dialog();
4094 "The action selection dialog should have been open");
4100 "The action selection dialog is for another actor unit.");
4107 if (cancel_button != NULL) {
4114 if (wait_button != NULL) {
4141 "Action enabled against non existing unit!");
4152 "Action enabled against non existing city!");
4165 "Action enabled against all units on "
4166 "non existing tile!");
4183 act, act_probs, custom,
4192 if (wait_button != NULL || cancel_button != NULL) {
4206 cd =
gui()->get_diplo_dialog();
4228 if (std_gui !=
nullptr) {
4234 if (std_gui !=
nullptr ||
fatal) {
4236 QMessageBox *ask =
new QMessageBox(parent);
4240 _(
"Tileset \"%s\" problem, it's probably incompatible with "
4244 _(
"Tileset problem, it's probably incompatible with "
4245 "the ruleset:\n%s"), msg);
4249 ask->setStandardButtons(QMessageBox::Ok);
4250 ask->setWindowTitle(
_(
"Tileset error"));
4252 if (std_gui !=
nullptr) {
4253 ask->setAttribute(Qt::WA_DeleteOnClose);
4269 QVector<int> *punit_ids;
4271 if (!punits || unit_list_size(punits) == 0) {
4277 punit_ids =
new QVector<int>();
4279 punit_ids->push_back(
punit->
id);
4283 title =
_(
"Upgrade Unit!");
4284 ask->setStandardButtons(QMessageBox::Ok);
4286 title =
_(
"Upgrade Obsolete Units");
4287 ask->setStandardButtons(QMessageBox::Cancel | QMessageBox::Ok);
4288 ask->setDefaultButton(QMessageBox::Cancel);
4291 ask->setAttribute(Qt::WA_DeleteOnClose);
4292 QObject::connect(ask, &hud_message_box::accepted, [=]() {
4293 std::unique_ptr<QVector<int>> uptr(punit_ids);
4296 for (
int id : *uptr) {
4318 ufont.setItalic(
true);
4323 p = mapFromGlobal(QCursor::pos());
4325 setMouseTracking(
true);
4326 final_p.setX(p.x());
4327 final_p.setY(p.y());
4328 if (p.x() +
width() > parentWidget()->
width()) {
4329 final_p.setX(parentWidget()->
width() -
width());
4331 if (p.y() -
height() < 0) {
4338 QTimer::singleShot(10,
this, SLOT(
update_img()));
4361 QList <QPixmap*>pix_list;
4368 struct canvas *unit_pixmap;
4391 if (
h_pix !=
nullptr) {
4395 h_pix->fill(palette().
color(QPalette::HighlightedText));
4410 pix->fill(Qt::transparent);
4414 unit_pixmap->
map_pixmap.fill(Qt::transparent);
4418 cropped_img =
img.copy(crop);
4422 Qt::KeepAspectRatio,
4423 Qt::SmoothTransformation);
4427 Qt::KeepAspectRatio,
4428 Qt::SmoothTransformation);
4430 pixc = QPixmap::fromImage(
img);
4431 pixp =
new QPixmap(pixc);
4432 pix_list.push_back(pixp);
4438 ufont.setPixelSize(a);
4440 pen.setColor(palette().
color(QPalette::Text));
4443 while (!pix_list.isEmpty()) {
4444 tmp_pix = pix_list.takeFirst();
4451 Q_ASSERT(
punit != NULL);
4454 p.drawPixmap(x, y, *
h_pix);
4455 p.drawPixmap(x, y, *tmp_pix);
4457 p.drawPixmap(x, y, *tmp_pix);
4472 str = QString(
_(
"MP:")) +
str;
4480 setFixedWidth(
pix->width() + 20);
4481 setFixedHeight(
pix->height() + 2 * (fm.height() + 6));
4482 qDeleteAll(pix_list.begin(), pix_list.end());
4494 QPoint
pos =
event->pos();
4500 if (x >
width() - 11
4501 || y >
height() - fm.height() - 5
4502 || y < fm.height() + 3 || x < 11) {
4506 b = (y - fm.height() - 3) /
item_size.height();
4523 if (
event->button() == Qt::RightButton) {
4565 if (point_size < 0) {
4566 f_size = &pixel_size;
4568 f_size = &point_size;
4577 str2 = QString(
_(
"%1 HP:%2/%3")).arg(QString(
astr_str(&addition)),
4582 str = QString(
PL_(
"%1 unit",
"%1 units",
4585 for (i = *f_size; i > 4; i--) {
4586 if (point_size < 0) {
4592 if (10 + qfm.horizontalAdvance(str2) <
width()) {
4598 painter->drawPixmap(10, h + 3, *
pix);
4599 pen.setColor(palette().
color(QPalette::Text));
4600 painter->setPen(pen);
4602 painter->drawText(10, h,
str);
4604 painter->drawText(10,
height() - 5, str2);
4609 float page_height = 3.0f / maxl;
4610 float page_start = (
static_cast<float>(
show_line)) / maxl;
4611 pen.setColor(palette().color(QPalette::HighlightedText));
4612 painter->setBrush(palette().color(QPalette::HighlightedText).darker());
4613 painter->setPen(palette().color(QPalette::HighlightedText).darker());
4614 painter->drawRect(
pix->width() + 10, h, 8, h +
pix->height());
4615 painter->setPen(pen);
4616 painter->drawRoundedRect(
pix->width() + 10,
4617 h + page_start *
pix->height(),
4618 8, h + page_height *
pix->height(), 2, 2);
4621 if (point_size < 0) {
4636 painter.begin(
this);
4661 if (
utile == NULL) {
4668 if (
utile !=
nullptr) {
4670 if (punit_list !=
nullptr) {
4689 gui()->mapview_wdg->setFocus();
4690 QWidget::closeEvent(
event);
4703 nr = qCeil(
static_cast<qreal
>(unit_list_size(
utile->
units)) / 4) - 3;
4704 if (
event->angleDelta().y() < 0) {
4722 if (
event->key() == Qt::Key_Escape) {
4727 QWidget::keyPressEvent(
event);
4763 struct unit_list *potential_transports = unit_list_new();
4764#ifndef FREECIV_NDEBUG
4770 unit_list_append(potential_transports, ptransport);
4774 tcount = unit_list_size(potential_transports);
4778 unit_list_destroy(potential_transports);
4781 }
else if (tcount == 1) {
4783 fc_assert(unit_list_get(potential_transports, 0) == best_transport);
4786 unit_list_destroy(potential_transports);
4801 int attacker_hp,
int defender_hp,
4802 bool make_att_veteran,
bool make_def_veteran)
4804 if (
gui()->qt_settings.show_battle_log) {
4807 attacker_hp, defender_hp,
4810 gui()->battlelog_wdg->scale,
4811 gui()->battlelog_wdg);
4813 gui()->battlelog_wdg->add_combat_info(huc);
4814 gui()->battlelog_wdg->show();
const char * action_prepare_ui_name(action_id act_id, const char *mnemonic, const struct act_prob prob, const char *custom)
bool action_prob_possible(const struct act_prob probability)
static struct action * action_by_number(action_id act_id)
#define action_iterate_end
#define action_id_get_actor_kind(act_id)
#define action_iterate(_act_)
#define action_id_get_target_kind(act_id)
void astr_free(struct astring *astr)
void astr_set(struct astring *astr, const char *format,...)
static const char * astr_str(const struct astring *astr) fc__attribute((nonnull(1)))
void audio_restart(const char *soundset_name, const char *musicset_name)
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
void output_window_append(const struct ft_color color, const char *featured_text)
const char * city_improvement_name_translation(const struct city *pcity, const struct impr_type *pimprove)
const char * city_name_get(const struct city *pcity)
#define INCITE_IMPOSSIBLE_COST
#define city_owner(_pcity_)
#define city_built_iterate(_pcity, _p)
#define city_built_iterate_end
void qtg_real_city_dialog_popup(struct city *pcity)
void stack_button(Choice_dialog_button *button)
struct unit * targeted_unit
void unstack_all_buttons()
Choice_dialog_button * get_identified_button(const int id)
QPushButton * target_unit_button
void update_dialog(const struct act_prob *act_probs)
QList< Choice_dialog_button * > last_buttons_stack
choice_dialog(const QString title, const QString text, QWidget *parent=NULL, void(*run_on_close_in)(int)=NULL)
QVBoxLayout * get_layout()
QList< Choice_dialog_button * > buttons_list
void(* run_on_close)(int)
QList< Choice_dialog_button * > action_button_map
int sub_target_id[ASTK_COUNT]
void execute_action(const int action)
void add_item(QString title, pfcn_void func, QVariant data1, QVariant data2, QString tool_tip, const int button_id)
disband_box(struct unit_list *punits, QWidget *parent=0)
struct unit_list * cpunits
choice_dialog * opened_dialog
choice_dialog * get_diplo_dialog()
void set_diplo_dialog(choice_dialog *widget)
static fc_font * instance()
QFont * get_font(QString name)
QPixmap * get_pixmap(const QString &id)
static fc_icons * instance()
int set_text_title(QString s1, QString s2, bool return_exec=false)
void mouseReleaseEvent(QMouseEvent *event)
notify_dialog(const char *caption, const char *headline, const char *lines, QWidget *parent=0)
void calc_size(int &x, int &y)
void paintEvent(QPaintEvent *paint_event)
void mouseMoveEvent(QMouseEvent *event)
virtual void update_menu()
void mousePressEvent(QMouseEvent *event)
notify_goto(const char *headline, const char *lines, const struct text_tag_list *tags, struct tile *ptile, QWidget *parent)
QPushButton * inspect_but
static qdef_act * action()
static qdef_act * m_instance
void paintEvent(QPaintEvent *event)
void mouseMoveEvent(QMouseEvent *event)
void mousePressEvent(QMouseEvent *event)
void mouseReleaseEvent(QMouseEvent *event)
qfc_dialog(QWidget *parent)
void style_selected(const QItemSelection &sl, const QItemSelection &ds)
QTableWidget * selected_nation_tabs
QPushButton * random_button
void nation_selected(const QItemSelection &sl, const QItemSelection &ds)
void nationset_changed(int index)
void leader_selected(int index)
void group_selected(const QItemSelection &sl, const QItemSelection &ds)
void set_index(int index)
QButtonGroup * sex_buttons
void update_nationset_combo()
races_dialog(struct player *pplayer, QWidget *parent=0)
QTableWidget * nation_tabs
QGridLayout * main_layout
void closeEvent(QCloseEvent *event)
void mouseMoveEvent(QMouseEvent *event)
void paint(QPainter *painter, QPaintEvent *event)
QList< unit * > unit_list
units_select(struct tile *ptile, QWidget *parent)
void paintEvent(QPaintEvent *event)
void wheelEvent(QWheelEvent *event)
void keyPressEvent(QKeyEvent *event)
void mousePressEvent(QMouseEvent *event)
bool client_is_global_observer(void)
enum client_states client_state(void)
void client_unit_init_act_prob_cache(struct unit *punit)
void action_selection_no_longer_in_progress(const int old_actor_id)
void request_unit_load(struct unit *pcargo, struct unit *ptrans, struct tile *ptile)
void unit_focus_set(struct unit *punit)
void request_do_action(action_id action, int actor_id, int target_id, int sub_tgt, const char *name)
void request_unit_disband(struct unit *punit)
void request_action_details(action_id action, int actor_id, int target_id)
void request_new_unit_activity_targeted(struct unit *punit, enum unit_activity act, struct extra_type *tgt)
void action_decision_clear_want(const int old_actor_id)
struct unit * head_of_units_in_focus(void)
void request_unit_upgrade(struct unit *punit)
void action_selection_next_in_focus(const int old_actor_id)
bool qtg_handmade_scenario_warning()
static void attack(QVariant data1, QVariant data2)
char forced_tileset_name[512]
int action_selection_target_extra(void)
static void destroy_city(QVariant data1, QVariant data2)
static void spy_sabotage_unit(QVariant data1, QVariant data2)
static void pillage(QVariant data1, QVariant data2)
static void caravan_marketplace(QVariant data1, QVariant data2)
static void clean_pollution(QVariant data1, QVariant data2)
static void spy_steal_shared(QVariant data1, QVariant data2, action_id act_id)
static void clean_fallout(QVariant data1, QVariant data2)
static void spy_sabotage(QVariant data1, QVariant data2)
int action_selection_target_tile(void)
static void spy_investigate(QVariant data1, QVariant data2)
static void act_sel_wait(QVariant data1, QVariant data2)
static void nuke_units(QVariant data1, QVariant data2)
int action_selection_actor_unit(void)
static void capture_units(QVariant data1, QVariant data2)
static void road(QVariant data1, QVariant data2)
static bool is_race_dialog_open
bool try_default_unit_action(QVariant q1, QVariant q2)
static void fortify(QVariant data1, QVariant data2)
static void transport_board(QVariant data1, QVariant data2)
static void spy_sabotage_unit_esc(QVariant data1, QVariant data2)
static void disband_unit(QVariant data1, QVariant data2)
static void spy_steal_gold(QVariant data1, QVariant data2)
void popdown_players_report()
static void mine(QVariant data1, QVariant data2)
void popup_musicset_suggestion_dialog(void)
static void spy_steal_gold_esc(QVariant data1, QVariant data2)
static void diplomat_embassy(QVariant data1, QVariant data2)
void unit_select_dialog_popup(struct tile *ptile)
void popup_upgrade_dialog(struct unit_list *punits)
void update_nationset_combo()
void action_selection_close(void)
static void cultivate(QVariant data1, QVariant data2)
static void paradrop_enter(QVariant data1, QVariant data2)
void races_update_pickable(bool nationset_change)
int action_selection_target_city(void)
static void spy_steal_something(QVariant data1, QVariant data2)
void popup_notify_goto_dialog(const char *headline, const char *lines, const struct text_tag_list *tags, struct tile *ptile)
static void spy_poison(QVariant data1, QVariant data2)
void show_tech_gained_dialog(Tech_type_id tech)
static void base(QVariant data1, QVariant data2)
static void spy_nuke_city_esc(QVariant data1, QVariant data2)
void popup_soundset_suggestion_dialog(void)
static void enter_hut2(QVariant data1, QVariant data2)
void popup_races_dialog(struct player *pplayer)
static void expel_unit(QVariant data1, QVariant data2)
static void paradrop_frighten(QVariant data1, QVariant data2)
static void diplomat_sabotage(QVariant data1, QVariant data2)
void popup_disband_dialog(struct unit_list *punits)
static action_id get_non_targeted_action_id(action_id tgt_action_id)
static void homeless(QVariant data1, QVariant data2)
static void caravan_help_build(QVariant data1, QVariant data2)
static void bombard(QVariant data1, QVariant data2)
void popdown_races_dialog(void)
void popup_tileset_suggestion_dialog(void)
static void conquer_city(QVariant data1, QVariant data2)
void revolution_response(struct government *gov)
void popdown_economy_report()
static void join_city(QVariant data1, QVariant data2)
static void spy_request_sabotage_list(QVariant data1, QVariant data2)
static void diplomat_bribe(QVariant data1, QVariant data2)
static void unit_disband_recover(QVariant data1, QVariant data2)
static void spy_steal(QVariant data1, QVariant data2)
static void airlift(QVariant data1, QVariant data2)
void popup_pillage_dialog(struct unit *punit, bv_extras extras)
void popup_sabotage_dialog(struct unit *actor, struct city *tcity, const struct action *paction)
static void transport_alight(QVariant data1, QVariant data2)
static void plant(QVariant data1, QVariant data2)
static void nuke(QVariant data1, QVariant data2)
static void disembark2(QVariant data1, QVariant data2)
static void transport_unload(QVariant data1, QVariant data2)
void action_selection_refresh(struct unit *actor_unit, struct city *target_city, struct unit *target_unit, struct tile *target_tile, struct extra_type *target_extra, const struct act_prob *act_probs)
void popdown_science_report()
static void diplomat_steal(QVariant data1, QVariant data2)
static void unit_upgrade(QVariant data1, QVariant data2)
bool popup_theme_suggestion_dialog(const char *theme_name)
static void enter_hut(QVariant data1, QVariant data2)
static void spy_request_strike_bld_list(QVariant data1, QVariant data2)
static void diplomat_incite_escape(QVariant data1, QVariant data2)
static void found_city(QVariant data1, QVariant data2)
static void diplomat_investigate(QVariant data1, QVariant data2)
void qtg_popup_combat_info(int attacker_unit_id, int defender_unit_id, int attacker_hp, int defender_hp, bool make_att_veteran, bool make_def_veteran)
static void bombard3(QVariant data1, QVariant data2)
static void diplomat_incite(QVariant data1, QVariant data2)
static void paradrop_conquer(QVariant data1, QVariant data2)
void popdown_endgame_report()
static void diplomat_steal_esc(QVariant data1, QVariant data2)
static bool is_more_user_input_needed
static void bombard2(QVariant data1, QVariant data2)
void popup_incite_dialog(struct unit *actor, struct city *tcity, int cost, const struct action *paction)
static const QHash< action_id, pfcn_void > af_map_init(void)
void popdown_all_spaceships_dialogs()
static void nuke_city(QVariant data1, QVariant data2)
void popup_connect_msg(const char *headline, const char *message)
static void diplomat_sabotage_esc(QVariant data1, QVariant data2)
void popdown_units_report()
static void transport_embark2(QVariant data1, QVariant data2)
static void spy_nuke_city(QVariant data1, QVariant data2)
void unit_select_dialog_update_real(void *unused)
static void spy_steal_esc(QVariant data1, QVariant data2)
static void paradrop(QVariant data1, QVariant data2)
static void suicide_attack(QVariant data1, QVariant data2)
void races_toggles_set_sensitive(void)
static action_id get_production_targeted_action_id(action_id tgt_action_id)
static void paradrop_frighten_conquer(QVariant data1, QVariant data2)
static void convert_unit(QVariant data1, QVariant data2)
static bool did_not_decide
static void spy_poison_esc(QVariant data1, QVariant data2)
static void pillage_something(QVariant data1, QVariant data2)
static void spy_request_sabotage_esc_list(QVariant data1, QVariant data2)
static void transform_terrain(QVariant data1, QVariant data2)
static void conquer_extras(QVariant data1, QVariant data2)
static void regular_move(QVariant data1, QVariant data2)
static void heal_unit2(QVariant data1, QVariant data2)
static void spy_embassy(QVariant data1, QVariant data2)
static races_dialog * race_dialog
static void frighten_hut2(QVariant data1, QVariant data2)
static void conquer_city2(QVariant data1, QVariant data2)
static void conquer_extras2(QVariant data1, QVariant data2)
static void frighten_hut(QVariant data1, QVariant data2)
bool qtg_request_transport(struct unit *pcargo, struct tile *ptile)
int action_selection_target_unit(void)
static void irrigate(QVariant data1, QVariant data2)
static void transport_embark3(QVariant data1, QVariant data2)
static void heal_unit(QVariant data1, QVariant data2)
void popdown_city_report()
static void paradrop_enter_conquer(QVariant data1, QVariant data2)
static void unit_home_city(QVariant data1, QVariant data2)
static void transport_embark(QVariant data1, QVariant data2)
bool try_default_city_action(QVariant q1, QVariant q2)
static void keep_moving(QVariant data1, QVariant data2)
static void spy_steal_maps_esc(QVariant data1, QVariant data2)
static void action_entry_update(Choice_dialog_button *button, action_id act, const struct act_prob *act_probs, const char *custom, QVariant data1, QVariant data2)
static void disembark1(QVariant data1, QVariant data2)
void restart_notify_dialogs()
static bool is_showing_pillage_dialog
static void action_entry(choice_dialog *cd, action_id act, const struct act_prob *act_probs, const char *custom, QVariant data1, QVariant data2)
static const QHash< action_id, pfcn_void > af_map
static void caravan_establish_trade(QVariant data1, QVariant data2)
void popdown_all_game_dialogs(void)
static void spy_steal_maps(QVariant data1, QVariant data2)
struct unit struct city struct unit * target_unit
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 int const struct action *paction show_tileset_error
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id popup_bribe_dialog
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit * actor
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs action_selection_no_longer_in_progress_gui_specific
const char const char * headline
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 int const struct action *paction bool fatal
struct unit struct city struct unit struct tile * target_tile
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
struct unit struct city * target_city
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 int cost
struct unit struct city struct unit struct tile struct extra_type * target_extra
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 int const struct action *paction bool const char * tset_name
#define IDENTITY_NUMBER_ZERO
#define PL_(String1, String2, n)
const struct ft_color ftc_client
struct unit * game_unit_by_number(int id)
struct city * game_city_by_number(int id)
struct government * government_by_number(const Government_type_id gov)
Government_type_id government_number(const struct government *pgovern)
int action_selection_target_extra(void)
static void diplomat_queue_handle_primary(void)
static void diplomat_queue_handle_secondary(void)
void action_selection_refresh(struct unit *actor_unit, struct city *target_city, struct unit *target_unit, struct tile *target_tile, struct extra_type *target_extra, const struct act_prob *act_probs)
void popdown_help_dialog(void)
void(* pfcn_void)(QVariant, QVariant)
#define mevent_gpos(__ev__)
#define CAPTURE_DEFAULT_THIS
void nationset_changed(void)
void popup_revolution_dialog(void)
void helptext_nation(char *buf, size_t bufsz, struct nation_type *pnation, const char *user_text)
Impr_type_id improvement_number(const struct impr_type *pimprove)
#define fc_assert_msg(condition, message,...)
#define fc_assert(condition)
#define fc_assert_action(condition, action)
struct tile * index_to_tile(const struct civ_map *imap, int mindex)
void put_unit(const struct unit *punit, 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)
const char *const notify_label
Nation_type_id nation_number(const struct nation_type *pnation)
bool nation_leader_is_male(const struct nation_leader *pleader)
const char * nation_adjective_for_player(const struct player *pplayer)
const char * nation_adjective_translation(const struct nation_type *pnation)
struct nation_type * nation_by_number(const Nation_type_id nation)
int nation_set_index(const struct nation_set *pset)
bool is_nation_pickable(const struct nation_type *nation)
const struct nation_leader_list * nation_leaders(const struct nation_type *pnation)
const char * nation_set_name_translation(const struct nation_set *pset)
bool is_nation_playable(const struct nation_type *nation)
bool nation_is_in_group(const struct nation_type *pnation, const struct nation_group *pgroup)
const char * nation_set_description(const struct nation_set *pset)
const char * nation_group_name_translation(const struct nation_group *pgroup)
int nation_set_count(void)
struct nation_group * nation_group_by_number(int id)
struct nation_set * nation_set_by_rule_name(const char *name)
bool is_nation_group_hidden(struct nation_group *pgroup)
struct nation_set * nation_set_by_setting_value(const char *setting)
const char * nation_leader_name(const struct nation_leader *pleader)
int nation_group_count(void)
const char * nation_set_rule_name(const struct nation_set *pset)
struct nation_style * style_of_nation(const struct nation_type *pnation)
#define nation_leader_list_iterate(leaderlist, pleader)
#define nation_sets_iterate_end
#define nation_sets_iterate(NAME_pset)
#define nations_iterate_end
#define nations_iterate(NAME_pnation)
#define nation_leader_list_iterate_end
const struct option_set * server_optset
bool option_str_set(struct option *poption, const char *str)
const char * option_str_get(const struct option *poption)
struct option * optset_option_by_name(const struct option_set *poptset, const char *name)
#define REQEST_PLAYER_INITIATED
int dsend_packet_nation_select_req(struct connection *pc, int player_no, Nation_type_id nation_no, bool is_male, const char *name, int style)
int dsend_packet_unit_get_actions(struct connection *pc, int actor_unit_id16, int actor_unit_id32, int target_unit_id16, int target_unit_id32, int target_tile_id, int target_extra_id, int request_kind)
int dsend_packet_city_name_suggestion_req(struct connection *pc, int unit_id16, int unit_id32)
void start_revolution(void)
void set_government_choice(struct government *government)
int player_number(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)
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
bool research_invention_gettable(const struct research *presearch, const Tech_type_id tech, bool allow_holes)
struct packet_ruleset_control control
struct packet_game_info info
bool tech_steal_allow_holes
char preferred_soundset[MAX_LEN_NAME]
char preferred_tileset[MAX_LEN_NAME]
char preferred_musicset[MAX_LEN_NAME]
struct unit * autocaravan
struct unit::@80::@82 client
struct act_prob * act_prob_cache
const char * style_name_translation(const struct nation_style *pstyle)
int style_number(const struct nation_style *pstyle)
int basic_city_style_for_style(struct nation_style *pstyle)
#define styles_iterate(_p)
#define styles_iterate_end
int fc_snprintf(char *str, size_t n, const char *format,...)
#define sz_strlcpy(dest, src)
#define advance_index_iterate_end
#define advance_index_iterate(_start, _index)
struct extra_type * get_preferred_pillage(bv_extras extras)
bool get_units_upgrade_info(char *buf, size_t bufsz, struct unit_list *punits)
const char * get_act_sel_action_custom_text(struct action *paction, const struct act_prob prob, const struct unit *actor_unit, const struct city *target_city)
const char * act_sel_action_tool_tip(const struct action *paction, const struct act_prob prob)
struct city * tile_city(const struct tile *ptile)
int tileset_hex_width(const struct tileset *t)
int tileset_unit_width(const struct tileset *t)
int tileset_unit_height(const struct tileset *t)
bool tileset_is_isometric(const struct tileset *t)
struct sprite * get_sample_city_sprite(const struct tileset *t, int style_idx)
const char * tileset_basename(const struct tileset *t)
int tileset_hex_height(const struct tileset *t)
struct sprite * get_nation_flag_sprite(const struct tileset *t, const struct nation_type *pnation)
void tileset_error(enum log_level level, const char *tset_name, const char *format,...)
bool tilespec_reread(const char *new_tileset_name, bool game_fully_initialized, float scale)
struct unit * transporter_for_unit_at(const struct unit *pcargo, const struct tile *ptile)
bool could_unit_load(const struct unit *pcargo, const struct unit *ptrans)
bool unit_can_do_action(const struct unit *punit, const action_id act_id)
void unit_activity_astr(const struct unit *punit, struct astring *astr)
#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)
#define utype_fuel(ptype)