Commit 8d25e465 authored by Kitty Barnett's avatar Kitty Barnett
Browse files

Merged with .Catznip tip

--HG--
branch : Catznip
parents 10d81d37 e3981fe0
a93ea004d7921eaff0531e01cab68a4835a54b90
\ No newline at end of file
dd1e1790c1f4b4b12fa4e8486259d10edfd91180
\ No newline at end of file
......@@ -10997,6 +10997,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>NameTagOffset</key>
<map>
<key>Comment</key>
<string>Height-offset for avatars' name tags</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>0.0</real>
</map>
<key>NameTagShowGroupTitles</key>
<map>
<key>Comment</key>
......
......@@ -379,12 +379,20 @@ BOOL LLFloaterTexturePicker::postBuild()
mModeSelector->setCommitCallback(onModeSelect, this);
mModeSelector->setSelectedIndex(0, 0);
childSetAction("l_add_btn", LLFloaterTexturePicker::onBtnAdd, this);
childSetAction("l_rem_btn", LLFloaterTexturePicker::onBtnRemove, this);
childSetAction("l_upl_btn", LLFloaterTexturePicker::onBtnUpload, this);
// [SL:KB] - Patch: Control-FilePicker | Checked: Catznip-6.1
childSetAction("l_add_btn", std::bind(&LLFloaterTexturePicker::onBtnAdd, this));
childSetAction("l_rem_btn", std::bind(&LLFloaterTexturePicker::onBtnRemove, this));
childSetAction("l_upl_btn", std::bind(&LLFloaterTexturePicker::onBtnUpload, this));
// /[SL:KB]
// childSetAction("l_add_btn", LLFloaterTexturePicker::onBtnAdd, this);
// childSetAction("l_rem_btn", LLFloaterTexturePicker::onBtnRemove, this);
// childSetAction("l_upl_btn", LLFloaterTexturePicker::onBtnUpload, this);
mLocalScrollCtrl = getChild<LLScrollListCtrl>("l_name_list");
mLocalScrollCtrl->setCommitCallback(onLocalScrollCommit, this);
// [SL:KB] - Patch: Control-FilePicker | Checked: Catznip-6.1
mLocalScrollCtrl->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onLocalScrollCommit, this, _1));
// /[SL:KB]
// mLocalScrollCtrl->setCommitCallback(onLocalScrollCommit, this);
LLLocalBitmapMgr::feedScrollList(mLocalScrollCtrl);
mNoCopyTextureSelected = FALSE;
......@@ -797,34 +805,43 @@ void LLFloaterTexturePicker::onModeSelect(LLUICtrl* ctrl, void *userdata)
self->getChild<LLScrollListCtrl>("l_name_list")->setVisible(!mode);
}
// static
void LLFloaterTexturePicker::onBtnAdd(void* userdata)
{
// [SL:KB] - Patch: Control-FilePicker | Checked: 2012-08-21 (Catznip-3.3)
LLFilePicker::getMultipleOpenFiles(LLFilePicker::FFLOAD_IMAGE,
boost::bind(&LLFloaterTexturePicker::onFilePickerCallback, (LLFloaterTexturePicker*)userdata, _1));
// [/SL:KB]
//// static
//void LLFloaterTexturePicker::onBtnAdd(void* userdata)
//{
// if (LLLocalBitmapMgr::addUnit() == true)
// {
// LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
// LLLocalBitmapMgr::feedScrollList(self->mLocalScrollCtrl);
// }
}
//}
// [SL:KB] - Patch: Control-FilePicker | Checked: 2012-08-21 (Catznip-3.3)
void LLFloaterTexturePicker::onFilePickerCallback(const std::vector<std::string>& files)
void LLFloaterTexturePicker::onBtnAdd()
{
LLFilePicker::getMultipleOpenFiles(LLFilePicker::FFLOAD_IMAGE, boost::bind(&LLFloaterTexturePicker::onFilePickerCallback, getDerivedHandle<LLFloaterTexturePicker>(), _1));
}
void LLFloaterTexturePicker::onFilePickerCallback(LLHandle<LLFloaterTexturePicker> hSelf, const std::vector<std::string>& files)
{
if (LLLocalBitmapMgr::addUnits(files))
{
LLLocalBitmapMgr::feedScrollList(mLocalScrollCtrl);
if (!hSelf.isDead())
{
LLLocalBitmapMgr::feedScrollList(hSelf.get()->mLocalScrollCtrl);
}
}
}
// [/SL:KB]
// static
void LLFloaterTexturePicker::onBtnRemove(void* userdata)
//// static
//void LLFloaterTexturePicker::onBtnRemove(void* userdata)
//{
// LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
// [SL:KB] - Patch: Control-FilePicker | Checked: Catznip-6.1
void LLFloaterTexturePicker::onBtnRemove()
{
LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
LLFloaterTexturePicker* self = this;
// [/SL:KB]
std::vector<LLScrollListItem*> selected_items = self->mLocalScrollCtrl->getAllSelected();
if (!selected_items.empty())
......@@ -847,10 +864,15 @@ void LLFloaterTexturePicker::onBtnRemove(void* userdata)
}
// static
void LLFloaterTexturePicker::onBtnUpload(void* userdata)
//// static
//void LLFloaterTexturePicker::onBtnUpload(void* userdata)
//{
// LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
// [SL:KB] - Patch: Control-FilePicker | Checked: Catznip-6.1
void LLFloaterTexturePicker::onBtnUpload()
{
LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
LLFloaterTexturePicker* self = this;
// [/SL:KB]
std::vector<LLScrollListItem*> selected_items = self->mLocalScrollCtrl->getAllSelected();
if (selected_items.empty())
......@@ -871,10 +893,15 @@ void LLFloaterTexturePicker::onBtnUpload(void* userdata)
}
//static
void LLFloaterTexturePicker::onLocalScrollCommit(LLUICtrl* ctrl, void* userdata)
////static
//void LLFloaterTexturePicker::onLocalScrollCommit(LLUICtrl* ctrl, void* userdata)
//{
// LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
// [SL:KB] - Patch: Control-FilePicker | Checked: Catznip-6.1
void LLFloaterTexturePicker::onLocalScrollCommit(LLUICtrl* ctrl)
{
LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
LLFloaterTexturePicker* self = this;
// [/SL:KB]
std::vector<LLScrollListItem*> selected_items = self->mLocalScrollCtrl->getAllSelected();
bool has_selection = !selected_items.empty();
......
......@@ -384,12 +384,16 @@ class LLFloaterTexturePicker : public LLFloater
void onTextureSelect(const LLTextureEntry& te);
static void onModeSelect(LLUICtrl* ctrl, void *userdata);
static void onBtnAdd(void* userdata);
static void onBtnRemove(void* userdata);
static void onBtnUpload(void* userdata);
static void onLocalScrollCommit(LLUICtrl* ctrl, void* userdata);
// static void onBtnAdd(void* userdata);
// static void onBtnRemove(void* userdata);
// static void onBtnUpload(void* userdata);
// static void onLocalScrollCommit(LLUICtrl* ctrl, void* userdata);
// [SL:KB] - Patch: Control-FilePicker | Checked: Catznip-3.3
void onFilePickerCallback(const std::vector<std::string>& files);
void onBtnAdd();
void onBtnRemove();
void onBtnUpload();
void onLocalScrollCommit(LLUICtrl* ctrl);
static void onFilePickerCallback(LLHandle<LLFloaterTexturePicker> hSelf, const std::vector<std::string>& files);
// [/SL:KB]
void setLocalTextureEnabled(BOOL enabled);
......
......@@ -3541,9 +3541,19 @@ void LLVOAvatar::idleUpdateNameTagPosition(const LLVector3& root_pos_last)
mCurRootToHeadOffset = lerp(mCurRootToHeadOffset, mTargetRootToHeadOffset, LLSmoothInterpolation::getInterpolant(0.2f));
// [SL:KB] - Patch: Settings-NameTagOffset
//static LLCachedControl<F32> name_tag_offset_proj(gSavedSettings, "NameTagOffset", 25.f);
static LLCachedControl<F32> name_tag_offset_fixed(gSavedSettings, "NameTagOffset", 0.f);
// [/SL:KB]
LLVector3 name_position = mRoot->getLastWorldPosition() + (mCurRootToHeadOffset * root_rot);
name_position += (local_camera_up * root_rot) - (projected_vec(local_camera_at * root_rot, camera_to_av));
name_position += pixel_up_vec * NAMETAG_VERTICAL_SCREEN_OFFSET;
// [SL:KB] - Patch: Settings-NameTagOffset
// NOTE: name_tag_offset_proj gives us an offset that's camera-dependent whereas name_tag_offset_fixed is a static screen-space offset
//name_position += pixel_up_vec * name_tag_offset_proj;
name_position[VZ] += name_tag_offset_fixed;
// [/SL:KB]
mNameText->setPositionAgent(name_position);
}
......
......@@ -252,6 +252,34 @@
value="2"
width="75" />
</radio_group>
<slider
control_name="NameTagOffset"
decimal_digits="0"
follows="top|left"
height="16"
increment="0.05"
label="Position: Low"
label_width="80"
layout="topleft"
left="175"
min_val="0"
max_val="1"
name="name_tag_offset"
show_text="false"
top_pad="0"
width="200" />
<text
type="string"
length="1"
follows="left|top"
height="15"
layout="topleft"
left_pad="3"
name="name_tags_textbox"
top_delta="0"
width="125">
High
</text>
<check_box
enabled_control="AvatarNameTagMode"
control_name="RenderNameShowSelf"
......@@ -260,7 +288,7 @@
layout="topleft"
left="155"
name="show_my_name_checkbox1"
top_pad="0"
top_pad="6"
width="100" />
<check_box
control_name="NameTagShowTyping"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment