diff options
author | Bendegúz Nagy | 2016-06-28 13:36:58 +0200 |
---|---|---|
committer | Bendegúz Nagy | 2016-08-26 23:02:22 +0200 |
commit | c40aca2d2d146ca6e3e56ee11dd504d9e4d31afb (patch) | |
tree | 6116cde8763253220405a3499656d93765d6f547 /engines | |
parent | cb9979fade6cd5746ea54c261bdaa8c28e375f3e (diff) | |
download | scummvm-rg350-c40aca2d2d146ca6e3e56ee11dd504d9e4d31afb.tar.gz scummvm-rg350-c40aca2d2d146ca6e3e56ee11dd504d9e4d31afb.tar.bz2 scummvm-rg350-c40aca2d2d146ca6e3e56ee11dd504d9e4d31afb.zip |
DM: Add F0335_INVENTORY_DrawPanel_ObjectDescriptionString
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dm/TODOs/methodtree.txt | 6 | ||||
-rw-r--r-- | engines/dm/inventory.cpp | 36 | ||||
-rw-r--r-- | engines/dm/inventory.h | 3 |
3 files changed, 43 insertions, 2 deletions
diff --git a/engines/dm/TODOs/methodtree.txt b/engines/dm/TODOs/methodtree.txt index 064e09581a..ab44a3f179 100644 --- a/engines/dm/TODOs/methodtree.txt +++ b/engines/dm/TODOs/methodtree.txt @@ -54,14 +54,16 @@ F0280_CHAMPION_AddCandidateChampionToParty // done, so-so F0303_CHAMPION_GetSkillLevel // done F0332_INVENTORY_DrawIconToViewport // done F0336_INVENTORY_DrawPanel_BuildObjectAttributesString // done - F0335_INVENTORY_DrawPanel_ObjectDescriptionString + F0335_INVENTORY_DrawPanel_ObjectDescriptionString // done + G0421_i_ObjectDescriptionTextX // done + G0422_i_ObjectDescriptionTextY // done F0339_INVENTORY_DrawPanel_ArrowOrEye G0430_apc_DirectionNames G0034_s_Graphic562_Box_ObjectDescriptionCircle G0032_s_Graphic562_Box_Panel G0352_apc_ObjectNames G0237_as_Graphic559_ObjectInfo - G0422_i_ObjectDescriptionTextY + G0422_i_ObjectDescriptionTextY // done F0346_INVENTORY_DrawPanel_ResurrectReincarnate // done F0291_CHAMPION_DrawSlot // done diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp index b23321bb3c..fe7807de13 100644 --- a/engines/dm/inventory.cpp +++ b/engines/dm/inventory.cpp @@ -369,4 +369,40 @@ void InventoryMan::buildObjectAttributeString(int16 potentialAttribMask, int16 a strcat(destString, suffixString); } + +void InventoryMan::drawPanelObjectDescriptionString(char* descString) { + if (descString[0] == '\f') { // form feed + descString++; + _objDescTextXpos = 108; + _objDescTextYpos = 59; + } + + if (descString[0]) { + char stringTmpBuff[128]; + strcpy(stringTmpBuff, descString); + + char *stringLine = stringTmpBuff; + bool severalLines = false; + char *string = nullptr; + while (*stringLine) { + if (strlen(stringLine) > 18) { // if string is too long to fit on one line + string = &stringLine[17]; + while (*string != ' ') // go back to the last space character + string--; + + *string = '\0'; // and split the string there + severalLines = true; + } + + _vm->_textMan->printToViewport(_objDescTextXpos, _objDescTextYpos, kColorLightestGray, stringLine); + _objDescTextYpos += 7; + if (severalLines) { + severalLines = false; + stringLine = ++string; + } else { + *stringLine = '\0'; + } + } + } +} } diff --git a/engines/dm/inventory.h b/engines/dm/inventory.h index ac68b544b9..18fe179958 100644 --- a/engines/dm/inventory.h +++ b/engines/dm/inventory.h @@ -58,6 +58,8 @@ public: PanelContent _panelContent; // @ G0424_i_PanelContent Thing _chestSlots[8]; // @ G0425_aT_ChestSlots Thing _openChest; // @ G0426_T_OpenChest + int16 _objDescTextXpos; // @ G0421_i_ObjectDescriptionTextX + int16 _objDescTextYpos; // @ G0422_i_ObjectDescriptionTextY void toggleInventory(ChampionIndex championIndex); // @ F0355_INVENTORY_Toggle_CPSE void drawStatusBoxPortrait(ChampionIndex championIndex); // @ F0354_INVENTORY_DrawStatusBoxPortrait @@ -73,6 +75,7 @@ public: void drawIconToViewport(IconIndice iconIndex, int16 xPos, int16 yPos); // @ F0332_INVENTORY_DrawIconToViewport void buildObjectAttributeString(int16 potentialAttribMask, int16 actualAttribMask, char ** attribStrings, char *destString, char *prefixString, char *suffixString); // @ F0336_INVENTORY_DrawPanel_BuildObjectAttributesString + void drawPanelObjectDescriptionString(char *descString); // @ F0335_INVENTORY_DrawPanel_ObjectDescriptionString }; |