19#include <QApplication>
27#include <QRadioButton>
36#include <QWidgetAction>
128 if (
pix !=
nullptr) {
140 pix->fill(Qt::transparent);
156 if (
pix !=
nullptr) {
165 pix->fill(Qt::transparent);
178 if ((value() != minimum() && value() < maximum())
179 || (0 == minimum() && 0 == maximum())) {
200 if (
pix !=
nullptr) {
220 p.drawLine(
rx.topLeft(),
rx.topRight());
221 p.drawLine(
rx.bottomLeft(),
rx.bottomRight());
234 gx.setColorAt(0.5,
QColor(40, 40, 40));
246 p.setClipping(
false);
248 c =
palette().color(QPalette::Window);
252 if (
pix !=
nullptr) {
253 p.setCompositionMode(QPainter::CompositionMode_SourceOver);
255 *
static_cast<float>(
pix->width()) /
pix->height(),
260 c =
palette().color(QPalette::Text);
262 sfont->setCapitalization(QFont::AllUppercase);
263 sfont->setBold(
true);
270 i = text().indexOf(
'\n');
272 s2 = text().right(text().length() -
i);
281 p.setCompositionMode(QPainter::CompositionMode_ColorDodge);
284 if (
fm.horizontalAdvance(
s1) >
rx.width()) {
285 s1 =
fm.elidedText(
s1, Qt::ElideRight,
rx.width());
292 if (
fm.horizontalAdvance(
s2) >
rx.width()) {
293 s2 =
fm.elidedText(
s2, Qt::ElideRight,
rx.width());
299 p.drawText(
i / 2,
pbh - j / 3,
s2);
308 p.setCompositionMode(QPainter::CompositionMode_ColorDodge);
311 if (
fm.horizontalAdvance(s) >
rx.width()) {
312 s =
fm.elidedText(s, Qt::ElideRight,
rx.width());
337 a.setPoints(4, r.x(), r.y() + offset,
338 r.x() + r.width(), (r.y() + offset) -
size,
357 p.setRenderHint(QPainter::Antialiasing);
359 p.drawLine(0, 0, pix->width(), pix->height());
360 p.drawLine(pix->width(), 0, 0, pix->height());
485 QSizePolicy::MinimumExpanding,
486 QSizePolicy::Slider);
519 for (j = 0; j <
i; j++) {
565 for (j = 0; j <
i; j++) {
568 layout->addWidget(ui, 0, Qt::AlignVCenter);
613 if (
event->button() == Qt::LeftButton) {
629 PL_(
"Sell %s for %d gold?",
630 "Sell %s for %d gold?",
price),
633 ask->set_text_title(
buf, (
_(
"Sell improvement?")));
634 ask->setStandardButtons(QMessageBox::Cancel | QMessageBox::Ok);
635 ask->setAttribute(Qt::WA_DeleteOnClose);
636 connect(
ask, &hud_message_box::accepted, [=]() {
639 if (
pcity ==
nullptr) {
703 *
isosize, Qt::SmoothTransformation);
706 Qt::SmoothTransformation);
709 if (
tmp !=
nullptr) {
750 menu =
new QMenu(
gui()->central_wdg);
767 menu->addAction(
load);
786 menu->popup(
event->globalPos());
875 if (
punit ==
nullptr) {
971 QImage temp_img(unit_img.size(), QImage::Format_ARGB32_Premultiplied);
975 p.fillRect(0, 0, unit_img.width(), unit_img.height(),
977 p.drawImage(0, 0, unit_img);
1003 event->angleDelta(),
1017 if (
event->button() == Qt::LeftButton) {
1068 QSizePolicy::MinimumExpanding,
1069 QSizePolicy::Slider);
1085 event->angleDelta(),
1107 for (j = 0; j <
i; j++) {
1109 layout->addWidget(ui, 0, Qt::AlignVCenter);
1145 for (j = 0; j <
i; j++) {
1147 layout->removeWidget(ui);
1183 citnum =
event->pos().x() / w;
1212 view->map_pixmap.fill(Qt::black);
1285 Qt::KeepAspectRatio,
1286 Qt::SmoothTransformation);
1371 wid_act->setDefaultWidget(
new QLabel(
_(
"Autoworker activity:")));
1376 if (
pterr->plant_result !=
nullptr
1384 if (
pterr->cultivate_result !=
nullptr
1392 if (
pterr->transform_result !=
pterr &&
pterr->transform_result !=
nullptr
1407 if (
ptask !=
nullptr) {
1411 con_menu->setAttribute(Qt::WA_DeleteOnClose);
1412 connect(
con_menu, &QMenu::triggered,
1414 bool target =
false;
1463 if (tgt !=
nullptr) {
1484 QFont f = QApplication::font();
1497 QSizePolicy::Expanding);
1505 int h = 2 *
fm.height() + 2;
1522 lcity_name->setToolTip(
_(
"Click to change city name"));
1550 ql->setFont(*small_font);
1609 scroll->setWidgetResizable(
true);
1611 + scroll->horizontalScrollBar()->height());
1612 scroll->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
1616 scroll2->setWidgetResizable(
true);
1618 +
scroll2->horizontalScrollBar()->height());
1619 scroll2->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
1624 scroll3->setWidgetResizable(
true);
1626 +
scroll3->horizontalScrollBar()->height());
1627 scroll3->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
1629 scroll->setProperty(
"city_scroll",
true);
1630 scroll2->setProperty(
"city_scroll",
true);
1631 scroll3->setProperty(
"city_scroll",
true);
1646 label =
new QLabel();
1648 label->setToolTip(
_(
"Show buildings"));
1652 label =
new QLabel();
1654 label->setToolTip(
_(
"Show units"));
1661 label =
new QLabel();
1663 label->setToolTip(
_(
"Show wonders"));
1670 label =
new QLabel();
1672 label->setToolTip(
_(
"Show future targets"));
1680 prod_options->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
1683 button =
new QPushButton;
1686 button->setToolTip(
_(
"Close city dialog"));
1687 connect(
button, &QAbstractButton::clicked,
this, &QWidget::hide);
1706 button->setFixedSize(64, 64);
1740 v_layout->setContentsMargins(0 , 0 , 0, 0);
1746 v_layout->setContentsMargins(0 , 0 , 0, 0);
1752 v_layout->setContentsMargins(0 , 0 , 0, 0);
1774 QStyle::SP_DialogDiscardButton),
"");
1787 r4->setChecked(
true);
1792 p_table_p->setProperty(
"showGrid",
"false");
1793 p_table_p->setProperty(
"selectionBehavior",
"SelectRows");
1794 p_table_p->setEditTriggers(QAbstractItemView::NoEditTriggers);
1795 p_table_p->verticalHeader()->setVisible(
false);
1796 p_table_p->horizontalHeader()->setVisible(
false);
1797 p_table_p->setSelectionMode(QAbstractItemView::SingleSelection);
1800 p_table_p->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContentsOnFirstShow);
1801 p_table_p->setContextMenuPolicy(Qt::CustomContextMenu);
1802 p_table_p->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
1804 header->setStretchLastSection(
true);
1813 qgbprod->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
1819 &QWidget::customContextMenuRequested,
this,
1827 &QTableWidget::itemDoubleClicked,
1846 info_list <<
_(
"Cities:") <<
_(
"Luxuries:") <<
_(
"Buildings:")
1847 <<
_(
"Nationality:") <<
_(
"Units:") <<
_(
"Wonders:");
1852 lab2 =
new QLabel(
this);
1853 lab2->setFont(*small_font);
1855 lab2->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
1860 gridl->setSpacing(0);
1882 =
new QPushButton(style()->
standardIcon(QStyle::SP_DialogSaveButton),
1891 cma_table->setProperty(
"showGrid",
"false");
1892 cma_table->setProperty(
"selectionBehavior",
"SelectRows");
1893 cma_table->setEditTriggers(QAbstractItemView::NoEditTriggers);
1894 cma_table->setSelectionMode(QAbstractItemView::SingleSelection);
1895 cma_table->setContextMenuPolicy(Qt::CustomContextMenu);
1896 cma_table->verticalHeader()->setVisible(
false);
1897 cma_table->horizontalHeader()->setVisible(
false);
1898 cma_table->horizontalHeader()->setSectionResizeMode(
1899 QHeaderView::Stretch);
1907 &QWidget::customContextMenuRequested,
this,
1909 connect(
cma_table, &QTableWidget::cellDoubleClicked,
this,
1915 str_list <<
_(
"Food") <<
_(
"Shield") <<
_(
"Trade") <<
_(
"Gold")
1916 <<
_(
"Luxury") <<
_(
"Science") <<
_(
"Celebrate")
1917 <<
_(
"Maximize growth");
1937 slider->setFocusPolicy(Qt::TabFocus);
1939 slider->setRange(-20, 20);
1940 slider->setSingleStep(1);
1974 slider->setFocusPolicy(Qt::TabFocus);
1998 hbox->addStretch(10);
2000 govA->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
2017 top_widget->setSizePolicy(QSizePolicy::Minimum,
2018 QSizePolicy::Minimum);
2020 scroll_info->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
2027 QSizePolicy::MinimumExpanding);
2133 Qt::FindDirectChildrenOnly);
2144 Qt::FindDirectChildrenOnly);
2168 Qt::FindDirectChildrenOnly);
2179 Qt::FindDirectChildrenOnly);
2198 if (pplayer ==
nullptr
2207 view->setDisabled(
true);
2216 view->setEnabled(
true);
2240 if (pplayer !=
nullptr
2306 if (!
gui()->qt_settings.city_geometry.isNull()) {
2312 QRect rect = QApplication::primaryScreen()->availableGeometry();
2314 resize((rect.width() * 4) / 5, (rect.height() * 5) / 6);
2336 if (
event->type() == QEvent::KeyPress) {
2339 if (
event->type() == QEvent::ShortcutOverride) {
2341 if (
key_event->key() == Qt::Key_Right) {
2343 event->setAccepted(
true);
2348 event->setAccepted(
true);
2353 event->setAccepted(
true);
2358 event->setAccepted(
true);
2363 return QObject::eventFilter(
obj,
event);
2379 ask->set_text_title_definput(
_(
"What should we rename the city to?"),
2381 ask->setAttribute(Qt::WA_DeleteOnClose);
2382 connect(
ask, &hud_message_box::accepted,
this, [=]() {
2429 ask->set_text_title_definput(
_(
"What should we name the preset?"),
2430 _(
"Name new preset"),
2432 ask->setAttribute(Qt::WA_DeleteOnClose);
2433 connect(
ask, &hud_message_box::accepted,
this,
2438 if (!text.isEmpty()) {
2439 param.allow_disorder = false;
2440 param.allow_specialists = true;
2441 param.require_happy = cma_celeb_checkbox->isChecked();
2442 param.max_growth = cma_max_growth->isChecked();
2443 param.happy_factor = slider_tab[2 * O_LAST + 1]->value();
2445 for (int i = O_FOOD; i < O_LAST; i++) {
2446 param.minimal_surplus[i] = slider_tab[2 * i]->value();
2447 param.factor[i] = slider_tab[2 * i + 1]->value();
2528 int ind = index.row();
2568 label =
reinterpret_cast<QLabel *
>(
qvar.value<
void *>());
2569 label->setText(QString::number(param.
factor[output]));
2572 label =
reinterpret_cast<QLabel *
>(
qvar.value<
void *>());
2579 label =
reinterpret_cast<QLabel *
>(
qvar.value<
void *>());
2619 item->setText(
_(
"No governor defined"));
2626 pix = style()->standardPixmap(QStyle::SP_DialogApplyButton);
2627 pix = pix.scaled(2 * pix.width(), 2 * pix.height(),
2628 Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
2633 .arg(s.toHtmlEscaped()));
2636 pix = style()->standardPixmap(QStyle::SP_DialogCancelButton);
2637 pix = pix.scaled(1.6 * pix.width(), 1.6 * pix.height(),
2638 Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
2642 cma_result->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
2678 ask->setStandardButtons(QMessageBox::Cancel | QMessageBox::Ok);
2679 ask->setDefaultButton(QMessageBox::Cancel);
2680 ask->setAttribute(Qt::WA_DeleteOnClose);
2681 connect(
ask, &hud_message_box::accepted,
this,
2724 if (
qvar.isNull() || !
qvar.isValid()) {
2728 label =
reinterpret_cast<QLabel *
>(
qvar.value<
void *>());
2729 label->setText(QString::number(value));
2766 cma_menu->setAttribute(Qt::WA_DeleteOnClose);
2768 connect(
cma_menu, &QMenu::triggered,
this,
2789 QMap<QString, cid>::const_iterator
map_iter;
2810 if (
list.count() == 0) {
2830 disband =
options_menu->addAction(
_(
"Allow disbanding city"));
2831 disband->setCheckable(
true);
2833 connect(disband, &QAction::triggered,
this,
2892 value)).arg(QString::number(value));
2920 QRect dest_rect(0, 0, w, h);
2932 dest_rect.moveTo(
i * w, 0);
2952 dest_rect.moveTo(
i * w, 0);
3038 value =
new QLabel(
buf);
3040 "or higher than: %d"),
3043 if (
pcount->helptext !=
nullptr) {
3048 help =
new QLabel(helptext);
3050 name->setFont(*small_font);
3051 value->setFont(*small_font);
3053 help->setFont(*small_font);
3067 QFont f = QApplication::font();
3080 h =
fm.height() + 6;
3117 item->setText(
"FLAG MISSING");
3161 _(
"Population: %d, Specialists: %d"),
3233 "%5.1f%%", (
float) illness / 10.0);
3299 struct unit_list *units;
3310 if (pplayer !=
nullptr
3331 if (pplayer !=
nullptr
3379 if (pplayer ==
nullptr) {
3395 if (
i >=
size - 1) {
3415 if (pplayer ==
nullptr) {
3431 if (
i == 0 ||
i ==
size) {
3488 "Treasury contains %d gold.",
3492 "Buy %s for %d gold?", value),
3495 ask->setStandardButtons(QMessageBox::Cancel | QMessageBox::Ok);
3496 ask->setDefaultButton(QMessageBox::Cancel);
3497 ask->setAttribute(Qt::WA_DeleteOnClose);
3498 connect(
ask, &hud_message_box::accepted,
this, [=]() {
3515 QFont f = QApplication::font();
3532 h =
fm.height() + 6;
3594 if (
str.contains(
'[') &&
str.contains(
']')) {
3597 ii =
str.lastIndexOf(
'[');
3598 ij =
str.lastIndexOf(
']');
3607 qitem->setTextAlignment(Qt::AlignRight);
3615 p_table_p->horizontalHeader()->setStretchLastSection(
false);
3618 p_table_p->horizontalHeader()->setStretchLastSection(
true);
3765 ask->set_text_title_definput(
_(
"What should we name new worklist?"),
3766 _(
"Save current worklist"),
3768 ask->setAttribute(Qt::WA_DeleteOnClose);
3769 connect(
ask, &hud_message_box::accepted, [=]() {
3778 if (!text.isEmpty()) {
3797 .replace(
"&",
"&&"));
3899 for (
int i = 0;
i <
l.size(); ++
i) {
3901 l.at(
i)->setFont(*
f);
3949 if (
ev->type() == QEvent::ToolTip) {
3961 if (!index.isValid()) {
3966 rect =
view->visualRect(index);
3970 rect.setX(rect.x() +
hpos.x());
3971 rect.setY(rect.y() +
hpos.y());
3976 QToolTip::hideText();
3990 return QString(
"<b>" + text +
"</b>");
4006 if (
pcity !=
nullptr) {
4009 upkeep = QString::number(building->
upkeep);
4018 str =
_(
"Obsolete by:");
4020 def_str =
"<p style='white-space:pre'><b>"
4023 if (
pcity !=
nullptr) {
4026 .arg(upkeep).toHtmlEscaped();
4033 .arg(upkeep).toHtmlEscaped();
4035 if (
s1.compare(
s2) != 0) {
4083 def_str +=
"<table width=\"100\%\"><tr><td>"
4090 +
QString(
"</td></tr><tr><td>")
4094 +
QString(
"</td><td colspan=\"2\">")
4097 +
QString(
"</td></tr><tr><td>")
4099 + QString::number(utype->
hp).toHtmlEscaped()
4101 + QString::number(utype->
firepower).toHtmlEscaped()
4106 +
QString(
"</td></tr></table><p style='white-space:pre'>");
4116 str =
str.trimmed().toHtmlEscaped();
4136 target =
reinterpret_cast<universal *
>(
qvar.value<
void *>());
4138 if (target ==
nullptr) {
4189 bool useless =
false;
4194 bool is_unit =
true;
4198 QIcon icon =
current_app()->style()->standardIcon(QStyle::SP_DialogCancelButton);
4202 if (!
option.rect.isValid()) {
4206 qvar = index.data();
4208 if (!
qvar.isValid()) {
4212 target =
reinterpret_cast<universal *
>(
qvar.value<
void *>());
4214 if (target ==
nullptr) {
4215 col.qcolor = Qt::white;
4218 *
sprite->
pm = icon.pixmap(100, 100);
4268 opt = QItemDelegate::setOptions(index,
option);
4270 opt.displayAlignment = Qt::AlignLeft;
4271 opt.textElideMode = Qt::ElideMiddle;
4272 QItemDelegate::drawBackground(
painter,
opt, index);
4278 -
painter->fontMetrics().height()) / 2);
4318 const QRect &rect)
const
4322 if ((
option.state & QStyle::State_MouseOver) == 0 || !rect.isValid()) {
4326 pix.fill(
QColor(50, 50, 50, 50));
4339 s.setHeight(
pd.y());
4347 QObject *
parent): QObject()
4369 return QVariant::fromValue((
void *)
target);
4384 bool su,
bool sw,
bool sb,
4386 : QAbstractListModel(
parent)
4410 if (!index.isValid()) {
4414 if (index.row() >= 0 && index.row() <
rowCount() && index.column() >= 0
4427 if (
role == Qt::ToolTipRole) {
4451 sh.setY(
fm.height() * 2);
4496 sh.setX(2 *
sh.y() +
sh.x());
4506 if (!index.isValid() ||
role != Qt::DisplayRole ||
role != Qt::ToolTipRole)
4509 if (index.row() >= 0 && index.row() <
rowCount() && index.column() >= 0
4528 bool show_units,
bool buy,
4530 bool show_buildings): QTableView()
4533 QRect rect = QApplication::primaryScreen()->availableGeometry();
4548 show_wonders, show_buildings,
this);
4578 pos = QCursor::pos();
4582 }
else if (
pos.x() -
width() < 0) {
4602 if (
event->button() == Qt::RightButton) {
4607 QAbstractItemView::mousePressEvent(
event);
4621 if (
ev->type() == QEvent::MouseButtonPress) {
4627 if (!
pw_rect.contains(QCursor::pos())) {
4651 qvar = index.data(Qt::UserRole);
4652 if (!
qvar.isValid()) {
4655 target =
reinterpret_cast<universal *
>(
qvar.value<
void *>());
4656 if (target !=
nullptr) {
const char * action_id_name_translation(action_id act_id)
#define action_id_univs_not_blocking(act_id, act_uni, tgt_uni)
QRect zealous_crop_rect(QImage &p)
void qtg_canvas_free(struct canvas *store)
struct canvas * qtg_canvas_create(int width, int height)
void qtg_canvas_copy(struct canvas *dest, struct canvas *src, int src_x, int src_y, int dest_x, int dest_y, int width, int height)
void pixmap_copy(QPixmap *dest, QPixmap *src, int src_x, int src_y, int dest_x, int dest_y, int width, int height)
static QFont * get_font(enum client_font font)
struct canvas int int struct sprite int int int int height
struct canvas int int canvas_y
struct canvas int canvas_x
struct canvas int int struct sprite int int int width
citizens citizens_nation_get(const struct city *pcity, const struct player_slot *pslot)
#define citizens_iterate_end
#define citizens_iterate(_pcity, _pslot, _nationality)
const char * city_improvement_name_translation(const struct city *pcity, const struct impr_type *pimprove)
int city_production_build_shield_cost(const struct city *pcity)
int city_granary_size(int city_size)
struct tile * city_map_to_tile(const struct civ_map *nmap, const struct tile *city_center, int city_radius_sq, int city_map_x, int city_map_y)
const char * city_name_get(const struct city *pcity)
int city_improvement_upkeep(const struct city *pcity, const struct impr_type *b)
bool is_city_option_set(const struct city *pcity, enum city_options option)
int city_population(const struct city *pcity)
int city_unit_unhappiness(const struct civ_map *nmap, struct unit *punit, int *free_unhappy)
bool city_unhappy(const struct city *pcity)
bool city_celebrating(const struct city *pcity)
int city_illness_calc(const struct city *pcity, int *ill_base, int *ill_size, int *ill_trade, int *ill_pollution)
bool city_happy(const struct city *pcity)
int city_map_radius_sq_get(const struct city *pcity)
int rs_max_city_radius_sq(void)
citizens city_specialists(const struct city *pcity)
bool can_city_build_now(const struct civ_map *nmap, const struct city *pcity, const struct universal *target)
int city_turns_to_grow(const struct city *pcity)
const char * city_production_name_translation(const struct city *pcity)
static citizens city_size_get(const struct city *pcity)
#define city_owner(_pcity_)
void qtg_popdown_city_dialog(struct city *pcity)
void qtg_real_city_dialog_refresh(struct city *pcity)
QString split_text(QString text, bool cut)
bool qtg_city_dialog_is_open(struct city *pcity)
QString get_tooltip(QVariant qvar)
void qtg_popdown_all_city_dialogs()
static city_dialog * city_dlg
void qtg_refresh_unit_city_dialogs(struct unit *punit)
static QString bold(QString text)
void qtg_real_city_dialog_popup(struct city *pcity)
QString get_tooltip_improvement(const impr_type *building, struct city *pcity, bool ext)
static bool city_dlg_created
static void pixmap_put_x(QPixmap *pix)
QString cut_helptext(QString text)
QString get_tooltip_unit(const struct unit_type *utype, bool ext)
void destroy_city_dialog()
void get_city_dialog_output_text(const struct city *pcity, Output_type_id otype, char *buf, size_t bufsz)
void get_city_dialog_production(struct city *pcity, char *buffer, size_t buffer_len)
int city_set_worklist(struct city *pcity, const struct worklist *pworklist)
int get_city_citizen_types(struct city *pcity, enum citizen_feeling idx, enum citizen_category *categories)
int city_buy_production(struct city *pcity)
bool city_queue_insert(struct city *pcity, int position, struct universal *item)
bool city_queue_insert_worklist(struct city *pcity, int position, const struct worklist *worklist)
int city_toggle_worker(struct city *pcity, int city_x, int city_y)
void get_city_dialog_airlift_text(const struct city *pcity, char *buf, size_t bufsz)
bool city_set_queue(struct city *pcity, const struct worklist *pqueue)
int city_change_production(struct city *pcity, struct universal *target)
void city_rotate_specialist(struct city *pcity, int citizen_index)
int get_citydlg_canvas_width(void)
bool canvas_to_city_pos(int *city_x, int *city_y, int city_radius_sq, int canvas_x, int canvas_y)
void get_city_dialog_airlift_value(const struct city *pcity, char *buf, size_t bufsz)
void city_get_queue(struct city *pcity, struct worklist *pqueue)
void city_dialog_redraw_map(struct city *pcity, struct canvas *pcanvas)
int city_sell_improvement(struct city *pcity, Impr_type_id sell_id)
void get_city_dialog_pollution_text(const struct city *pcity, char *buf, size_t bufsz)
void get_city_dialog_culture_text(const struct city *pcity, char *buf, size_t bufsz)
bool city_can_buy(const struct city *pcity)
int get_citydlg_canvas_height(void)
void get_city_dialog_illness_text(const struct city *pcity, char *buf, size_t bufsz)
void set_city(struct city *pcity)
city_label(int type, QWidget *parent=nullptr)
void mousePressEvent(QMouseEvent *event)
void paintEvent(QPaintEvent *event)
void mousePressEvent(QMouseEvent *event)
void set_pixmap(struct city *pcity, float z)
void context_menu(QPoint point)
QSize minimumSizeHint() const
city_map(QWidget *parent)
city_production_delegate(QPoint sh, QObject *parent, struct city *city)
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
void drawFocus(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect) const
int rowCount(const QModelIndex &index=QModelIndex()) const
QList< production_item * > city_target_list
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::DisplayRole)
int columnCount(const QModelIndex &parent=QModelIndex()) const
city_production_model(struct city *pcity, bool f, bool su, bool sw, bool sb, QObject *parent=nullptr)
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
static fc_font * instance()
QFont * get_font(QString name)
static fc_icons * instance()
void add_item(impr_item *item)
void wheelEvent(QWheelEvent *event)
impr_info(QWidget *parent)
QList< impr_item * > impr_list
void mouseDoubleClickEvent(QMouseEvent *event)
impr_item(QWidget *parent, const struct impr_type *building, struct city *pcity)
void enterEvent(QEnterEvent *event)
struct canvas * impr_pixmap
const struct impr_type * impr
void leaveEvent(QEvent *event)
void wheelEvent(QWheelEvent *event)
struct universal * target
production_item(struct universal *ptarget, QObject *parent)
progress_bar(QWidget *parent)
void paintEvent(QPaintEvent *event)
void resizeEvent(QResizeEvent *event)
void set_pixmap(struct universal *target)
void timerEvent(QTimerEvent *event)
void wheelEvent(QWheelEvent *event)
void add_item(unit_item *item)
QList< unit_item * > unit_list
void enterEvent(QEnterEvent *event)
void contextMenuEvent(QContextMenuEvent *ev)
QAction * activate_and_close
void mousePressEvent(QMouseEvent *event)
void wheelEvent(QWheelEvent *event)
void leaveEvent(QEvent *event)
unit_item(QWidget *parent, struct unit *punit, bool supp=false, int happy_cost=0)
void activate_and_close_dialog()
bool client_is_observer(void)
bool can_client_issue_orders(void)
int collect_eventually_buildable_targets(struct universal *targets, struct city *pcity, bool advanced_tech)
void name_and_sort_items(struct universal *targets, int num_targets, struct item *items, bool show_cost, struct city *pcity)
cid cid_encode(struct universal target)
int collect_already_built_targets(struct universal *targets, struct city *pcity)
struct universal cid_decode(cid id)
#define MAX_NUM_PRODUCTION_TARGETS
static struct fc_sockaddr_list * list
void cm_copy_parameter(struct cm_parameter *dest, const struct cm_parameter *const src)
bool cma_is_city_under_agent(const struct city *pcity, struct cm_parameter *parameter)
void cma_put_city_under_agent(struct city *pcity, const struct cm_parameter *const parameter)
void cma_release_city(struct city *pcity)
char * cmafec_preset_get_descr(int idx)
const char * cmafec_get_short_descr_of_city(const struct city *pcity)
const struct cm_parameter * cmafec_preset_get_parameter(int idx)
void cmafec_preset_add(const char *descr_name, struct cm_parameter *pparam)
int cmafec_preset_get_index_of_parameter(const struct cm_parameter *const parameter)
void cmafec_preset_remove(int idx)
int cmafec_preset_num(void)
void cmafec_get_fe_parameter(struct city *pcity, struct cm_parameter *dest)
void request_unit_fortify(struct unit *punit)
struct unit * request_unit_unload_all(struct unit *punit)
void unit_focus_set(struct unit *punit)
void request_unit_change_homecity(struct unit *punit)
void request_unit_unload(struct unit *pcargo)
void request_unit_sentry(struct unit *punit)
#define can_unit_do_activity_client(_punit_, _act_)
int counter_index(const struct counter *pcount)
#define city_counters_iterate_end
#define city_counters_iterate(pcount)
bool qtg_request_transport(struct unit *pcargo, struct tile *ptile)
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 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 struct unit struct city * pcity
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
int get_city_bonus(const struct city *pcity, enum effect_type effect_type)
const char * skip_intl_qualifier_prefix(const char *str)
#define PL_(String1, String2, n)
const char * population_to_text(int thousand_citizen)
struct city * game_city_by_number(int id)
struct global_worklist * global_worklist_by_id(int id)
bool global_worklist_set(struct global_worklist *pgwl, const struct worklist *pwl)
const char * global_worklist_name(const struct global_worklist *pgwl)
int global_worklist_id(const struct global_worklist *pgwl)
const struct worklist * global_worklist_get(const struct global_worklist *pgwl)
struct global_worklist * global_worklist_new(const char *name)
#define global_worklists_iterate(pgwl)
#define global_worklists_iterate_end
void canvas_free(struct canvas *store)
void popup_upgrade_dialog(struct unit_list *punits)
void popup_disband_dialog(struct unit_list *punits)
void free_sprite(struct sprite *s)
static GMenu * change_menu
QString get_tooltip_improvement(const impr_type *building, struct city *pcity=nullptr, bool ext=false)
QString get_tooltip(QVariant qvar)
#define CAPTURE_DEFAULT_THIS
QApplication * current_app()
char * helptext_unit(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, const struct unit_type *utype, bool class_help)
char * helptext_unit_upkeep_str(const struct unit_type *utype)
char * helptext_building(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, const struct impr_type *pimprove)
int impr_sell_gold(const struct impr_type *pimprove)
enum test_result test_player_sell_building_now(struct player *pplayer, struct city *pcity, const struct impr_type *pimprove)
bool is_special_improvement(const struct impr_type *pimprove)
bool is_improvement_redundant(const struct city *pcity, const struct impr_type *pimprove)
bool is_improvement(const struct impr_type *pimprove)
Impr_type_id improvement_number(const struct impr_type *pimprove)
int impr_build_shield_cost(const struct city *pcity, const struct impr_type *pimprove)
bool is_wonder(const struct impr_type *pimprove)
bool is_convert_improvement(const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
int impr_estimate_build_shield_cost(const struct player *pplayer, const struct tile *ptile, const struct impr_type *pimprove)
#define fc_assert_ret(condition)
#define fc_assert(condition)
#define fc_assert_action(condition, action)
void put_unit(const struct unit *punit, struct canvas *pcanvas, float zoom, int canvas_x, int canvas_y)
void put_unit_city_overlays(struct unit *punit, struct canvas *pcanvas, int canvas_x, int canvas_y, int *upkeep_cost, int happy_cost)
void center_tile_mapcanvas(const struct tile *ptile)
const char * move_points_text(int mp, bool reduce)
static const char * name_translation_get(const struct name_translation *ptrans)
const char *const default_font
const char *const notify_label
const char * nation_adjective_for_player(const struct player *pplayer)
struct nation_type * nation_of_player(const struct player *pplayer)
int send_packet_worker_task(struct connection *pc, const struct packet_worker_task *packet)
int dsend_packet_city_options_req(struct connection *pc, int city_id, bv_city_options options, enum city_wl_cancel_behavior wl_cb)
const char * text_happiness_cities(const struct city *pcity)
struct unit * player_unit_by_number(const struct player *pplayer, int unit_id)
struct player * player_slot_get_player(const struct player_slot *pslot)
void qtg_free_sprite(struct sprite *s)
struct sprite * qtg_create_sprite(int width, int height, struct color *pcolor)
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
#define strvec_iterate(psv, str)
#define strvec_iterate_end
void setup_ui(struct city *qcity)
city_label * citizens_label
void closeEvent(QCloseEvent *event)
void update_nation_table()
void hideEvent(QHideEvent *event)
void cma_toggle_changed_depr(int state)
QPushButton * work_next_but
progress_bar * production_combo_p
QTableWidget * nationality_table
void showEvent(QShowEvent *event)
QPushButton * happiness_button
void cma_double_clicked(int row, int column)
void display_worklist_menu(const QPoint &p)
QPushButton * next_city_but
QLabel * qlt[NUM_INFO_FIELDS]
QPushButton * work_prev_but
QHBoxLayout * single_page_layout
QHBoxLayout * leftbot_layout
QPushButton * zoom_in_button
QGridLayout * info_grid_layout
QPushButton * counterss_button
impr_info * city_buildings
city_label * lab_table[6]
unit_info * current_units
struct unit_node_vector supported_units
QPushButton * zoom_out_button
struct city_dialog::@148 happiness
QPushButton * work_add_but
QSplitter * central_left_splitter
void disband_state_changed(bool allow_disband)
QCheckBox * cma_celeb_checkbox
enum city_dialog::city_dialog_tab current_tab
void dbl_click_p(QTableWidgetItem *item)
QPushButton * cma_enable_but
QSlider * slider_tab[2 *O_LAST+2]
bool eventFilter(QObject *obj, QEvent *event)
QSplitter * prod_unit_splitter
QVBoxLayout * left_layout
QPushButton * work_rem_but
QSplitter * central_splitter
QWidget * prod_happ_widget
city_dialog(QWidget *parent=nullptr)
void cma_toggle_changed(Qt::CheckState state)
QVBoxLayout * counterss_layout
QPushButton * prev_city_but
void update_counters_table()
void update_improvements()
QHBoxLayout * happiness_layout
QCheckBox * future_targets
void change_production(bool next)
void cma_selected(const QItemSelection &sl, const QItemSelection &ds)
QCheckBox * cma_max_growth
void item_selected(const QItemSelection &sl, const QItemSelection &ds)
void show_targets_worklist()
void cma_context_menu(const QPoint &p)
struct city_dialog::@149 counters
void production_changed(int index)
void update_prod_buttons()
QWidget * happiness_widget
QGroupBox * happiness_group
QCheckBox * show_buildings
struct worker_task_list * task_reqs
enum city_wl_cancel_behavior wlcb
struct unit_list * info_units_present
struct unit_list * info_units_supported
struct universal production
struct city::@18::@21 client
struct unit_list * units_supported
struct packet_game_info info
int minimal_surplus[O_LAST]
struct requirement_vector obsolete_by
enum unit_activity activity
struct city_list * cities
struct player_economic economic
const struct unit_type * obsoleted_by
struct universal entries[MAX_LEN_WORKLIST]
int fc_snprintf(char *str, size_t n, const char *format,...)
struct advance * advance_by_number(const Tech_type_id atype)
bool is_future_tech(Tech_type_id tech)
const char * advance_name_translation(const struct advance *padvance)
struct advance * valid_advance_by_number(const Tech_type_id id)
const char * text_happiness_nationality(const struct city *pcity)
const char * text_happiness_wonders(const struct city *pcity)
const char * text_happiness_units(const struct city *pcity)
const char * text_happiness_luxuries(const struct city *pcity)
const char * text_happiness_buildings(const struct city *pcity)
const char * unit_description(struct unit *punit)
struct city * tile_city(const struct tile *ptile)
#define tile_terrain(_tile)
int tileset_hex_width(const struct tileset *t)
struct sprite * get_building_sprite(const struct tileset *t, const struct impr_type *pimprove)
int tileset_unit_width(const struct tileset *t)
int tileset_unit_height(const struct tileset *t)
int tileset_small_sprite_width(const struct tileset *t)
struct tileset * get_tileset(void)
struct tileset * unscaled_tileset
int tileset_unit_layout_offset_y(const struct tileset *t)
bool tileset_is_isometric(const struct tileset *t)
int tileset_small_sprite_height(const struct tileset *t)
struct sprite * get_icon_sprite(const struct tileset *t, enum icon_type icon)
int tileset_unit_with_upkeep_height(const struct tileset *t)
int tileset_hex_height(const struct tileset *t)
struct sprite * get_citizen_sprite(const struct tileset *t, enum citizen_category type, int citizen_index, const struct city *pcity)
struct sprite * get_unittype_sprite(const struct tileset *t, const struct unit_type *punittype, enum unit_activity activity, enum direction8 facing)
struct sprite * get_nation_flag_sprite(const struct tileset *t, const struct nation_type *pnation)
struct sprite * get_tech_sprite(const struct tileset *t, Tech_type_id tech)
const struct unit_type * utype
const struct impr_type * building
bool can_unit_change_homecity(const struct civ_map *nmap, const struct unit *punit)
bool unit_can_do_action(const struct unit *punit, const action_id act_id)
bool units_are_occupied(const struct unit_list *punits)
bool units_can_unload(const struct civ_map *nmap, const struct unit_list *punits)
bool units_can_upgrade(const struct civ_map *nmap, const struct unit_list *punits)
bool units_can_load(const struct unit_list *punits)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
int utype_build_shield_cost_base(const struct unit_type *punittype)
bool utype_is_consumed_by_action_result(enum action_result result, const struct unit_type *utype)
struct advance * utype_primary_tech_req(const struct unit_type *ptype)
bool utype_can_do_action_result(const struct unit_type *putype, enum action_result result)
int utype_build_shield_cost(const struct city *pcity, const struct player *pplayer, const struct unit_type *punittype)
const char * utype_name_translation(const struct unit_type *punittype)
const char * utype_values_translation(const struct unit_type *punittype)
static bool uclass_has_flag(const struct unit_class *punitclass, enum unit_class_flag_id flag)
#define utype_fuel(ptype)
static bool utype_has_flag(const struct unit_type *punittype, int flag)
void worklist_init(struct worklist *pwl)
bool worklist_peek_ith(const struct worklist *pwl, struct universal *prod, int idx)
bool worklist_insert(struct worklist *pwl, const struct universal *prod, int idx)
void worklist_remove(struct worklist *pwl, int idx)
int worklist_length(const struct worklist *pwl)