Author: ilor
Date: Sat Aug 16 21:42:19 2008
New Revision: 28654
URL: http://svn.gna.org/viewcvs/wesnoth?rev=28654&view=rev
Log:
editor2: sidebar tweaks
Added:
trunk/data/core/editor2-tool-hints.cfg (with props)
Modified:
trunk/data/core/_main.cfg
trunk/data/themes/editor2.cfg
trunk/src/editor2/editor_controller.cpp
trunk/src/editor2/editor_controller.hpp
trunk/src/editor2/editor_display.cpp
trunk/src/editor2/editor_display.hpp
trunk/src/editor2/editor_layout.cpp
trunk/src/editor2/mouse_action.cpp
trunk/src/editor2/mouse_action.hpp
trunk/src/reports.cpp
trunk/src/reports.hpp
Modified: trunk/data/core/_main.cfg
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/_main.cfg?rev=28654&r1=28653&r2=28654&view=diff
==============================================================================
--- trunk/data/core/_main.cfg (original)
+++ trunk/data/core/_main.cfg Sat Aug 16 21:42:19 2008
@@ -8,7 +8,6 @@
{core/terrain.cfg}
{core/terrain-graphics/}
{core/editor-groups.cfg}
-
#else
{core/macros/}
{core/about.cfg}
@@ -23,5 +22,6 @@
{core/editor-groups.cfg}
{core/editor2-brushes.cfg}
{core/editor2-hotkeys.cfg}
+{core/editor2-tool-hints.cfg}
#endif
#endif
Added: trunk/data/core/editor2-tool-hints.cfg
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/editor2-tool-hints.cfg?rev=28654&view=auto
==============================================================================
--- trunk/data/core/editor2-tool-hints.cfg (added)
+++ trunk/data/core/editor2-tool-hints.cfg Sat Aug 16 21:42:19 2008
@@ -1,0 +1,22 @@
+#textdomain wesnoth-editor
+# Tool information / help
+
+[editor2_tool_hint]
+ id="editor-tool-paint"
+ text= _ "Use left/right mouse button to draw fore-/background terrain.
Hold ALT to paint base layer only"
+[/editor2_tool_hint]
+
+[editor2_tool_hint]
+ id="editor-tool-fill"
+ text= _ "Use left/right mouse button to draw fore-/background terrain.
Hold ALT to paint base layer only"
+[/editor2_tool_hint]
+
+[editor2_tool_hint]
+ id="editor-tool-select"
+ text= _ "Left mouse button selects, right deselects. Hold Shift for
magic-wand selection of tiles with same terrain"
+[/editor2_tool_hint]
+
+[editor2_tool_hint]
+ id="editor-tool-starting-position"
+ text= _ "Left mouse button displays player selection, right clears.
Keys 1-9 set respectove starting position under cursor and delete clears"
+[/editor2_tool_hint]
Propchange: trunk/data/core/editor2-tool-hints.cfg
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/data/core/editor2-tool-hints.cfg
------------------------------------------------------------------------------
svn:keywords = 'Author Date Id Revision'
Modified: trunk/data/themes/editor2.cfg
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/themes/editor2.cfg?rev=28654&r1=28653&r2=28654&view=diff
==============================================================================
--- trunk/data/themes/editor2.cfg (original)
+++ trunk/data/themes/editor2.cfg Sat Aug 16 21:42:19 2008
@@ -215,10 +215,10 @@
items=undo
auto_tooltip=yes
ref=draw_button_editor
- rect="=,+6,+24,+24"
+ rect="=,+104,+24,+24"
xanchor=right
yachnor=fixed
- [/menu]
+ [/menu]
[menu]
id=redo_button_editor
image=redo_button_editor
@@ -268,6 +268,17 @@
[/label]
[status]
+ [editor2_tool_hint]
+ id=tool-hint
+ font_size={DEFAULT_EDITOR_FONT_REALLYTINY}
+ ref=draw_button_editor
+ rect="=,+6,+110,+40"
+ xanchor=right
+ yanchor=fixed
+ prefix=
+ prefix_literal=""
+ [/editor2_tool_hint]
+
# the time of day image
# [time_of_day]
# id=image-tod
@@ -276,6 +287,7 @@
# xanchor=right
# yanchor=fixed
# [/time_of_day]
+
[villages]
id=villages
@@ -287,6 +299,8 @@
prefix=
prefix_literal=""
[/villages]
+
+
# This panel encloses the location information displays and the
# observer icon. This separate container is used so that we can
Modified: trunk/src/editor2/editor_controller.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_controller.cpp?rev=28654&r1=28653&r2=28654&view=diff
==============================================================================
--- trunk/src/editor2/editor_controller.cpp (original)
+++ trunk/src/editor2/editor_controller.cpp Sat Aug 16 21:42:19 2008
@@ -93,7 +93,13 @@
i->second->set_toolbar_button(&menu);
}
}
- }
+ }
+ foreach (const config* c,
game_config.get_children("editor2_tool_hint")) {
+ mouse_action_map::iterator i =
mouse_actions_.find(hotkey::get_hotkey((*c)["id"]).get_id());
+ if (i != mouse_actions_.end()) {
+ mouse_action_hints_.insert(std::make_pair(i->first,
(*c)["text"]));
+ }
+ }
hotkey_set_mouse_action(hotkey::HOTKEY_EDITOR_TOOL_PAINT);
background_terrain_ = t_translation::GRASS_LAND;
@@ -139,7 +145,7 @@
delete gui_;
foreach (const mouse_action_map::value_type a, mouse_actions_) {
delete a.second;
- }
+ }
delete prefs_disp_manager_;
}
@@ -700,6 +706,7 @@
redraw_toolbar();
gui().set_report_content(reports::EDIT_LEFT_BUTTON_FUNCTION,
hotkey::get_hotkey(command).get_description());
+ gui().set_toolbar_hint(mouse_action_hints_[command]);
gui().invalidate_game_status();
} else {
ERR_ED << "Invalid hotkey command (" << (int)command << ")
passed to set_mouse_action\n";
@@ -849,19 +856,14 @@
if (mouse_handler_base::mouse_motion_default(x, y, update)) return;
gamemap::location hex_clicked = gui().hex_clicked_on(x, y);
if (get_map().on_board_with_border(drag_from_hex_) && is_dragging()) {
- LOG_ED << "Drag? " << dragging_left_ << " " << dragging_right_
- << " " <<(void*)(SDL_GetMouseState(NULL, NULL))
- << "\n";
editor_action* a = NULL;
bool partial = false;
editor_action* last_undo = get_map_context().last_undo_action();
if (dragging_left_ && (SDL_GetMouseState(NULL, NULL) &
SDL_BUTTON(1)) != 0) {
if (!get_map().on_board_with_border(hex_clicked))
return;
- LOG_ED << "Mouse drag L\n";
a = get_mouse_action()->drag_left(*gui_, x, y, partial,
last_undo);
} else if (dragging_right_ && (SDL_GetMouseState(NULL, NULL) &
SDL_BUTTON(3)) != 0) {
if (!get_map().on_board_with_border(hex_clicked))
return;
- LOG_ED << "Mouse drag R\n";
a = get_mouse_action()->drag_right(*gui_, x, y,
partial, last_undo);
}
//Partial means that the mouse action has modified the last
undo action and the controller shouldn't add
@@ -941,7 +943,6 @@
void editor_controller::process_keyup_event(const SDL_Event& event)
{
- LOG_ED << "keyup\n";
editor_action* a = get_mouse_action()->key_event(gui(), event);
perform_refresh_delete(a);
}
Modified: trunk/src/editor2/editor_controller.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_controller.hpp?rev=28654&r1=28653&r2=28654&view=diff
==============================================================================
--- trunk/src/editor2/editor_controller.hpp (original)
+++ trunk/src/editor2/editor_controller.hpp Sat Aug 16 21:42:19 2008
@@ -299,6 +299,10 @@
/** The mouse actions */
mouse_action_map mouse_actions_;
+ typedef std::map<hotkey::HOTKEY_COMMAND, std::string>
mouse_action_string_map;
+ /** Usage tips for mouse actions */
+ mouse_action_string_map mouse_action_hints_;
+
/** The current mouse action */
mouse_action* mouse_action_;
Modified: trunk/src/editor2/editor_display.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_display.cpp?rev=28654&r1=28653&r2=28654&view=diff
==============================================================================
--- trunk/src/editor2/editor_display.cpp (original)
+++ trunk/src/editor2/editor_display.cpp Sat Aug 16 21:42:19 2008
@@ -88,6 +88,7 @@
refresh_report(reports::POSITION,
reports::report(lexical_cast<std::string>(mouseoverHex_)));
}
refresh_report(reports::VILLAGES,
reports::report(lexical_cast<std::string>(map_.villages().size())));
+ refresh_report(reports::EDITOR2_TOOL_HINT,
reports::report(toolbar_hint_));
}
Modified: trunk/src/editor2/editor_display.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_display.hpp?rev=28654&r1=28653&r2=28654&view=diff
==============================================================================
--- trunk/src/editor2/editor_display.hpp (original)
+++ trunk/src/editor2/editor_display.hpp Sat Aug 16 21:42:19 2008
@@ -33,6 +33,7 @@
void remove_brush_loc(const gamemap::location& hex);
const editor_map& map() const { return static_cast<const
editor_map&>(map_); }
void rebuild_terrain(const gamemap::location &loc);
+ void set_toolbar_hint(const std::string value) { toolbar_hint_ = value;
}
protected:
void pre_draw();
/**
@@ -43,6 +44,7 @@
void draw_sidebar();
std::set<gamemap::location> brush_locations_;
+ std::string toolbar_hint_;
};
} //end namespace editor2
Modified: trunk/src/editor2/editor_layout.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_layout.cpp?rev=28654&r1=28653&r2=28654&view=diff
==============================================================================
--- trunk/src/editor2/editor_layout.cpp (original)
+++ trunk/src/editor2/editor_layout.cpp Sat Aug 16 21:42:19 2008
@@ -33,7 +33,7 @@
terrain_width = default_palette_width;
brush_x = 0;
brush_y = 0;
- brush_padding = 2;
+ brush_padding = 1;
palette_x = 0;
palette_y = 0;
palette_w = 10;
@@ -42,11 +42,11 @@
void adjust_sizes(const display &disp, size_specs &sizes) {
//! @todo Hardcoded coordinates for brush selection, make it themeable
- sizes.brush_x = disp.map_outside_area().w + 8;
- sizes.brush_y = 245;
+ sizes.brush_x = disp.map_outside_area().w + 10;
+ sizes.brush_y = 270;
//! @todo Hardcoded coordinates for terrain palette, make it themeable
sizes.palette_x = disp.map_outside_area().w + 16;
- sizes.palette_y = sizes.brush_y + 132 + 10;
+ sizes.palette_y = sizes.brush_y + 92;
sizes.palette_w = sizes.terrain_space * default_palette_width;
//the '-5' make sure that the scroll down button can not be outside of
//the window, this is probably a bug in placement anyway...
Modified: trunk/src/editor2/mouse_action.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/mouse_action.cpp?rev=28654&r1=28653&r2=28654&view=diff
==============================================================================
--- trunk/src/editor2/mouse_action.cpp (original)
+++ trunk/src/editor2/mouse_action.cpp Sat Aug 16 21:42:19 2008
@@ -153,7 +153,7 @@
std::set<gamemap::location> mouse_action_select::affected_hexes(
editor_display& disp, const gamemap::location& hex)
{
- if (key_[SDLK_RALT] || key_[SDLK_LALT]) {
+ if (has_shift_modifier()) {
return disp.map().get_contigious_terrain_tiles(hex);
} else {
return brush_drag_mouse_action::affected_hexes(disp, hex);
Modified: trunk/src/editor2/mouse_action.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/mouse_action.hpp?rev=28654&r1=28653&r2=28654&view=diff
==============================================================================
--- trunk/src/editor2/mouse_action.hpp (original)
+++ trunk/src/editor2/mouse_action.hpp Sat Aug 16 21:42:19 2008
@@ -40,7 +40,7 @@
}
virtual ~mouse_action() {}
-
+
/**
* Mouse move (not a drag). Never changes anything (other than
temporary highlihts and similar)
*/
@@ -108,6 +108,9 @@
const CKey& key_;
private:
+ /**
+ * Pointer to an associated menu/button, if such exists
+ */
const theme::menu* toolbar_button_;
};
@@ -176,7 +179,7 @@
gamemap::location previous_drag_hex_;
private:
/**
- * Current brush handle.
+ * Current brush handle. Currently a pointer-to-pointer with full
constness.
*/
const brush* const * const brush_;
};
Modified: trunk/src/reports.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/reports.cpp?rev=28654&r1=28653&r2=28654&view=diff
==============================================================================
--- trunk/src/reports.cpp (original)
+++ trunk/src/reports.cpp Sat Aug 16 21:42:19 2008
@@ -29,7 +29,7 @@
"turn", "gold", "villages", "num_units", "upkeep", "expenses",
"income", "terrain", "position", "side_playing", "observers",
"report_countdown", "report_clock",
- "selected_terrain", "edit_left_button_function"
+ "selected_terrain", "edit_left_button_function",
"editor2_tool_hint"
};
}
Modified: trunk/src/reports.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/reports.hpp?rev=28654&r1=28653&r2=28654&view=diff
==============================================================================
--- trunk/src/reports.hpp (original)
+++ trunk/src/reports.hpp Sat Aug 16 21:42:19 2008
@@ -33,7 +33,7 @@
TURN, GOLD, VILLAGES, NUM_UNITS, UPKEEP, EXPENSES,
INCOME, TERRAIN, POSITION, SIDE_PLAYING, OBSERVERS,
REPORT_COUNTDOWN, REPORT_CLOCK, SELECTED_TERRAIN,
- EDIT_LEFT_BUTTON_FUNCTION, NUM_REPORTS};
+ EDIT_LEFT_BUTTON_FUNCTION, EDITOR2_TOOL_HINT, NUM_REPORTS};
enum { UNIT_REPORTS_BEGIN=UNIT_NAME, UNIT_REPORTS_END=UNIT_PROFILE+1 };
enum { STATUS_REPORTS_BEGIN=TIME_OF_DAY, STATUS_REPORTS_END=NUM_REPORTS
};
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits