diff options
author | McCabe Maxsted | 2010-04-13 02:29:28 -0700 |
---|---|---|
committer | McCabe Maxsted | 2010-04-13 02:31:47 -0700 |
commit | c435a835bf26a0de1f8cb5ca44e4c5d4f74f1b89 (patch) | |
tree | 09c27b14f8167d8d4116fb221005f25d2216088c /linden/indra/newview/llfloaterbuildoptions.cpp | |
parent | From Emerald: added option to rez objects under the proper land group to prev... (diff) | |
download | meta-impy-c435a835bf26a0de1f8cb5ca44e4c5d4f74f1b89.zip meta-impy-c435a835bf26a0de1f8cb5ca44e4c5d4f74f1b89.tar.gz meta-impy-c435a835bf26a0de1f8cb5ca44e4c5d4f74f1b89.tar.bz2 meta-impy-c435a835bf26a0de1f8cb5ca44e4c5d4f74f1b89.tar.xz |
Ported Emerald build preferences and added them to llfloaterbuildoptions instead
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llfloaterbuildoptions.cpp | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/linden/indra/newview/llfloaterbuildoptions.cpp b/linden/indra/newview/llfloaterbuildoptions.cpp index 3cd35db..472f6bb 100644 --- a/linden/indra/newview/llfloaterbuildoptions.cpp +++ b/linden/indra/newview/llfloaterbuildoptions.cpp | |||
@@ -43,17 +43,24 @@ | |||
43 | // library includes | 43 | // library includes |
44 | #include "llfontgl.h" | 44 | #include "llfontgl.h" |
45 | #include "llcheckboxctrl.h" | 45 | #include "llcheckboxctrl.h" |
46 | #include "llcombobox.h" | ||
46 | #include "llspinctrl.h" | 47 | #include "llspinctrl.h" |
47 | #include "llsliderctrl.h" | 48 | #include "llsliderctrl.h" |
49 | #include "lltexturectrl.h" | ||
48 | 50 | ||
49 | // newview includes | 51 | // newview includes |
52 | #include "llinventorymodel.h" | ||
50 | #include "llresmgr.h" | 53 | #include "llresmgr.h" |
54 | #include "llstartup.h" // not really necessary here, but just in case | ||
51 | #include "llviewercontrol.h" | 55 | #include "llviewercontrol.h" |
56 | #include "llviewerinventory.h" | ||
57 | #include "floaterbusy.h" // class InvDropTarget | ||
52 | 58 | ||
53 | // | 59 | // |
54 | // Globals | 60 | // Globals |
55 | // | 61 | // |
56 | LLFloaterBuildOptions *LLFloaterBuildOptions::sInstance = NULL; | 62 | LLFloaterBuildOptions *LLFloaterBuildOptions::sInstance = NULL; |
63 | InvDropTarget * LLFloaterBuildOptions::mBuildObjectDropTarget; | ||
57 | 64 | ||
58 | // | 65 | // |
59 | // Methods | 66 | // Methods |
@@ -67,6 +74,55 @@ LLFloaterBuildOptions::LLFloaterBuildOptions( ) | |||
67 | LLFloaterBuildOptions::~LLFloaterBuildOptions() | 74 | LLFloaterBuildOptions::~LLFloaterBuildOptions() |
68 | { | 75 | { |
69 | sInstance = NULL; | 76 | sInstance = NULL; |
77 | delete mBuildObjectDropTarget; | ||
78 | mBuildObjectDropTarget = NULL; | ||
79 | } | ||
80 | |||
81 | BOOL LLFloaterBuildOptions::postBuild() | ||
82 | { | ||
83 | getChild<LLComboBox>("material")->setSimple(gSavedSettings.getString("BuildPrefs_Material")); | ||
84 | getChild<LLComboBox>("combobox shininess")->setSimple(gSavedSettings.getString("BuildPrefs_Shiny")); | ||
85 | |||
86 | getChild<LLComboBox>("material")->setCommitCallback(onComboBoxCommit); | ||
87 | getChild<LLComboBox>("combobox shininess")->setCommitCallback(onComboBoxCommit); | ||
88 | |||
89 | getChild<LLTextureCtrl>("texture control")->setDefaultImageAssetID(LLUUID("89556747-24cb-43ed-920b-47caed15465f")); | ||
90 | getChild<LLTextureCtrl>("texture control")->setCommitCallback(onTexturePickerCommit); | ||
91 | |||
92 | LLView *target_view = getChild<LLView>("build_item_add_disp_rect"); | ||
93 | if (target_view) | ||
94 | { | ||
95 | if (mBuildObjectDropTarget) | ||
96 | { | ||
97 | delete mBuildObjectDropTarget; | ||
98 | } | ||
99 | mBuildObjectDropTarget = new InvDropTarget("build drop target", target_view->getRect(),BuildAutoResponseItemDrop); | ||
100 | addChild(mBuildObjectDropTarget); | ||
101 | } | ||
102 | |||
103 | if (LLStartUp::getStartupState() == STATE_STARTED) | ||
104 | { | ||
105 | LLUUID itemid = (LLUUID)gSavedSettings.getString("BuildPrefs_Item"); | ||
106 | LLViewerInventoryItem* item = gInventory.getItem(itemid); | ||
107 | if (item) | ||
108 | { | ||
109 | childSetValue("build_item_add_disp_rect_txt", "Currently set to: "+item->getName()); | ||
110 | } | ||
111 | else if (itemid.isNull()) | ||
112 | { | ||
113 | childSetValue("build_item_add_disp_rect_txt", "Currently not set"); | ||
114 | } | ||
115 | else | ||
116 | { | ||
117 | childSetValue("build_item_add_disp_rect_txt", "Currently set to a item not on this account"); | ||
118 | } | ||
119 | } | ||
120 | else | ||
121 | { | ||
122 | childSetValue("build_item_add_disp_rect_txt", "Not logged in"); | ||
123 | } | ||
124 | |||
125 | return TRUE; | ||
70 | } | 126 | } |
71 | 127 | ||
72 | // static | 128 | // static |
@@ -95,3 +151,28 @@ BOOL LLFloaterBuildOptions::visible(void*) | |||
95 | { | 151 | { |
96 | return (sInstance != NULL); | 152 | return (sInstance != NULL); |
97 | } | 153 | } |
154 | |||
155 | void LLFloaterBuildOptions::BuildAutoResponseItemDrop(LLViewerInventoryItem* item) | ||
156 | { | ||
157 | gSavedSettings.setString("BuildPrefs_Item", item->getUUID().asString()); | ||
158 | LLFloaterBuildOptions::getInstance()->childSetValue("build_item_add_disp_rect_txt", "Currently set to: "+item->getName()); | ||
159 | } | ||
160 | |||
161 | void LLFloaterBuildOptions::onComboBoxCommit(LLUICtrl* ctrl, void* userdata) | ||
162 | { | ||
163 | |||
164 | LLComboBox* box = (LLComboBox*)ctrl; | ||
165 | if(box) | ||
166 | { | ||
167 | gSavedSettings.setString(box->getControlName(), box->getValue().asString()); | ||
168 | } | ||
169 | } | ||
170 | |||
171 | void LLFloaterBuildOptions::onTexturePickerCommit(LLUICtrl* ctrl, void* userdata) | ||
172 | { | ||
173 | LLTextureCtrl* image_ctrl = (LLTextureCtrl*)ctrl; | ||
174 | if(image_ctrl) | ||
175 | { | ||
176 | gSavedSettings.setString("BuildPrefs_Texture", image_ctrl->getImageAssetID().asString()); | ||
177 | } | ||
178 | } | ||