Warzone2100 / old-trac-import

Archived Import of (old) Warzone 2100 Trac
0 stars 0 forks source link

Disable minimap when its widget is invisible #4867

Closed wzdev-ci closed 5 years ago

wzdev-ci commented 5 years ago

resolution_fixed type_patch (an actual patch, not a request for one) | by Forgon


== 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:

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:

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.


Issue migrated from trac:4867 at 2022-04-16 13:34:52 -0700

wzdev-ci commented 5 years ago

Forgon _uploaded file invisible_radar.patch (11.6 KiB)_

patch file based on revision 456a74edb1fa76e66bf8e0e2c888b54c0b5c6299

wzdev-ci commented 5 years ago

Forgon _uploaded file invisible_radar_beacon_new.png (514.6 KiB)_

screenshot of beacon dropped at object under cursor after applying the patch invisible_radar_beacon_new.png

wzdev-ci commented 5 years ago

Forgon _uploaded file invisible_radar_beacon_old.png (514.5 KiB)_

screenshot of beacon dropped far from cursor position before applying the patch invisible_radar_beacon_old.png

wzdev-ci commented 5 years ago

Forgon _uploaded file invisible_radar_new.mkv (432.8 KiB)_

video of beacon dropped at object under cursor after applying the patch

wzdev-ci commented 5 years ago

Forgon _uploaded file invisible_radar_old.mkv (976.0 KiB)_

video of beacon dropped far from cursor position before applying the patch

wzdev-ci commented 5 years ago

Forgon _uploaded file invisible_radar_savegame.wz (53.5 KiB)_

savegame used by record_invisible_radar

wzdev-ci commented 5 years ago

Forgon _uploaded file record_invisible_radar (1.9 KiB)_

shell script to create video and screenshot documentation for this ticket

wzdev-ci commented 5 years ago

Forgon2100 forgon2100@... changed status from new to closed

wzdev-ci commented 5 years ago

Forgon2100 forgon2100@... changed owner from ` toForgon2100 forgon2100@protonmail.com`

wzdev-ci commented 5 years ago

Forgon2100 forgon2100@... changed resolution from ` tofixed`

wzdev-ci commented 5 years ago

Forgon2100 forgon2100@... committed [39]


In https://github.com/Warzone2100/warzone2100/commit/39f083ed0f0c29f071f9f528c9eeef5544373fd7:

#CommitTicketReference repository="" revision="39f083ed0f0c29f071f9f528c9eeef5544373fd7"
Fix mouse input for disabled radar widget

* new function radarVisible() prevents processing mouse input in radar's
  area after disabling it with "Toggle Overlays" keyboard shortcut

Fixes #4867
wzdev-ci commented 5 years ago

Forgon2100 forgon2100@... committed [9]


In https://github.com/Warzone2100/warzone2100/commit/9a8321a35d059ed3e460f046cd2e451bbcfeadc5:

#CommitTicketReference repository="" revision="9a8321a35d059ed3e460f046cd2e451bbcfeadc5"
Change function draw3DScene() through refactoring

Fixes #4867
wzdev-ci commented 5 years ago

Forgon2100 forgon2100@... committed [01]


In https://github.com/Warzone2100/warzone2100/commit/01cbe8bbffee8a12389ea6e4f17714a4fa0dd9df:

#CommitTicketReference repository="" revision="01cbe8bbffee8a12389ea6e4f17714a4fa0dd9df"
Change mouse over radar tests through refactoring

Fixes #4867
wzdev-ci commented 5 years ago

Forgon2100 forgon2100@... commented


In https://github.com/Warzone2100/warzone2100/commit/ebca18ee2501b307df35b2a692981aebe9db1b27:

#CommitTicketReference repository="" revision="ebca18ee2501b307df35b2a692981aebe9db1b27"
Fix one-off error in tile coordinate calculation

Fixes #4867