work around major issues of bug #12777...

...and editor's hotkey descriptions/tooltips in a way that does not
introduce new strings or mess with the code much
This commit is contained in:
Tomasz Śniatowski 2009-02-28 23:09:57 +01:00
parent bb0002e448
commit 80a3c91c2b
3 changed files with 14 additions and 11 deletions

View file

@ -175,7 +175,9 @@
id=draw_button_editor
image=draw_button_editor
items=editor-tool-paint
auto_tooltip=yes
# wmllint: local spelling left/right
tooltip= _ "Use left/right mouse button to draw fore-/background terrain. Hold Shift to paint base layer only."
tooltip_name_prepend=yes
ref=top-right-panel
#harcoded since the brushes are above, which are hardcoded in src/editor/editor_layout.cpp
rect="=+15,183,+24,+24"
@ -186,7 +188,9 @@
id=flood_button_editor
image=flood_button_editor
items=editor-tool-fill
auto_tooltip=yes
# wmllint: local spelling fore-/background
tooltip= _ "Use left/right mouse button to draw fore-/background terrain. Hold Shift to paint base layer only."
tooltip_name_prepend=yes
rect="+6,=,+24,+24"
xanchor=right
yanchor=fixed
@ -195,7 +199,9 @@
id=start_position_button_editor
image=start_position_button_editor
items=editor-tool-starting-position
auto_tooltip=yes
# wmllint: local spelling alt+number
tooltip= _ "Left mouse button displays player selection, right clears. Number keys scroll to the starting position, alt+number sets respective starting position under cursor, delete clears."
tooltip_name_prepend=yes
rect="+6,=,+24,+24"
xanchor=right
yanchor=fixed
@ -204,7 +210,9 @@
id=select_button_editor
image=select_button_editor
items=editor-tool-select
auto_tooltip=yes
# wmllint: local spelling deselects
tooltip= _ "Left mouse button selects, right deselects. Hold Shift for magic-wand selection of tiles with same terrain."
tooltip_name_prepend=yes
rect="+6,=,+24,+24"
xanchor=right
yanchor=fixed

View file

@ -200,13 +200,6 @@ void editor_controller::init_mouse_actions(const config& game_config)
foreach (const config* c, game_config.get_children("editor_tool_hint")) {
mouse_action_map::iterator i = mouse_actions_.find(hotkey::get_hotkey((*c)["id"]).get_id());
if (i != mouse_actions_.end()) {
if ((*c)["id"] != "editor-paste") {
std::stringstream dss;
dss << hotkey::get_hotkey((*c)["id"]).get_description();
dss << "\n";
dss << (*c)["text"];
hotkey::get_hotkey((*c)["id"]).set_description(dss.str());
}
mouse_action_hints_.insert(std::make_pair(i->first, (*c)["text"]));
}
}

View file

@ -535,6 +535,8 @@ theme::menu::menu(const config& cfg) : object(cfg),
{
if (utils::string_bool(cfg["auto_tooltip"]) && tooltip_.empty() && items_.size() == 1) {
tooltip_ = hotkey::get_hotkey(items_[0]).get_description();
} else if (utils::string_bool(cfg["tooltip_name_prepend"]) && items_.size() == 1) {
tooltip_ = hotkey::get_hotkey(items_[0]).get_description() + "\n" + tooltip_;
}
}