Merge viewer-neko

meow-7.2.2
Ansariel 2019-10-16 00:41:04 +02:00
commit a94d482dd4
10 changed files with 61 additions and 37 deletions

View File

@ -71,7 +71,6 @@ private:
bool onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password);
void onCursorChangedCallback(dullahan::ECursorType type);
const std::vector<std::string> onFileDialog(dullahan::EFileDialogType dialog_type, const std::string dialog_title, const std::string default_file, const std::string dialog_accept_filter, bool& use_default);
bool onJSDialogCallback(const std::string origin_url, const std::string message_text, const std::string default_prompt_text);
void postDebugMessage(const std::string& msg);
void authResponse(LLPluginMessage &message);
@ -359,14 +358,6 @@ const std::vector<std::string> MediaPluginCEF::onFileDialog(dullahan::EFileDialo
return std::vector<std::string>();
}
////////////////////////////////////////////////////////////////////////////////
//
bool MediaPluginCEF::onJSDialogCallback(const std::string origin_url, const std::string message_text, const std::string default_prompt_text)
{
// return true indicates we suppress the JavaScript alert UI entirely
return true;
}
////////////////////////////////////////////////////////////////////////////////
//
void MediaPluginCEF::onCursorChangedCallback(dullahan::ECursorType type)
@ -512,7 +503,6 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
mCEFLib->setOnFileDialogCallback(std::bind(&MediaPluginCEF::onFileDialog, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5));
mCEFLib->setOnCursorChangedCallback(std::bind(&MediaPluginCEF::onCursorChangedCallback, this, std::placeholders::_1));
mCEFLib->setOnRequestExitCallback(std::bind(&MediaPluginCEF::onRequestExitCallback, this));
mCEFLib->setOnJSDialogCallback(std::bind(&MediaPluginCEF::onJSDialogCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
dullahan::dullahan_settings settings;
settings.accept_language_list = mHostLanguage;

View File

@ -489,7 +489,7 @@ void LLFloaterModelPreview::initModelPreview()
mModelPreview = new LLModelPreview(tex_width, tex_height, this);
mModelPreview->setPreviewTarget(16.f);
mModelPreview->setDetailsCallback(boost::bind(&LLFloaterModelPreview::setDetails, this, _1, _2, _3, _4, _5));
mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, _1));
mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::modelUpdated, this, _1));
}
void LLFloaterModelPreview::onUploadOptionChecked(LLUICtrl* ctrl)
@ -599,7 +599,8 @@ void LLFloaterModelPreview::onClickCalculateBtn()
mModelPreview->getPreviewAvatar()->showAttachmentOverrides();
}
mUploadModelUrl.clear();
mUploadModelUrl.clear();
mModelPhysicsFee.clear();
gMeshRepo.uploadModel(mModelPreview->mUploadData, mModelPreview->mPreviewScale,
childGetValue("upload_textures").asBoolean(),
@ -4915,6 +4916,12 @@ void LLFloaterModelPreview::setStatusMessage(const std::string& msg)
mStatusMessage = msg;
}
void LLFloaterModelPreview::modelUpdated(bool calculate_visible)
{
mModelPhysicsFee.clear();
toggleCalculateButton(calculate_visible);
}
void LLFloaterModelPreview::toggleCalculateButton(bool visible)
{
mCalculateBtn->setVisible(visible);
@ -4940,7 +4947,10 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible)
childSetTextArg("download_weight", "[ST]", tbd);
childSetTextArg("server_weight", "[SIM]", tbd);
childSetTextArg("physics_weight", "[PH]", tbd);
childSetTextArg("upload_fee", "[FEE]", tbd);
if (!mModelPhysicsFee.isMap() || mModelPhysicsFee.emptyMap())
{
childSetTextArg("upload_fee", "[FEE]", tbd);
}
std::string dashes = hasString("--") ? getString("--") : "--";
childSetTextArg("price_breakdown", "[STREAMING]", dashes);
childSetTextArg("price_breakdown", "[PHYSICS]", dashes);
@ -5045,10 +5055,21 @@ void LLFloaterModelPreview::handleModelPhysicsFeeReceived()
mUploadBtn->setEnabled(isModelUploadAllowed());
}
void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason)
void LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result)
{
LL_WARNS() << "LLFloaterModelPreview::setModelPhysicsFeeErrorStatus(" << status << " : " << reason << ")" << LL_ENDL;
doOnIdleOneTime(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, true));
if (result.has("upload_price"))
{
mModelPhysicsFee = result;
childSetTextArg("upload_fee", "[FEE]", llformat("%d", result["upload_price"].asInteger()));
childSetVisible("upload_fee", true);
}
else
{
mModelPhysicsFee.clear();
}
}
/*virtual*/

View File

@ -126,7 +126,7 @@ public:
/*virtual*/ void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url);
void handleModelPhysicsFeeReceived();
/*virtual*/ void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason);
/*virtual*/ void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result);
/*virtual*/ void onModelUploadSuccess();
@ -210,6 +210,8 @@ private:
void onLoDSourceCommit(S32 lod);
void modelUpdated(bool calculate_visible);
// Toggles between "Calculate weights & fee" and "Upload" buttons.
void toggleCalculateButton(bool visible);

