summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloaterbuildoptions.cpp49
-rw-r--r--indra/newview/llfloaterbuildoptions.h7
-rw-r--r--indra/newview/llfloatertools.cpp39
-rw-r--r--indra/newview/llfloatertools.h2
-rw-r--r--indra/newview/llviewermenu.cpp6
-rw-r--r--indra/newview/llviewerwindow.cpp6
-rw-r--r--indra/newview/skins/default/xui/en/floater_build_options.xml61
-rw-r--r--indra/newview/skins/default/xui/en/floater_tools.xml62
8 files changed, 99 insertions, 133 deletions
diff --git a/indra/newview/llfloaterbuildoptions.cpp b/indra/newview/llfloaterbuildoptions.cpp
index 86c1bf0534..1b65d8d683 100644
--- a/indra/newview/llfloaterbuildoptions.cpp
+++ b/indra/newview/llfloaterbuildoptions.cpp
@@ -41,13 +41,9 @@
// Methods
//
-void commit_grid_mode(LLUICtrl *);
-
LLFloaterBuildOptions::LLFloaterBuildOptions(const LLSD& key)
- : LLFloater(key),
- mComboGridMode(NULL)
+ : LLFloater(key)
{
- mCommitCallbackRegistrar.add("GridOptions.gridMode", boost::bind(&commit_grid_mode,_1));
}
LLFloaterBuildOptions::~LLFloaterBuildOptions()
@@ -55,45 +51,9 @@ LLFloaterBuildOptions::~LLFloaterBuildOptions()
BOOL LLFloaterBuildOptions::postBuild()
{
- mComboGridMode = getChild<LLComboBox>("combobox grid mode");
-
return TRUE;
}
-void LLFloaterBuildOptions::setGridMode(EGridMode mode)
-{
- mComboGridMode->setCurrentByIndex((S32)mode);
-}
-
-void LLFloaterBuildOptions::updateGridMode()
-{
- if (mComboGridMode)
- {
- S32 index = mComboGridMode->getCurrentIndex();
- mComboGridMode->removeall();
-
- switch (mObjectSelection->getSelectType())
- {
- case SELECT_TYPE_HUD:
- mComboGridMode->add(getString("grid_screen_text"));
- mComboGridMode->add(getString("grid_local_text"));
- break;
- case SELECT_TYPE_WORLD:
- mComboGridMode->add(getString("grid_world_text"));
- mComboGridMode->add(getString("grid_local_text"));
- mComboGridMode->add(getString("grid_reference_text"));
- break;
- case SELECT_TYPE_ATTACHMENT:
- mComboGridMode->add(getString("grid_attachment_text"));
- mComboGridMode->add(getString("grid_local_text"));
- mComboGridMode->add(getString("grid_reference_text"));
- break;
- }
-
- mComboGridMode->setCurrentByIndex(index);
- }
-}
-
// virtual
void LLFloaterBuildOptions::onOpen(const LLSD& key)
{
@@ -105,10 +65,3 @@ void LLFloaterBuildOptions::onClose(bool app_quitting)
{
mObjectSelection = NULL;
}
-
-void commit_grid_mode(LLUICtrl *ctrl)
-{
- LLComboBox* combo = (LLComboBox*)ctrl;
-
- LLSelectMgr::getInstance()->setGridMode((EGridMode)combo->getCurrentIndex());
-}
diff --git a/indra/newview/llfloaterbuildoptions.h b/indra/newview/llfloaterbuildoptions.h
index 7f3811bf1c..02c56cb6a9 100644
--- a/indra/newview/llfloaterbuildoptions.h
+++ b/indra/newview/llfloaterbuildoptions.h
@@ -35,7 +35,6 @@
#include "llfloater.h"
#include "llselectmgr.h"
-class LLComboBox;
class LLObjectSelection;
typedef LLSafeHandle<LLObjectSelection> LLObjectSelectionHandle;
@@ -44,23 +43,17 @@ class LLFloaterBuildOptions
: public LLFloater
{
public:
-
virtual BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
/*virtual*/ void onClose(bool app_quitting);
- void setGridMode(EGridMode mode);
- void updateGridMode();
-
private:
-
friend class LLFloaterReg;
LLFloaterBuildOptions(const LLSD& key);
~LLFloaterBuildOptions();
- LLComboBox* mComboGridMode;
LLObjectSelectionHandle mObjectSelection;
};
#endif
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 0d37d0857e..5c8f5a5cc1 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -36,6 +36,7 @@
#include "llagentcamera.h"
#include "llbutton.h"
#include "llcheckboxctrl.h"
+#include "llcombobox.h"
#include "lldraghandle.h"
#include "llerror.h"
#include "llfloaterbuildoptions.h"
@@ -103,6 +104,7 @@ const std::string PANEL_NAMES[LLFloaterTools::PANEL_COUNT] =
// Local prototypes
+void commit_grid_mode(LLUICtrl *ctrl);
void commit_select_component(void *data);
void click_show_more(void*);
void click_popup_info(void*);
@@ -252,6 +254,7 @@ BOOL LLFloaterTools::postBuild()
getChild<LLUICtrl>("checkbox uniform")->setValue((BOOL)gSavedSettings.getBOOL("ScaleUniform"));
mCheckStretchTexture = getChild<LLCheckBoxCtrl>("checkbox stretch textures");
getChild<LLUICtrl>("checkbox stretch textures")->setValue((BOOL)gSavedSettings.getBOOL("ScaleStretchTextures"));
+ mComboGridMode = getChild<LLComboBox>("combobox grid mode");
mCheckStretchUniformLabel = getChild<LLTextBox>("checkbox uniform label");
//
@@ -330,6 +333,7 @@ LLFloaterTools::LLFloaterTools(const LLSD& key)
mCheckSnapToGrid(NULL),
mBtnGridOptions(NULL),
mTitleMedia(NULL),
+ mComboGridMode(NULL),
mCheckStretchUniform(NULL),
mCheckStretchTexture(NULL),
mCheckStretchUniformLabel(NULL),
@@ -386,6 +390,7 @@ LLFloaterTools::LLFloaterTools(const LLSD& key)
mCommitCallbackRegistrar.add("BuildTool.commitRadioMove", boost::bind(&commit_radio_group_move,_1));
mCommitCallbackRegistrar.add("BuildTool.commitRadioEdit", boost::bind(&commit_radio_group_edit,_1));
+ mCommitCallbackRegistrar.add("BuildTool.gridMode", boost::bind(&commit_grid_mode,_1));
mCommitCallbackRegistrar.add("BuildTool.selectComponent", boost::bind(&commit_select_component, this));
mCommitCallbackRegistrar.add("BuildTool.gridOptions", boost::bind(&LLFloaterTools::onClickGridOptions,this));
mCommitCallbackRegistrar.add("BuildTool.applyToSelection", boost::bind(&click_apply_to_selection, this));
@@ -687,6 +692,33 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
mRadioGroupEdit->setValue("radio select face");
}
+ if (mComboGridMode)
+ {
+ mComboGridMode->setVisible( edit_visible );
+ S32 index = mComboGridMode->getCurrentIndex();
+ mComboGridMode->removeall();
+
+ switch (mObjectSelection->getSelectType())
+ {
+ case SELECT_TYPE_HUD:
+ mComboGridMode->add(getString("grid_screen_text"));
+ mComboGridMode->add(getString("grid_local_text"));
+ break;
+ case SELECT_TYPE_WORLD:
+ mComboGridMode->add(getString("grid_world_text"));
+ mComboGridMode->add(getString("grid_local_text"));
+ mComboGridMode->add(getString("grid_reference_text"));
+ break;
+ case SELECT_TYPE_ATTACHMENT:
+ mComboGridMode->add(getString("grid_attachment_text"));
+ mComboGridMode->add(getString("grid_local_text"));
+ mComboGridMode->add(getString("grid_reference_text"));
+ break;
+ }
+
+ mComboGridMode->setCurrentByIndex(index);
+ }
+
// Snap to grid disabled for grab tool - very confusing
if (mCheckSnapToGrid) mCheckSnapToGrid->setVisible( edit_visible /* || tool == LLToolGrab::getInstance() */ );
if (mBtnGridOptions) mBtnGridOptions->setVisible( edit_visible /* || tool == LLToolGrab::getInstance() */ );
@@ -1037,6 +1069,13 @@ void LLFloaterTools::setObjectType( LLPCode pcode )
gFocusMgr.setMouseCapture(NULL);
}
+void commit_grid_mode(LLUICtrl *ctrl)
+{
+ LLComboBox* combo = (LLComboBox*)ctrl;
+
+ LLSelectMgr::getInstance()->setGridMode((EGridMode)combo->getCurrentIndex());
+}
+
void LLFloaterTools::onClickGridOptions()
{
diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h
index 63ed9dc82b..7a19d093a4 100644
--- a/indra/newview/llfloatertools.h
+++ b/indra/newview/llfloatertools.h
@@ -33,6 +33,7 @@
class LLButton;
class LLCheckBoxCtrl;
+class LLComboBox;
class LLPanelPermissions;
class LLPanelObject;
class LLPanelVolume;
@@ -140,6 +141,7 @@ public:
LLCheckBoxCtrl* mCheckSnapToGrid;
LLButton* mBtnGridOptions;
+ LLComboBox* mComboGridMode;
LLCheckBoxCtrl* mCheckStretchUniform;
LLCheckBoxCtrl* mCheckStretchTexture;
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 0104d35e53..4a71e6fc8e 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -7254,12 +7254,6 @@ class LLToolsUseSelectionForGrid : public view_listener_t
} func;
LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func);
LLSelectMgr::getInstance()->setGridMode(GRID_MODE_REF_OBJECT);
-
- LLFloaterBuildOptions* build_options_floater = LLFloaterReg::getTypedInstance<LLFloaterBuildOptions>("build_options");
- if (build_options_floater && build_options_floater->getVisible())
- {
- build_options_floater->setGridMode(GRID_MODE_REF_OBJECT);
- }
return true;
}
};
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 4499955dec..5730a55a9b 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -3170,12 +3170,6 @@ void LLViewerWindow::updateLayout()
//gMenuBarView->setItemVisible("BuildTools", gFloaterTools->getVisible());
}
- LLFloaterBuildOptions* build_options_floater = LLFloaterReg::findTypedInstance<LLFloaterBuildOptions>("build_options");
- if (build_options_floater && build_options_floater->getVisible())
- {
- build_options_floater->updateGridMode();
- }
-
// Always update console
if(gConsole)
{
diff --git a/indra/newview/skins/default/xui/en/floater_build_options.xml b/indra/newview/skins/default/xui/en/floater_build_options.xml
index 35918e9705..38428b36fc 100644
--- a/indra/newview/skins/default/xui/en/floater_build_options.xml
+++ b/indra/newview/skins/default/xui/en/floater_build_options.xml
@@ -1,70 +1,13 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater
legacy_header_height="18"
- height="198"
+ height="170"
layout="topleft"
name="build options floater"
help_topic="build_options_floater"
save_rect="true"
title="GRID OPTIONS"
width="264">
- <floater.string
- name="grid_screen_text">
- Screen
- </floater.string>
- <floater.string
- name="grid_local_text">
- Local
- </floater.string>
- <floater.string
- name="grid_world_text">
- World
- </floater.string>
- <floater.string
- name="grid_reference_text">
- Reference
- </floater.string>
- <floater.string
- name="grid_attachment_text">
- Attachment
- </floater.string>
- <text
- type="string"
- length="1"
- follows="left|top"
- height="16"
- layout="topleft"
- left="10"
- tool_tip="Grid opacity"
- name="grid_mode_label"
- top_pad="30"
- width="123">
- Mode
- </text>
- <combo_box
- height="23"
- layout="topleft"
- left_pad="9"
- follows="left|top"
- name="combobox grid mode"
- tool_tip="Choose the type of grid ruler for positioning the object"
- top_delta="-3"
- width="108">
- <combo_box.item
- label="World grid"
- name="World"
- value="World" />
- <combo_box.item
- label="Local grid"
- name="Local"
- value="Local" />
- <combo_box.item
- label="Reference grid"
- name="Reference"
- value="Reference" />
- <combo_box.commit_callback
- function="GridOptions.gridMode"/>
- </combo_box>
<spinner
control_name="GridResolution"
follows="left|top"
@@ -77,7 +20,7 @@
max_val="5"
min_val="0.01"
name="GridResolution"
- top_pad="4"
+ top_pad="30"
width="200" />
<spinner
control_name="GridDrawSize"
diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml
index f9147ea650..2d63c94fe1 100644
--- a/indra/newview/skins/default/xui/en/floater_tools.xml
+++ b/indra/newview/skins/default/xui/en/floater_tools.xml
@@ -14,7 +14,27 @@
save_visibility="true"
sound_flags="0"
width="295">
- <floater.string
+ <floater.string
+ name="grid_screen_text">
+ Screen
+ </floater.string>
+ <floater.string
+ name="grid_local_text">
+ Local
+ </floater.string>
+ <floater.string
+ name="grid_world_text">
+ World
+ </floater.string>
+ <floater.string
+ name="grid_reference_text">
+ Reference
+ </floater.string>
+ <floater.string
+ name="grid_attachment_text">
+ Attachment
+ </floater.string>
+ <floater.string
name="status_rotate">
Drag colored bands to rotate object
</floater.string>
@@ -312,20 +332,48 @@
top_pad="0"
name="checkbox snap to grid"
width="134" />
- <button
- left_pad="0"
- label="Options..."
+ <combo_box
+ height="20"
+ layout="topleft"
+ follows="left|top"
+ name="combobox grid mode"
+ tool_tip="Choose the type of grid ruler for positioning the object"
+ top="83"
+ left="195"
+ top_pad="0"
+ width="60">
+ <combo_box.item
+ label="World"
+ name="World"
+ value="World" />
+ <combo_box.item
+ label="Local"
+ name="Local"
+ value="Local" />
+ <combo_box.item
+ label="Reference"
+ name="Reference"
+ value="Reference" />
+ <combo_box.commit_callback
+ function="BuildTool.gridMode"/>
+ </combo_box>
+
+ <button
+ left="259"
+ label=""
+ image_selected="ForwardArrow_Press"
+ image_unselected="ForwardArrow_Off"
layout="topleft"
follows="top|left"
name="Options..."
tool_tip="See more grid options"
top="83"
- right="-35"
- width="65"
- height="21" >
+ width="25"
+ height="20" >
<button.commit_callback
function="BuildTool.gridOptions"/>
</button>
+
<button
follows="left|top"
height="20"