Freeciv-3.3: /fast/freeciv/nightly/main/client/gui-sdl2/dialogs.c File Reference

Freeciv-3.3

Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
dialogs.c File Reference
`#include <SDL2/SDL.h>`
`#include "astring.h"`
`#include "bitvector.h"`
`#include "fcintl.h"`
`#include "log.h"`
`#include "rand.h"`
`#include "combat.h"`
`#include "game.h"`
`#include "government.h"`
`#include "movement.h"`
`#include "sex.h"`
`#include "unitlist.h"`
`#include "client_main.h"`
`#include "climap.h"`
`#include "goto.h"`
`#include "helpdata.h"`
`#include "packhand.h"`
`#include "ratesdlg_g.h"`
`#include "text.h"`
`#include "zoom.h"`
`#include "chatline.h"`
`#include "citydlg.h"`
`#include "cityrep.h"`
`#include "cma_fe.h"`
`#include "colors.h"`
`#include "finddlg.h"`
`#include "gotodlg.h"`
`#include "graphics.h"`
`#include "gui_id.h"`
`#include "gui_main.h"`
`#include "gui_tilespec.h"`
`#include "helpdlg.h"`
`#include "inteldlg.h"`
`#include "mapctrl.h"`
`#include "mapview.h"`
`#include "menu.h"`
`#include "messagewin.h"`
`#include "optiondlg.h"`
`#include "plrdlg.h"`
`#include "repodlgs.h"`
`#include "sprite.h"`
`#include "themespec.h"`
`#include "widget.h"`
`#include "wldlg.h"`
`#include "dialogs.h"`
`#include "speclist.h"`

Go to the source code of this file.

## Data Structures

struct | notify_goto_data
struct | notify_goto_dialog
struct | nation_info

## Macros

#define | SPECLIST_TAG notify_goto
#define | SPECLIST_TYPE struct notify_goto_data
#define | NUM_SEEN 20
#define | ADV_NUM_SEEN 15
#define | TARGETS_ROW 5
#define | TARGETS_COL 1

## Functions

