Jump to content


Photo

Dungeon Defenders ToggleMap


  • Please log in to reply
No replies to this topic

#1 redyrthgin

redyrthgin
  • Members
  • 7 posts

Posted 07 November 2011 - 11:41 AM

Dungeon Defenders is a tower defense game. Normally you have to hold shift to display the map; similar to holding tab in many games to show a map/scoreboard.

Now you can toggle the map on/off with Capslock. Feel free to add or suggest changes/fixes/adjustments. I just threw this together for a request, so there are might be small issues with it.

Download script or the standalone executable

Changes:
Ninja edit - added tab to list of keys. Forgot the chat button! Opps.

/* -----------------------------------------------------------------------------
  Dungeon Defenders ToggleMap - By redyrthgin
  Date: November 7, 2011
  Overview: Allows for toggle map. Capslock toggles map. 
            Hitting shift works as expected/normal.
  Flaws: The user might hit capslock while they are in a non-map friendly part
         of the game. In that case, things will seem to not work, and it will
         be up to them to toggle the map again.
*/ -----------------------------------------------------------------------------
SetTitleMatchMode, 3
#IfWinActive, Dungeon Defenders

showMap = 0                                    ;tracks if we are showing the map

/* -----------------------------------------------------------------------------
 There are various keys that when pressed would send the user into a state where
  they might want to do something that would be hindered if the shift was still
  being held down. Examples: Hero Info (i key) and Forge (gotten to via e). If 
  you are in there and shift is held down nothing will seem to work. The user
  may feel something is broken, but might not attribute it to that the map is 
  still trying to be shown; nor that they should toggle it off. Therefor we 
  setup all these hotkeys to do it for them. 
*/ -----------------------------------------------------------------------------
list = ~*F1|~*i|~*e|~*f|~*shift Up|~*esc|~*tab ;keys we want to hide the map
loop, parse, list, |                           ;make keys into hotkeys
   hotkey, %A_LoopField%, handler

handler:                                       
   showMap = 0
   Send {shift up}
   SetCapsLockState, off
return

/* -----------------------------------------------------------------------------
 Capslock toggles showing the map.
*/ -----------------------------------------------------------------------------
~*Capslock::
   showMap := !showMap

   if(showMap)
      Send {shift down}
   else
      Send {shift up}
return