Browse Source

Correct type in calls to AddPanelString

pull/133/head
Anders Jenbo 7 years ago
parent
commit
334c06c6d3
  1. 28
      Source/control.cpp
  2. 4
      Source/cursor.cpp
  3. 8
      Source/diablo.cpp
  4. 74
      Source/items.cpp
  5. 16
      Source/monster.cpp

28
Source/control.cpp

@ -436,7 +436,7 @@ void DrawSpellList()
sprintf(infostr, "%s Spell", spelldata[pSpell].sNameText);
if (pSpell == SPL_HBOLT) {
sprintf(tempstr, "Damages undead only");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
if (s == 0)
sprintf(tempstr, "Spell Level 0 - Unusable");
@ -480,7 +480,7 @@ void DrawSpellList()
if (plr[myplr]._pSplHotKey[t] == pSpell && plr[myplr]._pSplTHotKey[t] == pSplType) {
DrawSpellCel(x, y, pSpellCels, t + 48, 56);
sprintf(tempstr, "Spell Hot Key #F%i", t + 5);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
}
}
@ -1342,7 +1342,7 @@ void CheckPanelInfo()
}
if (PanBtnHotKey[i]) {
sprintf(tempstr, "Hotkey : %s", PanBtnHotKey[i]);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
infoclr = COL_WHITE;
panelflag = 1;
@ -1355,17 +1355,17 @@ void CheckPanelInfo()
panelflag = 1;
pinfoflag = TRUE;
strcpy(tempstr, "Hotkey : 's'");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
v = plr[myplr]._pRSpell;
if (v != -1) {
switch (plr[myplr]._pRSplType) {
case RSPLTYPE_SKILL:
sprintf(tempstr, "%s Skill", spelldata[v].sSkillText);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
case RSPLTYPE_SPELL:
sprintf(tempstr, "%s Spell", spelldata[v].sNameText);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
c = plr[myplr]._pISplLvlAdd + plr[myplr]._pSplLvl[v];
if (c < 0)
c = 0;
@ -1373,11 +1373,11 @@ void CheckPanelInfo()
sprintf(tempstr, "Spell Level 0 - Unusable");
else
sprintf(tempstr, "Spell Level %i", c);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
case RSPLTYPE_SCROLL:
sprintf(tempstr, "Scroll of %s", spelldata[v].sNameText);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
s = 0;
for (i = 0; i < plr[myplr]._pNumInv; i++) {
if (plr[myplr].InvList[i]._itype != -1
@ -1397,16 +1397,16 @@ void CheckPanelInfo()
strcpy(tempstr, "1 Scroll");
else
sprintf(tempstr, "%i Scrolls", s);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
case RSPLTYPE_CHARGES:
sprintf(tempstr, "Staff of %s", spelldata[v].sNameText);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._iCharges == 1)
strcpy(tempstr, "1 Charge");
else
sprintf(tempstr, "%i Charges", plr[myplr].InvBody[INVLOC_HAND_LEFT]._iCharges);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
}
}
@ -1551,7 +1551,7 @@ void DrawInfoBox()
sprintf(infostr, "%i gold %s", nGold, get_pieces_str(plr[myplr].HoldItem._ivalue));
} else if (!plr[myplr].HoldItem._iStatFlag) {
ClearPanel();
AddPanelString("Requirements not met", 1);
AddPanelString("Requirements not met", TRUE);
pinfoflag = TRUE;
} else {
if (plr[myplr].HoldItem._iIdentified)
@ -1588,9 +1588,9 @@ void DrawInfoBox()
strcpy(infostr, plr[pcursplr]._pName);
ClearPanel();
sprintf(tempstr, "Level : %i", plr[pcursplr]._pLevel);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
sprintf(tempstr, "Hit Points %i of %i", plr[pcursplr]._pHitPoints >> 6, plr[pcursplr]._pMaxHP >> 6);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
}
if (infostr[0] || pnumlines)

4
Source/cursor.cpp

@ -131,7 +131,7 @@ void CheckTown()
ClearPanel();
strcpy(infostr, "Town Portal");
sprintf(tempstr, "from %s", plr[missile[mx]._misource]._pName);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
cursmx = missile[mx]._mix;
cursmy = missile[mx]._miy;
}
@ -160,7 +160,7 @@ void CheckRportal()
strcpy(tempstr, "The Unholy Altar");
else
strcpy(tempstr, "level 15");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
cursmx = missile[mx]._mix;
cursmy = missile[mx]._miy;
}

8
Source/diablo.cpp

