Summary: Added two new hotkeys, alt+m and and shift+m

alt-m to send a message to everyone in the game and shift+m to send a
message to allies.

Detailed desc.:

Added a "speaktoall" and "speaktoally" actions. The hotkeys fore these
are alt+m and shift+m respectively. These actions are the same as
"speak" except before they bring up the message text box, they change
the default "send to allies" check box value. So, subsequent speak
(hotkey: m) actions will remember whether you were talking to allies
or everyone, until 1) you do alt+m or shift+m, or 2) you check/uncheck
the "send to allies" checkbox.
This commit is contained in:
John B. Messerly 2004-05-22 22:36:24 +00:00
parent 97211537fb
commit ac60048c16
4 changed files with 27 additions and 1 deletions

View file

@ -146,6 +146,16 @@ language="English"
command=search
key=/
[/hotkey]
[hotkey]
command=speaktoally
key=m
shift=yes
[/hotkey]
[hotkey]
command=speaktoall
key=m
alt=yes
[/hotkey]
game_title="The Battle for Wesnoth"
version="Version"

View file

@ -86,6 +86,8 @@ HOTKEY_COMMAND string_to_command(const std::string& str)
m.insert(val("updateshroud",HOTKEY_UPDATE_SHROUD));
m.insert(val("continue",HOTKEY_CONTINUE_MOVE));
m.insert(val("search",HOTKEY_SEARCH));
m.insert(val("speaktoally",HOTKEY_SPEAK_ALLY));
m.insert(val("speaktoall",HOTKEY_SPEAK_ALL));
}
const std::map<std::string,HOTKEY_COMMAND>::const_iterator i = m.find(str);
@ -374,6 +376,18 @@ void execute_command(display& disp, HOTKEY_COMMAND command, command_executor* ex
if(executor)
executor->speak();
break;
case HOTKEY_SPEAK_ALLY:
if(executor) {
preferences::set_message_private(true);
executor->speak();
}
break;
case HOTKEY_SPEAK_ALL:
if(executor) {
preferences::set_message_private(false);
executor->speak();
}
break;
case HOTKEY_CREATE_UNIT:
if(executor)
executor->create_unit();

View file

@ -35,7 +35,7 @@ enum HOTKEY_COMMAND { HOTKEY_CYCLE_UNITS, HOTKEY_END_UNIT_TURN, HOTKEY_LEADER,
HOTKEY_OBJECTIVES, HOTKEY_UNIT_LIST, HOTKEY_STATISTICS, HOTKEY_QUIT_GAME,
HOTKEY_LABEL_TERRAIN, HOTKEY_SHOW_ENEMY_MOVES, HOTKEY_BEST_ENEMY_MOVES,
HOTKEY_DELAY_SHROUD, HOTKEY_UPDATE_SHROUD, HOTKEY_CONTINUE_MOVE,
HOTKEY_SEARCH,
HOTKEY_SEARCH, HOTKEY_SPEAK_ALLY, HOTKEY_SPEAK_ALL,
//editing specific commands
HOTKEY_EDIT_SET_TERRAIN,

View file

@ -956,6 +956,8 @@ bool turn_info::can_execute_command(hotkey::HOTKEY_COMMAND command) const
return enemies_visible_;
case hotkey::HOTKEY_SPEAK:
case hotkey::HOTKEY_SPEAK_ALLY:
case hotkey::HOTKEY_SPEAK_ALL:
return network::nconnections() > 0;
case hotkey::HOTKEY_REDO: