feat(parity): implement Conqueror level text tail and ground item name resolution (pass33)
This commit is contained in:
@@ -485,7 +485,9 @@ void NetworkActorManager::AppendActor(const SNetworkActorData& data) {
|
||||
tt.SetCharacterName(data.m_dwVID, data.m_stName);
|
||||
tt.SetCharacterPosition(data.m_dwVID, worldX, worldY, worldZ);
|
||||
|
||||
if (data.m_dwLevel > 0) {
|
||||
if (data.m_dwConquerorLevel > 0) {
|
||||
tt.AttachConquerorLevel(data.m_dwVID, "Lv " + std::to_string(data.m_dwConquerorLevel));
|
||||
} else if (data.m_dwLevel > 0) {
|
||||
tt.AttachLevel(data.m_dwVID, "Lv " + std::to_string(data.m_dwLevel));
|
||||
}
|
||||
|
||||
@@ -546,6 +548,9 @@ void NetworkActorManager::UpdateActor(const SNetworkUpdateActorData& data) {
|
||||
}
|
||||
|
||||
ChangeSash(data.m_dwVID, data.m_dwSash);
|
||||
if (data.m_dwConquerorLevel > 0) {
|
||||
TextTailManager::Instance().AttachConquerorLevel(data.m_dwVID, "Lv " + std::to_string(data.m_dwConquerorLevel));
|
||||
}
|
||||
// ChangeGuild / SetAlignment / SetStateFlags(KILLER) each end in RefreshTextTail.
|
||||
RefreshTextTail(data.m_dwVID);
|
||||
}
|
||||
|
||||
@@ -963,7 +963,12 @@ bool PythonNetworkStream::RecvItemGroundAddPacket() {
|
||||
float wy = static_cast<float>(p.lZ);
|
||||
float wz = static_cast<float>(p.lY);
|
||||
|
||||
TextTailManager::Instance().RegisterItemTextTail(p.dwVID, "Item " + std::to_string(p.dwVnum), wx, wy, wz);
|
||||
std::string itemName;
|
||||
int itemType = 0;
|
||||
if (!GetItemNameAndType(p.dwVnum, &itemName, &itemType) || itemName.empty()) {
|
||||
itemName = "Item " + std::to_string(p.dwVnum);
|
||||
}
|
||||
TextTailManager::Instance().RegisterItemTextTail(p.dwVID, itemName, wx, wy, wz);
|
||||
|
||||
if (m_groundItemCallback) {
|
||||
m_groundItemCallback(p.dwVID, p.dwVnum, p.lX, p.lY, p.lZ, true);
|
||||
|
||||
@@ -99,6 +99,10 @@ void TextTailManager::AttachLevel(uint32_t vid, const std::string& levelText, ui
|
||||
}
|
||||
}
|
||||
|
||||
void TextTailManager::AttachConquerorLevel(uint32_t vid, const std::string& levelText) {
|
||||
AttachLevel(vid, levelText, 0xFF8CC8FF);
|
||||
}
|
||||
|
||||
void TextTailManager::DetachLevel(uint32_t vid) {
|
||||
auto it = m_characterMap.find(vid);
|
||||
if (it != m_characterMap.end()) {
|
||||
|
||||
@@ -85,6 +85,7 @@ public:
|
||||
void AttachTitle(uint32_t vid, const std::string& title, uint32_t color = 0xFFFFD700);
|
||||
void DetachTitle(uint32_t vid);
|
||||
void AttachLevel(uint32_t vid, const std::string& levelText, uint32_t color = 0xFF98FF33);
|
||||
void AttachConquerorLevel(uint32_t vid, const std::string& levelText);
|
||||
void DetachLevel(uint32_t vid);
|
||||
void SetGuildName(uint32_t vid, const std::string& guildName, uint32_t guildID = 0);
|
||||
void DeleteCharacterTextTail(uint32_t vid);
|
||||
|
||||
Reference in New Issue
Block a user