diff -ur cvs/freeciv/client/control.c changes/freeciv/client/control.c --- cvs/freeciv/client/control.c Sun Jun 18 23:06:56 2000 +++ changes/freeciv/client/control.c Wed Jun 21 23:48:16 2000 @@ -796,6 +796,18 @@ } /************************************************************************** + Toggle display of diplomatic states colors in minimap +**************************************************************************/ +void request_toggle_diplo_states(void) +{ + if(get_client_state() != CLIENT_GAME_RUNNING_STATE) + return; + + minimap_diplo_states ^= 1; + refresh_overview_canvas(); +} + +/************************************************************************** Toggle display of city names **************************************************************************/ void request_toggle_city_names(void) @@ -1090,6 +1102,14 @@ void key_city_productions_toggle(void) { request_toggle_city_productions(); +} + +/************************************************************************** +... +**************************************************************************/ +void key_diplo_states_toggle(void) +{ + request_toggle_diplo_states(); } /************************************************************************** diff -ur cvs/freeciv/client/control.h changes/freeciv/client/control.h --- cvs/freeciv/client/control.h Sun Jun 18 23:06:56 2000 +++ changes/freeciv/client/control.h Thu Jun 22 12:33:00 2000 @@ -69,6 +69,7 @@ void key_cancel_action(void); void key_city_names_toggle(void); void key_city_productions_toggle(void); +void key_diplo_states_toggle(void); void key_end_turn(void); void key_map_grid_toggle(void); void key_move_north(void); diff -ur cvs/freeciv/client/gui-gtk/colors.c changes/freeciv/client/gui-gtk/colors.c --- cvs/freeciv/client/gui-gtk/colors.c Wed Jul 14 13:23:06 1999 +++ changes/freeciv/client/gui-gtk/colors.c Thu Jun 22 12:29:00 2000 @@ -11,13 +11,20 @@ GNU General Public License for more details. ***********************************************************************/ #include +#include #include +#include #include +#include "config.h" +#include "fcintl.h" #include "log.h" +#include "support.h" + #include "colors.h" +#include "dialogs.h" struct rgbtriple { int r, g, b; @@ -29,24 +36,107 @@ { 0, 255, 200}, /* Cyan */ { 0, 200, 0}, /* Ground (green) */ { 0, 0, 200}, /* Ocean (blue) */ - {128, 0, 0}, /* race0 */ - {128, 255, 255}, /* race1 */ - {255, 0, 0}, /* race2 */ - {255, 0, 128}, /* race3 */ - { 0, 0, 128}, /* race4 */ - {255, 0, 255}, /* race5 */ + { 0, 0, 0}, /* dummy */ + {255, 0, 0}, /* race0 */ + { 64, 128, 198}, /* race1 */ + {255, 255, 0}, /* race2 */ + {255, 0, 255}, /* race3 */ + { 0, 255, 255}, /* race4 */ + {255, 255, 255}, /* race5 */ {255, 128, 0}, /* race6 */ - {255, 255, 128}, /* race7 */ + {255, 0, 128}, /* race7 */ {255, 128, 128}, /* race8 */ - { 0, 0, 255}, /* race9 */ - { 0, 255, 0}, /* race10 */ - { 0, 128, 128}, /* race11 */ - { 0, 64, 64}, /* race12 */ - {198, 198, 198}, /* race13 */ + {128, 255, 0}, /* race9 */ + { 0, 255, 128}, /* race10 */ + {128, 255, 128}, /* race11 */ + {128, 0, 255}, /* race12 */ + { 0, 128, 255}, /* race13 */ + {128, 128, 255}, /* race14 */ + {255, 255, 128}, /* race15 */ + {255, 128, 255}, /* race16 */ + {128, 255, 255}, /* race17 */ + {128, 64, 0}, /* race18 */ + { 0, 128, 64}, /* race19 */ + { 0, 64, 128}, /* race20 */ + {128, 128, 0}, /* race21 */ + {128, 0, 128}, /* race22 */ + { 0, 128, 128}, /* race23 */ + {128, 128, 128}, /* race24 */ + { 0, 0, 0}, /* race25 */ + { 64, 0, 0}, /* race26 */ + { 0, 64, 0}, /* race27 */ + { 0, 0, 64}, /* race28 */ + {255, 160, 64}, /* race29 */ + { 0, 0, 0}, /* dummy */ + {255, 0, 0}, /* war */ + {255, 128, 0}, /* neutral */ + {255, 255, 0}, /* ceasefire*/ + { 64, 64, 255}, /* peace */ + { 0, 128, 64}, /* alliance */ + {128, 0, 0}, /* no contact */ }; GdkColor *colors_standard [COLOR_STD_LAST]; +typedef struct { + char text[32]; + int display; + void *r, *g, *b; + GtkWidget *canvas; +} std_color; + +#define STD_COLOR(text, display) {text, display, NULL, NULL, NULL, NULL} +#define STD_COLOR_TERMINATOR {"", 999, NULL, NULL, NULL, NULL} + +std_color colors[] = { + STD_COLOR("Black", 0), + STD_COLOR("White", 0), + STD_COLOR("Red", 0), + STD_COLOR("Yellow", 0), + STD_COLOR("Cyan", 0), + STD_COLOR("Ground", -1), + STD_COLOR("Ocean", -2), + STD_COLOR("dummy", 0), + STD_COLOR("Race #0", -1), + STD_COLOR("Race #1", 1), + STD_COLOR("Race #2", 1), + STD_COLOR("Race #3", 1), + STD_COLOR("Race #4", 1), + STD_COLOR("Race #5", 1), + STD_COLOR("Race #6", 1), + STD_COLOR("Race #7", 1), + STD_COLOR("Race #8", 1), + STD_COLOR("Race #9", 1), + STD_COLOR("Race #10", 1), + STD_COLOR("Race #11", 1), + STD_COLOR("Race #12", 1), + STD_COLOR("Race #13", 1), + STD_COLOR("Race #14", 1), + STD_COLOR("Race #15", -2), + STD_COLOR("Race #16", 2), + STD_COLOR("Race #17", 2), + STD_COLOR("Race #18", 2), + STD_COLOR("Race #19", 2), + STD_COLOR("Race #20", 2), + STD_COLOR("Race #21", 2), + STD_COLOR("Race #22", 2), + STD_COLOR("Race #23", 2), + STD_COLOR("Race #24", 2), + STD_COLOR("Race #25", 2), + STD_COLOR("Race #26", 2), + STD_COLOR("Race #27", 2), + STD_COLOR("Race #28", 2), + STD_COLOR("Race #29", 2), + STD_COLOR("dummy", 0), + STD_COLOR("War", -1), + STD_COLOR("Neutral", 1), + STD_COLOR("Ceasefire", 1), + STD_COLOR("Peace", -2), + STD_COLOR("Alliance", 2), + STD_COLOR("No Contact", 2), + STD_COLOR_TERMINATOR +}; + extern GtkWidget *toplevel; /************************************************************* @@ -63,7 +153,7 @@ colors_standard[i]->red = colors_standard_rgb[i].r<<8; colors_standard[i]->green= colors_standard_rgb[i].g<<8; colors_standard[i]->blue = colors_standard_rgb[i].b<<8; - + gdk_imlib_best_color_get (colors_standard[i]); } } @@ -105,4 +195,240 @@ void init_color_system(void) { alloc_standard_colors(); +} + + + +/************************************************************************** + Option dialog +**************************************************************************/ + +GtkWidget *coloropt_dialog_shell; + +/************************************************************************** +... +**************************************************************************/ +static void coloropt_ok_callback(GtkWidget *widget, gpointer data) +{ + int i; + + std_color *c; + + i = -1; + + for (c = colors; c->display != 999; c++) { + i++; + + if (c->display != 0) { + colors_standard_rgb[i].r = atoi(gtk_entry_get_text(GTK_ENTRY(c->r))); + colors_standard_rgb[i].g = atoi(gtk_entry_get_text(GTK_ENTRY(c->g))); + colors_standard_rgb[i].b = atoi(gtk_entry_get_text(GTK_ENTRY(c->b))); + } + } + + alloc_standard_colors(); + + gtk_widget_set_sensitive(toplevel, TRUE); + gtk_widget_destroy(coloropt_dialog_shell); +} + +/************************************************************************** +... +**************************************************************************/ +static void coloropt_update_callback(GtkWidget *widget, gpointer data) +{ + int i, r, g, b; + + GtkStyle *style; + + GdkColor *update_color; + + std_color *c; + + i = -1; + + for (c = colors; c->display != 999; c++) { + i++; + + if (c->display != 0) { + r = atoi(gtk_entry_get_text(GTK_ENTRY(c->r))); + g = atoi(gtk_entry_get_text(GTK_ENTRY(c->g))); + b = atoi(gtk_entry_get_text(GTK_ENTRY(c->b))); + + update_color = g_malloc(sizeof(GdkColor)); + + update_color->red = r << 8; + update_color->green = g << 8; + update_color->blue = b << 8; + + gdk_imlib_best_color_get(update_color); + + style = gtk_style_copy (c->canvas->style); + style->bg[GTK_STATE_NORMAL] = *update_color; + gtk_widget_set_style (c->canvas, style); + + gtk_widget_hide(c->canvas); + gtk_widget_show(c->canvas); + } + } +} + +/************************************************************************** +... +**************************************************************************/ +static void coloropt_cancel_callback(GtkWidget *widget, gpointer data) +{ + gtk_widget_set_sensitive(toplevel, TRUE); + gtk_widget_destroy(coloropt_dialog_shell); +} + +/**************************************************************** +... +*****************************************************************/ +static void create_coloropt_dialog(void) +{ + GtkWidget *ok_button, *update_button, *cancel_button, *label, *table; + GtkAccelGroup *accel = gtk_accel_group_new(); + GtkStyle *style; + + std_color *c; + + int i; + int j[2]; + int col; + int row; + int display; + int coln[2]; + char buf[4]; + + coloropt_dialog_shell = gtk_dialog_new(); + + gtk_signal_connect (GTK_OBJECT(coloropt_dialog_shell),"delete_event", + GTK_SIGNAL_FUNC(deleted_callback),NULL); + gtk_window_set_position (GTK_WINDOW(coloropt_dialog_shell), GTK_WIN_POS_MOUSE); + gtk_accel_group_attach (accel, GTK_OBJECT(coloropt_dialog_shell)); + + gtk_window_set_title(GTK_WINDOW(coloropt_dialog_shell ), _("Set minimap colors")); + + j[0] = 0; + j[1] = 0; + + for (i = 0; i < COLOR_STD_LAST; i++) + if (colors[i].display != 0) { + if (colors[i].display < 0) { + j[colors[i].display - 1] += 4; + } + + j[colors[i].display - 1]++; + } + + table = gtk_table_new (j[0] > j[1] ? j[0] : j[1], 10, FALSE); + gtk_table_set_row_spacings (GTK_TABLE(table), 2); + gtk_table_set_col_spacings (GTK_TABLE(table), 5); + gtk_container_border_width (GTK_CONTAINER(table), 5); + gtk_box_pack_start (GTK_BOX(GTK_DIALOG(coloropt_dialog_shell)->vbox), table, FALSE, TRUE, 0); + + label = gtk_label_new (_("Color")); + gtk_table_attach (GTK_TABLE(table), label, 0, 1, 0, 1, 0, 0, 0, 0); + label = gtk_label_new (_("R")); + gtk_table_attach (GTK_TABLE(table), label, 1, 2, 0, 1, 0, 0, 0, 0); + label = gtk_label_new (_("G")); + gtk_table_attach (GTK_TABLE(table), label, 2, 3, 0, 1, 0, 0, 0, 0); + label = gtk_label_new (_("B")); + gtk_table_attach (GTK_TABLE(table), label, 3, 4, 0, 1, 0, 0, 0, 0); + + label = gtk_label_new (_("Color")); + gtk_table_attach (GTK_TABLE(table), label, 5, 6, 0, 1, 0, 0, 0, 0); + label = gtk_label_new (_("R")); + gtk_table_attach (GTK_TABLE(table), label, 6, 7, 0, 1, 0, 0, 0, 0); + label = gtk_label_new (_("G")); + gtk_table_attach (GTK_TABLE(table), label, 7, 8, 0, 1, 0, 0, 0, 0); + label = gtk_label_new (_("B")); + gtk_table_attach (GTK_TABLE(table), label, 8, 9, 0, 1, 0, 0, 0, 0); + + coln[0] = 0; + coln[1] = 0; + i = -1; + + for (c = colors; c->display != 999; c++) { + i++; + + if (c->display != 0) { + display = c->display; + + if (display < 0) { + display *= -1; + coln[display - 1] += 4; + } + + row = coln[display - 1]++; + col = (display - 1) * 5; + + label = gtk_label_new (_(c->text)); + gtk_table_attach_defaults (GTK_TABLE(table), label, col, col + 1, row + 1, row + 2); + + c->r = gtk_entry_new_with_max_length (3); + gtk_widget_set_usize (c->r, 30, 0); + my_snprintf (buf, sizeof(buf), "%d", colors_standard_rgb[i].r); + gtk_entry_set_text (GTK_ENTRY(c->r), buf); + gtk_table_attach_defaults (GTK_TABLE(table), c->r, col + 1, col + 2, row + 1, row + 2); + + c->g = gtk_entry_new_with_max_length (3); + gtk_widget_set_usize (c->g, 30, 0); + my_snprintf (buf, sizeof(buf), "%d", colors_standard_rgb[i].g); + gtk_entry_set_text (GTK_ENTRY(c->g), buf); + gtk_table_attach_defaults (GTK_TABLE(table), c->g, col + 2, col + 3, row + 1, row + 2); + + c->b = gtk_entry_new_with_max_length (3); + gtk_widget_set_usize (c->b, 30, 0); + my_snprintf (buf, sizeof(buf), "%d", colors_standard_rgb[i].b); + gtk_entry_set_text (GTK_ENTRY(c->b), buf); + gtk_table_attach_defaults (GTK_TABLE(table), c->b, col + 3, col + 4, row + 1, row + 2); + + c->canvas = gtk_drawing_area_new(); + gtk_drawing_area_size (GTK_DRAWING_AREA(c->canvas), 20, 10); + style = gtk_style_copy (c->canvas->style); + style->bg[GTK_STATE_NORMAL] = *colors_standard[i]; + gtk_widget_set_style (c->canvas, style); + gtk_table_attach_defaults (GTK_TABLE(table), c->canvas, col + 4, col + 5, row + 1, row + 2); + } + } + + ok_button = gtk_button_new_with_label(_("OK")); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(coloropt_dialog_shell)->action_area), + ok_button, TRUE, TRUE, 0 ); + GTK_WIDGET_SET_FLAGS(ok_button, GTK_CAN_DEFAULT); + gtk_widget_grab_default(ok_button); + gtk_signal_connect(GTK_OBJECT(ok_button),"clicked", + GTK_SIGNAL_FUNC(coloropt_ok_callback), NULL); + + update_button = gtk_button_new_with_label(_("Update")); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(coloropt_dialog_shell)->action_area), + update_button, TRUE, TRUE, 0 ); + GTK_WIDGET_SET_FLAGS(update_button, GTK_CAN_DEFAULT); + gtk_signal_connect(GTK_OBJECT(update_button),"clicked", + GTK_SIGNAL_FUNC(coloropt_update_callback), NULL); + + cancel_button = gtk_button_new_with_label(_("Cancel")); + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(coloropt_dialog_shell)->action_area), + cancel_button, TRUE, TRUE, 0 ); + GTK_WIDGET_SET_FLAGS(cancel_button, GTK_CAN_DEFAULT); + gtk_signal_connect(GTK_OBJECT(cancel_button),"clicked", + GTK_SIGNAL_FUNC(coloropt_cancel_callback), NULL); + gtk_widget_add_accelerator(cancel_button, "clicked", + accel, GDK_Escape, 0, GTK_ACCEL_VISIBLE); + + gtk_widget_show_all(GTK_DIALOG(coloropt_dialog_shell)->vbox); + gtk_widget_show_all(GTK_DIALOG(coloropt_dialog_shell)->action_area); +} + +/**************************************************************** +... +*****************************************************************/ +void popup_coloropt_dialog(void) +{ + create_coloropt_dialog(); + + gtk_widget_show(coloropt_dialog_shell); + gtk_widget_set_sensitive(toplevel, FALSE); } diff -ur cvs/freeciv/client/gui-gtk/colors.h changes/freeciv/client/gui-gtk/colors.h --- cvs/freeciv/client/gui-gtk/colors.h Sun Sep 19 05:25:59 1999 +++ changes/freeciv/client/gui-gtk/colors.h Thu Jun 22 12:31:39 2000 @@ -19,4 +19,6 @@ extern GdkColor *colors_standard[COLOR_STD_LAST]; +void popup_coloropt_dialog(void); + #endif /* FC__COLORS_H */ diff -ur cvs/freeciv/client/gui-gtk/mapview.c changes/freeciv/client/gui-gtk/mapview.c --- cvs/freeciv/client/gui-gtk/mapview.c Sun Jun 18 23:07:00 2000 +++ changes/freeciv/client/gui-gtk/mapview.c Wed Jun 21 22:49:24 2000 @@ -676,10 +676,21 @@ /************************************************************************** ... **************************************************************************/ -static void set_overview_tile_foreground_color(int x, int y) +static int set_overview_tile_foreground_color(int x, int y, int only_terrain) { - gdk_gc_set_foreground (fill_bg_gc, - colors_standard[overview_tile_color(x, y)]); + int c, i; + + i = 0; + c = overview_tile_color(x, y, only_terrain); + + if (c < 0) { + c = -c; + i = 1; + } + + gdk_gc_set_foreground (fill_bg_gc, colors_standard[c]); + + return i; } @@ -688,13 +699,17 @@ **************************************************************************/ void refresh_overview_canvas(void) { - int x, y; + int x, y, n; for(y=0; ywindow, fill_bg_gc, TRUE, pos*2, y*2, + n, n ); + + n = 2 - set_overview_tile_foreground_color(x, y, 0); + gdk_draw_rectangle( overview_canvas_store, fill_bg_gc, TRUE, x*2, y*2, - 2, 2 ); + n, n ); gdk_draw_rectangle( overview_canvas->window, fill_bg_gc, TRUE, pos*2, y*2, - 2, 2 ); + n, n ); } /************************************************************************** diff -ur cvs/freeciv/client/gui-gtk/menu.c changes/freeciv/client/gui-gtk/menu.c --- cvs/freeciv/client/gui-gtk/menu.c Sun Jun 18 23:07:00 2000 +++ changes/freeciv/client/gui-gtk/menu.c Thu Jun 22 00:41:23 2000 @@ -33,6 +33,7 @@ #include "cityrep.h" #include "civclient.h" #include "clinet.h" +#include "colors.h" #include "control.h" #include "dialogs.h" #include "finddlg.h" @@ -65,6 +66,7 @@ MENU_GAME_OPTIONS, MENU_GAME_MSG_OPTIONS, + MENU_GAME_COLOR_OPTIONS, MENU_GAME_SAVE_SETTINGS, MENU_GAME_PLAYERS, MENU_GAME_MESSAGES, @@ -83,6 +85,7 @@ MENU_VIEW_SHOW_MAP_GRID, MENU_VIEW_SHOW_CITY_NAMES, MENU_VIEW_SHOW_CITY_PRODUCTIONS, + MENU_VIEW_MINIMAP_DIPLO_STATES, MENU_VIEW_CENTER_VIEW, MENU_ORDER_AUTO_SETTLER, @@ -154,6 +157,9 @@ case MENU_GAME_MSG_OPTIONS: popup_messageopt_dialog(); break; + case MENU_GAME_COLOR_OPTIONS: + popup_coloropt_dialog(); + break; case MENU_GAME_SAVE_SETTINGS: save_options(); break; @@ -227,6 +233,10 @@ if (draw_city_productions ^ GTK_CHECK_MENU_ITEM(widget)->active) key_city_productions_toggle(); break; + case MENU_VIEW_MINIMAP_DIPLO_STATES: + if (minimap_diplo_states ^ GTK_CHECK_MENU_ITEM(widget)->active) + key_diplo_states_toggle(); + break; case MENU_VIEW_CENTER_VIEW: center_on_unit(); break; @@ -480,6 +490,8 @@ MENU_GAME_OPTIONS }, { "/" N_("Game") "/" N_("Message Options"), NULL, game_menu_callback, MENU_GAME_MSG_OPTIONS }, + { "/" N_("Game") "/" N_("Minimap Colors"), NULL, game_menu_callback, + MENU_GAME_COLOR_OPTIONS }, { "/" N_("Game") "/" N_("Save Settings"), NULL, game_menu_callback, MENU_GAME_SAVE_SETTINGS }, { "/" N_("Game") "/sep2", NULL, NULL, @@ -536,6 +548,10 @@ MENU_VIEW_SHOW_CITY_PRODUCTIONS, "" }, { "/" N_("View") "/sep1", NULL, NULL, 0, "" }, + { "/" N_("View") "/" N_("Diplomatic States"), "d", view_menu_callback, + MENU_VIEW_MINIMAP_DIPLO_STATES, "" }, + { "/" N_("View") "/sep1", NULL, NULL, + 0, "" }, { "/" N_("View") "/" N_("Center View"), "c", view_menu_callback, MENU_VIEW_CENTER_VIEW }, @@ -843,6 +859,7 @@ menus_set_sensitive("
/Game/Local Options", FALSE); menus_set_sensitive("
/Game/Message Options", FALSE); + menus_set_sensitive("
/Game/Minimap Colors", FALSE); menus_set_sensitive("
/Game/Save Settings", FALSE); menus_set_sensitive("
/Game/Players", FALSE); menus_set_sensitive("
/Game/Messages", FALSE); @@ -862,6 +879,7 @@ menus_set_sensitive("
/Game/Local Options", TRUE); menus_set_sensitive("
/Game/Message Options", TRUE); + menus_set_sensitive("
/Game/Minimap Colors", TRUE); menus_set_sensitive("
/Game/Save Settings", TRUE); menus_set_sensitive("
/Game/Players", TRUE); menus_set_sensitive("
/Game/Messages", TRUE); diff -ur cvs/freeciv/client/include/colors_g.h changes/freeciv/client/include/colors_g.h --- cvs/freeciv/client/include/colors_g.h Sun Sep 19 05:26:00 1999 +++ changes/freeciv/client/include/colors_g.h Thu Jun 22 00:42:07 2000 @@ -19,11 +19,24 @@ COLOR_STD_BLACK, COLOR_STD_WHITE, COLOR_STD_RED, COLOR_STD_YELLOW, COLOR_STD_CYAN, COLOR_STD_GROUND, COLOR_STD_OCEAN, + + COLOR_STD_RACES_START, + COLOR_STD_RACE0, COLOR_STD_RACE1, COLOR_STD_RACE2, COLOR_STD_RACE3, COLOR_STD_RACE4, COLOR_STD_RACE5, COLOR_STD_RACE6, COLOR_STD_RACE7, COLOR_STD_RACE8, COLOR_STD_RACE9, COLOR_STD_RACE10, COLOR_STD_RACE11, - COLOR_STD_RACE12, COLOR_STD_RACE13, + COLOR_STD_RACE12, COLOR_STD_RACE13, COLOR_STD_RACE14, + COLOR_STD_RACE15, COLOR_STD_RACE16, COLOR_STD_RACE17, + COLOR_STD_RACE18, COLOR_STD_RACE19, COLOR_STD_RACE20, + COLOR_STD_RACE21, COLOR_STD_RACE22, COLOR_STD_RACE23, + COLOR_STD_RACE24, COLOR_STD_RACE25, COLOR_STD_RACE26, + COLOR_STD_RACE27, COLOR_STD_RACE28, COLOR_STD_RACE29, + + COLOR_STD_STATES_START, + + COLOR_STD_WAR, COLOR_STD_NEUTRAL, COLOR_STD_CEASEFIRE, + COLOR_STD_PEACE, COLOR_STD_ALLIANCE, COLOR_STD_NO_CONTACT, COLOR_STD_LAST }; diff -ur cvs/freeciv/client/options.c changes/freeciv/client/options.c --- cvs/freeciv/client/options.c Sun Jun 18 23:06:56 2000 +++ changes/freeciv/client/options.c Wed Jun 21 23:49:35 2000 @@ -34,19 +34,19 @@ /** Local Options: **/ -int solid_color_behind_units=0; -int sound_bell_at_new_turn=0; -int smooth_move_units=1; -int smooth_move_unit_steps=3; -int do_combat_animation=1; -int ai_popup_windows=0; -int ai_manual_turn_done=1; -int auto_center_on_unit=1; -int wakeup_focus=1; -int draw_diagonal_roads=1; -int center_when_popup_city=1; -int concise_city_production=0; -int auto_turn_done=0; +int solid_color_behind_units = 0; +int sound_bell_at_new_turn = 0; +int smooth_move_units = 1; +int smooth_move_unit_steps = 3; +int do_combat_animation = 1; +int ai_popup_windows = 0; +int ai_manual_turn_done = 1; +int auto_center_on_unit = 1; +int wakeup_focus = 1; +int draw_diagonal_roads = 1; +int center_when_popup_city = 1; +int concise_city_production = 0; +int auto_turn_done = 0; #define GEN_OPTION(name, desc, type) { #name, desc, type, &name, NULL } #define GEN_OPTION_TERMINATOR { NULL, NULL, COT_BOOL, NULL, NULL } @@ -70,9 +70,10 @@ /** View Options: **/ -int draw_map_grid=0; -int draw_city_names=1; -int draw_city_productions=0; +int draw_map_grid = 0; +int draw_city_names = 1; +int draw_city_productions = 0; +int minimap_diplo_states = 0; #define VIEW_OPTION(name) { #name, &name } #define VIEW_OPTION_TERMINATOR { NULL, NULL } diff -ur cvs/freeciv/client/options.h changes/freeciv/client/options.h --- cvs/freeciv/client/options.h Sun Jun 18 23:06:56 2000 +++ changes/freeciv/client/options.h Wed Jun 21 23:50:14 2000 @@ -49,6 +49,7 @@ extern int draw_map_grid; extern int draw_city_names; extern int draw_city_productions; +extern int minimap_diplo_states; typedef struct { char *name; diff -ur cvs/freeciv/client/tilespec.c changes/freeciv/client/tilespec.c --- cvs/freeciv/client/tilespec.c Sun Jun 18 23:06:56 2000 +++ changes/freeciv/client/tilespec.c Thu Jun 22 12:25:04 2000 @@ -1265,40 +1265,52 @@ to allow players to choose their preferred color etc. A hack added to avoid returning more that COLOR_STD_RACE13. But really there should be more colors available -- jk. + + Added code to assign number of colors dynamically by colors + available (currently: 30 for races). Each player can choose the + color settings for his/her client. -- mn ***********************************************************************/ enum color_std player_color(struct player *pplayer) { - return COLOR_STD_RACE0 + + return COLOR_STD_RACES_START + 1 + (pplayer->player_no % - (COLOR_STD_RACE13 - COLOR_STD_RACE0 + 1)); + (COLOR_STD_STATES_START - COLOR_STD_RACES_START - 1)); } /********************************************************************** Return color for overview map tile. ***********************************************************************/ -enum color_std overview_tile_color(int x, int y) +enum color_std overview_tile_color(int x, int y, int only_terrain) { enum color_std color; struct tile *ptile=map_get_tile(x, y); struct unit *punit; struct city *pcity; - if(!ptile->known) { - color=COLOR_STD_BLACK; - } else if((pcity=map_get_city(x, y))) { - if(pcity->owner==game.player_idx) - color=COLOR_STD_WHITE; - else - color=COLOR_STD_CYAN; - } else if ((punit=find_visible_unit(ptile))) { - if(punit->owner==game.player_idx) - color=COLOR_STD_YELLOW; - else - color=COLOR_STD_RED; - } else if(ptile->terrain==T_OCEAN) { - color=COLOR_STD_OCEAN; + if (ptile->terrain == T_OCEAN) { + color = COLOR_STD_OCEAN; } else { - color=COLOR_STD_GROUND; + color = COLOR_STD_GROUND; + } + + if (!only_terrain && !minimap_diplo_states) { + if((pcity = map_get_city(x, y))) { + color = COLOR_STD_RACES_START + pcity->owner + 1; + } else if ((punit = find_visible_unit(ptile))) { + color = -(COLOR_STD_RACES_START + punit->owner + 1); + } + } + + if (!only_terrain && minimap_diplo_states) { + if((pcity = map_get_city(x, y))) { + color = COLOR_STD_STATES_START + game.player_ptr->diplstates[pcity->owner].type + 1; + } else if ((punit = find_visible_unit(ptile))) { + color = -(COLOR_STD_STATES_START + game.player_ptr->diplstates[punit->owner].type + 1); + } + } + + if (!ptile->known) { + color = COLOR_STD_BLACK; } return color; diff -ur cvs/freeciv/client/tilespec.h changes/freeciv/client/tilespec.h --- cvs/freeciv/client/tilespec.h Sat Jun 10 17:09:43 2000 +++ changes/freeciv/client/tilespec.h Wed Jun 21 22:51:05 2000 @@ -44,7 +44,7 @@ int fill_unit_sprite_array(struct Sprite **sprs, struct unit *punit); enum color_std player_color(struct player *pplayer); -enum color_std overview_tile_color(int x, int y); +enum color_std overview_tile_color(int x, int y, int only_terrain); void set_focus_unit_hidden_state(int hide);