added 'show team colours' option to preferences dialog

This commit is contained in:
uid68803 2004-01-02 18:08:37 +00:00
parent fb3f002948
commit 6b932c8711
3 changed files with 22 additions and 3 deletions

View file

@ -199,6 +199,7 @@ skip_button="Skip"
turn_dialog_button="Turn Dialog"
turn_bell_button="Turn Bell"
show_side_colours="Show Team Colours"
lawful=Lawful
neutral=Neutral

View file

@ -334,6 +334,11 @@ bool show_ai_moves()
return prefs["show_ai_moves"] != "no";
}
void set_show_side_colours(bool value)
{
prefs["show_side_colours"] = value ? "yes" : "no";
}
bool show_side_colours()
{
return prefs["show_side_colours"] == "yes";
@ -472,9 +477,16 @@ void show_preferences_dialog(display& disp)
turn_bell_button.set_x(slider_left+fullscreen_button.width()+100);
turn_bell_button.set_y(sound_pos + 80 + 50);
gui::button side_colours_button(disp,string_table["show_side_colours"],
gui::button::TYPE_CHECK);
side_colours_button.set_check(show_side_colours());
side_colours_button.set_x(slider_left + fullscreen_button.width() + 100);
side_colours_button.set_y(sound_pos + 80 + 100);
gui::button hotkeys_button (disp,string_table["hotkeys_button"]);
hotkeys_button.set_x (slider_left + fullscreen_button.width () + 100);
hotkeys_button.set_y (sound_pos + 80 + 100);
hotkeys_button.set_x(slider_left + fullscreen_button.width() + 100);
hotkeys_button.set_y(sound_pos + 80 + 150);
bool redraw_all = true;
@ -527,7 +539,8 @@ void show_preferences_dialog(display& disp)
resolution_button.draw();
turn_dialog_button.draw();
turn_bell_button.draw();
hotkeys_button.draw ();
side_colours_button.draw();
hotkeys_button.draw();
font::draw_text(&disp,clip_rect,14,font::NORMAL_COLOUR,music_label,
music_rect.x,music_rect.y);
@ -573,6 +586,10 @@ void show_preferences_dialog(display& disp)
set_turn_dialog(turn_dialog_button.checked());
}
if(side_colours_button.process(mousex,mousey,left_button)) {
set_show_side_colours(side_colours_button.checked());
}
if (hotkeys_button.process (mousex, mousey, left_button))
{
show_hotkeys_dialog (disp);

View file

@ -77,6 +77,7 @@ namespace preferences {
bool show_ai_moves();
void set_show_side_colours(bool value);
bool show_side_colours();
std::string client_type();