Freeciv-3.2: /fast/freeciv/nightly/S3_2/client/gui-qt/sidebar.cpp Source File

Freeciv-3.2

Loading...
Searching...
No Matches
sidebar.cpp
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996-2005 - Freeciv Development Team
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18// Qt
19#include <QAction>
20#include <QApplication>
21#include <QHBoxLayout>
22#include <QMenu>
23#include <QPainter>
24#include <QPaintEvent>
25#include <QPixmap>
26#include <QScreen>
27#include <QTimer>
28
29// common
30#include "research.h"
31
32// client
33#include "client_main.h"
34
35// gui-qt
36#include "fc_client.h"
37#include "repodlgs.h"
38#include "sidebar.h"
39#include "sprite.h"
40
41extern void pixmap_copy(QPixmap *dest, QPixmap *src, int src_x, int src_y,
42 int dest_x, int dest_y, int width, int height);
43
44static void reduce_mod(int &val, int &mod);
45
46/***********************************************************************/
49 void reduce_mod(int &mod, int &val)
50{
51 if (mod > 0) {
52 val++;
53 mod--;
54 }
55
56 return;
57}
58
59/***********************************************************************/
62fc_sidewidget::fc_sidewidget(QPixmap *pix, QString label, QString pg,
63 pfcn_bool func, int type): QWidget()
64{
65 if (pix == nullptr) {
66 pix = new QPixmap(12,12);
67 pix->fill(Qt::black);
68 }
69
70 blink = false;
71 disabled = false;
72 def_pixmap = pix;
73 scaled_pixmap = new QPixmap;
74 final_pixmap = new QPixmap;
75
76 sfont = nullptr;
77 info_font = nullptr;
78 update_fonts();
79
80 left_click = func;
81 desc = label;
82 standard = type;
83 hover = false;
84 right_click = nullptr;
85 wheel_down = nullptr;
86 wheel_up = nullptr;
87 page = pg;
88 setContextMenuPolicy(Qt::CustomContextMenu);
89 timer = new QTimer;
90 timer->setSingleShot(false);
91 timer->setInterval(700);
92
93 connect(timer, &QTimer::timeout, this, &fc_sidewidget::sblink);
94}
95
96/***********************************************************************/
99fc_sidewidget::~fc_sidewidget()
100{
101 if (scaled_pixmap) {
102 delete scaled_pixmap;
103 }
104
105 if (def_pixmap) {
106 delete def_pixmap;
107 }
108
109 if (final_pixmap) {
110 delete final_pixmap;
111 }
112 delete timer;
113 delete sfont;
114 delete info_font;
115}
116
117/***********************************************************************/
120 void fc_sidewidget::set_pixmap(QPixmap *pm)
121{
122 if (def_pixmap) {
123 delete def_pixmap;
124 }
125
126 def_pixmap = pm;
127}
128
129/***********************************************************************/
132 void fc_sidewidget::update_fonts()
133{
134 if (sfont != nullptr) {
135 delete sfont;
136 }
137 sfont = new QFont(*fc_font::instance()->get_font(fonts::notify_label));
138 sfont->setCapitalization(QFont::SmallCaps);
139 sfont->setItalic(true);
140
141 if (info_font != nullptr) {
142 delete info_font;
143 }
144 info_font = new QFont(*sfont);
145 info_font->setBold(true);
146 info_font->setItalic(false);
147}
148
149/***********************************************************************/
152 void fc_sidewidget::set_custom_labels(QString l)
153{
154 custom_label = l;
155}
156
157/***********************************************************************/
160 void fc_sidewidget::set_tooltip(QString tooltip)
161{
162 setToolTip(tooltip);
163}
164
165/***********************************************************************/
168 QPixmap *fc_sidewidget::get_pixmap()
169{
170 return scaled_pixmap;
171}
172
173/***********************************************************************/
176 void fc_sidewidget::set_label(QString str)
177{
178 desc = str;
179}
180
181/***********************************************************************/
185 void fc_sidewidget::resize_pixmap(int width, int height)
186{
187 if (standard == SW_TAX) {
188 height = get_tax_sprite(tileset, O_LUXURY)->pm->height() + 8;
189 }
190
191 if (standard == SW_INDICATORS) {
192 height = client_government_sprite()->pm->height() + 8;
193 }
194
195 if (def_pixmap) {
196 *scaled_pixmap = def_pixmap->scaled(width, height, Qt::IgnoreAspectRatio,
197 Qt::SmoothTransformation);
198 }
199}
200
201/***********************************************************************/
204 void fc_sidewidget::paintEvent(QPaintEvent *event)
205{
206 QPainter painter;
207
208 painter.begin(this);
209 paint(&painter, event);
210 painter.end();
211}
212
213/***********************************************************************/
216 void fc_sidewidget::paint(QPainter *painter, QPaintEvent *event)
217{
218 if (final_pixmap) {
219 painter->drawPixmap(event->rect(), *final_pixmap,
220 event->rect());
221 }
222}
223
224/***********************************************************************/
227#ifndef FC_QT5_MODE
228 void fc_sidewidget::enterEvent(QEnterEvent *event)
229#else // FC_QT5_MODE
230void fc_sidewidget::enterEvent(QEvent *event)
231#endif // FC_QT5_MODE
232{
233 if (!hover) {
234 hover = true;
235 update_final_pixmap();
236 QWidget::enterEvent(event);
237 update();
238 }
239}
240
241/***********************************************************************/
244 void fc_sidewidget::leaveEvent(QEvent *event)
245{
246 if (hover) {
247 hover = false;
248 update_final_pixmap();
249 QWidget::leaveEvent(event);
250 update();
251
252 }
253}
254
255/***********************************************************************/
258 void fc_sidewidget::contextMenuEvent(QContextMenuEvent *event)
259{
260 if (hover) {
261 hover = false;
262 update_final_pixmap();
263 QWidget::contextMenuEvent(event);
264 update();
265 }
266}
267
268/***********************************************************************/
271 void fc_sidewidget::set_left_click(pfcn_bool func)
272{
273 left_click = func;
274}
275
276/***********************************************************************/
279 void fc_sidewidget::set_right_click(pfcn func)
280{
281 right_click = func;
282}
283
284/***********************************************************************/
287 void fc_sidewidget::set_wheel_down(pfcn func)
288{
289 wheel_down = func;
290}
291
292/***********************************************************************/
295 void fc_sidewidget::set_wheel_up(pfcn func)
296{
297 wheel_up = func;
298}
299
300/***********************************************************************/
303 void fc_sidewidget::mousePressEvent(QMouseEvent *event)
304{
305 if (event->button() == Qt::LeftButton && left_click != nullptr) {
306 left_click(true);
307 }
308 if (event->button() == Qt::RightButton && right_click != nullptr) {
309 right_click();
310 }
311 if (event->button() == Qt::RightButton && right_click == nullptr) {
312 gui()->game_tab_widget->setCurrentIndex(0);
313 }
314}
315
316/***********************************************************************/
319 void fc_sidewidget::wheelEvent(QWheelEvent *event)
320{
321 int delta = event->angleDelta().y();
322
323 if (delta < -90 && wheel_down) {
324 wheel_down();
325 } else if (delta > 90 && wheel_up) {
326 wheel_up();
327 }
328
329 event->accept();
330}
331
332/***********************************************************************/
335 void fc_sidewidget::sblink()
336{
337 if (keep_blinking) {
338 if (!timer->isActive()) {
339 timer->start();
340 }
341 blink = !blink;
342 } else {
343 blink = false;
344 if (timer->isActive()) {
345 timer->stop();
346 }
347 }
348 update_final_pixmap();
349}
350
351/***********************************************************************/
356 void fc_sidewidget::some_slot()
357{
358 QVariant qvar;
359 struct player *obs_player;
360 QAction *act;
361
362 act = qobject_cast<QAction *>(sender());
363 qvar = act->data();
364
365 if (!qvar.isValid()) {
366 return;
367 }
368
369 if (act->property("scimenu").toBool()) {
370 dsend_packet_player_research(&client.conn, qvar.toInt());
371 return;
372 }
373
374 if (qvar.toInt() == -1) {
375 send_chat("/observe");
376 return;
377 }
378
379 obs_player = reinterpret_cast< struct player *>(qvar.value<void *>());
380 if (obs_player != nullptr) {
381 QString s;
382 QByteArray cn_bytes;
383
384 s = QString("/observe \"%1\"").arg(obs_player->name);
385 cn_bytes = s.toUtf8();
386 send_chat(cn_bytes.data());
387 }
388}
389
390/***********************************************************************/
393 void fc_sidewidget::update_final_pixmap()
394{
395 const struct sprite *sprite;
396 int w, h, pos, i;
397 QPainter p;
398 QPen pen;
399 bool current = false;
400
401 if (final_pixmap) {
402 delete final_pixmap;
403 }
404
405 i = gui()->gimme_index_of(page);
406 if (i == gui()->game_tab_widget->currentIndex()) {
407 current = true;
408 }
409 final_pixmap = new QPixmap(scaled_pixmap->width(), scaled_pixmap->height());
410 final_pixmap->fill(Qt::transparent);
411
412 if (scaled_pixmap->width() == 0 || scaled_pixmap->height() == 0) {
413 return;
414 }
415
416 p.begin(final_pixmap);
417 p.setFont(*sfont);
418 pen.setColor(QColor(232, 255, 0));
419 p.setPen(pen);
420
421 if (standard == SW_TAX && !client_is_global_observer()) {
422 int d, modulo;
423
424 pos = 0;
425 sprite = get_tax_sprite(tileset, O_GOLD);
426 if (sprite == nullptr) {
427 return;
428 }
429 w = width() / 10;
430 modulo = width() % 10;
431 h = sprite->pm->height();
432 reduce_mod(modulo, pos);
433 if (client.conn.playing == nullptr) {
434 return;
435 }
436 for (d = 0; d < client.conn.playing->economic.tax / 10; ++d) {
437 p.drawPixmap(pos, 5, sprite->pm->scaled(w, h), 0, 0, w, h);
438 pos = pos + w;
439 reduce_mod(modulo, pos);
440 }
441
442 sprite = get_tax_sprite(tileset, O_SCIENCE);
443
444 for (; d < (client.conn.playing->economic.tax
445 + client.conn.playing->economic.science) / 10; ++d) {
446 p.drawPixmap(pos, 5, sprite->pm->scaled(w, h), 0, 0, w, h);
447 pos = pos + w;
448 reduce_mod(modulo, pos);
449 }
450
451 sprite = get_tax_sprite(tileset, O_LUXURY);
452
453 for (; d < 10 ; ++d) {
454 p.drawPixmap(pos, 5, sprite->pm->scaled(w, h), 0, 0, w, h);
455 pos = pos + w;
456 reduce_mod(modulo, pos);
457 }
458 } else if (standard == SW_INDICATORS) {
459 sprite = client_research_sprite();
460 w = sprite->pm->width();
461 pos = scaled_pixmap->width() / 2 - 2 * w;
462 p.drawPixmap(pos, 5, *sprite->pm);
463 pos = pos + w;
464 sprite = client_warming_sprite();
465 p.drawPixmap(pos, 5, *sprite->pm);
466 pos = pos + w;
467 sprite = client_cooling_sprite();
468 p.drawPixmap(pos, 5, *sprite->pm);
469 pos = pos + w;
470 sprite = client_government_sprite();
471 p.drawPixmap(pos, 5, *sprite->pm);
472
473 } else {
474 p.drawPixmap(0, 0 , *scaled_pixmap);
475 p.drawText(0, height() - 6 , desc);
476 }
477
478 p.setPen(palette().color(QPalette::Text));
479 if (!custom_label.isEmpty()) {
480 p.setFont(*info_font);
481 p.drawText(0, 0, width(), height(), Qt::AlignLeft | Qt::TextWordWrap,
482 custom_label);
483 }
484
485 if (current) {
486 p.setPen(palette().color(QPalette::Highlight));
487 p.drawRect(0 , 0, width() - 1 , height() - 1);
488 }
489
490 if (hover && !disabled) {
491 p.setCompositionMode(QPainter::CompositionMode_ColorDodge);
492 p.setPen(palette().color(QPalette::Highlight));
493 p.setBrush(palette().color(QPalette::AlternateBase));
494 p.drawRect(0 , 0, width() - 1 , height() - 1);
495 }
496
497 if (disabled) {
498 p.setCompositionMode(QPainter::CompositionMode_Darken);
499 p.setPen(QColor(0, 0, 0));
500 p.setBrush(QColor(0, 0, 50, 95));
501 p.drawRect(0 , 0, width(), height());
502 }
503
504 if (blink) {
505 p.setCompositionMode(QPainter::CompositionMode_ColorDodge);
506 p.setPen(QColor(0, 0, 0));
507 p.setBrush(palette().color(QPalette::HighlightedText));
508 p.drawRect(0 , 0, width(), height());
509 }
510
511 p.end();
512 update();
513}
514
515/***********************************************************************/
518fc_sidebar::fc_sidebar()
519{
520 setAttribute(Qt::WA_OpaquePaintEvent, true);
521 layout = new QVBoxLayout;
522 layout->setContentsMargins(0, 0, 0, 0);
523 setLayout(layout);
524 setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Ignored);
525}
526
527/***********************************************************************/
530fc_sidebar::~fc_sidebar()
531{
532}
533
534/***********************************************************************/
537 void fc_sidebar::add_widget(fc_sidewidget *fsw)
538{
539 objects.append(fsw);
540 layout->addWidget(fsw);
541 return;
542}
543
544/***********************************************************************/
547 void fc_sidebar::paintEvent(QPaintEvent *event)
548{
549 QPainter painter;
550
551 painter.begin(this);
552 paint(&painter, event);
553 painter.end();
554}
555
556/***********************************************************************/
559 void fc_sidebar::paint(QPainter *painter, QPaintEvent *event)
560{
561 painter->setBrush(QBrush(QColor(40, 40, 40)));
562 painter->drawRect(event->rect());
563}
564
565/**************************************************************************
566 Resize sidebar to take at least 80 pixels width and 100 pixels for FullHD
567 desktop and scaled accordingly for bigger resolutions eg 200 pixels for 4k
568 desktop.
569**************************************************************************/
570 void fc_sidebar::resize_me(int hght, bool force)
571{
572 int w, h, non_std, non_std_count, screen_hres;
573
574 h = hght;
575 screen_hres = QApplication::primaryScreen()->availableGeometry().width();
576 w = (100 * screen_hres) / 1920;
577 w = qMax(w, 80);
578
579 if (!force && w == width() && h == height()) {
580 return;
581 }
582
583 non_std = 0;
584 non_std_count = 0;
585
586 // Resize all non standard sidewidgets first
587 foreach (fc_sidewidget *sw, objects) {
588 if (sw->standard != SW_STD) {
589 sw->resize_pixmap(w, 0);
590 sw->setFixedSize(w, sw->get_pixmap()->height());
591 sw->update_final_pixmap();
592 non_std = non_std + sw->get_pixmap()->height();
593 non_std_count++;
594 }
595 }
596
597 h = h - non_std;
598 h = h / (objects.count() - non_std_count) - 2;
599 // Resize all standard sidewidgets
600 foreach (fc_sidewidget *sw, objects) {
601 if (sw->standard == SW_STD) {
602 sw->resize_pixmap(w, h);
603 sw->setFixedSize(w, h);
604 sw->update_final_pixmap();
605 }
606 }
607}
608
609/***********************************************************************/
612 void fc_sidebar::update_fonts()
613{
614 foreach (fc_sidewidget *sw, objects) {
615 sw->update_fonts();
616 sw->update_final_pixmap();
617 }
618}
619
620/***********************************************************************/
623 void side_show_map(bool nothing)
624{
625 gui()->game_tab_widget->setCurrentIndex(0);
626}
627
628/***********************************************************************/
631 void side_finish_turn(bool nothing)
632{
633 key_end_turn();
634}
635
636/***********************************************************************/
639 void side_rates_wdg(bool nothing)
640{
641 if (!client_is_observer()) {
642 popup_rates_dialog();
643 }
644}
645
646/***********************************************************************/
649 void side_center_unit()
650{
651 gui()->game_tab_widget->setCurrentIndex(0);
652 request_center_focus_unit();
653}
654
655/**********************************************************************/
658 void update_turn_done_tooltip()
659{
660 struct option *opt = optset_option_by_name(server_optset, "fixedlength");
661
662 if (opt != NULL && option_bool_get(opt)) {
663 gui()->sw_endturn->setToolTip(_("Fixed length turns"));
664 } else {
665 char buf[256];
666
667 fc_snprintf(buf, sizeof(buf), "%s:\n%s",
668 _("Turn Done"), _("Shift+Return"));
669 gui()->sw_endturn->setToolTip(buf);
670 }
671}
672
673/***********************************************************************/
676 void side_disable_endturn(bool do_restore)
677{
678 if (gui()->current_page() != PAGE_GAME) {
679 return;
680 }
681
682 gui()->sw_endturn->disabled = !do_restore;
683 gui()->sw_endturn->update_final_pixmap();
684}
685
686/***********************************************************************/
689 void side_blink_endturn(bool do_restore)
690{
691 if (gui()->current_page() != PAGE_GAME) {
692 return;
693 }
694 gui()->sw_endturn->blink = !do_restore;
695 gui()->sw_endturn->update_final_pixmap();
696}
697
698/***********************************************************************/
701 void side_indicators_menu()
702{
703 gov_menu *menu = new gov_menu(gui()->sidebar_wdg);
704
705 menu->create();
706 menu->update();
707 menu->popup(QCursor::pos());
708}
709
710/***********************************************************************/
715 void side_right_click_diplomacy(void)
716{
717 if (client_is_observer()) {
718 QMenu *menu = new QMenu(gui()->central_wdg);
719 QAction *eiskalt;
720 QString erwischt;
721
722 players_iterate(pplayer) {
723 if (pplayer == client.conn.playing) {
724 continue;
725 }
726 erwischt = QString(_("Observe %1")).arg(pplayer->name);
727 erwischt = erwischt + " ("
728 + nation_plural_translation(pplayer->nation) + ")";
729 eiskalt = new QAction(erwischt, gui()->mapview_wdg);
730 eiskalt->setData(QVariant::fromValue((void *)pplayer));
731 QObject::connect(eiskalt, &QAction::triggered, gui()->sw_diplo,
732 &fc_sidewidget::some_slot);
733 menu->addAction(eiskalt);
734 } players_iterate_end
735
736 if (!client_is_global_observer()) {
737 eiskalt = new QAction(_("Observe globally"), gui()->mapview_wdg);
738 eiskalt->setData(-1);
739 menu->addAction(eiskalt);
740 QObject::connect(eiskalt, &QAction::triggered, gui()->sw_diplo,
741 &fc_sidewidget::some_slot);
742 }
743
744 menu->setAttribute(Qt::WA_DeleteOnClose);
745 menu->popup(QCursor::pos());
746 } else {
747 int i;
748 i = gui()->gimme_index_of("DDI");
749 if (i < 0) {
750 return;
751 }
752 gui()->game_tab_widget->setCurrentIndex(i);
753 }
754}
755
756/***********************************************************************/
759 void side_right_click_science(void)
760{
761 QMenu *menu;
762 QAction *act;
763 QVariant qvar;
764 QList<qlist_item> curr_list;
765 qlist_item item;
766
767 if (!client_is_observer()) {
768 struct research *research = research_get(client_player());
769
770 advance_index_iterate(A_FIRST, i) {
771 if (TECH_PREREQS_KNOWN == research->inventions[i].state
772 && research->researching != i) {
773 item.tech_str =
774 QString::fromUtf8(advance_name_translation(advance_by_number(i)));
775 item.id = i;
776 curr_list.append(item);
777 }
778 } advance_index_iterate_end;
779 if (curr_list.isEmpty()) {
780 return;
781 }
782 std::sort(curr_list.begin(), curr_list.end(), comp_less_than);
783 menu = new QMenu(gui()->central_wdg);
784 for (int i = 0; i < curr_list.count(); i++) {
785 QIcon ic;
786 struct sprite *sp;
787
788 qvar = curr_list.at(i).id;
789 sp = get_tech_sprite(tileset, curr_list.at(i).id);
790 if (sp) {
791 ic = QIcon(*sp->pm);
792 }
793 act = new QAction(ic, curr_list.at(i).tech_str, gui()->mapview_wdg);
794 act->setData(qvar);
795 act->setProperty("scimenu", true);
796 menu->addAction(act);
797 QObject::connect(act, &QAction::triggered, gui()->sw_science,
798 &fc_sidewidget::some_slot);
799 }
800 menu->setAttribute(Qt::WA_DeleteOnClose);
801 menu->popup(QCursor::pos());
802 }
803}
804
805/***********************************************************************/
808 void side_left_click_science(bool nothing)
809{
810 science_report *sci_rep;
811 int i;
812 QWidget *w;
813
814 if (client_is_global_observer()) {
815 return;
816 }
817 if (!gui()->is_repo_dlg_open("SCI")) {
818 sci_rep = new science_report;
819 sci_rep->init();
820 } else {
821 i = gui()->gimme_index_of("SCI");
822 w = gui()->game_tab_widget->widget(i);
823 if (w->isVisible()) {
824 gui()->game_tab_widget->setCurrentIndex(0);
825 return;
826 }
827 sci_rep = reinterpret_cast< science_report*>(w);
828 gui()->game_tab_widget->setCurrentWidget(sci_rep);
829 }
830}
str
#define str
Definition astring.c:76
get_font
static QFont * get_font(enum client_font font)
Definition canvas.cpp:379
height
struct canvas int int struct sprite int int int int height
Definition canvas_g.h:44
width
struct canvas int int struct sprite int int int width
Definition canvas_g.h:44
send_chat
int send_chat(const char *message)
Definition chatline_common.c:46
fc_font::instance
static fc_font * instance()
Definition fonts.cpp:41
fc_sidewidget
Definition sidebar.h:50
fc_sidewidget::update_fonts
void update_fonts()
Definition sidebar.cpp:132
fc_sidewidget::blink
bool blink
Definition sidebar.h:71
fc_sidewidget::set_wheel_down
void set_wheel_down(pfcn func)
Definition sidebar.cpp:287
fc_sidewidget::final_pixmap
QPixmap * final_pixmap
Definition sidebar.h:100
fc_sidewidget::info_font
QFont * info_font
Definition sidebar.h:98
fc_sidewidget::wheel_down
pfcn wheel_down
Definition sidebar.h:94
fc_sidewidget::custom_label
QString custom_label
Definition sidebar.h:102
fc_sidewidget::sfont
QFont * sfont
Definition sidebar.h:97
fc_sidewidget::keep_blinking
bool keep_blinking
Definition sidebar.h:72
fc_sidewidget::~fc_sidewidget
~fc_sidewidget()
Definition sidebar.cpp:99
fc_sidewidget::fc_sidewidget
fc_sidewidget(QPixmap *pix, QString label, QString pg, pfcn_bool func, int type=SW_STD)
Definition sidebar.cpp:62
fc_sidewidget::wheelEvent
void wheelEvent(QWheelEvent *event)
Definition sidebar.cpp:319
fc_sidewidget::desc
QString desc
Definition sidebar.h:103
fc_sidewidget::set_wheel_up
void set_wheel_up(pfcn func)
Definition sidebar.cpp:295
fc_sidewidget::some_slot
void some_slot()
Definition sidebar.cpp:356
fc_sidewidget::contextMenuEvent
void contextMenuEvent(QContextMenuEvent *event)
Definition sidebar.cpp:258
fc_sidewidget::wheel_up
pfcn wheel_up
Definition sidebar.h:95
fc_sidewidget::def_pixmap
QPixmap * def_pixmap
Definition sidebar.h:99
fc_sidewidget::paintEvent
void paintEvent(QPaintEvent *event)
Definition sidebar.cpp:204
fc_sidewidget::paint
void paint()
fc_sidewidget::page
QString page
Definition sidebar.h:75
fc_sidewidget::set_custom_labels
void set_custom_labels(QString l)
Definition sidebar.cpp:152
fc_sidewidget::standard
int standard
Definition sidebar.h:74
fc_sidewidget::mousePressEvent
void mousePressEvent(QMouseEvent *event)
Definition sidebar.cpp:303
fc_sidewidget::set_left_click
void set_left_click(pfcn_bool func)
Definition sidebar.cpp:271
fc_sidewidget::set_label
void set_label(QString str)
Definition sidebar.cpp:176
fc_sidewidget::sblink
void sblink()
Definition sidebar.cpp:335
fc_sidewidget::hover
bool hover
Definition sidebar.h:92
fc_sidewidget::set_pixmap
void set_pixmap(QPixmap *pm)
Definition sidebar.cpp:120
fc_sidewidget::resize_pixmap
void resize_pixmap(int width, int height)
Definition sidebar.cpp:185
fc_sidewidget::timer
QTimer * timer
Definition sidebar.h:104
fc_sidewidget::set_right_click
void set_right_click(pfcn func)
Definition sidebar.cpp:279
fc_sidewidget::disabled
bool disabled
Definition sidebar.h:73
fc_sidewidget::set_tooltip
void set_tooltip(QString tooltip)
Definition sidebar.cpp:160
fc_sidewidget::leaveEvent
void leaveEvent(QEvent *event)
Definition sidebar.cpp:244
fc_sidewidget::left_click
pfcn_bool left_click
Definition sidebar.h:96
fc_sidewidget::enterEvent
void enterEvent(QEnterEvent *event)
Definition sidebar.cpp:228
fc_sidewidget::update_final_pixmap
void update_final_pixmap()
Definition sidebar.cpp:393
fc_sidewidget::scaled_pixmap
QPixmap * scaled_pixmap
Definition sidebar.h:101
fc_sidewidget::get_pixmap
QPixmap * get_pixmap()
Definition sidebar.cpp:168
fc_sidewidget::right_click
pfcn right_click
Definition sidebar.h:93
client_is_global_observer
bool client_is_global_observer(void)
Definition client_main.c:1345
client_is_observer
bool client_is_observer(void)
Definition client_main.c:1083
client
struct civclient client
Definition client_main.c:150
client_main.h
client_player
#define client_player()
Definition client_main.h:106
client_warming_sprite
struct sprite * client_warming_sprite(void)
Definition climisc.c:377
client_cooling_sprite
struct sprite * client_cooling_sprite(void)
Definition climisc.c:394
client_research_sprite
struct sprite * client_research_sprite(void)
Definition climisc.c:354
client_government_sprite
struct sprite * client_government_sprite(void)
Definition climisc.c:412
incite_cost
char * incite_cost
Definition comments.c:74
key_end_turn
void key_end_turn(void)
Definition control.c:3283
request_center_focus_unit
void request_center_focus_unit(void)
Definition control.c:2721
event
enum event_type event
Definition events.c:81
fc_client.h
O_SCIENCE
@ O_SCIENCE
Definition fc_types.h:101
O_LUXURY
@ O_LUXURY
Definition fc_types.h:101
O_GOLD
@ O_GOLD
Definition fc_types.h:101
_
#define _(String)
Definition fcintl.h:67
pos
static struct tile * pos
Definition finddlg.c:53
popup_rates_dialog
void popup_rates_dialog(void)
Definition gamedlgs.c:533
current_page
static enum client_pages current_page
Definition pages.c:78
tooltip
const char * tooltip
Definition repodlgs.c:1315
type
GType type
Definition repodlgs.c:1313
repodlgs.h
sprite.h
func
get_token_fn_t func
Definition inputfile.c:128
gui
static mpgui * gui
Definition mpgui_qt.cpp:52
fonts::notify_label
const char *const notify_label
Definition fonts.h:28
nation_plural_translation
const char * nation_plural_translation(const struct nation_type *pnation)
Definition nation.c:159
server_optset
const struct option_set * server_optset
Definition options.c:4019
option_bool_get
bool option_bool_get(const struct option *poption)
Definition options.c:796
optset_option_by_name
struct option * optset_option_by_name(const struct option_set *poptset, const char *name)
Definition options.c:430
dsend_packet_player_research
int dsend_packet_player_research(struct connection *pc, int tech)
Definition packets_gen.c:27133
players_iterate_end
#define players_iterate_end
Definition player.h:537
players_iterate
#define players_iterate(_pplayer)
Definition player.h:532
comp_less_than
bool comp_less_than(const qlist_item &q1, const qlist_item &q2)
Definition repodlgs.cpp:545
research_get
struct research * research_get(const struct player *pplayer)
Definition research.c:128
research.h
reduce_mod
static void reduce_mod(int &val, int &mod)
Definition sidebar.cpp:49
side_center_unit
void side_center_unit()
Definition sidebar.cpp:649
side_show_map
void side_show_map(bool nothing)
Definition sidebar.cpp:623
update_turn_done_tooltip
void update_turn_done_tooltip()
Definition sidebar.cpp:658
side_indicators_menu
void side_indicators_menu()
Definition sidebar.cpp:701
side_left_click_science
void side_left_click_science(bool nothing)
Definition sidebar.cpp:808
side_rates_wdg
void side_rates_wdg(bool nothing)
Definition sidebar.cpp:639
side_finish_turn
void side_finish_turn(bool nothing)
Definition sidebar.cpp:631
side_right_click_science
void side_right_click_science(void)
Definition sidebar.cpp:759
side_blink_endturn
void side_blink_endturn(bool do_restore)
Definition sidebar.cpp:689
side_disable_endturn
void side_disable_endturn(bool do_restore)
Definition sidebar.cpp:676
pixmap_copy
void pixmap_copy(QPixmap *dest, QPixmap *src, int src_x, int src_y, int dest_x, int dest_y, int width, int height)
Definition canvas.cpp:101
side_right_click_diplomacy
void side_right_click_diplomacy(void)
Definition sidebar.cpp:715
sidebar.h
SW_TAX
@ SW_TAX
Definition sidebar.h:26
SW_INDICATORS
@ SW_INDICATORS
Definition sidebar.h:26
SW_STD
@ SW_STD
Definition sidebar.h:26
pfcn_bool
void(* pfcn_bool)(bool)
Definition sidebar.h:31
pfcn
void(* pfcn)(void)
Definition sidebar.h:32
civclient::conn
struct connection conn
Definition client_main.h:96
color
Definition colors.h:21
connection::playing
struct player * playing
Definition connection.h:151
item
Definition climisc.h:80
option
Definition options.c:478
player_economic::science
int science
Definition player.h:63
player_economic::tax
int tax
Definition player.h:62
player
Definition player.h:247
player::economic
struct player_economic economic
Definition player.h:282
qlist_item
Definition repodlgs.h:116
research::research_invention::state
enum tech_state state
Definition research.h:71
research
Definition research.h:39
research::researching
Tech_type_id researching
Definition research.h:52
research::inventions
struct research::research_invention inventions[A_ARRAY_SIZE]
science_report
Definition repodlgs.c:69
science_report::init
void init()
Definition repodlgs.cpp:933
sprite
Definition sprite.h:22
sprite::pm
QPixmap * pm
Definition sprite.h:25
tileset
Definition tilespec.c:481
timer
Definition timing.c:81
timer::start
union timer::@11 start
fc_snprintf
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:974
advance_by_number
struct advance * advance_by_number(const Tech_type_id atype)
Definition tech.c:107
advance_name_translation
const char * advance_name_translation(const struct advance *padvance)
Definition tech.c:290
advance_index_iterate_end
#define advance_index_iterate_end
Definition tech.h:248
A_FIRST
#define A_FIRST
Definition tech.h:44
advance_index_iterate
#define advance_index_iterate(_start, _index)
Definition tech.h:244
get_tax_sprite
struct sprite * get_tax_sprite(const struct tileset *t, Output_type_id otype)
Definition tilespec.c:6883
get_tech_sprite
struct sprite * get_tech_sprite(const struct tileset *t, Tech_type_id tech)
Definition tilespec.c:6778