summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml2
-rw-r--r--indra/newview/llfloaterpreference.cpp53
-rw-r--r--indra/newview/llfloaterpreference.h12
-rw-r--r--indra/newview/llviewermenu.cpp2
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml32
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_controls.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_game_control.xml18
7 files changed, 80 insertions, 41 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 2057ddaa0d..36abebc942 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -2612,7 +2612,7 @@
<key>Value</key>
<integer>1</integer>
</map>
- <key>GameControl</key>
+ <key>EnableGameControl</key>
<map>
<key>Comment</key>
<string>Enable GameControl feature</string>
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 3c4eab0282..7ea9f9b4c2 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -402,6 +402,7 @@ void LLFloaterPreference::saveAvatarProperties( void )
}
}
+// static
void LLFloaterPreference::saveAvatarPropertiesCoro(const std::string cap_url, bool allow_publish)
{
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
@@ -439,6 +440,7 @@ bool LLFloaterPreference::postBuild()
mDisabledPopups = getChild<LLScrollListCtrl>("disabled_popups");
mEnablePopupBtn = getChild<LLButton>("enable_this_popup");
mDisablePopupBtn = getChild<LLButton>("disable_this_popup");
+ setPanelVisibility("game_control", LLGameControl::isEnabled());
gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&LLFloaterIMSessionTab::processChatHistoryStyleUpdate, false));
@@ -1048,6 +1050,15 @@ void LLFloaterPreference::onBtnCancel(const LLSD& userdata)
}
}
+//static
+void LLFloaterPreference::refreshInstance()
+{
+ if (LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences"))
+ {
+ instance->refresh();
+ }
+}
+
// static
void LLFloaterPreference::updateUserInfo(const std::string& visibility)
{
@@ -1057,6 +1068,7 @@ void LLFloaterPreference::updateUserInfo(const std::string& visibility)
}
}
+// static
void LLFloaterPreference::refreshEnabledGraphics()
{
if (LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences"))
@@ -1292,6 +1304,16 @@ void LLAvatarComplexityControls::setIndirectMaxArc()
void LLFloaterPreference::refresh()
{
+ setPanelVisibility("game_control", LLGameControl::isEnabled());
+ LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core");
+ for (LLView* view : *tabcontainer->getChildList())
+ {
+ if (LLPanelPreferenceControls* panel = dynamic_cast<LLPanelPreferenceControls*>(view))
+ {
+ panel->refresh();
+ break;
+ }
+ }
LLFloater::refresh();
setMaxNonImpostorsText(
gSavedSettings.getU32("RenderAvatarMaxNonImpostors"),
@@ -1945,6 +1967,16 @@ void LLFloaterPreference::selectPanel(const LLSD& name)
}
}
+void LLFloaterPreference::setPanelVisibility(const LLSD& name, bool visible)
+{
+ LLTabContainer * tab_containerp = getChild<LLTabContainer>("pref core");
+ LLPanel * panel = tab_containerp->getPanelByName(name.asStringRef());
+ if (NULL != panel)
+ {
+ tab_containerp->setTabVisibility(panel, visible);
+ }
+}
+
void LLFloaterPreference::selectPrivacyPanel()
{
selectPanel("im");
@@ -2532,6 +2564,12 @@ LLPanelPreferenceControls::~LLPanelPreferenceControls()
{
}
+void LLPanelPreferenceControls::refresh()
+{
+ populateControlTable();
+ LLPanelPreference::refresh();
+}
+
bool LLPanelPreferenceControls::postBuild()
{
// populate list of controls
@@ -2710,7 +2748,10 @@ void LLPanelPreferenceControls::populateControlTable()
addControlTableSeparator();
addControlTableRows("control_table_contents_media.xml");
addControlTableSeparator();
- addControlTableRows("control_table_contents_game_control.xml");
+ if (LLGameControl::isEnabled())
+ {
+ addControlTableRows("control_table_contents_game_control.xml");
+ }
}
// MODE_THIRD_PERSON; MODE_EDIT_AVATAR; MODE_SITTING
else if (mEditingMode < LLKeyConflictHandler::MODE_SAVED_SETTINGS)
@@ -2729,7 +2770,10 @@ void LLPanelPreferenceControls::populateControlTable()
addControlTableRows("control_table_contents_media.xml");
addControlTableSeparator();
- addControlTableRows("control_table_contents_game_control.xml");
+ if (LLGameControl::isEnabled())
+ {
+ addControlTableRows("control_table_contents_game_control.xml");
+ }
}
else
{
@@ -3440,12 +3484,10 @@ void LLPanelPreferenceGameControl::onCommitNumericValue()
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(); });
@@ -3522,7 +3564,6 @@ bool LLPanelPreferenceGameControl::postBuild()
// 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());
@@ -3882,7 +3923,7 @@ void LLPanelPreferenceGameControl::addActionTableSeparator()
void LLPanelPreferenceGameControl::updateEnable()
{
- bool enabled = mCheckEnableGameControl->get();
+ bool enabled = LLGameControl::isEnabled();
LLGameControl::setEnabled(enabled);
mCheckGameControlToServer->setEnabled(enabled);
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index 1a498c035e..b3872958ac 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -92,6 +92,8 @@ public:
virtual void changed() override;
virtual void changed(const LLUUID& session_id, U32 mask) override {};
+ static void refreshInstance();
+
// static data update, called from message handler
static void updateUserInfo(const std::string& visibility);
@@ -201,6 +203,7 @@ public:
void buildPopupLists();
static void refreshSkin(void* data);
void selectPanel(const LLSD& name);
+ void setPanelVisibility(const LLSD& name, bool visible);
void saveGraphicsPreset(std::string& preset);
void setRecommendedSettings();
@@ -327,6 +330,8 @@ public:
bool postBuild() override;
+ void refresh() override;
+
void apply() override;
void cancel(const std::vector<std::string> settings_to_skip = {}) override;
void saveSettings() override;
@@ -349,6 +354,9 @@ public:
void onDefaultKeyBind(bool all_modes) override;
void onCancelKeyBind() override;
+ // Cleans content and then adds content from xml files according to current mEditingMode
+ void populateControlTable();
+
private:
// reloads settings, discards current changes, updates table
void regenerateControls();
@@ -358,9 +366,6 @@ private:
bool addControlTableRows(const std::string &filename);
void addControlTableSeparator();
- // Cleans content and then adds content from xml files according to current mEditingMode
- void populateControlTable();
-
// Updates keybindings from storage to table
void updateTable();
@@ -435,7 +440,6 @@ 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/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index a6614542b8..39aa85beea 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -72,6 +72,7 @@
#include "llfloaterpathfindingcharacters.h"
#include "llfloaterpathfindinglinksets.h"
#include "llfloaterpay.h"
+#include "llfloaterpreference.h"
#include "llfloaterreporter.h"
#include "llfloatersearch.h"
#include "llfloaterscriptdebug.h"
@@ -965,6 +966,7 @@ class LLAdvancedToggleExperiment : public view_listener_t
if (feature == "GameControl")
{
LLGameControl::setEnabled(! LLGameControl::isEnabled());
+ LLFloaterPreference::refreshInstance();
return true;
}
return false;
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index f6946f5304..da9cc0c98d 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -2464,22 +2464,6 @@ 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">
@@ -2507,6 +2491,22 @@ function="World.EnvPreset"
visible="false">
<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
+ create_jump_keys="true"
label="Consoles"
name="Consoles"
tear_off="true">
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_controls.xml b/indra/newview/skins/default/xui/en/panel_preferences_controls.xml
index f8801f9c89..b02270dd9e 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_controls.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_controls.xml
@@ -6,7 +6,7 @@
label="Controls"
layout="topleft"
left="102"
- name="controls"
+ name="controls_panel"
top="1"
width="517">
<combo_box
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_game_control.xml b/indra/newview/skins/default/xui/en/panel_preferences_game_control.xml
index 8c9e15a180..bd92fe895d 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_game_control.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_game_control.xml
@@ -6,25 +6,17 @@
label="Game Controls"
layout="topleft"
left="102"
- name="gamecontrol"
+ name="game_control_panel"
top="1"
width="517">
<check_box
- name="enable_game_control"
- control_name="EnableGameControl"
- label="Enable GameControl"
- layout="topleft"
- height="15"
- left="10"
- top="10"/>
- <check_box
name="game_control_to_server"
control_name="GameControlToServer"
label="Send GameControl Data to server"
layout="topleft"
height="15"
left="10"
- top="30"/>
+ top="10"/>
<check_box
name="game_control_to_agent"
control_name="GameControlToAgent"
@@ -32,7 +24,7 @@
layout="topleft"
height="15"
left="10"
- top="50"/>
+ top="30"/>
<check_box
name="agent_to_game_control"
control_name="AgentToGameControl"
@@ -40,12 +32,12 @@
layout="topleft"
height="15"
left="10"
- top="70"/>
+ top="50"/>
<tab_container
name="game_control_tabs"
layout="topleft"
follows="all"
- top="90"
+ top="70"
left="2"
right="-2"
bottom="-32">