SOCIAL-717 FIX Artwork for click to move hint

updated resize logic for hint popups to accomodate image size
master
Richard Linden 2011-03-25 19:13:32 -07:00
parent d01afc8a6a
commit f443f3e847
10 changed files with 54 additions and 17 deletions

View File

@ -69,6 +69,7 @@ public:
void setColor(const LLColor4& color) { mColor = color; }
void setImage(LLPointer<LLUIImage> image) { mImagep = image; }
const LLPointer<LLUIImage> getImage() { return mImagep; }
private:
void setIconImageDrawSize() ;

View File

@ -12364,7 +12364,7 @@
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>120.0</real>
<real>1.0</real>
</map>
<key>DestinationGuideHintTimeout</key>
<map>

View File

@ -115,7 +115,11 @@ void LLFirstUse::notMoving(bool enable)
{
// fire off 2 notifications and rely on filtering to select the relevant one
firstUseNotification("FirstNotMoving", enable, "HintMove", LLSD(), LLSD().with("target", "move_btn").with("direction", "top"));
firstUseNotification("FirstNotMoving", enable, "HintMoveArrows", LLSD(), LLSD().with("target", "bottom_tray").with("direction", "top").with("hint_image", "arrow_keys.png").with("down_arrow", ""));
firstUseNotification("FirstNotMoving", enable, "HintMoveClick", LLSD(), LLSD()
.with("target", "nav_bar")
.with("direction", "bottom")
.with("hint_image", "click_to_move.png")
.with("up_arrow", ""));
}
// static

View File

@ -191,6 +191,8 @@ BOOL LLHintPopup::postBuild()
LLRect text_bounds = hint_text.getTextBoundingRect();
S32 delta_height = text_bounds.getHeight() - hint_text.getRect().getHeight();
reshape(getRect().getWidth(), getRect().getHeight() + delta_height);
hint_text.reshape(hint_text.getRect().getWidth(), hint_text.getRect().getHeight() + delta_height);
hint_text.translate(0, -delta_height);
return TRUE;
}
@ -211,6 +213,18 @@ void LLHintPopup::draw()
alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, mFadeInTime, 0.f, 1.f);
}
LLIconCtrl& hint_icon = getChildRef<LLIconCtrl>("hint_image");
LLUIImagePtr hint_image = hint_icon.getImage();
S32 image_height = hint_image.isNull() ? 0 : hint_image->getHeight();
S32 image_width = hint_image.isNull() ? 0 : hint_image->getWidth();
S32 delta_height = image_height - hint_icon.getRect().getHeight();
hint_icon.getParent()->reshape(image_width, image_height);
LLRect hint_rect = getLocalRect();
reshape(hint_rect.getWidth(), hint_rect.getHeight() + delta_height);
{ LLViewDrawContext context(alpha);
if (mTarget.empty())

View File

@ -57,6 +57,7 @@
#include "llviewercontrol.h"
#include "llfloatermediabrowser.h"
#include "llweb.h"
#include "llhints.h"
#include "llinventorymodel.h"
#include "lllandmarkactions.h"
@ -324,6 +325,8 @@ BOOL LLNavigationBar::postBuild()
LLTeleportHistory::getInstance()->setHistoryChangedCallback(
boost::bind(&LLNavigationBar::onTeleportHistoryChanged, this));
LLHints::registerHintTarget("nav_bar", LLView::getHandle());
return TRUE;
}

View File

@ -7034,11 +7034,15 @@ Mute everyone?
</notification>
<notification
name="HintMoveArrows"
name="HintMoveClick"
label="Move"
type="hint"
unique="true">
To walk, use the directional keys on your keyboard. You can run by pressing the Up arrow twice.
Click to Walk
Click anywhere on the ground to walk to that spot.
Click and Drag to Rotate View
Click and drag anywhere on the world to rotate your view
<tag>custom_skin</tag>
</notification>

View File

@ -16,7 +16,7 @@
right="197"
top="26"
bottom="92"
follows="all"
follows="left|right|bottom"
text_color="Black"
wrap="true"/>
<button right="197"

View File

@ -1,33 +1,43 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel
width="205"
width="305"
height="140"
layout="topleft">
<text name="hint_title"
font="SansSerifMedium"
left="8"
right="180"
right="290"
top="8"
bottom="20"
follows="left|right|top"
text_color="Black"
wrap="false"/>
<icon name="hint_image"
left="42"
top="25"
width="115"
height="86"
image_name="arrow_keys.png"
/>
<layout_stack left="0"
top="25"
width="305"
height="0"
follows="all"
orientation="horizontal">
<layout_panel auto_resize="true" width="100"/>
<layout_panel auto_resize="true" width="0">
<icon name="hint_image"
top="0"
left="0"
height="0"
width="0"
follows="all"/>
</layout_panel>
<layout_panel auto_resize="true" width="100"/>
</layout_stack>
<text name="hint_text"
left="8"
right="197"
right="297"
top_pad="5"
bottom="120"
follows="all"
follows="left|right|bottom"
text_color="Black"
wrap="true"/>
<button right="197"
<button right="297"
top="8"
width="16"
height="16"

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@ -2,6 +2,7 @@
<textures version="101">
<texture name="Button_Separator" file_name="bottomtray/button_separator.png" preload="true" />
<texture name="arrow_keys.png"/>
<texture name="click_to_move" file_name="click_to_move.png"/>
<texture name="bottomtray_close_off" file_name="bottomtray/close_off.png" preload="true" />
<texture name="bottomtray_close_over" file_name="bottomtray/close_over.png" preload="true" />
<texture name="bottomtray_close_press" file_name="bottomtray/close_press.png" preload="true" />