Author: ilor
Date: Fri Sep 26 16:38:27 2008
New Revision: 29691

URL: http://svn.gna.org/viewcvs/wesnoth?rev=29691&view=rev
Log:
editor2: add tool overlays for select and starting position, remove the 
redundant tool menu, make the mouse overlay draw on border tiles when in the 
editor

Added:
    trunk/images/editor/tool-overlay-select-brush.png   (with props)
    trunk/images/editor/tool-overlay-select-wand.png   (with props)
    trunk/images/editor/tool-overlay-starting-position.png   (with props)
Modified:
    trunk/data/themes/editor2.cfg
    trunk/src/display.cpp
    trunk/src/editor2/editor_controller.cpp
    trunk/src/editor2/editor_display.cpp
    trunk/src/editor2/mouse_action.cpp

Modified: trunk/data/themes/editor2.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/themes/editor2.cfg?rev=29691&r1=29690&r2=29691&view=diff
==============================================================================
--- trunk/data/themes/editor2.cfg (original)
+++ trunk/data/themes/editor2.cfg Fri Sep 26 16:38:27 2008
@@ -147,16 +147,6 @@
         [/menu]
 
         [menu]
-            id=menu-editor-tool
-            title= _ "Tool"
-            image=lite
-            
items=editor-tool-paint,editor-tool-fill,editor-tool-select,editor-tool-starting-position
-            rect="+2,=,+100,="
-            xanchor=fixed
-            yanchor=fixed
-        [/menu]
-
-        [menu]
             id=menu-editor-selection
             is_context_menu=true
             
items=menu-editor-starting-position,undo,redo,editor-cut,editor-copy,editor-paste,editor-selection-fill,editor-selection-rotate,editor-selection-flip,editor-selection-generate,editor-selection-randomize

Added: trunk/images/editor/tool-overlay-select-brush.png
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/images/editor/tool-overlay-select-brush.png?rev=29691&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/images/editor/tool-overlay-select-brush.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: trunk/images/editor/tool-overlay-select-wand.png
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/images/editor/tool-overlay-select-wand.png?rev=29691&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/images/editor/tool-overlay-select-wand.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: trunk/images/editor/tool-overlay-starting-position.png
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/images/editor/tool-overlay-starting-position.png?rev=29691&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/images/editor/tool-overlay-starting-position.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: trunk/src/display.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.cpp?rev=29691&r1=29690&r2=29691&view=diff
==============================================================================
--- trunk/src/display.cpp (original)
+++ trunk/src/display.cpp Fri Sep 26 16:38:27 2008
@@ -1906,7 +1906,7 @@
        if(loc == selectedHex_ && on_map && selected_hex_overlay_ != NULL) {
                drawing_buffer_add(LAYER_TERRAIN_TMP_BG, drawing_order, 
tblit(xpos, ypos, selected_hex_overlay_));
        }
-       if(loc == mouseoverHex_ && on_map && mouseover_hex_overlay_ != NULL) {
+       if(loc == mouseoverHex_ && (on_map || in_editor() && 
map_.on_board_with_border(loc)) && mouseover_hex_overlay_ != NULL) {
                drawing_buffer_add(LAYER_TERRAIN_TMP_BG, drawing_order, 
tblit(xpos, ypos, mouseover_hex_overlay_));
        }
        

Modified: trunk/src/editor2/editor_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_controller.cpp?rev=29691&r1=29690&r2=29691&view=diff
==============================================================================
--- trunk/src/editor2/editor_controller.cpp (original)
+++ trunk/src/editor2/editor_controller.cpp Fri Sep 26 16:38:27 2008
@@ -1101,6 +1101,7 @@
 {
        editor_action* a = get_mouse_action()->key_event(gui(), event);
        perform_refresh_delete(a);
+       set_mouseover_overlay();
 }
 
 void editor_controller::set_mouseover_overlay()

Modified: trunk/src/editor2/editor_display.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_display.cpp?rev=29691&r1=29690&r2=29691&view=diff
==============================================================================
--- trunk/src/editor2/editor_display.cpp (original)
+++ trunk/src/editor2/editor_display.cpp Fri Sep 26 16:38:27 2008
@@ -65,9 +65,7 @@
 
 image::TYPE editor_display::get_image_type(const gamemap::location& loc)
 {
-    if(brush_locations_.empty() && loc == mouseoverHex_ && 
map_.on_board_with_border(mouseoverHex_)) {
-        return image::BRIGHTENED;
-       } else if (brush_locations_.find(loc) != brush_locations_.end()) {
+       if (brush_locations_.find(loc) != brush_locations_.end()) {
         return image::BRIGHTENED;
     } else if (highlighted_locations_.find(loc) != 
highlighted_locations_.end()) {
         return image::SEMI_BRIGHTENED;

Modified: trunk/src/editor2/mouse_action.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/mouse_action.cpp?rev=29691&r1=29690&r2=29691&view=diff
==============================================================================
--- trunk/src/editor2/mouse_action.cpp (original)
+++ trunk/src/editor2/mouse_action.cpp Fri Sep 26 16:38:27 2008
@@ -297,7 +297,19 @@
 
 void mouse_action_select::set_mouse_overlay(editor_display& disp)
 {
-       disp.set_mouseover_hex_overlay(NULL); //TODO
+       surface image;
+       if (has_shift_modifier()) {
+               image = image::get_image("editor/tool-overlay-select-wand.png");
+       } else {
+               image = 
image::get_image("editor/tool-overlay-select-brush.png");
+       }
+       Uint8 alpha = 196;
+       int size = image->w;
+       int zoom = static_cast<int>(size * disp.get_zoom_factor());
+
+       // Add the alpha factor and scale the image
+       image = scale_surface(adjust_surface_alpha(image, alpha), zoom, zoom);
+       disp.set_mouseover_hex_overlay(image);
 }
 
 
@@ -411,7 +423,14 @@
 
 void mouse_action_starting_position::set_mouse_overlay(editor_display& disp)
 {
-       disp.set_mouseover_hex_overlay(NULL); //TODO
+       surface image = 
image::get_image("editor/tool-overlay-starting-position.png");
+       Uint8 alpha = 196;
+       int size = image->w;
+       int zoom = static_cast<int>(size * disp.get_zoom_factor());
+
+       // Add the alpha factor and scale the image
+       image = scale_surface(adjust_surface_alpha(image, alpha), zoom, zoom);
+       disp.set_mouseover_hex_overlay(image);
 }
 
 


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to