Merge viewer-neko

master
Ansariel 2019-07-05 18:04:36 +02:00
commit b69aff5a05
10 changed files with 163 additions and 25 deletions

View File

@ -520,7 +520,7 @@ std::string LLUrlEntrySLURL::getLocation(const std::string &url) const
}
//
// LLUrlEntrySeconlifeURL Describes *secondlife.com/ and *lindenlab.com/ urls to substitute icon 'hand.png' before link
// LLUrlEntrySeconlifeURL Describes *secondlife.com/ *lindenlab.com/ and *tilia-inc.com/ urls to substitute icon 'hand.png' before link
//
LLUrlEntrySecondlifeURL::LLUrlEntrySecondlifeURL()
{
@ -564,7 +564,7 @@ std::string LLUrlEntrySecondlifeURL::getTooltip(const std::string &url) const
}
//
// LLUrlEntrySimpleSecondlifeURL Describes *secondlife.com and *lindenlab.com urls to substitute icon 'hand.png' before link
// LLUrlEntrySimpleSecondlifeURL Describes *secondlife.com *lindenlab.com and *tilia-inc.com urls to substitute icon 'hand.png' before link
//
LLUrlEntrySimpleSecondlifeURL::LLUrlEntrySimpleSecondlifeURL()
{

View File

@ -16189,6 +16189,17 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<real>3</real>
</map>
<key>HUDScaleFactor</key>
<map>
<key>Comment</key>
<string>Scale of HUD attachments</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>1.0</real>
</map>
<key>UIScaleFactor</key>
<map>
<key>Comment</key>

View File

@ -842,6 +842,12 @@ void LLAgentCamera::setCameraZoomFraction(F32 fraction)
startCameraAnimation();
}
F32 LLAgentCamera::getAgentHUDTargetZoom()
{
static LLCachedControl<F32> hud_scale_factor(gSavedSettings, "HUDScaleFactor");
LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
return (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD) ? hud_scale_factor*gAgentCamera.mHUDTargetZoom : hud_scale_factor;
}
//-----------------------------------------------------------------------------
// cameraOrbitAround()

View File

@ -276,6 +276,7 @@ public:
F32 getCameraZoomFraction(); // Get camera zoom as fraction of minimum and maximum zoom
void setCameraZoomFraction(F32 fraction); // Set camera zoom as fraction of minimum and maximum zoom
F32 calcCameraFOVZoomFactor();
F32 getAgentHUDTargetZoom();
//--------------------------------------------------------------------
// Pan

View File

