From 27033f4ebb18d9483c0171c6a4d0618f56ef4102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Liru=20F=C3=A6rs?= Date: Sun, 5 Jan 2020 23:27:13 -0500 Subject: [PATCH] Add /setchannel command to set the nearby chat channel, from Alchemy --- indra/newview/app_settings/settings_ascent.xml | 11 +++++++++++ indra/newview/chatbar_as_cmdline.cpp | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index 759e674a9..13f340a5a 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -146,6 +146,17 @@ Value /resync + AlchemyChatCommandSetChatChannel + + Comment + Command to set nearby chat channel + Persist + 1 + Type + String + Value + /setchannel + AlchemyConnectToNeighbors Comment diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp index c70eec31b..b68240e60 100644 --- a/indra/newview/chatbar_as_cmdline.cpp +++ b/indra/newview/chatbar_as_cmdline.cpp @@ -261,6 +261,7 @@ bool cmd_line_chat(std::string data, EChatType type) static LLCachedControl sRegionMsgCommand(gSavedSettings, "SinguCmdLineRegionSay"); static LLCachedControl sTeleportToCam(gSavedSettings, "AscentCmdTeleportToCam"); static LLCachedControl sHoverHeight(gSavedSettings, "AlchemyChatCommandHoverHeight", "/hover"); + static LLCachedControl sSetNearbyChatChannelCmd(gSavedSettings, "AlchemyChatCommandSetChatChannel", "/setchannel"); static LLCachedControl sResyncAnimCommand(gSavedSettings, "AlchemyChatCommandResyncAnim", "/resync"); static LLCachedControl sKeyToName(gSavedSettings, "AscentCmdLineKeyToName"); static LLCachedControl sOfferTp(gSavedSettings, "AscentCmdLineOfferTp"); @@ -447,6 +448,15 @@ bool cmd_line_chat(std::string data, EChatType type) } return false; } + else if (cmd == utf8str_tolower(sSetNearbyChatChannelCmd)) // Set nearby chat channel + { + S32 chan; + if (input >> chan) + { + gSavedSettings.setS32("AlchemyNearbyChatChannel", chan); + return false; + } + } else if (cmd == utf8str_tolower(sTeleportToCam)) { gAgent.teleportViaLocation(gAgentCamera.getCameraPositionGlobal());