Anders Jenbo
1203514383
Clean up use of currlevel
4 years ago
staphen
b349e29058
Correctly indicate when scroll can be used on virtual gamepad
4 years ago
qndel
354e329644
Players[MyPlayerId] -> MyPlayer
4 years ago
obligaron
bc15bdf3a9
Remove PANEL_ defines and replace them with GetMainPanel()
4 years ago
staphen
0c4940fc00
Skip touch interactions with stash when stash is not open
4 years ago
staphen
0b41ce271f
Skip touch interactions with main panel when not in a game session
4 years ago
obligaron
2b0b944afb
Manage friendly mode per player and sync state between clients
4 years ago
ephphatha
7f15aa730d
Move definition of ghMainWnd to utils/display.cpp
...
This variable is controlled/set by the code in that file, this also lets other files have more specific/relevant includes instead of the monolith that is diablo.h
4 years ago
Anders Jenbo
3aca1a50c3
Fix build error
4 years ago
ephphatha
0cfd0e194a
Refactor TryDropItem to reduce use of globals
...
The way TryInvPut and DropItemBeforeTrig interacted was fragile, don't think this would've worked as expected at the best of times. Looks like it was added as part of controller support so guessing this isn't vanilla behaviour anyway.
4 years ago
staphen
ef9ae41f6a
Fix item graphics on potion buttons for virtual gamepad
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
8d3f39d2e5
Clear the held item if it is used to open a quest entrance
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
ephphatha
0595593f6f
Move the adjustment for large items out of InvGetEquipSlotCoord
4 years ago
ephphatha
c0a7f35bb9
Only attempt to lookup mouse position if the slot changes
4 years ago
ephphatha
b2127d07dc
Change InventoryMoveToBody side-effect to return value
...
This makes the call sites use the same pattern as every other inventory movement. See the next commit for why :D
4 years ago
ephphatha
40a0d6dda3
Replace uses of icursSize28 with local itemSize variable
...
Re-ordered the last couple of if conditions to make it clearer what the impact of the adjustments to mouse position are.
4 years ago
ephphatha
0adf0fb1f3
Use GetInventorySize in GetItemSizeOnSlot
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
5f788a6e04
Be explicit about the cursor overlap checks when acting on inventory cells
4 years ago
Gleb Mazovetskiy
ade8aba822
Fix some more warnings
4 years ago
Gleb Mazovetskiy
9b8347996a
Fix OpenDingux/RetroFW builds
...
Follow-up to https://github.com/diasurgical/devilutionX/pull/4414 ,
which removed the `state` field.
4 years ago
Anders Jenbo
c667e69554
[gamepad] Fix repeated spell casting getting stuck if there is no target
4 years ago
Anders Jenbo
3792b9238c
[touch] Hook up action repeat
4 years ago
Anders Jenbo
66d7a3c222
[gamepad] Reuse repeat logic from mouse
4 years ago
Gleb Mazovetskiy
235451ae5a
Reduce debug log output of Control
4 years ago
staphen
aad12e50e7
Do not process button held events in character panel
4 years ago
staphen
27b7a71132
Do not process held events for action buttons in main menu
4 years ago
staphen
075953a1f3
Enable use of L2/R2 on joystick
4 years ago
Anders Jenbo
c68af7a5bf
[touch] Allow interacting with the spell book
...
Fixes #4393
4 years ago
Anders Jenbo
3b86c7fac4
[touch] Spend stat points when clicking the buttons
...
Fixes #4387
4 years ago
staphen
2759eb130b
Update player's spell target when using quick cast on gamepad
4 years ago
Gleb Mazovetskiy
787bc54310
Only query cbutton state for button events
...
Similar to https://github.com/diasurgical/devilutionX/pull/4374
4 years ago
staphen
a0bc3f218f
Only query jbutton state for button events
4 years ago
Gleb Mazovetskiy
4c2fa76e49
Controller mouse emulation fixes
...
1. Do not interrupt mouse mode on virtual clicks.
2. Handle virtual clicks directly instead of sending an SDL event.
3. Fix D-Pad mouse emulation state handling.
4. Hides the modifier hints during D-Pad mouse emulation.
4 years ago
Gleb Mazovetskiy
56de0a6566
Fix modifier + D-Pad triggering a D-Pad event
...
Also fixes build with `HAS_KBCTRL=1`
Fixes #1977
4 years ago
Felipe Wannmacher
889cc04f95
Enhanced attack using controllers ( #4019 )
4 years ago
Gleb Mazovetskiy
79c7eee10a
Mouse/Gamepad fixes
...
Introduces a `ControlDevice` global which is distinct from `ControlMode`
in that it is set to `Gamepad` even when simulating a mouse.
This allows us to avoid a number of edge cases related to mode changes.
Fixes #4242
4 years ago
staphen
e6182709d1
Allow casting Town Portal, Teleport, and Guardian scrolls from inventory
4 years ago
Gleb Mazovetskiy
40b1cd6d8a
Fix a negative shift exponent sanitizer warning
...
Source/spells.h:53:14: runtime error: shift exponent -1 is negative
Fixes #4319
4 years ago
staphen
6250067283
Touchscreen navigation for stash
4 years ago
staphen
6a30cd3950
Add gamepad support for stash
4 years ago
Anders Jenbo
9226f1435c
Clean up PotionButtonRenderer
4 years ago
Anders Jenbo
0f44da5487
[gamepad] Fix using quick spells with rebound keys
4 years ago
Anders Jenbo
8235380ef9
[gamepad] Avoid OOB on empty belt
4 years ago
Anders Jenbo
9d65580294
[gamepad] Fix managing belt
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