@ -2524,6 +2524,9 @@ void watchdog_llerrs_callback(const std::string &error_string)
{
gLLErrorActivated = true;
gDebugInfo["FatalMessage"] = error_string;
LLAppViewer::instance()->writeDebugInfo();
#ifdef LL_WINDOWS
RaiseException(0,0,0,0);
#else

View File

@ -169,6 +169,53 @@ struct LLDeRezInfo
// Imports
//
//-----------------------------------------------------------------------------
// ~LLSelectionCallbackData()
//-----------------------------------------------------------------------------
LLSelectionCallbackData::LLSelectionCallbackData()
{
LLSelectMgr *instance = LLSelectMgr::getInstance();
LLObjectSelectionHandle selection = instance->getSelection();
if (!selection->getNumNodes())
{
return;
}
mSelectedObjects = new LLObjectSelection();
for (LLObjectSelection::iterator iter = selection->begin();
iter != selection->end();)
{
LLObjectSelection::iterator curiter = iter++;
LLSelectNode *nodep = *curiter;
LLViewerObject* objectp = nodep->getObject();
if (!objectp)
{
mSelectedObjects->mSelectType = SELECT_TYPE_WORLD;
}
else
{
LLSelectNode* new_nodep = new LLSelectNode(*nodep);
mSelectedObjects->addNode(new_nodep);
if (objectp->isHUDAttachment())
{
mSelectedObjects->mSelectType = SELECT_TYPE_HUD;
}
else if (objectp->isAttachment())
{
mSelectedObjects->mSelectType = SELECT_TYPE_ATTACHMENT;
}
else
{
mSelectedObjects->mSelectType = SELECT_TYPE_WORLD;
}
}
}
}
//
// Functions
@ -4656,9 +4703,19 @@ void LLSelectMgr::selectionSetObjectSaleInfo(const LLSaleInfo& sale_info)
void LLSelectMgr::sendAttach(U8 attachment_point, bool replace)
{
LLViewerObject* attach_object = mSelectedObjects->getFirstRootObject();
sendAttach(mSelectedObjects, attachment_point, replace);
}
if (!attach_object || !isAgentAvatarValid() || mSelectedObjects->mSelectType != SELECT_TYPE_WORLD)
void LLSelectMgr::sendAttach(LLObjectSelectionHandle selection_handle, U8 attachment_point, bool replace)
{
if (selection_handle.isNull())
{
return;
}
LLViewerObject* attach_object = selection_handle->getFirstRootObject();
if (!attach_object || !isAgentAvatarValid() || selection_handle->mSelectType != SELECT_TYPE_WORLD)
{
return;
}
@ -4676,6 +4733,7 @@ void LLSelectMgr::sendAttach(U8 attachment_point, bool replace)
}
sendListToRegions(
selection_handle,
"ObjectAttach",
packAgentIDAndSessionAndAttachment,
packObjectIDAndRotation,
@ -4687,6 +4745,7 @@ void LLSelectMgr::sendAttach(U8 attachment_point, bool replace)
// After "ObjectAttach" server will unsubscribe us from properties updates
// so either deselect objects or resend selection after attach packet reaches server
// In case of build_mode LLPanelObjectInventory::refresh() will deal with selection
// Still unsubscribe even in case selection_handle is not current selection
deselectAll();
}
}
@ -5228,7 +5287,17 @@ void LLSelectMgr::packPermissions(LLSelectNode* node, void *user_data)
void LLSelectMgr::sendListToRegions(const std::string& message_name,
void (*pack_header)(void *user_data),
void (*pack_body)(LLSelectNode* node, void *user_data),
void (*log_func)(LLSelectNode* node, void *user_data),
void (*log_func)(LLSelectNode* node, void *user_data),
void *user_data,
ESendType send_type)
{
sendListToRegions(mSelectedObjects, message_name, pack_header, pack_body, log_func, user_data, send_type);
}
void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle,
const std::string& message_name,
void (*pack_header)(void *user_data),
void (*pack_body)(LLSelectNode* node, void *user_data),
void (*log_func)(LLSelectNode* node, void *user_data),
void *user_data,
ESendType send_type)
{
@ -5254,7 +5323,7 @@ void LLSelectMgr::sendListToRegions(const std::string& message_name,
return true;
}
} func;
getSelection()->applyToNodes(&func);
selected_handle->applyToNodes(&func);
std::queue<LLSelectNode*> nodes_to_send;
@ -5297,25 +5366,25 @@ void LLSelectMgr::sendListToRegions(const std::string& message_name,
{
case SEND_ONLY_ROOTS:
if(message_name == "ObjectBuy")
getSelection()->applyToRootNodes(&pushroots);
selected_handle->applyToRootNodes(&pushroots);
else
getSelection()->applyToRootNodes(&pushall);
selected_handle->applyToRootNodes(&pushall);
break;
case SEND_INDIVIDUALS:
getSelection()->applyToNodes(&pushall);
selected_handle->applyToNodes(&pushall);
break;
case SEND_ROOTS_FIRST:
// first roots...
getSelection()->applyToNodes(&pushroots);
selected_handle->applyToNodes(&pushroots);
// then children...
getSelection()->applyToNodes(&pushnonroots);
selected_handle->applyToNodes(&pushnonroots);
break;
case SEND_CHILDREN_FIRST:
// first children...
getSelection()->applyToNodes(&pushnonroots);
selected_handle->applyToNodes(&pushnonroots);
// then roots...
getSelection()->applyToNodes(&pushroots);
selected_handle->applyToNodes(&pushroots);
break;
default:
@ -6882,8 +6951,7 @@ void LLSelectMgr::updateSelectionCenter()
if (mSelectedObjects->mSelectType != SELECT_TYPE_HUD && isAgentAvatarValid())
{
// reset hud ZOOM
gAgentCamera.mHUDTargetZoom = 1.f;
gAgentCamera.mHUDCurZoom = 1.f;
resetAgentHUDZoom();
}
mShowSelection = FALSE;
@ -7323,8 +7391,11 @@ BOOL LLSelectMgr::setForceSelection(BOOL force)
void LLSelectMgr::resetAgentHUDZoom()
{
gAgentCamera.mHUDTargetZoom = 1.f;
gAgentCamera.mHUDCurZoom = 1.f;
if (gAgentCamera.mHUDTargetZoom != 1)
{
gAgentCamera.mHUDTargetZoom = 1.f;
gAgentCamera.mHUDCurZoom = 1.f;
}
}
void LLSelectMgr::getAgentHUDZoom(F32 &target_zoom, F32 &current_zoom) const

View File

@ -264,6 +264,7 @@ class LLObjectSelection : public LLRefCount
{
friend class LLSelectMgr;
friend class LLSafeHandle<LLObjectSelection>;
friend class LLSelectionCallbackData;
protected:
~LLObjectSelection();
@ -466,6 +467,16 @@ namespace nd
}
// </FS:ND>
// temporary storage, Ex: to attach objects after autopilot
class LLSelectionCallbackData
{
public:
LLSelectionCallbackData();
LLObjectSelectionHandle getSelection() { return mSelectedObjects; }
private:
LLObjectSelectionHandle mSelectedObjects;
};
class LLSelectMgr : public LLEditMenuHandler, public LLSingleton<LLSelectMgr>, public nd::selection::PropertiesServer
{
LLSINGLETON(LLSelectMgr);
@ -819,6 +830,7 @@ public:
// canceled
void sendBuy(const LLUUID& buyer_id, const LLUUID& category_id, const LLSaleInfo sale_info);
void sendAttach(U8 attachment_point, bool replace);
void sendAttach(LLObjectSelectionHandle selection_handle, U8 attachment_point, bool replace);
void sendDetach();
void sendDropAttachment();
void sendLink();
@ -866,6 +878,13 @@ private:
void (*log_func)(LLSelectNode* node, void *user_data),
void *user_data,
ESendType send_type);
void sendListToRegions( LLObjectSelectionHandle selected_handle,
const std::string& message_name,
void (*pack_header)(void *user_data),
void (*pack_body)(LLSelectNode* node, void *user_data),
void (*log_func)(LLSelectNode* node, void *user_data),
void *user_data,
ESendType send_type);
static void packAgentID( void *);

View File

@ -1221,7 +1221,7 @@ void render_hud_attachments()
// [/RLVa:KB]
// smoothly interpolate current zoom level
gAgentCamera.mHUDCurZoom = lerp(gAgentCamera.mHUDCurZoom, gAgentCamera.mHUDTargetZoom, LLSmoothInterpolation::getInterpolant(0.03f));
gAgentCamera.mHUDCurZoom = lerp(gAgentCamera.mHUDCurZoom, gAgentCamera.getAgentHUDTargetZoom(), LLSmoothInterpolation::getInterpolant(0.03f));
if (LLPipeline::sShowHUDAttachments && !gDisconnected && setup_hud_matrices())
{

View File

@ -8292,10 +8292,10 @@ private:
static void onNearAttachObject(BOOL success, void *user_data);
void confirmReplaceAttachment(S32 option, LLViewerJointAttachment* attachment_point);
struct CallbackData
class CallbackData : public LLSelectionCallbackData
{
CallbackData(LLViewerJointAttachment* point, bool replace) : mAttachmentPoint(point), mReplace(replace) {}
public:
CallbackData(LLViewerJointAttachment* point, bool replace) : LLSelectionCallbackData(), mAttachmentPoint(point), mReplace(replace) {}
LLViewerJointAttachment* mAttachmentPoint;
bool mReplace;
@ -8336,8 +8336,8 @@ void LLObjectAttachToAvatar::onNearAttachObject(BOOL success, void *user_data)
// interpret 0 as "default location"
attachment_id = 0;
}
LLSelectMgr::getInstance()->sendAttach(attachment_id, cb_data->mReplace);
}
LLSelectMgr::getInstance()->sendAttach(cb_data->getSelection(), attachment_id, cb_data->mReplace);
}
LLObjectAttachToAvatar::setObjectSelection(NULL);
delete cb_data;

View File

@ -253,7 +253,7 @@
left="10"
name="UI Size:"
top_pad="8"
width="60">
width="80">
UI Scaling:
</text>
<slider
@ -271,10 +271,37 @@
top_pad="-14"
width="390" />
<text
type="string"
length="1"
follows="left|top"
height="12"
layout="topleft"
left="10"
name="HUD Size:"
top_pad="5"
width="80">
HUD Scaling:
</text>
<slider
control_name="HUDScaleFactor"
decimal_digits="2"
follows="left|top"
height="17"
increment="0.1"
initial_value="1"
layout="topleft"
left_pad="0"
max_val="2.0"
min_val="1.0"
name="ui_scale_slider"
top_pad="-14"
width="390" />
<text
type="string"
left="10"
top_pad="20"
top_pad="15"
width="140"
follows="left|top"
height="16"