Commit graph

497 commits

Author SHA1 Message Date
Juliano Leal Goncalves
379a27b64a ♻️ Convert 'ItemType' enum to enum class
🎨 Rename 'ItemType' elements to enum class standards
2021-09-13 00:25:49 +02:00
Anders Jenbo
064a70a9b1 Fix double encoding of monster names 2021-09-12 01:37:28 +02:00
Anders Jenbo
7169882b1f Implement new font rendering 2021-09-12 01:37:28 +02:00
qndel
a737d72dd9
Dynamic char panel 2021-08-30 20:33:55 +02:00
BC Ko
1cebabcfff documentation cleanup: control 2021-08-30 13:51:42 +02:00
Juliano Leal Goncalves
bb2dfdfb73 🚚 Rename 'ItemStruct' to 'Item' 2021-08-30 13:40:08 +02:00
Juliano Leal Goncalves
6c21638bee ♻️ Leverage 'Point' in 'SetCursorPos' function 2021-08-30 06:45:51 +02:00
Juliano Leal Goncalves
bbf529c65a 🚚 Rename 'PlayerStruct' to 'Player' 2021-08-30 06:44:18 +02:00
Anders Jenbo
4044fadeb5 Clean up some players references 2021-08-30 03:26:17 +02:00
qndel
9e1cdb4a82 CheckChrBtns cleanup 2021-08-29 17:53:13 +02:00
qndel
770f3a2f20 unify ranged and melee pierce 2021-08-28 18:04:22 +02:00
BC Ko
4df798808e
2435 refactor global variable Items part 2 (#2673) 2021-08-26 08:06:48 +02:00
Anders Jenbo
408c6e43b6 Don't echo quick commands 2021-08-19 20:36:12 +02:00
Vladimir Olteanu
bfcc57783c Remove Surface::{Alloc,Free}, introduce OwnedSurface 2021-08-19 08:51:59 +02:00
obligaron
36f13b34dc Add debug text commands 2021-08-19 03:44:20 +02:00
obligaron
6be94ceb3f Move DiabloHotkeyMsg to control.cpp and use IsChatAvailable 2021-08-19 03:44:20 +02:00
obligaron
13ab3e0ba9 Handle chat visible logic seperated from multiplayer (own function) 2021-08-19 03:44:20 +02:00
vladtepesch
0e56e52c75
fixes casting level 0 spell says "not enough mana" (#2568) 2021-08-11 19:52:00 +00:00
obligaron
8dbe16d4f6 Introduce GetSpellListItems 2021-08-11 02:44:51 +02:00
obligaron
95daecc1bb Introduce GetSpellListSelection and remove selection game logic from DrawSpellList 2021-08-11 02:44:51 +02:00
BC Ko
0a4361d5fc cleanup manual value clamping: control.cpp 2021-08-10 20:20:27 +02:00
Aaron Sun
6701b8a989 Fix attribute up (+) button doesn't work in special case
1) Open quest panel
2) Open character panel by click level up (+) button
2021-08-08 14:28:23 +02:00
Aaron Sun
aef812fb5a Modify the calculation of panel position
left/center combination is used, but panel distance is limited
2021-08-08 02:08:02 +02:00
Anders Jenbo
8df8b940c4
Handle some clang-tidy issues 2021-08-07 16:30:14 +02:00
Aaron Sun
3ee90ca629 Add options for sub-panel alignment 2021-08-07 16:09:32 +02:00
Anders Jenbo
90960f0c14 Remove dead code 2021-08-07 00:36:38 +02:00
4aron5un
4c8210df21
Center the sub-panels (Quest, Character, Spell and Inventory) (#2498) 2021-08-05 21:27:07 +02:00
Vladimir Olteanu
b17ff04ee2 Use string_view in DrawString and friends 2021-08-05 01:40:43 +02:00
qndel
169f980038 ranged/magic formulas 2021-08-04 23:55:44 +02:00
qndel
bd5e30db52 replace armor formula 2021-08-04 23:55:44 +02:00
Anders Jenbo
d523fc1e81 Cleanups 2021-08-02 10:12:40 +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
a2bed56061 Clean up some variables in control.cpp 2021-07-18 05:16:02 +02:00
Anders Jenbo
a19e7b2a3b Remove some more use of miniwin 2021-07-17 23:54:13 +02:00
obligaron
1956c6a1c2
Fix some 64bit warnings 2021-07-17 18:30:39 +02:00
Anders Jenbo
77b72da276 ♻️Use monster by reference when possible 2021-07-14 20:22:35 -07:00
Anders Jenbo
352a0ca510 Place local symbols in an anonymous namespace 2021-07-09 16:54:01 -07:00
Anders Jenbo
bc51e1616d 🎨 Apply clang-tidy 2021-07-08 08:14:03 -07:00
Anders Jenbo
20262e4569 🚚 Move local symbols in to anon namespace 2021-07-08 08:14:03 -07:00
Anders Jenbo
9ebdb6db69 General clean up 2021-07-08 03:30:25 -07:00
Anders Jenbo
9b8bf92575 Rename quest globals 2021-07-08 02:01:14 -07:00
Anders Jenbo
96bf75b502 Rename player globals 2021-07-08 02:01:14 -07:00
Anders Jenbo
dce78dde62 Rename lighting globals 2021-07-08 02:01:14 -07:00
Anders Jenbo
07ad083fda Rename monster globals 2021-07-08 02:01:14 -07:00
Anders Jenbo
cb564a2d54 Clean up A-D 2021-07-04 05:25:37 -07:00
Gleb Mazovetskiy
55464eec78 Fix -Wmissing-braces
Fixes warnings such as this one:

```
../../../../../../Source/engine/render/text_render.hpp:83:33: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        return DrawString(out, text, { position.x, position.y, out.w() - position.x, 0 }, flags, spacing, lineHeight, drawTextCursor);
                                       ^~~~~~~~~~~~~~~~~~~~~~
```
2021-07-03 19:08:45 -07:00
Anders Jenbo
4eabc6024b Apply various cleanups via Android Studio 2021-07-03 18:27:17 -07:00
Andrew James
3508aa6d3d
Align Life/Mana flask drawing routines (#2291)
* Clamp hpPer as a sanity check
* Refactor update mana routines in control.cpp to use PlayerStruct::UpdateManaPercentage
* Remove unnecessary calls to UpdateHP/ManaPercentage
* Unify logic that draws the flasks into a single internal function
* Fix style violations
* Remove unnecessary save/loads of hp/manaPer

The way this variable is used expects a value in this range and it gets clamped again anyway, but this makes the code more similar to the manaPer logic for future refactoring

Identical logic in use, the checks to see if the values are negative can be accomplished using clamp and the same divide by zero guard. I'll combine the two attributes in a near future commit.

control_update_life_mana is called during the game loop before any of the drawing functions so hpPer/manaPer are calculated based on the latest current/max of their respective attributes every frame.

There's no need to do the calculation again in the draw routines. (There's also no need to calculate this every frame but that's going to take a bit to untangle.)
2021-07-03 18:06:24 +02:00
Gleb Mazovetskiy
cb0dae8590 🚚 Rename CelOutputBuf to Surface and extract 2021-07-03 05:33:32 -07:00