added turn dialog and turn bell options

This commit is contained in:
Dave White 2003-10-25 01:37:59 +00:00
parent c23115f681
commit 7891f5b4e5
5 changed files with 62 additions and 0 deletions

View file

@ -96,6 +96,8 @@ no_leader_to_recruit="You don't have a leader to recruit with."
leader_not_on_start="You must have your leader on a keep to recruit or recall units."
no_recruit_location="There are no vacant castle tiles in which to recruit a unit."
your_turn="It is now your turn"
#buttons
ok_button="Ok"
cancel_button="Cancel"
@ -105,6 +107,9 @@ no_button="No"
next_button="Next"
skip_button="Skip"
turn_dialog_button="Turn Dialog"
turn_bell_button="Turn Bell"
lawful=Lawful
neutral=Neutral
chaotic=Chaotic

BIN
sounds/bell.wav Normal file

Binary file not shown.

View file

@ -22,6 +22,7 @@
#include "playturn.hpp"
#include "preferences.hpp"
#include "replay.hpp"
#include "sound.hpp"
#include "util.hpp"
#include <cmath>
@ -61,6 +62,14 @@ void play_turn(game_data& gameinfo, game_state& state_of_game,
const paths_wiper wiper(gui);
if(preferences::turn_bell()) {
sound::play_sound("bell.wav");
}
if(preferences::turn_dialog()) {
gui::show_dialog(gui,NULL,"",string_table["your_turn"],gui::MESSAGE);
}
turn_info turn_data;
//execute gotos - first collect gotos in a list

View file

@ -281,6 +281,26 @@ void set_scroll_speed(double new_speed)
scroll = new_speed;
}
bool turn_bell()
{
return prefs["turn_bell"] == "yes";
}
void set_turn_bell(bool ison)
{
prefs["turn_bell"] = (ison ? "yes" : "no");
}
bool turn_dialog()
{
return prefs["turn_dialog"] == "yes";
}
void set_turn_dialog(bool ison)
{
prefs["turn_dialog"] = (ison ? "yes" : "no");
}
void show_preferences_dialog(display& disp)
{
assert(::disp != NULL);
@ -375,6 +395,18 @@ void show_preferences_dialog(display& disp)
resolution_button.set_x(slider_left);
resolution_button.set_y(sound_pos + 80 + 150);
gui::button turn_dialog_button(disp,string_table["turn_dialog_button"],
gui::button::TYPE_CHECK);
turn_dialog_button.set_check(turn_dialog());
turn_dialog_button.set_x(slider_left+fullscreen_button.width()+30);
turn_dialog_button.set_y(sound_pos + 80);
gui::button turn_bell_button(disp,string_table["turn_bell_button"],
gui::button::TYPE_CHECK);
turn_bell_button.set_check(turn_bell());
turn_bell_button.set_x(slider_left+fullscreen_button.width()+30);
turn_bell_button.set_y(sound_pos + 80 + 50);
bool redraw_all = true;
for(;;) {
@ -422,6 +454,8 @@ void show_preferences_dialog(display& disp)
grid_button.draw();
close_button.draw();
resolution_button.draw();
turn_dialog_button.draw();
turn_bell_button.draw();
font::draw_text(&disp,clip_rect,14,font::NORMAL_COLOUR,music_label,
music_rect.x,music_rect.y);
@ -452,6 +486,14 @@ void show_preferences_dialog(display& disp)
break;
}
if(turn_bell_button.process(mousex,mousey,left_button)) {
set_turn_bell(turn_bell_button.checked());
}
if(turn_dialog_button.process(mousex,mousey,left_button)) {
set_turn_dialog(turn_dialog_button.checked());
}
disp.update_display();
SDL_Delay(10);

View file

@ -64,6 +64,12 @@ namespace preferences {
double get_scroll_speed();
void set_scroll_speed(double scroll);
bool turn_bell();
void set_turn_bell(bool ison);
bool turn_dialog();
void set_turn_dialog(bool ison);
void show_preferences_dialog(display& disp);
void show_video_mode_dialog(display& disp);
}