void | popdown_diplomat_dialog (void)
void | popdown_incite_dialog (void)
void | popdown_bribe_dialog (void)
void | popdown_advanced_terrain_dialog (void)
int | advanced_terrain_window_dlg_callback (struct widget *pwindow)
int | exit_advanced_terrain_dlg_callback (struct widget *pwidget)
static void | unit_select_dialog_popdown (void)
static void | popdown_terrain_info_dialog (void)
static void | popdown_pillage_dialog (void)
static void | popdown_connect_dialog (void)
static void | popdown_unit_upgrade_dlg (void)
static void | popdown_unit_disband_dlg (void)
void | put_window_near_map_tile (struct widget *pwindow, int window_width, int window_height, struct tile *ptile)
void | popdown_all_game_dialogs (void)
static bool | sdl_get_chance_to_win (int *att_chance, int *def_chance, struct unit *enemy_unit, struct unit *my_unit)
static void | notify_goto_dialog_advance (struct notify_goto_dialog *pdialog)
static struct notify_goto_data * | notify_goto_data_new (const char *headline, const char *lines, struct tile *ptile)
static void | notify_goto_data_destroy (struct notify_goto_data *pdata)
static int | notify_goto_dialog_callback (struct widget *widget)
static int | notify_goto_dialog_close_callback (struct widget *widget)
static int | notify_goto_dialog_goto_callback (struct widget *widget)
static struct notify_goto_dialog * | notify_goto_dialog_new (void)
static void | notify_goto_dialog_destroy (struct notify_goto_dialog *pdialog)
static void | notify_goto_dialog_update (struct notify_goto_dialog *pdialog)
void | popup_notify_goto_dialog (const char *headline, const char *lines, const struct text_tag_list *tags, struct tile *ptile)
void | popdown_notify_goto_dialog (void)
void | popup_connect_msg (const char *headline, const char *message)
static int | notify_dialog_window_callback (struct widget *pwindow)
static int | exit_notify_dialog_callback (struct widget *pwidget)
void | popup_notify_dialog (const char *caption, const char *headline, const char *lines)
static int | upgrade_unit_window_callback (struct widget *pwindow)
static int | cancel_upgrade_unit_callback (struct widget *pwidget)
static int | ok_upgrade_unit_window_callback (struct widget *pwidget)
void | popup_upgrade_dialog (struct unit_list *punits)
void | popup_unit_upgrade_dlg (struct unit *punit, bool city)
static int | disband_unit_window_callback (struct widget *pwindow)
static int | cancel_disband_unit_callback (struct widget *pwidget)
static int | ok_disband_unit_window_callback (struct widget *pwidget)
void | popup_unit_disband_dlg (struct unit *punit, bool city)
static int | unit_select_window_callback (struct widget *pwindow)
static int | exit_unit_select_callback (struct widget *pwidget)
static int | unit_select_callback (struct widget *pwidget)
void | unit_select_dialog_popup (struct tile *ptile)
void | unit_select_dialog_update_real (void *unused)
static int | terrain_info_window_dlg_callback (struct widget *pwindow)
static int | exit_terrain_info_dialog_callback (struct widget *button)
const char * | sdl_get_tile_defense_info_text (struct tile *ptile)
static void | popup_terrain_info_dialog (SDL_Surface *pdest, struct tile *ptile)
static int | terrain_info_callback (struct widget *pwidget)
static int | zoom_to_city_callback (struct widget *pwidget)
static int | change_production_callback (struct widget *pwidget)
static int | hurry_production_callback (struct widget *pwidget)
static int | cma_callback (struct widget *pwidget)
static int | adv_unit_select_callback (struct widget *pwidget)
static int | adv_unit_select_all_callback (struct widget *pwidget)
static int | adv_unit_sentry_idle_callback (struct widget *pwidget)
static int | goto_here_callback (struct widget *pwidget)
static int | patrol_here_callback (struct widget *pwidget)
static int | paradrop_here_callback (struct widget *pwidget)
static int | unit_help_callback (struct widget *pwidget)
void | popup_advanced_terrain_dialog (struct tile *ptile, Uint16 pos_x, Uint16 pos_y)
static int | pillage_window_callback (struct widget *pwindow)
static int | pillage_callback (struct widget *pwidget)
static int | exit_pillage_dlg_callback (struct widget *pwidget)
void | popup_pillage_dialog (struct unit *punit, bv_extras extras)
static void | popdown_government_dialog (void)
static int | government_dlg_callback (struct widget *gov_button)
static int | move_government_dlg_callback (struct widget *pwindow)
void | popup_government_dialog (void)
static int | next_set_callback (struct widget *next_button)
static int | prev_set_callback (struct widget *prev_button)
static int | nations_dialog_callback (struct widget *pwindow)
static int | nation_button_callback (struct widget *pnation)
static int | races_dialog_ok_callback (struct widget *start_button)
static int | races_dialog_cancel_callback (struct widget *button)
static int | next_name_callback (struct widget *next_button)
static int | prev_name_callback (struct widget *prev_button)
static int | change_sex_callback (struct widget *sex)
static void | select_random_leader (Nation_type_id nation)
static void | change_nation_label (void)
static int | style_callback (struct widget *pwidget)
static int | help_dlg_callback (struct widget *pwindow)
static int | cancel_help_dlg_callback (struct widget *pwidget)
static int | leader_name_edit_callback (struct widget *pedit)
static int | get_playable_nation_count (void)
void | popup_races_dialog (struct player *pplayer)
void | popdown_races_dialog (void)
void | races_update_pickable (bool nationset_change)
void | nationset_changed (void)
void | races_toggles_set_sensitive (void)
void | popup_tileset_suggestion_dialog (void)
void | popup_soundset_suggestion_dialog (void)
void | popup_musicset_suggestion_dialog (void)
bool | popup_theme_suggestion_dialog (const char *theme_name)
void | show_tech_gained_dialog (Tech_type_id tech)
void | show_tileset_error (bool fatal, const char *tset_name, const char *msg)
bool | handmade_scenario_warning (void)
void | real_multipliers_dialog_update (void *unused)
bool | request_transport (struct unit *pcargo, struct tile *ptile)
void | popup_combat_info (int attacker_unit_id, int defender_unit_id, int attacker_hp, int defender_hp, bool make_att_veteran, bool make_def_veteran)
void | request_action_confirmation (const char *expl, struct act_confirmation_data *data)
static int | image_popup_window_callback (struct widget *pwindow)
static int | exit_image_popup_callback (struct widget *pwidget)
void | popup_image (const char *tag, int width, int height)

## Variables

struct player * | races_player
bool | is_unit_move_blocked
static char * | leader_name = NULL
static struct notify_goto_dialog * | notify_goto_dialog = NULL
struct advanced_dialog * | notify_dlg = NULL
static struct small_dialog * | unit_upgrade_dlg = NULL
static struct small_dialog * | unit_disband_dlg = NULL
static struct advanced_dialog * | unit_select_dlg = NULL
static struct small_dialog * | terrain_info_dlg = NULL
struct advanced_dialog * | advanced_terrain_dlg = NULL
static struct small_dialog * | pillage_dlg = NULL
static struct small_dialog * | connect_dlg = NULL
static struct small_dialog * | gov_dlg = NULL
static struct advanced_dialog * | nation_dlg = NULL
static struct small_dialog * | help_dlg = NULL
struct advanced_dialog * | advanced_image_popup = NULL

## Macro Definition Documentation

## ◆ ADV_NUM_SEEN

#define ADV_NUM_SEEN 15

## ◆ NUM_SEEN

#define NUM_SEEN 20

## ◆ SPECLIST_TAG

#define SPECLIST_TAG notify_goto

Definition at line 220 of file dialogs.c.

## ◆ SPECLIST_TYPE

#define SPECLIST_TYPE struct notify_goto_data

Definition at line 221 of file dialogs.c.

## ◆ TARGETS_COL

#define TARGETS_COL 1

## ◆ TARGETS_ROW

#define TARGETS_ROW 5

## Function Documentation

## ◆ adv_unit_select_all_callback()

static int adv_unit_select_all_callback | ( | struct widget * | pwidget | ) |

static

User selected all units from tile.

Definition at line 1555 of file dialogs.c.

Referenced by popup_advanced_terrain_dialog().

## ◆ adv_unit_select_callback()

static int adv_unit_select_callback | ( | struct widget * | pwidget | ) |

static

