1 /***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
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)
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 ***********************************************************************/
15 #include <fc_config.h>
20 #include "government.h"
27 /**************************************************************************
28 Popup a dialog to display information about an event that has a
29 specific location. The user should be given the option to goto that
31 **************************************************************************/
32 void popup_notify_goto_dialog(const char *headline
, const char *lines
,
33 const struct text_tag_list
*tags
,
39 /**************************************************************************
40 Popup a dialog to display connection message from server.
41 **************************************************************************/
42 void popup_connect_msg(const char *headline
, const char *message
)
47 /**************************************************************************
48 Popup a generic dialog to display some generic information.
49 **************************************************************************/
50 void popup_notify_dialog(const char *caption
, const char *headline
,
56 /**************************************************************************
57 Popup the nation selection dialog.
58 **************************************************************************/
59 void popup_races_dialog(struct player
*pplayer
)
64 /**************************************************************************
65 Close the nation selection dialog. This should allow the user to
66 (at least) select a unit to activate.
67 **************************************************************************/
68 void popdown_races_dialog(void)
73 /**************************************************************************
74 Popup a dialog window to select units on a particular tile.
75 **************************************************************************/
76 void unit_select_dialog_popup(struct tile
*ptile
)
81 /**************************************************************************
82 Update the dialog window to select units on a particular tile.
83 **************************************************************************/
84 void unit_select_dialog_update_real(void)
89 /**************************************************************************
90 The server has changed the set of selectable nations.
91 **************************************************************************/
92 void races_update_pickable(bool nationset_change
)
97 /**************************************************************************
98 In the nation selection dialog, make already-taken nations unavailable.
99 This information is contained in the packet_nations_used packet.
100 **************************************************************************/
101 void races_toggles_set_sensitive(void)
106 /**************************************************************************
107 Popup a dialog asking if the player wants to start a revolution.
108 **************************************************************************/
109 void popup_revolution_dialog(void)
114 /**************************************************************************
115 Popup a dialog that allows the player to select what action a unit
117 **************************************************************************/
118 void popup_action_selection(struct unit
*actor_unit
,
119 struct city
*target_city
,
120 struct unit
*target_unit
,
121 struct tile
*target_tile
,
122 const struct act_prob
*act_probs
)
127 /**************************************************************************
128 Popup a window asking a diplomatic unit if it wishes to incite the
130 **************************************************************************/
131 void popup_incite_dialog(struct unit
*actor
, struct city
*pcity
, int cost
)
136 /**************************************************************************
137 Popup a dialog asking a diplomatic unit if it wishes to bribe the
139 **************************************************************************/
140 void popup_bribe_dialog(struct unit
*actor
, struct unit
*punit
, int cost
)
145 /**************************************************************************
146 Popup a dialog asking a diplomatic unit if it wishes to sabotage the
148 **************************************************************************/
149 void popup_sabotage_dialog(struct unit
*actor
, struct city
*pcity
)
154 /**************************************************************************
155 Popup a dialog asking the unit which improvement they would like to
157 **************************************************************************/
158 void popup_pillage_dialog(struct unit
*punit
, bv_extras may_pillage
)
163 /****************************************************************************
164 Pops up a dialog to confirm disband of the unit(s).
165 ****************************************************************************/
166 void popup_disband_dialog(struct unit_list
*punits
)
171 /**************************************************************************
172 Ruleset (modpack) has suggested loading certain tileset. Confirm from
174 **************************************************************************/
175 void popup_tileset_suggestion_dialog(void)
180 /****************************************************************
181 Ruleset (modpack) has suggested loading certain soundset. Confirm from
183 *****************************************************************/
184 void popup_soundset_suggestion_dialog(void)
189 /****************************************************************
190 Ruleset (modpack) has suggested loading certain musicset. Confirm from
192 *****************************************************************/
193 void popup_musicset_suggestion_dialog(void)
198 /**************************************************************************
199 Tileset (modpack) has suggested loading certain theme. Confirm from
201 **************************************************************************/
202 bool popup_theme_suggestion_dialog(const char *theme_name
)
208 /**************************************************************************
209 This function is called when the client disconnects or the game is
210 over. It should close all dialog windows for that game.
211 **************************************************************************/
212 void popdown_all_game_dialogs(void)
217 /**************************************************************************
218 Returns the id of the actor unit currently handled in action selection
219 dialog when the action selection dialog is open.
220 Returns IDENTITY_NUMBER_ZERO if no action selection dialog is open.
221 **************************************************************************/
222 int action_selection_actor_unit(void)
225 return IDENTITY_NUMBER_ZERO
;
228 /**************************************************************************
229 Returns id of the target city of the actions currently handled in action
230 selection dialog when the action selection dialog is open and it has a
231 city target. Returns IDENTITY_NUMBER_ZERO if no action selection dialog
232 is open or no city target is present in the action selection dialog.
233 **************************************************************************/
234 int action_selection_target_city(void)
237 return IDENTITY_NUMBER_ZERO
;
240 /**************************************************************************
241 Returns id of the target unit of the actions currently handled in action
242 selection dialog when the action selection dialog is open and it has a
243 unit target. Returns IDENTITY_NUMBER_ZERO if no action selection dialog
244 is open or no unit target is present in the action selection dialog.
245 **************************************************************************/
246 int action_selection_target_unit(void)
249 return IDENTITY_NUMBER_ZERO
;
252 /**************************************************************************
253 Updates the action selection dialog with new information.
254 **************************************************************************/
255 void action_selection_refresh(struct unit
*actor_unit
,
256 struct city
*target_city
,
257 struct unit
*target_unit
,
258 struct tile
*target_tile
,
259 const struct act_prob
*act_probs
)
264 /****************************************************************
265 Closes the action selection dialog
266 ****************************************************************/
267 void action_selection_close(void)
272 /****************************************************************
273 Player has gained a new tech.
274 *****************************************************************/
275 void show_tech_gained_dialog(Tech_type_id tech
)
280 /****************************************************************
281 Show tileset error dialog.
282 *****************************************************************/
283 void show_tileset_error(const char *msg
)
288 /****************************************************************
289 Give a warning when user is about to edit scenario with manually
291 *****************************************************************/
292 bool gui_handmade_scenario_warning(void)
294 /* Just tell the client common code to handle this. */
298 /****************************************************************
299 Unit wants to get into some transport on given tile.
300 *****************************************************************/
301 bool gui_request_transport(struct unit
*pcargo
, struct tile
*ptile
)
303 return FALSE
; /* Unit was not handled here. */
306 /***************************************************************************
307 Popup detailed information about battle or save information for
308 some kind of statistics
309 ***************************************************************************/
310 void gui_popup_combat_info(int attacker_unit_id
, int defender_unit_id
,
311 int attacker_hp
, int defender_hp
,
312 bool make_winner_veteran
)