#4867: Disable minimap when its widget is invisible
-------------------------------------------------+-------------------------
 Reporter:  Forgon                               |             Owner:
     Type:  patch (an actual patch, not a        |            Status:  new
  request for one)                               |         Milestone:
 Priority:  normal                               |  unspecified
Component:  other                                |           Version:
 Keywords:                                       |  git/master
 Blocking:                                       |        Blocked By:
                                                 |  Operating System:  All
                                                 |  /Non-Specific
-------------------------------------------------+-------------------------
 == Radar visibility

 When pressing the Tab key (the default keyboard shortcut for "Toggle
 Overlays"),
 all widgets were disabled, except the radar, which was merely turned
 invisible.

 This led to the following bugs:
 * in skirmish and multiplayer games, beacons dropped inside the radar area
   were either invisible to the user or seemed to appear in the wrong
 location
 * mouse actions continued to be processed as though the radar was active:
   * scrolling to set radar zoom
   * clicking the left mouse button to send units to a specific location
   * clicking or dragging the right mouse button to move around the map

 The problem occurred because the minimap was disabled only if at least one
 of
 two boolean variables were set to "false", neither of which was affected
 by the
 function setWidgetsStatus() that disabled widgets:
 * radarOnScreen (can be set via "Toggle Radar", by default through
 pressing F7)
 * radarPermitted (usually true when HQ present)

 The unused cheat "Move Pause" set the variable radarOnScreen when
 (de)activating
 widgets to avoid the bug.
 Yet this could overrule the user having toggled radar visibility by
 pressing F7.

 A new function radarVisible() now calls getWidgetStatus() to verify
 whether the
 radar is visible in addition to being activated.

 == Refactoring function draw3DScene()

 The function draw3DScene() does not draw widgets, radar included, if the
 variables bRender3DOnly and radarVisible are set to "false".
 The code for this rule was overly complicated and has been refactored.

 == Checking whether the mouse is inside the radar area

 The mouse cursor is inside the radar area if the functions radarVisible()
 and
 CoordInRadar() both return "true".
 This condition has been replaced in two instances with merely checking the
 return value of function isMouseOverRadar(), the variable mouseOverRadar.
 The function processRadarInput() only sets it to "true" if the radar is
 visible.

 == Fix one-off error in calculation of world coordinates

 Tile coordinates range from 0 to map length -1 or map width -1.
 The function CalcRadarPosition() did not subtract 1, causing a one-off
 error.

--
Ticket URL: <http://developer.wz2100.net/ticket/4867>
Warzone 2100 Trac <http://developer.wz2100.net/>
The Warzone 2100 Project

_______________________________________________
Warzone2100-project mailing list
Warzone2100-project@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/warzone2100-project

Reply via email to