From c820bb2929a37fb222ce0d7368d699e81f5edc00 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sat, 31 Aug 2024 01:33:27 +0200 Subject: Minimal code needed to add RLVa with an on/off toggle --- indra/newview/rlvcommon.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 indra/newview/rlvcommon.h (limited to 'indra/newview/rlvcommon.h') diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h new file mode 100644 index 0000000000..288d48e373 --- /dev/null +++ b/indra/newview/rlvcommon.h @@ -0,0 +1,16 @@ +#pragma once + +// ============================================================================ +// RlvStrings +// + +class RlvStrings +{ +public: + static std::string getVersion(bool wants_legacy); + static std::string getVersionAbout(); + static std::string getVersionImplNum(); + static std::string getVersionNum(); +}; + +// ============================================================================ -- cgit v1.2.3 From 7402fe6412e98e4b295ee3e04874f379c752f7a0 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Mon, 2 Sep 2024 01:39:17 +0200 Subject: Add basic scaffolding to support reply commands and handle @versionXXX as an illustration --- indra/newview/rlvcommon.h | 49 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 12 deletions(-) (limited to 'indra/newview/rlvcommon.h') diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h index 288d48e373..79ac6e1704 100644 --- a/indra/newview/rlvcommon.h +++ b/indra/newview/rlvcommon.h @@ -1,16 +1,41 @@ #pragma once -// ============================================================================ -// RlvStrings -// - -class RlvStrings +namespace Rlv { -public: - static std::string getVersion(bool wants_legacy); - static std::string getVersionAbout(); - static std::string getVersionImplNum(); - static std::string getVersionNum(); -}; + // ============================================================================ + // RlvStrings + // + + class Strings + { + public: + static std::string getVersion(bool wants_legacy); + static std::string getVersionAbout(); + static std::string getVersionImplNum(); + static std::string getVersionNum(); + }; + + // ============================================================================ + // RlvUtil + // + + namespace Util + { + bool isValidReplyChannel(S32 nChannel, bool isLoopback = false); + bool sendChatReply(S32 nChannel, const std::string& strUTF8Text); + bool sendChatReply(const std::string& strChannel, const std::string& strUTF8Text); + }; + + inline bool Util::isValidReplyChannel(S32 nChannel, bool isLoopback) + { + return (nChannel > (!isLoopback ? 0 : -1)) && (CHAT_CHANNEL_DEBUG != nChannel); + } + + inline bool Util::sendChatReply(const std::string& strChannel, const std::string& strUTF8Text) + { + S32 nChannel; + return LLStringUtil::convertToS32(strChannel, nChannel) ? sendChatReply(nChannel, strUTF8Text) : false; + } -// ============================================================================ + // ============================================================================ +} -- cgit v1.2.3 From 4f7eb9b12e9c7eeb9f3ee0980bd4616df7d678b6 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Mon, 2 Sep 2024 01:57:34 +0200 Subject: Add the @getcommand command query reply command --- indra/newview/rlvcommon.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/rlvcommon.h') diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h index 79ac6e1704..bec3e23e11 100644 --- a/indra/newview/rlvcommon.h +++ b/indra/newview/rlvcommon.h @@ -1,5 +1,7 @@ #pragma once +#include "rlvdefines.h" + namespace Rlv { // ============================================================================ @@ -22,6 +24,7 @@ namespace Rlv namespace Util { bool isValidReplyChannel(S32 nChannel, bool isLoopback = false); + bool parseStringList(const std::string& strInput, std::vector& optionList, std::string_view strSeparator = Constants::OptionSeparator); bool sendChatReply(S32 nChannel, const std::string& strUTF8Text); bool sendChatReply(const std::string& strChannel, const std::string& strUTF8Text); }; -- cgit v1.2.3 From b89d7ef92ca955ef600729b54353eb235b79038c Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Mon, 16 Sep 2024 15:33:27 +0200 Subject: Add the RLVa menu --- indra/newview/rlvcommon.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/rlvcommon.h') diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h index bec3e23e11..d18abcf1ac 100644 --- a/indra/newview/rlvcommon.h +++ b/indra/newview/rlvcommon.h @@ -24,6 +24,7 @@ namespace Rlv namespace Util { bool isValidReplyChannel(S32 nChannel, bool isLoopback = false); + void menuToggleVisible(); bool parseStringList(const std::string& strInput, std::vector& optionList, std::string_view strSeparator = Constants::OptionSeparator); bool sendChatReply(S32 nChannel, const std::string& strUTF8Text); bool sendChatReply(const std::string& strChannel, const std::string& strUTF8Text); -- cgit v1.2.3 From 6f4d7c2d6d363aee60d2f3d1fe4ed4a251aaa11b Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Tue, 17 Sep 2024 19:12:55 +0200 Subject: Add proper file headers --- indra/newview/rlvcommon.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'indra/newview/rlvcommon.h') diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h index d18abcf1ac..6f1bbbbdc6 100644 --- a/indra/newview/rlvcommon.h +++ b/indra/newview/rlvcommon.h @@ -1,3 +1,30 @@ +/** + * @file rlvcommon.h + * @author Kitty Barnett + * @brief RLVa helper functions and constants used throughout the viewer + * + * $LicenseInfo:firstyear=2024&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2024, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + #pragma once #include "rlvdefines.h" -- cgit v1.2.3