Suppress login bind point message and auto-join Local channel

Only show "Your home has been set" when the player actively changes their
bind point (via innkeeper), not on the initial login sync from the server.
Add "Local" to the auto-join channel list for Turtle WoW compatibility,
with a settings checkbox and persistence.
This commit is contained in:
Kelsi 2026-02-16 21:16:25 -08:00
parent 381d896348
commit 44d1431b60
4 changed files with 15 additions and 2 deletions

View file

@ -243,6 +243,7 @@ public:
bool trade = true;
bool localDefense = true;
bool lfg = true;
bool local = true;
};
ChatAutoJoin chatAutoJoin;

View file

@ -231,6 +231,7 @@ private:
bool chatAutoJoinTrade_ = true;
bool chatAutoJoinLocalDefense_ = true;
bool chatAutoJoinLFG_ = true;
bool chatAutoJoinLocal_ = true;
// Join channel input buffer
char joinChannelBuffer_[128] = "";

View file

@ -979,13 +979,17 @@ void GameHandler::handlePacket(network::Packet& packet) {
" pos=(", data.x, ", ", data.y, ", ", data.z, ")");
glm::vec3 canonical = core::coords::serverToCanonical(
glm::vec3(data.x, data.y, data.z));
// Only show message if bind point was already set (not initial login sync)
bool wasSet = hasHomeBind_;
hasHomeBind_ = true;
homeBindMapId_ = data.mapId;
homeBindPos_ = canonical;
if (bindPointCallback_) {
bindPointCallback_(data.mapId, canonical.x, canonical.y, canonical.z);
}
addSystemChatMessage("Your home has been set.");
if (wasSet) {
addSystemChatMessage("Your home has been set.");
}
} else {
LOG_WARNING("Failed to parse SMSG_BINDPOINTUPDATE");
}
@ -4396,6 +4400,7 @@ void GameHandler::autoJoinDefaultChannels() {
if (chatAutoJoin.trade) joinChannel("Trade");
if (chatAutoJoin.localDefense) joinChannel("LocalDefense");
if (chatAutoJoin.lfg) joinChannel("LookingForGroup");
if (chatAutoJoin.local) joinChannel("Local");
}
void GameHandler::setTarget(uint64_t guid) {

View file

@ -149,7 +149,8 @@ bool GameScreen::shouldShowMessage(const game::MessageChatData& msg, int tabInde
const std::string& ch = msg.channelName;
if (ch.find("Trade") == std::string::npos &&
ch.find("General") == std::string::npos &&
ch.find("LookingForGroup") == std::string::npos) {
ch.find("LookingForGroup") == std::string::npos &&
ch.find("Local") == std::string::npos) {
return false;
}
return true;
@ -208,6 +209,7 @@ void GameScreen::render(game::GameHandler& gameHandler) {
gameHandler.chatAutoJoin.trade = chatAutoJoinTrade_;
gameHandler.chatAutoJoin.localDefense = chatAutoJoinLocalDefense_;
gameHandler.chatAutoJoin.lfg = chatAutoJoinLFG_;
gameHandler.chatAutoJoin.local = chatAutoJoinLocal_;
// Process targeting input before UI windows
processTargetInput(gameHandler);
@ -5685,6 +5687,7 @@ void GameScreen::renderSettingsWindow() {
if (ImGui::Checkbox("Trade", &chatAutoJoinTrade_)) saveSettings();
if (ImGui::Checkbox("LocalDefense", &chatAutoJoinLocalDefense_)) saveSettings();
if (ImGui::Checkbox("LookingForGroup", &chatAutoJoinLFG_)) saveSettings();
if (ImGui::Checkbox("Local", &chatAutoJoinLocal_)) saveSettings();
ImGui::Spacing();
ImGui::Spacing();
@ -5704,6 +5707,7 @@ void GameScreen::renderSettingsWindow() {
chatAutoJoinTrade_ = true;
chatAutoJoinLocalDefense_ = true;
chatAutoJoinLFG_ = true;
chatAutoJoinLocal_ = true;
saveSettings();
}
@ -6189,6 +6193,7 @@ void GameScreen::saveSettings() {
out << "chat_autojoin_trade=" << (chatAutoJoinTrade_ ? 1 : 0) << "\n";
out << "chat_autojoin_localdefense=" << (chatAutoJoinLocalDefense_ ? 1 : 0) << "\n";
out << "chat_autojoin_lfg=" << (chatAutoJoinLFG_ ? 1 : 0) << "\n";
out << "chat_autojoin_local=" << (chatAutoJoinLocal_ ? 1 : 0) << "\n";
LOG_INFO("Settings saved to ", path);
}
@ -6248,6 +6253,7 @@ void GameScreen::loadSettings() {
else if (key == "chat_autojoin_trade") chatAutoJoinTrade_ = (std::stoi(val) != 0);
else if (key == "chat_autojoin_localdefense") chatAutoJoinLocalDefense_ = (std::stoi(val) != 0);
else if (key == "chat_autojoin_lfg") chatAutoJoinLFG_ = (std::stoi(val) != 0);
else if (key == "chat_autojoin_local") chatAutoJoinLocal_ = (std::stoi(val) != 0);
} catch (...) {}
}
LOG_INFO("Settings loaded from ", path);