169 static bool left =
FALSE;
263#if IS_BETA_VERSION || IS_DEVEL_VERSION
292#if IS_BETA_VERSION || IS_DEVEL_VERSION
320 _(
"Launches local server, and connects to it for a single-player game."));
328 _(
"Loads one of the scenarios for a single-player game. "
329 "Tutorial is one of the scenarios."));
337 _(
"Continues previously saved single-player game."));
345 _(
"Connects to outside server. "
346 "Sometimes you want to launch a separate server even for local games."));
354 _(
"Adjusting client-side options."));
362 _(
"Gives you a break from playing freeciv."));
434 files = pdialog->
files();
453 if (
NULL != filename) {
474 _(
"_Save") :
_(
"_Open"),
505 const gchar *full_path;
522 if (
NULL == filename) {
525 pdialog->
action(filename);
563 const gchar *filename;
633 "use-underline",
TRUE,
634 "mnemonic-widget",
view,
675 "use-underline",
TRUE,
676 "mnemonic-widget",
entry,
1125 for (
i = 0;
i <
n;
i++) {
1331 "use-underline",
TRUE,
1333 "label",
_(
"_Host:"),
1346 "use-underline",
TRUE,
1348 "label",
_(
"_Port:"),
1362 "use-underline",
TRUE,
1364 "label",
_(
"_Login:"),
1379 "use-underline",
TRUE,
1381 "label",
_(
"Pass_word:"),
1395 "use-underline",
TRUE,
1397 "label",
_(
"Conf_irm Password:"),
1591 enum ai_level *levels = (
enum ai_level *)data;
1598 enum ai_level
level = levels[
i];
1770 char buf[4096] =
"";
1830 if (
NULL != pplayer) {
1916 enum ai_level
level;
1937 const int count = pplayer->
team
1998 if ((1 !=
event->button && 3 !=
event->button)
2006 if (1 ==
event->button) {
2012 }
else if (3 ==
event->button) {
2016 int player_no, conn_id;
2137 log_error(
"%s(): connection %s not found.",
2211 text =
_(
"Not _ready");
2216 if (
is_human(pplayer) && !pplayer->is_ready) {
2254 text =
_(
"Pick _Nation");
2257 text =
_(
"_Take a Player");
2270 text =
_(
"_Observe");
2273 text =
_(
"Do not _observe");
2287 const struct player *pplayer)
2292 if (
NULL != start) {
2322 if (
NULL != start) {
2392 flag = pplayer->nation ?
get_flag(pplayer->nation) :
NULL;
2396 if (
pconn->playing == pplayer && !
pconn->observer) {
2397 conn_id =
pconn->id;
2403 if (
is_ai(pplayer) && !pplayer->was_created
2404 && !pplayer->is_connected) {
2415 is_ready = !
is_human(pplayer) ?
TRUE : pplayer->is_ready;
2418 nation =
_(
"Random");
2419 if (pplayer->was_created) {
2454 if (
pconn->id == conn_id) {
2629 enum ai_level
level;
2679 "use-underline",
TRUE,
2680 "mnemonic-widget",
spin,
2682 "label",
_(
"Number of _Players\n(including AI):"),
2706 "use-underline",
TRUE,
2708 "label",
_(
"AI Skill _Level:"),
2721 "use-underline",
TRUE,
2723 "label",
_(
"Ruleset:"),
2730 _(
"_More Game Options..."));
2843 if (load_successful) {
2867 const gchar *filename;
2942 "use-underline",
TRUE,
2943 "mnemonic-widget",
view,
2944 "label",
_(
"Choose Saved Game to _Load:"),
2999 2, &description, -1);
3011 maj = ver / 1000000;
3095 if (
fcver < 30000) {
3101 if (
fcver % 10000 >= 9000) {
3108 "scenario.description");
3223 "use-underline",
TRUE,
3224 "mnemonic-widget",
view,
3225 "label",
_(
"Choose a _Scenario:"),
3364 log_debug(
"Switching client page from %s to %s.",
3577 _(
"Error Creating the Map Image!"), msg);
3595 if (!
strcmp(
"default", rulesets[
i])) {
struct canvas int int struct sprite int int int int height
struct canvas int int struct sprite int int int width
int send_chat_printf(const char *format,...)
int send_chat(const char *message)
void output_window_append(const struct ft_color color, const char *featured_text)
bool can_client_control(void)
bool client_is_global_observer(void)
bool client_is_observer(void)
enum client_states client_state(void)
char fc_password[MAX_LEN_PASSWORD]
enum ai_level server_ai_level(void)
bool mapimg_client_createmap(const char *filename)
void center_on_something(void)
static struct fc_sockaddr_list * list
int connect_to_server(const char *username, const char *hostname, int port, char *errbuf, int errbufsize)
void disconnect_from_server(bool leaving_sound)
void send_save_game(const char *filename)
void set_ruleset(const char *ruleset)
bool is_server_running(void)
bool client_start_server(void)
bool can_client_access_hack(void)
const char * conn_description(const struct connection *pconn)
struct connection * conn_by_number(int id)
#define conn_list_iterate(connlist, pconn)
#define conn_list_iterate_end
void fc_mutex_allocate(fc_mutex *mutex)
void fc_mutex_release(fc_mutex *mutex)
const struct ft_color ftc_client
static PangoLayout * layout
void inputline_toolkit_view_append_button(GtkWidget *toolkit_view, GtkWidget *button)
GtkWidget * inputline_toolkit_view_new(void)
void inputline_grab_focus(void)
void chatline_scroll_to_bottom(bool delayed)
void popup_races_dialog(struct player *pplayer)
const char * client_string
GtkTextBuffer * message_buffer
struct video_mode * resolution_request_get(void)
void enable_menus(bool enable)
void refresh_chat_buttons(void)
void reset_unit_table(void)
static struct video_mode vmode
GtkWidget * toplevel_tabs
#define GUI_GTK_OPTION(optname)
void gtk_tree_view_focus(GtkTreeView *view)
void gtk_stockbutton_set_label(GtkWidget *button, const gchar *label_text)
GtkWidget * icon_label_button_new(const gchar *icon_name, const gchar *label_text)
GtkTreeViewColumn * add_treeview_column(GtkWidget *view, const char *title, GType gtype, int model_index)
void setup_dialog(GtkWidget *shell, GtkWidget *parent)
void mapview_freeze(void)
void overview_size_changed(void)
static struct gui_dialog * shell
void option_dialog_popup(const char *name, const struct option_set *poptset)
static GtkListStore * load_store
static void update_network_page(void)
void handle_game_load(bool load_successful, const char *filename)
GtkWidget * create_start_page(void)
GtkWidget * create_network_page(void)
static void client_aitoggle_player(void *data)
static GtkWidget * nation_button
static void update_server_list(enum server_scan_type sstype, const struct server_list *list)
static void start_scenario_callback(GtkWidget *w, gpointer data)
static GtkTreeSelection * scenario_selection
static void update_start_page_buttons(void)
static void save_dialog_response_callback(GtkWidget *w, gint response, gpointer data)
GtkWidget * create_scenario_page(void)
static void show_conn_popup(struct player *pplayer, struct connection *pconn)
static GtkWidget * network_confirm_password_label
void save_mapimg_dialog_popup(void)
static void ruleset_selected(const char *name)
static void ready_button_callback(GtkWidget *w, gpointer data)
static bool conn_list_selection(struct player **ppplayer, struct connection **ppconn)
static struct server_scan_timer_data meta_scan
static void update_network_lists(void)
static GtkWidget * statusbar
static GtkWidget * server_playerlist_view
static GtkListStore * save_dialog_store_new(void)
void append_network_statusbar(const char *text, bool force)
static gboolean update_network_statusbar(gpointer data)
void set_rulesets(int num_rulesets, char **rulesets)
void mapimg_client_save(const char *filename)
static void conn_menu_player_command(GObject *object, gpointer data)
static void load_filename(const char *filename)
static void conn_menu_nation_chosen(GObject *object, gpointer data)
static GtkWidget * scenario_description
void save_game_dialog_popup(void)
enum client_pages get_current_client_page(void)
static GtkListStore * lan_store
static enum connection_state connection_status
static struct server_scan_timer_data lan_scan
static void save_dialog_list_callback(GtkTreeSelection *selection, gpointer data)
static void connect_network_game_callback(GtkWidget *w, gpointer data)
static GtkTreeView * connection_list_view
static GtkWidget * network_login
static GtkWidget * network_login_label
static void connect_callback(GtkWidget *w, gpointer data)
static void scenario_browse_callback(GtkWidget *w, gpointer data)
static GtkListStore * meta_store
static void update_load_page(void)
static void save_dialog_update(struct save_dialog *pdialog)
static GtkWidget * scenario_authors
static GtkWidget * start_aifill_spin
static void ruleset_entry_changed(GtkWidget *w, gpointer data)
void(* save_dialog_action_fn_t)(const char *filename)
static void open_settings(void)
static void set_connection_state(enum connection_state state)
static GtkWidget * ruleset_combo
static void observe_button_callback(GtkWidget *w, gpointer data)
static void conn_menu_ready_chosen(GObject *object, gpointer data)
static void server_scan_error(struct server_scan *scan, const char *message)
static void load_callback(void)
static void save_dialog_file_chooser_callback(GtkWidget *widget, gint response, gpointer data)
static void network_list_callback(GtkTreeSelection *select, gpointer data)
static GtkListStore * server_playerlist_store
static void nation_button_callback(GtkWidget *w, gpointer data)
void real_set_client_page(enum client_pages new_page)
static void conn_menu_connection_command(GObject *object, gpointer data)
static void scenario_list_callback(void)
static gboolean intro_expose(GtkWidget *w, cairo_t *cr, gpointer *data)
static void load_browse_callback(GtkWidget *w, gpointer data)
static void network_activate_callback(GtkTreeView *view, GtkTreePath *arg1, GtkTreeViewColumn *arg2, gpointer data)
static struct fileinfo_list * save_dialog_scenario_list(void)
static void connection_state_reset(void)
void real_conn_list_dialog_update(void *unused)
static gboolean connection_list_event(GtkWidget *widget, GdkEventButton *event, gpointer data)
static bool holding_srv_list_mutex
static GtkTreeStore * connection_list_store
static struct fileinfo_list * save_dialog_savegame_list(void)
static void start_new_game_callback(GtkWidget *w, gpointer data)
void destroy_server_scans(void)
void save_scenario_dialog_popup(void)
static GtkTreeSelection * lan_selection
static void save_dialog_save_scenario(const char *filename)
struct fileinfo_list *(* save_dialog_files_fn_t)(void)
static gboolean check_server_scan(gpointer data)
static void save_dialog_store_update(GtkListStore *store, const struct fileinfo_list *files)
static void ai_fill_changed_by_user(GtkWidget *w, gpointer data)
static gboolean delayed_unselect_path(gpointer data)
static void conn_menu_player_take(GObject *object, gpointer data)
static void conn_menu_info_chosen(GObject *object, gpointer data)
static bool model_get_player_iter(GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *start, const struct player *pplayer)
static GtkTreeSelection * load_selection
static void ai_skill_callback(GtkWidget *w, gpointer data)
static enum client_pages current_page
static GtkWidget * statusbar_frame
static GtkWidget * network_confirm_password
static void client_take_player(struct player *pplayer)
static void clear_network_statusbar(void)
static GtkTreeSelection * meta_selection
static void save_dialog_row_callback(GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer data)
static void connection_list_row_callback(GtkTreeView *tree_view, GtkTreeIter *iter, GtkTreePath *path, gpointer data)
GtkWidget * create_load_page(void)
static GtkWidget * ai_lvl_combobox
static GtkWidget * network_password_label
static GtkWidget * save_dialog_new(const char *title, const char *savelabel, const char *savefilelabel, save_dialog_action_fn_t action, save_dialog_files_fn_t files)
static void intro_free(GtkWidget *w, gpointer *data)
static GtkWidget * network_password
static GtkWidget * network_host
void handle_authentication_req(enum authentication_type type, const char *message)
static GtkTreeStore * connection_list_store_new(void)
static bool send_new_aifill_to_server
static void save_dialog_file_chooser_popup(const char *title, GtkFileChooserAction action, save_dialog_action_fn_t cb)
static GtkWidget * network_port
static void add_tree_col(GtkWidget *treeview, GType gtype, const char *title, int colnum, const char *key)
static void save_dialog_entry_callback(GtkEntry *entry, gpointer data)
static void main_callback(GtkWidget *w, gpointer data)
void update_start_page(void)
static void scenario_callback(void)
static GtkWidget * start_options_table
static bool no_ruleset_callback
void ai_fill_changed_by_server(int aifill)
static void update_server_playerlist(const struct server *pserver)
static GtkWidget * observe_button
static GtkWidget * scenario_version
GtkWidget * create_statusbar(void)
static void game_options_callback(GtkWidget *w, gpointer data)
static GtkListStore * scenario_store
static GtkWidget * network_host_label
static bool model_get_conn_iter(GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *parent, GtkTreeIter *start, const struct connection *pconn)
static GQueue * statusbar_queue
GtkWidget * start_message_area
static GtkWidget * network_port_label
static void update_scenario_page(void)
static GtkWidget * scenario_filename
static void conn_menu_team_chosen(GObject *object, gpointer data)
static GtkWidget * create_conn_menu(struct player *pplayer, struct connection *pconn)
static void load_saved_game_callback(GtkWidget *w, gpointer data)
static guint statusbar_timer
static bool object_extract(GObject *object, struct player **ppplayer, struct connection **ppconn)
static void object_put(GObject *object, struct player *pplayer, struct connection *pconn)
static struct fileinfo_list * save_dialog_mapimg_list(void)
GtkWidget * create_main_page(void)
static void conn_list_select_conn(struct connection *pconn)
static GtkWidget * ready_button
GdkPixbuf * create_player_icon(const struct player *plr)
GdkPixbuf * get_flag(const struct nation_type *nation)
void free_sprite(struct sprite *s)
struct sprite * sprite_scale(struct sprite *src, int new_w, int new_h)
struct sprite * load_gfxfile(const char *filename, bool svgflag)
void voteinfo_gui_update(void)
GtkWidget * voteinfo_bar_new(bool split_bar)
GtkWidget * pregame_votebar
void(* save_dialog_action_fn_t)(const char *filename)
struct fileinfo_list *(* save_dialog_files_fn_t)(void)
static struct server_list * server_list
static enum client_pages old_page
void conn_list_dialog_update(void)
#define fc_assert_ret(condition)
#define fc_assert_ret_val(condition, val)
#define log_debug(message,...)
#define log_error(message,...)
const char * mapimg_error(void)
const char * nation_adjective_for_player(const struct player *pplayer)
bool can_conn_edit_players_nation(const struct connection *pconn, const struct player *pplayer)
#define NO_NATION_SELECTED
const struct option_set * server_optset
const struct option_set * client_optset
int option_int_get(const struct option *poption)
struct option * optset_option_by_name(const struct option_set *poptset, const char *name)
bool option_int_set(struct option *poption, int val)
int send_packet_authentication_reply(struct connection *pc, const struct packet_authentication_reply *packet)
int dsend_packet_save_scenario(struct connection *pc, const char *name)
int dsend_packet_player_ready(struct connection *pc, int player_no, bool is_ready)
bool is_settable_ai_level(enum ai_level level)
struct player * player_by_number(const int player_id)
int player_slot_count(void)
int player_number(const struct player *pplayer)
const char * player_name(const struct player *pplayer)
bool player_has_flag(const struct player *pplayer, enum plr_flag_id flag)
#define ai_level_cmd(_level_)
#define players_iterate_end
#define players_iterate(_pplayer)
#define players_iterate_alive_end
#define players_iterate_alive(_pplayer)
void secfile_destroy(struct section_file *secfile)
struct section_file * secfile_load_section(const char *filename, const char *section, bool allow_duplicates)
bool secfile_lookup_bool_default(const struct section_file *secfile, bool def, const char *path,...)
int secfile_lookup_int_default(const struct section_file *secfile, int def, const char *path,...)
const char * secfile_lookup_str_default(const struct section_file *secfile, const char *def, const char *path,...)
struct srv_list * server_scan_get_list(struct server_scan *scan)
void server_scan_finish(struct server_scan *scan)
struct server_scan * server_scan_begin(enum server_scan_type type, ServerScanErrorFunc error_func)
enum server_scan_type server_scan_get_type(const struct server_scan *scan)
enum server_scan_status server_scan_poll(struct server_scan *scan)
#define server_list_iterate_end
#define server_list_iterate(serverlist, pserver)
struct setting_list * level[OLEVELS_NUM]
const struct strvec * get_scenario_dirs(void)
const struct strvec * get_save_dirs(void)
char * skip_to_basename(char *filepath)
struct fileinfo_list * fileinfolist_infix(const struct strvec *dirs, const char *infix, bool nodups)
#define fileinfo_list_iterate(list, pnode)
#define fileinfo_list_iterate_end
struct sprite int int int int struct sprite int int float scale
struct sprite int int int int struct sprite int int float bool smooth get_sprite_dimensions
const char * aifill(int amount)
struct conn_list * est_connections
struct packet_game_info info
enum cmdlevel access_level
save_dialog_action_fn_t action
save_dialog_files_fn_t files
struct server_scan * scan
struct server_list * servers
int fc_snprintf(char *str, size_t n, const char *format,...)
int cat_snprintf(char *str, size_t n, const char *format,...)
int fc_remove(const char *filename)
#define sz_strlcpy(dest, src)
#define sz_strlcat(dest, src)
#define fc_strncmp(_s1_, _s2_, _len_)
const char * team_name_translation(const struct team *pteam)
const char * team_slot_name_translation(const struct team_slot *tslot)
int team_number(const struct team *pteam)
int team_slot_index(const struct team_slot *tslot)
const struct player_list * team_members(const struct team *pteam)
bool team_slot_is_used(const struct team_slot *tslot)
const char * team_slot_rule_name(const struct team_slot *tslot)
#define team_slots_iterate_end
#define team_slots_iterate(_tslot)
const char * tileset_main_intro_filename(const struct tileset *t)
void client_start_server_and_set_page(enum client_pages page)
void set_client_page(enum client_pages page)
void update_queue_connect_processing_finished(int request_id, uq_callback_t callback, void *data)
enum client_pages get_client_page(void)
const char * fc_git_revision(void)
const char * unstable_message(void)
const char * word_version(void)