This removes the build-time dependencies on SDL_ttf and FriBidi,
alongside the SDL_ttf wrappers, the SDL_ttf text surface class, the
SDL_ttf render cache, and the SDL_ttf (de)initialization code.
This adds a minimal wrapper around pango_text intended for use in GUI1,
in particular for the help browser. Functionality is very incomplete
right now but for the time being we can render text, determine line
dimensions, and ellipsize text, which is almost the bare minimum needed
for porting the Help system (it's still missing a word wrapping
implementation).
The change to static_cast for the definition of LUAL_BUFFERSIZE replaces the fix previously used (d0100758f8) for Lua 5.3. 5.4 removes the static alternative for LUAL_BUFFERSIZE. A better solution would probably be to disable the old-style-cast warning for luaconf.h, but I can't figure out how to do that so using static_cast is the easiest solution. Do note that change will have to be applied each Lua update like the aforementioned commit.
Instead of having the preferences dialog make a copy of all advanced preference config objects (and sorting them)
every time you invoke it, this adds a new advanced_manager class instantiated once in game_launcher (not sure if
that's the best place for it, though) that parses and handles the options. Allows me to greatly clean up the
preferences dialog code.
This allows using full markup for the license text and making it
independently scrollable without messing up the dialog. It also enables
URL parsing in it.
This commit adds tools to test parsing of WML macros by the preprocessor
and parser. The commit also adds two tests of the #define and #undef
WML macro as examples.
The tests consist of three steps:
1. Define one WML string containing macros and one WML string
that lacks macros in each test. The two WML strings should be
equivalent after preprocessing.
2. Transform each WML string into a syntax tree (represented by config
objects) with the preprocessor and parser of Wesnoth.
3. Check if the two config objects are equal. Since the two WML strings
are equivalent, the two configs object should be equivalent if the
preprocessor and parsers are both correct.
The output of the preprocessor is in an undocumented format. Therefore,
this commit does not test the preprocessor as an isolated unit.
This also adds a few utility switches which people are probably already
familiarized with from the game proper. Most notably this means I don't
need to alter and recompile campaignd any time I want different logging
settings.
There's some functionality commented out in this commit while I figure
out how to wire it into the campaignd server class.
This includes all the Win32-specific code dealing with the retrieval of
the UTF-16 version of the command line and subsequent parsing into an
array of UTF-8 strings.
The latter code is unchanged except for the function names and one local
variable originally named `is_excaped` instead of `is_escaped`.
(Note to self: ask gfgtdf if he was aware of the existence of
CommandLineToArgvW() back when he wrote the Win32 command line retrieval
logic.)
Instead of creating lots of image::locators and calling a family of
similarly-named preferences functions, this refactor encapsulates that logic
and uses an enum.
The new orb_status files still need adding to the MacOS build.
An assert has been added to `unit_drawer`'s constructor. There are two callers
- the `display` class guards it with an explicit check before constructing
unit_drawer. The `game_display` class doesn't have an explicit check, but it's
clear that other code in that class assumes the teams are already valid (and
would crash if they weren't).
In source_lists/wesnoth, put the new files in alphabetical order.
This (as expected) fails to build on MacOS, just like the previous build.
It also fails to build with Clang on Linux, just like the previous build. That's
caused by src/scripting/push_check.hpp:89's unused parameter 'L', and is
also just like the previous build.
lua now has a widget userdata that can be used
to set/get widgets properties as one would
expect, a lot of the set/get_dialog_xy function
were converted into modifiable properties of
the widget userdata. This in particular allows
us to get rid of the strange 'path to widget'
type of arguments of gui2 functions.
It currently generates lot of compiler wanrings,
I will fix this in a later commit.
One of the main advantage is that it makes it
much easier to add new api, previously a lot
of functions where overused, probably because
that was just easier than creatign a new
function. For example set_dialog_value returned
multiple value of listbox objects. (the
compatibility path doesn't support this
particular feature yet but i don't think it is
important, it probably wasn't even used at all,
since it also wasn't documented).
This also adds some new features, like an 'add_item'
function to add an item to a listbox, a 'type'
property of widgets to query the type of a
widget and a 'item_count' property to count the
number of children in an item.
Im still not 100% sure about the
property /function names, in particular:
1) i might rename 'items' to 'elements' or
'children' in some functions. Not sure yet
2) I might rename the 'value' property to
'value_compat' to make clear that its only
supposed to be used by the
backwards_compat.lua code.
A next step in improving this api might be
to introduce a (reusable!) 'window' userdata
so that the implementaion of wesnoth.show_dialog
would become:
```
function wesnoth.show_dialog(wml, preshow, postshow)
local dialog = gui.create_dialog(wml)
preshow(dialog)
local res = dialog:show()
postshow(dialog)
return res
end
```
However this is currently not really possble
since the pure existance of a gui2::window
object blocks the gui1 code (the main game view)
from receiving events. So we clearly cannot luas
gc take ownership of gui2::window objects.
Reasoning being:
* The result_set and other APIs are nicer to use.
* We use mariadb on our server rather than mysql, so this would minimize the chance of any incompatibilities.
* The mysql C++ connector 1.1 isn't compatible with with c++17 (https://stackoverflow.com/q/47284705).
Rather than having everything in the MOTD, this adds a separate button that will popup a window which will have most of this information in two tabs:
* General server information, such as a link to the CoC.
* Announcements, such as tournaments and new versions being released.
The information on this new window will be stored in the new `server_config` database table.
The MOTD will then just be a short greeting instead of the several lines that are shown currently.
Additionally, now the motd will only be displayed in the lobby chat the first time the user logs on.
the game_config_view object offers const
access to the game_config object, furthermore
it allows the game_config config object to be
replaced by a vector of config objects which
is what we will do later.
We're going to be using NN scaling for the map, and that's already handled automatically
by SDL (and in the future, OGL). We don't need these settings for surface SCALED_TO_ZOOM
and SCALED_TO_HEX scaling. In any case, if we want to scale a surface to zoom or hex, it
will almost certainly be for map rendering (such scaling methods don't make sense in the
UI, for example), so just defaulting to NN is simplest.
This change drops the option to use Linear or xBRZ scaling for map zooming. This was already
the practical case due to me converting map rendering to use textures. NN was used for all
zoom levels, and it's fast and looks good.
This was never fully implemented and has been essentially abandoned. If we want to
add this again, we should look to adding full game controller support (Steam controller,
for example), though I don't know how suited this game is for controller support. As for
as I can tell, the only working part was ever map scrolling.
Includes a sqrt -> std::sqrt conversion I forgot in this file awhile back.
While I understand the reason it's here, it's been over a decade, no other user handlers have been added, and there's no indication any others will be added. Therefore, it doesn't seem like there's much of a reason to keep this code around.
ipv6 address must be specifid surrounded by [], like [ipv6_address]:port,
since otherwise impossible to disambiguate colons separating ipv6 quads
from the colon delimiting port
This was never finished, is not maintained, suffers from a lack of features the "old" listbox
class now has, and seems (according to the logs) to be have been superceded by the pane widget.
At the very least, the pane widget seems to be what mordante was working with in his early
prototype of a new addon manager, and not this 2010 list class.
(cherry-picked from commit 458dd284b8)
Base64 according to RFC4648.
Crypt64 is whatever crypt() does.
The two radix-64 encodings share less code than I would like,
because base64 is stream-oriented and therefore big-endian,
while crypt is little-endian.
* Some improvements to the messages
* Don't clobber existing metatables on deprecated subtables
* Fix Lua deprecation messages not even being logged
* Fix deprecation of Lua subtables
* Don't clobber the metatable when deprecating a subtable
Previously, MP Staging was using connect_engine::connected_users() to fill in the user list.
However, I noticed that the server was already sending the user list to all clients, including
the host, so I could unify the handling between Staging and Join Game by just using the server
data for both.
I've also added appropriate indicators for host, observer, and self in the list for both dialogs.
Additional host= and observer= status keys are sent by the server for that purpose.
I've also made the server dispatch the player list to the host when a game is created. This is
slightly redundant, since the host is the only player at that point, but it's easier than creating
a user config locally, or using connected_users(), not to mention easier to maintain.
The wesnothd::game::send_user_list function no longer exists early id `description_` is null.
No idea why it did that. It's not even used in the function. Anyway, it needed to be removed in
order for the above change to work.
Speaking of the host's copy of the player list, I haven't touched that. It's still needed for
managing things in the connect_engine. Might simplify things further in the future by delegating
more handling to the server, since it has a lot of the data needed already, but that's a different
project.
This mostly has to do with moving various components into more logical locations instead of
all mushed together in gui/widgets/settings.*pp. To that end, the following changes have been
made:
* The gui2::init function has been moved to its own file in the gui/ toplevel.
* load_settings() has been merged into init().
* All functions and code relating to gui theme definitions have been moved to their own file.
* All code relating to widgets or window static init have been moved to their own file.
* window::update_screen_size has been moved out of the window class and into settings.cpp.
* The unimplemented free-stadnding version of load_widget_definitions has been removed.
* gui_definition::read and gui_defintion::load have been merged into the gui_definition ctor
and greatly simplified.
* Some functions relating to builder_widgets have been renamed for clarity.
* add/remove_single_widget_defintion now access the current gui theme instead of the default.
This looks like it was a mistake made in the original code.
* Since the static registry is now externally linked, the unit tests accessor for window types
has been removed.
* Documentation has been updated. The wikidoc comment for gui_definition has been removed. It
was rather out-of-date and needed to be reworked anyway.
* widget_builder_func_t's signature is now to take a config reference and not a copy, though
REGISRER_WIDGET had already passed register_builder_widget a lambda that took a reference.
* Various other misc cleanups and improvements.