diff options
Diffstat (limited to 'linden/indra/newview/lloverlaybar.cpp')
-rw-r--r-- | linden/indra/newview/lloverlaybar.cpp | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp index 0366e75..e5c1113 100644 --- a/linden/indra/newview/lloverlaybar.cpp +++ b/linden/indra/newview/lloverlaybar.cpp | |||
@@ -55,12 +55,13 @@ | |||
55 | #include "llviewermedia.h" | 55 | #include "llviewermedia.h" |
56 | #include "llviewerparcelmedia.h" | 56 | #include "llviewerparcelmedia.h" |
57 | #include "llviewerparcelmgr.h" | 57 | #include "llviewerparcelmgr.h" |
58 | #include "llvieweruictrlfactory.h" | 58 | #include "lluictrlfactory.h" |
59 | #include "llviewerwindow.h" | 59 | #include "llviewerwindow.h" |
60 | #include "llvoiceclient.h" | 60 | #include "llvoiceclient.h" |
61 | #include "llvoavatar.h" | 61 | #include "llvoavatar.h" |
62 | #include "llvoiceremotectrl.h" | 62 | #include "llvoiceremotectrl.h" |
63 | #include "llwebbrowserctrl.h" | 63 | #include "llwebbrowserctrl.h" |
64 | #include "llselectmgr.h" | ||
64 | 65 | ||
65 | // | 66 | // |
66 | // Globals | 67 | // Globals |
@@ -112,7 +113,7 @@ LLOverlayBar::LLOverlayBar() | |||
112 | factory_map["voice_remote"] = LLCallbackMap(LLOverlayBar::createVoiceRemote, this); | 113 | factory_map["voice_remote"] = LLCallbackMap(LLOverlayBar::createVoiceRemote, this); |
113 | factory_map["chat_bar"] = LLCallbackMap(LLOverlayBar::createChatBar, this); | 114 | factory_map["chat_bar"] = LLCallbackMap(LLOverlayBar::createChatBar, this); |
114 | 115 | ||
115 | gUICtrlFactory->buildPanel(this, "panel_overlaybar.xml", &factory_map); | 116 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_overlaybar.xml", &factory_map); |
116 | } | 117 | } |
117 | 118 | ||
118 | BOOL LLOverlayBar::postBuild() | 119 | BOOL LLOverlayBar::postBuild() |
@@ -136,16 +137,6 @@ LLOverlayBar::~LLOverlayBar() | |||
136 | // LLView destructor cleans up children | 137 | // LLView destructor cleans up children |
137 | } | 138 | } |
138 | 139 | ||
139 | EWidgetType LLOverlayBar::getWidgetType() const | ||
140 | { | ||
141 | return WIDGET_TYPE_OVERLAY_BAR; | ||
142 | } | ||
143 | |||
144 | LLString LLOverlayBar::getWidgetTag() const | ||
145 | { | ||
146 | return LL_OVERLAY_BAR_TAG; | ||
147 | } | ||
148 | |||
149 | // virtual | 140 | // virtual |
150 | void LLOverlayBar::reshape(S32 width, S32 height, BOOL called_from_parent) | 141 | void LLOverlayBar::reshape(S32 width, S32 height, BOOL called_from_parent) |
151 | { | 142 | { |
@@ -159,12 +150,12 @@ void LLOverlayBar::reshape(S32 width, S32 height, BOOL called_from_parent) | |||
159 | 150 | ||
160 | void LLOverlayBar::layoutButtons() | 151 | void LLOverlayBar::layoutButtons() |
161 | { | 152 | { |
162 | LLView* state_buttons_panel = getChildByName("state_buttons", TRUE); | 153 | LLView* state_buttons_panel = getChildView("state_buttons"); |
163 | 154 | ||
164 | if (state_buttons_panel && state_buttons_panel->getVisible()) | 155 | if (state_buttons_panel->getVisible()) |
165 | { | 156 | { |
166 | LLViewQuery query; | 157 | LLViewQuery query; |
167 | LLWidgetTypeFilter widget_filter(WIDGET_TYPE_BUTTON); | 158 | LLWidgetTypeFilter<LLButton> widget_filter; |
168 | query.addPreFilter(LLEnabledFilter::getInstance()); | 159 | query.addPreFilter(LLEnabledFilter::getInstance()); |
169 | query.addPreFilter(&widget_filter); | 160 | query.addPreFilter(&widget_filter); |
170 | 161 | ||
@@ -200,7 +191,7 @@ void LLOverlayBar::refresh() | |||
200 | BOOL buttons_changed = FALSE; | 191 | BOOL buttons_changed = FALSE; |
201 | 192 | ||
202 | BOOL im_received = gIMMgr->getIMReceived(); | 193 | BOOL im_received = gIMMgr->getIMReceived(); |
203 | LLButton* button = LLUICtrlFactory::getButtonByName(this, "IM Received"); | 194 | LLButton* button = getChild<LLButton>("IM Received"); |
204 | if (button && button->getVisible() != im_received) | 195 | if (button && button->getVisible() != im_received) |
205 | { | 196 | { |
206 | button->setVisible(im_received); | 197 | button->setVisible(im_received); |
@@ -210,7 +201,7 @@ void LLOverlayBar::refresh() | |||
210 | } | 201 | } |
211 | 202 | ||
212 | BOOL busy = gAgent.getBusy(); | 203 | BOOL busy = gAgent.getBusy(); |
213 | button = LLUICtrlFactory::getButtonByName(this, "Set Not Busy"); | 204 | button = getChild<LLButton>("Set Not Busy"); |
214 | if (button && button->getVisible() != busy) | 205 | if (button && button->getVisible() != busy) |
215 | { | 206 | { |
216 | button->setVisible(busy); | 207 | button->setVisible(busy); |
@@ -220,7 +211,7 @@ void LLOverlayBar::refresh() | |||
220 | } | 211 | } |
221 | 212 | ||
222 | BOOL controls_grabbed = gAgent.anyControlGrabbed(); | 213 | BOOL controls_grabbed = gAgent.anyControlGrabbed(); |
223 | button = LLUICtrlFactory::getButtonByName(this, "Release Keys"); | 214 | button = getChild<LLButton>("Release Keys"); |
224 | 215 | ||
225 | if (button && button->getVisible() != controls_grabbed) | 216 | if (button && button->getVisible() != controls_grabbed) |
226 | { | 217 | { |
@@ -233,7 +224,7 @@ void LLOverlayBar::refresh() | |||
233 | BOOL mouselook_grabbed; | 224 | BOOL mouselook_grabbed; |
234 | mouselook_grabbed = gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_DOWN_INDEX) | 225 | mouselook_grabbed = gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_DOWN_INDEX) |
235 | || gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_UP_INDEX); | 226 | || gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_UP_INDEX); |
236 | button = LLUICtrlFactory::getButtonByName(this, "Mouselook"); | 227 | button = getChild<LLButton>("Mouselook"); |
237 | 228 | ||
238 | if (button && button->getVisible() != mouselook_grabbed) | 229 | if (button && button->getVisible() != mouselook_grabbed) |
239 | { | 230 | { |
@@ -248,7 +239,7 @@ void LLOverlayBar::refresh() | |||
248 | { | 239 | { |
249 | sitting = gAgent.getAvatarObject()->mIsSitting; | 240 | sitting = gAgent.getAvatarObject()->mIsSitting; |
250 | } | 241 | } |
251 | button = LLUICtrlFactory::getButtonByName(this, "Stand Up"); | 242 | button = getChild<LLButton>("Stand Up"); |
252 | 243 | ||
253 | if (button && button->getVisible() != sitting) | 244 | if (button && button->getVisible() != sitting) |
254 | { | 245 | { |
@@ -325,6 +316,7 @@ void LLOverlayBar::onClickMouselook(void*) | |||
325 | //static | 316 | //static |
326 | void LLOverlayBar::onClickStandUp(void*) | 317 | void LLOverlayBar::onClickStandUp(void*) |
327 | { | 318 | { |
319 | LLSelectMgr::getInstance()->deselectAllForStandingUp(); | ||
328 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); | 320 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); |
329 | } | 321 | } |
330 | 322 | ||
@@ -359,7 +351,7 @@ void LLOverlayBar::toggleMediaPlay(void*) | |||
359 | } | 351 | } |
360 | else | 352 | else |
361 | { | 353 | { |
362 | LLParcel* parcel = gParcelMgr->getAgentParcel(); | 354 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); |
363 | if (parcel) | 355 | if (parcel) |
364 | { | 356 | { |
365 | LLViewerParcelMedia::play(parcel); | 357 | LLViewerParcelMedia::play(parcel); |
@@ -380,7 +372,7 @@ void LLOverlayBar::toggleMusicPlay(void*) | |||
380 | gOverlayBar->mMusicState = PLAYING; // desired state | 372 | gOverlayBar->mMusicState = PLAYING; // desired state |
381 | if (gAudiop) | 373 | if (gAudiop) |
382 | { | 374 | { |
383 | LLParcel* parcel = gParcelMgr->getAgentParcel(); | 375 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); |
384 | if ( parcel ) | 376 | if ( parcel ) |
385 | { | 377 | { |
386 | // this doesn't work properly when crossing parcel boundaries - even when the | 378 | // this doesn't work properly when crossing parcel boundaries - even when the |