User selected unit.

Definition at line 1536 of file dialogs.c.

Referenced by popup_advanced_terrain_dialog().

## ◆ adv_unit_sentry_idle_callback()

static int adv_unit_sentry_idle_callback | ( | struct widget * | pwidget | ) |

static

Sentry unit widget contains.

Definition at line 1573 of file dialogs.c.

Referenced by popup_advanced_terrain_dialog().

## ◆ advanced_terrain_window_dlg_callback()

int advanced_terrain_window_dlg_callback | ( | struct widget * | pwindow | ) |

User selected "Advanced Menu"

Definition at line 1432 of file dialogs.c.

Referenced by popup_advanced_terrain_dialog().

## ◆ cancel_disband_unit_callback()

static int cancel_disband_unit_callback | ( | struct widget * | pwidget | ) |

static

User interacted with disband unit dialog cancel -button

Definition at line 844 of file dialogs.c.

Referenced by popup_unit_disband_dlg().

## ◆ cancel_help_dlg_callback()

static int cancel_help_dlg_callback | ( | struct widget * | pwidget | ) |

static

User requested closing of help dialog.

Definition at line 2863 of file dialogs.c.

Referenced by nation_button_callback(), and popdown_races_dialog().

## ◆ cancel_upgrade_unit_callback()

static int cancel_upgrade_unit_callback | ( | struct widget * | pwidget | ) |

static

User interacted with upgrade unit dialog cancel -button

Definition at line 635 of file dialogs.c.

Referenced by popup_unit_upgrade_dlg().

## ◆ change_nation_label()

static void change_nation_label | ( | void |  | ) |

static

Update nation label.

Definition at line 3024 of file dialogs.c.

Referenced by nation_button_callback(), and races_toggles_set_sensitive().

## ◆ change_production_callback()

static int change_production_callback | ( | struct widget * | pwidget | ) |

static

User requested production change.

Definition at line 1490 of file dialogs.c.

Referenced by popup_advanced_terrain_dialog().

## ◆ change_sex_callback()

static int change_sex_callback | ( | struct widget * | sex | ) |

static

User requested leader gender change.

Definition at line 2637 of file dialogs.c.

Referenced by next_name_callback(), popup_races_dialog(), and prev_name_callback().

## ◆ cma_callback()

static int cma_callback | ( | struct widget * | pwidget | ) |

static

User requested opening of cma settings.

Definition at line 1521 of file dialogs.c.

Referenced by popup_advanced_terrain_dialog().

## ◆ disband_unit_window_callback()

static int disband_unit_window_callback | ( | struct widget * | pwindow | ) |

static

User interacted with disband unit widget.

Definition at line 832 of file dialogs.c.

Referenced by popup_unit_disband_dlg().

## ◆ exit_advanced_terrain_dlg_callback()

int exit_advanced_terrain_dlg_callback | ( | struct widget * | pwidget | ) |

User requested closing of advanced terrain dialog.

Definition at line 1444 of file dialogs.c.

Referenced by popup_advanced_terrain_dialog().

## ◆ exit_image_popup_callback()

static int exit_image_popup_callback | ( | struct widget * | pwidget | ) |

static

User interacted with image popup dialog close button.

Definition at line 3737 of file dialogs.c.

Referenced by popup_image().

## ◆ exit_notify_dialog_callback()

static int exit_notify_dialog_callback | ( | struct widget * | pwidget | ) |

static

User interacted with notify dialog close button.

Definition at line 493 of file dialogs.c.

Referenced by popup_notify_dialog().

## ◆ exit_pillage_dlg_callback()

static int exit_pillage_dlg_callback | ( | struct widget * | pwidget | ) |

static

User requested closing of pillage dialog.

Definition at line 2258 of file dialogs.c.

Referenced by popup_pillage_dialog().

## ◆ exit_terrain_info_dialog_callback()

static int exit_terrain_info_dialog_callback | ( | struct widget * | button | ) |

static

Popdown terrain information dialog.

Definition at line 1293 of file dialogs.c.

Referenced by popup_terrain_info_dialog().

## ◆ exit_unit_select_callback()

static int exit_unit_select_callback | ( | struct widget * | pwidget | ) |

static

User requested unit select window to be closed.

Definition at line 1044 of file dialogs.c.

Referenced by unit_select_dialog_popup().

## ◆ get_playable_nation_count()

static int get_playable_nation_count | ( | void |  | ) |

static

Count available playable nations.

Definition at line 3097 of file dialogs.c.

Referenced by popup_races_dialog(), and races_toggles_set_sensitive().

## ◆ goto_here_callback()

static int goto_here_callback | ( | struct widget * | pwidget | ) |

static

Initiate goto to selected tile.

Definition at line 1600 of file dialogs.c.

Referenced by popup_advanced_terrain_dialog().

## ◆ government_dlg_callback()

static int government_dlg_callback | ( | struct widget * | gov_button | ) |

static

User selected government button.

Definition at line 2426 of file dialogs.c.

Referenced by popup_government_dialog().

## ◆ handmade_scenario_warning()

bool handmade_scenario_warning | ( | void |  | ) |

Give a warning when user is about to edit scenario with manually set properties.

Definition at line 3678 of file dialogs.c.

## ◆ help_dlg_callback()

