meow-7.2.2
callum 2010-09-13 10:50:40 -07:00
commit d921420a75
17 changed files with 121 additions and 25 deletions

View File

@ -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>

View File

@ -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");

View File

@ -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

View File

@ -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);
@ -320,6 +345,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)
{

View File

@ -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:

View File

@ -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");
}

View File

@ -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"/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -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"

View File

@ -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"

View File

@ -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>

View File

@ -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"