Add /setchannel command to set the nearby chat channel, from Alchemy

This commit is contained in:
Liru Færs
2020-01-05 23:27:13 -05:00
parent c772179149
commit 27033f4ebb
2 changed files with 21 additions and 0 deletions

View File

@@ -146,6 +146,17 @@
<key>Value</key>
<string>/resync</string>
</map>
<key>AlchemyChatCommandSetChatChannel</key>
<map>
<key>Comment</key>
<string>Command to set nearby chat channel</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>/setchannel</string>
</map>
<key>AlchemyConnectToNeighbors</key>
<map>
<key>Comment</key>

View File

@@ -261,6 +261,7 @@ bool cmd_line_chat(std::string data, EChatType type)
static LLCachedControl<std::string> sRegionMsgCommand(gSavedSettings, "SinguCmdLineRegionSay");
static LLCachedControl<std::string> sTeleportToCam(gSavedSettings, "AscentCmdTeleportToCam");
static LLCachedControl<std::string> sHoverHeight(gSavedSettings, "AlchemyChatCommandHoverHeight", "/hover");
static LLCachedControl<std::string> sSetNearbyChatChannelCmd(gSavedSettings, "AlchemyChatCommandSetChatChannel", "/setchannel");
static LLCachedControl<std::string> sResyncAnimCommand(gSavedSettings, "AlchemyChatCommandResyncAnim", "/resync");
static LLCachedControl<std::string> sKeyToName(gSavedSettings, "AscentCmdLineKeyToName");
static LLCachedControl<std::string> 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());