View File

@ -45,7 +45,7 @@ public:
virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0;
virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) = 0;
virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result) = 0;
virtual void onModelUploadSuccess() {};

View File

@ -214,8 +214,7 @@ BOOL LLMediaCtrl::handleScrollHWheel(S32 x, S32 y, S32 clicks)
if (LLPanel::handleScrollHWheel(x, y, clicks)) return TRUE;
if (mMediaSource && mMediaSource->hasMedia())
{
convertInputCoords(x, y);
mMediaSource->scrollWheel(x, y, clicks, 0, gKeyboard->currentMask(TRUE));
mMediaSource->getMediaPlugin()->scrollEvent(clicks, 0, gKeyboard->currentMask(TRUE));
}
return TRUE;
@ -443,18 +442,18 @@ void LLMediaCtrl::onOpenWebInspector()
////////////////////////////////////////////////////////////////////////////////
//
BOOL LLMediaCtrl::handleKeyHere(KEY key, MASK mask)
BOOL LLMediaCtrl::handleKeyHere( KEY key, MASK mask )
{
BOOL result = FALSE;
if (mMediaSource)
{
result = mMediaSource->handleKeyHere(key, mask);
}
if (!result)
if ( ! result )
result = LLPanel::handleKeyHere(key, mask);
return result;
}
@ -616,8 +615,6 @@ void LLMediaCtrl::navigateTo( std::string url_in, std::string mime_type, bool cl
// LL_INFOS() << "Rejecting attempt to load restricted website :" << urlIn << LL_ENDL;
return;
}
if (ensureMediaSourceExists())
{

View File

@ -2873,7 +2873,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp
if (observer)
{
observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason);
observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason, body["error"]);
}
}
else
@ -2906,7 +2906,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp
if (observer)
{
observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason);
observer->setModelPhysicsFeeErrorStatus(status.toULong(), reason, body["error"]);
}
}
}

View File

@ -82,8 +82,11 @@
#include <boost/bind.hpp>
// "Features" Tab
const F32 DEFAULT_GRAVITY_MULTIPLIER = 1.f;
const F32 DEFAULT_DENSITY = 1000.f;
// "Features" Tab
BOOL LLPanelVolume::postBuild()
{
// Flexible Objects Parameters
@ -833,7 +836,7 @@ void LLPanelVolume::onLightSelectTexture(const LLSD& data)
// static
void LLPanelVolume::onCommitMaterial( LLUICtrl* ctrl, void* userdata )
{
//LLPanelObject* self = (LLPanelObject*) userdata;
LLPanelVolume* self = (LLPanelVolume*)userdata;
LLComboBox* box = (LLComboBox*) ctrl;
if (box)
@ -844,6 +847,19 @@ void LLPanelVolume::onCommitMaterial( LLUICtrl* ctrl, void* userdata )
if (material_name != LEGACY_FULLBRIGHT_DESC)
{
U8 material_code = LLMaterialTable::basic.getMCode(material_name);
if (self)
{
LLViewerObject* objectp = self->mObject;
if (objectp)
{
objectp->setPhysicsGravity(DEFAULT_GRAVITY_MULTIPLIER);
objectp->setPhysicsFriction(LLMaterialTable::basic.getFriction(material_code));
//currently density is always set to 1000 serverside regardless of chosen material,
//actual material density should be used here, if this behavior change
objectp->setPhysicsDensity(DEFAULT_DENSITY);
objectp->setPhysicsRestitution(LLMaterialTable::basic.getRestitution(material_code));
}
}
LLSelectMgr::getInstance()->selectionSetMaterial(material_code);
}
}

View File

@ -53,7 +53,7 @@ public:
virtual ~LLWholeModelFeeObserver() {}
virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0;
virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason) = 0;
virtual void setModelPhysicsFeeErrorStatus(S32 status, const std::string& reason, const LLSD& result) = 0;
LLHandle<LLWholeModelFeeObserver> getWholeModelFeeObserverHandle() const { return mWholeModelFeeObserverHandle; }

View File

@ -456,6 +456,11 @@ void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_
LL_INFOS("Messaging") << "give_money(" << uuid << "," << amount << ")"<< LL_ENDL;
if(can_afford_transaction(amount))
{
if (uuid.isNull())
{
LL_WARNS() << "Failed to send L$ gift to to Null UUID." << LL_ENDL;
return;
}
// gStatusBar->debitBalance(amount);
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_MoneyTransferRequest);

View File

@ -8130,13 +8130,6 @@ void LLVOAvatar::sitOnObject(LLViewerObject *sit_object)
if (root_object == sit_object)
{
LLFloaterTools::sPreviousFocusOnAvatar = true;
if (!gSavedSettings.getBOOL("EditCameraMovement"))
{
// always freeze camera in space, even if camera doesn't move
// so, for example, follow cam scripts can't affect you when in build mode
gAgentCamera.setFocusGlobal(gAgentCamera.calcFocusPositionTargetGlobal(), LLUUID::null);
gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
}
}
}
}