Changed: Remove char limit from displaying icon label

fix-media-player
Nimetu 5 years ago
parent 7cb5c817a6
commit ca20d582b3

@ -1293,10 +1293,10 @@ void CDBCtrlSheet::setupItem ()
// special icon text // special icon text
if( _NeedSetup || _ItemSheet->getIconText() != _OptString ) if( _NeedSetup || _ItemSheet->getIconText() != _OptString )
{ {
// compute from OptString. Allow only 1 line and 4 chars // compute from OptString. Allow only 1 line (-2 for padding)
_OptString= _ItemSheet->getIconText(); _OptString= _ItemSheet->getIconText();
// Display Top Left // Display Top Left
setupCharBitmaps(40, 1, 6, true); setupCharBitmaps(40-2, 1, true);
} }
// Special Item requirement // Special Item requirement
@ -1410,8 +1410,8 @@ void CDBCtrlSheet::setupMacro()
{ {
if (!_NeedSetup) return; if (!_NeedSetup) return;
// compute from OptString // compute from OptString (-2 for padding)
setupCharBitmaps(26, 4, 5); setupCharBitmaps(26-2, 4);
_NeedSetup = false; _NeedSetup = false;
@ -1713,8 +1713,8 @@ void CDBCtrlSheet::setupDisplayAsPhrase(const std::vector<NLMISC::CSheetId> &bri
{ {
// recompute text // recompute text
_OptString= iconName; _OptString= iconName;
// compute from OptString. Allow only 1 line and 5 chars // compute from OptString. Allow only 1 line (-2 for padding)
setupCharBitmaps(26, 1, 5); setupCharBitmaps(26-2, 1);
} }
} }
} }
@ -1840,10 +1840,10 @@ void CDBCtrlSheet::setupOutpostBuilding()
// special icon text // special icon text
if (pOBSheet->getIconText() != _OptString) if (pOBSheet->getIconText() != _OptString)
{ {
// compute from OptString. Allow only 1 line and 4 chars // compute from OptString. Allow only 1 line, (-2 for padding)
_OptString= pOBSheet->getIconText(); _OptString= pOBSheet->getIconText();
// Display Top Left // Display Top Left
setupCharBitmaps(40, 1, 6, true); setupCharBitmaps(40-2, 1, true);
} }
} }
else else
@ -1886,7 +1886,7 @@ void CDBCtrlSheet::resetCharBitmaps()
} }
// *************************************************************************** // ***************************************************************************
void CDBCtrlSheet::setupCharBitmaps(sint32 maxW, sint32 maxLine, sint32 maxWChar, bool topDown) void CDBCtrlSheet::setupCharBitmaps(sint32 maxW, sint32 maxLine, bool topDown)
{ {
// Use the optString for the Macro name // Use the optString for the Macro name
_OptString = toLower(_OptString); _OptString = toLower(_OptString);
@ -1907,7 +1907,7 @@ void CDBCtrlSheet::setupCharBitmaps(sint32 maxW, sint32 maxLine, sint32 maxWChar
{ {
char c = _OptString[i]; char c = _OptString[i];
sint32 w = rVR.getTypoTextureW(c); sint32 w = rVR.getTypoTextureW(c);
if ((curLineSize + w) > maxW || (sint32)xChar>=maxWChar) if ((curLineSize + w) > maxW)
{ {
lineNb ++; lineNb ++;
if (lineNb == maxLine) break; if (lineNb == maxLine) break;

@ -815,7 +815,7 @@ private:
// remove enchant and buff markers from item icon // remove enchant and buff markers from item icon
void clearIconBuffs(); void clearIconBuffs();
void setupCharBitmaps(sint32 maxW, sint32 maxLine, sint32 maxWChar= 1000, bool topDown= false); void setupCharBitmaps(sint32 maxW, sint32 maxLine, bool topDown= false);
void resetCharBitmaps(); void resetCharBitmaps();
void displayCharBitmaps(sint32 rdrLayer, sint32 x, sint32 y, NLMISC::CRGBA color); void displayCharBitmaps(sint32 rdrLayer, sint32 x, sint32 y, NLMISC::CRGBA color);

Loading…
Cancel
Save