mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 19:44:54 +02:00
creature names font fix
This commit is contained in:
@@ -3,6 +3,7 @@ Font
|
|||||||
texture: verdana-11px-rounded.png
|
texture: verdana-11px-rounded.png
|
||||||
height: 14
|
height: 14
|
||||||
glyph-size: 16 16
|
glyph-size: 16 16
|
||||||
|
spacing: -1 0
|
||||||
|
|
||||||
glyph-widths:
|
glyph-widths:
|
||||||
32: 4
|
32: 4
|
||||||
|
@@ -189,6 +189,8 @@ const std::vector<Point>& Font::calculateGlyphsPositions(const std::string& text
|
|||||||
lineWidths[lines] = 0;
|
lineWidths[lines] = 0;
|
||||||
} else if(glyph >= 32) {
|
} else if(glyph >= 32) {
|
||||||
lineWidths[lines] += m_glyphsSize[glyph].width() ;
|
lineWidths[lines] += m_glyphsSize[glyph].width() ;
|
||||||
|
if((i+1 != textLength && text[i+1] != '\n')) // only add space if letter is not the last or before a \n.
|
||||||
|
lineWidths[lines] += m_glyphSpacing.width();
|
||||||
maxLineWidth = std::max(maxLineWidth, lineWidths[lines]);
|
maxLineWidth = std::max(maxLineWidth, lineWidths[lines]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -221,7 +223,7 @@ const std::vector<Point>& Font::calculateGlyphsPositions(const std::string& text
|
|||||||
|
|
||||||
// render only if the glyph is valid
|
// render only if the glyph is valid
|
||||||
if(glyph >= 32 && glyph != (uchar)'\n') {
|
if(glyph >= 32 && glyph != (uchar)'\n') {
|
||||||
virtualPos.x += m_glyphsSize[glyph].width();
|
virtualPos.x += m_glyphsSize[glyph].width() + m_glyphSpacing.width();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1055,6 +1055,9 @@ ThingPtr ProtocolGame::internalGetThing(InputMessage& msg)
|
|||||||
uint32 id = msg.getU32();
|
uint32 id = msg.getU32();
|
||||||
std::string name = msg.getString();
|
std::string name = msg.getString();
|
||||||
|
|
||||||
|
if(name.length() > 0) // every creature name must have a capital letter
|
||||||
|
name[0] = toupper(name[0]);
|
||||||
|
|
||||||
g_map.removeCreatureById(removeId);
|
g_map.removeCreatureById(removeId);
|
||||||
|
|
||||||
if(m_localPlayer->getId() == id)
|
if(m_localPlayer->getId() == id)
|
||||||
|
Reference in New Issue
Block a user