60 Commits
Author SHA1 Message Date
obligaron f31def7c33 Fix MSVC warnings in qol\* 2023-11-19 01:41:03 +01:00
ephphatha 996841e82e Restore level 50 experience cap from Diablo 2023-08-24 05:46:44 +02:00
ephphatha e6890cc5cc Move MaxCharacterLevel to playerdat and add helpers for the various uses 2023-08-24 05:46:44 +02:00
ephphatha 14639cd096 Replace _pNextExper with getter method
No real need to persist this value
2023-08-24 05:46:44 +02:00
ephphatha da76e131e4 Add getter/setter for character levels to ensure _pNextExper stays synced 2023-08-24 05:46:44 +02:00
ephphatha d92d152576 Use unsigned type for character levels 2023-08-24 05:46:44 +02:00
ephphatha 486f5ca3e8 Replace ExpLvlsTbl global with helper function 2023-08-24 05:46:44 +02:00
Gleb Mazovetskiy 5bf0b8bc96 Add more missing <cstdint> includes
https://github.com/diasurgical/devilutionX/pull/6095 only added includes
for `uint32_t`, this PR also adds the includes for the remaining
integral types.
2023-05-10 16:29:27 +01:00
Eric Robinson f75f66d54b Add playerdat (#5763) 2023-02-10 12:56:28 +00:00
Gleb Mazovetskiy c351acbf7e Remove redundant devilutionx.mpq check
We now check it only once in `CheckArchivesUpToDate`.
We then use `LoadClx` instead of `LoadOptionalClx` throughout.
2022-08-04 15:16:00 +02:00
Gleb Mazovetskiy 5505e830fb Render XP bar as CLX
Missed in #5183.
Also, the previous conversion command was incorrect (missing
--transparent-color 1), re-converted with:

```
pcx2clx --transparent-color 1 data/xpbar.pcx
```
2022-08-04 15:16:00 +02:00
Mikołaj Piróg dda0b96ea5 Remove #defines in player.h and add constexpr where applicable (#4896)
* Change defines to constexpr int in player.h

* Add const or constexpr to player.h/cpp where applicable

* Update tests with changed names of player constatns

* remove unecessary variable
2022-07-05 17:25:23 +02:00
Gleb Mazovetskiy 563ee3af7c Optimize FormatInteger 2022-06-18 13:57:22 +02:00
Vladimir Olteanu 2cc9d70fa6 Use decimal separators for gold and XP (#4722) 2022-06-18 09:13:59 +02:00
Gleb Mazovetskiy 1fc8ecb6f6 Add fmt::runtime annotations for C++20 support
`fmt` requires non-contexpr format string arguments to be wrapped in
`fmt::runtime` in C++20.
2022-06-14 12:46:36 +01:00
Gleb Mazovetskiy 779ccaca17 Overhaul translation fetching
1. Do not modify the map after loading. Instead, return string views
   (guaranteed to be null-terminated) from look up functions and return
   the key directly if not found.
2. Use an `unorded_map` instead of `map` where available (C++20).
   Saves a bit of RAM (~50 KiB) and improves lookup performance.
2022-06-14 12:46:36 +01:00
qndel 354e329644 Players[MyPlayerId] -> MyPlayer 2022-05-31 05:35:52 +02:00
obligaron bc15bdf3a9 Remove PANEL_ defines and replace them with GetMainPanel() 2022-05-29 20:20:44 +02:00
Anders Jenbo 1409e604f5 Reduce string conversions 2022-03-20 11:04:15 +01:00
Anders Jenbo d0014b0414 Fix untranlsatable strings 2022-03-19 13:24:41 +01:00
Anders Jenbo 718c46e7fe Remove use of tempstr 2022-03-19 06:03:19 +01:00
qndel 81800e64bb MAXCHARLEVEL cleanup 2022-03-01 21:45:47 +01:00
Gleb MazovetskiyandAnders Jenbo 7e1fea6f76 clang-format all files in {Source,test}/
Also includes a few manual tweaks to comments and newlines for better results.

Co-authored-by: Anders Jenbo <[email protected]>
2021-11-24 23:44:12 +01:00
obligaron 635f378722 Add OptionEntry Experience Bar 2021-11-24 09:31:39 +01:00
Anders Jenbo 7771a08d03 Translatable mainpanel 2021-09-19 07:21:52 +02:00
Anders Jenbo 3b0858cdac Don't show xp bar when chat is open 2021-09-19 07:21:52 +02:00
Juliano Leal Goncalves 3251171a5c ♻️ Leverage 'Point' in 'xpbar.DrawBar' function 2021-08-30 06:45:51 +02:00
Juliano Leal Goncalves 20d356a6eb ♻️ Leverage 'Point' in art_draw functions 2021-08-30 06:45:51 +02:00
ephphatha 8f2e94ae4d Use unsigned types for player experience and related values 2021-08-12 13:38:05 +02:00
ephphatha 0575716eac Rename UiFlags members to group related options 2021-07-31 20:22:40 +02:00
ephphatha 4ad53232a0 Convert the UiFlags enum to a scoped enum type
Replace operator&& with named function
2021-07-31 20:22:40 +02:00
Anders Jenbo 7f5ea145e9 Fix MSVC C4477 warning
Also take translation in to account when printing XP info
2021-07-08 09:05:15 -07:00
Anders Jenbo 2ca6e37c46 Clean up sub folders using clang-tidy/Android Studio 2021-07-08 03:30:25 -07:00
Anders Jenbo 96bf75b502 Rename player globals 2021-07-08 02:01:14 -07:00
Anders Jenbo a7c7fa0030 Fully apply clang-tidy/format to all files 2021-07-03 16:41:43 -07:00
Gleb Mazovetskiy cb0dae8590 🚚 Rename CelOutputBuf to Surface and extract 2021-07-03 05:33:32 -07:00
Anders Jenbo b71b0149a3 Clang-tidy: ConstexprVariableCase 2021-07-03 03:09:43 +02:00
Juliano Leal Goncalves fd9f2099d0 ♻️ Leverage 'Point' to represent mouse position 2021-06-27 16:37:59 +02:00
Gleb Mazovetskiy f9f301b054 🚚 engine.h: Extract Point, Direction, clamp
`engine.h` is getting quite bloated. Moves this code to their own files.
2021-06-21 01:36:20 -07:00
Anders Jenbo 8a7ec56d3a Player by reference part 2
This mostly change player to be by reference instead of by index.
But additionally it does stript checks for gold in the belt, move some
value types to the initialization and short circute a few functiongs.
2021-05-24 21:00:32 +02:00
Jmgr bbd39aa513 Replace sprintfs with strcpy for translatable strings 2021-05-21 01:02:45 +02:00
Jmgr 6e85cde978 Update format strings 2021-05-21 01:02:45 +02:00
Jmgr 0c27e756f7 Add fmt::format 2021-05-21 01:02:45 +02:00
Anders Jenbo 34744c068f ♻️Consitantly use %i and not %d 2021-05-15 14:17:52 +02:00
Anders Jenbo 68e73c0dfe 🐛 Fix infopanel text color 2021-05-12 11:40:31 +02:00
Anders Jenbo e665a0c4b0 ♻️Draw info box text using DrawString 2021-05-10 22:28:21 +02:00
Anders Jenbo dbf5662ce6 :note: Update MPQ error messages 2021-05-08 04:38:07 +02:00
Gleb Mazovetskiy 710ddb9af6 ♻️ Make SetPixel a method 2021-05-07 01:02:03 +02:00
Gleb Mazovetskiy b9d452390b 🧹 Source/qol: FastDraw -> UnsafeDraw 2021-05-06 12:58:06 +02:00
Anders Jenbo 654a2b8834 ♻️Clean up automap code
Use Point for x,y pairs. Make helpers for drawing door and squares
2021-05-02 15:27:38 +02:00