Anders Jenbo
d82f2ebc9e
Pass players by reference instead of an index
4 years ago
ephphatha
c68fcf3cb1
Apply MethodCase config to Rectangle::Contains
...
Also included Circle and VirtualButton classes due to the shared use.
4 years ago
Gleb Mazovetskiy
8e9c9e0238
Reduced the size of `OwnedCelSprite*` by 8 bytes
...
`OwnedCelSpriteWithFrameHeight`: 40 -> 32
4 years ago
Andrew James
0add7a8af6
Define sizes using Size type in control.cpp/stash.cpp ( #4737 )
...
* Use appropriate types for size constants in control.cpp
* Declare constexpr value for iterating over the cells in a stash grid
* Use appropriate type for UIRectangle dimensions
4 years ago
Gleb Mazovetskiy
563ee3af7c
Optimize `FormatInteger`
4 years ago
Vladimir Olteanu
2cc9d70fa6
Use decimal separators for gold and XP ( #4722 )
4 years ago
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.
4 years ago
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.
4 years ago
Anders Jenbo
1203514383
Clean up use of currlevel
4 years ago
qndel
354e329644
Players[MyPlayerId] -> MyPlayer
4 years ago
obligaron
bc15bdf3a9
Remove PANEL_ defines and replace them with GetMainPanel()
4 years ago
obligaron
d86c4e5d84
Introduce GetUIRectangle() to distinguish between UI and main panel
4 years ago
obligaron
70c5cf6cad
Fix item label text with open stash ( #4595 )
...
* Item labels: check if stash is open in IsMouseOverGameArea
* Add IsLeft/RightPanelOpen
4 years ago
qndel
89109dc9f4
HP bar tweaks and fixes ( #4525 )
...
* HP bar tweaks and fixes
4 years ago
ephphatha
ca48efc185
Update spell book requirements when refreshing stash items
4 years ago
ephphatha
64a2c41b2c
Set clang-tidy config for MethodCase option
...
Previously this was falling back to FunctionCase, leading to inconsistent casing of class methods throughout the codebase. Applied to Item as an example.
4 years ago
ephphatha
7a3722d63b
Add helper for clearing an item and using it's old value
...
Used when moving from one persistent variable to another where we want the source variable to be marked empty. Defining as a function instead of move constructor/assignment operator as we only really need to mark the source for xvalues. Detecting that in the constructor/assignment would be needlessly complicated.
4 years ago
ephphatha
ad7ad46ce9
Explicitly clear HoldItem when putting an item into the Inventory/Stash
...
Previously this also relied on NewCursor modifying MyPlayer->HoldItem when setting the cursor to a non-item cursor to avoid item duplication, seems more appropriate to make this explicit in the caller.
4 years ago
ephphatha
7e7798fd2b
Add function to mark an item as empty
4 years ago
ephphatha
56138ecf25
Invalidate held item when pasting into the stash
...
Makes use of that Item::isEmpty check in NewCursor to set the hand cursor when empty handed.
4 years ago
ephphatha
026b428c7d
Add NewCursor(Item&) for setting the cursor based on a held item
...
The case for empty items should never be hit in the current code, but I've got a related PR that'll make use of that so adding it now.
4 years ago
Anders Jenbo
dc706e8ed5
Use HoldItem for determining if an item is held
...
This cleans up a bit of code and solves a few edge cases where an item
could be lost, the game be unresponsive, or miss fire an event during
lag cause of the cursor not reflecting the currently held item.
4 years ago
Andrew James
538e3de309
Play sound after withdrawing gold from the stash
...
All gold related interactions a player can make with the stash now have audio feedback
4 years ago
Andrew James
08052fdf74
Play gold sound effect when depositing in stash
...
This adds a bit of audible feedback to help the player know that the action had an impact (along with the cursor changing and the count increasing).
4 years ago
ephphatha
907e1376b0
Add function to get item id at grid coords
...
Also introduced a few helper types and values to hopefully help document behaviour
correct spelling in comment
Co-authored-by: qndel <stefan551@o2.pl>
4 years ago
ephphatha
cef42d47a8
Add function to get current grid
4 years ago
Andrew James
6dca3b50c1
Remove use of SetICursor and related globals from CheckStashPaste ( #4429 )
4 years ago
ephphatha
6a04d441c1
Expand hot area of stash cell to include bottom-right border
...
This matches the behaviour of inventory cell hit logic. Previously it was possible to click exactly on a border and be unable to put an item in the stash.
4 years ago
Gleb Mazovetskiy
a66ca44695
Zero-based frame indexing
...
Index frames starting at 0 instead of 1.
4 years ago
Gleb Mazovetskiy
80599319bc
Don't hide the automap in Help and Chat Log ( #4379 )
...
This was necessary in the past due to stippled transparency but we use
blended transparency now.
Fixes #4355
4 years ago
qndel
6e4542f444
increase max stash pages from 50 to 100
4 years ago
Andrew James
028c5945b8
Add helpers to change stash pages ( #4287 )
4 years ago
obligaron
7b7cee52db
AddItemToStashGrid: Use PointsInRectangleRange with a starting position ( #4297 )
4 years ago
ephphatha
e8e20c1159
Min, not max, when clamping stash page...
4 years ago
staphen
6a30cd3950
Add gamepad support for stash
4 years ago
ephphatha
2b47f3abcc
Address type conversion warnings in loadsave.cpp
...
Most of this was centred around stash pages being saved/loaded as unsigned values but stored as signed values. Consistently used unsigned since it matches the intended usage.
4 years ago
Anders Jenbo
1ba817ca53
Unify gold handling (withdraw any amount from stash)
4 years ago
Andrew James
308ac7d7ad
Use PointsInRectangleRange with a starting position ( #4202 )
4 years ago
obligaron
3e9ca60460
Update _iStatFlag for stash items
4 years ago
obligaron
481f15ded5
Introduce StashStruct.GetPage/SetPage
4 years ago
Anders Jenbo
6d28810dc7
Change infostr from char[128] to std::string
4 years ago
Anders Jenbo
1409e604f5
Reduce string conversions
4 years ago
Andrew James
4ff83431d2
Remove the use of HoldItem in AutoGetItem ( #4178 )
4 years ago
obligaron
92993ad039
Ctrl+click stash item swap: if there is no room left, don't drop the item on the ground
4 years ago
obligaron
e52fa46687
Disable scrolls in UseStashItem
4 years ago
Anders Jenbo
d0014b0414
Fix untranlsatable strings
4 years ago
obligaron
b495cabeb5
Allow to swap items with ctrl+click between inventory and stash
4 years ago
Anders Jenbo
718c46e7fe
Remove use of tempstr
4 years ago
obligaron
2617332a41
Allow only one gold input panel to be open
4 years ago
Anders Jenbo
a48f89007d
Implement stash
4 years ago