Freeciv21
Develop your civilization from humble roots to a global empire
page_game.h
Go to the documentation of this file.
1 /****** , , **********************************************************
2  \\ \\ Copyright (c) 1996-2020 Freeciv21 and Freeciv
3  ) \\ \\ I-- contributors. This file is part of Freeciv21.
4  ) )) )) / * \ Freeciv21 is free software: you can redistribute
5  \ || || / /^=" in and/or modify it under the terms of the GNU
6  ,__ _\ \\ --/ / General Public License as published by the Free
7 < \\___/ ' Software Foundation, either version 3 of the License,
8  '===\ ___, ) or (at your option) any later version.
9  \ )___/\\ You should have received a copy of the
10  / / '" GNU General Public License along with Freeciv21.
11  \ \ If not, see https://www.gnu.org/licenses/.
12 ****** '" **********************************************************/
13 #pragma once
14 
15 #include <QMap>
16 #include <QStackedWidget>
17 #include <QWidget>
18 
19 class city_dialog;
20 class fc_client;
21 class map_view;
22 class minimap_panel;
23 class hud_units;
24 class indicators_widget;
25 class chat_widget;
26 class message_widget;
27 class hud_battle_log;
28 class gold_widget;
29 class goto_dialog;
32 class top_bar;
33 class top_bar_widget;
34 class units_select;
35 class xvote;
36 
37 /****************************************************************************
38  Widget holding all game tabs
39 ****************************************************************************/
40 class fc_game_tab_widget : public QStackedWidget {
41  Q_OBJECT
42 
43 public:
45  void init();
46 
47 protected:
48  bool event(QEvent *event) override;
49 private slots:
50  void current_changed(int index);
51 };
52 
53 class pageGame : public QWidget {
54  Q_OBJECT
55 
56 public:
57  pageGame(QWidget *);
58  ~pageGame() override;
59  void reloadSidebarIcons();
60  void updateSidebarTooltips();
61  int addGameTab(QWidget *widget);
62  void rmGameTab(int index); // doesn't delete widget
63  void gimmePlace(QWidget *widget, const QString &str);
64  int gimmeIndexOf(const QString &str);
65  void removeRepoDlg(const QString &str);
66  bool isRepoDlgOpen(const QString &str);
67  void updateInfoLabel();
68 
69  void popup_budget_dialog();
70 
71  QWidget *game_main_widget;
89  bool diplomacy_notify = false;
90 public slots:
91 private slots:
93 
94 private:
102 };
103 
107 pageGame *queen();
fc_game_tab_widget()
Game tab widget constructor.
Definition: page_game.cpp:565
void init()
Init default settings for game_tab_widget.
Definition: page_game.cpp:570
bool event(QEvent *event) override
Resize event for all game tab widgets.
Definition: page_game.cpp:579
void current_changed(int index)
Tab has been changed.
Definition: page_game.cpp:648
Top bar widget that shows the amount of gold owned by the current player, and their income.
Definition: top_bar.h:109
Top bar widget for indicators (global warming/nuclear winter/science/ government).
Definition: top_bar.h:50
The panel at the bottom right of the game screen, holding the minimap and the Turn Done button.
Definition: minimap_panel.h:23
Top bar widget for national budget.
Definition: top_bar.h:33
city_dialog * city_overlay
Definition: page_game.h:83
::minimap_panel * minimap_panel
Definition: page_game.h:82
top_bar_widget * sw_map
Definition: page_game.h:99
void rmGameTab(int index)
Removes given tab widget from game page.
Definition: page_game.cpp:682
int gimmeIndexOf(const QString &str)
Returns index on game tab page of given report dialog.
Definition: page_game.cpp:706
int addGameTab(QWidget *widget)
Inserts tab widget to game view page.
Definition: page_game.cpp:670
bool isRepoDlgOpen(const QString &str)
Checks if given report is opened, if you create new report as tab on game page, figure out some origi...
Definition: page_game.cpp:736
indicators_widget * sw_indicators
Definition: page_game.h:87
map_view * mapview_wdg
Definition: page_game.h:81
top_bar_widget * sw_cities
Definition: page_game.h:97
void removeRepoDlg(const QString &str)
Removes report dialog string from the list marking it as closed.
Definition: page_game.cpp:723
top_bar * top_bar_wdg
Definition: page_game.h:73
pageGame(QWidget *)
Definition: page_game.cpp:64
top_bar_widget * sw_science
Definition: page_game.h:88
chat_widget * chat
Definition: page_game.h:80
void updateInfoLabelTimeout()
Definition: page_game.cpp:303
national_budget_widget * sw_tax
Definition: page_game.h:101
void updateSidebarTooltips()
Updates top bar tooltips.
Definition: page_game.cpp:340
bool diplomacy_notify
Definition: page_game.h:89
~pageGame() override
hud_units * unitinfo_wdg
Definition: page_game.h:77
QWidget * game_main_widget
Definition: page_game.h:71
top_bar_widget * sw_cunit
Definition: page_game.h:84
QTimer * update_info_timer
Definition: page_game.h:96
message_widget * message
Definition: page_game.h:78
void gimmePlace(QWidget *widget, const QString &str)
Finds not used index on game_view_tab and returns it.
Definition: page_game.cpp:690
hud_battle_log * battlelog_wdg
Definition: page_game.h:76
fc_game_tab_widget * game_tab_widget
Definition: page_game.h:72
xvote * x_vote
Definition: page_game.h:85
void reloadSidebarIcons()
Reloads top bar icons (useful on theme change)
Definition: page_game.cpp:234
QMap< QString, QWidget * > opened_repo_dlgs
Definition: page_game.h:95
gold_widget * sw_economy
Definition: page_game.h:98
void updateInfoLabel()
Real update, updates only once per 300 ms.
Definition: page_game.cpp:262
national_budget_dialog * budget_dialog
Definition: page_game.h:100
goto_dialog * gtd
Definition: page_game.h:74
top_bar_widget * sw_message
Definition: page_game.h:79
units_select * unit_selector
Definition: page_game.h:75
top_bar_widget * sw_diplo
Definition: page_game.h:86
void popup_budget_dialog()
Popup (or raise) the (tax/science/luxury) rates selection dialog.
Definition: page_game.cpp:281
pageGame * queen()
Return game instandce.
Definition: page_game.cpp:557