Skip to content

Commit

Permalink
DM: Add F0393_MENUS_DrawSpellAreaControls
Browse files Browse the repository at this point in the history
  • Loading branch information
Bendegúz Nagy committed Aug 26, 2016
1 parent 12d3591 commit 5893dc7
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 1 deletion.
1 change: 1 addition & 0 deletions engines/dm/champion.cpp
Expand Up @@ -95,6 +95,7 @@ ChampionMan::ChampionMan(DMEngine *vm) : _vm(vm) {
_partyIsSleeping = false;
_leaderHandObjectIconIndex = kIconIndiceNone;
_leaderEmptyHanded = true;
_magicCasterChampionIndex = kChampionNone;
}

uint16 ChampionMan::getChampionPortraitX(uint16 index) {
Expand Down
1 change: 1 addition & 0 deletions engines/dm/champion.h
Expand Up @@ -440,6 +440,7 @@ class ChampionMan {
IconIndice _leaderHandObjectIconIndex; // @ G0413_i_LeaderHandObjectIconIndex
bool _leaderEmptyHanded; // @ G0415_B_LeaderEmptyHanded
Party _party; // @ G0407_s_Party
ChampionIndex _magicCasterChampionIndex; // @ G0514_i_MagicCasterChampionIndex

explicit ChampionMan(DMEngine *vm);
void resetDataToStartGame(); // @ F0278_CHAMPION_ResetDataToStartGame
Expand Down
3 changes: 2 additions & 1 deletion engines/dm/eventman.cpp
Expand Up @@ -33,6 +33,7 @@
#include "movesens.h"
#include "objectman.h"
#include "inventory.h"
#include "menus.h"



Expand Down Expand Up @@ -674,7 +675,7 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
commandSetLeader(kChampionFirst);
warning("MISSING CODE: F0394_MENUS_SetMagicCasterAndDrawSpellArea");
} else {
warning("MISSING CODE: F0393_MENUS_DrawSpellAreaControls");
_vm->_menuMan->drawSpellAreaControls(champMan._magicCasterChampionIndex);
}

warning("MISSING CODE: F0051_TEXT_MESSAGEAREA_PrintLineFeed");
Expand Down
71 changes: 71 additions & 0 deletions engines/dm/menus.cpp
Expand Up @@ -223,4 +223,75 @@ const char* MenuMan::getActionName(ChampionAction actionIndex) {
return (actionIndex == kChampionActionNone) ? "" : gChampionActionNames[actionIndex];
}


Box gBoxSpellAreaControls = Box(233, 319, 42, 49); // @ G0504_s_Graphic560_Box_SpellAreaControls

void MenuMan::drawSpellAreaControls(ChampionIndex champIndex) {
ChampionMan &champMan = *_vm->_championMan;
DisplayMan &dispMan = *_vm->_displayMan;
TextMan &textMan = *_vm->_textMan;

Champion &champ = champMan._champions[champIndex];
int16 champCurrHealth[4];
for (uint16 i = 0; i < 4; ++i)
champCurrHealth[i] = champMan._champions[i]._currHealth;
warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
dispMan.clearScreenBox(kColorBlack, gBoxSpellAreaControls);
int16 champCount = champMan._partyChampionCount;
switch (champIndex) {
case kChampionFirst:
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
textMan.printTextToScreen(235, 48, kColorBlack, kColorCyan, champ._name);
if (champCount) {
if (champCurrHealth[1]) {
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
}
labelChamp2:
if (champCount > 2) {
if (champCurrHealth[2]) {
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
}
labelChamp3:
if (champCount > 3) {
if (champCurrHealth[3]) {
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
}
}
}
}
break;
case kChampionSecond:
if (champCurrHealth[0]) {
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
}
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
textMan.printTextToScreen(249, 48, kColorBlack, kColorCyan, champ._name);
goto labelChamp2;
case kChampionThird:
if (champCurrHealth[0]) {
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
}
if (champCurrHealth[1]) {
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
}
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
textMan.printTextToScreen(263, 48, kColorBlack, kColorCyan, champ._name);
goto labelChamp3;
case kChampionFourth:
if (champCurrHealth[0]) {
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
}
if (champCurrHealth[1]) {
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
}
if (champCurrHealth[2]) {
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
}
warning("MISSING CODE: F0006_MAIN_HighlightScreenBox");
textMan.printTextToScreen(277, 48, kColorBlack, kColorCyan, champ._name);
break;
}
warning("MISSING CODE: F0078_MOUSE_ShowPointer");
}

}
1 change: 1 addition & 0 deletions engines/dm/menus.h
Expand Up @@ -65,6 +65,7 @@ class MenuMan {
void refreshActionAreaAndSetChampDirMaxDamageReceived(); // @ F0390_MENUS_RefreshActionAreaAndSetChampionDirectionMaximumDamageReceived
void drawActionArea(); // @ F0387_MENUS_DrawActionArea
const char* getActionName(ChampionAction actionIndex); // @ F0384_MENUS_GetActionName
void drawSpellAreaControls(ChampionIndex champIndex); // @ F0393_MENUS_DrawSpellAreaControls
};

}
Expand Down

0 comments on commit 5893dc7

Please sign in to comment.