webperimental: killstack decides stack protects.
[freeciv.git] / client / gui-stub / dialogs.c
blobe23b49fb89d35692b81f48dd01390fd3877782c5
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)
6 any later version.
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 ***********************************************************************/
14 #ifdef HAVE_CONFIG_H
15 #include <fc_config.h>
16 #endif
18 /* common */
19 #include "game.h"
20 #include "government.h"
22 /* gui main header */
23 #include "gui_stub.h"
25 #include "dialogs.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
30 location.
31 **************************************************************************/
32 void popup_notify_goto_dialog(const char *headline, const char *lines,
33 const struct text_tag_list *tags,
34 struct tile *ptile)
36 /* PORTME */
39 /**************************************************************************
40 Popup a dialog to display connection message from server.
41 **************************************************************************/
42 void popup_connect_msg(const char *headline, const char *message)
44 /* PORTME */
47 /**************************************************************************
48 Popup a generic dialog to display some generic information.
49 **************************************************************************/
50 void popup_notify_dialog(const char *caption, const char *headline,
51 const char *lines)
53 /* PORTME */
56 /**************************************************************************
57 Popup the nation selection dialog.
58 **************************************************************************/
59 void popup_races_dialog(struct player *pplayer)
61 /* PORTME */
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)
70 /* PORTME */
73 /**************************************************************************
74 Popup a dialog window to select units on a particular tile.
75 **************************************************************************/
76 void unit_select_dialog_popup(struct tile *ptile)
78 /* PORTME */
81 /**************************************************************************
82 Update the dialog window to select units on a particular tile.
83 **************************************************************************/
84 void unit_select_dialog_update_real(void)
86 /* PORTME */
89 /**************************************************************************
90 The server has changed the set of selectable nations.
91 **************************************************************************/
92 void races_update_pickable(bool nationset_change)
94 /* PORTME */
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)
103 /* PORTME */
106 /**************************************************************************
107 Popup a dialog asking if the player wants to start a revolution.
108 **************************************************************************/
109 void popup_revolution_dialog(void)
111 /* PORTME */
114 /**************************************************************************
115 Popup a dialog that allows the player to select what action a unit
116 should take.
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)
124 /* PORTME */
127 /**************************************************************************
128 Popup a window asking a diplomatic unit if it wishes to incite the
129 given enemy city.
130 **************************************************************************/
131 void popup_incite_dialog(struct unit *actor, struct city *pcity, int cost,
132 const struct action *paction)
134 /* PORTME */
137 /**************************************************************************
138 Popup a dialog asking a diplomatic unit if it wishes to bribe the
139 given enemy unit.
140 **************************************************************************/
141 void popup_bribe_dialog(struct unit *actor, struct unit *punit, int cost,
142 const struct action *paction)
144 /* PORTME */
147 /**************************************************************************
148 Popup a dialog asking a diplomatic unit if it wishes to sabotage the
149 given enemy city.
150 **************************************************************************/
151 void popup_sabotage_dialog(struct unit *actor, struct city *pcity,
152 const struct action *paction)
154 /* PORTME */
157 /**************************************************************************
158 Popup a dialog asking the unit which improvement they would like to
159 pillage.
160 **************************************************************************/
161 void popup_pillage_dialog(struct unit *punit, bv_extras may_pillage)
163 /* PORTME */
166 /****************************************************************************
167 Pops up a dialog to confirm disband of the unit(s).
168 ****************************************************************************/
169 void popup_disband_dialog(struct unit_list *punits)
171 /* PORTME */
174 /**************************************************************************
175 Ruleset (modpack) has suggested loading certain tileset. Confirm from
176 user and load.
177 **************************************************************************/
178 void popup_tileset_suggestion_dialog(void)
180 /* PORTME */
183 /****************************************************************
184 Ruleset (modpack) has suggested loading certain soundset. Confirm from
185 user and load.
186 *****************************************************************/
187 void popup_soundset_suggestion_dialog(void)
189 /* PORTME */
192 /****************************************************************
193 Ruleset (modpack) has suggested loading certain musicset. Confirm from
194 user and load.
195 *****************************************************************/
196 void popup_musicset_suggestion_dialog(void)
198 /* PORTME */
201 /**************************************************************************
202 Tileset (modpack) has suggested loading certain theme. Confirm from
203 user and load.
204 **************************************************************************/
205 bool popup_theme_suggestion_dialog(const char *theme_name)
207 /* PORTME */
208 return FALSE;
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)
217 /* PORTME */
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)
227 /* PORTME */
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)
239 /* PORTME */
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)
251 /* PORTME */
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)
264 /* TODO: port me. */
267 /****************************************************************
268 Closes the action selection dialog
269 ****************************************************************/
270 void action_selection_close(void)
272 /* PORTME */
275 /****************************************************************
276 Player has gained a new tech.
277 *****************************************************************/
278 void show_tech_gained_dialog(Tech_type_id tech)
280 /* PORTME */
283 /****************************************************************
284 Show tileset error dialog.
285 *****************************************************************/
286 void show_tileset_error(const char *msg)
288 /* PORTME */
291 /****************************************************************
292 Give a warning when user is about to edit scenario with manually
293 set properties.
294 *****************************************************************/
295 bool gui_handmade_scenario_warning(void)
297 /* Just tell the client common code to handle this. */
298 return FALSE;
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)