Enabled the terrain description dialog in the editor.

Conflicts:
	data/themes/editor.cfg
	src/editor/editor_controller.cpp
This commit is contained in:
fendrin 2014-06-06 22:30:28 +02:00 committed by Ignacio R. Morelle
parent 046a7b66ca
commit ea3fd99a81
3 changed files with 16 additions and 3 deletions

View file

@ -38,7 +38,7 @@
[menu]
id=menu-editor-paste-context
is_context_menu=true
items=menu-unit-facing,editor-unit-toggle-loyal,editor-change-unitid,editor-unit-recruit,renameunit,describeunit,editor-deleteunit,editor-toggle-renameable,editor-toggle-canrecruit,editor-cut,editor-copy,editor-paste,editor-tool-select,editor-select-all,editor-select-inverse,editor-select-none,editor-clipboard-rotate-cw,editor-clipboard-rotate-ccw,editor-clipboard-flip-horizontal,editor-clipboard-flip-vertical,editor-selection-fill,editor-selection-rotate,editor-selection-flip, editor-selection-generate,editor-selection-randomize,editor-save-area
items=describeterrain,menu-unit-facing,editor-unit-toggle-loyal,editor-change-unitid,editor-unit-recruit,renameunit,describeunit,editor-deleteunit,editor-toggle-renameable,editor-toggle-canrecruit,editor-cut,editor-copy,editor-paste,editor-tool-select,editor-select-all,editor-select-inverse,editor-select-none,editor-clipboard-rotate-cw,editor-clipboard-rotate-ccw,editor-clipboard-flip-horizontal,editor-clipboard-flip-vertical,editor-selection-fill,editor-selection-rotate,editor-selection-flip, editor-selection-generate,editor-selection-randomize,editor-save-area
[/menu]
####### Menu Bar

View file

@ -293,9 +293,10 @@ bool editor_controller::can_execute_command(const hotkey::hotkey_command& cmd, i
case HOTKEY_STATUS_TABLE:
return !context_manager_->get_map_context().get_teams().empty();
case HOTKEY_TERRAIN_DESCRIPTION:
return gui().mouseover_hex().valid();
// unit tool related
case HOTKEY_UNIT_DESCRIPTION:
return toolkit_->is_mouse_action_set(HOTKEY_EDITOR_TOOL_UNIT);
case HOTKEY_DELETE_UNIT:
case HOTKEY_RENAME_UNIT:
case HOTKEY_EDITOR_UNIT_CHANGE_ID:
@ -304,6 +305,7 @@ bool editor_controller::can_execute_command(const hotkey::hotkey_command& cmd, i
case HOTKEY_EDITOR_UNIT_TOGGLE_LOYAL:
case HOTKEY_EDITOR_UNIT_RECRUIT_ASSIGN:
case HOTKEY_EDITOR_UNIT_FACING:
case HOTKEY_UNIT_DESCRIPTION:
{
map_location loc = gui_->mouseover_hex();
const unit_map& units = context_manager_->get_map_context().get_units();
@ -1318,6 +1320,16 @@ void editor_controller::right_mouse_up(int x, int y, const bool /*browse*/)
context_manager_->refresh_after_action();
}
void editor_controller::terrain_description()
{
const map_location& loc = gui().mouseover_hex();
if (context_manager_->get_map().on_board(loc) == false)
return;
const terrain_type& type = context_manager_->get_map().get_terrain_info(loc);
dialogs::show_terrain_description(type);
}
void editor_controller::process_keyup_event(const SDL_Event& event)
{
editor_action* a = toolkit_->get_mouse_action()->key_event(gui(), event);

View file

@ -121,6 +121,7 @@ class editor_controller : public controller_base,
/** Grid toggle */
void toggle_grid();
void terrain_description();
void unit_description();
void change_unit_id();
void rename_unit();