185 Commits
Author SHA1 Message Date
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
staphen d707f07e8f Make item graphics in stores optional 2023-01-22 00:39:20 +01:00
Gleb Mazovetskiy 8fe8023542 Create save and config directories
If a config directory did not exist, the ini file was
not saved at all.

Only implemented for targets that support `std::filesystem` or `std::experimental::filesystem`.
These are all the targets except nxdk and iOS (only supported on iOS 13+).
2023-01-12 03:28:28 +00:00
staphen f17ea8db98 Implement settings menu for gamepad customization 2022-11-27 18:27:21 +01:00
Gleb Mazovetskiy a2a8b1c706 Padmapper: Simplify buttonTo* data structures
Use an `std::array` instead of `std::unordered_map`.
2022-11-07 04:56:50 +00:00
Gleb Mazovetskiy e7c0d2943f KeyMapper: Use forward_list instead of vector
Similar to how we do this for Padmapper.
2022-11-02 11:52:07 +00:00
staphen 6a565d3755 Further improve simulated mouse interaction 2022-10-31 10:29:37 +01:00
staphen 198dec9412 Iron out interactions between simulated mouse movement and character movement 2022-10-31 10:29:37 +01:00
staphen d7908d82f4 Always remove release actions from padmapper regardless of whether the action can be invoked 2022-10-31 10:29:37 +01:00
staphen 4579324726 Ensure that padmapper actions are in the correct order after initialization 2022-10-31 10:29:37 +01:00
staphen c83f7d3958 Avoid copy construction of PadmapperOptions::Action 2022-10-26 21:36:08 +02:00
Gleb Mazovetskiy 179ae009df Improve logic and fix for old compilers 2022-10-17 01:01:21 +02:00
staphen e67e4934cc Add padmapper for gamepad customization 2022-10-17 01:01:21 +02:00
Gleb Mazovetskiy 41f43ea3f5 Support unpacked MPQs from devilutionx-mpq-tools
https://github.com/diasurgical/devilutionx-mpq-tools produces an unpacked MPQ
with all the graphics converted to CLX and the unused files removed.
This is primarily useful on RAM-constrained platforms, such as PS2,
because it eliminates the MPQ overhead.

Adds a build option to load from such unpacked directories instead of the MPQ.

These directories are searched for in the same locations
where the MPQs would be searched for otherwise.

Example directory layout:

* /usr/local/share/diasurgical/devilutionx/diabdat/ -- unpacked and converted diabdat.mpq
* /usr/local/share/diasurgical/devilutionx/hellfire/ -- unpacked and converted hellfire MPQs (all of them merged into 1 directory)
* /usr/local/share/diasurgical/devilutionx/fonts/ -- unpacked fonts.mpq
* /usr/local/share/diasurgical/devilutionx/pl/ -- unpacked pl.mpq

These directory structure is produced by calling `unpack_and_minify_mpq`
2022-10-11 18:00:57 +01:00
Yuvraj Tetarwal 59482b5e9f Auto oil pickup (#5159)
* Fixed formatting
2022-07-31 18:26:07 +02:00
Gleb Mazovetskiy a4ac41cece Replace DVL_VK virtual key codes with SDLK 2022-07-17 10:00:06 +01:00
Trihedraf 5ee6e5dd3a Make zoom a setting in the menu (#4931) 2022-07-10 19:59:32 +02:00
Gleb Mazovetskiy 197e1180b2 Add StrCat and StrAppend
Adds simple string / integer concatenation functions.

Many of the uses of `fmt::format` are simply concatenation
of a few strings and integers.

`StrCat` is an easier-to-read alternative to such uses of `fmt`.
2022-07-10 06:14:58 +02:00
Gleb Mazovetskiy 5f813c3bec Xbox NXDK: Disable upscaling by default 2022-07-09 18:50:53 +01:00
Gleb Mazovetskiy 0a64ae3b6b Xbox NXDK: Default vsync to false and hide option
Looks like vsync doesn't work on NXDK at the moment.

Defaults it to false and hides it from the menu.

It is still possible to manually enable it via `diablo.ini` for testing.
2022-07-09 18:50:53 +01:00
Gleb Mazovetskiy 254806e027 Optimize translation RAM usage
1. Store all key data and all values data as 2 char arrays.
2. Change map keys to char pointers.
3. Change map values to offsets into the values array.

Example savings for Russian: 460 KiB -> 374.2 KiB (-85.8 KiB)

* Map: 68.5 KiB (with `string_view` keys it would be 101.5 KiB)
* Keys array: 108.7 KiB
* Values array: 197.0 KiB
2022-07-08 11:52:18 +01:00
Trihedrafandobligaron e002de4d69 show item labels toggle in menu
Co-Authored-By: obligaron <[email protected]>
2022-06-28 17:46:59 +02:00