DM: Add F0378_COMMAND_ProcessType81_ClickInPanel

This commit is contained in:
Bendegúz Nagy 2016-06-24 02:08:26 +02:00
parent eddf2f494d
commit b820a36d3a
3 changed files with 28 additions and 13 deletions

View File

@ -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

View File

@ -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
};
}

View File

@ -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;