mirror of
https://github.com/edubart/otclient.git
synced 2025-12-22 16:27:10 +01:00
Partial 10.36 support, also fix #499
This commit is contained in:
@@ -53,6 +53,7 @@ Creature::Creature() : Thing()
|
||||
m_skull = Otc::SkullNone;
|
||||
m_shield = Otc::ShieldNone;
|
||||
m_emblem = Otc::EmblemNone;
|
||||
m_icon = Otc::NpcIconNone;
|
||||
m_lastStepDirection = Otc::InvalidDirection;
|
||||
m_nameCache.setFont(g_fonts.getFont("verdana-11px-rounded"));
|
||||
m_nameCache.setAlign(Fw::AlignTopCenter);
|
||||
@@ -258,7 +259,7 @@ void Creature::drawInformation(const Point& point, bool useGray, const Rect& par
|
||||
if(g_game.getFeature(Otc::GameBlueNpcNameColor) && isNpc() && m_healthPercent == 100 && !useGray)
|
||||
fillColor = Color(0x66, 0xcc, 0xff);
|
||||
|
||||
if(drawFlags & Otc::DrawBars) {
|
||||
if(drawFlags & Otc::DrawBars && (!isNpc() || !g_game.getFeature(Otc::GameHideNpcNames))) {
|
||||
g_painter->setColor(Color::black);
|
||||
g_painter->drawFilledRect(backgroundRect);
|
||||
|
||||
@@ -287,6 +288,11 @@ void Creature::drawInformation(const Point& point, bool useGray, const Rect& par
|
||||
Rect emblemRect = Rect(backgroundRect.x() + 13.5 + 12, backgroundRect.y() + 16, m_emblemTexture->getSize());
|
||||
g_painter->drawTexturedRect(emblemRect, m_emblemTexture);
|
||||
}
|
||||
if(m_icon != Otc::NpcIconNone && m_iconTexture) {
|
||||
g_painter->setColor(Color::white);
|
||||
Rect iconRect = Rect(backgroundRect.x() + 13.5 + 12, backgroundRect.y() + 5, m_iconTexture->getSize());
|
||||
g_painter->drawTexturedRect(iconRect, m_iconTexture);
|
||||
}
|
||||
}
|
||||
|
||||
void Creature::turn(Otc::Direction direction)
|
||||
@@ -708,6 +714,12 @@ void Creature::setEmblem(uint8 emblem)
|
||||
callLuaField("onEmblemChange", m_emblem);
|
||||
}
|
||||
|
||||
void Creature::setIcon(uint8 icon)
|
||||
{
|
||||
m_icon = icon;
|
||||
callLuaField("onIconChange", m_icon);
|
||||
}
|
||||
|
||||
void Creature::setSkullTexture(const std::string& filename)
|
||||
{
|
||||
m_skullTexture = g_textures.getTexture(filename);
|
||||
@@ -733,6 +745,12 @@ void Creature::setEmblemTexture(const std::string& filename)
|
||||
m_emblemTexture = g_textures.getTexture(filename);
|
||||
}
|
||||
|
||||
void Creature::setIconTexture(const std::string& filename)
|
||||
{
|
||||
m_iconTexture = g_textures.getTexture(filename);
|
||||
}
|
||||
|
||||
|
||||
void Creature::setSpeedFormula(double speedA, double speedB, double speedC)
|
||||
{
|
||||
m_speedFormula[Otc::SpeedFormulaA] = speedA;
|
||||
|
||||
Reference in New Issue
Block a user