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
,
132 const struct action
*paction
)
137 /**************************************************************************
138 Popup a dialog asking a diplomatic unit if it wishes to bribe the
140 **************************************************************************/
141 void popup_bribe_dialog(struct unit
*actor
, struct unit
*punit
, int cost
,
142 const struct action
*paction
)
147 /**************************************************************************
148 Popup a dialog asking a diplomatic unit if it wishes to sabotage the
150 **************************************************************************/
151 void popup_sabotage_dialog(struct unit
*actor
, struct city
*pcity
,
152 const struct action
*paction
)
157 /**************************************************************************
158 Popup a dialog asking the unit which improvement they would like to
160 **************************************************************************/
161 void popup_pillage_dialog(struct unit
*punit
, bv_extras may_pillage
)
166 /****************************************************************************
167 Pops up a dialog to confirm disband of the unit(s).
168 ****************************************************************************/
169 void popup_disband_dialog(struct unit_list
*punits
)
174 /**************************************************************************
175 Ruleset (modpack) has suggested loading certain tileset. Confirm from
177 **************************************************************************/
178 void popup_tileset_suggestion_dialog(void)
183 /****************************************************************
184 Ruleset (modpack) has suggested loading certain soundset. Confirm from
186 *****************************************************************/
187 void popup_soundset_suggestion_dialog(void)
192 /****************************************************************
193 Ruleset (modpack) has suggested loading certain musicset. Confirm from
195 *****************************************************************/
196 void popup_musicset_suggestion_dialog(void)
201 /**************************************************************************
202 Tileset (modpack) has suggested loading certain theme. Confirm from
204 **************************************************************************/
205 bool popup_theme_suggestion_dialog(const char *theme_name
)
211 /**************************************************************************
212 This function is called when the client disconnects or the game is
213 over. It should close all dialog windows for that game.
214 **************************************************************************/
215 void popdown_all_game_dialogs(void)
220 /**************************************************************************
221 Returns the id of the actor unit currently handled in action selection
222 dialog when the action selection dialog is open.
223 Returns IDENTITY_NUMBER_ZERO if no action selection dialog is open.
224 **************************************************************************/
225 int action_selection_actor_unit(void)
228 return IDENTITY_NUMBER_ZERO
;
231 /**************************************************************************
232 Returns id of the target city of the actions currently handled in action
233 selection dialog when the action selection dialog is open and it has a
234 city target. Returns IDENTITY_NUMBER_ZERO if no action selection dialog
235 is open or no city target is present in the action selection dialog.
236 **************************************************************************/
237 int action_selection_target_city(void)
240 return IDENTITY_NUMBER_ZERO
;
243 /**************************************************************************
244 Returns id of the target unit of the actions currently handled in action
245 selection dialog when the action selection dialog is open and it has a
246 unit target. Returns IDENTITY_NUMBER_ZERO if no action selection dialog
247 is open or no unit target is present in the action selection dialog.
248 **************************************************************************/
249 int action_selection_target_unit(void)
252 return IDENTITY_NUMBER_ZERO
;
255 /**************************************************************************
256 Updates the action selection dialog with new information.
257 **************************************************************************/
258 void action_selection_refresh(struct unit
*actor_unit
,
259 struct city
*target_city
,
260 struct unit
*target_unit
,
261 struct tile
*target_tile
,
262 const struct act_prob
*act_probs
)
267 /****************************************************************
268 Closes the action selection dialog
269 ****************************************************************/
270 void action_selection_close(void)
275 /****************************************************************
276 Player has gained a new tech.
277 *****************************************************************/
278 void show_tech_gained_dialog(Tech_type_id tech
)
283 /****************************************************************
284 Show tileset error dialog.
285 *****************************************************************/
286 void show_tileset_error(const char *msg
)
291 /****************************************************************
292 Give a warning when user is about to edit scenario with manually
294 *****************************************************************/
295 bool gui_handmade_scenario_warning(void)
297 /* Just tell the client common code to handle this. */
301 /****************************************************************
302 Unit wants to get into some transport on given tile.
303 *****************************************************************/
304 bool gui_request_transport(struct unit
*pcargo
, struct tile
*ptile
)
306 return FALSE
; /* Unit was not handled here. */
309 /***************************************************************************
310 Popup detailed information about battle or save information for
311 some kind of statistics
312 ***************************************************************************/
313 void gui_popup_combat_info(int attacker_unit_id
, int defender_unit_id
,
314 int attacker_hp
, int defender_hp
,
315 bool make_winner_veteran
)