diff options
author | Richard Nelson <none@none> | 2010-09-13 10:34:54 -0700 |
---|---|---|
committer | Richard Nelson <none@none> | 2010-09-13 10:34:54 -0700 |
commit | 19848665587fce7fc232c528add88c994ddefd63 (patch) | |
tree | 5c435b6493947507920d6e31baf95cb6e5f0dcb5 /indra/newview | |
parent | 24f308caaeda941a626b6143d95adbfe07450f97 (diff) | |
parent | e2257bc78e53162127c49adad3f9dc406ecc270e (diff) |
merge
Diffstat (limited to 'indra/newview')
17 files changed, 121 insertions, 25 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6ea4cf8625..efe418f0e8 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2809,7 +2809,18 @@ <key>Value</key> <integer>0</integer> </map> - <key>EnableVoiceChat</key> + <key>EnableUIHints</key> + <map> + <key>Comment</key> + <string>Toggles UI hint popups</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>EnableVoiceChat</key> <map> <key>Comment</key> <string>Enable talking to other residents with a microphone</string> diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index fba15693c8..8c3d30237f 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -470,6 +470,8 @@ BOOL LLBottomTray::postBuild() gMenuHolder->addChild(mBottomTrayContextMenu); mNearbyChatBar = findChild<LLNearbyChatBar>("chat_bar"); + LLHints::registerHintTarget("chat_bar", mNearbyChatBar->LLView::getHandle()); + mChatBarContainer = getChild<LLLayoutPanel>("chat_bar_layout_panel"); mToolbarStack = getChild<LLLayoutStack>("toolbar_stack"); diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index ead06d59f9..b864ba6a36 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -74,7 +74,7 @@ void LLFirstUse::resetFirstUse() // static void LLFirstUse::otherAvatarChatFirst(bool enable) { - firstUseNotification("FirstOtherChatBeforeUser", enable, "HintChat", LLSD(), LLSD().with("target", "incoming_chat").with("direction", "right")); + firstUseNotification("FirstOtherChatBeforeUser", enable, "HintChat", LLSD(), LLSD().with("target", "chat_bar").with("direction", "top_right").with("distance", 24)); } // static diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index 0c91dd473d..bd7fec63e8 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -32,6 +32,7 @@ #include "llbutton.h" #include "lltextbox.h" #include "llviewerwindow.h" +#include "llviewercontrol.h" #include "llsdparam.h" class LLHintPopup : public LLPanel @@ -43,7 +44,8 @@ public: LEFT, TOP, RIGHT, - BOTTOM + BOTTOM, + TOP_RIGHT } EPopupDirection; struct PopupDirections : public LLInitParam::TypeValuesHelper<LLHintPopup::EPopupDirection, PopupDirections> @@ -54,6 +56,7 @@ public: declare("right", LLHintPopup::RIGHT); declare("top", LLHintPopup::TOP); declare("bottom", LLHintPopup::BOTTOM); + declare("top_right", LLHintPopup::TOP_RIGHT); } }; @@ -76,7 +79,9 @@ public: Optional<LLUIImage*> left_arrow, up_arrow, right_arrow, - down_arrow; + down_arrow, + lower_left_arrow; + Optional<S32> left_arrow_offset, up_arrow_offset, right_arrow_offset, @@ -90,6 +95,7 @@ public: up_arrow("up_arrow"), right_arrow("right_arrow"), down_arrow("down_arrow"), + lower_left_arrow("lower_left_arrow"), left_arrow_offset("left_arrow_offset"), up_arrow_offset("up_arrow_offset"), right_arrow_offset("right_arrow_offset"), @@ -115,7 +121,8 @@ private: LLUIImagePtr mArrowLeft, mArrowUp, mArrowRight, - mArrowDown; + mArrowDown, + mArrowDownAndLeft; S32 mArrowLeftOffset, mArrowUpOffset, mArrowRightOffset, @@ -137,6 +144,7 @@ LLHintPopup::LLHintPopup(const LLHintPopup::Params& p) mArrowUp(p.up_arrow), mArrowRight(p.right_arrow), mArrowDown(p.down_arrow), + mArrowDownAndLeft(p.lower_left_arrow), mArrowLeftOffset(p.left_arrow_offset), mArrowUpOffset(p.up_arrow_offset), mArrowRightOffset(p.right_arrow_offset), @@ -272,6 +280,19 @@ void LLHintPopup::draw() arrow_imagep = mArrowUp; } break; + case TOP_RIGHT: + my_rect.setCenterAndSize( target_rect.mRight + (my_local_rect.getWidth() / 2), + target_rect.mTop + (my_local_rect.getHeight() / 2 + mDistance), + my_local_rect.getWidth(), + my_local_rect.getHeight()); + if (mArrowDownAndLeft) + { + arrow_rect.setCenterAndSize(my_local_rect.mLeft + mArrowDownAndLeft->getWidth() / 2 + mArrowLeftOffset, + my_local_rect.mBottom - mArrowDownAndLeft->getHeight() / 2 + mArrowDownOffset, + mArrowDownAndLeft->getWidth(), + mArrowDownAndLeft->getHeight()); + arrow_imagep = mArrowDownAndLeft; + } } setShape(my_rect); LLPanel::draw(); @@ -289,27 +310,31 @@ std::map<LLNotificationPtr, class LLHintPopup*> LLHints::sHints; //static void LLHints::show(LLNotificationPtr hint) { - LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams<LLHintPopup>()); - - LLParamSDParser parser; - parser.readSD(hint->getPayload(), p, true); - p.notification = hint; - - if (p.validateBlock()) + if (gSavedSettings.getBOOL("EnableUIHints")) { - LLHintPopup* popup = new LLHintPopup(p); + LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams<LLHintPopup>()); - sHints[hint] = popup; + LLParamSDParser parser; + parser.readSD(hint->getPayload(), p, true); + p.notification = hint; - LLView* hint_holder = gViewerWindow->getHintHolder(); - if (hint_holder) + if (p.validateBlock()) { - hint_holder->addChild(popup); - popup->centerWithin(hint_holder->getLocalRect()); + LLHintPopup* popup = new LLHintPopup(p); + + sHints[hint] = popup; + + LLView* hint_holder = gViewerWindow->getHintHolder(); + if (hint_holder) + { + hint_holder->addChild(popup); + popup->centerWithin(hint_holder->getLocalRect()); + } } } } +//static void LLHints::hide(LLNotificationPtr hint) { hint_map_t::iterator found_it = sHints.find(hint); @@ -321,6 +346,26 @@ void LLHints::hide(LLNotificationPtr hint) } //static +void LLHints::hideAll() +{ + std::vector<LLNotificationPtr> notifications; + for (hint_map_t::iterator it = sHints.begin(), end_it = sHints.end(); + it != end_it; + ++it) + { + notifications.push_back(it->first); + } + + for(std::vector<LLNotificationPtr>::iterator it = notifications.begin(), end_it = notifications.end(); + it != end_it; + ++it) + { + LLNotifications::instance().cancel(*it); + } + +} + +//static void LLHints::registerHintTarget(const std::string& name, LLHandle<LLView> target) { sTargetRegistry.defaultRegistrar().replace(name, target); diff --git a/indra/newview/llhints.h b/indra/newview/llhints.h index 90e09ed004..3bca7f00a1 100644 --- a/indra/newview/llhints.h +++ b/indra/newview/llhints.h @@ -36,6 +36,7 @@ class LLHints public: static void show(LLNotificationPtr hint); static void hide(LLNotificationPtr hint); + static void hideAll(); static void registerHintTarget(const std::string& name, LLHandle<LLView> target); static LLHandle<LLView> getHintTarget(const std::string& name); private: diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index e1ce0b384a..eb74cfc00b 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -62,6 +62,7 @@ #include "lllandmarkactions.h" #include "llgroupmgr.h" #include "lltooltip.h" +#include "llhints.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" #include "llimview.h" @@ -7740,6 +7741,26 @@ public: } }; +class LLToggleUIHints : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool ui_hints_enabled = gSavedSettings.getBOOL("EnableUIHints"); + if (ui_hints_enabled) + { + // hide existing hints + LLHints::hideAll(); + + gSavedSettings.setBOOL("EnableUIHints", FALSE); + } + else + { + gSavedSettings.setBOOL("EnableUIHints", TRUE); + } + return true; + } +}; + void LLUploadCostCalculator::calculateCost() { S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); @@ -8220,4 +8241,5 @@ void initialize_menus() view_listener_t::addMenu(new LLEditableSelected(), "EditableSelected"); view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono"); + view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints"); } diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 8d6a564687..7c8574609c 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -651,6 +651,7 @@ with the same filename but different name <texture name="hint_arrow_right" file_name="windows/hint_arrow_right.png" preload="false"/> <texture name="hint_arrow_up" file_name="windows/hint_arrow_up.png" preload="false"/> <texture name="hint_arrow_down" file_name="windows/hint_arrow_down.png" preload="false"/> + <texture name="hint_arrow_lower_left" file_name="windows/hint_arrow_lower_left.png" preload="false"/> <texture name="Yellow_Gradient" file_name="windows/yellow_gradient.png"/> <texture name="Popup_Caution" file_name="icons/pop_up_caution.png"/> diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_down.png b/indra/newview/skins/default/textures/windows/hint_arrow_down.png Binary files differindex 11ab3c2d0c..ddadef0978 100644 --- a/indra/newview/skins/default/textures/windows/hint_arrow_down.png +++ b/indra/newview/skins/default/textures/windows/hint_arrow_down.png diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_left.png b/indra/newview/skins/default/textures/windows/hint_arrow_left.png Binary files differindex e5c597a550..2794b967e8 100644 --- a/indra/newview/skins/default/textures/windows/hint_arrow_left.png +++ b/indra/newview/skins/default/textures/windows/hint_arrow_left.png diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_lower_left.png b/indra/newview/skins/default/textures/windows/hint_arrow_lower_left.png Binary files differnew file mode 100644 index 0000000000..0dfc99898d --- /dev/null +++ b/indra/newview/skins/default/textures/windows/hint_arrow_lower_left.png diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_right.png b/indra/newview/skins/default/textures/windows/hint_arrow_right.png Binary files differindex 3f89187e13..7ac57f805b 100644 --- a/indra/newview/skins/default/textures/windows/hint_arrow_right.png +++ b/indra/newview/skins/default/textures/windows/hint_arrow_right.png diff --git a/indra/newview/skins/default/textures/windows/hint_arrow_up.png b/indra/newview/skins/default/textures/windows/hint_arrow_up.png Binary files differindex 1050097efb..bb3e1c07fa 100644 --- a/indra/newview/skins/default/textures/windows/hint_arrow_up.png +++ b/indra/newview/skins/default/textures/windows/hint_arrow_up.png diff --git a/indra/newview/skins/default/textures/windows/hint_background.png b/indra/newview/skins/default/textures/windows/hint_background.png Binary files differindex 0839a95205..cfac5deacb 100644 --- a/indra/newview/skins/default/textures/windows/hint_background.png +++ b/indra/newview/skins/default/textures/windows/hint_background.png diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml index a46604c834..1432099590 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml @@ -86,7 +86,7 @@ visible="true" width="20" /> </layout_panel> - <layout_panel name="leave_call_panel"> + <layout_panel name="leave_call_panel" height="26" auto_resize="false"> <layout_stack clip="true" auto_resize="false" @@ -98,10 +98,14 @@ orientation="horizontal" width="262"> <layout_panel - class="panel_voice_effect" - name="panel_voice_effect" - visiblity_control="VoiceMorphingEnabled" - filename="panel_voice_effect.xml" /> + height="26" + width="200"> + <panel + class="panel_voice_effect" + name="panel_voice_effect" + visiblity_control="VoiceMorphingEnabled" + filename="panel_voice_effect.xml" /> + </layout_panel> <layout_panel auto_resize="false" user_resize="false" diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 0b85074eb6..dbd24b6d59 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -945,6 +945,14 @@ function="Floater.Show" parameter="sl_about" /> </menu_item_call> + <menu_item_check + label="Enable Hints" + name="Enable Hints"> + <on_check + control="EnableUIHints"/> + <on_click + function="ToggleUIHints"/> + </menu_item_check> </menu> <menu label="Advanced" diff --git a/indra/newview/skins/default/xui/en/panel_hint.xml b/indra/newview/skins/default/xui/en/panel_hint.xml index 839dbc58f2..e2e9d0aef0 100644 --- a/indra/newview/skins/default/xui/en/panel_hint.xml +++ b/indra/newview/skins/default/xui/en/panel_hint.xml @@ -9,7 +9,7 @@ top="8" bottom="20" follows="left|right|top" - text_color="White" + text_color="Black" wrap="false"/> <text name="hint_text" left="8" @@ -17,7 +17,7 @@ top="26" bottom="92" follows="all" - text_color="White" + text_color="Black" wrap="true"/> <button right="197" top="8" @@ -25,6 +25,7 @@ height="16" name="close" follows="right|top" + image_color="DkGray" image_unselected="Icon_Close_Foreground" image_selected="Icon_Close_Press"/> </panel> diff --git a/indra/newview/skins/default/xui/en/widgets/hint_popup.xml b/indra/newview/skins/default/xui/en/widgets/hint_popup.xml index a9975941af..92080df154 100644 --- a/indra/newview/skins/default/xui/en/widgets/hint_popup.xml +++ b/indra/newview/skins/default/xui/en/widgets/hint_popup.xml @@ -11,6 +11,7 @@ up_arrow="hint_arrow_up" right_arrow="hint_arrow_right" down_arrow="hint_arrow_down" + lower_left_arrow="hint_arrow_lower_left" left_arrow_offset="3" up_arrow_offset="-2" right_arrow_offset="-3" |