Changeset 819 for trunk/src/xtra2.c

Show
Ignore:
Timestamp:
03/26/08 12:57:49 (2 years ago)
Author:
ajps
Message:

Revised the way mouse click targetting works to fix #326 and #327 - it
should now actually be possible to target and look around using clicks.

New behaviour is that first click moves the cursor and 'looks', another
click in the place highlighted carries out the action (setting target,
launching projectile, whatever). Clicks on monsters target monsters,
otherwise the grid is targetted.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/xtra2.c

    r816 r819  
    19611961                else 
    19621962                { 
    1963                         p = "Direction ('5' or <click> for target, '*' to re-target, Escape to cancel)? "; 
     1963                        p = "Direction ('5' for target, '*' or <click> to re-target, Escape to cancel)? "; 
    19641964                } 
    19651965 
     
    19731973                        case '\xff': 
    19741974                        { 
    1975                                 target_set_location(ke.mousey + Term->offset_y, ke.mousex + Term->offset_x); 
    1976                                 dir = 5; 
     1975                                if (target_set_interactive(TARGET_KILL, KEY_GRID_X(ke), KEY_GRID_Y(ke))) 
     1976                                        dir = 5; 
     1977 
    19771978                                break; 
    19781979                        } 
     
    19811982                        case '*': 
    19821983                        { 
    1983                                 if (target_set_interactive(TARGET_KILL)) dir = 5; 
     1984                                if (target_set_interactive(TARGET_KILL, -1, -1)) dir = 5; 
    19841985                                break; 
    19851986                        }