Freeciv-3.3
Loading...
Searching...
No Matches
tileset_dlg.c
Go to the documentation of this file.
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.
7
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***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18#include <gtk/gtk.h>
19
20/* utility */
21#include "fcintl.h"
22
23/* common */
24#include "game.h"
25#include "unitlist.h"
26
27/* client */
28#include "tilespec.h"
29
30/* client/gui-gtk-5.0 */
31#include "gui_main.h"
32#include "gui_stuff.h"
33
34#include "dialogs_g.h"
35
36extern char forced_tileset_name[512];
37
38/************************************************************************/
42{
43 if (arg == GTK_RESPONSE_YES) {
44 /* User accepted tileset loading */
48 _("Can't load requested tileset."));
49 }
50 }
51}
52
53/************************************************************************/
58{
59 GtkWidget *dialog, *label;
60 char buf[1024];
61
62 dialog = gtk_dialog_new_with_buttons(_("Preferred tileset"),
63 NULL,
64 0,
65 _("_Load tileset"),
67 _("_Keep current tileset"),
69 NULL);
70 setup_dialog(dialog, toplevel);
73
74 fc_snprintf(buf, sizeof(buf),
75 _("Modpack suggests using %s tileset.\n"
76 "It might not work with other tilesets.\n"
77 "You are currently using tileset %s."),
79
80 label = gtk_label_new(buf);
82 label);
85
86 /* In case incoming rulesets are incompatible with current tileset
87 * we need to block their receive before user has accepted loading
88 * of the correct tileset. */
90
92}
char * incite_cost
Definition comments.c:76
#define _(String)
Definition fcintl.h:67
struct civ_game game
Definition game.c:61
GtkWidget * toplevel
Definition gui_main.c:126
void setup_dialog(GtkWidget *shell, GtkWidget *parent)
Definition gui_stuff.c:287
char forced_tileset_name[512]
void popup_tileset_suggestion_dialog(void)
Definition tileset_dlg.c:58
gint blocking_dialog(GtkWidget *dlg)
Definition gui_stuff.c:1136
static void tileset_suggestion_response(gint arg)
Definition tileset_dlg.c:41
@ LOG_ERROR
Definition log.h:31
struct packet_ruleset_control control
Definition game.h:83
char preferred_tileset[MAX_LEN_NAME]
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:960
#define sz_strlcpy(dest, src)
Definition support.h:195
#define TRUE
Definition support.h:46
const char * tileset_basename(const struct tileset *t)
Definition tilespec.c:730
void tileset_error(enum log_level level, const char *tset_name, const char *format,...)
Definition tilespec.c:650
bool tilespec_reread(const char *new_tileset_name, bool game_fully_initialized, float scale)
Definition tilespec.c:1401