summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorleviathan <leviathan@lindenlab.com>2024-06-27 00:18:42 -0700
committerAndrew Meadows <andrew.l.meadows@gmail.com>2024-10-03 09:03:28 -0700
commit9c986bef6704ac07112e18dc82b870acf1847e41 (patch)
treed24a8ce4b0c63dd2e0304340ec33464ee19dd845 /indra
parent2daf175650cdda7cc8f820b6cb17b1475496e7ac (diff)
put GameControl behind a feature flag
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/llscrolllistctrl.cpp10
-rw-r--r--indra/llwindow/llgamecontrol.cpp23
-rw-r--r--indra/llwindow/llgamecontrol.h3
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llagent.cpp2
-rw-r--r--indra/newview/llappviewer.cpp7
-rw-r--r--indra/newview/llfloaterjoystick.cpp17
-rw-r--r--indra/newview/llfloaterpreference.cpp51
-rw-r--r--indra/newview/llfloaterpreference.h4
-rw-r--r--indra/newview/llviewerjoystick.cpp27
-rw-r--r--indra/newview/llviewerjoystick.h16
-rw-r--r--indra/newview/llviewermenu.cpp50
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml23
-rw-r--r--indra/newview/tests/llviewerhelputil_test.cpp2
14 files changed, 195 insertions, 51 deletions
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 07c4b5681b..ddd1d81cb4 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -1713,6 +1713,16 @@ void LLScrollListCtrl::setEnabled(bool enabled)
mCanSelect = enabled;
setTabStop(enabled);
mScrollbar->setTabStop(!enabled && mScrollbar->getPageSize() < mScrollbar->getDocSize());
+
+ // when the table is disabled also disable its items
+ for (LLScrollListItem* item : mItemList)
+ {
+ item->setEnabled(enabled);
+ if (!enabled)
+ {
+ item->setSelected(false);
+ }
+ }
}
bool LLScrollListCtrl::handleScrollWheel(S32 x, S32 y, S32 clicks)
diff --git a/indra/llwindow/llgamecontrol.cpp b/indra/llwindow/llgamecontrol.cpp
index 23849aca66..0e3782a10e 100644
--- a/indra/llwindow/llgamecontrol.cpp
+++ b/indra/llwindow/llgamecontrol.cpp
@@ -443,6 +443,7 @@ namespace
U64 g_lastSend = 0;
U64 g_nextResendPeriod = FIRST_RESEND_PERIOD;
+ bool g_enabled = false;
bool g_sendToServer = false;
bool g_controlAgent = false;
bool g_translateAgentActions = false;
@@ -457,6 +458,7 @@ namespace
std::function<LLSD(const std::string&)> s_loadObject;
std::function<void(const std::string&, LLSD&)> s_saveObject;
+ std::string SETTING_ENABLE("EnableGameControl");
std::string SETTING_SENDTOSERVER("GameControlToServer");
std::string SETTING_CONTROLAGENT("GameControlToAgent");
std::string SETTING_TRANSLATEACTIONS("AgentToGameControl");
@@ -1490,6 +1492,21 @@ void onControllerAxis(const SDL_Event& event)
}
// static
+bool LLGameControl::isEnabled()
+{
+ return g_enabled;
+}
+
+void LLGameControl::setEnabled(bool enable)
+{
+ if (enable != g_enabled)
+ {
+ g_enabled = enable;
+ s_saveBoolean(SETTING_ENABLE, g_enabled);
+ }
+}
+
+// static
bool LLGameControl::isInitialized()
{
return g_gameControl != nullptr;
@@ -1593,7 +1610,7 @@ bool LLGameControl::computeFinalStateAndCheckForChanges()
// g_lastSend has "expired"
// either because g_nextResendPeriod has been zeroed
// or the last send really has expired.
- return g_sendToServer && (g_lastSend + g_nextResendPeriod < get_now_nsec());
+ return g_enabled && g_sendToServer && (g_lastSend + g_nextResendPeriod < get_now_nsec());
}
// static
@@ -1762,7 +1779,7 @@ LLGameControl::ActionNameType LLGameControl::getActionNameType(const std::string
// static
bool LLGameControl::willControlAvatar()
{
- return g_controlAgent && g_agentControlMode == CONTROL_MODE_AVATAR;
+ return g_enabled && g_controlAgent && g_agentControlMode == CONTROL_MODE_AVATAR;
}
// static
@@ -2040,6 +2057,7 @@ void LLGameControl::initByDefault()
void LLGameControl::loadFromSettings()
{
// In case of absence of the required setting the default value is assigned
+ g_enabled = s_loadBoolean(SETTING_ENABLE);
g_sendToServer = s_loadBoolean(SETTING_SENDTOSERVER);
g_controlAgent = s_loadBoolean(SETTING_CONTROLAGENT);
g_translateAgentActions = s_loadBoolean(SETTING_TRANSLATEACTIONS);
@@ -2068,6 +2086,7 @@ void LLGameControl::loadFromSettings()
// static
void LLGameControl::saveToSettings()
{
+ s_saveBoolean(SETTING_ENABLE, g_enabled);
s_saveBoolean(SETTING_SENDTOSERVER, g_sendToServer);
s_saveBoolean(SETTING_CONTROLAGENT, g_controlAgent);
s_saveBoolean(SETTING_TRANSLATEACTIONS, g_translateAgentActions);
diff --git a/indra/llwindow/llgamecontrol.h b/indra/llwindow/llgamecontrol.h
index d75aa3a018..9398fb7f66 100644
--- a/indra/llwindow/llgamecontrol.h
+++ b/indra/llwindow/llgamecontrol.h
@@ -255,6 +255,9 @@ public:
friend class LLGameControllerManager;
};
+ static bool isEnabled();
+ static void setEnabled(bool enabled);
+
static bool isInitialized();
static void init(const std::string& gamecontrollerdb_path,
std::function<bool(const std::string&)> loadBoolean,
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 2e520037b3..2057ddaa0d 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -2612,6 +2612,17 @@
<key>Value</key>
<integer>1</integer>
</map>
+ <key>GameControl</key>
+ <map>
+ <key>Comment</key>
+ <string>Enable GameControl feature</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>GameControlToServer</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 63c84b91cf..53929051da 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -5000,7 +5000,7 @@ static S32 g_deltaFrame { 0 };
void LLAgent::applyExternalActionFlags()
{
- if (! LLGameControl::willControlAvatar())
+ if (! LLGameControl::isEnabled() || ! LLGameControl::willControlAvatar())
{
return;
}
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index dcd2a2f98d..c99f7365ab 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -4811,6 +4811,7 @@ void LLAppViewer::idle()
send_agent_update(false);
+ // Some GameControl stuff needs to be executed even when the feature is not enabled
// Note: we process game_control before sending AgentUpdate
// because it may translate to control flags that control avatar motion.
LLGameControl::processEvents(gFocusMgr.getAppHasFocus());
@@ -4832,7 +4833,11 @@ void LLAppViewer::idle()
sendGameControlInput();
}
- gAgent.setExternalActionFlags(action_flags);
+ // This GameControl stuff should NOT be executed when it isn't enabled
+ if (LLGameControl::isEnabled())
+ {
+ gAgent.setExternalActionFlags(action_flags);
+ }
// When appropriate, update agent location to the simulator.
F32 agent_update_time = agent_update_timer.getElapsedTimeF32();
diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp
index 1f7f97aad5..4736e30036 100644
--- a/indra/newview/llfloaterjoystick.cpp
+++ b/indra/newview/llfloaterjoystick.cpp
@@ -44,6 +44,7 @@
#include "llwindow.h"
#include "llcheckboxctrl.h"
#include "llcombobox.h"
+#include "llgamecontrol.h"
#if LL_WINDOWS && !LL_MESA_HEADLESS
// Require DirectInput version 8
@@ -78,8 +79,12 @@ BOOL CALLBACK di8_list_devices_callback(LPCDIDEVICEINSTANCE device_instance_ptr,
// Capable of detecting devices like Oculus Rift
if (device_instance_ptr && pvRef)
{
+ // We always include the device if it is from 3DConnexion, otherwise
+ // if the GameControl feature is enabled then we perfer to route other devices to it.
std::string product_name = utf16str_to_utf8str(llutf16string(device_instance_ptr->tszProductName));
- if (LLViewerJoystick::is3DConnexionDevice(product_name))
+ bool include_device = LLViewerJoystick::is3DConnexionDevice(product_name) || !LLGameControl::isEnabled();
+
+ if (include_device)
{
S32 size = sizeof(GUID);
LLSD::Binary data; //just an std::vector
@@ -306,11 +311,13 @@ void LLFloaterJoystick::refreshListOfDevices()
#if LL_WINDOWS && !LL_MESA_HEADLESS
LL_WARNS() << "NDOF connected to device without using SL provided handle" << LL_ENDL;
#endif
- // This feature used to support various gamepad devices however
- // going forward we will restrict it to 3DConnexion devices (SpaceMouse, etc)
- // and will handle gamepads with the GameControl feature.
+ // We always include the device if it is from 3DConnexion, otherwise we only
+ // support the device in this context when GameControl feature is disabled.
std::string desc = LLViewerJoystick::getInstance()->getDescription();
- if (LLViewerJoystick::is3DConnexionDevice(desc))
+ bool include_device = LLViewerJoystick::is3DConnexionDevice(desc) ||
+ (!LLGameControl::isEnabled() && !desc.empty());
+
+ if (include_device)
{
LLSD value = LLSD::Integer(1); // value for selection
addDevice(desc, value);
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 2aa54eef57..3c4eab0282 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -3284,7 +3284,7 @@ bool LLPanelPreferenceGameControl::initCombobox(LLScrollListItem* item, LLScroll
}
combobox->setValue(value);
- combobox->setVisible(TRUE);
+ combobox->setVisible(true);
combobox->showList();
gSelectedGrid = grid;
@@ -3404,7 +3404,7 @@ void LLPanelPreferenceGameControl::onAxisOptionsSelect()
mNumericValueEditor->setMaxValue(LLGameControl::MAX_AXIS_OFFSET);
mNumericValueEditor->setValue(deviceOptions.getAxisOptions()[row_index].mOffset);
}
- mNumericValueEditor->setVisible(TRUE);
+ mNumericValueEditor->setVisible(true);
}
initCombobox(row, mAxisOptions);
@@ -3437,13 +3437,15 @@ void LLPanelPreferenceGameControl::onCommitNumericValue()
}
}
-BOOL LLPanelPreferenceGameControl::postBuild()
+bool LLPanelPreferenceGameControl::postBuild()
{
// Above the tab container
+ mCheckEnableGameControl = getChild<LLCheckBoxCtrl>("enable_game_control");
mCheckGameControlToServer = getChild<LLCheckBoxCtrl>("game_control_to_server");
mCheckGameControlToAgent = getChild<LLCheckBoxCtrl>("game_control_to_agent");
mCheckAgentToGameControl = getChild<LLCheckBoxCtrl>("agent_to_game_control");
+ mCheckEnableGameControl->setCommitCallback([this](LLUICtrl*, const LLSD&) { updateEnable(); });
mCheckGameControlToAgent->setCommitCallback([this](LLUICtrl*, const LLSD&) { updateActionTableState(); });
mCheckAgentToGameControl->setCommitCallback([this](LLUICtrl*, const LLSD&) { updateActionTableState(); });
@@ -3513,13 +3515,14 @@ BOOL LLPanelPreferenceGameControl::postBuild()
mAxisOptions->setRect(rect);
mAxisOptions->updateLayout();
- return TRUE;
+ return true;
}
// Update all UI control values from real objects
// This function is called before floater is shown
void LLPanelPreferenceGameControl::onOpen(const LLSD& key)
{
+ mCheckEnableGameControl->setValue(LLGameControl::isEnabled());
mCheckGameControlToServer->setValue(LLGameControl::getSendToServer());
mCheckGameControlToAgent->setValue(LLGameControl::getControlAgent());
mCheckAgentToGameControl->setValue(LLGameControl::getTranslateAgentActions());
@@ -3549,6 +3552,8 @@ void LLPanelPreferenceGameControl::onOpen(const LLSD& key)
mCheckShowAllDevices->setValue(false);
populateDeviceTitle();
+
+ updateEnable();
}
void LLPanelPreferenceGameControl::populateActionTableRows(const std::string& filename)
@@ -3855,10 +3860,10 @@ void LLPanelPreferenceGameControl::clearSelectionState()
gSelectedGrid = nullptr;
gSelectedItem = nullptr;
gSelectedCell = nullptr;
- mNumericValueEditor->setVisible(FALSE);
- mAnalogChannelSelector->setVisible(FALSE);
- mBinaryChannelSelector->setVisible(FALSE);
- mAxisSelector->setVisible(FALSE);
+ mNumericValueEditor->setVisible(false);
+ mAnalogChannelSelector->setVisible(false);
+ mBinaryChannelSelector->setVisible(false);
+ mAxisSelector->setVisible(false);
}
void LLPanelPreferenceGameControl::addActionTableSeparator()
@@ -3875,15 +3880,39 @@ void LLPanelPreferenceGameControl::addActionTableSeparator()
mActionTable->addRow(separator_params, EAddPosition::ADD_BOTTOM);
}
+void LLPanelPreferenceGameControl::updateEnable()
+{
+ bool enabled = mCheckEnableGameControl->get();
+ LLGameControl::setEnabled(enabled);
+
+ mCheckGameControlToServer->setEnabled(enabled);
+ mCheckGameControlToAgent->setEnabled(enabled);
+ mCheckAgentToGameControl->setEnabled(enabled);
+
+ mActionTable->setEnabled(enabled);
+ mAxisOptions->setEnabled(enabled);
+ mAxisMappings->setEnabled(enabled);
+ mButtonMappings->setEnabled(enabled);
+ mDeviceList->setEnabled(enabled);
+
+ if (!enabled)
+ {
+ //mActionTable->deselectAllItems();
+ mAnalogChannelSelector->setVisible(false);
+ mBinaryChannelSelector->setVisible(false);
+ clearSelectionState();
+ }
+}
+
void LLPanelPreferenceGameControl::updateActionTableState()
{
// Enable the table if at least one of the GameControl<-->Agent options is enabled
- bool enable_table = mCheckGameControlToAgent->get() || mCheckAgentToGameControl->get();
+ bool enable_table = LLGameControl::isEnabled() && (mCheckGameControlToAgent->get() || mCheckAgentToGameControl->get());
mActionTable->deselectAllItems();
mActionTable->setEnabled(enable_table);
- mAnalogChannelSelector->setVisible(FALSE);
- mBinaryChannelSelector->setVisible(FALSE);
+ mAnalogChannelSelector->setVisible(false);
+ mBinaryChannelSelector->setVisible(false);
}
void LLPanelPreferenceGameControl::onResetToDefaults()
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index 810bb7d6ac..1a498c035e 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -172,7 +172,7 @@ public:
void setPersonalInfo(const std::string& visibility);
void refreshEnabledState();
void onCommitWindowedMode();
- void refresh(); // Refresh enable/disable
+ void refresh() override; // Refresh enable/disable
// if the quality radio buttons are changed
void onChangeQuality(const LLSD& data);
@@ -426,6 +426,7 @@ private:
bool initCombobox(LLScrollListItem* item, LLScrollListCtrl* grid);
void clearSelectionState();
void addActionTableSeparator();
+ void updateEnable();
void updateActionTableState();
void onResetToDefaults();
void resetChannelMappingsToDefaults();
@@ -434,6 +435,7 @@ private:
void resetButtonMappingsToDefaults();
// Above the tab container
+ LLCheckBoxCtrl *mCheckEnableGameControl;
LLCheckBoxCtrl *mCheckGameControlToServer; // send game_control data to server
LLCheckBoxCtrl *mCheckGameControlToAgent; // use game_control data to move avatar
LLCheckBoxCtrl *mCheckAgentToGameControl; // translate external avatar actions to game_control data
diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp
index 42238da418..416f6a476a 100644
--- a/indra/newview/llviewerjoystick.cpp
+++ b/indra/newview/llviewerjoystick.cpp
@@ -41,6 +41,7 @@
#include "llagent.h"
#include "llagentcamera.h"
#include "llfocusmgr.h"
+#include "llgamecontrol.h"
#if LL_WINDOWS && !LL_MESA_HEADLESS
// Require DirectInput version 8
@@ -148,12 +149,18 @@ BOOL CALLBACK di8_devices_callback(LPCDIDEVICEINSTANCE device_instance_ptr, LPVO
LLSD guid = LLViewerJoystick::getInstance()->getDeviceUUID();
- bool init_device = LLViewerJoystick::is3DConnexionDevice(product_name);
- if (init_device && guid.isBinary())
+ bool init_device = false;
+ if (guid.isBinary())
{
std::vector<U8> bin_bucket = guid.asBinary();
init_device = memcmp(&bin_bucket[0], &device_instance_ptr->guidInstance, sizeof(GUID)) == 0;
}
+ else
+ {
+ // It might be better to init space navigator here, but if system doesn't has one,
+ // ndof will pick a random device, it is simpler to pick first device now to have an id
+ init_device = true;
+ }
if (init_device)
{
@@ -283,6 +290,7 @@ NDOF_HotPlugResult LLViewerJoystick::HotPlugAddCallback(NDOF_Device *dev)
ndof_dump(stderr, dev);
joystick->mNdofDev = dev;
joystick->mDriverState = JDS_INITIALIZED;
+ joystick->mDeviceIs3DConnexion = is3DConnexionDevice(joystick->mNdofDev->product);
res = NDOF_KEEP_HOTPLUGGED;
}
joystick->updateEnabled(true);
@@ -308,18 +316,11 @@ void LLViewerJoystick::HotPlugRemovalCallback(NDOF_Device *dev)
// -----------------------------------------------------------------------------
LLViewerJoystick::LLViewerJoystick()
-: mDriverState(JDS_UNINITIALIZED),
- mNdofDev(NULL),
- mResetFlag(false),
- mCameraUpdated(true),
- mOverrideCamera(false),
- mJoystickRun(0)
{
for (int i = 0; i < 6; i++)
{
mAxes[i] = sDelta[i] = sLastDelta[i] = 0.0f;
}
-
memset(mBtn, 0, sizeof(mBtn));
// factor in bandwidth? bandwidth = gViewerStats->mKBitStat
@@ -398,6 +399,7 @@ void LLViewerJoystick::init(bool autoenable)
else
{
mDriverState = JDS_INITIALIZED;
+ mDeviceIs3DConnexion = is3DConnexionDevice(mNdofDev->product);
}
}
#endif
@@ -494,6 +496,7 @@ void LLViewerJoystick::initDevice(LLSD &guid)
else
{
mDriverState = JDS_INITIALIZED;
+ mDeviceIs3DConnexion = is3DConnexionDevice(mNdofDev->product);
}
}
#endif
@@ -578,6 +581,7 @@ bool LLViewerJoystick::initDevice(void * preffered_device /* LPDIRECTINPUTDEVICE
else
{
mDriverState = JDS_INITIALIZED;
+ mDeviceIs3DConnexion = is3DConnexionDevice(mNdofDev->product);
return true;
}
#endif
@@ -593,6 +597,7 @@ void LLViewerJoystick::terminate()
ndof_libcleanup(); // frees alocated memory in mNdofDev
mDriverState = JDS_UNINITIALIZED;
mNdofDev = NULL;
+ mDeviceIs3DConnexion = false;
LL_INFOS("Joystick") << "Terminated connection with NDOF device." << LL_ENDL;
}
#endif
@@ -1344,7 +1349,9 @@ bool LLViewerJoystick::toggleFlycam()
void LLViewerJoystick::scanJoystick()
{
- if (mDriverState != JDS_INITIALIZED || !gSavedSettings.getBOOL("JoystickEnabled"))
+ if (mDriverState != JDS_INITIALIZED
+ || !gSavedSettings.getBOOL("JoystickEnabled")
+ || (!mDeviceIs3DConnexion && LLGameControl::isEnabled()))
{
return;
}
diff --git a/indra/newview/llviewerjoystick.h b/indra/newview/llviewerjoystick.h
index b4fe3877f4..aaf9abb437 100644
--- a/indra/newview/llviewerjoystick.h
+++ b/indra/newview/llviewerjoystick.h
@@ -102,19 +102,21 @@ protected:
private:
F32 mAxes[6];
long mBtn[16];
- EJoystickDriverState mDriverState;
- NDOF_Device *mNdofDev;
- bool mResetFlag;
- F32 mPerfScale;
- bool mCameraUpdated;
- bool mOverrideCamera;
- U32 mJoystickRun;
+ EJoystickDriverState mDriverState { JDS_UNINITIALIZED };
+ NDOF_Device *mNdofDev { nullptr };
// Windows: _GUID as U8 binary map
// MacOS: long as an U8 binary map
// Else: integer 1 for no device/ndof's default device
LLSD mLastDeviceUUID;
+ F32 mPerfScale;
+ U32 mJoystickRun { 0 };
+ bool mResetFlag { false };
+ bool mCameraUpdated { true };
+ bool mOverrideCamera { false };
+ bool mDeviceIs3DConnexion { false };
+
static F32 sLastDelta[7];
static F32 sDelta[7];
};
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 2d94b4da9f..a6614542b8 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -52,6 +52,7 @@
#include "llagentui.h"
#include "llagentwearables.h"
#include "llagentpilot.h"
+#include "llavataractions.h"
#include "llcompilequeue.h"
#include "llconsole.h"
#include "lldebugview.h"
@@ -79,9 +80,9 @@
#include "llfloaterworldmap.h"
#include "llfloaterbuildoptions.h"
#include "fsyspath.h"
-#include "llavataractions.h"
-#include "lllandmarkactions.h"
+#include "llgamecontrol.h"
#include "llgroupmgr.h"
+#include "lllandmarkactions.h"
#include "lltooltip.h"
#include "lltoolface.h"
#include "llhints.h"
@@ -943,17 +944,45 @@ class LLAdvancedToggleFeature : public view_listener_t
class LLAdvancedCheckFeature : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
-{
- U32 feature = feature_from_string( userdata.asString() );
- bool new_value = false;
+ {
+ U32 feature = feature_from_string( userdata.asString() );
+ bool new_value = false;
+
+ if ( feature != 0 )
+ {
+ new_value = LLPipeline::toggleRenderDebugFeatureControl( feature );
+ }
+
+ return new_value;
+ }
+};
- if ( feature != 0 )
+class LLAdvancedToggleExperiment : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
{
- new_value = LLPipeline::toggleRenderDebugFeatureControl( feature );
+ std::string feature = userdata.asString();
+ if (feature == "GameControl")
+ {
+ LLGameControl::setEnabled(! LLGameControl::isEnabled());
+ return true;
+ }
+ return false;
}
+};
- return new_value;
-}
+class LLAdvancedCheckExperiment : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ bool value = false;
+ std::string feature = userdata.asString();
+ if (feature == "GameControl")
+ {
+ value = LLGameControl::isEnabled();
+ }
+ return value;
+ }
};
class LLAdvancedCheckDisplayTextureDensity : public view_listener_t
@@ -9729,6 +9758,9 @@ void initialize_menus()
view_listener_t::addMenu(new LLAdvancedToggleFeature(), "Advanced.ToggleFeature");
view_listener_t::addMenu(new LLAdvancedCheckFeature(), "Advanced.CheckFeature");
+ view_listener_t::addMenu(new LLAdvancedToggleExperiment(), "Advanced.ToggleExperiment");
+ view_listener_t::addMenu(new LLAdvancedCheckExperiment(), "Advanced.CheckExperiment");
+
view_listener_t::addMenu(new LLAdvancedCheckDisplayTextureDensity(), "Advanced.CheckDisplayTextureDensity");
view_listener_t::addMenu(new LLAdvancedSetDisplayTextureDensity(), "Advanced.SetDisplayTextureDensity");
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index ec2dffb5e5..f6946f5304 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -19,7 +19,7 @@
label="Inventory..."
name="Inventory"
shortcut="control|I"
- visible="true">
+ visible="true">
<menu_item_check.on_check
function="Floater.Visible"
parameter="inventory" />
@@ -734,8 +734,7 @@
function="Floater.Show"
parameter="snapshot" />
</menu_item_call>
-
-<menu_item_call
+ <menu_item_call
label="360 snapshot"
name="Capture 360"
shortcut="control|alt|shift|s">
@@ -2344,7 +2343,7 @@ function="World.EnvPreset"
function="Advanced.ToggleFeature"
parameter="flexible" />
</menu_item_check>
- </menu>
+ </menu>
<menu_item_check
label="Use Plugin Read Thread"
name="Use Plugin Read Thread">
@@ -2465,6 +2464,22 @@ function="World.EnvPreset"
<menu_item_separator/>
+ <menu
+ create_jump_keys="true"
+ label="Experimental Features"
+ name="Experimental Features"
+ tear_off="true">
+ <menu_item_check
+ label="GameControl"
+ name="ToggleGameControl">
+ <menu_item_check.on_check
+ function="Advanced.CheckExperiment"
+ parameter="GameControl" />
+ <menu_item_check.on_click
+ function="Advanced.ToggleExperiment"
+ parameter="GameControl" />
+ </menu_item_check>
+ </menu>
<menu_item_call
label="Show Debug Settings"
name="Debug Settings">
diff --git a/indra/newview/tests/llviewerhelputil_test.cpp b/indra/newview/tests/llviewerhelputil_test.cpp
index 9ee6625bf1..9a7a5be09f 100644
--- a/indra/newview/tests/llviewerhelputil_test.cpp
+++ b/indra/newview/tests/llviewerhelputil_test.cpp
@@ -79,6 +79,8 @@ bool LLAgent::isGodlike() const { return false; }
LLAgent gAgent;
+LLFlycam::LLFlycam() { }
+
std::string LLWeb::expandURLSubstitutions(const std::string &url,
const LLSD &default_subs)
{