diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llaudio/llwindgen.h | 3 | ||||
-rw-r--r-- | indra/llrender/llfontgl.cpp | 26 | ||||
-rw-r--r-- | indra/llrender/llfontgl.h | 20 | ||||
-rw-r--r-- | indra/llui/llloadingindicator.cpp | 3 | ||||
-rw-r--r-- | indra/llui/lltextbase.cpp | 23 | ||||
-rw-r--r-- | indra/llui/lltextbase.h | 1 | ||||
-rw-r--r-- | indra/llui/llui.cpp | 1 | ||||
-rw-r--r-- | indra/llui/lluictrl.h | 8 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.cpp | 20 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.h | 5 | ||||
-rw-r--r-- | indra/newview/llcofwearables.cpp | 16 | ||||
-rw-r--r-- | indra/newview/lloutfitslist.cpp | 17 | ||||
-rw-r--r-- | indra/newview/lloutfitslist.h | 4 | ||||
-rw-r--r-- | indra/newview/llscrollingpanelparam.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llsidepanelappearance.cpp | 9 | ||||
-rw-r--r-- | indra/newview/lltexturectrl.cpp | 5 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_about_land.xml | 10 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_cof_wearables.xml | 5 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/sidepanel_appearance.xml | 8 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/textbase.xml | 2 |
20 files changed, 139 insertions, 51 deletions
diff --git a/indra/llaudio/llwindgen.h b/indra/llaudio/llwindgen.h index 1908b2545f..0e6d0aa2ca 100644 --- a/indra/llaudio/llwindgen.h +++ b/indra/llaudio/llwindgen.h @@ -52,7 +52,8 @@ public: mY1(0.0f), mCurrentGain(0.f), mCurrentFreq(100.f), - mCurrentPanGainR(0.5f) + mCurrentPanGainR(0.5f), + mLastSample(0.f) { mSamplePeriod = (F32)mSubSamples / (F32)mInputSamplingRate; mB2 = expf(-F_TWO_PI * mFilterBandWidth * mSamplePeriod); diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index d9e1976341..6eb5e0eff4 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -118,6 +118,32 @@ BOOL LLFontGL::loadFace(const std::string& filename, F32 point_size, F32 vert_dp static LLFastTimer::DeclareTimer FTM_RENDER_FONTS("Fonts"); +S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, const LLRect& rect, const LLColor4 &color, HAlign halign, VAlign valign, U8 style, + ShadowType shadow, S32 max_chars, F32* right_x, BOOL use_ellipses) const +{ + F32 x = rect.mLeft; + F32 y = 0.f; + + switch(valign) + { + case TOP: + y = rect.mTop; + break; + case VCENTER: + y = rect.getCenterY(); + break; + case BASELINE: + case BOTTOM: + y = rect.mBottom; + break; + default: + y = rect.mBottom; + break; + } + return render(wstr, begin_offset, x, y, color, halign, valign, style, shadow, max_chars, rect.getWidth(), right_x, use_ellipses); +} + + S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, const LLColor4 &color, HAlign halign, VAlign valign, U8 style, ShadowType shadow, S32 max_chars, S32 max_pixels, F32* right_x, BOOL use_ellipses) const { diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h index dfa4cf8ce5..f29ac5165c 100644 --- a/indra/llrender/llfontgl.h +++ b/indra/llrender/llfontgl.h @@ -95,8 +95,24 @@ public: BOOL loadFace(const std::string& filename, F32 point_size, const F32 vert_dpi, const F32 horz_dpi, const S32 components, BOOL is_fallback); - S32 render(const LLWString &text, S32 begin_offset, F32 x, F32 y, const LLColor4 &color, HAlign halign = LEFT, VAlign valign = BASELINE, U8 style = NORMAL, - ShadowType shadow = NO_SHADOW, S32 max_chars = S32_MAX, S32 max_pixels = S32_MAX, F32* right_x=NULL, BOOL use_ellipses = FALSE) const; + S32 render(const LLWString &text, S32 begin_offset, + const LLRect& rect, + const LLColor4 &color, + HAlign halign = LEFT, VAlign valign = BASELINE, + U8 style = NORMAL, ShadowType shadow = NO_SHADOW, + S32 max_chars = S32_MAX, + F32* right_x=NULL, + BOOL use_ellipses = FALSE) const; + + S32 render(const LLWString &text, S32 begin_offset, + F32 x, F32 y, + const LLColor4 &color, + HAlign halign = LEFT, VAlign valign = BASELINE, + U8 style = NORMAL, ShadowType shadow = NO_SHADOW, + S32 max_chars = S32_MAX, S32 max_pixels = S32_MAX, + F32* right_x=NULL, + BOOL use_ellipses = FALSE) const; + S32 render(const LLWString &text, S32 begin_offset, F32 x, F32 y, const LLColor4 &color) const; // renderUTF8 does a conversion, so is slower! diff --git a/indra/llui/llloadingindicator.cpp b/indra/llui/llloadingindicator.cpp index f8b029e19c..2ad5c5a530 100644 --- a/indra/llui/llloadingindicator.cpp +++ b/indra/llui/llloadingindicator.cpp @@ -41,7 +41,8 @@ #include "lluictrlfactory.h" #include "lluiimage.h" -static LLDefaultChildRegistry::Register<LLLoadingIndicator> r("loading_indicator"); +// registered in llui.cpp to avoid being left out by MS linker +//static LLDefaultChildRegistry::Register<LLLoadingIndicator> r("loading_indicator"); /////////////////////////////////////////////////////////////////////////////// // LLLoadingIndicator::Data class diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 17e41d9e24..ccd22ee050 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -193,6 +193,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mHPad(p.h_pad), mVPad(p.v_pad), mHAlign(p.font_halign), + mVAlign(p.font_valign), mLineSpacingMult(p.line_spacing.multiple), mLineSpacingPixels(p.line_spacing.pixels), mClipPartial(p.clip_partial && !p.allow_scroll), @@ -482,9 +483,9 @@ void LLTextBase::drawCursor() text_color = mFgColor.get(); fontp = mDefaultFont; } - fontp->render(text, mCursorPos, cursor_rect.mLeft, cursor_rect.mTop, + fontp->render(text, mCursorPos, cursor_rect, LLColor4(1.f - text_color.mV[VRED], 1.f - text_color.mV[VGREEN], 1.f - text_color.mV[VBLUE], alpha), - LLFontGL::LEFT, LLFontGL::TOP, + LLFontGL::LEFT, mVAlign, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 1); @@ -2435,12 +2436,12 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele S32 end = llmin( selection_start, seg_end ); S32 length = end - start; font->render(text, start, - rect.mLeft, rect.mTop, + rect, color, - LLFontGL::LEFT, LLFontGL::TOP, + LLFontGL::LEFT, mEditor.mVAlign, LLFontGL::NORMAL, mStyle->getShadowType(), - length, rect.getWidth(), + length, &right_x, mEditor.getUseEllipses()); } @@ -2454,12 +2455,12 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele S32 length = end - start; font->render(text, start, - rect.mLeft, rect.mTop, + rect, LLColor4( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2], 1.f ), - LLFontGL::LEFT, LLFontGL::TOP, + LLFontGL::LEFT, mEditor.mVAlign, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, - length, rect.getWidth(), + length, &right_x, mEditor.getUseEllipses()); } @@ -2471,12 +2472,12 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele S32 end = seg_end; S32 length = end - start; font->render(text, start, - rect.mLeft, rect.mTop, + rect, color, - LLFontGL::LEFT, LLFontGL::TOP, + LLFontGL::LEFT, mEditor.mVAlign, LLFontGL::NORMAL, mStyle->getShadowType(), - length, rect.getWidth(), + length, &right_x, mEditor.getUseEllipses()); } diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index fe8ebb1b80..ff63cc26f5 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -357,6 +357,7 @@ protected: S32 mHPad; // padding on left of text S32 mVPad; // padding above text LLFontGL::HAlign mHAlign; + LLFontGL::VAlign mVAlign; F32 mLineSpacingMult; // multiple of line height used as space for a single line of text (e.g. 1.5 to get 50% padding) S32 mLineSpacingPixels; // padding between lines const LLFontGL* mDefaultFont; // font that is used when none specified diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index dff1cb93e7..7f9dca08d2 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -97,7 +97,6 @@ static LLDefaultChildRegistry::Register<LLFlyoutButton> register_flyout_button(" static LLDefaultChildRegistry::Register<LLSearchEditor> register_search_editor("search_editor"); // register other widgets which otherwise may not be linked in -static LLDefaultChildRegistry::Register<LLMenuButton> register_menu_button("menu_button"); static LLDefaultChildRegistry::Register<LLLoadingIndicator> register_loading_indicator("loading_indicator"); diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index b9a4f61e15..1f9d2c9049 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -47,14 +47,10 @@ const BOOL TAKE_FOCUS_YES = TRUE; const BOOL TAKE_FOCUS_NO = FALSE; -// NOTE: the LLFocusableElement class declaration has been moved from here to llfocusmgr.h. - class LLUICtrl : public LLView, public boost::signals2::trackable { public: - - typedef boost::function<void (LLUICtrl* ctrl, const LLSD& param)> commit_callback_t; typedef boost::signals2::signal<void (LLUICtrl* ctrl, const LLSD& param)> commit_signal_t; // *TODO: add xml support for this type of signal in the future @@ -111,8 +107,8 @@ public: commit_callback; Optional<EnableCallbackParam> validate_callback; - Optional<CommitCallbackParam> mouseenter_callback; - Optional<CommitCallbackParam> mouseleave_callback; + Optional<CommitCallbackParam> mouseenter_callback, + mouseleave_callback; Optional<std::string> control_name; Optional<EnableControls> enabled_controls; diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 6b337e0d74..a46d961709 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -452,14 +452,22 @@ void LLUICtrlFactory::registerWidget(const std::type_info* widget_type, const st { // associate parameter block type with template .xml file std::string* existing_tag = LLWidgetNameRegistry::instance().getValue(param_block_type); - if (existing_tag != NULL && *existing_tag != tag) + if (existing_tag != NULL) { - std::cerr << "Duplicate entry for T::Params, try creating empty param block in derived classes that inherit T::Params" << std::endl; - // forcing crash here - char* foo = 0; - *foo = 1; + if(*existing_tag != tag) + { + std::cerr << "Duplicate entry for T::Params, try creating empty param block in derived classes that inherit T::Params" << std::endl; + // forcing crash here + char* foo = 0; + *foo = 1; + } + else + { + // widget already registered + return; + } } - LLWidgetNameRegistry ::instance().defaultRegistrar().add(param_block_type, tag); + LLWidgetNameRegistry::instance().defaultRegistrar().add(param_block_type, tag); // associate widget type with factory function LLDefaultWidgetRegistry::instance().defaultRegistrar().add(widget_type, creator_func); //FIXME: comment this in when working on schema generation diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 7da96ffce3..c99acee48e 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -373,8 +373,9 @@ LLChildRegistry<DERIVED>::Register<T>::Register(const char* tag, LLWidgetCreator LLUICtrlFactory::instance().registerWidget(&typeid(T), &typeid(typename T::Params), &LLUICtrlFactory::createDefaultWidget<T>, tag); // since registry_t depends on T, do this in line here - typedef typename T::child_registry_t registry_t; - LLChildRegistryRegistry::instance().defaultRegistrar().add(&typeid(T), registry_t::instance()); + // TODO: uncomment this for schema generation + //typedef typename T::child_registry_t registry_t; + //LLChildRegistryRegistry::instance().defaultRegistrar().add(&typeid(T), registry_t::instance()); } diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index cbebc93306..472d2ccf24 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -167,10 +167,18 @@ public: protected: static void replaceWearable() { - static LLButton* show_add_wearables_btn = - LLSideTray::getInstance()->getChild<LLButton>("show_add_wearables_btn"); - - show_add_wearables_btn->onCommit(); + // *TODO: Most probable that accessing to LLPanelOutfitEdit instance should be: + // LLSideTray::getInstance()->getSidepanelAppearance()->getPanelOutfitEdit() + // without casting. Getter methods provides possibility to check and construct + // absent instance. Explicit relations between components avoids situations + // when we tries to construct instance with unsatisfied implicit input conditions. + LLPanelOutfitEdit * panel_outfit_edit = + dynamic_cast<LLPanelOutfitEdit*> (LLSideTray::getInstance()->getPanel( + "panel_outfit_edit")); + if (panel_outfit_edit != NULL) + { + panel_outfit_edit->showAddWearablesPanel(true); + } } /*virtual*/ LLContextMenu* createMenu() diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 23c7e64cce..dddfd9106f 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -657,10 +657,10 @@ bool LLOutfitsList::isActionEnabled(const LLSD& userdata) } if (command_name == "take_off") { - // Enable "Take Off" only if a worn item or base outfit is selected. - return ( !hasItemSelected() - && LLAppearanceMgr::getInstance()->getBaseOutfitUUID() == mSelectedOutfitUUID ) - || hasWornItemSelected(); + // Enable "Take Off" if any of selected items can be taken off + // or the selected outfit contains items that can be taken off. + return ( hasItemSelected() && canTakeOffSelected() ) + || ( !hasItemSelected() && LLAppearanceMgr::getCanRemoveFromCOF(mSelectedOutfitUUID) ); } if (command_name == "wear_add") @@ -955,14 +955,19 @@ void LLOutfitsList::applyFilterToTab( } } -bool LLOutfitsList::hasWornItemSelected() +bool LLOutfitsList::canTakeOffSelected() { uuid_vec_t selected_uuids; getSelectedItemsUUIDs(selected_uuids); + LLFindWearablesEx is_worn(/*is_worn=*/ true, /*include_body_parts=*/ false); + for (uuid_vec_t::const_iterator it=selected_uuids.begin(); it != selected_uuids.end(); ++it) { - if (get_is_item_worn(*it)) return true; + LLViewerInventoryItem* item = gInventory.getItem(*it); + if (!item) continue; + + if (is_worn(NULL, item)) return true; } return false; } diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 26722f2a96..d7cf8a8c08 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -179,9 +179,9 @@ private: void applyFilterToTab(const LLUUID& category_id, LLAccordionCtrlTab* tab, const std::string& filter_substring); /** - * Returns true if there are any worn items among currently selected, otherwise false. + * Returns true if there are any items that can be taken off among currently selected, otherwise false. */ - bool hasWornItemSelected(); + bool canTakeOffSelected(); void onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id); void onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y); diff --git a/indra/newview/llscrollingpanelparam.cpp b/indra/newview/llscrollingpanelparam.cpp index 6f5238f0a1..36d581a41a 100644 --- a/indra/newview/llscrollingpanelparam.cpp +++ b/indra/newview/llscrollingpanelparam.cpp @@ -209,6 +209,7 @@ void LLScrollingPanelParam::onSliderMoved(LLUICtrl* ctrl, void* userdata) if (current_weight != new_weight ) { self->mWearable->setVisualParamWeight( param->getID(), new_weight, FALSE ); + self->mWearable->writeToAvatar(); gAgentAvatarp->updateVisualParams(); } } @@ -298,6 +299,7 @@ void LLScrollingPanelParam::onHintHeldDown( LLVisualParamHint* hint ) && new_percent < slider->getMaxValue()) { mWearable->setVisualParamWeight( hint->getVisualParam()->getID(), new_weight, FALSE); + mWearable->writeToAvatar(); gAgentAvatarp->updateVisualParams(); slider->setValue( weightToPercent( new_weight ) ); @@ -330,6 +332,7 @@ void LLScrollingPanelParam::onHintMinMouseUp( void* userdata ) && new_percent < slider->getMaxValue()) { self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight, FALSE); + self->mWearable->writeToAvatar(); slider->setValue( self->weightToPercent( new_weight ) ); } } @@ -363,6 +366,7 @@ void LLScrollingPanelParam::onHintMaxMouseUp( void* userdata ) && new_percent < slider->getMaxValue()) { self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight, FALSE); + self->mWearable->writeToAvatar(); slider->setValue( self->weightToPercent( new_weight ) ); } } diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 951323551c..7a7ffb9983 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -196,6 +196,15 @@ void LLSidepanelAppearance::onVisibilityChange(const LLSD &new_visibility) { gAgentCamera.changeCameraToCustomizeAvatar(); } + if (mEditWearable && mEditWearable->getVisible()) + { + LLWearable *wearable_ptr = mEditWearable->getWearable(); + if (gAgentWearables.getWearableIndex(wearable_ptr) == LLAgentWearables::MAX_CLOTHING_PER_TYPE) + { + // we're no longer wearing the wearable we were last editing, switch back to outfit editor + showOutfitEditPanel(); + } + } } } else diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 0b86cefa1d..fcb9deb20b 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -423,8 +423,9 @@ BOOL LLFloaterTexturePicker::postBuild() mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); mInventoryPanel->setAllowMultiSelect(FALSE); - // store this filter as the default one - mInventoryPanel->getRootFolder()->getFilter()->markDefault(); + // Commented out to scroll to currently selected texture. See EXT-5403. + // // store this filter as the default one + // mInventoryPanel->getRootFolder()->getFilter()->markDefault(); // Commented out to stop opening all folders with textures // mInventoryPanel->openDefaultFolderForType(LLFolderType::FT_TEXTURE); diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 14aacafa9f..68e36ff0b3 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -191,9 +191,10 @@ type="string" length="1" follows="left|top" - height="16" + height="20" layout="topleft" left_pad="2" + valign="center" name="ContentRatingText" top_delta="0" width="250"> @@ -207,7 +208,7 @@ layout="topleft" left="10" name="Owner:" - top_pad="5" + top_pad="1" width="100"> Owner: </text> @@ -729,8 +730,10 @@ Leyla Linden </text> height="16" layout="topleft" left_pad="10" + top_delta="-3" mouse_opaque="false" name="region_maturity_text" + valign="center" width="150"> Adult </text> @@ -743,6 +746,7 @@ Leyla Linden </text> left="10" mouse_opaque="false" name="resellable_lbl" + top_pad="9" width="100"> Resale: </text> @@ -1924,6 +1928,8 @@ Only large parcels can be listed in search. left_delta="0" name="public_access" top_pad="5" + label_text.valign="center" + label_text.v_pad="-7" width="278" /> <text type="string" diff --git a/indra/newview/skins/default/xui/en/panel_cof_wearables.xml b/indra/newview/skins/default/xui/en/panel_cof_wearables.xml index d2c8ab159f..d5943ea156 100644 --- a/indra/newview/skins/default/xui/en/panel_cof_wearables.xml +++ b/indra/newview/skins/default/xui/en/panel_cof_wearables.xml @@ -35,7 +35,10 @@ multi_select="true" name="list_attachments" top="0" - width="311" /> + width="311"> + <flat_list_view.no_items_text + value="No attachments worn" /> + </flat_list_view> </accordion_tab> <accordion_tab layout="topleft" diff --git a/indra/newview/skins/default/xui/en/sidepanel_appearance.xml b/indra/newview/skins/default/xui/en/sidepanel_appearance.xml index 10d8c7dbb8..02ab0ffee5 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_appearance.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_appearance.xml @@ -52,14 +52,14 @@ width="333"> visible="false" /> <icon follows="top|left" - height="32" - image_name="TabIcon_Appearance_Off" + height="31" + image_name="Shirt_Large" name="outfit_icon" mouse_opaque="false" visible="true" - left="0" + left="1" top="0" - width="32" /> + width="31" /> <text font="SansSerifSmall" text_color="EmphasisColor" diff --git a/indra/newview/skins/default/xui/en/widgets/textbase.xml b/indra/newview/skins/default/xui/en/widgets/textbase.xml index f4dc192bc3..b2da2147c1 100644 --- a/indra/newview/skins/default/xui/en/widgets/textbase.xml +++ b/indra/newview/skins/default/xui/en/widgets/textbase.xml @@ -1,3 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <textbase clip_partial="false" + halign="left" + valign="top" font="SansSerif"/> |