Benny 735 Posted February 23, 2019 Report Share Posted February 23, 2019 PREVIEW: CÓDIGO: Procure essa parte em creature.cpp: if(drawFlags & Otc::DrawNames) { if(g_painter->getColor() != fillColor) g_painter->setColor(fillColor); m_nameCache.draw(textRect); } Troque por: if (drawFlags & Otc::DrawNames) { if (g_painter->getColor() != fillColor) g_painter->setColor(fillColor); CachedText shiny; shiny.setText("Shiny"); shiny.setFont(g_fonts.getFont("verdana-11px-rounded")); Rect shinyrect = Rect(point.x - shiny.getTextSize().width() / 2.0, point.y - 26, shiny.getTextSize()); if (m_name.find("Shiny") != std::string::npos) { char* shinys = "Shiny"; std::string nname = m_name; nname.erase(0, 5); m_nameCache.setText(nname); m_nameCache.draw(textRect); g_painter->setOpacity(0.5); g_painter->setColor(Color(255, 255, 0)); shiny.draw(shinyrect); g_painter->resetColor(); g_painter->resetOpacity(); m_nameCache.setText(m_name); } else { m_nameCache.draw(textRect); } } Créditos: @Refe Developer Berg, Wase Wiss, Cigarette and 3 others 5 1 Link to comment https://xtibia.com/forum/topic/249218-otclient-shiny-name/ Share on other sites More sharing options...
Ayron5 40 Posted February 23, 2019 Report Share Posted February 23, 2019 38 minutos atrás, bXnny disse: PREVIEW: CÓDIGO: Procure essa parte em creature.cpp: if(drawFlags & Otc::DrawNames) { if(g_painter->getColor() != fillColor) g_painter->setColor(fillColor); m_nameCache.draw(textRect); } Troque por: if (drawFlags & Otc::DrawNames) { if (g_painter->getColor() != fillColor) g_painter->setColor(fillColor); CachedText shiny; shiny.setText("Shiny"); shiny.setFont(g_fonts.getFont("verdana-11px-rounded")); Rect shinyrect = Rect(point.x - shiny.getTextSize().width() / 2.0, point.y - 26, shiny.getTextSize()); if (m_name.find("Shiny") != std::string::npos) { char* shinys = "Shiny"; std::string nname = m_name; nname.erase(0, 5); m_nameCache.setText(nname); m_nameCache.draw(textRect); g_painter->setOpacity(0.5); g_painter->setColor(Color(255, 255, 0)); shiny.draw(shinyrect); g_painter->resetColor(); g_painter->resetOpacity(); m_nameCache.setText(m_name); } else { m_nameCache.draw(textRect); } } Créditos: @Refe Nice! ^^ Link to comment https://xtibia.com/forum/topic/249218-otclient-shiny-name/#findComment-1749028 Share on other sites More sharing options...
XZero 68 Posted February 23, 2019 Report Share Posted February 23, 2019 Eu uso uma parada para colocar no nome em cima da sprite, que é configurada em Things.otml, não tem como por essa configuração para o "Shiny" ficar em cima do nome ? Link to comment https://xtibia.com/forum/topic/249218-otclient-shiny-name/#findComment-1749033 Share on other sites More sharing options...
Benny 735 Posted February 23, 2019 Author Report Share Posted February 23, 2019 9 horas atrás, XZero disse: Eu uso uma parada para colocar no nome em cima da sprite, que é configurada em Things.otml, não tem como por essa configuração para o "Shiny" ficar em cima do nome ? 12 horas atrás, bXnny disse: point.y - 26 Não tenho certeza, mas acho que nessa linha aí tu consegue mudar. Link to comment https://xtibia.com/forum/topic/249218-otclient-shiny-name/#findComment-1749039 Share on other sites More sharing options...
Refe 320 Posted February 23, 2019 Report Share Posted February 23, 2019 9 horas atrás, XZero disse: Eu uso uma parada para colocar no nome em cima da sprite, que é configurada em Things.otml, não tem como por essa configuração para o "Shiny" ficar em cima do nome ? Faz assim, logo depois na linha que começa com: Rect shinyrect Você poe: shinyrect.setBottom(textRect.getTop()); se nao for, troque o getTop() Por top() Eu fiz isso pelo celular, qualquer erro me avisa. Link to comment https://xtibia.com/forum/topic/249218-otclient-shiny-name/#findComment-1749043 Share on other sites More sharing options...
XZero 68 Posted February 23, 2019 Report Share Posted February 23, 2019 (edited) @Refe Agora não aparece o nome shiny Edited February 23, 2019 by XZero Link to comment https://xtibia.com/forum/topic/249218-otclient-shiny-name/#findComment-1749045 Share on other sites More sharing options...
Refe 320 Posted February 23, 2019 Report Share Posted February 23, 2019 Você usa o name displacement né? Link to comment https://xtibia.com/forum/topic/249218-otclient-shiny-name/#findComment-1749046 Share on other sites More sharing options...
XZero 68 Posted February 23, 2019 Report Share Posted February 23, 2019 @Refe Sim Link to comment https://xtibia.com/forum/topic/249218-otclient-shiny-name/#findComment-1749047 Share on other sites More sharing options...
Crypter 136 Posted February 23, 2019 Report Share Posted February 23, 2019 @XZero if (drawFlags & Otc::DrawNames) { if (g_painter->getColor() != fillColor) g_painter->setColor(fillColor); CachedText shiny; shiny.setText("Shiny"); shiny.setFont(g_fonts.getFont("verdana-11px-rounded")); Rect shinyrect = Rect(point.x - shiny.getTextSize().width() / 2.0, textRect.y - 14, shiny.getTextSize()); if (m_name.find("Shiny") != std::string::npos) { std::string eraseName = m_name; eraseName.erase(0, 5); m_nameCache.setText(eraseName); m_nameCache.draw(textRect); g_painter->setOpacity(0.5); g_painter->setColor(Color(255, 255, 0)); shiny.draw(shinyrect); g_painter->resetColor(); g_painter->resetOpacity(); m_nameCache.setText(m_name); } else { m_nameCache.draw(textRect); } } Link to comment https://xtibia.com/forum/topic/249218-otclient-shiny-name/#findComment-1749048 Share on other sites More sharing options...
XZero 68 Posted February 23, 2019 Report Share Posted February 23, 2019 (edited) @Crypter então é so trocar textRect.y - 26 por textRect.y - 14 ?? Edited February 23, 2019 by XZero Link to comment https://xtibia.com/forum/topic/249218-otclient-shiny-name/#findComment-1749049 Share on other sites More sharing options...
Crypter 136 Posted February 23, 2019 Report Share Posted February 23, 2019 point.y - 26 por textRect.y - 14 Link to comment https://xtibia.com/forum/topic/249218-otclient-shiny-name/#findComment-1749050 Share on other sites More sharing options...
XZero 68 Posted February 23, 2019 Report Share Posted February 23, 2019 @Crypter Erro ao compilar C:\Users\User\Desktop\Source\src\client\creature.cpp||In member function 'void Creature::drawInformation(const Point&, bool, const Rect&, int)':| C:\Users\User\Desktop\Source\src\client\creature.cpp|284|error: invalid use of member function (did you forget the '()' ?)| Link to comment https://xtibia.com/forum/topic/249218-otclient-shiny-name/#findComment-1749053 Share on other sites More sharing options...
Crypter 136 Posted February 23, 2019 Report Share Posted February 23, 2019 muda pra textRect.top() - 14 XZero 1 Link to comment https://xtibia.com/forum/topic/249218-otclient-shiny-name/#findComment-1749056 Share on other sites More sharing options...
XZero 68 Posted February 23, 2019 Report Share Posted February 23, 2019 (edited) @Crypter funcionou agora tem como mecher na posição X ? Edited February 23, 2019 by XZero Link to comment https://xtibia.com/forum/topic/249218-otclient-shiny-name/#findComment-1749059 Share on other sites More sharing options...
Crypter 136 Posted February 23, 2019 Report Share Posted February 23, 2019 (edited) Tenta point.x - shiny.getTextSize().width() / 2.0 por textRect.right() + nameSize.width() / 2.0 - shiny.getTextSize().width() / 2.0 Edited February 23, 2019 by Crypter Link to comment https://xtibia.com/forum/topic/249218-otclient-shiny-name/#findComment-1749060 Share on other sites More sharing options...
Recommended Posts