static int help_dlg_callback | ( | struct widget * | pwindow | ) |

static

User interacted with help dialog.

Definition at line 2855 of file dialogs.c.

Referenced by nation_button_callback().

## ◆ hurry_production_callback()

static int hurry_production_callback | ( | struct widget * | pwidget | ) |

static

User requested hurry production.

Definition at line 1505 of file dialogs.c.

Referenced by popup_advanced_terrain_dialog().

## ◆ image_popup_window_callback()

static int image_popup_window_callback | ( | struct widget * | pwindow | ) |

static

User interacted with image popup dialog.

Definition at line 3725 of file dialogs.c.

Referenced by popup_image().

## ◆ leader_name_edit_callback()

static int leader_name_edit_callback | ( | struct widget * | pedit | ) |

static

User interacted with leader name edit widget.

Definition at line 3004 of file dialogs.c.

Referenced by popup_races_dialog().

## ◆ move_government_dlg_callback()

static int move_government_dlg_callback | ( | struct widget * | pwindow | ) |

static

User requested move of government dialog.

Definition at line 2440 of file dialogs.c.

Referenced by popup_government_dialog().

## ◆ nation_button_callback()

static int nation_button_callback | ( | struct widget * | nation_button | ) |

static

User selected nation.

Definition at line 2882 of file dialogs.c.

Referenced by popup_races_dialog().

## ◆ nations_dialog_callback()

static int nations_dialog_callback | ( | struct widget * | pwindow | ) |

static

User interacted with nations dialog.

Definition at line 2591 of file dialogs.c.

Referenced by popup_races_dialog().

## ◆ nationset_changed()

void nationset_changed | ( | void |  | ) |

Nationset selection update

Definition at line 3565 of file dialogs.c.

Referenced by option_gui_update(), and races_dialog::races_dialog().

## ◆ next_name_callback()

static int next_name_callback | ( | struct widget * | next | ) |

static

User requested next leader name.

Definition at line 2666 of file dialogs.c.

Referenced by popup_races_dialog().

## ◆ next_set_callback()

static int next_set_callback | ( | struct widget * | next_button | ) |

static

User requested next nationset

Definition at line 2776 of file dialogs.c.

Referenced by popup_races_dialog().

## ◆ notify_dialog_window_callback()

static int notify_dialog_window_callback | ( | struct widget * | pwindow | ) |

static

User interacted with generic notify dialog.

Definition at line 481 of file dialogs.c.

Referenced by popup_notify_dialog().

## ◆ notify_goto_data_destroy()

static void notify_goto_data_destroy | ( | struct notify_goto_data * | pdata | ) |

static

Destroy a notify goto data.

Definition at line 254 of file dialogs.c.

Referenced by notify_goto_dialog_new().

## ◆ notify_goto_data_new()

static struct notify_goto_data * notify_goto_data_new | ( | const char * | headline,
|  | const char * | lines,
|  | struct tile * | ptile
| ) |  |

static

Create a notify goto data.

Definition at line 238 of file dialogs.c.

Referenced by popup_notify_goto_dialog().

## ◆ notify_goto_dialog_advance()

static void notify_goto_dialog_advance | ( | struct notify_goto_dialog * | pdialog | ) |

static

Update a notify dialog.

Definition at line 422 of file dialogs.c.

Referenced by notify_goto_dialog_close_callback().

## ◆ notify_goto_dialog_callback()

static int notify_goto_dialog_callback | ( | struct widget * | widget | ) |

static

Move the notify dialog.

Definition at line 263 of file dialogs.c.

Referenced by notify_goto_dialog_new().

## ◆ notify_goto_dialog_close_callback()

static int notify_goto_dialog_close_callback | ( | struct widget * | widget | ) |

static

Close the notify dialog.

Definition at line 278 of file dialogs.c.

Referenced by notify_goto_dialog_new().

## ◆ notify_goto_dialog_destroy()

static void notify_goto_dialog_destroy | ( | struct notify_goto_dialog * | pdialog | ) |

static

Destroy a notify dialog.

Definition at line 357 of file dialogs.c.

Referenced by notify_goto_dialog_advance(), and popdown_notify_goto_dialog().

## ◆ notify_goto_dialog_goto_callback()

static int notify_goto_dialog_goto_callback | ( | struct widget * | widget | ) |

static

Goto callback.

Definition at line 293 of file dialogs.c.

Referenced by notify_goto_dialog_update().

## ◆ notify_goto_dialog_new()

static struct notify_goto_dialog * notify_goto_dialog_new | ( | void |  | ) |

static

Create a notify dialog.

Definition at line 318 of file dialogs.c.

Referenced by popup_notify_goto_dialog().

## ◆ notify_goto_dialog_update()

static void notify_goto_dialog_update | ( | struct notify_goto_dialog * | pdialog | ) |

static

Update a notify dialog.

Definition at line 376 of file dialogs.c.

Referenced by notify_goto_dialog_advance(), and popup_notify_goto_dialog().

## ◆ ok_disband_unit_window_callback()

static int ok_disband_unit_window_callback | ( | struct widget * | pwidget | ) |

static

User interacted with unit disband dialog "Disband" -button.

Definition at line 859 of file dialogs.c.

Referenced by popup_unit_disband_dlg().

## ◆ ok_upgrade_unit_window_callback()

static int ok_upgrade_unit_window_callback | ( | struct widget * | pwidget | ) |

static

User interacted with unit upgrade dialog "Upgrade" -button.

Definition at line 650 of file dialogs.c.

Referenced by popup_unit_upgrade_dlg().

## ◆ paradrop_here_callback()

static int paradrop_here_callback | ( | struct widget * | pwidget | ) |

static

Initiate paradrop to selected tile.

Definition at line 1648 of file dialogs.c.

Referenced by popup_advanced_terrain_dialog().

## ◆ patrol_here_callback()

static int patrol_here_callback | ( | struct widget * | pwidget | ) |

static

Initiate patrol to selected tile.

Definition at line 1619 of file dialogs.c.

Referenced by popup_advanced_terrain_dialog().

## ◆ pillage_callback()

static int pillage_callback | ( | struct widget * | pwidget | ) |

static

User selected what to pillage.

Definition at line 2237 of file dialogs.c.

## ◆ pillage_window_callback()

static int pillage_window_callback | ( | struct widget * | pwindow | ) |

static

User interacted with pillage dialog.

Definition at line 2225 of file dialogs.c.

Referenced by popup_pillage_dialog().

## ◆ popdown_advanced_terrain_dialog()

void popdown_advanced_terrain_dialog | ( | void |  | ) |

Popdown a generic dialog to display some generic information about terrain : tile, units , cities, etc.

Definition at line 1417 of file dialogs.c.

Referenced by adv_unit_select_all_callback(), adv_unit_select_callback(), adv_unit_sentry_idle_callback(), change_production_callback(), cma_callback(), exit_advanced_terrain_dlg_callback(), goto_here_callback(), hurry_production_callback(), paradrop_here_callback(), patrol_here_callback(), popdown_all_game_dialogs(), terrain_info_callback(), unit_help_callback(), and zoom_to_city_callback().

## ◆ popdown_all_game_dialogs()

void popdown_all_game_dialogs | ( | void |  | ) |

This function is called when the client disconnects or the game is over. It should close all dialog windows for that game.

Definition at line 149 of file dialogs.c.

## ◆ popdown_bribe_dialog()

void popdown_bribe_dialog | ( | void |  | ) |

extern

Popdown a dialog asking a diplomatic unit if it wishes to bribe the given enemy unit.

Definition at line 1856 of file action_dialog.c.

Referenced by popdown_all_game_dialogs().

## ◆ popdown_connect_dialog()

static void popdown_connect_dialog | ( | void |  | ) |

static

Popdown a dialog asking the unit how they want to "connect" their location to the destination.

Definition at line 2393 of file dialogs.c.

Referenced by popdown_all_game_dialogs().

## ◆ popdown_diplomat_dialog()

void popdown_diplomat_dialog | ( | void |  | ) |

extern

Popdown a dialog giving a diplomatic unit some options when moving into the target tile.

Definition at line 826 of file action_dialog.c.

Referenced by popdown_all_game_dialogs().

## ◆ popdown_government_dialog()

static void popdown_government_dialog | ( | void |  | ) |

static

Close the government dialog.

Definition at line 2413 of file dialogs.c.

Referenced by government_dlg_callback().

## ◆ popdown_incite_dialog()

void popdown_incite_dialog | ( | void |  | ) |

extern

Popdown a window asking a diplomatic unit if it wishes to incite the given enemy city.

Definition at line 1593 of file action_dialog.c.

Referenced by popdown_all_game_dialogs().

## ◆ popdown_notify_goto_dialog()

void popdown_notify_goto_dialog | ( | void |  | ) |

Popdown the notify goto dialog.

Definition at line 459 of file dialogs.c.

Referenced by popdown_all_game_dialogs().

## ◆ popdown_pillage_dialog()

static void popdown_pillage_dialog | ( | void |  | ) |

static

Popdown a dialog asking the unit which improvement they would like to pillage.

Definition at line 2271 of file dialogs.c.

Referenced by exit_pillage_dlg_callback(), pillage_callback(), and popdown_all_game_dialogs().

## ◆ popdown_races_dialog()

void popdown_races_dialog | ( | void |  | ) |

Close the nation selection dialog. This should allow the user to (at least) select a unit to activate.

Definition at line 3534 of file dialogs.c.

## ◆ popdown_terrain_info_dialog()

static void popdown_terrain_info_dialog | ( | void |  | ) |

static

Popdown terrain information dialog.

Definition at line 1280 of file dialogs.c.

Referenced by exit_terrain_info_dialog_callback(), and popdown_all_game_dialogs().

## ◆ popdown_unit_disband_dlg()

static void popdown_unit_disband_dlg | ( | void |  | ) |

static

Close unit disband dialog.

Definition at line 1015 of file dialogs.c.

Referenced by cancel_disband_unit_callback(), ok_disband_unit_window_callback(), and popdown_all_game_dialogs().

## ◆ popdown_unit_upgrade_dlg()

static void popdown_unit_upgrade_dlg | ( | void |  | ) |

static

Close unit upgrade dialog.

Definition at line 815 of file dialogs.c.

Referenced by cancel_upgrade_unit_callback(), ok_upgrade_unit_window_callback(), and popdown_all_game_dialogs().

