mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-21 20:44:24 +00:00
Merge branch 'ellipse_hotkey'
This commit is contained in:
parent
0d91848651
commit
b0d4f5b133
@ -214,6 +214,11 @@
|
|||||||
key=s
|
key=s
|
||||||
alt=yes
|
alt=yes
|
||||||
[/hotkey]
|
[/hotkey]
|
||||||
|
[hotkey]
|
||||||
|
command=toggleellipses
|
||||||
|
key=e
|
||||||
|
{IF_APPLE_CMD_ELSE_CTRL}
|
||||||
|
[/hotkey]
|
||||||
[hotkey]
|
[hotkey]
|
||||||
command=togglegrid
|
command=togglegrid
|
||||||
key=g
|
key=g
|
||||||
|
@ -67,6 +67,7 @@ const struct {
|
|||||||
{ hotkey::HOTKEY_REPEAT_RECRUIT, "repeatrecruit", N_("Repeat Recruit"), false, hotkey::SCOPE_GAME },
|
{ hotkey::HOTKEY_REPEAT_RECRUIT, "repeatrecruit", N_("Repeat Recruit"), false, hotkey::SCOPE_GAME },
|
||||||
{ hotkey::HOTKEY_RECALL, "recall", N_("Recall"), false, hotkey::SCOPE_GAME },
|
{ hotkey::HOTKEY_RECALL, "recall", N_("Recall"), false, hotkey::SCOPE_GAME },
|
||||||
{ hotkey::HOTKEY_ENDTURN, "endturn", N_("End Turn"), false, hotkey::SCOPE_GAME },
|
{ hotkey::HOTKEY_ENDTURN, "endturn", N_("End Turn"), false, hotkey::SCOPE_GAME },
|
||||||
|
{ hotkey::HOTKEY_TOGGLE_ELLIPSES, "toggleellipses", N_("Toggle Ellipses"), false, hotkey::SCOPE_GENERAL },
|
||||||
{ hotkey::HOTKEY_TOGGLE_GRID, "togglegrid", N_("Toggle Grid"), false, hotkey::SCOPE_GENERAL },
|
{ hotkey::HOTKEY_TOGGLE_GRID, "togglegrid", N_("Toggle Grid"), false, hotkey::SCOPE_GENERAL },
|
||||||
{ hotkey::HOTKEY_MOUSE_SCROLL, "mousescroll", N_("Mouse Scrolling"), false, hotkey::SCOPE_GENERAL },
|
{ hotkey::HOTKEY_MOUSE_SCROLL, "mousescroll", N_("Mouse Scrolling"), false, hotkey::SCOPE_GENERAL },
|
||||||
{ hotkey::HOTKEY_STATUS_TABLE, "statustable", N_("Status Table"), false, hotkey::SCOPE_GAME },
|
{ hotkey::HOTKEY_STATUS_TABLE, "statustable", N_("Status Table"), false, hotkey::SCOPE_GAME },
|
||||||
@ -724,6 +725,9 @@ bool command_executor::execute_command(HOTKEY_COMMAND command, int /*index*/)
|
|||||||
case HOTKEY_LOAD_GAME:
|
case HOTKEY_LOAD_GAME:
|
||||||
load_game();
|
load_game();
|
||||||
break;
|
break;
|
||||||
|
case HOTKEY_TOGGLE_ELLIPSES:
|
||||||
|
toggle_ellipses();
|
||||||
|
break;
|
||||||
case HOTKEY_TOGGLE_GRID:
|
case HOTKEY_TOGGLE_GRID:
|
||||||
toggle_grid();
|
toggle_grid();
|
||||||
break;
|
break;
|
||||||
|
@ -49,7 +49,7 @@ enum HOTKEY_COMMAND {
|
|||||||
HOTKEY_UNIT_DESCRIPTION, HOTKEY_RENAME_UNIT,
|
HOTKEY_UNIT_DESCRIPTION, HOTKEY_RENAME_UNIT,
|
||||||
HOTKEY_SAVE_GAME, HOTKEY_SAVE_REPLAY, HOTKEY_SAVE_MAP, HOTKEY_LOAD_GAME,
|
HOTKEY_SAVE_GAME, HOTKEY_SAVE_REPLAY, HOTKEY_SAVE_MAP, HOTKEY_LOAD_GAME,
|
||||||
HOTKEY_RECRUIT, HOTKEY_REPEAT_RECRUIT, HOTKEY_RECALL, HOTKEY_ENDTURN,
|
HOTKEY_RECRUIT, HOTKEY_REPEAT_RECRUIT, HOTKEY_RECALL, HOTKEY_ENDTURN,
|
||||||
HOTKEY_TOGGLE_GRID, HOTKEY_STATUS_TABLE, HOTKEY_MUTE, HOTKEY_MOUSE_SCROLL,
|
HOTKEY_TOGGLE_ELLIPSES, HOTKEY_TOGGLE_GRID, HOTKEY_STATUS_TABLE, HOTKEY_MUTE, HOTKEY_MOUSE_SCROLL,
|
||||||
HOTKEY_SPEAK, HOTKEY_CREATE_UNIT, HOTKEY_CHANGE_SIDE, HOTKEY_PREFERENCES,
|
HOTKEY_SPEAK, HOTKEY_CREATE_UNIT, HOTKEY_CHANGE_SIDE, HOTKEY_PREFERENCES,
|
||||||
HOTKEY_OBJECTIVES, HOTKEY_UNIT_LIST, HOTKEY_STATISTICS, HOTKEY_STOP_NETWORK, HOTKEY_START_NETWORK, HOTKEY_QUIT_GAME,
|
HOTKEY_OBJECTIVES, HOTKEY_UNIT_LIST, HOTKEY_STATISTICS, HOTKEY_STOP_NETWORK, HOTKEY_START_NETWORK, HOTKEY_QUIT_GAME,
|
||||||
HOTKEY_LABEL_TEAM_TERRAIN, HOTKEY_LABEL_TERRAIN, HOTKEY_CLEAR_LABELS,HOTKEY_SHOW_ENEMY_MOVES, HOTKEY_BEST_ENEMY_MOVES,
|
HOTKEY_LABEL_TEAM_TERRAIN, HOTKEY_LABEL_TERRAIN, HOTKEY_CLEAR_LABELS,HOTKEY_SHOW_ENEMY_MOVES, HOTKEY_BEST_ENEMY_MOVES,
|
||||||
@ -253,6 +253,7 @@ public:
|
|||||||
virtual void save_replay() {}
|
virtual void save_replay() {}
|
||||||
virtual void save_map() {}
|
virtual void save_map() {}
|
||||||
virtual void load_game() {}
|
virtual void load_game() {}
|
||||||
|
virtual void toggle_ellipses() {}
|
||||||
virtual void toggle_grid() {}
|
virtual void toggle_grid() {}
|
||||||
virtual void status_table() {}
|
virtual void status_table() {}
|
||||||
virtual void recall() {}
|
virtual void recall() {}
|
||||||
|
@ -1556,6 +1556,12 @@ private:
|
|||||||
gui_->invalidate_game_status();
|
gui_->invalidate_game_status();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void menu_handler::toggle_ellipses()
|
||||||
|
{
|
||||||
|
preferences::set_ellipses(!preferences::ellipses());
|
||||||
|
gui_->invalidate_all();
|
||||||
|
}
|
||||||
|
|
||||||
void menu_handler::toggle_grid()
|
void menu_handler::toggle_grid()
|
||||||
{
|
{
|
||||||
preferences::set_grid(!preferences::grid());
|
preferences::set_grid(!preferences::grid());
|
||||||
|
@ -94,6 +94,7 @@ public:
|
|||||||
void label_terrain(mouse_handler& mousehandler, bool team_only);
|
void label_terrain(mouse_handler& mousehandler, bool team_only);
|
||||||
void clear_labels();
|
void clear_labels();
|
||||||
void continue_move(mouse_handler &mousehandler, int side_num);
|
void continue_move(mouse_handler &mousehandler, int side_num);
|
||||||
|
void toggle_ellipses();
|
||||||
void toggle_grid();
|
void toggle_grid();
|
||||||
void unit_hold_position(mouse_handler &mousehandler, int side_num);
|
void unit_hold_position(mouse_handler &mousehandler, int side_num);
|
||||||
void end_unit_turn(mouse_handler &mousehandler, int side_num);
|
void end_unit_turn(mouse_handler &mousehandler, int side_num);
|
||||||
|
@ -369,6 +369,10 @@ void play_controller::unit_description(){
|
|||||||
menu_handler_.unit_description(mouse_handler_);
|
menu_handler_.unit_description(mouse_handler_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void play_controller::toggle_ellipses(){
|
||||||
|
menu_handler_.toggle_ellipses();
|
||||||
|
}
|
||||||
|
|
||||||
void play_controller::toggle_grid(){
|
void play_controller::toggle_grid(){
|
||||||
menu_handler_.toggle_grid();
|
menu_handler_.toggle_grid();
|
||||||
}
|
}
|
||||||
@ -628,6 +632,7 @@ bool play_controller::can_execute_command(hotkey::HOTKEY_COMMAND command, int in
|
|||||||
case hotkey::HOTKEY_MAP_SCREENSHOT:
|
case hotkey::HOTKEY_MAP_SCREENSHOT:
|
||||||
case hotkey::HOTKEY_ACCELERATED:
|
case hotkey::HOTKEY_ACCELERATED:
|
||||||
case hotkey::HOTKEY_SAVE_MAP:
|
case hotkey::HOTKEY_SAVE_MAP:
|
||||||
|
case hotkey::HOTKEY_TOGGLE_ELLIPSES:
|
||||||
case hotkey::HOTKEY_TOGGLE_GRID:
|
case hotkey::HOTKEY_TOGGLE_GRID:
|
||||||
case hotkey::HOTKEY_MOUSE_SCROLL:
|
case hotkey::HOTKEY_MOUSE_SCROLL:
|
||||||
case hotkey::HOTKEY_STATUS_TABLE:
|
case hotkey::HOTKEY_STATUS_TABLE:
|
||||||
|
@ -72,6 +72,7 @@ public:
|
|||||||
virtual void show_enemy_moves(bool ignore_units);
|
virtual void show_enemy_moves(bool ignore_units);
|
||||||
virtual void goto_leader();
|
virtual void goto_leader();
|
||||||
virtual void unit_description();
|
virtual void unit_description();
|
||||||
|
virtual void toggle_ellipses();
|
||||||
virtual void toggle_grid();
|
virtual void toggle_grid();
|
||||||
virtual void search();
|
virtual void search();
|
||||||
|
|
||||||
|
@ -258,6 +258,16 @@ void set_language(const std::string& s)
|
|||||||
preferences::set("locale", s);
|
preferences::set("locale", s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ellipses()
|
||||||
|
{
|
||||||
|
return utils::string_bool(get("show_side_colours"), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _set_ellipses(bool ison)
|
||||||
|
{
|
||||||
|
preferences::set("show_side_colours", (ison ? "yes" : "no"));
|
||||||
|
}
|
||||||
|
|
||||||
bool grid()
|
bool grid()
|
||||||
{
|
{
|
||||||
return utils::string_bool(get("grid"), false);
|
return utils::string_bool(get("grid"), false);
|
||||||
|
@ -159,6 +159,9 @@ namespace preferences {
|
|||||||
bool show_fps();
|
bool show_fps();
|
||||||
void set_show_fps(bool value);
|
void set_show_fps(bool value);
|
||||||
|
|
||||||
|
bool ellipses();
|
||||||
|
void _set_ellipses(bool ison);
|
||||||
|
|
||||||
bool grid();
|
bool grid();
|
||||||
void _set_grid(bool ison);
|
void _set_grid(bool ison);
|
||||||
} // end namespace preferences
|
} // end namespace preferences
|
||||||
|
@ -139,6 +139,11 @@ void set_turbo_speed(double speed)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_ellipses(bool ison)
|
||||||
|
{
|
||||||
|
_set_ellipses(ison);
|
||||||
|
}
|
||||||
|
|
||||||
void set_grid(bool ison)
|
void set_grid(bool ison)
|
||||||
{
|
{
|
||||||
_set_grid(ison);
|
_set_grid(ison);
|
||||||
|
@ -31,6 +31,7 @@ namespace preferences {
|
|||||||
void set_scroll_to_action(bool ison);
|
void set_scroll_to_action(bool ison);
|
||||||
void set_resolution(const std::pair<int,int>& res);
|
void set_resolution(const std::pair<int,int>& res);
|
||||||
void set_turbo(bool ison);
|
void set_turbo(bool ison);
|
||||||
|
void set_ellipses(bool ison);
|
||||||
void set_grid(bool ison);
|
void set_grid(bool ison);
|
||||||
void set_turbo_speed(double speed);
|
void set_turbo_speed(double speed);
|
||||||
void set_colour_cursors(bool value);
|
void set_colour_cursors(bool value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user