Skip to content

Enhance: import/export map as JSON#4546

Merged
SlySven merged 31 commits intoMudlet:developmentfrom
SlySven:Enhance_importExportMapAsJSON
Feb 14, 2021
Merged

Enhance: import/export map as JSON#4546
SlySven merged 31 commits intoMudlet:developmentfrom
SlySven:Enhance_importExportMapAsJSON

Conversation

@SlySven
Copy link
Copy Markdown
Member

@SlySven SlySven commented Dec 29, 2020

This is so that a crowd sourced map might be edited in a collaborative manner. The first stage is to make sufficient of the entire map details be exported/imported in a modular (by area) fashion.

First (easier) part is writing the data out.

Include a Lua function exportJsonMap() to perform the export function.

Also:

  • Rename (QMultiMap<int, QPair<int, int>>) TArea::exits to: TArea::mAreaExits because the old name was such a common word in our source code it was hard to find the uses of this member.

This format has been constructed so as to not mention the most common, or default values for some items - so as to minimise details that have to be included on the basis they can be assumed when reconstructing them on the other end.

On the other hand the whole file is compressible so for storage (but not for diff/git work) archiving / compressing the file is recommended! For instance a binary map file I have is 18.6MB which produced a 25.8MB JSON file which I was able to compress down to 2.9MB - obviously this is very content dependent, so other's Miles-May-Vary...

As the export process is not that fast include a progress dialogue that shows how many areas, map labels and rooms have been processed into the JSON format. For a 20K room map with 40 odd areas and around 800 map labels
(which are awkward to convert to a text-like form) this can take 30 seconds on my 1.8GHz 4 Core PC!

Signed-off-by: Stephen Lyons slysven@virginmedia.com

This is so that a crowd sourced map might be edited in a collaborative
manner. The first stage is to make sufficient of the entire map details
be exported/imported in a modular (by area) fashion.

First (easier) part is writing the data out.

Include a Lua function `exportJsonMap()` to perform the export function.

Also:
* Rename `(QMultiMap<int, QPair<int, int>>) TArea::exits` to:
`TArea::mAreaExits` because the old name was such a common word in our
source code it was hard to find the uses of this member.

This format has been constructed so as to not mention the most common, or
default values for some items - so as to minimise details that have to be
included on the basis they can be assumed when reconstructing them on the
other end.

The other hand the whole file is compressible so for storage (but not for
diff/git work) archiving / compressing the file is recommended! For
instance a binary map file I have is 18.6MB which produced a 25.8MB JSON
file which I was able to compress down to 2.9MB - obviously this is *very*
content dependent, so other's Miles-May-Vary...

As the export process is not that fast include a progress dialogue that
shows how many areas, map labels and rooms have been processed into the
JSON format. For a 20K room map with 40 odd areas and around 800 map labels
(which are awkward to convert to a text-like form) this can take 30
seconds on my 1.8GHz 4 Core PC!

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Dec 29, 2020

Hey there! Thanks for helping Mudlet improve. 🌟

Test versions

You can directly test the changes here:

No need to install anything - just unzip and run.
Let us know if it works well, and if it doesn't, please give details.

It spotted a missing space between an `ìf` and the opening brace of it's
conditions.

It had a recommendation about a constant that I was using to set the
dimension of a `char[]` (array) - it felt a compile time `constexpr` was
a better thing to use.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@SlySven
Copy link
Copy Markdown
Member Author

SlySven commented Dec 29, 2020

👷 🛠️ Note this is currently a Work In Progress and there is no guarantee that the data it produces is enough to reproduce your map. Hell there isn't even a reader for the file produced yet - that is the next step...

Also - the exact format might change once I try to construct that reader (if/when I find I have done this rong.)

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Although the existing code would abort at the end of an area, for some
humongous maps with a few very large areas it is also a good idea to check
for the cancel button being pressed each time the progress bar is updated.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
I was trying to avoid committing some code that I was already working on
but not ready to push out and accidentally left a fragment (a closing `}`)
in place which broke compilation...

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Dec 30, 2020

@wilk you have experience working with the map data format, can you help in reviewing?

@wilk
Copy link
Copy Markdown

wilk commented Dec 30, 2020

Yeah, @vadi2 , I'd like to but I'm sure you're looking for someone else 😄

@Delwing
Copy link
Copy Markdown
Contributor

Delwing commented Dec 30, 2020

@vadi2 sure, but I guess it's not done yet :) I've asked SlySven about estmates, since I have deep interest in that feature :)
Will keep my on that :)

@SlySven
Copy link
Copy Markdown
Member Author

SlySven commented Jan 1, 2021

⚠️ The code so far is flawed in that it is not populating the "int (color Id)" => R,G,B(,A) trip/quadrup-let color "customEnvColors" table.

The "int (IRE MUD color code)" => ìnt (Mudlet color Id) "envColor" table is probably also not being filled in either...

Renamed `(QMap<int, int>) TMap::envColors` to `TMap::mEnvColors`
and `(QMap<int, QColor>) Tmap::customEnvColors` to `TMap::mCustomEnvColors`
so that it is clearer that they are members of the `TMap` class.

Add alpha component to end of list of (now four) 0 to 255 integer values
returned by `getCustomEnvColorTable()` - as the corresponding setter does
allow one to be provided.

Extract some of the `QStringLiterals` in `./src/TMap.cpp` to predefined
constants so that only one of each string is created/needed in that file.

Fixed handling of `TMap::mCustomEnvColors` as it was not being written
correctly. Version incremented to `0.002` - and only that form will be
read currently. The reader is incomplete at present - only a test read of
the direct TMap elements are loaded to temporary variables for testing.
The area (and their contained rooms) are still to have parser created.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Needed to bring in changes to the way special exits and special exit locks
are stored in the `TRoom` class.

Conflicts resolved in:
* src/TArea.cpp
* src/TMap.cpp
* src/TRoom.cpp
* src/TRoom.h

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
SlySven added a commit to SlySven/Mudlet that referenced this pull request Jan 9, 2021
This actually makes management of map labels a lot simpler.

I also need this to be in place for my JSON map file export/importer
PR Mudlet#4546.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@SlySven SlySven added the Waiting for other PR Merge This PR is awaiting another PR to merge firstly. label Jan 10, 2021
@SlySven
Copy link
Copy Markdown
Member Author

SlySven commented Jan 10, 2021

Actually it is waiting for #4604 to be merged into the development branch.

SlySven added a commit that referenced this pull request Jan 17, 2021
This actually makes management of map labels a lot simpler.

I also need this to be in place for my JSON map file export/importer
PR #4546.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Move initialisers for TMap, TRoomDB, TRoom and TArea to header file where
possible. As per Issue Mudlet#4578.

Move the default and unnamed area names from TRoomDB to TMap - as it made
setting them up easier (though one of them does need to be initilised
before the normal TRoomDB instance associated with the TMap is itself
initialised. This meant putting these private members near the top of the
header file even though we normally put private ones down the bottom.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Conflicts resolved in:
* src/T2DMap.cpp
* src/TArea.cpp
* src/TArea.h
* src/TLuaInterpreter.cpp
* src/TMap.cpp
* src/TMapLabel.h

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
The code is common to all three classes so can be shared. At the same time
make it explicit in the key as to whether there is an alpha component so
the colour is a 24Bit opaque one or a 32Bit one with transparency.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@SlySven SlySven added enhancement and removed Waiting for other PR Merge This PR is awaiting another PR to merge firstly. labels Jan 26, 2021
…gain (Mudlet#4687)

A test for this pointer being a `nullptr` is what enables a new dialogue to
be made in the 2D mapper - by not initialising it in Mudlet#4573 a random
non-null value is found so the dialogue and thus the functionality can be
virtually impossible to use.

As it is a pointer I have taken the liberty to introduce a `p` into the
initial part of the name - after the `m` to indicate it is a class member.

As the defect is a regression that causes loss of functionality I am rating
this as a **high** priority bug(fix) even though it does not induce any
fatal termination of the application.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
…sion

In creating Mudlet#4693 I chose the opposite duplicate chunk of code that I was
using in this PR - since there was slight differences it would have
impacted when this PR is merged.

This commit swaps things so that it uses the same code as will be in
the development branch in the near future.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Copy link
Copy Markdown
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great! Nice piece of work :)

The only thing I'd improve on is that the object reading code is possibly more complicated than it should be: trying to read the keys first, then iterating them using and old-style iterator. Can this be improved with a ranged-for pattern that would be much simpler to read?

src/TArea.cpp Outdated
Comment on lines +49 to +62
static const QString scCOLORS{QStringLiteral("colors")};
static const QString scCOORDINATES{QLatin1String("coordinates")};
static const QString scGRID_MODE{QStringLiteral("gridMode")};
static const QString scID{QStringLiteral("id")};
static const QString scIMAGE{QStringLiteral("image")};
static const QString scLABELS{QStringLiteral("labels")};
static const QString scNAME{QStringLiteral("name")};
static const QString scROOM_COUNT{QStringLiteral("roomCount")};
static const QString scROOMS{QStringLiteral("rooms")};
static const QString scSCALED{QStringLiteral("scaled")};
static const QString scSHOW_ON_TOP{QStringLiteral("showOnTop")};
static const QString scSIZE{QLatin1String("size")};
static const QString scTEXT{QStringLiteral("text")};
static const QString scUSER_DATA{QStringLiteral("userData")};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are a pain and make the code difficult to read. Also, since we're creating a QString, there are no advantages to QStringLiteral it turns out. I recommend removing these - I understand it's good to have for consistency, but honestly in our small codebase the error is unlikely to happen.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we are creating one QString (per compilation unit) instead of one for each use within that CU (.cpp file). i will have a look to see whether QLatin1String offers a compromise (again there will likely be only one copy per CU as the compiler should share them) so the run-time construction cost should not be that much even with multiple uses through the file.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Humm, QJsonObject and related has methods that have QLatin1String overloads - but they were only introduced in Qt 5.14 - so if I read that right they are reasonable to use given that all our CI builds are using Qt 5.15 and the extra cost of the more complicated construction prior to that is just going to be a burden on systems not at the leading edge of Qt.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but the developer pain that this code is adding is not worth the convenience it promises. I think if you run the numbers, you won't even see a 5% improvement.

return labelId;
}

void TArea::writeJsonArea(QJsonArray& array) const
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constants excluded, nice and easy to follow 👍

src/TArea.cpp Outdated
}

QStringList keys = obj.keys();
for (int i = 0, total = keys.count(); i < total; ++i) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Difficult to follow - can a simple ranged-for be used to read the object's key and value at once? This pattern is repeated elsewhere and should be simplified.

src/TMap.cpp Outdated
return {false, QStringLiteral("no areas detected")};
}

mProgressDialogAreasTotal = qRound(mapObj[scAREA_COUNT].toDouble());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why all of this conversion? This is something that could use a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All numbers (even integers) are doubles in JSON aren't and this seemed to me to be the most robust means of reading something that could have been edited by a user (or even a third party tool).

src/TMap.cpp Outdated
}

QMap<int, int> envColors;
if (mapObj.contains(scENV_TO_COLOR_MAPPING) && mapObj.value(scENV_TO_COLOR_MAPPING).isObject()) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just reading a simple key:value from the json but the code is not simple - could a range-for be used to simplify things here? Same with custom colors below, takes some effort to parse what it is doing - when it shouldn't.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is trying to be robust - first it checks for the thing to exist, then it checks that it is the right sort of thing (object vs array) - in other places where it is an array it also checks that it has a reasonable number of elements. I've seen other JSON stuff in a few places and it too is checking that something is not undefined before it tries to do anything doesn't it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah but if we can get a ranged for, it won't even trigger if there's nothing there?

@Kebap
Copy link
Copy Markdown
Contributor

Kebap commented Feb 11, 2021

Include a Lua function exportJsonMap() to perform the export function.

Do we have a button? Also for import? Maybe in preferences next to existing backup? Sorry did not test, yet.

Copy link
Copy Markdown
Contributor

@Kebap Kebap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few suggestions from me 😄

Conflicts resolved in:
* src/TLuaInterpreter.cpp
* src/TLuaInterpreter.h
* src/dlgMapper.cpp

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
…the PR

This is so that the two new methods adopt the same new code that other
functions in the TLuaInterpreter class do.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@vadi2 vadi2 added the needs documentation This pull request changes things the players would use/see and thus needs an update in the manual label Feb 13, 2021
Revert use of a single common `static const QString` for each string needed
in the JSON map file handling in `TMap`, `TArea` and `TRoom` classes.

Switch to "range based" for-loops for some of the JSON additions.

Fix a spelling mistake in a comment.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
…rted

Not doing this would cause a resource leak if the abort button was clicked
during importation of a Json map file.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@SlySven
Copy link
Copy Markdown
Member Author

SlySven commented Feb 14, 2021

@vadi2 How is it looking now? I've taken out those static const QStrings and adopted range-based fors where I could see how to do so.

Copy link
Copy Markdown
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! It looks great on my side 🥇

@Kebap had some good comments in there about making it possible to use json from the interface, will defer final approval to him.

@SlySven
Copy link
Copy Markdown
Member Author

SlySven commented Feb 14, 2021

@Kebap had some good comments in there about making it possible to use json from the interface, will defer final approval to him.

Yeah - I understood the desire for that - but TBH this is big enough already and I wanted to get this in as something that can be used before I go on to:

  • Add it to the UI - probably as an additional file type on the save/load buttons.
  • Research and add Lua API to swap one or more areas with replacements from JSON file(s) - and the means to export them - gotta work out the logistics which would probably include a requirement for all the exits from each half (the map to received the import less the areas to be swapped out + the replacement areas to be swapped in) to connect up to rooms in the other part.

Also, as a more general issue, I think we ought to have a method to control which user data items are saved/exported so that the user can specify that a particular data item is:

  • exported in all cases ("Public")
  • only exported to locally shared maps ("Protected")
  • never exported ("Private")

Obviously the autosave at the end of a session - and the default - must be to save all data; but when sharing the map with other profile/users there is a requirement to be a bit more selective. As it happens this is something that I have been conscious of for a while - and your (@Vadi) observation that each characters' current room is saved in the file; and is now visible in a human readable form in the JSON export is very related to this as well. Fortunately the detail can be found and hand-edited out should anyone not like it - but the data that is leaked is only the local name that each profile has and the location that was recorded when the file was last updated for that profile - and for a map file that is shared/copied to another profile the data will be stale and out of date as soon as the profile on the machine where the player location is actively used changes (humm, does that sentence makes sense to anyone...? 💫)

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Feb 14, 2021

TBH this is big enough already and I wanted to get this in as something that can be used before I go on to

I see what you mean, I agree. @Kebap @Delwing ?

@Delwing
Copy link
Copy Markdown
Contributor

Delwing commented Feb 14, 2021

I've posted question while ago - why do we need to export room highlights if they are not permanent normally.

@SlySven
Copy link
Copy Markdown
Member Author

SlySven commented Feb 14, 2021

I've posted question while ago - why do we need to export room highlights if they are not permanent normally.

Ah, well spotted - I'll check that, and if so, I've whip that detail out...

@SlySven
Copy link
Copy Markdown
Member Author

SlySven commented Feb 14, 2021

🤔 Confirmed - none of the room high-lighting details (size, two colours and state) are stored in the binary map format!

Is that the wanted state of things? I'll comment out the writer method but leave the reader active.

It has been pointed out that the binary map format does not save the room
highlighting details either - so replicate that behaviour for the moment.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@Kebap
Copy link
Copy Markdown
Contributor

Kebap commented Feb 14, 2021

making it possible to use json from the interface

Yeah - I understood the desire for that - but TBH this is big enough already and I wanted to get this in as something that can be used before I go on to:

  • Add it to the UI - probably as an additional file type on the save/load buttons.

Seems fair to me, approved!

@SlySven SlySven merged commit 6d4046e into Mudlet:development Feb 14, 2021
@SlySven SlySven deleted the Enhance_importExportMapAsJSON branch February 15, 2021 01:07
@SlySven
Copy link
Copy Markdown
Member Author

SlySven commented Feb 15, 2021

📚 Wiki documentation added and links inserted into TLuainterpreter.cpp at (2) appropriate places #4810.

