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++) {
551 event->angleDelta().y(),
552 Qt::Horizontal,
event->buttons(),
571 for (j = 0; j <
i; j++) {
574 layout->addWidget(ui, 0, Qt::AlignVCenter);
608 event->angleDelta().y(),
609 Qt::Horizontal,
event->buttons(),
625 if (
event->button() == Qt::LeftButton) {
641 PL_(
"Sell %s for %d gold?",
642 "Sell %s for %d gold?",
price),
645 ask->set_text_title(
buf, (
_(
"Sell improvement?")));
646 ask->setStandardButtons(QMessageBox::Cancel | QMessageBox::Ok);
647 ask->setAttribute(Qt::WA_DeleteOnClose);
648 connect(
ask, &hud_message_box::accepted, [=]() {
651 if (pcity ==
nullptr) {
715 *
isosize, Qt::SmoothTransformation);
718 Qt::SmoothTransformation);
721 if (
tmp !=
nullptr) {
762 menu =
new QMenu(
gui()->central_wdg);
779 menu->addAction(
load);
798 menu->popup(
event->globalPos());
887 if (
punit ==
nullptr) {
983 QImage temp_img(unit_img.size(), QImage::Format_ARGB32_Premultiplied);
987 p.fillRect(0, 0, unit_img.width(), unit_img.height(),
989 p.drawImage(0, 0, unit_img);
1015 event->angleDelta(),
1021 event->angleDelta(),
1022 event->angleDelta().y(),
1023 Qt::Horizontal,
event->buttons(),
1035 if (
event->button() == Qt::LeftButton) {
1086 QSizePolicy::MinimumExpanding,
1087 QSizePolicy::Slider);
1103 event->angleDelta(),
1109 event->angleDelta(),
1110 event->angleDelta().y(),
1111 Qt::Horizontal,
event->buttons(),
1131 for (j = 0; j <
i; j++) {
1133 layout->addWidget(ui, 0, Qt::AlignVCenter);
1169 for (j = 0; j <
i; j++) {
1171 layout->removeWidget(ui);
1207 citnum =
event->pos().x() / w;
1236 view->map_pixmap.fill(Qt::black);
1309 Qt::KeepAspectRatio,
1310 Qt::SmoothTransformation);
1395 wid_act->setDefaultWidget(
new QLabel(
_(
"Autosettler activity:")));
1435 con_menu->setAttribute(Qt::WA_DeleteOnClose);
1436 connect(
con_menu, &QMenu::triggered,
1438 bool target =
false;
1508 QFont f = QApplication::font();
1521 QSizePolicy::Expanding);
1529 int h = 2 *
fm.height() + 2;
1546 lcity_name->setToolTip(
_(
"Click to change city name"));
1574 ql->setFont(*small_font);
1633 scroll->setWidgetResizable(
true);
1635 + scroll->horizontalScrollBar()->height());
1636 scroll->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
1640 scroll2->setWidgetResizable(
true);
1642 +
scroll2->horizontalScrollBar()->height());
1643 scroll2->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
1648 scroll3->setWidgetResizable(
true);
1650 +
scroll3->horizontalScrollBar()->height());
1651 scroll3->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
1653 scroll->setProperty(
"city_scroll",
true);
1654 scroll2->setProperty(
"city_scroll",
true);
1655 scroll3->setProperty(
"city_scroll",
true);
1670 label =
new QLabel();
1672 label->setToolTip(
_(
"Show buildings"));
1676 label =
new QLabel();
1678 label->setToolTip(
_(
"Show units"));
1685 label =
new QLabel();
1687 label->setToolTip(
_(
"Show wonders"));
1694 label =
new QLabel();
1696 label->setToolTip(
_(
"Show future targets"));
1704 prod_options->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
1707 button =
new QPushButton;
1710 button->setToolTip(
_(
"Close city dialog"));
1711 connect(
button, &QAbstractButton::clicked,
this, &QWidget::hide);
1730 button->setFixedSize(64, 64);
1764 v_layout->setContentsMargins(0 , 0 , 0, 0);
1770 v_layout->setContentsMargins(0 , 0 , 0, 0);
1776 v_layout->setContentsMargins(0 , 0 , 0, 0);
1798 QStyle::SP_DialogDiscardButton),
"");
1811 r4->setChecked(
true);
1816 p_table_p->setProperty(
"showGrid",
"false");
1817 p_table_p->setProperty(
"selectionBehavior",
"SelectRows");
1818 p_table_p->setEditTriggers(QAbstractItemView::NoEditTriggers);
1819 p_table_p->verticalHeader()->setVisible(
false);
1820 p_table_p->horizontalHeader()->setVisible(
false);
1821 p_table_p->setSelectionMode(QAbstractItemView::SingleSelection);
1824 p_table_p->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContentsOnFirstShow);
1825 p_table_p->setContextMenuPolicy(Qt::CustomContextMenu);
1826 p_table_p->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
1828 header->setStretchLastSection(
true);
1837 qgbprod->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
1843 &QWidget::customContextMenuRequested,
this,
1851 &QTableWidget::itemDoubleClicked,
1870 info_list <<
_(
"Cities:") <<
_(
"Luxuries:") <<
_(
"Buildings:")
1871 <<
_(
"Nationality:") <<
_(
"Units:") <<
_(
"Wonders:");
1876 lab2 =
new QLabel(
this);
1877 lab2->setFont(*small_font);
1879 lab2->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
1884 gridl->setSpacing(0);
1906 =
new QPushButton(style()->
standardIcon(QStyle::SP_DialogSaveButton),
1915 cma_table->setProperty(
"showGrid",
"false");
1916 cma_table->setProperty(
"selectionBehavior",
"SelectRows");
1917 cma_table->setEditTriggers(QAbstractItemView::NoEditTriggers);
1918 cma_table->setSelectionMode(QAbstractItemView::SingleSelection);
1919 cma_table->setContextMenuPolicy(Qt::CustomContextMenu);
1920 cma_table->verticalHeader()->setVisible(
false);
1921 cma_table->horizontalHeader()->setVisible(
false);
1922 cma_table->horizontalHeader()->setSectionResizeMode(
1923 QHeaderView::Stretch);
1931 &QWidget::customContextMenuRequested,
this,
1933 connect(
cma_table, &QTableWidget::cellDoubleClicked,
this,
1939 str_list <<
_(
"Food") <<
_(
"Shield") <<
_(
"Trade") <<
_(
"Gold")
1940 <<
_(
"Luxury") <<
_(
"Science") <<
_(
"Celebrate")
1941 <<
_(
"Maximize growth");
1961 slider->setFocusPolicy(Qt::TabFocus);
1963 slider->setRange(-20, 20);
1964 slider->setSingleStep(1);
1988 slider->setFocusPolicy(Qt::TabFocus);
2012 hbox->addStretch(10);
2014 govA->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
2031 top_widget->setSizePolicy(QSizePolicy::Minimum,
2032 QSizePolicy::Minimum);
2034 scroll_info->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
2041 QSizePolicy::MinimumExpanding);
2147 Qt::FindDirectChildrenOnly);
2158 Qt::FindDirectChildrenOnly);
2182 Qt::FindDirectChildrenOnly);
2193 Qt::FindDirectChildrenOnly);
2219 view->setDisabled(
true);
2231 view->setEnabled(
true);
2318 if (!
gui()->qt_settings.city_geometry.isNull()) {
2324 QRect rect = QApplication::primaryScreen()->availableGeometry();
2326 resize((rect.width() * 4) / 5, (rect.height() * 5) / 6);
2348 if (
event->type() == QEvent::KeyPress) {
2351 if (
event->type() == QEvent::ShortcutOverride) {
2353 if (
key_event->key() == Qt::Key_Right) {
2355 event->setAccepted(
true);
2360 event->setAccepted(
true);
2365 event->setAccepted(
true);
2370 event->setAccepted(
true);
2375 return QObject::eventFilter(
obj,
event);
2391 ask->set_text_title_definput(
_(
"What should we rename the city to?"),
2393 ask->setAttribute(Qt::WA_DeleteOnClose);
2394 connect(
ask, &hud_message_box::accepted,
this, [=]() {
2441 ask->set_text_title_definput(
_(
"What should we name the preset?"),
2442 _(
"Name new preset"),
2444 ask->setAttribute(Qt::WA_DeleteOnClose);
2445 connect(
ask, &hud_message_box::accepted,
this,
2450 if (!text.isEmpty()) {
2451 param.allow_disorder = false;
2452 param.allow_specialists = true;
2453 param.require_happy = cma_celeb_checkbox->isChecked();
2454 param.max_growth = cma_max_growth->isChecked();
2455 param.happy_factor = slider_tab[2 * O_LAST + 1]->value();
2457 for (int i = O_FOOD; i < O_LAST; i++) {
2458 param.minimal_surplus[i] = slider_tab[2 * i]->value();
2459 param.factor[i] = slider_tab[2 * i + 1]->value();
2540 int ind = index.row();
2580 label =
reinterpret_cast<QLabel *
>(
qvar.value<
void *>());
2581 label->setText(QString::number(param.
factor[output]));
2584 label =
reinterpret_cast<QLabel *
>(
qvar.value<
void *>());
2591 label =
reinterpret_cast<QLabel *
>(
qvar.value<
void *>());
2631 item->setText(
_(
"No governor defined"));
2638 pix = style()->standardPixmap(QStyle::SP_DialogApplyButton);
2639 pix = pix.scaled(2 * pix.width(), 2 * pix.height(),
2640 Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
2645 .arg(s.toHtmlEscaped()));
2648 pix = style()->standardPixmap(QStyle::SP_DialogCancelButton);
2649 pix = pix.scaled(1.6 * pix.width(), 1.6 * pix.height(),
2650 Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
2654 cma_result->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
2690 ask->setStandardButtons(QMessageBox::Cancel | QMessageBox::Ok);
2691 ask->setDefaultButton(QMessageBox::Cancel);
2692 ask->setAttribute(Qt::WA_DeleteOnClose);
2693 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,
2891 value)).arg(QString::number(value));
2919 QRect dest_rect(0, 0, w, h);
2931 dest_rect.moveTo(
i * w, 0);
2951 dest_rect.moveTo(
i * w, 0);
3037 value =
new QLabel(
buf);
3039 "or higher than: %d"),
3042 if (
pcount->helptext !=
nullptr) {
3047 help =
new QLabel(helptext);
3049 name->setFont(*small_font);
3050 value->setFont(*small_font);
3052 help->setFont(*small_font);
3066 QFont f = QApplication::font();
3079 h =
fm.height() + 6;
3116 item->setText(
"FLAG MISSING");
3160 _(
"Population: %d, Specialists: %d"),
3232 "%5.1f%%", (
float) illness / 10.0);
3298 struct unit_list *units;
3392 if (
i >=
size - 1) {
3427 if (
i == 0 ||
i ==
size) {
3484 "Treasury contains %d gold.",
3488 "Buy %s for %d gold?", value),
3491 ask->setStandardButtons(QMessageBox::Cancel | QMessageBox::Ok);
3492 ask->setDefaultButton(QMessageBox::Cancel);
3493 ask->setAttribute(Qt::WA_DeleteOnClose);
3494 connect(
ask, &hud_message_box::accepted,
this, [=]() {
3511 QFont f = QApplication::font();
3528 h =
fm.height() + 6;
3590 if (
str.contains(
'[') &&
str.contains(
']')) {
3593 ii =
str.lastIndexOf(
'[');
3594 ij =
str.lastIndexOf(
']');
3603 qitem->setTextAlignment(Qt::AlignRight);
3611 p_table_p->horizontalHeader()->setStretchLastSection(
false);
3614 p_table_p->horizontalHeader()->setStretchLastSection(
true);
3761 ask->set_text_title_definput(
_(
"What should we name new worklist?"),
3762 _(
"Save current worklist"),
3764 ask->setAttribute(Qt::WA_DeleteOnClose);
3765 connect(
ask, &hud_message_box::accepted, [=]() {
3774 if (!text.isEmpty()) {
3895 for (
int i = 0;
i <
l.size(); ++
i) {
3897 l.at(
i)->setFont(*
f);
3945 if (
ev->type() == QEvent::ToolTip) {
3957 if (!index.isValid()) {
3962 rect =
view->visualRect(index);
3966 rect.setX(rect.x() +
hpos.x());
3967 rect.setY(rect.y() +
hpos.y());
3972 QToolTip::hideText();
3986 return QString(
"<b>" + text +
"</b>");
4001 if (pcity !=
nullptr) {
4004 upkeep = QString::number(building->
upkeep);
4013 str =
_(
"Obsolete by:");
4015 def_str =
"<p style='white-space:pre'><b>"
4018 if (pcity !=
nullptr) {
4021 .arg(upkeep).toHtmlEscaped();
4027 .arg(upkeep).toHtmlEscaped();
4029 if (
s1.compare(
s2) != 0) {
4077 def_str +=
"<table width=\"100\%\"><tr><td>"
4084 +
QString(
"</td></tr><tr><td>")
4088 +
QString(
"</td><td colspan=\"2\">")
4091 +
QString(
"</td></tr><tr><td>")
4093 + QString::number(utype->
hp).toHtmlEscaped()
4095 + QString::number(utype->
firepower).toHtmlEscaped()
4100 +
QString(
"</td></tr></table><p style='white-space:pre'>");
4110 str =
str.trimmed().toHtmlEscaped();
4129 target =
reinterpret_cast<universal *
>(
qvar.value<
void *>());
4131 if (target ==
NULL) {
4187 bool is_unit =
true;
4191 QIcon icon =
current_app()->style()->standardIcon(QStyle::SP_DialogCancelButton);
4195 if (!
option.rect.isValid()) {
4199 qvar = index.data();
4201 if (!
qvar.isValid()) {
4205 target =
reinterpret_cast<universal *
>(
qvar.value<
void *>());
4207 if (target ==
NULL) {
4208 col.qcolor = Qt::white;
4211 *
sprite->
pm = icon.pixmap(100, 100);
4261 opt = QItemDelegate::setOptions(index,
option);
4263 opt.displayAlignment = Qt::AlignLeft;
4264 opt.textElideMode = Qt::ElideMiddle;
4265 QItemDelegate::drawBackground(
painter,
opt, index);
4271 -
painter->fontMetrics().height()) / 2);
4311 const QRect &rect)
const
4315 if ((
option.state & QStyle::State_MouseOver) == 0 || !rect.isValid()) {
4319 pix.fill(
QColor(50, 50, 50, 50));
4332 s.setHeight(
pd.y());
4340 QObject *
parent): QObject()
4362 return QVariant::fromValue((
void *)
target);
4377 bool su,
bool sw,
bool sb,
4379 : QAbstractListModel(
parent)
4403 if (!index.isValid()) {
4407 if (index.row() >= 0 && index.row() <
rowCount() && index.column() >= 0
4420 if (
role == Qt::ToolTipRole) {
4444 sh.setY(
fm.height() * 2);
4489 sh.setX(2 *
sh.y() +
sh.x());
4499 if (!index.isValid() ||
role != Qt::DisplayRole ||
role != Qt::ToolTipRole)
4502 if (index.row() >= 0 && index.row() <
rowCount() && index.column() >= 0
4521 bool show_units,
bool buy,
4523 bool show_buildings): QTableView()
4526 QRect rect = QApplication::primaryScreen()->availableGeometry();
4541 show_wonders, show_buildings,
this);
4571 pos = QCursor::pos();
4575 }
else if (
pos.x() -
width() < 0) {
4595 if (
event->button() == Qt::RightButton) {
4600 QAbstractItemView::mousePressEvent(
event);
4614 if (
ev->type() == QEvent::MouseButtonPress) {
4620 if (!
pw_rect.contains(QCursor::pos())) {
4644 qvar = index.data(Qt::UserRole);
4645 if (!
qvar.isValid()) {
4648 target =
reinterpret_cast<universal *
>(
qvar.value<
void *>());
4649 if (target !=
NULL) {
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)
city_label(int type, QWidget *parent=0)
void set_city(struct city *pcity)
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
city_production_model(struct city *pcity, bool f, bool su, bool sw, bool sb, QObject *parent=0)
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
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 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 improvement_has_flag(const struct impr_type *pimprove, enum impr_flag_id flag)
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)
struct city_dialog::@144 happiness
city_label * citizens_label
void closeEvent(QCloseEvent *event)
void update_nation_table()
void hideEvent(QHideEvent *event)
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
QPushButton * work_add_but
city_dialog(QWidget *parent=0)
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
void cma_toggle_changed(int val)
struct city_dialog::@145 counters
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)
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 unit_list * units_supported
struct city::@17::@20 client
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_upgrade(const struct civ_map *nmap, const struct unit_list *punits)
bool units_can_unload(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)