80684 Commits

Author SHA1 Message Date
Tahsin Jahin Khalid
c42271fb2c Terrains: add Snowy Drake Village 2022-05-29 02:57:15 +06:00
Elvish_Hunter
8b8f99e65a wmllint: fixed translation marks not being removed from values when checking if a string is empty 2022-05-28 22:03:25 +02:00
Charles Dang
5b846fea3c
Fix build on MinGW
For some reason MinGW doesn't like using template argument deduction on the array... Make it explicit when building there. Also moves the `sized_array` alias to `enum_base` since we don't need it defined in the definition class. Also makes the two versions of ENUM_AND_ARRAY cleaner.
2022-05-28 15:35:18 -04:00
Nils Kneuper
31b508ccfc updated French translation 2022-05-28 12:03:11 +02:00
Charles Dang
5121795a51 Forgot to add the string include back 2022-05-28 00:01:45 -04:00
Charles Dang
2d08a533d1 Refined string_enum
- Cleaned up code and documentation
- Made both overloads of get_enum constexpr (one now takes a string_view instead of a string)
- Used type deduction for the values array. For existing uses this will deduce the same as before (const char*)
  This also means it's not explicit, and some classes can use string_view.
2022-05-27 22:58:48 -04:00
loonycyborg
051a725cef
servers: avoid potential dangling queue items in send_doc_queued()
Use scope guards to ensure that queues are cleared of that socket whenever
coro_send_doc() throws.
2022-05-27 22:20:26 +03:00
Charles Dang
8fd4304c88 Hotkey/Item: optimized add_hotkey
Since this is the only way to add things to the hotkey list, there can be at most one
matching entry in the list. Since order doesn't matter, just swap in the new hotkey at
that position rather than erasing and re-adding at end. If we want efficient mid-list
removal we should use std::list.
2022-05-27 13:02:04 -04:00
Charles Dang
96ac3fd973 GUI2/Preferences: removed hotkey scope setter
As in a28e326417968e4f75ebda7bac2165b267388750, this doesn't seem to do anything anymore.
2022-05-27 13:00:38 -04:00
Charles Dang
21fd2a0b45 Include <array> in enum_base.hpp 2022-05-26 22:56:20 -04:00
Charles Dang
7e76e21a87 Fixed hotkey scope regression
See comment in hotkey/hotkey/hotkey_command.hpp for explanation. This isn't a good solution,
but I need to figure out a better one.
2022-05-26 22:41:44 -04:00
Wedge009
8960e407e9 Editor: Add missing items and scenery (resolves #6719) 2022-05-27 10:11:45 +10:00
Charles Dang
7637f0547c Hotkey: misc cleanup 2022-05-26 18:30:53 -04:00
Charles Dang
a28e326417 Hotkey/Item: don't set active scope when adding a hotkey
At one point it seems like this was used in matching existing hotkeys, but I can't find
any code that relies on this being here anymore.
2022-05-26 17:58:57 -04:00
Charles Dang
b4ee34dfff Hotkey/Item: optimized loading of default hotkeys
We don't need the check-if-we-need-to-remove-existing-entry behavior when loading defaults,
since we always want the defaults as a base. This splits load_hotkeys into two functions,
one which directly sets the hotkeys list and the other which will check before adding.
2022-05-26 17:55:08 -04:00
Charles Dang
a6f1a75153 Hotkey/Item: minor QoL cleanup 2022-05-26 16:36:48 -04:00
Charles Dang
b77e262e5b Hotkey/Manager: removed static functions 2022-05-26 16:28:45 -04:00
Charles Dang
3269f6b30a Hotkey: removed direct scope setters
All scope setting should use scope_changer.
2022-05-26 16:08:15 -04:00
Charles Dang
1c287b812a Hotkey: added option to disable restore behavior when passing a new scope bitset to scope_changer
This replaces deactivate_all_scopes followed by set_scope_active. These cases didn't have restorer behavior.
I'm not sure if using restorer behavior would be ok, will need to evaluate that. This is just to clean up
code while matching current behavior.
2022-05-26 16:05:29 -04:00
Charles Dang
d956436de7 Hotkey: used scope_changer bitset ctor instead of manually deactivating/setting scopes
Constructing a temporary bitset with a single bit set serves the same purpose.
2022-05-26 15:46:44 -04:00
Charles Dang
2b7cf06326 Hotkey: added scope_changer ctor taking hk_scopes
Removes the need to call set_active_scopes immediately after
2022-05-26 15:18:41 -04:00
Charles Dang
f96a53ab66 Hotkey Item: formatting cleanup 2022-05-26 15:06:52 -04:00
Charles Dang
8803d4ceba Hotkey: removed redundant helpers
- get_hotkey_null replaced with hotkey_command::null_command (latter just called the former)
- get_id replaced with direct member access
- get_description replaced with direct member access
- get_tooltip replaced with direct member access
2022-05-26 15:06:32 -04:00
Charles Dang
24395660ae
Merge pull request #6728 from wesnoth/hotkey-command-handling-cleanup
Hotkeys: refactored how hotkey_commands are stored and managed (WML hotkeys only)
2022-05-26 14:32:14 -04:00
Charles Dang
cbc48c521c Further refinements 2022-05-26 13:42:23 -04:00
loonycyborg
03c4731be0
servers: moved send_queued code into separate function from a lambda 2022-05-26 20:04:29 +03:00
Charles Dang
063aa9b199 Hotkeys: refactored how hotkey_commands are stored and managed (WML hotkeys only)
This encompasses two closely related changes. First, we now store hotkey_commands in a map instead of
a vector with accompanying index map. Most code did not rely on the command container being contiguous,
and since the commonly used get_hotkey_command was already performing a lookup in the index map, there
wasn't much need to use a separate container. Associative storage makes the most sense here.

The one place that did rely on the command container being contiguous was remove_wml_hotkey. I realized,
however, that it would be much cleaner to eliminate the manual bookkeeping. To this end, I added a new
wml_hotkey_record RAII class. It registers a hotkey_command when created and removes it on destruction.
Using a map for the commands made this even easier, since it doesn't invalidate other iterators or
require other commands to be moved to keep the container contiguous. In addition, removing the secondary
index map means we no longer need to recreate that every time a wml hotkey is removed!

Switching to this RAII-based system means delete_all_wml_hotkeys could also be removed, since all WML
hotkeys should now be handled by wml_hotkey_record and clean themselves up on destruction.

clear_hotkey_commands was also removed, since it was both misleading and now unnecessary. It only cleared
the index map, not the actual list of hotkey_commands! Given that init_hotkey_commands actually set up
the command list, this was doubly confusing.
2022-05-26 02:43:15 -04:00
Tommy
0006c50bb4 Render to an offscreen texture rather than directly.
This should fix issues with inconsistent buffering behaviour.
2022-05-25 16:14:19 +12:00
Charles Dang
cc73828450 Fixed crash when rendering gamemap 2022-05-24 19:29:21 -04:00
Charles Dang
3be51e928f Fixed small regression in 023bdb7 2022-05-24 16:47:52 -04:00
Charles Dang
cdd854d5fa GUI2/Unit Preview Pane: used NN-scaled [drawing] for unit image (resolves #6700) 2022-05-24 16:26:06 -04:00
Charles Dang
1cc222caec Hotkeys: removed hotkeys_by_category
The only place that used this was the preferences dialog, and that was refactored out in 023bdb71426bf3fca4ad22f2a7f63f6272bb241e.
We want to reduce as much global state as possible, especially since this code is accessed by multiple threads (loading screen)
2022-05-24 16:24:09 -04:00
Charles Dang
023bdb7142 GUI2/Preferences: refactored how hotkey categories are handled
Constitutes a further refinement of a688ab77b9f18db7fd34118267a3c59e9cf5584c.

Instead of getting a list of categories and filtering out those without any hotkeys (custom WML ones,
for example), we generate a set of categories from the list of visible hotkeys when we set up the list.
This ensures we only ever have matching categories for the hotkeys we're seeing and removes the need
for extra global bookkeeping in the category code.

This also ensures the category list is reconstructed when resetting hotkeys. I don't know how categories
could have appeared/disappeared after resetting (the old code should be safe), but this makes sure it
will never be an issue since when visible_hotkeys is changed, so is visible_categories.
2022-05-24 16:09:00 -04:00
Tommy
58c9d4feae CVideo: add get_pixel_scale() to return the active pixel scale.
Multiply font sizes by this to create high-dpi font textures.
2022-05-24 03:20:46 -04:00
Charles Dang
c028dd7cf6
Merge pull request #6693 from mesilliac/rendering_system_overhaul
Rendering system overhaul
2022-05-24 03:15:15 -04:00
Tommy
197dfae46c Merge remote-tracking branch 'wesnoth/master' into rendering_system_overhaul 2022-05-24 18:27:40 +12:00
Charles Dang
776a127c57 Hotkeys: properly named hotkey_command id and command members 2022-05-24 01:57:27 -04:00
Charles Dang
bd663177d2 Preferences/Game: made use of insert_or_assign 2022-05-24 00:08:18 -04:00
Charles Dang
bf4dab1b1e Hotkeys: some cleanup
- Moved hotkey_command_temp definition to the cpp
- Removed trailing underscores from non-private objects
- Initialize master_hotkey_list at compile-time
- Mark const containers const
2022-05-24 00:08:18 -04:00
Wedge009
799f251113 THoT S4: Remove spurious WML (closes #6725) 2022-05-24 08:14:24 +10:00
Martin Liska
5fa07ea15c Fix building with GCC 13.
Fixes the following issue:
base64.hpp:23:49: error: 'uint8_t' was not declared in this scope

and:
deprecation.hpp:20:22: error: found ':' in nested-name-specifier, expected '::'
2022-05-23 16:09:28 +02:00
Luis Miguel Iglesias Sánchez
7d2ee4ef72
Merge pull request #6438 from Descacharrado/NR_S01_OOS_6268
NR S01 Solve OOS by moving code to synced event
2022-05-23 10:09:58 +02:00
Luis Miguel Iglesias Sánchez
742bb75ca3
EI S07a various fixes (#6639)
* Side 2 hidden without spoilers
* Fixed Grug upkeep, added dialogue about Ogres joining
* typographic quote
2022-05-22 10:45:17 -05:00
doofus-01
e2c57124f4
1.17 water-related things (#6695)
* caribe monster unit

* some sea-related terrain overlays

* minor variation of dead oak

* update rubble on the water
2022-05-22 05:05:52 -07:00
Nils Kneuper
92312479e9 updated Japanese translation 2022-05-22 11:07:44 +02:00
Tommy
47ff165450 Potential fix for CVideo::get_dpi_scale_factor on Mac. 2022-05-21 23:12:32 -05:00
Tommy
b8144449c6 Potential fix for hardware-rendering high-dpi issues on Mac. 2022-05-21 23:12:32 -05:00
Nils Kneuper
a693aa1233 updated Czech translation 2022-05-21 10:52:01 +02:00
Nils Kneuper
50ef1ddf6f updated French translation 2022-05-21 10:50:36 +02:00
Celtic Minstrel
0ffe926b01
Make tutorial hint messages persistent (#6620)
The hint messages even persist in saved games, in case someone saves their tutorial
2022-05-20 12:23:49 -04:00