diff --git a/include/game/game_handler.hpp b/include/game/game_handler.hpp index 15a03176..b6005824 100644 --- a/include/game/game_handler.hpp +++ b/include/game/game_handler.hpp @@ -243,6 +243,7 @@ public: bool trade = true; bool localDefense = true; bool lfg = true; + bool local = true; }; ChatAutoJoin chatAutoJoin; diff --git a/include/ui/game_screen.hpp b/include/ui/game_screen.hpp index dec4eef2..c5d8b600 100644 --- a/include/ui/game_screen.hpp +++ b/include/ui/game_screen.hpp @@ -231,6 +231,7 @@ private: bool chatAutoJoinTrade_ = true; bool chatAutoJoinLocalDefense_ = true; bool chatAutoJoinLFG_ = true; + bool chatAutoJoinLocal_ = true; // Join channel input buffer char joinChannelBuffer_[128] = ""; diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 0a0ba132..9d6f0e30 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -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) { diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 76db9e43..df14f183 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -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);