@ -1095,8 +1095,8 @@ void PressKey(int vkey)
helpflag = 0;
} else if(stextflag) {
ClearPanel();
AddPanelString("No help available", 1); /// BUGFIX: message isn't displayed
AddPanelString("while in stores", 1);
AddPanelString("No help available", TRUE); /// BUGFIX: message isn't displayed
AddPanelString("while in stores", TRUE);
track_repeat_walk(0);
} else {
invflag = 0;
@ -1915,8 +1915,8 @@ void timeout_cursor(BOOL bTimeout)
sgnTimeoutCurs = pcurs;
multi_net_ping();
ClearPanel();
AddPanelString("-- Network timeout --", 1);
AddPanelString("-- Waiting for players --", 1);
AddPanelString("-- Network timeout --", TRUE);
AddPanelString("-- Waiting for players --", TRUE);
SetCursor_(CURSOR_HOURGLASS);
drawpanflag = 255;
}

74
Source/items.cpp

@ -2585,67 +2585,67 @@ void PrintItemOil(char IDidx)
switch (IDidx) {
case IMISC_FULLHEAL:
strcpy(tempstr, "fully recover life");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
case IMISC_HEAL:
strcpy(tempstr, "recover partial life");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
case IMISC_OLDHEAL:
strcpy(tempstr, "recover life");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
case IMISC_DEADHEAL:
strcpy(tempstr, "deadly heal");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
case IMISC_MANA:
strcpy(tempstr, "recover mana");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
case IMISC_FULLMANA:
strcpy(tempstr, "fully recover mana");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
case IMISC_ELIXSTR:
strcpy(tempstr, "increase strength");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
case IMISC_ELIXMAG:
strcpy(tempstr, "increase magic");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
case IMISC_ELIXDEX:
strcpy(tempstr, "increase dexterity");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
case IMISC_ELIXVIT:
strcpy(tempstr, "increase vitality");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
case IMISC_ELIXWEAK:
strcpy(tempstr, "decrease strength");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
case IMISC_ELIXDIS:
strcpy(tempstr, "decrease strength");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
case IMISC_ELIXCLUM:
strcpy(tempstr, "decrease dexterity");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
case IMISC_ELIXSICK:
strcpy(tempstr, "decrease vitality");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
case IMISC_REJUV:
strcpy(tempstr, "recover life and mana");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
case IMISC_FULLREJUV:
strcpy(tempstr, "fully recover life and mana");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
break;
}
}
@ -2997,30 +2997,30 @@ void PrintItemMisc(ItemStruct *x)
{
if (x->_iMiscId == IMISC_SCROLL) {
strcpy(tempstr, "Right-click to read");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
if (x->_iMiscId == IMISC_SCROLLT) {
strcpy(tempstr, "Right-click to read, then");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
strcpy(tempstr, "left-click to target");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
if (x->_iMiscId >= IMISC_USEFIRST && x->_iMiscId <= IMISC_USELAST) {
PrintItemOil(x->_iMiscId);
strcpy(tempstr, "Right click to use");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
if (x->_iMiscId == IMISC_BOOK) {
strcpy(tempstr, "Right click to read");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
if (x->_iMiscId == IMISC_MAPOFDOOM) {
strcpy(tempstr, "Right click to view");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
if (x->_iMiscId == IMISC_EAR) {
sprintf(tempstr, "Level : %i", x->_ivalue);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
}
@ -3031,30 +3031,30 @@ void PrintItemDetails(ItemStruct *x)
sprintf(tempstr, "damage: %i-%i Indestructible", x->_iMinDam, x->_iMaxDam);
else
sprintf(tempstr, "damage: %i-%i Dur: %i/%i", x->_iMinDam, x->_iMaxDam, x->_iDurability, x->_iMaxDur);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
if (x->_iClass == ICLASS_ARMOR) {
if (x->_iMaxDur == 255)
sprintf(tempstr, "armor: %i Indestructible", x->_iAC);
else
sprintf(tempstr, "armor: %i Dur: %i/%i", x->_iAC, x->_iDurability, x->_iMaxDur);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
if (x->_iMiscId == IMISC_STAFF && x->_iMaxCharges) {
sprintf(tempstr, "dam: %i-%i Dur: %i/%i", x->_iMinDam, x->_iMaxDam, x->_iDurability, x->_iMaxDur);
sprintf(tempstr, "Charges: %i/%i", x->_iCharges, x->_iMaxCharges);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
if (x->_iPrePower != -1) {
PrintItemPower(x->_iPrePower, x);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
if (x->_iSufPower != -1) {
PrintItemPower(x->_iSufPower, x);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
if (x->_iMagical == ITEM_QUALITY_UNIQUE) {
AddPanelString("unique item", 1);
AddPanelString("unique item", TRUE);
uitemflag = 1;
curruitem = *x;
}
@ -3067,7 +3067,7 @@ void PrintItemDetails(ItemStruct *x)
sprintf(tempstr, "%s %i Mag", tempstr, x->_iMinMag);
if (x->_iMinDex)
sprintf(tempstr, "%s %i Dex", tempstr, x->_iMinDex);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
pinfoflag = TRUE;
}
@ -3079,29 +3079,29 @@ void PrintItemDur(ItemStruct *x)
sprintf(tempstr, "damage: %i-%i Indestructible", x->_iMinDam, x->_iMaxDam);
else
sprintf(tempstr, "damage: %i-%i Dur: %i/%i", x->_iMinDam, x->_iMaxDam, x->_iDurability, x->_iMaxDur);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
if (x->_iMiscId == IMISC_STAFF && x->_iMaxCharges) {
sprintf(tempstr, "Charges: %i/%i", x->_iCharges, x->_iMaxCharges);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
if (x->_iMagical != ITEM_QUALITY_NORMAL)
AddPanelString("Not Identified", 1);
AddPanelString("Not Identified", TRUE);
}
if (x->_iClass == ICLASS_ARMOR) {
if (x->_iMaxDur == 255)
sprintf(tempstr, "armor: %i Indestructible", x->_iAC);
else
sprintf(tempstr, "armor: %i Dur: %i/%i", x->_iAC, x->_iDurability, x->_iMaxDur);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
if (x->_iMagical != ITEM_QUALITY_NORMAL)
AddPanelString("Not Identified", 1);
AddPanelString("Not Identified", TRUE);
if (x->_iMiscId == IMISC_STAFF && x->_iMaxCharges) {
sprintf(tempstr, "Charges: %i/%i", x->_iCharges, x->_iMaxCharges);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
}
if (x->_itype == ITYPE_RING || x->_itype == ITYPE_AMULET)
AddPanelString("Not Identified", 1);
AddPanelString("Not Identified", TRUE);
PrintItemMisc(x);
if (x->_iMinMag + x->_iMinDex + x->_iMinStr) {
strcpy(tempstr, "Required:");

16
Source/monster.cpp

@ -4995,7 +4995,7 @@ void PrintMonstHistory(int mt)
int minHP, maxHP, res;
sprintf(tempstr, "Total kills : %i", monstkills[mt]);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
if (monstkills[mt] >= 30) {
minHP = monsterdata[mt].mMinHP;
maxHP = monsterdata[mt].mMaxHP;
@ -5016,7 +5016,7 @@ void PrintMonstHistory(int mt)
maxHP = 4 * maxHP + 3;
}
sprintf(tempstr, "Hit Points : %i-%i", minHP, maxHP);
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
if (monstkills[mt] >= 15) {
if (gnDifficulty != DIFF_HELL)
@ -5026,7 +5026,7 @@ void PrintMonstHistory(int mt)
res = res & (RESIST_MAGIC | RESIST_FIRE | RESIST_LIGHTNING | IMUNE_MAGIC | IMUNE_FIRE | IMUNE_LIGHTNING);
if (!res) {
strcpy(tempstr, "No magic resistance");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
} else{
if (res & (RESIST_MAGIC | RESIST_FIRE | RESIST_LIGHTNING)) {
strcpy(tempstr, "Resists : ");
@ -5037,7 +5037,7 @@ void PrintMonstHistory(int mt)
if (res & RESIST_LIGHTNING)
strcat(tempstr, "Lightning ");
tempstr[strlen(tempstr) - 1] = '\0';
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
if (res & (IMUNE_MAGIC | IMUNE_FIRE | IMUNE_LIGHTNING)) {
strcpy(tempstr, "Immune : ");
@ -5048,7 +5048,7 @@ void PrintMonstHistory(int mt)
if (res & IMUNE_LIGHTNING)
strcat(tempstr, "Lightning ");
tempstr[strlen(tempstr) - 1] = '\0';
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
}
}
}
@ -5062,21 +5062,21 @@ void PrintUniqueHistory()
res = monster[pcursmonst].mMagicRes & (RESIST_MAGIC | RESIST_FIRE | RESIST_LIGHTNING | IMUNE_MAGIC | IMUNE_FIRE | IMUNE_LIGHTNING);
if (!res) {
strcpy(tempstr, "No resistances");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
strcpy(tempstr, "No Immunities");
} else {
if (res & (RESIST_MAGIC | RESIST_FIRE | RESIST_LIGHTNING))
strcpy(tempstr, "Some Magic Resistances");
else
strcpy(tempstr, "No resistances");
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
if (res & (IMUNE_MAGIC | IMUNE_FIRE | IMUNE_LIGHTNING)) {
strcpy(tempstr, "Some Magic Immunities");
} else {
strcpy(tempstr, "No Immunities");
}
}
AddPanelString(tempstr, 1);
AddPanelString(tempstr, TRUE);
pinfoflag = TRUE;
}

Loading…
Cancel
Save