Browse Source

Implement recharge and fix cursor for repair

pull/420/head
Anders Jenbo 6 years ago
parent
commit
e590e6995a
  1. 2
      Source/scrollrt.cpp
  2. 6
      SourceX/controls/plrctrls.cpp

2
Source/scrollrt.cpp

@ -102,7 +102,7 @@ static void scrollrt_draw_cursor_item()
assert(! sgdwCursWdt);
if (pcurs <= 0 || cursW == 0 || cursH == 0 || sgbControllerActive) {
if (pcurs <= 0 || cursW == 0 || cursH == 0 || (sgbControllerActive && !invflag && !chrflag)) {
return;
}

6
SourceX/controls/plrctrls.cpp

@ -145,11 +145,13 @@ bool checkMonstersNearby(bool attack)
// hide the cursor when we start walking via keyboard/controller
void HideCursor()
{
if (pcurs >= CURSOR_FIRSTITEM) // if we don't drop the item on cursor, it will be destroyed
if (pcurs >= CURSOR_FIRSTITEM) // drop item to allow us to pick up other items
DropItemBeforeTrig();
SetCursorPos(320, 180);
MouseX = 320;
MouseY = 180;
if (pcurs == CURSOR_REPAIR || pcurs == CURSOR_RECHARGE)
SetCursor_(CURSOR_HAND);
sgbControllerActive = true;
}
@ -625,6 +627,8 @@ void performPrimaryAction()
CheckIdentify(myplr, pcursinvitem);
else if (pcurs == CURSOR_REPAIR)
DoRepair(myplr, pcursinvitem);
else if (pcurs == CURSOR_RECHARGE)
DoRecharge(myplr, pcursinvitem);
else
CheckInvItem();
}

Loading…
Cancel
Save