From 8c4c9fbe96fce74b9c4f8f4813130f543a49e1cc Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 6 Sep 2024 14:29:02 +0200 Subject: [PATCH] Put everything in FSCommon into the namespace with the same name --- indra/newview/NACLfloaterexploresounds.cpp | 2 +- indra/newview/chatbar_as_cmdline.cpp | 276 ++++++++++----------- indra/newview/fschathistory.cpp | 2 +- indra/newview/fscommon.cpp | 8 +- indra/newview/fscommon.h | 14 +- indra/newview/fsconsoleutils.cpp | 6 +- indra/newview/fsfloaterim.cpp | 2 +- indra/newview/fskeywords.cpp | 2 +- indra/newview/fslslbridge.cpp | 50 ++-- indra/newview/fsradar.cpp | 16 +- indra/newview/growlmanager.cpp | 4 +- indra/newview/lggbeammaps.cpp | 8 +- indra/newview/llagentcamera.cpp | 4 +- indra/newview/llenvironment.cpp | 12 +- indra/newview/llimprocessing.cpp | 4 +- indra/newview/llimview.cpp | 6 +- indra/newview/llmutelist.cpp | 4 +- indra/newview/llnetmap.cpp | 2 +- indra/newview/llstartup.cpp | 14 +- indra/newview/lltoastimpanel.cpp | 2 +- indra/newview/llviewermenu.cpp | 18 +- indra/newview/llviewermessage.cpp | 16 +- indra/newview/llviewerparcelmedia.cpp | 28 +-- indra/newview/llviewerwindow.cpp | 2 +- indra/newview/llvoavatar.cpp | 4 +- indra/newview/streamtitledisplay.cpp | 2 +- 26 files changed, 254 insertions(+), 254 deletions(-) diff --git a/indra/newview/NACLfloaterexploresounds.cpp b/indra/newview/NACLfloaterexploresounds.cpp index c90a4c7562..a58695824b 100644 --- a/indra/newview/NACLfloaterexploresounds.cpp +++ b/indra/newview/NACLfloaterexploresounds.cpp @@ -252,7 +252,7 @@ bool NACLFloaterExploreSounds::tick() { LLStringUtil::format_map_t format_args; format_args["TIME"] = llformat("%.1f", static_cast((LLTimer::getElapsedSeconds() - item.mTimeStopped) / 60.0)); - playing_column["value"] = format_string(str_not_playing, format_args); + playing_column["value"] = FSCommon::format_string(str_not_playing, format_args); } LLSD& type_column = element["columns"][1]; diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp index a62d4da495..e5005b41c9 100644 --- a/indra/newview/chatbar_as_cmdline.cpp +++ b/indra/newview/chatbar_as_cmdline.cpp @@ -103,22 +103,22 @@ public: doZdCleanup(); if (mErrorCode == 1) { - report_to_nearby_chat(llformat("The object with the UUID of \"%s\" can no longer be found in-world.", mDropUUID.c_str())); - report_to_nearby_chat("This can occur if the object was returned or deleted, or if your client is no longer rendering it."); - report_to_nearby_chat(llformat("Transfer from \"%s\" to \"%s\" aborted.", mFolderName.c_str(), mDropUUID.c_str())); + FSCommon::report_to_nearby_chat(llformat("The object with the UUID of \"%s\" can no longer be found in-world.", mDropUUID.c_str())); + FSCommon::report_to_nearby_chat("This can occur if the object was returned or deleted, or if your client is no longer rendering it."); + FSCommon::report_to_nearby_chat(llformat("Transfer from \"%s\" to \"%s\" aborted.", mFolderName.c_str(), mDropUUID.c_str())); } else { if (mPackage) { - report_to_nearby_chat("Packager finished, you may now pick up the prim that contains the objects."); - report_to_nearby_chat(llformat("Packaged what you had selected in world into the folder \"%s\" in your inventory and into the prim with the UUID of \"%s\"", mFolderName.c_str(), mDropUUID.c_str())); - report_to_nearby_chat("Don't worry if you look at the contents of package right now, it may show as empty, it isn't, it's just a bug with Second Life itself."); - report_to_nearby_chat("If you take it into your inventory then rez it back out, all the contents will be there."); + FSCommon::report_to_nearby_chat("Packager finished, you may now pick up the prim that contains the objects."); + FSCommon::report_to_nearby_chat(llformat("Packaged what you had selected in world into the folder \"%s\" in your inventory and into the prim with the UUID of \"%s\"", mFolderName.c_str(), mDropUUID.c_str())); + FSCommon::report_to_nearby_chat("Don't worry if you look at the contents of package right now, it may show as empty, it isn't, it's just a bug with Second Life itself."); + FSCommon::report_to_nearby_chat("If you take it into your inventory then rez it back out, all the contents will be there."); } else { - report_to_nearby_chat(llformat("Completed transfer from \"%s\" to \"%s\".", mFolderName.c_str(), mDropUUID.c_str())); + FSCommon::report_to_nearby_chat(llformat("Completed transfer from \"%s\" to \"%s\".", mFolderName.c_str(), mDropUUID.c_str())); } } } @@ -130,7 +130,7 @@ public: LLViewerObject* objectp = gObjectList.findObject(mDestination); if (objectp) { - report_to_nearby_chat(std::string("Transferring ") + subj->getName()); + FSCommon::report_to_nearby_chat(std::string("Transferring ") + subj->getName()); LLToolDragAndDrop::dropInventory(objectp, subj, LLToolDragAndDrop::SOURCE_AGENT, gAgentID); if (mStack.size() > 0) { @@ -218,11 +218,11 @@ public: if (mPackage) { - report_to_nearby_chat("Packager started. Phase 1 (taking in-world objects into inventory) starting in: "); + FSCommon::report_to_nearby_chat("Packager started. Phase 1 (taking in-world objects into inventory) starting in: "); } else { - report_to_nearby_chat("Ztake activated. Taking selected in-world objects into inventory in: "); + FSCommon::report_to_nearby_chat("Ztake activated. Taking selected in-world objects into inventory in: "); } } @@ -230,7 +230,7 @@ public: { if (!mPackage) { - report_to_nearby_chat("Ztake deactivated."); + FSCommon::report_to_nearby_chat("Ztake deactivated."); } } @@ -239,7 +239,7 @@ public: switch (mState) { case ZTS_COUNTDOWN: - report_to_nearby_chat(llformat("%i...", mCountdown--)); + FSCommon::report_to_nearby_chat(llformat("%i...", mCountdown--)); if (mCountdown == 0) mState = ZTS_SELECTION; break; @@ -301,25 +301,25 @@ public: } else { - report_to_nearby_chat("Ktake has taken all selected objects."); + FSCommon::report_to_nearby_chat("Ktake has taken all selected objects."); doZtCleanup(); mState = ZTS_DONE; } } else { - report_to_nearby_chat("Ztake has taken all selected objects. Say \"ztake off\" to deactivate ztake or select more objects to continue."); + FSCommon::report_to_nearby_chat("Ztake has taken all selected objects. Say \"ztake off\" to deactivate ztake or select more objects to continue."); } } else { if (mPackage) { - report_to_nearby_chat(llformat("Packager: %i objects left to take.", mToTake.size())); + FSCommon::report_to_nearby_chat(llformat("Packager: %i objects left to take.", mToTake.size())); } else { - report_to_nearby_chat(llformat("Ztake: %i objects left to take.", mToTake.size())); + FSCommon::report_to_nearby_chat(llformat("Ztake: %i objects left to take.", mToTake.size())); } } } @@ -328,12 +328,12 @@ public: { if (mPackage) { - report_to_nearby_chat(llformat("Packager: no objects to take.")); + FSCommon::report_to_nearby_chat(llformat("Packager: no objects to take.")); doZtCleanup(); } else { - report_to_nearby_chat(llformat("Ztake: no objects to take.")); + FSCommon::report_to_nearby_chat(llformat("Ztake: no objects to take.")); } } break; @@ -354,14 +354,14 @@ public: { if (itemstack.size() < mPackSize) { - report_to_nearby_chat("Phase 1 of the packager finished, but some items mave have been missed."); + FSCommon::report_to_nearby_chat("Phase 1 of the packager finished, but some items mave have been missed."); } else { - report_to_nearby_chat("Phase 1 of the packager finished."); + FSCommon::report_to_nearby_chat("Phase 1 of the packager finished."); } - report_to_nearby_chat("Do not have the destination prim selected while transfer is running to reduce the chances of \"Inventory creation on in-world object failed.\""); + FSCommon::report_to_nearby_chat("Do not have the destination prim selected while transfer is running to reduce the chances of \"Inventory creation on in-world object failed.\""); LLUUID sdest{ mPackageDest }; gZDrop = new JCZdrop(itemstack, sdest, mFolderName.c_str(), mPackageDest.asString().c_str(), true); @@ -427,12 +427,12 @@ public: mRunning(false), mCountdown(5) { - report_to_nearby_chat("Mtake activated. Taking selected in-world objects into inventory in: "); + FSCommon::report_to_nearby_chat("Mtake activated. Taking selected in-world objects into inventory in: "); } ~TMZtake() { - report_to_nearby_chat("Mtake deactivated."); + FSCommon::report_to_nearby_chat("Mtake deactivated."); } bool tick() @@ -476,7 +476,7 @@ public: } if (mCountdown > 0) { - report_to_nearby_chat(llformat("%i...", mCountdown--)); + FSCommon::report_to_nearby_chat(llformat("%i...", mCountdown--)); } else if (!mToTake.empty()) { @@ -502,11 +502,11 @@ public: { if (mToTake.empty()) { - report_to_nearby_chat("Mtake has taken all selected objects. Say \"mtake off\" to deactivate Mtake or select more objects to continue."); + FSCommon::report_to_nearby_chat("Mtake has taken all selected objects. Say \"mtake off\" to deactivate Mtake or select more objects to continue."); } else { - report_to_nearby_chat(llformat("Mtake: %i objects left to take.", mToTake.size())); + FSCommon::report_to_nearby_chat(llformat("Mtake: %i objects left to take.", mToTake.size())); } } } @@ -539,7 +539,7 @@ static void key_to_name_callback(const LLUUID& id, const LLAvatarName& av_name) { name = RlvStrings::getAnonym(av_name); } - report_to_nearby_chat(llformat("%s: (%s)", id.asString().c_str(), name.c_str())); + FSCommon::report_to_nearby_chat(llformat("%s: (%s)", id.asString().c_str(), name.c_str())); } bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gesture) @@ -597,7 +597,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest { if (from_gesture) { - report_to_nearby_chat(LLTrans::getString("DrawDistanceSteppingGestureObsolete")); + FSCommon::report_to_nearby_chat(LLTrans::getString("DrawDistanceSteppingGestureObsolete")); gSavedSettings.setBOOL("FSRenderFarClipStepping", true); return false; } @@ -608,7 +608,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest gAgentCamera.mDrawDistance = drawDist; LLStringUtil::format_map_t args; args["DISTANCE"] = llformat("%.0f", drawDist); - report_to_nearby_chat(LLTrans::getString("FSCmdLineDrawDistanceSet", args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("FSCmdLineDrawDistanceSet", args)); return false; } } @@ -669,7 +669,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest std::string bw_cmd_respond; args["[VALUE]"] = llformat ("%d", band_width); bw_cmd_respond = LLTrans::getString("FSCmdLineRSP", args); - report_to_nearby_chat(bw_cmd_respond); + FSCommon::report_to_nearby_chat(bw_cmd_respond); return false; } } @@ -688,7 +688,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest // send appropriate enable/disable messages to nearby chat - FIRE-24160 if (!aoWasEnabled) { - report_to_nearby_chat(LLTrans::getString("FSAOEnabled")); + FSCommon::report_to_nearby_chat(LLTrans::getString("FSAOEnabled")); } } else if (status == "off") @@ -698,7 +698,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest // send appropriate enable/disable messages to nearby chat - FIRE-24160 if (aoWasEnabled) { - report_to_nearby_chat(LLTrans::getString("FSAODisabled")); + FSCommon::report_to_nearby_chat(LLTrans::getString("FSAODisabled")); } } else if (status == "sit") @@ -742,7 +742,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest if (!myObject) { - report_to_nearby_chat(llformat("Object with key %s not found!", target_key.asString().c_str())); + FSCommon::report_to_nearby_chat(llformat("Object with key %s not found!", target_key.asString().c_str())); return false; } @@ -782,7 +782,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest msg->addVector3("Normal", LLVector3::zero); msg->addVector3("Binormal", LLVector3::zero); msg->sendMessage(myObject->getRegion()->getHost()); - report_to_nearby_chat(llformat("Touched object with key %s", target_key.asString().c_str())); + FSCommon::report_to_nearby_chat(llformat("Touched object with key %s", target_key.asString().c_str())); } } return false; @@ -796,7 +796,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest if (!myObject) { - report_to_nearby_chat(llformat("Object with key %s not found!", target_key.asString().c_str())); + FSCommon::report_to_nearby_chat(llformat("Object with key %s not found!", target_key.asString().c_str())); return false; } if ((!RlvActions::isRlvEnabled()) || (RlvActions::canSit(myObject, LLVector3::zero))) @@ -811,7 +811,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest msg->addVector3Fast(_PREHASH_Offset, LLVector3::zero); gAgent.getRegion()->sendReliableMessage(); - report_to_nearby_chat(llformat("Sat on object with key %s", target_key.asString().c_str())); + FSCommon::report_to_nearby_chat(llformat("Sat on object with key %s", target_key.asString().c_str())); } } return false; @@ -821,7 +821,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest if ( (!RlvActions::isRlvEnabled()) || (RlvActions::canStand()) ) { gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); - report_to_nearby_chat(std::string("Standing up")); + FSCommon::report_to_nearby_chat(std::string("Standing up")); } return false; } @@ -859,7 +859,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest gAgent.sendReliableMessage(); LLStringUtil::format_map_t args; args["NAME"] = LLSLURL("agent", target_key, "inspect").getSLURLString(); - report_to_nearby_chat(LLTrans::getString("FSCmdLineTpOffered", args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("FSCmdLineTpOffered", args)); } return false; } @@ -996,7 +996,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest { LLStringUtil::format_map_t args; args["RAND"] = llformat("%s", look_for.c_str()); - report_to_nearby_chat(LLTrans::getString("FSCmdLineCalcRandError", args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("FSCmdLineCalcRandError", args)); } std::string random_number_text = llformat("%d", random_number); expr.replace(random_string_pos, look_for.length(), random_number_text); @@ -1021,7 +1021,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest result_str << result; out = result_str.str(); } - report_to_nearby_chat(out); + FSCommon::report_to_nearby_chat(out); return false; } } @@ -1054,22 +1054,22 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest { if (gZDrop) { - report_to_nearby_chat("Zdrop is already active."); + FSCommon::report_to_nearby_chat("Zdrop is already active."); } else { std::string destination; if (i >> destination) { - report_to_nearby_chat("Beginning Zdrop."); - report_to_nearby_chat("Verifying destination prim is present inworld..."); + FSCommon::report_to_nearby_chat("Beginning Zdrop."); + FSCommon::report_to_nearby_chat("Verifying destination prim is present inworld..."); if (!LLUUID::validate(destination)) { - report_to_nearby_chat("Entered UUID is invalid! (Hint: use the \"copy key\" button in the build menu.)"); + FSCommon::report_to_nearby_chat("Entered UUID is invalid! (Hint: use the \"copy key\" button in the build menu.)"); } else if (!gObjectList.findObject(LLUUID(destination))) { - report_to_nearby_chat("Unable to locate object. Please verify the object is rezzed and in view, and that the UUID is correct."); + FSCommon::report_to_nearby_chat("Unable to locate object. Please verify the object is rezzed and in view, and that the UUID is correct."); } else { @@ -1085,7 +1085,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest LLUUID folder_id = gInventory.findCategoryByName(folder); if (folder_id.notNull()) { - report_to_nearby_chat("Verifying folder location..."); + FSCommon::report_to_nearby_chat("Verifying folder location..."); std::stack inventorystack; std::vector > inventory = findInventoryInFolder(folder); for (const auto& item : inventory) @@ -1094,32 +1094,32 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest } if (!inventorystack.empty()) { - report_to_nearby_chat(llformat("Found folder \"%s\".", folder.c_str())); - report_to_nearby_chat(llformat("Found prim \"%s\".", destination.c_str())); - report_to_nearby_chat(llformat("Transferring inventory items from \"%s\" to prim \"%s\".", folder.c_str(), destination.c_str())); - report_to_nearby_chat("WARNING: No-copy items will be moved to the destination prim!"); - report_to_nearby_chat("Do not have the prim selected while transfer is running to reduce the chances of \"Inventory creation on in-world object failed.\""); - report_to_nearby_chat("Use \"zdrop off\" to stop the transfer"); + FSCommon::report_to_nearby_chat(llformat("Found folder \"%s\".", folder.c_str())); + FSCommon::report_to_nearby_chat(llformat("Found prim \"%s\".", destination.c_str())); + FSCommon::report_to_nearby_chat(llformat("Transferring inventory items from \"%s\" to prim \"%s\".", folder.c_str(), destination.c_str())); + FSCommon::report_to_nearby_chat("WARNING: No-copy items will be moved to the destination prim!"); + FSCommon::report_to_nearby_chat("Do not have the prim selected while transfer is running to reduce the chances of \"Inventory creation on in-world object failed.\""); + FSCommon::report_to_nearby_chat("Use \"zdrop off\" to stop the transfer"); LLUUID sdest = LLUUID(destination); gZDrop = new JCZdrop(inventorystack, sdest, folder.c_str(), destination.c_str()); } } else { - report_to_nearby_chat(llformat("\"%s\" folder not found. Please check the spelling.", folder.c_str())); - report_to_nearby_chat("Zdrop cannot work if the folder is inside another folder."); + FSCommon::report_to_nearby_chat(llformat("\"%s\" folder not found. Please check the spelling.", folder.c_str())); + FSCommon::report_to_nearby_chat("Zdrop cannot work if the folder is inside another folder."); } } catch (std::out_of_range&) { - report_to_nearby_chat("The Zdrop command transfers items from your inventory to a rezzed prim without the need to wait for the contents of the prim to load. No-copy items are moved to the prim. All other items are copied."); - report_to_nearby_chat("Valid command: Zdrop (rezzed prim UUID) (source inventory folder name)"); + FSCommon::report_to_nearby_chat("The Zdrop command transfers items from your inventory to a rezzed prim without the need to wait for the contents of the prim to load. No-copy items are moved to the prim. All other items are copied."); + FSCommon::report_to_nearby_chat("Valid command: Zdrop (rezzed prim UUID) (source inventory folder name)"); } } } else { - report_to_nearby_chat("Please specify an object UUID to copy the items in this folder to."); + FSCommon::report_to_nearby_chat("Please specify an object UUID to copy the items in this folder to."); } } } @@ -1127,7 +1127,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest { if (!gZDrop) { - report_to_nearby_chat("Zdrop is already deactivated."); + FSCommon::report_to_nearby_chat("Zdrop is already deactivated."); } else { @@ -1138,13 +1138,13 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest } else { - report_to_nearby_chat(llformat("Invalid command: \"%s\". Valid commands: zdrop on (source inventory folder) (rezzed prim UUID); zdrop off", setting.c_str())); + FSCommon::report_to_nearby_chat(llformat("Invalid command: \"%s\". Valid commands: zdrop on (source inventory folder) (rezzed prim UUID); zdrop off", setting.c_str())); } } else { - report_to_nearby_chat("The Zdrop command transfers items from your inventory to a rezzed prim without the need to wait for the contents of the prim to load. No-copy items are moved to the prim. All other items are copied."); - report_to_nearby_chat("Valid commands: zdrop on (rezzed prim UUID) (source inventory folder name); zdrop off"); + FSCommon::report_to_nearby_chat("The Zdrop command transfers items from your inventory to a rezzed prim without the need to wait for the contents of the prim to load. No-copy items are moved to the prim. All other items are copied."); + FSCommon::report_to_nearby_chat("Valid commands: zdrop on (rezzed prim UUID) (source inventory folder name); zdrop off"); } return false; } @@ -1157,12 +1157,12 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest { if (gZTake) { - report_to_nearby_chat("Ztake is already active."); + FSCommon::report_to_nearby_chat("Ztake is already active."); } else { - report_to_nearby_chat("Beginning Ztake."); - report_to_nearby_chat("Verifying folder location..."); + FSCommon::report_to_nearby_chat("Beginning Ztake."); + FSCommon::report_to_nearby_chat("Verifying folder location..."); std::string folder_name; std::string tmp; while (i >> tmp) @@ -1175,18 +1175,18 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest LLUUID folder = gInventory.findCategoryByName(folder_name); if (folder.notNull()) { - report_to_nearby_chat(llformat("Found destination folder \"%s\".", folder_name.c_str())); + FSCommon::report_to_nearby_chat(llformat("Found destination folder \"%s\".", folder_name.c_str())); gZTake = new JCZtake(folder); } else { - report_to_nearby_chat(llformat("\"%s\" folder not found. Please check the spelling.", folder_name.c_str())); - report_to_nearby_chat("Ztake cannot work if the folder is inside another folder."); + FSCommon::report_to_nearby_chat(llformat("\"%s\" folder not found. Please check the spelling.", folder_name.c_str())); + FSCommon::report_to_nearby_chat("Ztake cannot work if the folder is inside another folder."); } } catch (std::out_of_range&) { - report_to_nearby_chat("Please specify a destination folder in your inventory."); + FSCommon::report_to_nearby_chat("Please specify a destination folder in your inventory."); } } } @@ -1194,7 +1194,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest { if (!gZTake) { - report_to_nearby_chat("Ztake is already deactivated."); + FSCommon::report_to_nearby_chat("Ztake is already deactivated."); } else { @@ -1205,14 +1205,14 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest } else { - report_to_nearby_chat(llformat("Invalid command: \"%s\". Valid commands: ztake on (destination inventory folder); ztake off", setting.c_str())); + FSCommon::report_to_nearby_chat(llformat("Invalid command: \"%s\". Valid commands: ztake on (destination inventory folder); ztake off", setting.c_str())); } return false; } else { - report_to_nearby_chat("The Ztake command copies selected rezzed objects into the folder you specify in your inventory."); - report_to_nearby_chat("Valid commands: ztake on (destination inventory folder name); ztake off"); + FSCommon::report_to_nearby_chat("The Ztake command copies selected rezzed objects into the folder you specify in your inventory."); + FSCommon::report_to_nearby_chat("Valid commands: ztake on (destination inventory folder name); ztake off"); } return false; } @@ -1221,14 +1221,14 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest std::string destination; if (i >> destination) { - report_to_nearby_chat("Verifying destination prim is present inworld..."); + FSCommon::report_to_nearby_chat("Verifying destination prim is present inworld..."); if (!LLUUID::validate(destination)) { - report_to_nearby_chat("Entered UUID is invalid! (Hint: use the \"copy key\" button in the build menu.)"); + FSCommon::report_to_nearby_chat("Entered UUID is invalid! (Hint: use the \"copy key\" button in the build menu.)"); } else if (!gObjectList.findObject(LLUUID(destination))) { - report_to_nearby_chat("Unable to locate object. Please verify the object is rezzed, in view, and that the UUID is correct."); + FSCommon::report_to_nearby_chat("Unable to locate object. Please verify the object is rezzed, in view, and that the UUID is correct."); } else { @@ -1244,24 +1244,24 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest LLUUID folder = gInventory.findCategoryByName(folder_name); if (folder.notNull()) { - report_to_nearby_chat(llformat("Found destination folder \"%s\".", folder_name.c_str())); + FSCommon::report_to_nearby_chat(llformat("Found destination folder \"%s\".", folder_name.c_str())); gZTake = new JCZtake(folder, true, LLUUID(destination), folder_name, (command == "cpackage") ? DRD_ACQUIRE_TO_AGENT_INVENTORY : DRD_TAKE_INTO_AGENT_INVENTORY); } else { - report_to_nearby_chat(llformat("\"%s\" folder not found. Please check the spelling.", folder_name.c_str())); - report_to_nearby_chat("The packager cannot work if the folder is inside another folder."); + FSCommon::report_to_nearby_chat(llformat("\"%s\" folder not found. Please check the spelling.", folder_name.c_str())); + FSCommon::report_to_nearby_chat("The packager cannot work if the folder is inside another folder."); } } catch (std::out_of_range&) { - report_to_nearby_chat("Please specify a destination folder in your inventory."); + FSCommon::report_to_nearby_chat("Please specify a destination folder in your inventory."); } } } else { - report_to_nearby_chat(llformat("Packager usage: \"%s destination_prim_UUID inventory folder name\"",command.c_str())); + FSCommon::report_to_nearby_chat(llformat("Packager usage: \"%s destination_prim_UUID inventory folder name\"",command.c_str())); } return false; } @@ -1270,14 +1270,14 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest std::string destination; if (i >> destination) { - report_to_nearby_chat("Verifying destination prim is present inworld..."); + FSCommon::report_to_nearby_chat("Verifying destination prim is present inworld..."); if (!LLUUID::validate(destination)) { - report_to_nearby_chat("Entered UUID is invalid! (Hint: use the \"copy key\" button in the build menu.)"); + FSCommon::report_to_nearby_chat("Entered UUID is invalid! (Hint: use the \"copy key\" button in the build menu.)"); } else if (!gObjectList.findObject(LLUUID(destination))) { - report_to_nearby_chat("Unable to locate object. Please verify the object is rezzed, in view, and that the UUID is correct."); + FSCommon::report_to_nearby_chat("Unable to locate object. Please verify the object is rezzed, in view, and that the UUID is correct."); } else { @@ -1295,7 +1295,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest { if (!LLUUID::validate(take)) { - report_to_nearby_chat("Entered UUID is invalid! (Hint: use the \"copy key\" button in the build menu.)"); + FSCommon::report_to_nearby_chat("Entered UUID is invalid! (Hint: use the \"copy key\" button in the build menu.)"); return false; } else @@ -1303,7 +1303,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest LLViewerObject* objectp = gObjectList.findObject(LLUUID(take)); if(!objectp) { - report_to_nearby_chat("Unable to locate object. Please verify the object is rezzed, in view, and that the UUID is correct."); + FSCommon::report_to_nearby_chat("Unable to locate object. Please verify the object is rezzed, in view, and that the UUID is correct."); return false; } else @@ -1319,30 +1319,30 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest if (to_take.empty()) { - report_to_nearby_chat("No objects to take."); + FSCommon::report_to_nearby_chat("No objects to take."); } else { - report_to_nearby_chat(llformat("Found destination folder \"%s\".", folder_name.c_str())); + FSCommon::report_to_nearby_chat(llformat("Found destination folder \"%s\".", folder_name.c_str())); gZTake = new JCZtake(folder, true, LLUUID(destination), folder_name, DRD_ACQUIRE_TO_AGENT_INVENTORY, false, to_take); } } else { - report_to_nearby_chat(llformat("\"%s\" folder not found. Please check the spelling.", folder_name.c_str())); - report_to_nearby_chat("The packager cannot work if the folder is inside another folder."); + FSCommon::report_to_nearby_chat(llformat("\"%s\" folder not found. Please check the spelling.", folder_name.c_str())); + FSCommon::report_to_nearby_chat("The packager cannot work if the folder is inside another folder."); } } catch (std::out_of_range&) { - report_to_nearby_chat("Please specify a destination folder in your inventory."); + FSCommon::report_to_nearby_chat("Please specify a destination folder in your inventory."); } } } } else { - report_to_nearby_chat(llformat("Packager usage: \"%s destination_prim_UUID inventory folder name\"",command.c_str())); + FSCommon::report_to_nearby_chat(llformat("Packager usage: \"%s destination_prim_UUID inventory folder name\"",command.c_str())); } return false; } @@ -1352,14 +1352,14 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest std::string destination; if (i >> destination) { - report_to_nearby_chat("Verifying destination prim is present inworld..."); + FSCommon::report_to_nearby_chat("Verifying destination prim is present inworld..."); if (!LLUUID::validate(destination)) { - report_to_nearby_chat("Entered UUID is invalid! (Hint: use the \"copy key\" button in the build menu.)"); + FSCommon::report_to_nearby_chat("Entered UUID is invalid! (Hint: use the \"copy key\" button in the build menu.)"); } else if (!gObjectList.findObject(LLUUID(destination))) { - report_to_nearby_chat("Unable to locate object. Please verify the object is rezzed, in view, and that the UUID is correct."); + FSCommon::report_to_nearby_chat("Unable to locate object. Please verify the object is rezzed, in view, and that the UUID is correct."); } else { @@ -1371,7 +1371,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest LLUUID folder = gInventory.findCategoryByName(folder_name); if (folder.notNull()) { - report_to_nearby_chat(llformat("kpackager started. Destination folder: \"%s\" Listening to object: \"%s\"", folder_name.c_str(), destination.c_str())); + FSCommon::report_to_nearby_chat(llformat("kpackager started. Destination folder: \"%s\" Listening to object: \"%s\"", folder_name.c_str(), destination.c_str())); cmd_line_mPackagerToTake.clear(); cmd_line_mPackagerTargetFolderName = folder_name; @@ -1380,20 +1380,20 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest } else { - report_to_nearby_chat(llformat("\"%s\" folder not found. Please check the spelling.", folder_name.c_str())); - report_to_nearby_chat("The packager cannot work if the folder is inside another folder."); + FSCommon::report_to_nearby_chat(llformat("\"%s\" folder not found. Please check the spelling.", folder_name.c_str())); + FSCommon::report_to_nearby_chat("The packager cannot work if the folder is inside another folder."); } } catch (std::out_of_range&) { - report_to_nearby_chat("Please specify a destination folder in your inventory."); + FSCommon::report_to_nearby_chat("Please specify a destination folder in your inventory."); } } } } else { - report_to_nearby_chat(llformat("Packager usage: \"%s destination_prim_UUID inventory folder name\"",command.c_str())); + FSCommon::report_to_nearby_chat(llformat("Packager usage: \"%s destination_prim_UUID inventory folder name\"",command.c_str())); } return false; } @@ -1405,7 +1405,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest cmd_line_mPackagerTargetFolderName = ""; cmd_line_mPackagerTargetFolder.setNull(); cmd_line_mPackagerDest.setNull(); - report_to_nearby_chat("Packager: Stopped and cleared."); + FSCommon::report_to_nearby_chat("Packager: Stopped and cleared."); return false; } } @@ -1426,7 +1426,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest { if (!LLUUID::validate(take)) { - report_to_nearby_chat("Entered UUID is invalid! (Hint: use the \"copy key\" button in the build menu.)"); + FSCommon::report_to_nearby_chat("Entered UUID is invalid! (Hint: use the \"copy key\" button in the build menu.)"); return false; } else @@ -1434,7 +1434,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest LLViewerObject* objectp = gObjectList.findObject(LLUUID(take)); if(!objectp) { - report_to_nearby_chat("Unable to locate object. Please verify the object is rezzed, in view, and that the UUID is correct."); + FSCommon::report_to_nearby_chat("Unable to locate object. Please verify the object is rezzed, in view, and that the UUID is correct."); return false; } else @@ -1450,23 +1450,23 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest if (to_take.empty()) { - report_to_nearby_chat("No objects to take."); + FSCommon::report_to_nearby_chat("No objects to take."); } else { - report_to_nearby_chat(llformat("Found destination folder \"%s\".", folder_name.c_str())); + FSCommon::report_to_nearby_chat(llformat("Found destination folder \"%s\".", folder_name.c_str())); gZTake = new JCZtake(folder, true, LLUUID::null, folder_name, (command == "kcopy") ? DRD_ACQUIRE_TO_AGENT_INVENTORY : DRD_TAKE_INTO_AGENT_INVENTORY, false, to_take); } } else { - report_to_nearby_chat(llformat("\"%s\" folder not found. Please check the spelling.", folder_name.c_str())); - report_to_nearby_chat("The packager cannot work if the folder is inside another folder."); + FSCommon::report_to_nearby_chat(llformat("\"%s\" folder not found. Please check the spelling.", folder_name.c_str())); + FSCommon::report_to_nearby_chat("The packager cannot work if the folder is inside another folder."); } } catch (std::out_of_range&) { - report_to_nearby_chat("Please specify a destination folder in your inventory."); + FSCommon::report_to_nearby_chat("Please specify a destination folder in your inventory."); } } return false; @@ -1480,12 +1480,12 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest { if (gMTake) { - report_to_nearby_chat("Mtake is already active."); + FSCommon::report_to_nearby_chat("Mtake is already active."); } else { - report_to_nearby_chat("Beginning Mtake."); - report_to_nearby_chat("Verifying folder location..."); + FSCommon::report_to_nearby_chat("Beginning Mtake."); + FSCommon::report_to_nearby_chat("Verifying folder location..."); std::string folder_name; std::string tmp; while (i >> tmp) @@ -1498,18 +1498,18 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest LLUUID folder = gInventory.findCategoryByName(folder_name); if (folder.notNull()) { - report_to_nearby_chat(llformat("Found destination folder \"%s\".", folder_name.c_str())); + FSCommon::report_to_nearby_chat(llformat("Found destination folder \"%s\".", folder_name.c_str())); gMTake = new TMZtake(folder); } else { - report_to_nearby_chat(llformat("\"%s\" folder not found. Please check the spelling.", folder_name.c_str())); - report_to_nearby_chat("Mtake cannot work if the folder is inside another folder."); + FSCommon::report_to_nearby_chat(llformat("\"%s\" folder not found. Please check the spelling.", folder_name.c_str())); + FSCommon::report_to_nearby_chat("Mtake cannot work if the folder is inside another folder."); } } catch (std::out_of_range&) { - report_to_nearby_chat("Please specify a destination folder in your inventory."); + FSCommon::report_to_nearby_chat("Please specify a destination folder in your inventory."); } } } @@ -1517,7 +1517,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest { if (!gMTake) { - report_to_nearby_chat("Mtake is already deactivated."); + FSCommon::report_to_nearby_chat("Mtake is already deactivated."); } else { @@ -1528,14 +1528,14 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest } else { - report_to_nearby_chat(llformat("Invalid command: \"%s\". Valid commands: mtake on (destination inventory folder); mtake off", setting.c_str())); + FSCommon::report_to_nearby_chat(llformat("Invalid command: \"%s\". Valid commands: mtake on (destination inventory folder); mtake off", setting.c_str())); } return false; } else { - report_to_nearby_chat("The Mtake command renames selected rezzed objects to the dimensions of the prim, then copies them into the folder you specify in your inventory."); - report_to_nearby_chat("Valid commands: mtake on (destination inventory folder name); mtake off"); + FSCommon::report_to_nearby_chat("The Mtake command renames selected rezzed objects to the dimensions of the prim, then copies them into the folder you specify in your inventory."); + FSCommon::report_to_nearby_chat("Valid commands: mtake on (destination inventory folder name); mtake off"); } return false; } @@ -1555,11 +1555,11 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest LLStringUtil::format_map_t args; args["[POS]"] = cameraPositionString; - report_to_nearby_chat(LLTrans::getString("FSCameraPositionCopied", args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("FSCameraPositionCopied", args)); } else { - report_to_nearby_chat("Could not get a valid region pointer."); + FSCommon::report_to_nearby_chat("Could not get a valid region pointer."); } return false; } @@ -1597,7 +1597,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest { LLStringUtil::format_map_t args; args["COMMAND"] = llformat("%s", std::string(sFSCmdLineRollDice).c_str()); - report_to_nearby_chat(LLTrans::getString("FSCmdLineRollDiceModifiersInvalid", args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("FSCmdLineRollDiceModifiersInvalid", args)); return false; } @@ -1613,11 +1613,11 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest { result_per_die -= 1; die_penetrated = 0; - report_to_nearby_chat(llformat("#%d 1d%d-1: %d.", die_iter, faces, result_per_die)); + FSCommon::report_to_nearby_chat(llformat("#%d 1d%d-1: %d.", die_iter, faces, result_per_die)); } else { - report_to_nearby_chat(llformat("#%d 1d%d: %d.", die_iter, faces, result_per_die)); + FSCommon::report_to_nearby_chat(llformat("#%d 1d%d: %d.", die_iter, faces, result_per_die)); } result += result_per_die; ++die_iter; @@ -1627,7 +1627,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest // Modifier: Successes lower than a value if (result_per_die <= modifier) { - report_to_nearby_chat(" ^-- " + LLTrans::getString("FSCmdLineRollDiceSuccess")); + FSCommon::report_to_nearby_chat(" ^-- " + LLTrans::getString("FSCmdLineRollDiceSuccess")); ++successes; } else @@ -1640,7 +1640,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest // Modifier: Successes greater than a value if (result_per_die >= modifier) { - report_to_nearby_chat(" ^-- " + LLTrans::getString("FSCmdLineRollDiceSuccess")); + FSCommon::report_to_nearby_chat(" ^-- " + LLTrans::getString("FSCmdLineRollDiceSuccess")); ++successes; } else @@ -1651,13 +1651,13 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest else if ((modifier_type == "!" && result_per_die == modifier) || (modifier_type == "!>" && result_per_die >= modifier) || (modifier_type == "!<" && result_per_die <= modifier)) { // Modifier: Exploding dice - report_to_nearby_chat(" ^-- " + LLTrans::getString("FSCmdLineRollDiceExploded")); + FSCommon::report_to_nearby_chat(" ^-- " + LLTrans::getString("FSCmdLineRollDiceExploded")); --die_iter; } else if ((modifier_type == "!p" && result_per_die == modifier) || (modifier_type == "!p>" && result_per_die >= modifier) || (modifier_type == "!p<" && result_per_die <= modifier)) { // Modifier: Penetrating dice (special style of exploding dice) - report_to_nearby_chat(" ^-- " + LLTrans::getString("FSCmdLineRollDicePenetrated")); + FSCommon::report_to_nearby_chat(" ^-- " + LLTrans::getString("FSCmdLineRollDicePenetrated")); die_penetrated = 1; --die_iter; } @@ -1665,7 +1665,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest { // Modifier: Reroll result -= result_per_die; - report_to_nearby_chat(" ^-- " + LLTrans::getString("FSCmdLineRollDiceReroll")); + FSCommon::report_to_nearby_chat(" ^-- " + LLTrans::getString("FSCmdLineRollDiceReroll")); --die_iter; } @@ -1675,7 +1675,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest // More than 1000 iterations already? We probably have an infinite loop - kill all further rolls // Explosions can trigger this easily, "rolld 1 6 !> 0" for example die_iter = 102; - report_to_nearby_chat(LLTrans::getString("FSCmdLineRollDiceFreezeGuard")); + FSCommon::report_to_nearby_chat(LLTrans::getString("FSCmdLineRollDiceFreezeGuard")); return false; } } @@ -1695,14 +1695,14 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest else if (modifier_type == ">" || modifier_type == "<") { // Modifier: Successes - report_to_nearby_chat(LLTrans::getString("FSCmdLineRollDiceSuccess") + ": " + llformat("%d", successes)); + FSCommon::report_to_nearby_chat(LLTrans::getString("FSCmdLineRollDiceSuccess") + ": " + llformat("%d", successes)); } modifier_type = modifier_type + llformat("%d", modifier); } } else { - report_to_nearby_chat(LLTrans::getString("FSCmdLineRollDiceLimits")); + FSCommon::report_to_nearby_chat(LLTrans::getString("FSCmdLineRollDiceLimits")); return false; } } @@ -1718,7 +1718,7 @@ bool cmd_line_chat(std::string_view revised_text, EChatType type, bool from_gest args["FACES"] = llformat("%d", faces); args["RESULT"] = llformat("%d", result); args["MODIFIER"] = llformat("%s", modifier_type.c_str()); - report_to_nearby_chat(LLTrans::getString("FSCmdLineRollDiceTotal", args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("FSCmdLineRollDiceTotal", args)); return false; } } @@ -1844,9 +1844,9 @@ bool cmdline_packager(std::string_view message, const LLUUID& fromID, const LLUU std::string item(csv, start, comma-start); LLStringUtil::trim(item); LLViewerObject* objectp = gObjectList.findObject(LLUUID(item)); - if(!objectp) + if (!objectp) { - report_to_nearby_chat(llformat("Packager: Unable to locate object. Please verify the object is rezzed, in view, and that the UUID is correct: \"%s\"", item.c_str())); + FSCommon::report_to_nearby_chat(llformat("Packager: Unable to locate object. Please verify the object is rezzed, in view, and that the UUID is correct: \"%s\"", item.c_str())); return false; } else @@ -1860,14 +1860,14 @@ bool cmdline_packager(std::string_view message, const LLUUID& fromID, const LLUU start = comma + 1; } - while(comma < csv.length()); + while (comma < csv.length()); - report_to_nearby_chat(llformat("Packager: adding objects: \"%s\"", static_cast(csv).c_str())); + FSCommon::report_to_nearby_chat(llformat("Packager: adding objects: \"%s\"", static_cast(csv).c_str())); return true; } else if (cmd == "kpackagerend") { - report_to_nearby_chat("Packager: finalizing."); + FSCommon::report_to_nearby_chat("Packager: finalizing."); gZTake = new JCZtake(cmd_line_mPackagerTargetFolder, true, cmd_line_mPackagerDest, cmd_line_mPackagerTargetFolderName, DRD_ACQUIRE_TO_AGENT_INVENTORY, false, cmd_line_mPackagerToTake); cmd_line_mPackagerToTake.clear(); cmd_line_mPackagerTargetFolderName = ""; diff --git a/indra/newview/fschathistory.cpp b/indra/newview/fschathistory.cpp index 9f5ad93a32..46ff9a47ea 100644 --- a/indra/newview/fschathistory.cpp +++ b/indra/newview/fschathistory.cpp @@ -1467,7 +1467,7 @@ void FSChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL // FS:LO FIRE-2899 - Faded text for IMs in nearby chat //IRC styled /me messages. - bool irc_me = is_irc_me_prefix(chat.mText); + bool irc_me = FSCommon::is_irc_me_prefix(chat.mText); // Delimiter after a name in header copy/past and in plain text mode std::string delimiter = ": "; diff --git a/indra/newview/fscommon.cpp b/indra/newview/fscommon.cpp index c90be48d87..aca85af03c 100644 --- a/indra/newview/fscommon.cpp +++ b/indra/newview/fscommon.cpp @@ -69,7 +69,7 @@ extern S32 gMaxAgentGroups; S32 FSCommon::sObjectAddMsg = 0; -void report_to_nearby_chat(std::string_view message) +void FSCommon::report_to_nearby_chat(std::string_view message) { LLChat chat; chat.mText = message; @@ -77,19 +77,19 @@ void report_to_nearby_chat(std::string_view message) LLNotificationsUI::LLNotificationManager::instance().onChat(chat, LLSD()); } -std::string format_string(std::string text, const LLStringUtil::format_map_t& args) +std::string FSCommon::format_string(std::string text, const LLStringUtil::format_map_t& args) { LLStringUtil::format(text, args); return text; } -bool is_irc_me_prefix(std::string_view text) +bool FSCommon::is_irc_me_prefix(std::string_view text) { const std::string_view prefix = text.substr(0, 4); return (prefix == "/me " || prefix == "/me'"); } -std::string unescape_name(std::string_view name) +std::string FSCommon::unescape_name(std::string_view name) { // bugfix for SL-46920: preventing filenames that break stuff. char * curl_str = curl_unescape(name.data(), static_cast(name.size())); // Calling data() should be ok here because we also pass the length diff --git a/indra/newview/fscommon.h b/indra/newview/fscommon.h index 2e7946b0e5..be912aa9a3 100644 --- a/indra/newview/fscommon.h +++ b/indra/newview/fscommon.h @@ -34,16 +34,16 @@ class LLAvatarName; class LLViewerObject; class LLViewerParcelMgr; -const F64 AVATAR_UNKNOWN_Z_OFFSET = -1.0; // Const value for avatars at unknown height -const F32 AVATAR_UNKNOWN_RANGE = -1.f; - -void report_to_nearby_chat(std::string_view message); -std::string format_string(std::string text, const LLStringUtil::format_map_t& args); -bool is_irc_me_prefix(std::string_view text); -std::string unescape_name(std::string_view name); +constexpr F64 AVATAR_UNKNOWN_Z_OFFSET = -1.0; // Const value for avatars at unknown height +constexpr F32 AVATAR_UNKNOWN_RANGE = -1.f; namespace FSCommon { + void report_to_nearby_chat(std::string_view message); + std::string format_string(std::string text, const LLStringUtil::format_map_t& args); + bool is_irc_me_prefix(std::string_view text); + std::string unescape_name(std::string_view name); + std::string applyAutoCloseOoc(std::string message); std::string applyMuPose(std::string message); diff --git a/indra/newview/fsconsoleutils.cpp b/indra/newview/fsconsoleutils.cpp index ca03c46926..745ee3051e 100644 --- a/indra/newview/fsconsoleutils.cpp +++ b/indra/newview/fsconsoleutils.cpp @@ -69,7 +69,7 @@ bool FSConsoleUtils::ProcessChatMessage(const LLChat& chat_msg, const LLSD &args std::string sender_name(chat_msg.mFromName); //IRC styled /me messages. - bool irc_me = is_irc_me_prefix(chat_msg.mText); + bool irc_me = FSCommon::is_irc_me_prefix(chat_msg.mText); // Delimiter after a name in header copy/past and in plain text mode std::string delimiter = ": "; @@ -128,7 +128,7 @@ void FSConsoleUtils::onProcessChatAvatarNameLookup(const LLUUID& agent_id, const std::string sender_name(chat_msg.mFromName); //IRC styled /me messages. - bool irc_me = is_irc_me_prefix(chat_msg.mText); + bool irc_me = FSCommon::is_irc_me_prefix(chat_msg.mText); // Delimiter after a name in header copy/past and in plain text mode std::string delimiter = ": "; @@ -218,7 +218,7 @@ void FSConsoleUtils::onProccessInstantMessageNameLookup(const LLUUID& agent_id, std::string delimiter = ": "; // irc styled messages - if (is_irc_me_prefix(message)) + if (FSCommon::is_irc_me_prefix(message)) { delimiter = LLStringUtil::null; message = message.substr(3); diff --git a/indra/newview/fsfloaterim.cpp b/indra/newview/fsfloaterim.cpp index 560c39b354..643db2eee1 100644 --- a/indra/newview/fsfloaterim.cpp +++ b/indra/newview/fsfloaterim.cpp @@ -462,7 +462,7 @@ void FSFloaterIM::sendMsgFromInputEditor(EChatType type) str_viewer_mode = "T"; //Build it up - size_t insert_pos = is_irc_me_prefix(utf8_text) ? 4 : 0; + size_t insert_pos = FSCommon::is_irc_me_prefix(utf8_text) ? 4 : 0; //For testing/beta groups, we display the build version since it doesn't speed by and this might change often if (FSData::getInstance()->isTestingGroup(mSessionID)) diff --git a/indra/newview/fskeywords.cpp b/indra/newview/fskeywords.cpp index 5b49f831c2..813d0a0194 100644 --- a/indra/newview/fskeywords.cpp +++ b/indra/newview/fskeywords.cpp @@ -157,7 +157,7 @@ void FSKeywords::notify(const LLChat& chat) if (FSEnableGrowl) { std::string msg = chat.mFromName; - if (is_irc_me_prefix(chat.mText)) + if (FSCommon::is_irc_me_prefix(chat.mText)) { msg = msg + chat.mText.substr(3); } diff --git a/indra/newview/fslslbridge.cpp b/indra/newview/fslslbridge.cpp index 178794ea30..c2762351d1 100644 --- a/indra/newview/fslslbridge.cpp +++ b/indra/newview/fslslbridge.cpp @@ -445,13 +445,13 @@ bool FSLSLBridge::lslToViewer(std::string_view message, const LLUUID& fromID, co { LLStringUtil::format_map_t args2; args2["OBJECT_CHARACTER_TIME"] = scriptInfoArray[5].asString(); - args["PATHFINDING_TEXT"] = " " + format_string(LLTrans::getString("fsbridge_script_info_pf"), args2); + args["PATHFINDING_TEXT"] = " " + FSCommon::format_string(LLTrans::getString("fsbridge_script_info_pf"), args2); } else { args["PATHFINDING_TEXT"] = ""; } - report_to_nearby_chat(format_string(LLTrans::getString("fsbridge_script_info"), args)); + FSCommon::report_to_nearby_chat(FSCommon::format_string(LLTrans::getString("fsbridge_script_info"), args)); if (scriptInfoArrayCount == 27) { LLStringUtil::format_map_t args3; @@ -476,19 +476,19 @@ bool FSLSLBridge::lslToViewer(std::string_view message, const LLUUID& fromID, co args3["OBJECT_TEMP_ATTACHED"] = scriptInfoArray[24].asInteger() == 1 ? LLTrans::getString("Yes") : LLTrans::getString("No"); args3["AVATAR_POS"] = scriptInfoArray[25].asString(); args3["INSPECTING_KEY"] = scriptInfoArray[26].asString(); - report_to_nearby_chat(format_string(LLTrans::getString("fsbridge_script_info_ext"), args3)); + FSCommon::report_to_nearby_chat(FSCommon::format_string(LLTrans::getString("fsbridge_script_info_ext"), args3)); } } else { - report_to_nearby_chat(LLTrans::getString("fsbridge_error_scriptinfonotfound")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_error_scriptinfonotfound")); LL_WARNS("FSLSLBridge") << "ScriptInfo - Object to check is invalid or out of range (warning returned by viewer, data somehow passed bridge script check)" << LL_ENDL; } } else { - report_to_nearby_chat(LLTrans::getString("fsbridge_error_scriptinfomalformed")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_error_scriptinfomalformed")); LL_WARNS("FSLSLBridge") << "ScriptInfo - Received malformed response from bridge (missing ending tag)" << LL_ENDL; } } @@ -526,17 +526,17 @@ bool FSLSLBridge::lslToViewer(std::string_view message, const LLUUID& fromID, co { if (message.substr(valuepos + FS_ERROR_ATTRIBUTE.size(), 9) == "injection") { - report_to_nearby_chat(LLTrans::getString("fsbridge_error_injection")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_error_injection")); LL_WARNS("FSLSLBridge") << "Script injection detected" << LL_ENDL; } else if (message.substr(valuepos + FS_ERROR_ATTRIBUTE.size(), 18) == "scriptinfonotfound") { - report_to_nearby_chat(LLTrans::getString("fsbridge_error_scriptinfonotfound")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_error_scriptinfonotfound")); LL_WARNS("FSLSLBridge") << "ScriptInfo - Object to check is invalid or out of range (warning returned by bridge)" << LL_ENDL; } else if (message.substr(valuepos + FS_ERROR_ATTRIBUTE.size(), 7) == "wrongvm") { - report_to_nearby_chat(LLTrans::getString("fsbridge_error_wrongvm")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_error_wrongvm")); LL_WARNS("FSLSLBridge") << "Script is using old LSO (16 KB memory limit) instead of new Mono (64 KB memory limit) virtual machine, which creates high probability of stack-heap collision and bridge failure by running out of memory" << LL_ENDL; } else @@ -618,7 +618,7 @@ void FSLSLBridge::recreateBridge() { // FIRE-11746: Recreate should throw error if disabled LL_WARNS("FSLSLBridge") << "Asked to create bridge, but bridge is disabled. Aborting." << LL_ENDL; - report_to_nearby_chat(LLTrans::getString("fsbridge_cant_create_disabled")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_cant_create_disabled")); setBridgeCreating(false); // FIRE-11746 return; @@ -627,7 +627,7 @@ void FSLSLBridge::recreateBridge() if (gSavedSettings.getBOOL("NoInventoryLibrary")) { LL_WARNS("FSLSLBridge") << "Asked to create bridge, but we don't have a library. Aborting." << LL_ENDL; - report_to_nearby_chat(LLTrans::getString("fsbridge_no_library")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_no_library")); setBridgeCreating(false); return; } @@ -635,12 +635,12 @@ void FSLSLBridge::recreateBridge() if (mBridgeCreating) { LL_WARNS("FSLSLBridge") << "Bridge creation already in progress, aborting new attempt." << LL_ENDL; - report_to_nearby_chat(LLTrans::getString("fsbridge_already_creating")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_already_creating")); return; } //announce yourself - report_to_nearby_chat(LLTrans::getString("fsbridge_creating")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_creating")); setupFSCategory([](const LLUUID& bridge_folder_id) { @@ -739,7 +739,7 @@ void FSLSLBridge::initBridge() if (gSavedSettings.getBOOL("NoInventoryLibrary")) { LL_WARNS("FSLSLBridge") << "Asked to create bridge, but we don't have a library. Aborting." << LL_ENDL; - report_to_nearby_chat(LLTrans::getString("fsbridge_no_library")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_no_library")); setBridgeCreating(false); return; } @@ -809,7 +809,7 @@ void FSLSLBridge::startCreation() setBridgeCreating(true); mFinishCreation = false; //announce yourself - report_to_nearby_chat(LLTrans::getString("fsbridge_creating")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_creating")); createNewBridge(); } @@ -871,7 +871,7 @@ void FSLSLBridge::processAttach(LLViewerObject* object, const LLViewerJointAttac LL_WARNS("FSLSLBridge") << "Bridge not created. Our bridge container attachment isn't named correctly." << LL_ENDL; if (mBridgeCreating) { - report_to_nearby_chat(LLTrans::getString("fsbridge_failure_creation_bad_name")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_failure_creation_bad_name")); setBridgeCreating(false); //in case we interrupted the creation } return; @@ -883,7 +883,7 @@ void FSLSLBridge::processAttach(LLViewerObject* object, const LLViewerJointAttac LL_WARNS("FSLSLBridge") << "Bridge container is still NULL in inventory. Aborting." << LL_ENDL; if (mBridgeCreating) { - report_to_nearby_chat(LLTrans::getString("fsbridge_failure_creation_null")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_failure_creation_null")); setBridgeCreating(false); //in case we interrupted the creation } return; @@ -899,7 +899,7 @@ void FSLSLBridge::processAttach(LLViewerObject* object, const LLViewerJointAttac mAllowDetach = true; LLVOAvatarSelf::detachAttachmentIntoInventory(fsObject->getUUID()); LL_WARNS("FSLSLBridge") << "Attempt to attach to bridge point an object other than current bridge" << LL_ENDL; - report_to_nearby_chat(LLTrans::getString("fsbridge_failure_attach_wrong_object")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_failure_attach_wrong_object")); if (mBridgeCreating) { setBridgeCreating(false); //in case we interrupted the creation @@ -917,7 +917,7 @@ void FSLSLBridge::processAttach(LLViewerObject* object, const LLViewerJointAttac LL_WARNS("FSLSLBridge") << "Bridge container isn't in the correct inventory location. Detaching it and aborting." << LL_ENDL; if (mBridgeCreating) { - report_to_nearby_chat(LLTrans::getString("fsbridge_failure_attach_wrong_location")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_failure_attach_wrong_location")); setBridgeCreating(false); //in case we interrupted the creation } return; @@ -933,7 +933,7 @@ void FSLSLBridge::processAttach(LLViewerObject* object, const LLViewerJointAttac LL_WARNS("FSLSLBridge") << "Something unknown just got attached to bridge point, detaching and aborting." << LL_ENDL; if (mBridgeCreating) { - report_to_nearby_chat(LLTrans::getString("fsbridge_failure_attach_point_in_use")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_failure_attach_point_in_use")); setBridgeCreating(false); //in case we interrupted the creation } LLVOAvatarSelf::detachAttachmentIntoInventory(mpBridge->getUUID()); @@ -1009,7 +1009,7 @@ void FSLSLBridge::inventoryChanged(LLViewerObject* object, } else { - report_to_nearby_chat(LLTrans::getString("fsbridge_warning_unexpected_items")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_warning_unexpected_items")); LL_WARNS("FSLSLBridge") << "The bridge inventory contains items other than bridge script." << LL_ENDL; if (!isOurScript) //some junk but no valid script? Unlikely to happen, but lets add script anyway. { @@ -1033,7 +1033,7 @@ void FSLSLBridge::inventoryChanged(LLViewerObject* object, LL_INFOS("FSLSLBridge") << "Bridge created." << LL_ENDL; mFinishCreation = false; mAllowedDetachables.clear(); - report_to_nearby_chat(LLTrans::getString("fsbridge_created")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_created")); } } @@ -1119,11 +1119,11 @@ void FSLSLBridge::processDetach(LLViewerObject* object, const LLViewerJointAttac if (mpBridge && mpBridge->getUUID() == fsObject->getUUID()) { mpBridge = nullptr; - report_to_nearby_chat(LLTrans::getString("fsbridge_detached")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_detached")); mIsFirstCallDone = false; if (mBridgeCreating) { - report_to_nearby_chat(LLTrans::getString("fsbridge_warning_not_finished")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_warning_not_finished")); setBridgeCreating(false); //in case we interrupted the creation mAllowedDetachables.clear(); } @@ -1320,7 +1320,7 @@ void FSLSLBridgeScriptCallback::fire(const LLUUID& inv_item) } else { - report_to_nearby_chat(LLTrans::getString("fsbridge_failure_creation_create_script")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_failure_creation_create_script")); cleanup = true; } } @@ -1440,7 +1440,7 @@ void FSLSLBridge::cleanUpBridge() { //something unexpected went wrong. Try to clean up and not crash. LL_WARNS("FSLSLBridge") << "Bridge object not found. Can't proceed with creation, exiting." << LL_ENDL; - report_to_nearby_chat(LLTrans::getString("fsbridge_failure_not_found")); + FSCommon::report_to_nearby_chat(LLTrans::getString("fsbridge_failure_not_found")); if (isBridgeValid()) { diff --git a/indra/newview/fsradar.cpp b/indra/newview/fsradar.cpp index 8658ae1cc4..c9b982769c 100644 --- a/indra/newview/fsradar.cpp +++ b/indra/newview/fsradar.cpp @@ -392,7 +392,7 @@ void FSRadar::updateRadarList() { LLStringUtil::format_map_t args; args["DISTANCE"] = llformat("%3.2f", avRange); - std::string message = format_string(str_chat_entering, args); + std::string message = FSCommon::format_string(str_chat_entering, args); make_ui_sound("UISndRadarChatEnter"); // FIRE-6069: Radar alerts sounds LLAvatarNameCache::get(avId, boost::bind(&FSRadar::radarAlertMsg, this, _1, _2, message)); } @@ -400,7 +400,7 @@ void FSRadar::updateRadarList() { LLStringUtil::format_map_t args; args["DISTANCE"] = llformat("%3.2f", avRange); - std::string message = format_string(str_draw_distance_entering, args); + std::string message = FSCommon::format_string(str_draw_distance_entering, args); make_ui_sound("UISndRadarDrawEnter"); // FIRE-6069: Radar alerts sounds LLAvatarNameCache::get(avId, boost::bind(&FSRadar::radarAlertMsg, this, _1, _2, message)); } @@ -411,7 +411,7 @@ void FSRadar::updateRadarList() { LLStringUtil::format_map_t args; args["DISTANCE"] = llformat("%3.2f", avRange); - std::string message = format_string(str_region_entering_distance, args); + std::string message = FSCommon::format_string(str_region_entering_distance, args); LLAvatarNameCache::get(avId, boost::bind(&FSRadar::radarAlertMsg, this, _1, _2, message)); } else @@ -449,7 +449,7 @@ void FSRadar::updateRadarList() { LLStringUtil::format_map_t args; args["DISTANCE"] = llformat("%3.2f", avRange); - std::string message = format_string(str_chat_entering, args); + std::string message = FSCommon::format_string(str_chat_entering, args); make_ui_sound("UISndRadarChatEnter"); // FIRE-6069: Radar alerts sounds LLAvatarNameCache::get(avId, boost::bind(&FSRadar::radarAlertMsg, this, _1, _2, message)); } @@ -465,7 +465,7 @@ void FSRadar::updateRadarList() { LLStringUtil::format_map_t args; args["DISTANCE"] = llformat("%3.2f", avRange); - std::string message = format_string(str_draw_distance_entering, args); + std::string message = FSCommon::format_string(str_draw_distance_entering, args); make_ui_sound("UISndRadarDrawEnter"); // FIRE-6069: Radar alerts sounds LLAvatarNameCache::get(avId, boost::bind(&FSRadar::radarAlertMsg, this, _1, _2, message)); } @@ -484,7 +484,7 @@ void FSRadar::updateRadarList() { LLStringUtil::format_map_t args; args["DISTANCE"] = llformat("%3.2f", avRange); - std::string message = format_string(str_region_entering_distance, args); + std::string message = FSCommon::format_string(str_region_entering_distance, args); LLAvatarNameCache::get(avId, boost::bind(&FSRadar::radarAlertMsg, this, _1, _2, message)); } else @@ -544,7 +544,7 @@ void FSRadar::updateRadarList() make_ui_sound("UISndRadarAgeAlert"); LLStringUtil::format_map_t args; args["AGE"] = llformat("%d", avAge); - std::string message = format_string(str_avatar_age_alert, args); + std::string message = FSCommon::format_string(str_avatar_age_alert, args); LLAvatarNameCache::get(avId, boost::bind(&FSRadar::radarAlertMsg, this, _1, _2, message)); } ent->mAgeAlertPerformed = true; @@ -1020,7 +1020,7 @@ void FSRadar::zoomAvatar(const LLUUID& avatar_id, std::string_view name) { LLStringUtil::format_map_t args; args["AVATARNAME"] = static_cast(name); - report_to_nearby_chat(LLTrans::getString("camera_no_focus", args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("camera_no_focus", args)); } } diff --git a/indra/newview/growlmanager.cpp b/indra/newview/growlmanager.cpp index 9f514c4127..94f074da9c 100644 --- a/indra/newview/growlmanager.cpp +++ b/indra/newview/growlmanager.cpp @@ -340,7 +340,7 @@ void GrowlManager::onInstantMessage(const LLSD& im) } std::string message = im["message"].asString(); - if (is_irc_me_prefix(message)) + if (FSCommon::is_irc_me_prefix(message)) { message = message.substr(3); } @@ -390,7 +390,7 @@ void GrowlManager::onNearbyChatMessage(const LLSD& chat) if ((EChatType)chat["chat_type"].asInteger() == CHAT_TYPE_IM) { std::string message = chat["message"].asString(); - if (is_irc_me_prefix(message)) + if (FSCommon::is_irc_me_prefix(message)) { message = message.substr(3); } diff --git a/indra/newview/lggbeammaps.cpp b/indra/newview/lggbeammaps.cpp index 654ae844bb..ed63acdc02 100644 --- a/indra/newview/lggbeammaps.cpp +++ b/indra/newview/lggbeammaps.cpp @@ -275,7 +275,7 @@ string_vec_t lggBeamMaps::getFileNames() if (found) { name = name.erase(name.length() - 4); - names.push_back(unescape_name(name)); + names.push_back(FSCommon::unescape_name(name)); } } @@ -288,7 +288,7 @@ string_vec_t lggBeamMaps::getFileNames() if (found) { name = name.erase(name.length() - 4); - names.push_back(unescape_name(name)); + names.push_back(FSCommon::unescape_name(name)); } } return names; @@ -307,7 +307,7 @@ string_vec_t lggBeamMaps::getColorsFileNames() if (found) { name = name.erase(name.length() - 4); - names.push_back(unescape_name(name)); + names.push_back(FSCommon::unescape_name(name)); } } @@ -321,7 +321,7 @@ string_vec_t lggBeamMaps::getColorsFileNames() if (found) { name = name.erase(name.length() - 4); - names.push_back(unescape_name(name)); + names.push_back(FSCommon::unescape_name(name)); } } return names; diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 66ca3f6875..1e9d7b4b91 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -3373,13 +3373,13 @@ void LLAgentCamera::loadCameraPosition() if (stored_camera_pos.isNull()) { - report_to_nearby_chat(LLTrans::getString("LoadCameraPositionNoneSaved")); + FSCommon::report_to_nearby_chat(LLTrans::getString("LoadCameraPositionNoneSaved")); return; } if (dist_vec_squared(gAgent.getPositionGlobal(), stored_camera_pos) > far_clip_squared) { - report_to_nearby_chat(LLTrans::getString("LoadCameraPositionOutsideDrawDistance")); + FSCommon::report_to_nearby_chat(LLTrans::getString("LoadCameraPositionOutsideDrawDistance")); return; } diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 4f197437a1..c370ab8ed1 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -886,8 +886,8 @@ void LLEnvironment::loadLegacyPresets() if (found) { name = name.erase(name.length() - 4); - mLegacySkies.push_back(unescape_name(name)); - LL_DEBUGS("WindlightCaps") << "Added Legacy Sky: " << unescape_name(name) << LL_ENDL; + mLegacySkies.push_back(FSCommon::unescape_name(name)); + LL_DEBUGS("WindlightCaps") << "Added Legacy Sky: " << FSCommon::unescape_name(name) << LL_ENDL; } } @@ -901,8 +901,8 @@ void LLEnvironment::loadLegacyPresets() if (found) { name = name.erase(name.length() - 4); - mLegacyWater.push_back(unescape_name(name)); - LL_DEBUGS("WindlightCaps") << "Added Legacy Water: " << unescape_name(name) << LL_ENDL; + mLegacyWater.push_back(FSCommon::unescape_name(name)); + LL_DEBUGS("WindlightCaps") << "Added Legacy Water: " << FSCommon::unescape_name(name) << LL_ENDL; } } @@ -916,8 +916,8 @@ void LLEnvironment::loadLegacyPresets() if (found) { name = name.erase(name.length() - 4); - mLegacyDayCycles.push_back(unescape_name(name)); - LL_DEBUGS("WindlightCaps") << "Added Legacy Day Cycle: " << unescape_name(name) << LL_ENDL; + mLegacyDayCycles.push_back(FSCommon::unescape_name(name)); + LL_DEBUGS("WindlightCaps") << "Added Legacy Day Cycle: " << FSCommon::unescape_name(name) << LL_ENDL; } } } diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index cd4aaea2de..d531443468 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -443,7 +443,7 @@ void inventory_offer_handler(LLOfferInfo* info) message_type = "InvOfferAutoAcceptUser"; } - report_to_nearby_chat(LLTrans::getString(message_type, chat_args)); + FSCommon::report_to_nearby_chat(LLTrans::getString(message_type, chat_args)); make_ui_sound("UISndInventoryOffer"); } // @@ -1626,7 +1626,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id, // Consolidate IRC /me prefix checks //std::string prefix = message.substr(0, 4); //if (prefix == "/me " || prefix == "/me'") - if (is_irc_me_prefix(message)) + if (FSCommon::is_irc_me_prefix(message)) // { chat.mChatStyle = CHAT_STYLE_IRC; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 3a8868d4fa..602a8fcab5 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3527,7 +3527,7 @@ void LLIMMgr::addMessage( { LLStringUtil::format_map_t args; args["NAME"] = LLSLURL("group", new_session_id, "about").getSLURLString(); - report_to_nearby_chat(LLTrans::getString("GroupChatMuteNotice", args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("GroupChatMuteNotice", args)); } clearPendingInvitation(new_session_id); clearPendingAgentListUpdates(new_session_id); @@ -3624,7 +3624,7 @@ void LLIMMgr::addMessage( else if (reportIgnoredAdHocSession) { // report_to_nearby_chat(LLTrans::getString("IgnoredAdHocSession")); - report_to_nearby_chat(LLTrans::getString("IgnoredAdHocSession", args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("IgnoredAdHocSession", args)); } // return; @@ -4981,7 +4981,7 @@ public: { LLStringUtil::format_map_t args; args["NAME"] = LLSLURL("group", session_id, "about").getSLURLString(); - report_to_nearby_chat(LLTrans::getString("GroupChatMuteNotice", args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("GroupChatMuteNotice", args)); } //KC: make sure we leave the group chat at the server end as well diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index 1563dfa10a..f7fd8159ab 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -400,7 +400,7 @@ void LLMuteList::updateAdd(const LLMute& mute, bool show_message /* = true */) { LLStringUtil::format_map_t args; args["NAME"] = mute.mName; - report_to_nearby_chat(LLTrans::getString("Mute_Add", args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("Mute_Add", args)); } // } @@ -512,7 +512,7 @@ void LLMuteList::updateRemove(const LLMute& mute) { LLStringUtil::format_map_t args; args["NAME"] = mute.mName; - report_to_nearby_chat(LLTrans::getString("Mute_Remove", args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("Mute_Remove", args)); } // } diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 2a57c15954..ed9861fee0 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -2132,7 +2132,7 @@ void LLNetMap::handleCam() } else { - report_to_nearby_chat(LLTrans::getString("minimap_no_focus")); + FSCommon::report_to_nearby_chat(LLTrans::getString("minimap_no_focus")); } } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 6d83d13499..4fd058a68f 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -418,7 +418,7 @@ void downloadGridlistError( LLSD const &aData, std::string const &aURL ) if (rawData.size() == 0) { - report_to_nearby_chat(LLTrans::getString("SLGridStatusInvalidMsg")); + FSCommon::report_to_nearby_chat(LLTrans::getString("SLGridStatusInvalidMsg")); LL_WARNS("SLGridStatusResponder") << "Error - empty output" << LL_ENDL; return; } @@ -490,17 +490,17 @@ void downloadGridlistError( LLSD const &aData, std::string const &aURL ) LLStringUtil::trim(newsTitle); LLStringUtil::trim(newsDesc); LLStringUtil::trim(newsLink); - report_to_nearby_chat("[ " + newsTitle + " ] " + newsDesc + " [ " + newsLink + " ]"); + FSCommon::report_to_nearby_chat("[ " + newsTitle + " ] " + newsDesc + " [ " + newsLink + " ]"); } else { - report_to_nearby_chat(LLTrans::getString("SLGridStatusInvalidMsg")); + FSCommon::report_to_nearby_chat(LLTrans::getString("SLGridStatusInvalidMsg")); LL_WARNS("SLGridStatusResponder") << "Error - inner tag(s) missing" << LL_ENDL; } } else { - report_to_nearby_chat(LLTrans::getString("SLGridStatusInvalidMsg")); + FSCommon::report_to_nearby_chat(LLTrans::getString("SLGridStatusInvalidMsg")); LL_WARNS("SLGridStatusResponder") << "Error - output without " << LL_ENDL; } } @@ -512,13 +512,13 @@ void downloadGridstatusError(LLSD const &aData, std::string const &aURL) if (status.getType() == HTTP_INTERNAL_ERROR) { - report_to_nearby_chat(LLTrans::getString("SLGridStatusTimedOut")); + FSCommon::report_to_nearby_chat(LLTrans::getString("SLGridStatusTimedOut")); } else { LLStringUtil::format_map_t args; args["STATUS"] = llformat("%d", status.getType()); - report_to_nearby_chat(LLTrans::getString("SLGridStatusOtherError", args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("SLGridStatusOtherError", args)); } } // @@ -3299,7 +3299,7 @@ bool idle_startup() // FIRE-6643 Display MOTD when login screens are disabled if (gSavedSettings.getBOOL("FSDisableLoginScreens")) { - report_to_nearby_chat(gAgent.mMOTD); + FSCommon::report_to_nearby_chat(gAgent.mMOTD); } // // diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp index 2f7bbeea14..197a0f6ff6 100644 --- a/indra/newview/lltoastimpanel.cpp +++ b/indra/newview/lltoastimpanel.cpp @@ -75,7 +75,7 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notif // Consolidate IRC /me prefix checks //std::string prefix = p.message.substr(0, 4); //if (prefix == "/me " || prefix == "/me'") - if (is_irc_me_prefix(p.message)) + if (FSCommon::is_irc_me_prefix(p.message)) // { //style_params.font.style = "UNDERLINE"; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 62a8553d8b..0bf8a2e3f7 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -829,16 +829,16 @@ class LLAdvancedToggleHUDInfo : public view_listener_t } else if ("badge" == info_type) { - report_to_nearby_chat("Hippos!"); + FSCommon::report_to_nearby_chat("Hippos!"); } else if ("cookies" == info_type) { - report_to_nearby_chat("Cookies!"); + FSCommon::report_to_nearby_chat("Cookies!"); } // else if ("motd" == info_type) { - report_to_nearby_chat(gAgent.mMOTD); + FSCommon::report_to_nearby_chat(gAgent.mMOTD); } // return true; @@ -7715,13 +7715,13 @@ class LLWorldAlwaysRun : public view_listener_t { gAgent.clearAlwaysRun(); // gAgent.clearRunning(); - report_to_nearby_chat(LLTrans::getString("AlwaysRunDisabled")); + FSCommon::report_to_nearby_chat(LLTrans::getString("AlwaysRunDisabled")); } else { gAgent.setAlwaysRun(); // gAgent.setRunning(); - report_to_nearby_chat(LLTrans::getString("AlwaysRunEnabled")); + FSCommon::report_to_nearby_chat(LLTrans::getString("AlwaysRunEnabled")); } // tell the simulator. @@ -9799,7 +9799,7 @@ void handle_selected_texture_info(void*) //LLSD args; //args["MESSAGE"] = msg; //LLNotificationsUtil::add("SystemMessage", args); - report_to_nearby_chat(msg); + FSCommon::report_to_nearby_chat(msg); // } } @@ -10203,7 +10203,7 @@ void setDoubleClickAction(const std::string& control) bool ignore_mask = true; conflictHandler.registerControl(control, index, click, key, mask, ignore_mask); - report_to_nearby_chat(LLTrans::getString("DoubleClickTeleportEnabled")); + FSCommon::report_to_nearby_chat(LLTrans::getString("DoubleClickTeleportEnabled")); } else { @@ -10214,7 +10214,7 @@ void setDoubleClickAction(const std::string& control) if (data.mMouse == click && data.mKey == key && data.mMask == mask) { conflictHandler.clearControl(control, i); - report_to_nearby_chat(LLTrans::getString("DoubleClickTeleportDisabled")); + FSCommon::report_to_nearby_chat(LLTrans::getString("DoubleClickTeleportDisabled")); } } } @@ -10685,7 +10685,7 @@ class FSDumpSimulatorFeaturesToChat : public view_listener_t std::stringstream out_str; region->getSimulatorFeatures(sim_features); LLSDSerialize::toPrettyXML(sim_features, out_str); - report_to_nearby_chat(out_str.str()); + FSCommon::report_to_nearby_chat(out_str.str()); } return true; } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index d2bace66ab..1333ce477d 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -203,7 +203,7 @@ public: { if (gSavedSettings.getBOOL("FSExperimentalLostAttachmentsFixReport")) { - report_to_nearby_chat("Refreshing attachments..."); + FSCommon::report_to_nearby_chat("Refreshing attachments..."); } mEventTimer.stop(); LLAttachmentsMgr::instance().refreshAttachments(); @@ -3050,7 +3050,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) // Consolidate IRC /me prefix checks //std::string prefix = mesg.substr(0, 4); //if (prefix == "/me " || prefix == "/me'") - if (is_irc_me_prefix(mesg)) + if (FSCommon::is_irc_me_prefix(mesg)) // { ircstyle = true; @@ -4571,7 +4571,7 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data) if (gSavedSettings.getBOOL("FSExperimentalLostAttachmentsFixReport")) { - report_to_nearby_chat(message); + FSCommon::report_to_nearby_chat(message); } continue; @@ -4992,11 +4992,11 @@ void process_sim_stats(LLMessageSystem *msg, void **user_data) if (change_count > 0) { - report_to_nearby_chat(format_string(increase_message, args)); + FSCommon::report_to_nearby_chat(FSCommon::format_string(increase_message, args)); } else if (change_count < 0) { - report_to_nearby_chat(format_string(decrease_message, args)); + FSCommon::report_to_nearby_chat(FSCommon::format_string(decrease_message, args)); } } } @@ -6401,7 +6401,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) // make_ui_sound("UISndRestart"); - report_to_nearby_chat(LLTrans::getString("FSRegionRestartInLocalChat")); // FIRE-6307: Region restart notices in local chat + FSCommon::report_to_nearby_chat(LLTrans::getString("FSRegionRestartInLocalChat")); // FIRE-6307: Region restart notices in local chat fs_report_region_restart_to_channel(seconds); // Announce region restart to a defined chat channel } @@ -6663,7 +6663,7 @@ void process_alert_core(const std::string& message, bool modal) } make_ui_sound("UISndRestartOpenSim"); - report_to_nearby_chat(LLTrans::getString("FSRegionRestartInLocalChat")); // FIRE-6307: Region restart notices in local chat + FSCommon::report_to_nearby_chat(LLTrans::getString("FSRegionRestartInLocalChat")); // FIRE-6307: Region restart notices in local chat fs_report_region_restart_to_channel(seconds); // Announce region restart to a defined chat channel return; } @@ -6836,7 +6836,7 @@ void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **use action = LLTrans::getString("Collision_UnknownType", args); return; } - report_to_nearby_chat(action); + FSCommon::report_to_nearby_chat(action); } // Nearby Chat Collision Messages // Report Collision Messages to scripts diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index 766366fa3c..5c8e7355bb 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -910,7 +910,7 @@ void LLViewerParcelMedia::filterMediaUrl(LLParcel* parcel) { LLStringUtil::format_map_t format_args; format_args["[DOMAIN]"] = domain; - report_to_nearby_chat(LLTrans::getString("MediaFilterMediaContentBlocked", format_args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("MediaFilterMediaContentBlocked", format_args)); mMediaLastActionPlay = false; } else @@ -992,7 +992,7 @@ void callback_media_alert2(const LLSD ¬ification, const LLSD &response, LLPar inst->saveDomainFilterList(); LLStringUtil::format_map_t format_args; format_args["[DOMAIN]"] = domain; - report_to_nearby_chat(LLTrans::getString("MediaFilterMediaContentDomainAlwaysAllowed", format_args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("MediaFilterMediaContentDomainAlwaysAllowed", format_args)); inst->mCurrentMedia = *parcel; if (parcel->getName() == currentparcel->getName()) { @@ -1009,7 +1009,7 @@ void callback_media_alert2(const LLSD ¬ification, const LLSD &response, LLPar inst->saveDomainFilterList(); LLStringUtil::format_map_t format_args; format_args["[DOMAIN]"] = domain; - report_to_nearby_chat(LLTrans::getString("MediaFilterMediaContentDomainAlwaysBlocked", format_args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("MediaFilterMediaContentDomainAlwaysBlocked", format_args)); } else if ((option == 2) && allow) // Whitelist URL { @@ -1020,7 +1020,7 @@ void callback_media_alert2(const LLSD ¬ification, const LLSD &response, LLPar inst->saveDomainFilterList(); LLStringUtil::format_map_t format_args; format_args["[MEDIAURL]"] = media_url; - report_to_nearby_chat(LLTrans::getString("MediaFilterMediaContentUrlAlwaysAllowed", format_args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("MediaFilterMediaContentUrlAlwaysAllowed", format_args)); inst->mCurrentMedia = *parcel; if (parcel->getName() == currentparcel->getName()) { @@ -1037,7 +1037,7 @@ void callback_media_alert2(const LLSD ¬ification, const LLSD &response, LLPar inst->saveDomainFilterList(); LLStringUtil::format_map_t format_args; format_args["[MEDIAURL]"] = media_url; - report_to_nearby_chat(LLTrans::getString("MediaFilterMediaContentUrlAlwaysBlocked", format_args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("MediaFilterMediaContentUrlAlwaysBlocked", format_args)); } // We've dealt with the alert, so mark it as inactive. @@ -1110,7 +1110,7 @@ void callback_media_alert_single(const LLSD ¬ification, const LLSD &response, inst->saveDomainFilterList(); LLStringUtil::format_map_t format_args; format_args["[DOMAIN]"] = domain; - report_to_nearby_chat(LLTrans::getString("MediaFilterMediaContentDomainAlwaysBlocked", format_args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("MediaFilterMediaContentDomainAlwaysBlocked", format_args)); } else if (option == 3) // Whitelist domain { @@ -1121,7 +1121,7 @@ void callback_media_alert_single(const LLSD ¬ification, const LLSD &response, inst->saveDomainFilterList(); LLStringUtil::format_map_t format_args; format_args["[DOMAIN]"] = domain; - report_to_nearby_chat(LLTrans::getString("MediaFilterMediaContentDomainAlwaysAllowed", format_args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("MediaFilterMediaContentDomainAlwaysAllowed", format_args)); inst->mCurrentMedia = *parcel; if (parcel->getName() == currentparcel->getName()) { @@ -1316,7 +1316,7 @@ void LLViewerParcelMedia::filterAudioUrl(std::string media_url) { LLStringUtil::format_map_t format_args; format_args["[DOMAIN]"] = domain; - report_to_nearby_chat(LLTrans::getString("MediaFilterAudioContentBlocked", format_args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("MediaFilterAudioContentBlocked", format_args)); LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade(); mAudioLastActionPlay = false; } @@ -1401,7 +1401,7 @@ void callback_audio_alert2(const LLSD ¬ification, const LLSD &response, std:: inst->saveDomainFilterList(); LLStringUtil::format_map_t format_args; format_args["[DOMAIN]"] = domain; - report_to_nearby_chat(LLTrans::getString("MediaFilterAudioContentDomainAlwaysAllowed", format_args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("MediaFilterAudioContentDomainAlwaysAllowed", format_args)); if (gAudiop) { inst->mCurrentMusic = media_url; @@ -1418,7 +1418,7 @@ void callback_audio_alert2(const LLSD ¬ification, const LLSD &response, std:: inst->saveDomainFilterList(); LLStringUtil::format_map_t format_args; format_args["[DOMAIN]"] = domain; - report_to_nearby_chat(LLTrans::getString("MediaFilterAudioContentDomainAlwaysBlocked", format_args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("MediaFilterAudioContentDomainAlwaysBlocked", format_args)); if (gAudiop) { inst->mCurrentMusic = ""; @@ -1435,7 +1435,7 @@ void callback_audio_alert2(const LLSD ¬ification, const LLSD &response, std:: inst->saveDomainFilterList(); LLStringUtil::format_map_t format_args; format_args["[MEDIAURL]"] = media_url; - report_to_nearby_chat(LLTrans::getString("MediaFilterAudioContentUrlAlwaysAllowed", format_args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("MediaFilterAudioContentUrlAlwaysAllowed", format_args)); if (gAudiop) { inst->mCurrentMusic = media_url; @@ -1452,7 +1452,7 @@ void callback_audio_alert2(const LLSD ¬ification, const LLSD &response, std:: inst->saveDomainFilterList(); LLStringUtil::format_map_t format_args; format_args["[MEDIAURL]"] = media_url; - report_to_nearby_chat(LLTrans::getString("MediaFilterAudioContentUrlAlwaysBlocked", format_args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("MediaFilterAudioContentUrlAlwaysBlocked", format_args)); if (gAudiop) { inst->mCurrentMusic = ""; @@ -1534,7 +1534,7 @@ void callback_audio_alert_single(const LLSD ¬ification, const LLSD &response, inst->saveDomainFilterList(); LLStringUtil::format_map_t format_args; format_args["[DOMAIN]"] = domain; - report_to_nearby_chat(LLTrans::getString("MediaFilterAudioContentDomainAlwaysAllowed", format_args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("MediaFilterAudioContentDomainAlwaysAllowed", format_args)); if (gAudiop) { inst->mCurrentMusic = media_url; @@ -1551,7 +1551,7 @@ void callback_audio_alert_single(const LLSD ¬ification, const LLSD &response, inst->saveDomainFilterList(); LLStringUtil::format_map_t format_args; format_args["[DOMAIN]"] = domain; - report_to_nearby_chat(LLTrans::getString("MediaFilterAudioContentDomainAlwaysBlocked", format_args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("MediaFilterAudioContentDomainAlwaysBlocked", format_args)); if (gAudiop) { inst->mCurrentMusic = ""; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 6822cb6c2f..2819f52695 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -5946,7 +5946,7 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save { LLStringUtil::format_map_t args; args["FILENAME"] = filepath; - report_to_nearby_chat(LLTrans::getString("SnapshotSavedToDisk", args)); + FSCommon::report_to_nearby_chat(LLTrans::getString("SnapshotSavedToDisk", args)); } success_cb(); } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index bc4865f416..b2d6d6e141 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3990,7 +3990,7 @@ void LLVOAvatar::idleUpdateNameTagText(bool new_name) LLStringUtil::format_map_t label_args; label_args["COMPLEXITY"] = complexity_string; - addNameTagLine(format_string(complexity_label, label_args), complexity_color, LLFontGL::NORMAL, LLFontGL::getFontSansSerifSmall()); + addNameTagLine(FSCommon::format_string(complexity_label, label_args), complexity_color, LLFontGL::NORMAL, LLFontGL::getFontSansSerifSmall()); // only show texture area if this is the reason for jelly baby rendering static LLCachedControl max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit", 1000.0f); @@ -3999,7 +3999,7 @@ void LLVOAvatar::idleUpdateNameTagText(bool new_name) LLResMgr::getInstance()->getIntegerString(complexity_string, mAttachmentSurfaceArea); label_args["TEXTURE_AREA"] = complexity_string; - addNameTagLine(format_string(texture_area_label, label_args), LLColor4::red, LLFontGL::NORMAL, LLFontGL::getFontSansSerifSmall()); + addNameTagLine(FSCommon::format_string(texture_area_label, label_args), LLColor4::red, LLFontGL::NORMAL, LLFontGL::getFontSansSerifSmall()); } } // diff --git a/indra/newview/streamtitledisplay.cpp b/indra/newview/streamtitledisplay.cpp index fdd4bfa7ff..53341640bd 100644 --- a/indra/newview/streamtitledisplay.cpp +++ b/indra/newview/streamtitledisplay.cpp @@ -94,7 +94,7 @@ void StreamTitleDisplay::checkMetadata(const LLSD& metadata) if (ShowStreamMetadata > 1) { chat = LLTrans::getString("StreamtitleNowPlaying") + " " + chat; - report_to_nearby_chat(chat); + FSCommon::report_to_nearby_chat(chat); } else if (ShowStreamMetadata == 1 && (metadata.has("TITLE") || metadata.has("ARTIST"))) {