Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance: allow modification of the player room indication on 2D map (M…
…udlet#2621) This is a squash-and-merge of a number of commits with the following edited summary: This PR reorganises the 2D Painter code to draw the player room indicator AFTER all the rooms have been drawn so that it does not get overdrawn by rooms painted after the player's room - which it could be if the rooms are at maximum size or the area is in "gridMode". It also offers some alternative marker options in the form of an oversized ring around the room which reduces the obstruction of the details of the room when the marker is drawn on it. The alternatives are: * a fixed red colour ring * a fixed blue/yellow colour ring - two contrasting colours mean that it can not be lost if drawn over a room that already has one of them as its colour (environment) setting. * a customizable two colour ring where the user can set the outer and inner colours as they like - even to the same colour. The ancient `(bool) Host::mMapStrongHighlight` option is still respected, I note that it was introduced in 3cb1719 from 2011/01/20 (after Mudlet 1.0.5) and the code to control it was lost in 8b0e8bb from 2012/12/31 "NEW Vadim Peretokin: mapper remembers settings" just before the release of Mudlet 2.0...! Refactor: ensure player room is drawn last This is done by extracting the relevant room drawing code to a separate inline function that is used whilst iterating through the area rooms to paint them, skipping but noting if the player room is found and then that function is used to paint the player's room afterwards. Revise: made code acceptable to all compilers The clang compiler does not like `auto` being used as a type in function prototypes as it is not formally part of the C++14 standard but a GCC extension - it got put in by the Qt Creator function extraction code option on the refactor menu. Revise: allow player room marking customisation to be saved and restored They are saved with the profile's data rather than the map. Revise: show transparency effects in custom player room marker colours It is not possible to just colour the background of the `QPushButton`s that set the custom colours to use for the *custom* player room marker as the transparency effects do not show. Instead this commit arranges for an icon with a black-and-white checker board pattern is over-painted with a brush in the relevant colour so that when the opacity is less than 100% the pattern is shown to an extent which is proportional to the degree of transparency of the colour chosen. Refactor: extract code to start 2D map speed-walk & simplify drawRoom code Suggested in peer review comment: Mudlet#2621 Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
- Loading branch information