DM: Add renameChampion stub, fix wrong inputArray EventManager::commandProcess81ClickInPanel

This commit is contained in:
Bendegúz Nagy 2016-06-25 13:31:47 +02:00
parent dad087454c
commit 9c544a44f2
8 changed files with 46 additions and 9 deletions

View file

@ -38,12 +38,12 @@ namespace DM {
Box gBoxMouth = Box(55, 72, 12, 29); // @ G0048_s_Graphic562_Box_Mouth
Box gBoxEye = Box(11, 28, 12, 29); // @ G0049_s_Graphic562_Box_Eye
Box gBoxChampionIcons[4] = {
Box gBoxChampionIcons[4] = {
Box(281, 299, 0, 13),
Box(301, 319, 0, 13),
Box(301, 319, 15, 28),
Box(281, 299, 15, 28)};
Color gChampionColor[4] = {(Color)7, (Color)11, (Color)8, (Color)14};
Color gChampionColor[4] = {(Color)7, (Color)11, (Color)8, (Color)14};
uint16 gSlotMasks[38] = { // @ G0038_ai_Graphic562_SlotMasks
/* 30 for champion inventory, 8 for chest */
@ -312,7 +312,7 @@ T0280046:
slotIndex_Green = AL_0_slotIndex_Red++;
}
break;
default:
break;
}
@ -690,7 +690,32 @@ void ChampionMan::drawSlot(uint16 champIndex, ChampionSlot slotIndex) {
}
}
void ChampionMan::renameChampion(Champion* champ) {
warning("STUB METHOD: Champion::renameChampion, F0281_CHAMPION_Rename");
DisplayMan &dispMan = *_vm->_displayMan;
TextMan &textMan = *_vm->_textMan;
Box box;
box._y1 = 3;
box._y2 = 8 + 1;
box._x1 = 3;
box._x2 = box._x1 + 167;
dispMan.clearScreenBox(kColorDarkestGray, box, gDungeonViewport);
dispMan.blitToScreen(dispMan.getBitmap(kPanelRenameChampionIndice), 144, 0, 0, gBoxPanel, kColorCyan, gDungeonViewport);
textMan.printToViewport(177, 58, kColorLightestGray, "_______");
textMan.printToViewport(105, 76, kColorLightestGray, "___________________");
Common::Point clickPos;
static Box okButtonBox(197, 215, 147, 155); // inclusive boundaries, constructor adds +1
for (;;) {
_vm->_eventMan->processInput();
if (_vm->_eventMan->hasPendingClick(clickPos, kLeftMouseButton) && okButtonBox.isPointInside(clickPos)) {
return;
}
dispMan.updateScreen();
}
}
}

View file

@ -451,6 +451,7 @@ public:
uint16 championIconIndex(int16 val, direction dir); // @ M26_CHAMPION_ICON_INDEX
void drawHealthStaminaManaValues(Champion *champ); // @ F0290_CHAMPION_DrawHealthStaminaManaValues
void drawSlot(uint16 champIndex, ChampionSlot slotIndex); // @ F0291_CHAMPION_DrawSlot
void renameChampion(Champion* champ); // @ F0281_CHAMPION_Rename
};

View file

@ -225,8 +225,8 @@ void DMEngine::gameloop() {
//} while (!_stopWaitingForPlayerInput || !_gameTimeTicking);
if (!_inventoryMan->_inventoryChampionOrdinal && !_championMan->_partyIsSleeping) {
Box box(0, 0 + 224 + 1, 33, 33 + 126 + 1);
_displayMan->clearScreenBox(kColorBlack, box); // dummy code
Box box(0, 224, 0, 126);
_displayMan->clearScreenBox(kColorBlack, box, gDungeonViewport); // dummy code
_displayMan->drawDungeon(_dungeonMan->_currMap._partyDir, _dungeonMan->_currMap._partyPosX, _dungeonMan->_currMap._partyPosY);
}
// DUMMY CODE: next line

View file

@ -659,7 +659,7 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
}
if (commandType == kCommandClickInPanelReincarnate) {
warning("MISSING CODE: F0281_CHAMPION_Rename");
champMan.renameChampion(champ);
champ->resetSkillsToZero();
for (uint16 i = 0; i < 12; i++) {
@ -703,11 +703,17 @@ void EventManager::commandProcess81ClickInPanel(int16 x, int16 y) {
case kPanelContentResurrectReincarnate:
if (!champMan._leaderEmptyHanded)
break;
commandType = getCommandTypeFromMouseInput(gMouseInput_PanelChest, Common::Point(x, y), kLeftMouseButton);
commandType = getCommandTypeFromMouseInput(gMouseInput_PanelResurrectReincarnateCancel, Common::Point(x, y), kLeftMouseButton);
if (commandType != kCommandNone)
commandProcessCommands160To162ClickInResurrectReincarnatePanel(commandType);
break;
}
}
bool EventManager::hasPendingClick(Common::Point& point, MouseButton button)
{
if (_pendingClickButton && button == _pendingClickButton)
point = _pendingClickPos;
return _pendingClickPresent;
}
}; // end of namespace DM

View file

@ -251,6 +251,8 @@ public:
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
bool hasPendingClick(Common::Point &point, MouseButton button);
};
}

View file

@ -70,7 +70,8 @@ enum GraphicIndice {
kSlotBoxWoundedIndice = 34, // @ C034_GRAPHIC_SLOT_BOX_WOUNDED
kChampionIcons = 28, // @ C028_GRAPHIC_CHAMPION_ICONS
kFontGraphicIndice = 557, // @ C557_GRAPHIC_FONT
kSlotBoxActingHandIndice = 35 // @ C035_GRAPHIC_SLOT_BOX_ACTING_HAND
kSlotBoxActingHandIndice = 35, // @ C035_GRAPHIC_SLOT_BOX_ACTING_HAND
kPanelRenameChampionIndice = 27 // @ C027_GRAPHIC_PANEL_RENAME_CHAMPION
};
extern uint16 gPalSwoosh[16];

View file

@ -37,7 +37,7 @@
namespace DM {
Box gBoxFloppyZzzCross = Box(174, 218, 2, 12); // @ G0041_s_Graphic562_Box_ViewportFloppyZzzCross
Box gBoxPanel = Box(80, 223, 52, 124); // @ G0032_s_Graphic562_Box_Panel
Box gBoxPanel = Box(80, 223, 52, 124);
Box gBoxFood = Box(112, 159, 60, 68); // @ G0035_s_Graphic562_Box_Food
Box gBoxWater = Box(112, 159, 83, 91); // @ G0036_s_Graphic562_Box_Water
Box gBoxPoisoned = Box(112, 207, 105, 119); // @ G0037_s_Graphic562_Box_Poisoned

View file

@ -36,6 +36,8 @@ namespace DM {
#define kChampionStatusBoxSpacing 69 // @ C69_CHAMPION_STATUS_BOX_SPACING
extern Box gBoxPanel; // @ G0032_s_Graphic562_Box_Panel
enum PanelContent {
kPanelContentFoodWaterPoisoned = 0, // @ C00_PANEL_FOOD_WATER_POISONED
kPanelContentScroll = 2, // @ C02_PANEL_SCROLL