Commit Graph
206 Commits
Author SHA1 Message Date
Gleb Mazovetskiy 88a9a0656d Move option change handlers out of options.cpp
Fixes #7638
2025-01-13 11:57:25 +00:00
Gleb Mazovetskiy d94bc424df sgOptions -> GetOptions()
In C++, globals initialization order accross translation units is not
defined. Accessing a global via a function ensures that it is initialized.

This will be needed for #7638, which will statically initialize change
handlers after the Options object has been initialized.
2025-01-13 11:57:25 +00:00
Anders Jenbo 908fb47073 Merge limitFPS and vSync options (#7646) 2025-01-12 15:28:50 +01:00
Gleb Mazovetskiy bbcda12792 Move QuickMessages to its own library
Eliminates an options->diablo dependency.
2025-01-11 13:51:56 +00:00
Gleb Mazovetskiy 7668de36a4 Add a default clock mod
This mod renders a clock in the top-right corner
and is always available (disabled by default).

It is useful to have a mod available by default
as we work on mod support.
2025-01-10 10:51:47 +00:00
staphen 3b841b5800 Reload Lua mods when enabling/disabling 2025-01-10 01:20:20 +01:00
Gleb Mazovetskiy d7647d6c63 More dependency untangling
1. Moves more assets-related stuff from `init` to `engine/assets`.
2. Removes `SDL_audiolib` dependency from `soundsample.h`.
3. Cleans up some unused/missing includes.
2025-01-09 18:19:44 +00:00
Gleb Mazovetskiy b76feb2be3 Extract game mode out of init.cpp
Untangles some dependencies
2025-01-09 11:02:19 +00:00
Gleb Mazovetskiy a49b1f2d58 Extract Is{Any,None}Of out of engine.hpp
Untangles some of the dependencies
2025-01-08 09:54:56 +09:00
staphen 4931cc6386 Lua mod ini file configuration 2025-01-08 01:45:14 +01:00
Eric Robinson 8d1fb2bd63 Move Game Mode to own category 2024-11-30 20:59:23 +01:00
Gleb Mazovetskiy 66b0f43731 Add a threshold for skipping the loading screen 2024-11-10 13:49:01 +01:00
Gleb Mazovetskiy b8ab6d2faa Migrate from SimpleIni to our own implementation
Our implementation has a more modern interface and only
supports the features that we care about.

It always outputs `\n` as newlines and does not output BOM.

The modern interface eliminates awkward `c_str()/data()` conversions.

This implementation preserves comments and the file order of sections
and keys. New keys are written in insertion order.

We now also support modifying and adding default comments,
which may be a useful thing to do for the especially tricky
ini options (this PR doesn't add any but adds the ability to do so).

Sadly, this increases the RG99 binary size by 24 KiB.
I'm guessing this is because the map implementation generates
quite a bit of code.

Note that while it might seem that using `std::string` for every key and
value would do a lot of allocations, most of these strings are
small and thus benefit from Small String Optimization (= no allocations).
2024-11-05 10:12:24 +00:00
Sten Feldman 95c79ecd61 🇪🇪 ET Translation patch (#7479)
- First iteration of Estonian translations
- Added to Eesti to Options as well as included the strings to the Asset file.
2024-10-12 21:40:06 +01:00
staphen 1078598226 Hide Upscale option in Settings menu 2024-09-29 03:05:11 +02:00
Eric Robinson 6396af1ff5 Cleanup panel code (Part 2) (#7421) 2024-09-18 04:28:17 +02:00
qndel 24f108f193 fix many typos (#7322) 2024-08-09 21:13:42 +02:00
Byrgius 0a778eec4b Turkish Translation (#7197) 2024-07-21 20:16:04 +02:00
djvs a6e2481a3e Option to not pause the game when the window loses focus (#7046) 2024-04-18 00:25:55 +02:00
Tully-B 8fa95a1740 Add Hungarian translation (#7062) 2024-04-10 22:08:24 +02:00
Gleb Mazovetskiy 41189060ef Fix mouse wheel key names 2024-02-04 09:30:27 +00:00
obligaron 426dd4c4af Add scroll wheel support to keymapper 2023-12-14 22:17:57 +01:00
obligaron 22ec684671 Fix some MSVC warnings 2023-12-02 12:57:34 +01:00
9123f01a96 Hotkeys: Support more keybindings (#6719)
* Extend F keys with F13-F24 range
* Add more possible keybindings
* Removed hardcoded keys that are used elsewhere
* Put PAUSE back where it was before
* Remove hardcoded logic for PAUSE key
* Hotkeys: Support more keybindings

This patch adds more keybindings, so we can map multiple keys.

It also adds a possibility to bind an alternate key to pause game
(currently mapped to P and Pause key by default).

Co-authored-by: n <[email protected]>
Co-authored-by: staphen <[email protected]>
2023-10-17 18:16:17 +02:00
tetektoza fbc542433f Hotkeys: Support binding to keypad numbers (0-9)
This patch adds support to bind actions in settings to keypad numbers
(0-9).
2023-10-16 05:20:43 +02:00
Gleb Mazovetskiy ae27dc2bc8 Keymapper: Reduce log spam in verbose mode
If a key is not bound, do not log "no name found for key".
2023-10-15 15:04:44 +01:00
Gleb Mazovetskiy 6d43898fad Fix unused variable warnings for resampler name
If a resampler was not enabled, we'd get an unused variable warning:

    warning: unused variable 'ResamplerSpeex' [-Wunused-const-variable]
    constexpr char ResamplerSpeex[] = "Speex";
2023-09-17 06:28:55 +01:00
Vinícius Ferrão dff46af2de Fixes testing characters from Hellfire showing up in Diablo
This commit restricts the use of Test Barbarian and Test Barb to the
Hellfire expansion only.

Signed-off-by: Vinícius Ferrão <[email protected]>
2023-09-16 03:16:33 +02:00
Vinícius Ferrão 2644ec73af Add Crippling Shrines from Hellfire (#6273) 2023-09-03 01:42:59 +02:00
Gleb Mazovetskiy 5355146d51 Use structured bindings 2023-08-29 12:56:49 +01:00
Gleb Mazovetskiy ba4def9382 Use utils/algorithm/container.hpp in more places 2023-08-19 19:57:11 +09:00
Gleb Mazovetskiy 8c1a847f41 Remove utils/stdcompat/string_view.hpp 2023-08-14 09:59:14 +01:00
Gleb Mazovetskiy c19bfe87fa Remove utils/stdcompat/algorithm.hpp 2023-08-14 01:54:29 +01:00
Gleb Mazovetskiy 7a5e5f73e6 Support language-specific font variants
Refs #3538
2023-08-12 17:44:30 +02:00
Gleb Mazovetskiy 8101e2c0ba Add c_any_of and friends
Adds handy helpers for performing algorithms on the entire container.
They're prefixed with `c_` for container.

This naming convention is identical to some popular C++ libraries, such
as Abseil.
2023-08-12 16:24:01 +01:00
DakkJaniels ad19caf667 Move hp/mana display and item graphics to gameplay options 2023-07-14 03:12:29 +02:00
Anders Jenbo 9e7d223f19 Menu tweaks 2023-06-05 21:11:14 +02:00
DakkJaniels e485493a3d Fix print screen for different print screen key bindings (#6060) 2023-05-26 06:20:54 +02:00
staphen 8b6b898493 Defer d-pad inputs to movement handlers 2023-04-21 02:45:10 +02:00
staphen 6bcb4d70e4 Use padmapper bindings on spell icons 2023-04-15 09:53:49 +02:00
Gleb Mazovetskiy c858ab4d2c Fix some compilation warnings
also removes a couple of unused filesystem includes
2023-03-12 13:21:40 +00:00
Gleb Mazovetskiy f2cb9f0fa0 file_util: Implement RecursivelyCreateDir
With this, we no longer require `std::filesystem` support to create the
save file directory when it does not exist.

Note that by default the save file directory exists because it is
created by SDL, so this is mostly useful on platforms that override the
save directory or use `UNPACKED_SAVES`.
2023-03-11 17:47:29 +00:00
obligaron adeeae2c52 Add option to enable singleplayer quests in multiplayer 2023-02-27 05:00:07 +01:00
Gleb Mazovetskiy 1a1a282d9a Use C FILE instead of C++ streams throughout
Reduces binary size by ~2 KiB and may improve compatibility with oddball
systems (e.g. PS2).
2023-02-15 18:15:07 +00:00
staphen b46482f414 Clear padmapper state when changing event handlers 2023-02-12 09:28:37 +01:00
staphen 02bbf2565e Provide default selections for resolution on systems with only one display mode 2023-02-12 00:38:46 +01:00
staphen 92361f9f6d Display resolution height when FitToScreen is on 2023-02-05 02:02:37 +01:00
Trihedraf 624d5be3d2 make Floating Numbers an enum for random, vertical or off 2023-01-30 19:17:47 +01:00
Bubio 81c7d0618d Fixed spelling errors (#5714)
Corrected a spelling error in the "Show Item Graphics in Stores" description
(desription -> description)
2023-01-23 16:52:35 +01:00
c99f7cf644 Floating numbers (#5639)
Co-authored-by: qndel <[email protected]>
Co-authored-by: Stephen C. Wills <[email protected]>
2023-01-22 07:20:10 +01:00