@SlySven SlySven removed the needs documentation This pull request changes things the players would use/see and thus needs an update in the manual label Feb 15, 2021
SlySven added a commit that referenced this pull request Aug 3, 2021
…opment one (#5311)

This is a squash and merge of over 250 commits to the main development branch 
into the 64-bit Windows one so as to bring in "other" changes in summary they
are:

* Infrastructure: updated text for translation (#4777)
Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* display(): don't freeze showing Geyser windows (#4773)
replace prettywrite with inspect to avoid crashes or stackoverflow in Geyser

* make inspect global + replace prettywrite in miniconsole display

* alias prettywrite

* add nullcheck back (#4782)
Co-authored-by: Piotr Wilczynski <piotr.wilczynski@bisnode.com>

* Add f function for string interpolation and 6 tests for it.

* Set lua runtime version for vscode

* Clarify internal message about movable tabs (#4791)

* Clarify message over movable tabs

* Update src/mudlet.cpp
Co-authored-by: Kebap <kebap_spam@gmx.net>

* Infrastructure: Update PR template (#4801)

* Infrastructure: downgrade to GCC 7 from 9 (#4796)

* Downgrade to GCC 7 from 9

* Update .github/workflows/build-mudlet.yml

Co-authored-by: Stephen Lyons <slysven@virginmedia.com>

* Infrastructure: improve resiliency ptb changelogs (#4804)

* Generate changelog for macOS builds

* Show generated changlog in appveyor builds

* Enhance: import/export map as JSON (#4546)

This is so that a crowd sourced map might be edited in a collaborative
manner. The first stage is to make sufficient of the entire map details
be exported/imported in a modular (by area) fashion.

Include Lua functions `exportJsonMap(pathFileName)` and
`importJsonMap(pathFileName)` to perform the whole map export and
import functions.

Also, rename `(QMultiMap<int, QPair<int, int>>) TArea::exits` to:
`TArea::mAreaExits` because the old name was such a common word in our
source code it was hard to find the uses of this member.

This format has been constructed so as to not mention the most common, or
default values for some items - so as to minimise details that have to be
included on the basis they can be assumed when reconstructing them on the
other end.

On the other hand the whole file is compressible so for storage (but not for
diff/git work) archiving / compressing the file is recommended! For
instance a binary map file I have is 18.6MB which produced a 25.8MB JSON
file which I was able to compress down to 2.9MB - obviously this is *very*
content dependent, so other's Miles-May-Vary...

As the export process is not that fast include a progress dialogue that
shows how many areas, map labels and rooms have been processed into the
JSON format. For a 20K room map with 40 odd areas and around 800 map labels
(which are awkward to convert to a text-like form) this can take 30
seconds on my 1.8GHz 4 Core PC!

CodeFactor had a recommendation about a constant that I was using to
set the dimension of a `char[]` (array) - it felt a compile time `constexpr` was
a better thing to use.

Revised to make Cancel button work in big areas:

Although the existing code would abort at the end of an area, for some
humongous maps with a few very large areas it is also a good idea to check
for the cancel button being pressed each time the progress bar is updated.

Renamed `(QMap<int, int>) TMap::envColors` to `TMap::mEnvColors`
and `(QMap<int, QColor>) Tmap::customEnvColors` to `TMap::mCustomEnvColors`
so that it is clearer that they are members of the `TMap` class.

Add alpha component to end of list of (now four) 0 to 255 integer values
returned by `getCustomEnvColorTable()` - as the corresponding setter does
allow one to be provided.

Move initialisers for TMap, TRoomDB, TRoom and TArea to header file where
possible. As per Issue #4578.

Move the default and unnamed area names from TRoomDB to TMap - as it made
setting them up easier (though one of them does need to be initialised
before the normal TRoomDB instance associated with the TMap is itself
initialised. This meant putting these private members near the top of the
header file even though we normally put private ones down the bottom.

Refactor: move JSON colour writing/reading code from TArea/TRoom to TMap

The code is common to all three classes so can be shared. At the same time
make it explicit in the key as to whether there is an alpha component so
the colour is a 24Bit opaque one or a 32Bit one with transparency.

Revise: peer-review items and other tweaks

Note that this revises the format version to be 1.000 (ready for release)
so, although the format has not changed, any recent files produced during
evaluation will need to be hand edited to change the line:
    "formatVersion": 0.003,
to:
    "formatVersion": 1.000,
in order to read them now.

Switch to "range based" for-loops for some of the JSON additions.

Fixup: ensure partially built new TRoomDB is destroyed if reading aborted

Not doing this would cause a resource leak if the abort button was clicked
during importation of a Json map file.

Revise: disable writing out Room highlighting details

It has been pointed out that the binary map format does not save the room
highlighting details either - so replicate that behaviour for the moment.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>

* Internal: cleanup stray debug statements (#4802)

* Cleanup stray debug statements

* Revert accidental change

* Infrastructure: install our own Boost (#4797)

* Improve exists function, return nil+msg if wrong type provided (#4775)

* Add a placeholder to the optional command fields (#4786)

* fix segfault when no mapper window is opened but contributors to map info are added (#4787)

Co-authored-by: Piotr Wilczynski <piotr.wilczynski@bisnode.com>

* Update: provide Wiki links for new functions (#4810)

Made a trivial change to cause rebuild (as origin commit had a
component that caused the CI to not be run): take out
unneeded `QStringLiteral` wrappers around perfectly usable
raw C strings.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Don't preinstall "send text to all games" script (#4811)

* Add getProfileTabNumber() (#4788)

* Make it simple to delete empty default profiles (#4592)

Co-authored-by: Stephen Lyons <slysven@virginmedia.com>

* Fix wrong text selection when timestamp shown (#4815)

* Fix selection only copying one letter when double/triple click (#4816)

fixes copying only one letter if a word by doubleclick or a whole line by triple click is selected

* Restore compatibility with macOS 10.14 (#4793)

* Set XCode to 11.3 which is what we used in Travis

* Set CMAKE_OSX_DEPLOYMENT_TARGET correctly

* Correct CMakeLists

* Fix syntax

* Up to latest available XCode

* Add section for release notes blurb to the pr template

* Repair setPopup api (#4823)

* repair setPopup api

* improve setPopup error message

* revert change

probably a copy/paste fail

* Show a placeholder in the input first launch (#4806)

* (autocommit) Updated text for translation (#4825)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* (autocommit) Updated autocompletion data (#4827)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* Have consistent JSON map import messages (#4829)

* Improve clarity in timing code (#4830)

Co-authored-by: Stephen Lyons <slysven@virginmedia.com>

* Lua API: Custom HTTP method requests (#4814)

Co-authored-by: Piotr Wilczynski <piotr.wilczynski@bisnode.com>

* Repair LabelCallback and CmdLineAction error handling when no window is found (#4834)

* New Crowdin updates (#4710)

* Fix selection of replay message (#4650)

* BugFix: improve handling of TConsole::mSystemMessageBgColor

This `QColor` is initilised to the default value of `TConsole::mBgColor`
which, since #4570, is now the transparent color. Unfortunely this is bad
because when text printed on the main console with:
`(void) TConsole::printSystemMessage(const QString)`
the red foreground and the transparent background get swapped over and thus
is rendered as a solid block of red.

This PR attempts to solve this by ensuring that whne the
`TConsole::mBgColor` member is set to a different color that the same
colour is also stored for use as `TConsole::mSystemMessageBgColor`.

The issue of how things are colored does seem to be made more complicated
by the use of `QPalette` for some things for which it does not seem to be
worthwhile; therefore in this PR I also remove some uses of the Qt palette
system in places where it does not seem to be doing anything useful.

I have also reviewed how things might be affected by setting an image as
a background image for the main console but it seems that the changes here
do not prevent the display of an image where there is NO text shown on
screen.

This might close #4635.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* BugFix: part revert previous commit and correct spelling

The modifications made to `(void) TConsole::changeColors()` to take away
the manipulation of the command line palette should not have been done!

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Allow functions alongside with [[string]] everywhere (#4800)

* Infrastructure: update build action used for dependencies (#4832)

* Show icon again in macOS installer (#4820)

* BugFix: prevent crashes when clicking on empty maps (#4824)

It prevents several mouse events for the mappers (both 2 and 3D) from doing
much if the map is non-existent! This should close Issue #4821.

It also:
* adds a `(bool) TRoomDB::isEmpty()` function to provide a consistent
indication that there is no rooms in the current map. (This saves having
to count all the rooms in the map {to get the `size()`} and checking the
value is not zero - technically it ought to be a tiny bit faster!)

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>

* Short map info will have trailing .,/ removed and will be trimmed by default  (#4812)

* enhance short map info to remove trailing .,/ from room name and trim it be default

* work on copy of room name
remove multiple occurences

* Update src/mapInfoContributorManager.cpp

Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>

* Update src/mapInfoContributorManager.cpp

* Update src/mapInfoContributorManager.cpp

Co-authored-by: Kebap <kebap_spam@gmx.net>

* remove extra space

* small correction

* toggle short room info trim + strip punctuation in view mode only

Co-authored-by: Piotr Wilczynski <piotr.wilczynski@bisnode.com>
Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>
Co-authored-by: Kebap <kebap_spam@gmx.net>

* Infrastructure: Codesign macOS builds in Github Actions (#4746)

* Fix MXP playing MSP handles with no attribute names (#4839)

* Fix some features games displaying twice in connection dialog (#4840)

* Internal: Upgrade to final Sparkle 1.25 (macOS updater) instead of RC (#4845)

* Internal: consistently return {value, value} for std::pair() (#4842)

* Add Clessidra to known games using Discord Rich Presence (#4844)

* Fix text value in showNotification() not being set correctly (#4852)

* Fix setBackgroundColor first argument to be optional again (#4860)

* Internal: Remove unused variables (#4851)

* Remove unused qstrings

* Remove more unused variables

* Refactor: rationalise control names and remove unneeded elements in mapper (#4863)

Add type prefixes to all the controls on the mapper form - and rename some
e.g. "dim2" becomes "pushButton_3D"; "bubbles", "checkBox_roundRooms".

Make the 2D/3D button be a checkable one that only shows 3D and is in that
mode when down - and hidden when the 3D map has been disabled during build.
Correspondingly, make `show2dView()`, now called `slot_toggle3DView(bool)`
note the state of its argument - so that it can respond to the button state
in the signal.

Remove unused second GLWidget constructor.

Move all POD-type constructor initialisers for GLWidget class to header
file. Also move some global variables to be class members instead.

Remove unused methods (including some slots and signals) and global
variables.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Fix hecho with transparent background (#4866)

* Add automation to auto-link Linux and macOS PTB to updater (#4861)

* getPackages and getModules by Lua api (#4871)

* getPackages and getModules

* adjust to fit lua api

getAllRoomUserData() and getAreaExits() don't return nil if no data is given + they don't return true if data is given so I adjusted to fit the existing api

* suggestion

* Consistent JSON map save/load functions (#4882)

* Bump actions/setup-node from v2.1.4 to v2.1.5 (#4880)

Bumps [actions/setup-node](https://github.com/actions/setup-node) from v2.1.4 to v2.1.5.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v2.1.4...46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix backwards capability of some stylesheets + cecho background color handling (#4865)

* change mpBackground to have no children

* get rid of mpBackground

To don't get white\transparent miniconsoles I had to revert the changes made in mBgColor so I fixed btw the issue with cecho background

* get settings to work also when set in the settings editor

* remove qDebug

* fix white "transparent" miniconsoles

had to change this because it cause miniconsoles with "transparent" (they are never really transparent) set background to be white

* prevent white line in dark theme

this commit prevents a white line in eraenes dark theme and changes the QString in setobjectname to QStringLiterals

* Add AdjustableContainerRepositionFinish event, change in AdjustableContainerReposition event (#4864)

* AdjustableContainer - AdjustableContainerRepositionFinish event, change in AdjustableContainerReposition event

* typo

Co-authored-by: Kamil Tunkiewicz <kamiltunkiewicz@currencyfair.com>

* Delete test PTB workflow (#4835)

* Update list of software we use (#4883)

* Fix macOS PTB updates(#4884)

* (autocommit) Updated text for translation (#4881)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* Internal: Add missing braces around statements (#4889)

* Add missing braces

* Add missing braces around statements

* Add automated check to verify improvements against Mudlet's C++ style guide (#4858)

* Internal: add GUItest mpackage for testing cecho/decho/hecho and console transparency to tests (#4886)

* BugFix: remove 3 compilation warnings (#4890)

* An out of order member in `Host` constructor initialisation list
* An unused argument to lambda function in:
  `TLuaInterpreter::registerMapInfo(...)`
* A, now unused, variable in `mudlet::slot_module_clicked(...)`

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* BugFix: prevent crash in userwindows when closing profile (#4892)

This seems to be a regression and running a git bisect to identify
when it was introduced points to: f94a494bb046e7cc5ed2c762a23675f4bf15f4e6

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* BugFix: do not squash dockable mapper when visibility is toggled (#4896)

The existing code was showing and hiding both the `dlgMapper` and, when it
is contained within a floating/dockable QDockWidget, that container widget.
This has the unfortunate side effect of causing that type of mapper to
shrink to a minimal size when shown a second time.

It was confusing that the code to show and hide the mapper was actually
contained within a method called `createMapper` - so that has been renamed
to `showHideOrCreateMapper` and the functionality - clearly
dividable into two parts - has been refactored into two new methods that
does one part; coincidentally one of them can now be called `createMapper`!

Also add a `(bool) isFloatAndDockable()` method to the `dlgMapper` class
to refactor out the means to identify that instance of the class being
contained in a `QDockWidget`.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Fix colored buttons on macOS and Windows (#4846)

Since somewhere after Qt 5.12 the style code for the "windowssvista" style
(only) paints `QPushButton`s with native painting code that hides the
background colour set in a stylesheet setting entirely with the border.

This detail is hidden away on:
https://doc.qt.io/qt-5/stylesheet-reference.html
under QPushButton, where it says:
"Warning: If you only set a background-color on a QPushButton, the
background may not appear unless you set the border property to some
value. This is because, by default, the QPushButton draws a native border
which completely overlaps the background-color. For example,

QPushButton { background-color: red; border: none; }"

This documentation page does seems to show this from at least back to Qt
5.5 - but it does look that we have not been encountering it - certainly
neither the "Fusion" or "Windows" (old style possibly dating back to Win98
era) seem to display this behaviour - which is why this bug fix is labelled
as **Windows**.

The fix implemented here detects if the style factory being used is the
problematic "windowsvista" one (default on Windows nowadays), or something
else by appending a `--style=Windows` or `--style=Fusion` to the
`Mudlet.exe` command line invokation (possilbly with a short-cut) or does
the same thing by setting the `QT_STYLE_OVERRIDE` environmental variable to
one of those two styles; if this is the case then a flag is set and that is
used to modify some style steet strings to work around the issue.

This ought to be documented in the Lua API functions that might be used to
apply stylesheets to pushbuttons as any that set a `background-color`
without also doing something with `border` may not behave as the user
expects!

By making the style sheet creation template strings in the `mudlet`
singleton class we can generate them centrally when the application
starts and provide them globally to all the places where they are needed;
this makes the overall set of changes much smaller!

Thanks to Discord user `mars#8093` (a.k.a. `The Lost`) for demonstrating
that MacOs seems to have the same problem in it's platform specific
and default `macintosh` style as well - so this fix is also applied for that
one to.

Revised by making the style factory matching case insensitive

Simplify the debug output now that the issue has been solved but leave a
single line to debug output whether we detect a problematic style factory
or not - it will help us to debug what is going on if end-users have problems
with style (factories) and ask us to diagnose things remotely.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>

* Check first argument in c/d/h (echo/link/popup) functions (#4898)

* Reformat module and package manager code out of mudlet.cpp (#4897)

* get PackageManager out of mudlet.cpp

* get Module Manager out of mudlet.cpp

* close package/modulemanager when parent console closes

* copyright

* copyright for headers

* Add original authors

Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>

* Fix clang-tidy review to run against forks as well (#4895)

* Bring focus back to main command line if label/miniconsole in floating UserWindow have been clicked  (#4900)

* mouse release in userwindow focus on main command line

* qobject_cast instead of dynamic_cast

* Bug fix make drag and drop trigger chains work again (#4901)

It seems the replacement for obsolete code I made in #4461 was
incomplete as I had missed off a defaulted but in our case required
argument to:
`[pure virtual] (QModelIndex) QAbstractItemModel::index(int, int,
                          const QModelIndex &parent = QModelIndex()) const`
in two places.

Thanks to @Edru2 for pointing this detail out and thus finding the fix!

Also polish this by adding some comments and eliminate several uses
of `goto` and as there is a chain of `if`s which each check one boolean
but only one of them should be true at a time it is worthwhile to make
all but the first of them `else if`s instead.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Syncronize list of clang-tidy checks (#4903)

* Update clangtidy-diff-analysis.yml

* Update .clang-tidy

* (autocommit) Updated text for translation (#4904)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* (autocommit) Updated IRE mapping script to latest upstream (#4905)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* (autocommit) Updated autocompletion data (#4907)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* Bump 3rdparty/qtkeychain from `f719ccd` to `a25443a` (#4908)

Bumps [3rdparty/qtkeychain](https://github.com/Mudlet/qtkeychain) from `f719ccd` to `a25443a`.
- [Release notes](https://github.com/Mudlet/qtkeychain/releases)
- [Commits](https://github.com/Mudlet/qtkeychain/compare/f719ccdfbaca805cd0fca1d69b84184d98645911...a25443a5c6ec70bd8db78d1c68b0886c780ea3a9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Disable few more clang-tidy checks (#4909)

* Use a normal cursor in view mode & a closed cursor on drag (#4914)

* Automatically set the key name, just like aliases (#4911)

* Rename Exit to Quit Mudlet (#4919)

* (autocommit) Updated text for translation (#4930)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* Restore default black colour for labels (#4927)

* Clear console selection if cmd line changes selection (#4923)

* clear console selection if cmd line changes selection

* clang tidy suggestion

* Use a better default color for labels (#4935)

* Use a better default for labels

* Update TMainConsole.cpp

* New Crowdin updates (#4888)

* fix labels losing colour if stylesheet without colour informations is set on label (#4948)

* Inverted check for special exit lock when looking for useable exits at start of path. (#4949)

* Fix hecho eating characters (#4934)

* Revert mpMainFrame palettes (Hotfix) (#4950)

* revert to use palettes

* conflicts

* Update TConsole.h

* Update TConsole.h

* stylesheets bg color for sub command lines

* Don't copy timestamps in normal copy (#4959)

* Update development to 4.11.1 (#4944)

* Add StickMUD to IRE Mapper script includes (#4951)

* BugFix: restore selection highlight when Cntr or TimeStamp click done (#4968)

This will close #4961.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Disable clang-tidy check about nonprivate members (#4969)

* Disable clang-tidy check about nonprivate members

* Update .clang-tidy

* BugFix: properly dispose of editor when profile closed when multiplaying (#4954)

I found whilst running Mudlet in GammaRay and opening/closing profiles
that the `dlgTriggerEditor` instance used for each active profile's
editor was not being destroyed when that profile was closed from the close
button on it's tab in the tab bar...

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Update getConnectionInfo() to mention if you're connected (#4943)

* order of setting the mpMainFrame palette seems to cause transparent miniconsoles to be white (#4971)

* order seems to matter

* autofill background was duplicated

* Update killTriggers' error message to say ID, not name (#4932)

* Infrastructure: Update all automatic builds of Mudlet to latest Qt 5.15.2 (#4756)

* BugFix: prevent initial split view in TConsoles (#4953)

* BugFix: prevent initial split view in TConsoles

This was because the `(TTextEdit) TConsole::mLowerPane` was being shown
and then hidden by a one shot "run when idle" timer when there is no
need to AFAICT.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Fix Linux packaging (#4979)

* Skip unknown MXP elements (#4978)

* Update Windows install script (#4973)

* Ensure GCC 7 is available for Linux builds (#4983)

* BugFix: prevent flash on tab switch in multi-view (#4952)

If we are showing all the profiles at the same time then hiding the current
one does not make sense when in multi-view mode...!

This will close #4792.

Revised to try and reduce comments in PR:

I'd like to leave some of them in place because there is some aspects that
are not blindingly obvious to the casual view. Also there is some code who
presence is not entirely clear to be needed to me - until someone can work
if it has to be there then it is probably okay to leave notes about what I
have worked out around it for whoever wants to do the further
investigation.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>

* Enhance: allow profiles to be reordered when multi-playing (#4976)

This implements a requested feature to allow the tabs on the tab bar to
reordered and the profiles displayed underneath when multi-playing will
follow suite. This not being done previously was why I had to lock the
tab bar because at that time the tabs could move but the profiles did not!

Also remove unused function that is impacted by this PR - I knew there
was a reason why I had removed it - but neglected to include that in the
original commit.

Also update some of my Copyright lines.

Revised to remove `static const TMainConsole::scmProperty_HostName`
introduced in an earlier commit for this PR:

Given that we only use *this* instance of the `const char "HostNme"` in
THREE places in THREE separate files it was felt not to be worthwhile
abstracting it to an explicit `const` value and just to use the raw literal
where needed. As it happens the same text is used elsewhere for the same
purpose (identifying the related profile in a Qt rather than a Mudlet class
instance) there might be a more optimum way to do this in a common
universally used (maybe even pre-compiled) header file.

However that can be left for a separate PR if it is thought worthwhile...

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>

* Update -dev to 4.11.2 (#4992)

* Fix broken perm* functions (#5004)

* Package exporter ui rework + metainfo for packages in config.lua (#4885)

* Prevent code running twice on setScript and resetProfile (#5006)

* Fix crash with getMapLabels() when used on invalid area (#5014)

* Don't deselect text if typing in command line (#4991)

* (autocommit) Updated IRE mapping script to latest upstream (#4988)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* (autocommit) Updated autocompletion data (#4989)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* Generic mapper unsubscribe to events upon uninstall  (#5018)

* (autocommit) Updated text for translation (#5025)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* Fix icon anti-aliasing + icon copy in new package exporter (#5028)

* Don't translate the + in package exporter (#5031)

* Bump 3rdparty/qtkeychain from `f719ccd` to `a25443a` (#5039)

Bumps [3rdparty/qtkeychain](https://github.com/Mudlet/qtkeychain) from `f719ccd` to `a25443a`.
- [Release notes](https://github.com/Mudlet/qtkeychain/releases)
- [Commits](https://github.com/Mudlet/qtkeychain/compare/f719ccdfbaca805cd0fca1d69b84184d98645911...a25443a5c6ec70bd8db78d1c68b0886c780ea3a9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Correct syntax error in versions.lua (#5040)

* Avoid crash caused by mssp eventhandler (#5010)

* avoid crash if mssp eventhandler is set

* Update qtkeychain

* Move comment to better place

Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>

* Only check C++ changes if C++ files were actually updated (#5043)

* New Crowdin updates (#4977)

* Fix generic mapper update notifications (#5050)

* Fix mapper update notifications

* Update generic_mapper.xml

* Update versions.lua

* Add icon size recommendation (#5032)

* Actually show 512x512 recommendation text to package exporter (#5055)

* Add missing 512x512 recommended text

* Improve tooltip

* BugFix: repair borked searchAreaUserData in with both key and value case (#5019)

This was introduced by my PR #3705 on 2020/05/01.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Enhance: show profile indication in central debug console output (#4781)

This PR adds a single character inside `[`...`]` to the beginning of
(nearly) all texts displayed on the Central Debug Console which is made
unique for each session of a profile run in a Mudlet application run.
This marking (except for messages not from a particular profile) is not
displayed when there is only one profile - and the start and end (and
a change of name) of each profile is noted and a revised listing of the
symbol used for each active profile is shown each time it changes.

To do this the previous dummy `>> 0` used at the end of a `TDebug()`
message creation has been changed to instead take a pointer to a profile's
`host` instance - from which the profile name is extracted. To allow for
multi-coloured messages to be concatenated, inserting a
`(QChar) TDebug::csmContinue` element at the start of a new `TDebug` text
will cause it to be appended onto the end of a previous `TDebug` text
without acquiring the profile indication marking.

Messages that are generated with a `nullptr` as the Host pointer are
expected to be messages from the Mudlet Application rather than a
particular profile and they will always be marked with a `[*]`.

When multi-playing closing a profile and reopening it again will cause a
new identifier to the used for the subsequent run - so it can be seen
which run any messages are from.

The current design uses identifiers from the sequence: 'A' to 'Z' - after that
set of 26 marks are exhausted then all subsequent profile runs in that
Mudlet application run reused the same letters as they were freed up
by that profile being closed. In the pathological case of some user
trying to run 27 profiles at a time then the excess will be shown with a '?'.
it would be possible to extend the sequence but as the Central Debug
console is intended to help with debugging it is not expected for the
finite number of identifiers to be a serious limitation!

This will close #804 (originally a LaunchPad issue:
https://bugs.launchpad.net/mudlet/+bug/1658271 )!

Also:
* simplify some Lua handling of boolean returns and conditions based upon
an integer value.
* in `TTrigger::match(...)` use `QStringList::at(...)` in some places where
it is faster/safer than `QStringList::operator[]()`.
* Remove a rogue line-feed prior to a:
"LUA: code compiled without errors. OK"
message which was making it more spammy than it needed to be.

Note that `(bool) TLuaInterpreter::compileScript(const QString&)` has been
found to be unused so has been removed from the codebase.

Enhanced to also add tags to tab bar as well as CDC when the latter
is visible - this will help the user to track the displayed messages to
the appropriate tab without having to look for the messages shown
when two or more profiles are active and a new one is loaded or
when three or more profiles are active and one of them is closed.

Revised to use a different symbol (heavy asterix) instead of a plain one

This is for non-profile specific messages and sits better on the text line
and is bigger/heavier than a standard (ASCII) Asterix symbol.

Revised as CodeFactor wanted the `TTabBar` constructor with a single
`Host*` argument to be marked `explicit`.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>

* (autocommit) Updated autocompletion data (#5038)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* Add file watches apis and event (#4942)

* add filewatches api

* simplify api names

Co-authored-by: Piotr Wilczynski <piotr.wilczynski@bisnode.com>

* Update about info for Chris (#5060)

* Enhance: add GNU/Hurd as a supported OS (#5020)

Just a few days early for April 1st!

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Fix nonsense message for when there's no rooms in the map (#5023)

* Removes deprecated, unused code and fixes tests in TMxpParserTest (#4893)

- TMxpParserTest was testing functions that are never called and not testing the actual running code for some cases
- This commit changes the TMxpTagParser interface, unused functions and updates TMxpParserTest to test the actual code

* Typo fixes (#5070)

* Update dlgTriggerEditor.cpp

* Update TRoomDB.cpp

* Update TRoomDB.cpp

* Update dlgProfilePreferences.cpp

* Update dlgAboutDialog.cpp

* Update TTextEdit.cpp

* Update dlgColorTrigger.cpp

* Update profile_preferences.ui

* Update TTextEdit.cpp

* Update timers_main_area.ui

* Update triggers_main_area.ui

* Update dlgProfilePreferences.cpp

* Update dlgProfilePreferences.cpp

* Update scripts_main_area.ui

* Fix Mudlet crash if profile folder didn't match with profile name (#5049)

* BugFix: prevent crash on profile loading (#5072)

Not entirely sure of the mechanism that introduced this issue. However
it seems that my #4976 was too optimistic about when:
`(void) Host::setName(const QString&)` was to be used and did not
guard sufficiently against a `Host` instance not having it's `TMainConsole`
instantiated yet.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Revert "Fix Mudlet crash if profile folder didn't match with profile name (#5049)" (#5077)

This reverts commit 368f6c72a5feabe5c3192b9248d05ecb20eeca37.

* BugFix: improve parsing areas in XML map files (#5063)

The exact mechanism leading to the issue seems a little odd as it hasn't
manifested before. However this should close #5029 by preventing an area
being created unless a valid "id" attribute has been read from the <area>
element - which can't happen for a bogus one.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* BugFix: S. Exits not staying locked when loaded from current file formats (#5073)

A coding error meant the current file formats that retained the previous
storage of the special exit lock status as a `1` or `0` prefix on the
name/command for the special exit was not being corrected inserted into the
recently added separate container to store the lock status of special
exits - this meant they were effectively lost.

This will close #4999.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Fix alignment of labels in package exporter (#5045)

* Fix alignment of package exporter

* Replace icon with a label

* Fix macOS / Ubuntu CMake builds (#5078)

* Remove bad cmake flag to fix recent CMake compile

* Update build-mudlet.yml

* Update build-mudlet.yml

* Revert to pre Qt 5.15.2 (#5042)

* Restore CodeQL scans (#5068)

* Show an error if an asset file goes missing during package export (#5053)

* New Crowdin updates (#5057)

* New translations mudlet.ts (Chinese Simplified)

* New translations mudlet.ts (Chinese Simplified)

* New translations mudlet.ts (Chinese Simplified)

* New translations mudlet.ts (Chinese Simplified)

* New translations mudlet.ts (Chinese Simplified)

* Fix CodeQL builds (#5085)

* (autocommit) Updated text for translation (#5087)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* (autocommit) Updated autocompletion data (#5089)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* Bump 3rdparty/qtkeychain from `a25443a` to `324a35c` (#5090)

Bumps [3rdparty/qtkeychain](https://github.com/Mudlet/qtkeychain) from `a25443a` to `324a35c`.
- [Release notes](https://github.com/Mudlet/qtkeychain/releases)
- [Commits](https://github.com/Mudlet/qtkeychain/compare/a25443a5c6ec70bd8db78d1c68b0886c780ea3a9...324a35c4334b0b535782e1e156cc034742fd6272)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* BugFix: improve handling of non-map and too new files in profile's map dir (#5071)

This is an **alternative** to #5022 - and *one* of them will be needed so
that #5016 is safe - though, TBH I do not think that the latter should be
dumping JSON format files into a folder which we had previously reserved
for binary map save files!

This will also close #4275 by checking for the map version number (the
first four bytes of the file) being between 1 and 127 and rejecting it if
that test is not met.

Revised to keep GHA Clang-tidy appeased by initialising some variables
that are immediately assigned a value in the next lines following them!

Revised to include JSON maps files as ones to try and load, had to add
something so that the (error) texts returned by
`TMap::readJsonMapFile(...)` are translated when used as part of error
messages on the main console.

It does mean that the user can abort the import of a (large) JSON map
file. Personally I'd have preferred to keep the UI more uniform for both
binary and JSON map file loading but it seems from the peer-review
that it was preferred to be able to abort the load. This will, I think, trigger
some no-map code if the user does abort the loading of a JSON file...

Revised to prevent double auditing of map when loaded from JSON file

Revised to remove iteration though potential map files so reverted to
only consider the *newest* file that *could* be a map file.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* BugFix: correct typo in OS indentifier maco define (#5091)

I have got new glasses since I did this originally!

Also use a more explicit `int64_t` instead of `long` for the GNU/Hurd case.
This will reduce the GHA Clang-Tidy moaning.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* allow drag and drop and copy/paste of images onto package description in package exporter (#5058)

* allow drag and drop of images onto description

* return true got lost

* copy packagePath/.mudlet

* allow copy/paste of images

* codefactor

* Update dlgPackageExporter.h

* didn't compile

* disable copy_move

* allow insert on cursor position if copy/paste

if image is inserted with copy paste it will be insert at the cursor position, drag and drop images will always be inserted at the end.
Images won't be duplicated anymore

* image names as placeholder + svg support

* clearer comment

* Update placeholder to mention markdown and dnd support

Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>

* Prevent multiple resize event if size didn't change (#5009)

* Align saveJsonMap with saveMap() (#5016)

* Overhaul package manager (#4938)

* Prevent multiple resize event if size didn't change (second attempt) (#5104)

* prevent multiple resize event

* resizing in userwindows didn't work

have to change method as resizing in userwindows didn't work with the previous method

* suggestions

* Update qtkeychain

* fix for issue with command line resize

* preventLuaEvent was duplicated

* Improve Windows update error messages (#5098)

* BugFix:_restore editor auto-completer to wait for several characters (#5092)

Rick (upstream maintainer of edbee-lib) adopted our idea of making the
editor auto-completer not react until a minimum number of characters has
been entered. However he, not unreasonably made it a configurable option.

In doing so he obviously removed our hard coded value of 3 but since we
were not aware of this the setting was being left at the default of 0. This
commit puts our wanted setting back in.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Fix clicking on line # does to take focus in edbee (#5100)

* Update Windows CI build to libzip 1.7.3, which supports cancellation (#5101)

* (autocommit) Updated text for translation (#5116)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* Fix aborting package downloads to work (#4259)

* Implement aborting downloads

* Cancel correctly

* Add const

* Hook up slot correctly

* Don't try to install package if cancelled

* Coverity: fix issue registered as CID 1415094 (#5127)

This `QComboBox` was added by #4718 but due to subsequent revision it is no
longer needed and was not removed during those revisions.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Coverity: fix issue registered as CID 1503742 (#5126)

An (lack of) initialisation issue.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Fix miniconsole error message (#5122)

* Allow description to be resized in package exporter (#5112)

* Improve element naming

* Add first splitter

* Add 2nd splitter

* Fixup

* Coverity: fix issue registered as CID 1503731 (#5133)

A class member was local to a single method but it was not being
initialised. Made it back into a local.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Don't freeze Mudlet while exporting a package (#5052)

* Use unique ptr which won't leak memory when JSON map load is aborted (#5129)

* Coverity: fix issue registered as CID 1503737 (#5136)

I agree, the line concerned is useless code - my best guess is that the
call originally had a side effect - or my code once needed the update room
count, but it doesn't now.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Coverity: fix issue registered as CID 1503740 (#5135)

As it happens I do not think that execution *could* reach the point where
the change is made - but I guess it is better to be safe than to
dereference a null pointer...

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Coverity: fix issue registered as CID 1503729 (#5128)

It seems like there was no check for a valid TArea pointer in
`TLuaInterpreter::getMapLabel(...)` - in fact it also means that there
was no error being handled for a positive but missing area's Id number.
This would result in a nullptr being dereferenced which is a significant
(seg. faulting, i.e. fatal to the application) issue!

Looking more closely I can see that in (my) PR #4604 a couple of months
back I put a `QMap` container into every area so that all of them may
contain map labels, whereas the prior code held all the QMaps in another
centralised QMap and the prior code checked for a container for an area
when a label was sought - my revised design was what introduced this
regression.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Coverity: fix issue registered as CID 1415026 (x6 ?) (#5146)

In - it seems 6 places we allocate values to a `TExit` (class is in same
file as `dlgRoomExit` class) without checking that the `TExit` was `new`ed
correctly and stored into a container class. This PR addresses that by
checking (with a `Q_ASSERT_X`) that the item was instantiated and avoids
the perceived risk of the container that would be used to hold it not
having it (and thus returning a `nullptr` instead) and also by working with
the tested pointer directly. The container has the item added at the end of
the section of code concerned.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Docker development support (#5047)

* Cleanup

* Fix settings for linux override

* Fix debug mode

* Commit env template

* Reduce default core count

* Build from cmake instead of pro file

* Enhance: extend getOS() function to include version information (#5155)

This extra information is enough to enable Lua scripts to distinguish
between Windows 10 and Windows 7 (the original intention) but during
I found that returning a version number as a second return value is not
itself helpful for GNU/Linux distributions - e.g. for my main Devuan box
it produced the value "3" (for Devaun Stable or 3.0 "Beowuld") so for
Linux only this was extended even further to include the "product name"
(typically a string relating to the "Distribution") as a third return
value.

Note that the Qt functions/macros used are not sufficient (AFAICT) to
report the precise version/build for Windows 10 - which sadly was wanted by
one person concerned about gaining this information somehow.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Coverity: fix issue registered as CID 1414989 (x10 ?) (#5145)

Technically we are storing a pointer in a QMap/QHash type container so as
well as checking that there is an entry for the particular key we also
should check that the stored key is non-null before we use it in further
checks.

Whilst we could do this by converting the existing:
`if (originalExits.contains(dirCode)
     && originalExits.value(dirCode)->destination > 0) {`
to be:
`if (originalExits.contains(dirCode)
     && originalExits.value(dirCode)
     && originalExits.value(dirCode)->destination > 0) {`
we can just as well rely on the QMap/QHash::value() method to return a
default constructed (i.e. `nullptr`) if the key provided is not found:
`if (originalExits.value(dirCode)
     && originalExits.value(dirCode)->destination > 0) {`

Further inspection shows that a more compact modification for the LAST exit
being considered in that chunk of code (the one not in the 11 instances
picked up by Coverity) has already been done so it can be applied to these
as well (with a renaming of the local variable from `exit` to `pExit`)!
`auto pExit = originalExits.value(dirCode);
 if (pExit && pExit->destination > 0) {`

It also seems that the same issue is also present in 12 cases in a higher
`if` that contains each of the 11 (or 12) pieces of code in this issue.

This commit should silence this warning in this file but I think it also
appears in other parts of our code (we store a pointer in a container and
check for the presence of the pointer but not that it is not a null one
before trying to dereference it)...

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Revise: some changes to Server GUI downloader handling (CID 1478854) (#5147)

Initially this was going to address Coverity CID 1478854 - like Vadi's
PR #5130. However I spotted some improvements that could be made as well:
* rename `(void) cTelnet::replyFinished(QNetworkReply*)` to
`(void) cTelnet::slot_replyFinished(QNetworkReply*)` as it *is* a SLOT.
* rename `(QNetworkReply*) cTelnet::packageDownloadReply` to
`(QNetworkReply*) mpPackageDownloadReply`
* check that the argument passed to the slot method matches the one that is
expected (issues a warning if it doesn't)
* clean up the argument supplied to the slot method in ALL cases.
* reset the stored `QNetworkReply` point to a `nullptr` upon success (and
thus returns it to the state it now has on class creation.

Revised warning message to give better context.

Signed-off by: Stephen Lyons <slysven@virginmedia.com>
Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>

* Only build for Coverity in Travis (#5158)

* Repair getMapMenus (#5121)

* Switch to Qt 5.14.2 for all CI builds (#5102)

* Don't set the tabs / main buttons font to a monospace one (#5153)

* Coverity: fix issue registered as CID 1503735 (#5144)

If `room` (renamed to `pRoom`) is null in:
`(void) T2DMap::paintMapInfo(const QElapsedTimer&, QPainter&, const int,
QColor&)`
then there is no way we can call `pRoom->getArea()` when we iterate through
all the map information contributors - as it happens we are not likely to
get here as the `paintEvent()` will abort and print the message about there
being no map or not knowing where the player is...

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Update actions/cache requirement to v2.1.5 (#5174)

Updates the requirements on [actions/cache](https://github.com/actions/cache) to permit the latest version.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/commits/1a9e2138d905efd099035b49d8b7a3888c653ca8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump 3rdparty/qtkeychain from `324a35c` to `41af102` (#5173)

Bumps [3rdparty/qtkeychain](https://github.com/Mudlet/qtkeychain) from `324a35c` to `41af102`.
- [Release notes](https://github.com/Mudlet/qtkeychain/releases)
- [Commits](https://github.com/Mudlet/qtkeychain/compare/324a35c4334b0b535782e1e156cc034742fd6272...41af1025dda5ec7587e2ecc8ba69387d60e403dc)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* (autocommit) Updated text for translation (#5170)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* (autocommit) Updated IRE mapping script to latest upstream (#5171)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* Fix description updates to take effect (#5180)

* More resilient libhunspell detection for qmake (#5161)

* Add debug information to Linux updates as well (#4917)

* Add debug info to PTB process

* change update channel to testing

* Revert "change update channel to testing"

This reverts commit 2928c890d1c776d5f609692f2a70d2ce5109c08d.

* Fix image updates not taking effect (#5179)

* Hide details when the last package is removed (#5178)

* Add tests for variable interface (#5141)

* Cleanup

* Fix settings for linux override

* Fix debug mode

* Commit env template

* Reduce default core count

* Some initial work on lua interface tests

* Fix lua tests

* Fix import in lua interface

* Fix lua state reference

* Fix tests

* Validate var name is correct

* Update includes

* Some lint fixes

* Remove unused code

* Add copyright bit

* lint fix

* nolint

* Fix typo in zip error message (#5176)

* Improve some texts for translations (#5186)

* Remove path/filename from translations

* "Remove packages" as plural

* untangle texts, settle "format version"

* Split more texts

* get rid of double "this"

* Coverity: fix issue registered as CID 1503742 - again! (#5134)

Somehow the same CID code has been reused by Coverity for another lack of
initialisation issue in the same class.

To try and fix this I have overhauled all the members that might need
initialisation to have it and moved that initialisation to the header file.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Coverity: fix issue registered as CID 1503736 (#5137)

The original moan was about a check for the `(TMap*) T2DMap::mpMap` member
being a nullptr when it had already been dereferenced several (many) times
before in the same method:
`(void) T2DMap::mouseDoubleClickEvent(QMouseEvent*)`
to correct this I moved the test to the top of method - and I spotted that
some of the related methods had a similar check and others did not. So
I put a similar check in all of them.

Then studying the code more closely I spotted that the class had both a
`(QPointer<Host>) T2DMap::mpHost` and a `(TMap*) T2DMap::mpMap` yet in
quite a few places was using the pointed to class instances own pointer to
the other class instance. This looks to be doing unnecessary indirection
so I have changed them to use this own class's member values as the
pointers instead. Indeed in a further case involving I think some update
code copy-pasted from elsewhere I found some indirection that would in fact
resolve to point to the class `T2Map` instance directly!

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Finish replaceLine and related functions (#5115)

* Make replaceLine and creplaceLine handle optional window argument, add dreplaceLine and hreplaceLine, and add functions to handle them to Geyser.MiniConsole
* Fix indentation

* (autocommit) Updated text for translation (#5192)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* Bump ZedThree/clang-tidy-review from v0.6.0 to v0.6.1 (#5194)

Bumps [ZedThree/clang-tidy-review](https://github.com/ZedThree/clang-tidy-review) from v0.6.0 to v0.6.1.
- [Release notes](https://github.com/ZedThree/clang-tidy-review/releases)
- [Commits](https://github.com/ZedThree/clang-tidy-review/compare/v0.6.0...3677b43f8b1d3f43441c26ebaf43a08a4cfce417)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Allow variable creation without initial selection (#5183)

* Allow variable creation without initial selection

* Handle seg fault when cItem is not defined

* Add translation wrapper and remove un-necessary parent check

* New Crowdin updates (#5086)

* Avoid top folder duplicate if exporting existing package (#5044)

* deselect empty top folder to avoid duplication

* use right click on item to check item without inheritance of check state

* Update src/dlgPackageExporter.cpp

Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>

* Bump PTB builds to 4.11.3 (#5202)

* (autocommit) Updated text for translation (#5203)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* (autocommit) Updated autocompletion data (#5205)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* Actually disable widechar_width updates (#5197)

* Actually disable widechar_width updates

* Update .github/workflows/update-3rdparty.yml

* Fix --quiet command line parameter (#5209)

* (autocommit) Updated text for translation (#5211)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* Bump ZedThree/clang-tidy-review from v0.6.1 to v0.7.0 (#5212)

Bumps [ZedThree/clang-tidy-review](https://github.com/ZedThree/clang-tidy-review) from v0.6.1 to v0.7.0.
- [Release notes](https://github.com/ZedThree/clang-tidy-review/releases)
- [Commits](https://github.com/ZedThree/clang-tidy-review/compare/v0.6.1...f936872efe021c26f30ee25cf35aa659dd7a931f)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix Ubuntu 16.04 builds (add php ppa for libzip-dev) (#5214)

* Update build-mudlet.yml

* Fix trailing spaces

* Run builds on the 'main' branch as well (#5215)

* Fix assets to expand fully as well (#5187)

* Update generic_mapper.xml (#5189)

changes find_me's table.contains to table.index_of to prevent erroneous matches when in rooms with its id matching-or-less than number of valid room names

* Remove unused description images from packages (#5208)

* Minor cleanup

* Cleanup unused description images

* Fix warning

* Commit header as well

* Fix loadMap() to work again (#5210)

* Add paths-ignore (#5225)

* Add paths-ignore

* Add a workflow_dispatch target for codeql

This will allow you to trigger analyses on demand.

* Bump pat-s/always-upload-cache from 2.1.3 to 2.1.5 (#5228)

Bumps [pat-s/always-upload-cache](https://github.com/pat-s/always-upload-cache) from 2.1.3 to 2.1.5.
- [Release notes](https://github.com/pat-s/always-upload-cache/releases)
- [Commits](https://github.com/pat-s/always-upload-cache/compare/v2.1.3...v2.1.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Improve position of mapper right-click menu (#5230)

* Gather common commands after spaghetti

* Unified naming

* New Crowdin updates (#5207)

* Only show relevant actions in mapper's right-click menu (#5231)

* move add closer to define action

* straighten if-clauses

* restore order

* store result of size()

* indent by 4

* Mostly display actions during selection

* Drop disabled action

* No viewing mode during selection

* Apply experimental labels to package manager and exporter consistently (#5226)

* Apply experimental labels to package manager and exporter consistently

* Shorten name

* (autocommit) Updated text for translation (#5236)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* Fix error shown for map load on new profiles (#5177)

* Fix error shown for map load on new profiles

* Fix logic error - new profiles + login should show mmp map

* Peer review

* Provide initial value for pParent (#5199)

* Bump actions/cache from 2.1.5 to 2.1.6 (#5244)

Bumps [actions/cache](https://github.com/actions/cache) from 2.1.5 to 2.1.6.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2.1.5...v2.1.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* GUIUtils.lua-Change-green-to-match-default-green (#5233)

When using ansi2decho, the dark green is lighter than the normal/default dark green in preferences. This should do it.

* Backport fixes made to release process for 4.11 (#5258)

* BugFix: repair loss of custom profile icons (#5256)

This should close #5248 which looks to have been introduced by my #3948
from last July. It failed to accommodate the custom icon code from a couple
of years ago done by #2814.

Basically the problem was that I removed storage of the profile name from
the "display text" for the `QTreeWidgetItem`s in the profile connection
dialogue. It was moved to a UserRole stored in the item's data area so that
it was stored but not shown under the item and just showed the icon.
However the custom icon code was still looking at the item's `text()` which
now, of course, is empty!

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* New Crowdin updates (#5237)

* New translations mudlet.ts (Russian)

* New translations mudlet.ts (French)

* New translations mudlet.ts (Spanish)

* New translations mudlet.ts (German)

* New translations mudlet.ts (Greek)

* New translations mudlet.ts (Italian)

* New translations mudlet.ts (Dutch)

* New translations mudlet.ts (Polish)

* New translations mudlet.ts (Portuguese)

* New translations mudlet.ts (Turkish)

* New translations mudlet.ts (Chinese Simplified)

* New translations mudlet.ts (Chinese Traditional)

* New translations mudlet.ts (Portuguese, Brazilian)

* New translations mudlet.ts (English, United Kingdom)

* New translations mudlet.ts (Pirate English)

* New translations mudlet.ts (Russian)

* New translations mudlet.ts (Italian)

* New translations mudlet.ts (English, United Kingdom)

* New translations mudlet.ts (English, United Kingdom)

* New translations mudlet.ts (German)

* (autocommit) Updated autocompletion data (#5259)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* Re-do windeployqt fixes for Qt 5.14.2 (#5260)

* Change "southeastst" to "southeast" (#5267)

Fix 2 typos in JSON map export

Closes #5265.

Signed-off by: Stephen Lyons <slysven@virginmedia.com>

Authored by: atari2600tim <29287358+atari2600tim@users.noreply.github.com>

* (autocommit) Updated autocompletion data (#5271)

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* New translations mudlet.ts (Polish) (#5269)

* Update development with 4.12.0 release info (#5266)

* Update development with 4.12.0 release

* Re-instate -dev

* Update Ubuntu builds to 18.04 (#5282)

Ubuntu 16.04 is EOL and breaks for building.

* Update autocompletion data in Mudlet (#5283)

* (autocommit) Updated autocompletion data

* (autocommit) Updated autocompletion data

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* Added mouse menu actions to windows. (#5279)

* Added shortcuts to navigate editor between triggers, aliases, etc. (#5280)

* Refactor the shortcut adjustments out
- not sure why the action text has no tr() anymore but it still works..!

* Join Functions, If to Switch, Shortcut indirection
- removing "unset" function in lieu of an optional bool parameter in "set"
- reworking if/else cascade into a nice switch for readability
- even more readabily: drop much repeated code & set shortcut once at the end

* Revert shortcut indirection
- This could otherwise drop shortcuts from ALL taskbar items. While this seems fair for now, it could have unintended consequences later. So stay as is for now.

* Also use setShortcuts during toolbar creation

* Define toolbar2 items in order of display

* Mention new shortcuts in tool-tips

* Mention new shortcuts in tool-tips

* Finally set toolbar2 shortcuts

* Add header data

* Add header data

* Undo switch, c++ can't handle strings

* Stupid ;

* Forgot ) as well

* tr() necessary after all

* move comment before function

* inverse logic

* typo

* use inversed logic

* Enhance: improve line-breaking in Command Line (#5288)

This was suggested by the Discord User Kaylee#0064 in the
mudlet-development channel on 2021/06/11T18:56Z.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Fix: newly created profiles will remember their connection info (#5245)

* Update text for translation in Crowdin (#5296)

* (autocommit) Updated text for translation

Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>

* Bump actions/setup-node from 2.1.5 to 2.2.0 (#5302)

Bumps [actions/setup-node](https://github.com/actions/setup-node) from 2.1.5 to 2.2.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v2.1.5...v2.2.0)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* BugFix: correct some misquoting in some PowerShell CI scripts

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* BugFix: workaround MSYS2/Mingw-w64 Luarocks issue 9037

The new packages (3.5.0-1) are borked so we need to use the previous
version (2.4.4-2).

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* BugFix: add needed --noconfirm option to pacman step

... otherwise the process hangs waiting for a y/n response!

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Revise: add further project files to qmake project file

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

* Revert: undo stuff used to bodge a Window PTB build during development

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: mudlet-machine-account <mudlet-machine-account@users.noreply.github.com>
Co-authored-by: Manuel Wegmann <60551052+Edru2@users.noreply.github.com>
Co-authored-by: Piotr <delwing@gmail.com>
Co-authored-by: Piotr Wilczynski <piotr.wilczynski@bisnode.com>
Co-authored-by: Damian Monogue <demonnic@gmail.com>
Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>
Co-authored-by: Kebap <kebap_spam@gmx.net>
Co-authored-by: mudlet-machine-account <39947211+mudlet-machine-account@users.noreply.github.com>
Co-authored-by: Mike Conley <sousesider@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kamil Tunkiewicz <ktunkiewicz@currencyfair.com>
Co-authored-by: Kamil Tunkiewicz <kamiltunkiewicz@currencyfair.com>
Co-authored-by: Andrew Waters <kaeus3@gmail.com>
Co-authored-by: atari2600tim <29287358+atari2600tim@users.noreply.github.com>
Co-authored-by: Chris Mitchell <chris.mit7@gmail.com>
Co-authored-by: Gustavo Sousa <gustavocms@gmail.com>
Co-authored-by: Damian Monog…
Chris7 pushed a commit to Chris7/Mudlet that referenced this pull request Jan 2, 2022
This actually makes management of map labels a lot simpler.

I also need this to be in place for my JSON map file export/importer
PR Mudlet#4546.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Chris7 pushed a commit to Chris7/Mudlet that referenced this pull request Jan 2, 2022
This is so that a crowd sourced map might be edited in a collaborative
manner. The first stage is to make sufficient of the entire map details
be exported/imported in a modular (by area) fashion.

Include Lua functions `exportJsonMap(pathFileName)` and
`importJsonMap(pathFileName)` to perform the whole map export and
import functions.

Also, rename `(QMultiMap<int, QPair<int, int>>) TArea::exits` to:
`TArea::mAreaExits` because the old name was such a common word in our
source code it was hard to find the uses of this member.

This format has been constructed so as to not mention the most common, or
default values for some items - so as to minimise details that have to be
included on the basis they can be assumed when reconstructing them on the
other end.

On the other hand the whole file is compressible so for storage (but not for
diff/git work) archiving / compressing the file is recommended! For
instance a binary map file I have is 18.6MB which produced a 25.8MB JSON
file which I was able to compress down to 2.9MB - obviously this is *very*
content dependent, so other's Miles-May-Vary...

As the export process is not that fast include a progress dialogue that
shows how many areas, map labels and rooms have been processed into the
JSON format. For a 20K room map with 40 odd areas and around 800 map labels
(which are awkward to convert to a text-like form) this can take 30
seconds on my 1.8GHz 4 Core PC!

CodeFactor had a recommendation about a constant that I was using to
set the dimension of a `char[]` (array) - it felt a compile time `constexpr` was
a better thing to use.

Revised to make Cancel button work in big areas:

Although the existing code would abort at the end of an area, for some
humongous maps with a few very large areas it is also a good idea to check
for the cancel button being pressed each time the progress bar is updated.

Renamed `(QMap<int, int>) TMap::envColors` to `TMap::mEnvColors`
and `(QMap<int, QColor>) Tmap::customEnvColors` to `TMap::mCustomEnvColors`
so that it is clearer that they are members of the `TMap` class.

Add alpha component to end of list of (now four) 0 to 255 integer values
returned by `getCustomEnvColorTable()` - as the corresponding setter does
allow one to be provided.

Move initialisers for TMap, TRoomDB, TRoom and TArea to header file where
possible. As per Issue Mudlet#4578.

Move the default and unnamed area names from TRoomDB to TMap - as it made
setting them up easier (though one of them does need to be initialised
before the normal TRoomDB instance associated with the TMap is itself
initialised. This meant putting these private members near the top of the
header file even though we normally put private ones down the bottom.

Refactor: move JSON colour writing/reading code from TArea/TRoom to TMap

The code is common to all three classes so can be shared. At the same time
make it explicit in the key as to whether there is an alpha component so
the colour is a 24Bit opaque one or a 32Bit one with transparency.

Revise: peer-review items and other tweaks

Note that this revises the format version to be 1.000 (ready for release)
so, although the format has not changed, any recent files produced during
evaluation will need to be hand edited to change the line:
    "formatVersion": 0.003,
to:
    "formatVersion": 1.000,
in order to read them now.

Switch to "range based" for-loops for some of the JSON additions.

Fixup: ensure partially built new TRoomDB is destroyed if reading aborted

Not doing this would cause a resource leak if the abort button was clicked
during importation of a Json map file.

Revise: disable writing out Room highlighting details

It has been pointed out that the binary map format does not save the room
highlighting details either - so replicate that behaviour for the moment.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>
SlySven added a commit to SlySven/Mudlet that referenced this pull request Jan 25, 2022
This error was introduced in the original "load/save Maps as JSON" PR,
Mudlet#4546 ...!

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
SlySven added a commit to SlySven/Mudlet that referenced this pull request Jan 25, 2022
This error was introduced in the original "load/save Maps as JSON" PR,
Mudlet#4546 ...!

Also include a check for transparency - as a recent PR Mudlet#5783 added the
option for that to both the fore and background colours of map labels.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
vadi2 pushed a commit that referenced this pull request Jan 31, 2022
…in JSON map files (#5929)

This error was introduced in the original "load/save Maps as JSON" PR, #4546 ...!

Also include a check for transparency - as a recent PR #5873 (*Edited: not 5783!*) added the option for that to both the fore and background colours of map labels.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>

#### Release post highlight
Fix - prevent a corner case not saving the fore/background colour details for map labels correctly in JSON map files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants