19#include <QApplication>
27#include <QRadioButton>
36#include <QWidgetAction>
127 if (
pix !=
nullptr) {
139 pix->fill(Qt::transparent);
155 if (
pix !=
nullptr) {
164 pix->fill(Qt::transparent);
177 if ((value() != minimum() && value() < maximum())
178 || (0 == minimum() && 0 == maximum())) {
199 if (
pix !=
nullptr) {
219 p.drawLine(
rx.topLeft(),
rx.topRight());
220 p.drawLine(
rx.bottomLeft(),
rx.bottomRight());
233 gx.setColorAt(0.5,
QColor(40, 40, 40));
245 p.setClipping(
false);
247 c =
palette().color(QPalette::Window);
251 if (
pix !=
nullptr) {
252 p.setCompositionMode(QPainter::CompositionMode_SourceOver);
254 *
static_cast<float>(
pix->width()) /
pix->height(),
259 c =
palette().color(QPalette::Text);
261 sfont->setCapitalization(QFont::AllUppercase);
262 sfont->setBold(
true);
269 i = text().indexOf(
'\n');
271 s2 = text().right(text().length() -
i);
280 p.setCompositionMode(QPainter::CompositionMode_ColorDodge);
283 if (
fm.horizontalAdvance(
s1) >
rx.width()) {
284 s1 =
fm.elidedText(
s1, Qt::ElideRight,
rx.width());
291 if (
fm.horizontalAdvance(
s2) >
rx.width()) {
292 s2 =
fm.elidedText(
s2, Qt::ElideRight,
rx.width());
298 p.drawText(
i / 2,
pbh - j / 3,
s2);
307 p.setCompositionMode(QPainter::CompositionMode_ColorDodge);
310 if (
fm.horizontalAdvance(s) >
rx.width()) {
311 s =
fm.elidedText(s, Qt::ElideRight,
rx.width());
336 a.setPoints(4, r.x(), r.y() + offset,
337 r.x() + r.width(), (r.y() + offset) -
size,
356 p.setRenderHint(QPainter::Antialiasing);
358 p.drawLine(0, 0, pix->width(), pix->height());
359 p.drawLine(pix->width(), 0, 0, pix->height());
484 QSizePolicy::MinimumExpanding,
485 QSizePolicy::Slider);
518 for (j = 0; j <
i; j++) {
564 for (j = 0; j <
i; j++) {
567 layout->addWidget(ui, 0, Qt::AlignVCenter);
612 if (
event->button() == Qt::LeftButton) {
628 PL_(
"Sell %s for %d gold?",
629 "Sell %s for %d gold?",
price),
632 ask->set_text_title(
buf, (
_(
"Sell improvement?")));
633 ask->setStandardButtons(QMessageBox::Cancel | QMessageBox::Ok);
634 ask->setAttribute(Qt::WA_DeleteOnClose);
635 connect(
ask, &hud_message_box::accepted, [=]() {
638 if (pcity ==
nullptr) {
702 *
isosize, Qt::SmoothTransformation);
705 Qt::SmoothTransformation);
708 if (
tmp !=
nullptr) {
749 menu =
new QMenu(
gui()->central_wdg);
766 menu->addAction(
load);
785 menu->popup(
event->globalPos());
874 if (
punit ==
nullptr) {
970 QImage temp_img(unit_img.size(), QImage::Format_ARGB32_Premultiplied);
974 p.fillRect(0, 0, unit_img.width(), unit_img.height(),
976 p.drawImage(0, 0, unit_img);
1002 event->angleDelta(),
1016 if (
event->button() == Qt::LeftButton) {
1067 QSizePolicy::MinimumExpanding,
1068 QSizePolicy::Slider);
1084 event->angleDelta(),
1106 for (j = 0; j <
i; j++) {
1108 layout->addWidget(ui, 0, Qt::AlignVCenter);
1144 for (j = 0; j <
i; j++) {
1146 layout->removeWidget(ui);
1182 citnum =
event->pos().x() / w;
1211 view->map_pixmap.fill(Qt::black);
1284 Qt::KeepAspectRatio,
1285 Qt::SmoothTransformation);
1370 wid_act->setDefaultWidget(
new QLabel(
_(
"Autoworker activity:")));
1375 if (
pterr->plant_result !=
nullptr
1383 if (
pterr->cultivate_result !=
nullptr
1391 if (
pterr->transform_result !=
pterr &&
pterr->transform_result !=
nullptr
1406 if (
ptask !=
nullptr) {
1410 con_menu->setAttribute(Qt::WA_DeleteOnClose);
1411 connect(
con_menu, &QMenu::triggered,
1413 bool target =
false;
1462 if (tgt !=
nullptr) {
1483 QFont f = QApplication::font();
1496 QSizePolicy::Expanding);
1504 int h = 2 *
fm.height() + 2;
1521 lcity_name->setToolTip(
_(
"Click to change city name"));
1549 ql->setFont(*small_font);
1608 scroll->setWidgetResizable(
true);
1610 + scroll->horizontalScrollBar()->height());
1611 scroll->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
1615 scroll2->setWidgetResizable(
true);
1617 +
scroll2->horizontalScrollBar()->height());
1618 scroll2->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
1623 scroll3->setWidgetResizable(
true);
1625 +
scroll3->horizontalScrollBar()->height());
1626 scroll3->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
1628 scroll->setProperty(
"city_scroll",
true);
1629 scroll2->setProperty(
"city_scroll",
true);
1630 scroll3->setProperty(
"city_scroll",
true);
1645 label =
new QLabel();
1647 label->setToolTip(
_(
"Show buildings"));
1651 label =
new QLabel();
1653 label->setToolTip(
_(
"Show units"));
1660 label =
new QLabel();
1662 label->setToolTip(
_(
"Show wonders"));
1669 label =
new QLabel();
1671 label->setToolTip(
_(
"Show future targets"));
1679 prod_options->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
1682 button =
new QPushButton;
1685 button->setToolTip(
_(
"Close city dialog"));
1686 connect(
button, &QAbstractButton::clicked,
this, &QWidget::hide);
1706 button->setFixedSize(64, 64);
1734 v_layout->setContentsMargins(0 , 0 , 0, 0);
1740 v_layout->setContentsMargins(0 , 0 , 0, 0);
1746 v_layout->setContentsMargins(0 , 0 , 0, 0);
1768 QStyle::SP_DialogDiscardButton),
"");
1781 r4->setChecked(
true);
1786 p_table_p->setProperty(
"showGrid",
"false");
1787 p_table_p->setProperty(
"selectionBehavior",
"SelectRows");
1788 p_table_p->setEditTriggers(QAbstractItemView::NoEditTriggers);
1789 p_table_p->verticalHeader()->setVisible(
false);
1790 p_table_p->horizontalHeader()->setVisible(
false);
1791 p_table_p->setSelectionMode(QAbstractItemView::SingleSelection);
1794 p_table_p->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContentsOnFirstShow);
1795 p_table_p->setContextMenuPolicy(Qt::CustomContextMenu);
1796 p_table_p->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
1798 header->setStretchLastSection(
true);
1807 qgbprod->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
1813 &QWidget::customContextMenuRequested,
this,
1821 &QTableWidget::itemDoubleClicked,
1840 info_list <<
_(
"Cities:") <<
_(
"Luxuries:") <<
_(
"Buildings:")
1841 <<
_(
"Nationality:") <<
_(
"Units:") <<
_(
"Wonders:");
1846 lab2 =
new QLabel(
this);
1847 lab2->setFont(*small_font);
1849 lab2->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
1854 gridl->setSpacing(0);
1872 =
new QPushButton(style()->
standardIcon(QStyle::SP_DialogSaveButton),
1881 cma_table->setProperty(
"showGrid",
"false");
1882 cma_table->setProperty(
"selectionBehavior",
"SelectRows");
1883 cma_table->setEditTriggers(QAbstractItemView::NoEditTriggers);
1884 cma_table->setSelectionMode(QAbstractItemView::SingleSelection);
1885 cma_table->setContextMenuPolicy(Qt::CustomContextMenu);
1886 cma_table->verticalHeader()->setVisible(
false);
1887 cma_table->horizontalHeader()->setVisible(
false);
1888 cma_table->horizontalHeader()->setSectionResizeMode(
1889 QHeaderView::Stretch);
1897 &QWidget::customContextMenuRequested,
this,
1899 connect(
cma_table, &QTableWidget::cellDoubleClicked,
this,
1905 str_list <<
_(
"Food") <<
_(
"Shield") <<
_(
"Trade") <<
_(
"Gold")
1906 <<
_(
"Luxury") <<
_(
"Science") <<
_(
"Celebrate")
1907 <<
_(
"Maximize growth");
1927 slider->setFocusPolicy(Qt::TabFocus);
1929 slider->setRange(-20, 20);
1930 slider->setSingleStep(1);
1954 slider->setFocusPolicy(Qt::TabFocus);
1977 hbox->addStretch(10);
1994 top_widget->setSizePolicy(QSizePolicy::Minimum,
1995 QSizePolicy::Minimum);
1997 scroll_info->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
2004 QSizePolicy::MinimumExpanding);
2099 Qt::FindDirectChildrenOnly);
2106 Qt::FindDirectChildrenOnly);
2125 if (pplayer ==
nullptr
2134 view->setDisabled(
true);
2143 view->setEnabled(
true);
2167 if (pplayer !=
nullptr
2227 if (!
gui()->qt_settings.city_geometry.isNull()) {
2233 QRect rect = QApplication::primaryScreen()->availableGeometry();
2235 resize((rect.width() * 4) / 5, (rect.height() * 5) / 6);
2257 if (
event->type() == QEvent::KeyPress) {
2260 if (
event->type() == QEvent::ShortcutOverride) {
2262 if (
key_event->key() == Qt::Key_Right) {
2264 event->setAccepted(
true);
2269 event->setAccepted(
true);
2274 event->setAccepted(
true);
2279 event->setAccepted(
true);
2284 return QObject::eventFilter(
obj,
event);
2300 ask->set_text_title_definput(
_(
"What should we rename the city to?"),
2302 ask->setAttribute(Qt::WA_DeleteOnClose);
2303 connect(
ask, &hud_message_box::accepted,
this, [=]() {
2350 ask->set_text_title_definput(
_(
"What should we name the preset?"),
2351 _(
"Name new preset"),
2353 ask->setAttribute(Qt::WA_DeleteOnClose);
2354 connect(
ask, &hud_message_box::accepted,
this,
2359 if (!text.isEmpty()) {
2360 param.allow_disorder = false;
2361 param.allow_specialists = true;
2362 param.require_happy = cma_celeb_checkbox->isChecked();
2363 param.max_growth = cma_max_growth->isChecked();
2364 param.happy_factor = slider_tab[2 * O_LAST + 1]->value();
2366 for (int i = O_FOOD; i < O_LAST; i++) {
2367 param.minimal_surplus[i] = slider_tab[2 * i]->value();
2368 param.factor[i] = slider_tab[2 * i + 1]->value();
2449 int ind = index.row();
2489 label =
reinterpret_cast<QLabel *
>(
qvar.value<
void *>());
2490 label->setText(QString::number(param.
factor[output]));
2493 label =
reinterpret_cast<QLabel *
>(
qvar.value<
void *>());
2500 label =
reinterpret_cast<QLabel *
>(
qvar.value<
void *>());
2540 item->setText(
_(
"No governor defined"));
2547 pix = style()->standardPixmap(QStyle::SP_DialogApplyButton);
2548 pix = pix.scaled(2 * pix.width(), 2 * pix.height(),
2549 Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
2554 .arg(s.toHtmlEscaped()));
2557 pix = style()->standardPixmap(QStyle::SP_DialogCancelButton);
2558 pix = pix.scaled(1.6 * pix.width(), 1.6 * pix.height(),
2559 Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
2563 cma_result->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
2599 ask->setStandardButtons(QMessageBox::Cancel | QMessageBox::Ok);
2600 ask->setDefaultButton(QMessageBox::Cancel);
2601 ask->setAttribute(Qt::WA_DeleteOnClose);
2602 connect(
ask, &hud_message_box::accepted,
this,
2633 if (
qvar.isNull() || !
qvar.isValid()) {
2637 label =
reinterpret_cast<QLabel *
>(
qvar.value<
void *>());
2638 label->setText(QString::number(value));
2674 cma_menu->setAttribute(Qt::WA_DeleteOnClose);
2676 connect(
cma_menu, &QMenu::triggered,
this,
2697 QMap<QString, cid>::const_iterator
map_iter;
2718 if (
list.count() == 0) {
2738 disband =
options_menu->addAction(
_(
"Allow disbanding city"));
2739 disband->setCheckable(
true);
2741 connect(disband, &QAction::triggered,
this,
2800 value)).arg(QString::number(value));
2828 QRect dest_rect(0, 0, w, h);
2840 dest_rect.moveTo(
i * w, 0);
2860 dest_rect.moveTo(
i * w, 0);
2933 QFont f = QApplication::font();
2946 h =
fm.height() + 6;
2983 item->setText(
"FLAG MISSING");
3027 _(
"Population: %d, Specialists: %d"),
3099 "%5.1f%%", (
float) illness / 10.0);
3165 struct unit_list *units;
3175 if (pplayer !=
nullptr
3196 if (pplayer !=
nullptr
3244 if (pplayer ==
nullptr) {
3260 if (
i >=
size - 1) {
3280 if (pplayer ==
nullptr) {
3296 if (
i == 0 ||
i ==
size) {
3353 "Treasury contains %d gold.",
3357 "Buy %s for %d gold?", value),
3360 ask->setStandardButtons(QMessageBox::Cancel | QMessageBox::Ok);
3361 ask->setDefaultButton(QMessageBox::Cancel);
3362 ask->setAttribute(Qt::WA_DeleteOnClose);
3363 connect(
ask, &hud_message_box::accepted,
this, [=]() {
3380 QFont f = QApplication::font();
3397 h =
fm.height() + 6;
3459 if (
str.contains(
'[') &&
str.contains(
']')) {
3462 ii =
str.lastIndexOf(
'[');
3463 ij =
str.lastIndexOf(
']');
3472 qitem->setTextAlignment(Qt::AlignRight);
3480 p_table_p->horizontalHeader()->setStretchLastSection(
false);
3483 p_table_p->horizontalHeader()->setStretchLastSection(
true);
3630 ask->set_text_title_definput(
_(
"What should we name new worklist?"),
3631 _(
"Save current worklist"),
3633 ask->setAttribute(Qt::WA_DeleteOnClose);
3634 connect(
ask, &hud_message_box::accepted, [=]() {
3643 if (!text.isEmpty()) {
3662 .replace(
"&",
"&&"));
3764 for (
int i = 0;
i <
l.size(); ++
i) {
3766 l.at(
i)->setFont(*
f);
3814 if (
ev->type() == QEvent::ToolTip) {
3826 if (!index.isValid()) {
3831 rect =
view->visualRect(index);
3835 rect.setX(rect.x() +
hpos.x());
3836 rect.setY(rect.y() +
hpos.y());
3841 QToolTip::hideText();
3855 return QString(
"<b>" + text +
"</b>");
3871 if (pcity !=
nullptr) {
3874 upkeep = QString::number(building->
upkeep);
3883 str =
_(
"Obsolete by:");
3885 def_str =
"<p style='white-space:pre'><b>"
3888 if (pcity !=
nullptr) {
3891 .arg(upkeep).toHtmlEscaped();
3898 .arg(upkeep).toHtmlEscaped();
3900 if (
s1.compare(
s2) != 0) {
3948 def_str +=
"<table width=\"100\%\"><tr><td>"
3955 +
QString(
"</td></tr><tr><td>")
3959 +
QString(
"</td><td colspan=\"2\">")
3962 +
QString(
"</td></tr><tr><td>")
3964 + QString::number(utype->
hp).toHtmlEscaped()
3966 + QString::number(utype->
firepower).toHtmlEscaped()
3971 +
QString(
"</td></tr></table><p style='white-space:pre'>");
3981 str =
str.trimmed().toHtmlEscaped();
4001 target =
reinterpret_cast<universal *
>(
qvar.value<
void *>());
4003 if (target ==
nullptr) {
4059 bool is_unit =
true;
4063 QIcon icon =
current_app()->style()->standardIcon(QStyle::SP_DialogCancelButton);
4067 if (!
option.rect.isValid()) {
4071 qvar = index.data();
4073 if (!
qvar.isValid()) {
4077 target =
reinterpret_cast<universal *
>(
qvar.value<
void *>());
4079 if (target ==
nullptr) {
4080 col.qcolor = Qt::white;
4083 *
sprite->
pm = icon.pixmap(100, 100);
4133 opt = QItemDelegate::setOptions(index,
option);
4135 opt.displayAlignment = Qt::AlignLeft;
4136 opt.textElideMode = Qt::ElideMiddle;
4137 QItemDelegate::drawBackground(
painter,
opt, index);
4143 -
painter->fontMetrics().height()) / 2);
4183 const QRect &rect)
const
4187 if ((
option.state & QStyle::State_MouseOver) == 0 || !rect.isValid()) {
4191 pix.fill(
QColor(50, 50, 50, 50));
4204 s.setHeight(
pd.y());
4212 QObject *
parent): QObject()
4234 return QVariant::fromValue((
void *)
target);
4249 bool su,
bool sw,
bool sb,
4251 : QAbstractListModel(
parent)
4275 if (!index.isValid()) {
4279 if (index.row() >= 0 && index.row() <
rowCount() && index.column() >= 0
4292 if (
role == Qt::ToolTipRole) {
4316 sh.setY(
fm.height() * 2);
4361 sh.setX(2 *
sh.y() +
sh.x());
4371 if (!index.isValid() ||
role != Qt::DisplayRole ||
role != Qt::ToolTipRole)
4374 if (index.row() >= 0 && index.row() <
rowCount() && index.column() >= 0
4393 bool show_units,
bool buy,
4395 bool show_buildings): QTableView()
4398 QRect rect = QApplication::primaryScreen()->availableGeometry();
4413 show_wonders, show_buildings,
this);
4443 pos = QCursor::pos();
4447 }
else if (
pos.x() -
width() < 0) {
4467 if (
event->button() == Qt::RightButton) {
4472 QAbstractItemView::mousePressEvent(
event);
4486 if (
ev->type() == QEvent::MouseButtonPress) {
4492 if (!
pw_rect.contains(QCursor::pos())) {
4516 qvar = index.data(Qt::UserRole);
4517 if (!
qvar.isValid()) {
4520 target =
reinterpret_cast<universal *
>(
qvar.value<
void *>());
4521 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)
bool can_city_build_now(const struct city *pcity, const struct universal *target)
int city_unit_unhappiness(struct unit *punit, int *free_unhappy)
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)
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)
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_)
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_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)
char * helptext_unit(char *buf, size_t bufsz, struct player *pplayer, const char *user_text, const struct unit_type *utype)
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)
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)
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)
void setup_ui(struct city *qcity)
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
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
QSplitter * central_left_splitter
void disband_state_changed(bool allow_disband)
QCheckBox * cma_celeb_checkbox
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)
city_dialog(QWidget *parent=nullptr)
void update_happiness_button()
QPushButton * prev_city_but
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
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 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)