Had to move a lot more code than expected.
Note that the entry for YAMG has an unwieldy label for some reason. This
doesn't really matter since YAMG will be removed in an upcoming commit.
- Add an internal command logger to the lua kernel base, and expose
this.
- Redirect the internal lua `print` to the command logger.
- Add an external logger registration system to lua kernel, in
addition to the internal one.
- Add a lua console dialog which binds to a lua kernel base and
permits to review the contents of the logger and issue new commands,
and report errors.
- Add a hotkey binding to launch the lua console "`"
- Adds tab completion support to the lua console
This commit also gives the smart enums in src/make_enum.hpp
introspective capabilities, by giving them a static const size_t
which tells how many possible values they may take (hence the range
of the enum.) It was convenient for the dialog implementation
to have this.
Note that, I had to make use of __attribute__((unused)) to compile
this. I apply this using a macro which adds it for gcc, clang, and
mingw which I know respond to this attribute. I don't know what is
the equivalent MSVC device, or if it is even necessary, so its
possible that this commit needs to be fixed up.
We also disable unit tests for the new advanced graphics dialog,
there are no tests for it right now...
This commit permits link_color to be specified in any label defn,
at the same place that link_aware is specified. It will be passed
through to tcanvas and finally font::ttext in a similar manner as
link awareness, and used for the color parameter in any link
formatting. We choose a default value of #ffff00 everywhere,
matching the definition currently in the help browser for cross-
references.
This adds a "link_aware" key to label definitions, and C++ tlabel
objects no longer initializer this to true, but instead read the
value from their definition configuration.
This commit adds a new property of font::ttext, whether it is
"link aware". Link aware text has tokens that look like hyperlinks
formatted thusly, with coloration and an underline.
A `get_link` function, taking a layout location, returns a link
token if it is pointed to at that location, and link awareness
is enabled, and the empty string otherwise.
All gui2::tcontrols may now have their text labels set to be link
aware if desired. The gui2::tlabel constructor automatically sets
these to be link aware. The gui2::tlabel click handler is set to
use the `get_link` function instead of the `get_token` function.
Link awareness is also registered as a property of [text] fields in
gui widget definitions.
The problem was that widget ids were being used in place of
preference ids, which are very similar but not exactly the same.
This commit fixes the bug, but goes further and changes all the
widget ids to match the preference ids, reducing the chance of
confusion in the future.
In this case, we deactivate all of the notification checkboxes,
and set all relevant preferences and checkboxes to false. We also
put a tooltip on the header for this column, saying "This build of
wesnoth doesn't support desktop notifications, contact your
package manager."
Era and mod selection is functional, as well as options to enable mp_configure and mp_create dialogs.
There is still an issue of realoading config. If you load multiplayer, then exit, then load campaign, there is no config reload, so the multiplayer eras/mods stay in config and are selectable. However, since state.classification().campaign_type is not set to multiplayer, when config is reloaded for a specific campaign, multiplayer won't be defined and therefore the selected era may no longer be available. So, we need some way to handle this case better. Also, it may be desirable to add a button to advanced settings which would change the campaign_type to multiplayer and reload (if we actually did want to load some mp era). Another potential option for this dialog could be IO type (to make the game networked, etc).
It allows the user to browse to the cache (using a desktop API call),
copy its path to clipboard, clean the cache contents (deleting stale
files), or purge it entirely.
This is ideal for people sticking to the same cache dir for very long
and thus keeping content that was generated by previous versions of
Wesnoth they might not even use anymore. Purging the cache might also
aid troubleshooting (although there is a --nocache switch for that too).
The dialog also makes Wesnoth slightly more transparent about its own
disk usage, information which may not be readily accessible to people
without the technical know-how to locate a hidden directory.
For now it's accessed by pushing a button in Preferences -> General,
even though this is not ideal since it is actually Advanced Preferences
material given the nature of the cache. Unfortunately, the Advanced
page's layout is currently monopolized by the advanced preferences
options and I'm not interested right now in solving that UI design
puzzle; it will have to wait, much like the Paths dialog has done and
continues to do for 1.12.
This replaces the page number slider with a "minimal" variant slider and
an adjacent label widget whose text we enter manually.
The label format is "<PAGE>/<COUNT>" and it's untranslatable. Hopefully
this shouldn't cause any localization issues since it's all numbers and
we currently can't use alternative numeral systems anyway.
I'm leaving the page slider's maximum_value_label attribute intact just
in case this needs to be reverted later, since it's going into the 1.12
branch too.
The default variant's text label is both inflexible in content (can't
customize the format for non-edge values) and layout (reserves way more
space than it needs at a time for its text label, often resulting in
huge horizontal gaps between a slider and an adjacent widget). This
makes it unsuitable for use in gui2::tchat_log.
This new minimal variant will be wired into gui2::tchat_log next.
This copies the current contents of the dialog to clipboard. The button
currently lacks a tooltip because the tooltip has the potential to cause
map labels to glitch through the dialog when displayed (see commit
eab3e6fb646fda8cc6101a3e568c86c2b17b707f and bug #22176).
This copies the contents of the main display area to clipboard. The
button currently lacks a tooltip because the tooltip causes map labels
to glitch through the dialog when displayed (noticeable in e.g. the test
scenario). I'll file a bug for this issue later using a (commented-out)
line introduced by this commit as a test case.