## ◆ popup_advanced_terrain_dialog()

void popup_advanced_terrain_dialog | ( | struct tile * | ptile,
|  | Uint16 | pos_x,
|  | Uint16 | pos_y
| ) |  |

Popup a generic dialog to display some generic information about terrain : tile, units , cities, etc.

Definition at line 1697 of file dialogs.c.

Referenced by button_down_on_map(), and button_up_on_map().

## ◆ popup_combat_info()

void popup_combat_info | ( | int | attacker_unit_id,
|  | int | defender_unit_id,
|  | int | attacker_hp,
|  | int | defender_hp,
|  | bool | make_att_veteran,
|  | bool | make_def_veteran
| ) |  |

Popup detailed information about battle or save information for some kind of statistics

Definition at line 3704 of file dialogs.c.

## ◆ popup_connect_msg()

void popup_connect_msg | ( | const char * | headline,
|  | const char * | message
| ) |  |

Popup a dialog to display connection message from server.

Definition at line 470 of file dialogs.c.

## ◆ popup_government_dialog()

void popup_government_dialog | ( | void |  | ) |

Popup a dialog asking the player what government to switch to.

Definition at line 2452 of file dialogs.c.

Referenced by revolution_callback().

## ◆ popup_image()

void popup_image | ( | const char * | tag,
|  | int | width,
|  | int | height
| ) |  |

Popup image window

Definition at line 3755 of file dialogs.c.

## ◆ popup_musicset_suggestion_dialog()

void popup_musicset_suggestion_dialog | ( | void |  | ) |

Ruleset (modpack) has suggested loading certain musicset. Confirm from user and load.

Definition at line 3644 of file dialogs.c.

## ◆ popup_notify_dialog()

void popup_notify_dialog | ( | const char * | caption,
|  | const char * | headline,
|  | const char * | lines
| ) |  |

Popup a generic dialog to display some generic information.

Definition at line 511 of file dialogs.c.

## ◆ popup_notify_goto_dialog()

void popup_notify_goto_dialog | ( | const char * | headline,
|  | const char * | lines,
|  | const struct text_tag_list * | tags,
|  | struct tile * | ptile
| ) |  |

Popup a dialog to display information about an event that has a specific location. The user should be given the option to goto that location.

Definition at line 441 of file dialogs.c.

## ◆ popup_pillage_dialog()

void popup_pillage_dialog | ( | struct unit * | punit,
|  | bv_extras | extras
| ) |  |

Popup a dialog asking the unit which improvement they would like to pillage.

Definition at line 2286 of file dialogs.c.

## ◆ popup_races_dialog()

void popup_races_dialog | ( | struct player * | pplayer | ) |

Popup the nation selection dialog.

Definition at line 3113 of file dialogs.c.

## ◆ popup_soundset_suggestion_dialog()

void popup_soundset_suggestion_dialog | ( | void |  | ) |

Ruleset (modpack) has suggested loading certain soundset. Confirm from user and load.

Definition at line 3636 of file dialogs.c.

## ◆ popup_terrain_info_dialog()

static void popup_terrain_info_dialog | ( | SDL_Surface * | pdest,
|  | struct tile * | ptile
| ) |  |

static

Popup terrain information dialog.

Definition at line 1326 of file dialogs.c.

Referenced by popup_advanced_terrain_dialog(), and terrain_info_callback().

## ◆ popup_theme_suggestion_dialog()

bool popup_theme_suggestion_dialog | ( | const char * | theme_name | ) |

Tileset (modpack) has suggested loading certain theme. Confirm from user and load.

Definition at line 3652 of file dialogs.c.

## ◆ popup_tileset_suggestion_dialog()

void popup_tileset_suggestion_dialog | ( | void |  | ) |

Ruleset (modpack) has suggested loading certain tileset. Confirm from user and load.

Definition at line 3628 of file dialogs.c.

## ◆ popup_unit_disband_dlg()

void popup_unit_disband_dlg | ( | struct unit * | punit,
|  | bool | city
| ) |  |

Open unit disband dialog.

Definition at line 878 of file dialogs.c.

Referenced by disband_units_orders_city_dlg_callback(), and unit_order_callback().

## ◆ popup_unit_upgrade_dlg()

void popup_unit_upgrade_dlg | ( | struct unit * | punit,
|  | bool | city
| ) |  |

Open unit upgrade dialog.

Definition at line 683 of file dialogs.c.

Referenced by popup_upgrade_dialog(), unit_order_callback(), upgrade_callback(), and upgrade_units_orders_city_dlg_callback().

## ◆ popup_upgrade_dialog()

void popup_upgrade_dialog | ( | struct unit_list * | punits | ) |

Popup dialog for upgrade units

Definition at line 669 of file dialogs.c.

## ◆ prev_name_callback()

static int prev_name_callback | ( | struct widget * | prev | ) |

static

User requested previous leader name.

Definition at line 2721 of file dialogs.c.

Referenced by popup_races_dialog().

## ◆ prev_set_callback()

static int prev_set_callback | ( | struct widget * | prev_button | ) |

static

User requested prev nationset

Definition at line 2796 of file dialogs.c.

Referenced by popup_races_dialog().

## ◆ put_window_near_map_tile()

void put_window_near_map_tile | ( | struct widget * | pwindow,
|  | int | window_width,
|  | int | window_height,
|  | struct tile * | ptile
| ) |  |

Place window near given tile on screen.

Definition at line 109 of file dialogs.c.

Referenced by popup_action_selection(), popup_bribe_dialog(), popup_hurry_production_dialog(), popup_incite_dialog(), popup_pillage_dialog(), popup_sabotage_dialog(), popup_terrain_info_dialog(), popup_unit_disband_dlg(), popup_unit_upgrade_dlg(), and unit_select_dialog_popup().

## ◆ races_dialog_cancel_callback()

static int races_dialog_cancel_callback | ( | struct widget * | button | ) |

static

User cancelled nations dialog.

Definition at line 2815 of file dialogs.c.

Referenced by popup_races_dialog().

## ◆ races_dialog_ok_callback()

static int races_dialog_ok_callback | ( | struct widget * | start_button | ) |

static

User accepted nation.

Definition at line 2605 of file dialogs.c.

Referenced by popup_races_dialog().

## ◆ races_toggles_set_sensitive()

void races_toggles_set_sensitive | ( | void |  | ) |

In the nation selection dialog, make already-taken nations unavailable. This information is contained in the packet_nations_used packet.

Definition at line 3577 of file dialogs.c.

## ◆ races_update_pickable()

void races_update_pickable | ( | bool | nationset_change | ) |

The server has changed the set of selectable nations.

Definition at line 3552 of file dialogs.c.

## ◆ real_multipliers_dialog_update()

void real_multipliers_dialog_update | ( | void * | unused | ) |

Update multipliers (policies) dialog.

Definition at line 3687 of file dialogs.c.

## ◆ request_action_confirmation()

void request_action_confirmation | ( | const char * | expl,
|  | struct act_confirmation_data * | data
| ) |  |

Common code wants confirmation for an action.

Definition at line 3713 of file dialogs.c.

## ◆ request_transport()

bool request_transport | ( | struct unit * | pcargo,
|  | struct tile * | ptile
| ) |  |

Unit wants to get into some transport on given tile.

Definition at line 3695 of file dialogs.c.

## ◆ sdl_get_chance_to_win()

static bool sdl_get_chance_to_win | ( | int * | att_chance,
|  | int * | def_chance,
|  | struct unit * | enemy_unit,
|  | struct unit * | my_unit
| ) |  |

static

Find my unit's (focus) chance of success at attacking/defending the given enemy unit. Return FALSE if the values cannot be determined (e.g., no units given).

Definition at line 192 of file dialogs.c.

Referenced by popup_advanced_terrain_dialog(), and unit_select_dialog_popup().

## ◆ sdl_get_tile_defense_info_text()

const char * sdl_get_tile_defense_info_text | ( | struct tile * | ptile | ) |

Return a (static) string with terrain defense bonus. This does not include bonuses some units may get out of bases.

Definition at line 1306 of file dialogs.c.

Referenced by redraw_unit_info_label().

## ◆ select_random_leader()

static void select_random_leader | ( | Nation_type_id | nation | ) |

static

Selects a leader and the appropriate sex. Updates the gui elements and the selected_* variables.

Definition at line 3051 of file dialogs.c.

Referenced by nation_button_callback(), popup_races_dialog(), and races_toggles_set_sensitive().

## ◆ show_tech_gained_dialog()

void show_tech_gained_dialog | ( | Tech_type_id | tech | ) |

Player has gained a new tech.

Definition at line 3661 of file dialogs.c.

## ◆ show_tileset_error()

void show_tileset_error | ( | bool | fatal,
|  | const char * | tset_name,
|  | const char * | msg
| ) |  |

Show tileset error dialog.

Definition at line 3669 of file dialogs.c.

## ◆ style_callback()

static int style_callback | ( | struct widget * | pwidget | ) |

static

User interacted with style widget.

Definition at line 2828 of file dialogs.c.

Referenced by popup_races_dialog().

## ◆ terrain_info_callback()

static int terrain_info_callback | ( | struct widget * | pwidget | ) |

static

User requested terrain info.

Definition at line 1457 of file dialogs.c.

Referenced by popup_advanced_terrain_dialog().

## ◆ terrain_info_window_dlg_callback()

static int terrain_info_window_dlg_callback | ( | struct widget * | pwindow | ) |

static

Popdown terrain information dialog.

Definition at line 1268 of file dialogs.c.

Referenced by popup_terrain_info_dialog().

## ◆ unit_help_callback()

static int unit_help_callback | ( | struct widget * | pwidget | ) |

static

Show help about unit type.

Definition at line 1681 of file dialogs.c.

Referenced by popup_advanced_terrain_dialog().

## ◆ unit_select_callback()

static int unit_select_callback | ( | struct widget * | pwidget | ) |

static

User selected unit from unit select window.

Definition at line 1057 of file dialogs.c.

Referenced by unit_select_dialog_popup().

## ◆ unit_select_dialog_popdown()

static void unit_select_dialog_popdown | ( | void |  | ) |

static

Popdown a dialog window to select units on a particular tile.

Definition at line 1076 of file dialogs.c.

## ◆ unit_select_dialog_popup()

void unit_select_dialog_popup | ( | struct tile * | ptile | ) |

Popup a dialog window to select units on a particular tile.

Definition at line 1092 of file dialogs.c.

## ◆ unit_select_dialog_update_real()

void unit_select_dialog_update_real | ( | void * | unused | ) |

Update the dialog window to select units on a particular tile.

Definition at line 1254 of file dialogs.c.

## ◆ unit_select_window_callback()

static int unit_select_window_callback | ( | struct widget * | pwindow | ) |

static

User interacted with unit selection window.

Definition at line 1032 of file dialogs.c.

Referenced by unit_select_dialog_popup().

## ◆ upgrade_unit_window_callback()

static int upgrade_unit_window_callback | ( | struct widget * | pwindow | ) |

static

User interacted with upgrade unit widget.

Definition at line 623 of file dialogs.c.

Referenced by popup_unit_upgrade_dlg().

## ◆ zoom_to_city_callback()

static int zoom_to_city_callback | ( | struct widget * | pwidget | ) |

static

User requested zoom to city.

Definition at line 1474 of file dialogs.c.

Referenced by popup_advanced_terrain_dialog().

## Variable Documentation

## ◆ advanced_image_popup

struct advanced_dialog* advanced_image_popup = NULL

Definition at line 3720 of file dialogs.c.

Referenced by exit_image_popup_callback(), image_popup_window_callback(), and popup_image().

## ◆ advanced_terrain_dlg

struct advanced_dialog* advanced_terrain_dlg = NULL

Definition at line 1411 of file dialogs.c.

Referenced by advanced_terrain_window_dlg_callback(), popdown_advanced_terrain_dialog(), and popup_advanced_terrain_dialog().

## ◆ connect_dlg

struct small_dialog* connect_dlg = NULL

static

Definition at line 2387 of file dialogs.c.

Referenced by popdown_connect_dialog().

## ◆ gov_dlg

struct small_dialog* gov_dlg = NULL

static

Definition at line 2408 of file dialogs.c.

Referenced by move_government_dlg_callback(), popdown_government_dialog(), and popup_government_dialog().

## ◆ help_dlg

struct small_dialog* help_dlg = NULL

static

Definition at line 2559 of file dialogs.c.

Referenced by cancel_help_dlg_callback(), and nation_button_callback().

## ◆ is_unit_move_blocked

bool is_unit_move_blocked

extern

Definition at line 107 of file gui_main.c.

Referenced by exit_unit_select_callback(), popdown_advanced_terrain_dialog(), popdown_connect_dialog(), popdown_pillage_dialog(), popup_advanced_terrain_dialog(), popup_pillage_dialog(), unit_select_dialog_popdown(), and unit_select_dialog_popup().

## ◆ leader_name

char* leader_name = NULL

static

Definition at line 97 of file dialogs.c.

Referenced by aifill(), create_command_pregame(), leader_name_edit_callback(), next_name_callback(), popdown_races_dialog(), populate_leader_list(), prev_name_callback(), receive_packet_ruleset_nation_100(), and select_random_leader().

## ◆ nation_dlg

struct advanced_dialog* nation_dlg = NULL

static

Definition at line 2558 of file dialogs.c.

Referenced by change_nation_label(), change_sex_callback(), nation_button_callback(), nations_dialog_callback(), nationset_changed(), next_name_callback(), next_set_callback(), popdown_races_dialog(), popup_races_dialog(), prev_name_callback(), prev_set_callback(), races_dialog_ok_callback(), races_toggles_set_sensitive(), races_update_pickable(), select_random_leader(), and style_callback().

## ◆ notify_dlg

struct advanced_dialog* notify_dlg = NULL

Definition at line 476 of file dialogs.c.

Referenced by exit_notify_dialog_callback(), notify_dialog_window_callback(), and popup_notify_dialog().

## ◆ notify_goto_dialog

struct notify_goto_dialog* notify_goto_dialog = NULL

static

Definition at line 231 of file dialogs.c.

## ◆ pillage_dlg

struct small_dialog* pillage_dlg = NULL

static

Definition at line 2220 of file dialogs.c.

Referenced by pillage_window_callback(), popdown_pillage_dialog(), and popup_pillage_dialog().

## ◆ races_player

struct player* races_player

Definition at line 86 of file dialogs.c.

## ◆ terrain_info_dlg

struct small_dialog* terrain_info_dlg = NULL

static

Definition at line 1262 of file dialogs.c.

Referenced by popdown_terrain_info_dialog(), popup_terrain_info_dialog(), and terrain_info_window_dlg_callback().

## ◆ unit_disband_dlg

struct small_dialog* unit_disband_dlg = NULL

static

Definition at line 827 of file dialogs.c.

Referenced by disband_unit_window_callback(), popdown_unit_disband_dlg(), and popup_unit_disband_dlg().

## ◆ unit_select_dlg

struct advanced_dialog* unit_select_dlg = NULL

static

Definition at line 1027 of file dialogs.c.

Referenced by unit_select_dialog_popdown(), unit_select_dialog_popup(), and unit_select_window_callback().

## ◆ unit_upgrade_dlg

struct small_dialog* unit_upgrade_dlg = NULL

static

Definition at line 618 of file dialogs.c.

Referenced by popdown_unit_upgrade_dlg(), popup_unit_upgrade_dlg(), and upgrade_unit_window_callback().