void notify(const unsigned int message, const std::string &str) { if (message >= NotifyTypes::TYPE_END || !localChatTab) return; const NotificationInfo &info = notifications[message]; switch (info.flags) { case NotifyFlags::STRING: { localChatTab->chatLog(strprintf(gettext(info.text), str.c_str()), ChatMsgType::BY_SERVER); break; } case NotifyFlags::GUILD_STRING: { ChatTab *const tab = getGuildTab(); chatLog(tab, strprintf(gettext(info.text), str.c_str())); break; } case NotifyFlags::PARTY_STRING: { ChatTab *const tab = partyHandler->getTab(); chatLog(tab, strprintf(gettext(info.text), str.c_str())); break; } case NotifyFlags::EMPTY: case NotifyFlags::INT: case NotifyFlags::GUILD: case NotifyFlags::PARTY: case NotifyFlags::SPEECH: default: break; } soundManager.playSfx(SoundDB::getSound(message)); }
void notify(const unsigned int message) { if (message >= NotifyTypes::TYPE_END || localChatTab == nullptr) { return; } const NotificationInfo &info = notifications[message]; if (*info.text == 0) { soundManager.playSfx(SoundDB::getSound(message), 0, 0); return; } switch (info.flags) { case NotifyFlags::EMPTY: localChatTab->chatLog(gettext(info.text), ChatMsgType::BY_SERVER, IgnoreRecord_false, TryRemoveColors_true); break; case NotifyFlags::GUILD: { if (localPlayer == nullptr) return; ChatTab *const tab = getGuildTab(); chatLog(tab, gettext(info.text)); break; } case NotifyFlags::PARTY: { ChatTab *const tab = partyHandler->getTab(); chatLog(tab, gettext(info.text)); break; } case NotifyFlags::SPEECH: { if (localPlayer != nullptr) localPlayer->setSpeech(gettext(info.text)); break; } case NotifyFlags::INT: case NotifyFlags::STRING: case NotifyFlags::GUILD_STRING: case NotifyFlags::PARTY_STRING: default: break; } soundManager.playSfx(SoundDB::getSound(message), 0, 0); }
void notify(const unsigned int message) { if (message >= NotifyTypes::TYPE_END || !localChatTab) return; const NotificationInfo &info = notifications[message]; switch (info.flags) { case NotifyFlags::EMPTY: localChatTab->chatLog(gettext(info.text), ChatMsgType::BY_SERVER); break; case NotifyFlags::GUILD: { if (!localPlayer) return; ChatTab *const tab = getGuildTab(); chatLog(tab, gettext(info.text)); break; } case NotifyFlags::PARTY: { ChatTab *const tab = partyHandler->getTab(); chatLog(tab, gettext(info.text)); break; } case NotifyFlags::SPEECH: { if (localPlayer) localPlayer->setSpeech(gettext(info.text)); break; } case NotifyFlags::INT: case NotifyFlags::STRING: case NotifyFlags::GUILD_STRING: case NotifyFlags::PARTY_STRING: default: break; } soundManager.playSfx(SoundDB::getSound(message)); }