diff options
author | Bendegúz Nagy | 2016-06-24 02:08:26 +0200 |
---|---|---|
committer | Bendegúz Nagy | 2016-08-26 23:02:22 +0200 |
commit | b820a36d3a94e9510e313144378b789efe954fe4 (patch) | |
tree | 4754e6fd419d8818c2eef248a35a2ad8b797e31b | |
parent | eddf2f494d3e750519e0d515d97834f05974c3c1 (diff) | |
download | scummvm-rg350-b820a36d3a94e9510e313144378b789efe954fe4.tar.gz scummvm-rg350-b820a36d3a94e9510e313144378b789efe954fe4.tar.bz2 scummvm-rg350-b820a36d3a94e9510e313144378b789efe954fe4.zip |
DM: Add F0378_COMMAND_ProcessType81_ClickInPanel
-rw-r--r-- | engines/dm/eventman.cpp | 38 | ||||
-rw-r--r-- | engines/dm/eventman.h | 1 | ||||
-rw-r--r-- | engines/dm/inventory.cpp | 2 |
3 files changed, 28 insertions, 13 deletions
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index ca094210ec..689d9fd551 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -420,20 +420,11 @@ void EventManager::processCommandQueue() { } if (cmd._type == kCommandClickInDungeonView) { - /*warning("DUMMY CODE, all of this"); - DungeonMan &dunMan = *_vm->_dungeonMan; - CurrMapData &currMap = dunMan._currMap; - uint16 mapX = currMap._partyPosX; - uint16 mapY = currMap._partyPosY; - mapX += gDirIntoStepCountEast[currMap._partyDir]; - mapY += gDirIntoStepCountNorth[currMap._partyDir]; - Thing squareFirstThing = dunMan.getSquareFirstThing(mapX, mapY); - Sensor sensor(dunMan.getThingData(squareFirstThing)); - if (sensor.getType() == kSensorWallChampionPortrait) { - _vm->_championMan->addCandidateChampionToParty(sensor.getData()); - }*/ commandProcessType80ClickInDungeonView(commandX, commandY); } + if (cmd._type == kCommandClickInPanel) { + commandProcess81ClickInPanel(commandX, commandY); + } // MISSING CODE: the rest of the function } @@ -696,4 +687,27 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane warning("MISSING CODE: F0067_MOUSE_SetPointerToNormal"); } +void EventManager::commandProcess81ClickInPanel(int16 x, int16 y) { + ChampionMan &champMan = *_vm->_championMan; + InventoryMan &invMan = *_vm->_inventoryMan; + + CommandType commandType; + switch (invMan._panelContent) { + case kPanelContentChest: + if (champMan._leaderIndex == kChampionNone) // if no leader + return; + commandType = getCommandTypeFromMouseInput(gMouseInput_PanelChest, Common::Point(x, y), kLeftMouseButton); + if (commandType != kCommandNone) + warning("MISSING CODE: F0302_CHAMPION_ProcessCommands28To65_ClickOnSlotBox"); + break; + case kPanelContentResurrectReincarnate: + if (!champMan._leaderEmptyHanded) + break; + commandType = getCommandTypeFromMouseInput(gMouseInput_PanelChest, Common::Point(x, y), kLeftMouseButton); + if (commandType != kCommandNone) + commandProcessCommands160To162ClickInResurrectReincarnatePanel(commandType); + break; + } +} + }; // end of namespace DM diff --git a/engines/dm/eventman.h b/engines/dm/eventman.h index fa4728741d..ca9587716c 100644 --- a/engines/dm/eventman.h +++ b/engines/dm/eventman.h @@ -250,6 +250,7 @@ public: void commandProcessType80ClickInDungeonViewTouchFrontWall(); // @ F0372_COMMAND_ProcessType80_ClickInDungeonView_TouchFrontWall void commandProcessType80ClickInDungeonView(int16 posX, int16 posY); // @ F0377_COMMAND_ProcessType80_ClickInDungeonView void commandProcessCommands160To162ClickInResurrectReincarnatePanel(CommandType commandType); // @ F0282_CHAMPION_ProcessCommands160To162_ClickInResurrectReincarnatePanel + void commandProcess81ClickInPanel(int16 x, int16 y); // @ F0378_COMMAND_ProcessType81_ClickInPanel }; } diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp index 2fd4f4157c..550c4c85c6 100644 --- a/engines/dm/inventory.cpp +++ b/engines/dm/inventory.cpp @@ -53,7 +53,7 @@ void InventoryMan::toggleInventory(ChampionIndex championIndex) { EventManager &em = *_vm->_eventMan; DisplayMan &dm = *_vm->_displayMan; - if ((championIndex == kChampionCloseInventory) && !cm._champions[championIndex]._currHealth) + if ((championIndex != kChampionCloseInventory) && !cm._champions[championIndex]._currHealth) return; if (_vm->_pressingEye || _vm->_pressingMouth) return; |