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-3.22 */
31#include "gui_main.h"
32#include "gui_stuff.h"
33
34#include "dialogs_g.h"
35
36extern char forced_tileset_name[512];
37static void tileset_suggestion_callback(GtkWidget *dlg, gint arg);
38
39/************************************************************************/
43{
44 if (arg == GTK_RESPONSE_YES) {
45 /* User accepted tileset loading */
49 _("Can't load requested tileset."));
50 }
51 }
52}
53
54/************************************************************************/
59{
60 GtkWidget *dialog, *label;
61 char buf[1024];
62
63 dialog = gtk_dialog_new_with_buttons(_("Preferred tileset"),
64 NULL,
65 0,
66 _("_Load tileset"),
68 _("_Keep current tileset"),
70 NULL);
71 setup_dialog(dialog, toplevel);
74
75 fc_snprintf(buf, sizeof(buf),
76 _("Modpack suggests using %s tileset.\n"
77 "It might not work with other tilesets.\n"
78 "You are currently using tileset %s."),
80
81 label = gtk_label_new(buf);
84 gtk_widget_show(label);
85
86 g_signal_connect(dialog, "response",
88
89 /* In case incoming rulesets are incompatible with current tileset
90 * we need to block their receive before user has accepted loading
91 * of the correct tileset. */
93
94 gtk_widget_destroy(dialog);
95}
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
static void tileset_suggestion_callback(GtkWidget *dlg, gint arg)
Definition tileset_dlg.c:42
@ 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