merge storm-2082 changes
commit
53fb7f9998
|
|
@ -719,6 +719,7 @@ Jonathan Yap
|
|||
STORM-2030
|
||||
STORM-2034
|
||||
STORM-2018
|
||||
STORM-2082
|
||||
Kadah Coba
|
||||
STORM-1060
|
||||
STORM-1843
|
||||
|
|
|
|||
|
|
@ -230,6 +230,7 @@ set(viewer_SOURCE_FILES
|
|||
llfloaterconversationlog.cpp
|
||||
llfloaterconversationpreview.cpp
|
||||
llfloaterdeleteenvpreset.cpp
|
||||
llfloaterdeleteprefpreset.cpp
|
||||
llfloaterdestinations.cpp
|
||||
llfloaterdisplayname.cpp
|
||||
llfloatereditdaycycle.cpp
|
||||
|
|
@ -247,7 +248,6 @@ set(viewer_SOURCE_FILES
|
|||
llfloatergroupinvite.cpp
|
||||
llfloatergroups.cpp
|
||||
llfloaterhandler.cpp
|
||||
llfloaterhardwaresettings.cpp
|
||||
llfloaterhelpbrowser.cpp
|
||||
llfloaterhud.cpp
|
||||
llfloaterimagepreview.cpp
|
||||
|
|
@ -260,6 +260,7 @@ set(viewer_SOURCE_FILES
|
|||
llfloaterlagmeter.cpp
|
||||
llfloaterland.cpp
|
||||
llfloaterlandholdings.cpp
|
||||
llfloaterloadprefpreset.cpp
|
||||
llfloatermap.cpp
|
||||
llfloatermediasettings.cpp
|
||||
llfloatermemleak.cpp
|
||||
|
|
@ -283,6 +284,7 @@ set(viewer_SOURCE_FILES
|
|||
llfloaterregioninfo.cpp
|
||||
llfloaterreporter.cpp
|
||||
llfloaterregionrestarting.cpp
|
||||
llfloatersaveprefpreset.cpp
|
||||
llfloatersceneloadstats.cpp
|
||||
llfloaterscriptdebug.cpp
|
||||
llfloaterscriptedprefs.cpp
|
||||
|
|
@ -456,6 +458,7 @@ set(viewer_SOURCE_FILES
|
|||
llpanelplaceprofile.cpp
|
||||
llpanelplaces.cpp
|
||||
llpanelplacestab.cpp
|
||||
llpanelpresetspulldown.cpp
|
||||
llpanelprimmediacontrols.cpp
|
||||
llpanelprofile.cpp
|
||||
llpanelsnapshot.cpp
|
||||
|
|
@ -495,6 +498,7 @@ set(viewer_SOURCE_FILES
|
|||
llplacesfolderview.cpp
|
||||
llpopupview.cpp
|
||||
llpostcard.cpp
|
||||
llpresetsmanager.cpp
|
||||
llpreview.cpp
|
||||
llpreviewanim.cpp
|
||||
llpreviewgesture.cpp
|
||||
|
|
@ -834,6 +838,7 @@ set(viewer_HEADER_FILES
|
|||
llfloatercolorpicker.h
|
||||
llfloaterconversationlog.h
|
||||
llfloaterconversationpreview.h
|
||||
llfloaterdeleteprefpreset.h
|
||||
llfloaterdeleteenvpreset.h
|
||||
llfloaterdestinations.h
|
||||
llfloaterdisplayname.h
|
||||
|
|
@ -852,7 +857,6 @@ set(viewer_HEADER_FILES
|
|||
llfloatergroupinvite.h
|
||||
llfloatergroups.h
|
||||
llfloaterhandler.h
|
||||
llfloaterhardwaresettings.h
|
||||
llfloaterhelpbrowser.h
|
||||
llfloaterhud.h
|
||||
llfloaterimagepreview.h
|
||||
|
|
@ -868,6 +872,7 @@ set(viewer_HEADER_FILES
|
|||
llfloaterlagmeter.h
|
||||
llfloaterland.h
|
||||
llfloaterlandholdings.h
|
||||
llfloaterloadprefpreset.h
|
||||
llfloatermap.h
|
||||
llfloatermediasettings.h
|
||||
llfloatermemleak.h
|
||||
|
|
@ -891,6 +896,7 @@ set(viewer_HEADER_FILES
|
|||
llfloaterregioninfo.h
|
||||
llfloaterreporter.h
|
||||
llfloaterregionrestarting.h
|
||||
llfloatersaveprefpreset.h
|
||||
llfloatersceneloadstats.h
|
||||
llfloaterscriptdebug.h
|
||||
llfloaterscriptedprefs.h
|
||||
|
|
@ -1055,6 +1061,7 @@ set(viewer_HEADER_FILES
|
|||
llpanelplaceprofile.h
|
||||
llpanelplaces.h
|
||||
llpanelplacestab.h
|
||||
llpanelpresetspulldown.h
|
||||
llpanelprimmediacontrols.h
|
||||
llpanelprofile.h
|
||||
llpanelsnapshot.h
|
||||
|
|
@ -1089,6 +1096,7 @@ set(viewer_HEADER_FILES
|
|||
llplacesfolderview.h
|
||||
llpopupview.h
|
||||
llpostcard.h
|
||||
llpresetsmanager.h
|
||||
llpreview.h
|
||||
llpreviewanim.h
|
||||
llpreviewgesture.h
|
||||
|
|
|
|||
|
|
@ -26,8 +26,11 @@
|
|||
<RenderTerrainLODFactor value="2"/>
|
||||
<!--Default for now-->
|
||||
<RenderTreeLODFactor value="0.5"/>
|
||||
<!--Try Impostors-->
|
||||
<!--Avater Impostors and Visual Muting Limits-->
|
||||
<RenderUseImpostors value="TRUE"/>
|
||||
<RenderAvatarMaxVisible value="20"/>
|
||||
<RenderAutoMuteRenderWeightLimit value="350000"/>
|
||||
<RenderAutoMuteSurfaceAreaLimit value="300"/>
|
||||
<!--Default for now-->
|
||||
<RenderVolumeLODFactor value="1.125"/>
|
||||
<!--NO SHADERS-->
|
||||
|
|
|
|||
|
|
@ -28,8 +28,11 @@
|
|||
<RenderTerrainLODFactor value="1.0"/>
|
||||
<!--Default for now-->
|
||||
<RenderTreeLODFactor value="0.5"/>
|
||||
<!--Try Impostors-->
|
||||
<!--Avater Impostors and Visual Muting Limits-->
|
||||
<RenderUseImpostors value="TRUE"/>
|
||||
<RenderAvatarMaxVisible value="12"/>
|
||||
<RenderAutoMuteRenderWeightLimit value="75000"/>
|
||||
<RenderAutoMuteSurfaceAreaLimit value="150"/>
|
||||
<!--Default for now-->
|
||||
<RenderVolumeLODFactor value="1.125"/>
|
||||
<!--NO SHADERS-->
|
||||
|
|
|
|||
|
|
@ -26,8 +26,11 @@
|
|||
<RenderTerrainLODFactor value="1.0"/>
|
||||
<!--Default for now-->
|
||||
<RenderTreeLODFactor value="0.5"/>
|
||||
<!--Try Impostors-->
|
||||
<!--Avater Impostors and Visual Muting Limits-->
|
||||
<RenderUseImpostors value="TRUE"/>
|
||||
<RenderAvatarMaxVisible value="18"/>
|
||||
<RenderAutoMuteRenderWeightLimit value="100000"/>
|
||||
<RenderAutoMuteSurfaceAreaLimit value="200"/>
|
||||
<!--Default for now-->
|
||||
<RenderVolumeLODFactor value="1.125"/>
|
||||
<!--NO SHADERS-->
|
||||
|
|
|
|||
|
|
@ -8202,17 +8202,6 @@
|
|||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>RenderAvatarComplexityLimit</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Max visual complexity of avatars in a scene</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>S32</string>
|
||||
<key>Value</key>
|
||||
<integer>-1</integer>
|
||||
</map>
|
||||
<key>RenderComplexityColorMin</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -8298,7 +8287,9 @@
|
|||
<key>RenderAvatarMaxVisible</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Maximum number of avatars to display at any one time</string>
|
||||
<string>Maximum number of avatars to fully render at one time;
|
||||
over this limit uses impostor rendering (simplified rendering
|
||||
with less frequent updates)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
|
|
@ -9737,13 +9728,13 @@
|
|||
<key>RenderTerrainDetail</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Detail applied to terrain texturing (0 = none, 1 or 2 = full)</string>
|
||||
<string>Detail applied to terrain texturing (0 = none, 1 = full)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>S32</string>
|
||||
<key>Value</key>
|
||||
<integer>2</integer>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>RenderTerrainLODFactor</key>
|
||||
<map>
|
||||
|
|
@ -9887,7 +9878,7 @@
|
|||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
<integer>10000000</integer>
|
||||
</map>
|
||||
<key>RenderAutoMuteRenderWeightLimit</key>
|
||||
<map>
|
||||
|
|
@ -9911,17 +9902,6 @@
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>RenderAutoMuteFunctions</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Developing feature to render some avatars using simple impostors or colored silhouettes. (Set to 7 for all functionality)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<real>0</real>
|
||||
</map>
|
||||
<key>RenderAutoMuteLogging</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -9942,7 +9922,7 @@
|
|||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
<real>1.0E6</real>
|
||||
</map>
|
||||
|
||||
<key>RenderVBOEnable</key>
|
||||
|
|
@ -10529,17 +10509,6 @@
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>ShowAdvancedGraphicsSettings</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Show advanced graphics settings</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>ShowAllObjectHoverTip</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
@ -15595,7 +15564,28 @@
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
|
||||
<key>PresetGraphicActive</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Name of currently selected preference</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string />
|
||||
</map>
|
||||
<key>MaximumARC</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Controls RenderAutoMuteRenderWeightLimit in a non-linear fashion</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
</map>
|
||||
</llsd>
|
||||
|
||||
|
|
|
|||
|
|
@ -26,8 +26,11 @@
|
|||
<RenderTerrainLODFactor value="2.0"/>
|
||||
<!--Default for now-->
|
||||
<RenderTreeLODFactor value="1.0"/>
|
||||
<!--Try Impostors-->
|
||||
<!--Avater Impostors and Visual Muting Limits-->
|
||||
<RenderUseImpostors value="TRUE"/>
|
||||
<RenderAvatarMaxVisible value="0"/>
|
||||
<RenderAutoMuteRenderWeightLimit value="0"/>
|
||||
<RenderAutoMuteSurfaceAreaLimit value="10000"/>
|
||||
<!--Default for now-->
|
||||
<RenderVolumeLODFactor value="2.0"/>
|
||||
<!--NO SHADERS-->
|
||||
|
|
|
|||
|
|
@ -5095,7 +5095,7 @@ void LLAppViewer::idle()
|
|||
}
|
||||
|
||||
// Update AV render info
|
||||
LLAvatarRenderInfoAccountant::idle();
|
||||
LLAvatarRenderInfoAccountant::getInstance()->idle();
|
||||
|
||||
{
|
||||
LL_RECORD_BLOCK_TIME(FTM_AUDIO_UPDATE);
|
||||
|
|
|
|||
|
|
@ -28,14 +28,16 @@
|
|||
|
||||
// Precompiled header
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
// associated header
|
||||
#include "llavatarrenderinfoaccountant.h"
|
||||
// STL headers
|
||||
// std headers
|
||||
// external library headers
|
||||
// other Linden headers
|
||||
#include "llcharacter.h"
|
||||
#include "llhttpclient.h"
|
||||
#include "httprequest.h"
|
||||
#include "httphandler.h"
|
||||
#include "httpresponse.h"
|
||||
#include "llcorehttputil.h"
|
||||
#include "llappcorehttp.h"
|
||||
#include "lltimer.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewermenu.h"
|
||||
|
|
@ -43,6 +45,8 @@
|
|||
#include "llviewerregion.h"
|
||||
#include "llvoavatar.h"
|
||||
#include "llworld.h"
|
||||
// associated header
|
||||
#include "llavatarrenderinfoaccountant.h"
|
||||
|
||||
|
||||
static const std::string KEY_AGENTS = "agents"; // map
|
||||
|
|
@ -53,223 +57,259 @@ static const std::string KEY_MESSAGE = "message";
|
|||
static const std::string KEY_ERROR = "error";
|
||||
|
||||
|
||||
// Send data updates about once per minute, only need per-frame resolution
|
||||
LLFrameTimer LLAvatarRenderInfoAccountant::sRenderInfoReportTimer;
|
||||
static const F32 SECS_BETWEEN_REGION_SCANS = 5.f; // Scan the region list every 5 seconds
|
||||
static const F32 SECS_BETWEEN_REGION_REQUEST = 15.0; // Look for new avs every 15 seconds
|
||||
static const F32 SECS_BETWEEN_REGION_REPORTS = 60.0; // Update each region every 60 seconds
|
||||
|
||||
|
||||
// The policy class for HTTP traffic; this is the right value for all capability requests.
|
||||
static LLCore::HttpRequest::policy_t http_policy(LLAppCoreHttp::AP_REPORTING);
|
||||
|
||||
// Priority for HTTP requests. Use 0U.
|
||||
static LLCore::HttpRequest::priority_t http_priority(0U);
|
||||
|
||||
LLAvatarRenderInfoAccountant::LLAvatarRenderInfoAccountant()
|
||||
: mHttpRequest(new LLCore::HttpRequest)
|
||||
, mHttpHeaders(new LLCore::HttpHeaders)
|
||||
, mHttpOptions(new LLCore::HttpOptions)
|
||||
{
|
||||
mHttpOptions->setTransferTimeout(SECS_BETWEEN_REGION_SCANS);
|
||||
|
||||
mHttpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_LLSD_XML);
|
||||
mHttpHeaders->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_LLSD_XML);
|
||||
}
|
||||
|
||||
LLAvatarRenderInfoAccountant::~LLAvatarRenderInfoAccountant()
|
||||
{
|
||||
mHttpOptions->release();
|
||||
mHttpHeaders->release();
|
||||
// delete mHttpRequest; ???
|
||||
}
|
||||
|
||||
// HTTP responder class for GET request for avatar render weight information
|
||||
class LLAvatarRenderInfoGetResponder : public LLHTTPClient::Responder
|
||||
class LLAvatarRenderInfoGetHandler : public LLCore::HttpHandler
|
||||
{
|
||||
private:
|
||||
LOG_CLASS(LLAvatarRenderInfoGetHandler);
|
||||
|
||||
public:
|
||||
LLAvatarRenderInfoGetResponder(U64 region_handle) : mRegionHandle(region_handle)
|
||||
LLAvatarRenderInfoGetHandler() : LLCore::HttpHandler()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void error(U32 statusNum, const std::string& reason)
|
||||
{
|
||||
LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
|
||||
if (regionp)
|
||||
void onCompleted(LLCore::HttpHandle handle,
|
||||
LLCore::HttpResponse* response)
|
||||
{
|
||||
LL_WARNS() << "HTTP error result for avatar weight GET: " << statusNum
|
||||
<< ", " << reason
|
||||
<< " returned by region " << regionp->getName()
|
||||
<< LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Avatar render weight GET error recieved but region not found for "
|
||||
<< mRegionHandle
|
||||
<< ", error " << statusNum
|
||||
<< ", " << reason
|
||||
<< LL_ENDL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
virtual void result(const LLSD& content)
|
||||
{
|
||||
LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
|
||||
if (regionp)
|
||||
{
|
||||
if (LLAvatarRenderInfoAccountant::logRenderInfo())
|
||||
{
|
||||
LL_INFOS() << "LRI: Result for avatar weights request for region " << regionp->getName() << ":" << LL_ENDL;
|
||||
}
|
||||
|
||||
if (content.isMap())
|
||||
{
|
||||
if (content.has(KEY_AGENTS))
|
||||
LLCore::HttpStatus status = response->getStatus();
|
||||
if (status)
|
||||
{
|
||||
LLSD avatar_render_info;
|
||||
if (LLCoreHttpUtil::responseToLLSD(response, false /* quiet logging */,
|
||||
avatar_render_info))
|
||||
{
|
||||
const LLSD & agents = content[KEY_AGENTS];
|
||||
if (agents.isMap())
|
||||
if (avatar_render_info.isMap())
|
||||
{
|
||||
LLSD::map_const_iterator report_iter = agents.beginMap();
|
||||
while (report_iter != agents.endMap())
|
||||
if (avatar_render_info.has(KEY_AGENTS))
|
||||
{
|
||||
LLUUID target_agent_id = LLUUID(report_iter->first);
|
||||
const LLSD & agent_info_map = report_iter->second;
|
||||
LLViewerObject* avatarp = gObjectList.findObject(target_agent_id);
|
||||
if (avatarp &&
|
||||
avatarp->isAvatar() &&
|
||||
agent_info_map.isMap())
|
||||
{ // Extract the data for this avatar
|
||||
|
||||
if (LLAvatarRenderInfoAccountant::logRenderInfo())
|
||||
const LLSD & agents = avatar_render_info[KEY_AGENTS];
|
||||
if (agents.isMap())
|
||||
{
|
||||
for (LLSD::map_const_iterator agent_iter = agents.beginMap();
|
||||
agent_iter != agents.endMap();
|
||||
agent_iter++
|
||||
)
|
||||
{
|
||||
LL_INFOS() << "LRI: Agent " << target_agent_id
|
||||
<< ": " << agent_info_map << LL_ENDL;
|
||||
}
|
||||
LLUUID target_agent_id = LLUUID(agent_iter->first);
|
||||
LLViewerObject* avatarp = gObjectList.findObject(target_agent_id);
|
||||
if (avatarp && avatarp->isAvatar())
|
||||
{
|
||||
const LLSD & agent_info_map = agent_iter->second;
|
||||
if (agent_info_map.isMap())
|
||||
{
|
||||
LL_DEBUGS("AvatarRenderInfo") << " Agent " << target_agent_id
|
||||
<< ": " << agent_info_map << LL_ENDL;
|
||||
|
||||
if (agent_info_map.has(KEY_WEIGHT))
|
||||
{
|
||||
((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger());
|
||||
}
|
||||
if (agent_info_map.has(KEY_WEIGHT))
|
||||
{
|
||||
((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS("AvatarRenderInfo") << "agent entry invalid"
|
||||
<< " agent " << target_agent_id
|
||||
<< " map " << agent_info_map
|
||||
<< LL_ENDL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_DEBUGS("AvatarRenderInfo") << "Unknown agent " << target_agent_id << LL_ENDL;
|
||||
}
|
||||
} // for agent_iter
|
||||
}
|
||||
report_iter++;
|
||||
else
|
||||
{
|
||||
LL_WARNS("AvatarRenderInfo") << "malformed get response agents avatar_render_info is not map" << LL_ENDL;
|
||||
}
|
||||
} // has "agents"
|
||||
else if (avatar_render_info.has(KEY_ERROR))
|
||||
{
|
||||
const LLSD & error = avatar_render_info[KEY_ERROR];
|
||||
LL_WARNS("AvatarRenderInfo") << "Avatar render info GET error: "
|
||||
<< error[KEY_IDENTIFIER]
|
||||
<< ": " << error[KEY_MESSAGE]
|
||||
<< LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS("AvatarRenderInfo") << "no agent key in get response" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
} // has "agents"
|
||||
else if (content.has(KEY_ERROR))
|
||||
else
|
||||
{
|
||||
LL_WARNS("AvatarRenderInfo") << "malformed get response is not map" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const LLSD & error = content[KEY_ERROR];
|
||||
LL_WARNS() << "Avatar render info GET error: "
|
||||
<< error[KEY_IDENTIFIER]
|
||||
<< ": " << error[KEY_MESSAGE]
|
||||
<< " from region " << regionp->getName()
|
||||
<< LL_ENDL;
|
||||
LL_WARNS("AvatarRenderInfo") << "malformed get response parse failure" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_INFOS() << "Avatar render weight info recieved but region not found for "
|
||||
<< mRegionHandle << LL_ENDL;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Something went wrong. Translate the status to
|
||||
// a meaningful message.
|
||||
LL_WARNS("AvatarRenderInfo") << "GET failed Status: "
|
||||
<< status.toTerseString()
|
||||
<< ", Reason: " << status.toString()
|
||||
<< LL_ENDL;
|
||||
}
|
||||
|
||||
private:
|
||||
U64 mRegionHandle;
|
||||
delete this; // release the handler object
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// HTTP responder class for POST request for avatar render weight information
|
||||
class LLAvatarRenderInfoPostResponder : public LLHTTPClient::Responder
|
||||
class LLAvatarRenderInfoPostHandler : public LLCore::HttpHandler
|
||||
{
|
||||
public:
|
||||
LLAvatarRenderInfoPostResponder(U64 region_handle) : mRegionHandle(region_handle)
|
||||
private:
|
||||
LOG_CLASS(LLAvatarRenderInfoPostHandler);
|
||||
|
||||
public:
|
||||
LLAvatarRenderInfoPostHandler() : LLCore::HttpHandler()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void error(U32 statusNum, const std::string& reason)
|
||||
{
|
||||
LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
|
||||
if (regionp)
|
||||
void onCompleted(LLCore::HttpHandle handle,
|
||||
LLCore::HttpResponse* response)
|
||||
{
|
||||
LL_WARNS() << "HTTP error result for avatar weight POST: " << statusNum
|
||||
<< ", " << reason
|
||||
<< " returned by region " << regionp->getName()
|
||||
<< LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "Avatar render weight POST error recieved but region not found for "
|
||||
<< mRegionHandle
|
||||
<< ", error " << statusNum
|
||||
<< ", " << reason
|
||||
<< LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void result(const LLSD& content)
|
||||
{
|
||||
LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
|
||||
if (regionp)
|
||||
{
|
||||
if (LLAvatarRenderInfoAccountant::logRenderInfo())
|
||||
LLCore::HttpStatus status = response->getStatus();
|
||||
if (status)
|
||||
{
|
||||
LL_INFOS() << "LRI: Result for avatar weights POST for region " << regionp->getName()
|
||||
<< ": " << content << LL_ENDL;
|
||||
LL_DEBUGS("AvatarRenderInfo") << "post succeeded" << LL_ENDL;
|
||||
}
|
||||
|
||||
if (content.isMap())
|
||||
else
|
||||
{
|
||||
if (content.has(KEY_ERROR))
|
||||
{
|
||||
const LLSD & error = content[KEY_ERROR];
|
||||
LL_WARNS() << "Avatar render info POST error: "
|
||||
<< error[KEY_IDENTIFIER]
|
||||
<< ": " << error[KEY_MESSAGE]
|
||||
<< " from region " << regionp->getName()
|
||||
<< LL_ENDL;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_INFOS() << "Avatar render weight POST result recieved but region not found for "
|
||||
<< mRegionHandle << LL_ENDL;
|
||||
}
|
||||
}
|
||||
// Something went wrong. Translate the status to
|
||||
// a meaningful message.
|
||||
LL_WARNS("AvatarRenderInfo") << "POST failed Status: "
|
||||
<< status.toTerseString()
|
||||
<< ", Reason: " << status.toString()
|
||||
<< LL_ENDL;
|
||||
}
|
||||
|
||||
private:
|
||||
U64 mRegionHandle;
|
||||
delete this; // release the handler object
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// static
|
||||
// Send request for one region, no timer checks
|
||||
// called when the
|
||||
void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regionp)
|
||||
{
|
||||
std::string url = regionp->getCapability("AvatarRenderInfo");
|
||||
if (!url.empty())
|
||||
if ( regionp->getRenderInfoReportTimer().hasExpired() ) // Time to make request
|
||||
{
|
||||
if (logRenderInfo())
|
||||
U32 num_avs = 0;
|
||||
|
||||
std::string url = regionp->getCapability("AvatarRenderInfo");
|
||||
if (!url.empty())
|
||||
{
|
||||
LL_INFOS() << "LRI: Sending avatar render info to region "
|
||||
<< regionp->getName()
|
||||
<< " from " << url
|
||||
<< LL_ENDL;
|
||||
}
|
||||
|
||||
// Build the render info to POST to the region
|
||||
LLSD report = LLSD::emptyMap();
|
||||
LLSD agents = LLSD::emptyMap();
|
||||
// Build the render info to POST to the region
|
||||
LLSD agents = LLSD::emptyMap();
|
||||
|
||||
std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
|
||||
while( iter != LLCharacter::sInstances.end() )
|
||||
{
|
||||
LLVOAvatar* avatar = dynamic_cast<LLVOAvatar*>(*iter);
|
||||
if (avatar &&
|
||||
avatar->getRezzedStatus() >= 2 && // Mostly rezzed (maybe without baked textures downloaded)
|
||||
!avatar->isDead() && // Not dead yet
|
||||
avatar->getObjectHost() == regionp->getHost()) // Ensure it's on the same region
|
||||
std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
|
||||
while( iter != LLCharacter::sInstances.end() )
|
||||
{
|
||||
avatar->calculateUpdateRenderCost(); // Make sure the numbers are up-to-date
|
||||
|
||||
LLSD info = LLSD::emptyMap();
|
||||
if (avatar->getVisualComplexity() > 0)
|
||||
LLVOAvatar* avatar = dynamic_cast<LLVOAvatar*>(*iter);
|
||||
if (avatar &&
|
||||
avatar->getRezzedStatus() >= 2 && // Mostly rezzed (maybe without baked textures downloaded)
|
||||
!avatar->isDead() && // Not dead yet
|
||||
avatar->getObjectHost() == regionp->getHost()) // Ensure it's on the same region
|
||||
{
|
||||
info[KEY_WEIGHT] = avatar->getVisualComplexity();
|
||||
agents[avatar->getID().asString()] = info;
|
||||
avatar->calculateUpdateRenderCost(); // Make sure the numbers are up-to-date
|
||||
|
||||
if (logRenderInfo())
|
||||
LLSD info = LLSD::emptyMap();
|
||||
if (avatar->getVisualComplexity() > 0)
|
||||
{
|
||||
LL_INFOS() << "LRI: Sending avatar render info for " << avatar->getID()
|
||||
<< ": " << info << LL_ENDL;
|
||||
LL_INFOS() << "LRI: other info geometry " << avatar->getAttachmentGeometryBytes()
|
||||
<< ", area " << avatar->getAttachmentSurfaceArea()
|
||||
<< LL_ENDL;
|
||||
info[KEY_WEIGHT] = avatar->getVisualComplexity();
|
||||
agents[avatar->getID().asString()] = info;
|
||||
|
||||
LL_DEBUGS("AvatarRenderInfo") << "Sending avatar render info for " << avatar->getID()
|
||||
<< ": " << info << LL_ENDL;
|
||||
num_avs++;
|
||||
}
|
||||
}
|
||||
iter++;
|
||||
}
|
||||
iter++;
|
||||
|
||||
if (num_avs > 0)
|
||||
{
|
||||
LLSD report = LLSD::emptyMap();
|
||||
report[KEY_AGENTS] = agents;
|
||||
|
||||
LLCore::HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID);
|
||||
LLAvatarRenderInfoPostHandler* handler = new LLAvatarRenderInfoPostHandler;
|
||||
|
||||
handle = LLCoreHttpUtil::requestPostWithLLSD(mHttpRequest,
|
||||
http_policy,
|
||||
http_priority,
|
||||
url,
|
||||
report,
|
||||
mHttpOptions,
|
||||
mHttpHeaders,
|
||||
handler);
|
||||
if (LLCORE_HTTP_HANDLE_INVALID == handle)
|
||||
{
|
||||
LLCore::HttpStatus status(mHttpRequest->getStatus());
|
||||
LL_WARNS("AvatarRenderInfo") << "HTTP POST request failed"
|
||||
<< " Status: " << status.toTerseString()
|
||||
<< " Reason: '" << status.toString() << "'"
|
||||
<< LL_ENDL;
|
||||
delete handler;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_INFOS("AvatarRenderInfo") << "Sent render costs for " << num_avs
|
||||
<< " avatars to region " << regionp->getName()
|
||||
<< LL_ENDL;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_DEBUGS("AvatarRenderInfo") << "no agent info to send" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS("AvatarRenderInfo") << "AvatarRenderInfo cap is empty" << LL_ENDL;
|
||||
}
|
||||
|
||||
report[KEY_AGENTS] = agents;
|
||||
if (agents.size() > 0)
|
||||
{
|
||||
LLHTTPClient::post(url, report, new LLAvatarRenderInfoPostResponder(regionp->getHandle()));
|
||||
}
|
||||
// Reset this regions timer, moving to longer intervals if there are lots of avatars around
|
||||
regionp->getRenderInfoReportTimer().resetWithExpiry(SECS_BETWEEN_REGION_REPORTS + (2.f * num_avs));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -280,19 +320,39 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio
|
|||
// Send request for one region, no timer checks
|
||||
void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regionp)
|
||||
{
|
||||
std::string url = regionp->getCapability("AvatarRenderInfo");
|
||||
if (!url.empty())
|
||||
if (regionp->getRenderInfoRequestTimer().hasExpired())
|
||||
{
|
||||
if (logRenderInfo())
|
||||
std::string url = regionp->getCapability("AvatarRenderInfo");
|
||||
if (!url.empty())
|
||||
{
|
||||
LL_INFOS() << "LRI: Requesting avatar render info for region "
|
||||
<< regionp->getName()
|
||||
<< " from " << url
|
||||
<< LL_ENDL;
|
||||
|
||||
LLAvatarRenderInfoGetHandler* handler = new LLAvatarRenderInfoGetHandler;
|
||||
// First send a request to get the latest data
|
||||
LLCore::HttpHandle handle = mHttpRequest->requestGet(http_policy,
|
||||
http_priority,
|
||||
url,
|
||||
NULL,
|
||||
NULL,
|
||||
handler);
|
||||
if (LLCORE_HTTP_HANDLE_INVALID != handle)
|
||||
{
|
||||
LL_INFOS("AvatarRenderInfo") << "Requested avatar render info for region "
|
||||
<< regionp->getName()
|
||||
<< LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS("AvatarRenderInfo") << "Failed to launch HTTP GET request. Try again."
|
||||
<< LL_ENDL;
|
||||
delete handler;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS("AvatarRenderInfo") << "no AvatarRenderInfo cap for " << regionp->getName() << LL_ENDL;
|
||||
}
|
||||
|
||||
// First send a request to get the latest data
|
||||
LLHTTPClient::get(url, new LLAvatarRenderInfoGetResponder(regionp->getHandle()));
|
||||
regionp->getRenderInfoRequestTimer().resetWithExpiry(SECS_BETWEEN_REGION_REQUEST);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -301,98 +361,60 @@ void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regi
|
|||
// Called every frame - send render weight requests to every region
|
||||
void LLAvatarRenderInfoAccountant::idle()
|
||||
{
|
||||
if (sRenderInfoReportTimer.hasExpired())
|
||||
{
|
||||
const F32 SECS_BETWEEN_REGION_SCANS = 5.f; // Scan the region list every 5 seconds
|
||||
const F32 SECS_BETWEEN_REGION_REQUEST = 60.0; // Update each region every 60 seconds
|
||||
mHttpRequest->update(0); // give any pending http operations a chance to call completion methods
|
||||
|
||||
S32 num_avs = LLCharacter::sInstances.size();
|
||||
if (mRenderInfoScanTimer.hasExpired())
|
||||
{
|
||||
LL_DEBUGS("AvatarRenderInfo") << "Scanning regions for render info updates"
|
||||
<< LL_ENDL;
|
||||
|
||||
if (logRenderInfo())
|
||||
{
|
||||
LL_INFOS() << "LRI: Scanning all regions and checking for render info updates"
|
||||
<< LL_ENDL;
|
||||
}
|
||||
|
||||
// Check all regions and see if it's time to fetch/send data
|
||||
// Check all regions
|
||||
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
|
||||
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
|
||||
iter != LLWorld::getInstance()->getRegionList().end();
|
||||
++iter)
|
||||
{
|
||||
LLViewerRegion* regionp = *iter;
|
||||
if (regionp &&
|
||||
regionp->isAlive() &&
|
||||
regionp->capabilitiesReceived() && // Region has capability URLs available
|
||||
regionp->getRenderInfoRequestTimer().hasExpired()) // Time to make request
|
||||
if ( regionp
|
||||
&& regionp->isAlive()
|
||||
&& regionp->capabilitiesReceived())
|
||||
{
|
||||
// each of these is further governed by and resets its own timer
|
||||
sendRenderInfoToRegion(regionp);
|
||||
getRenderInfoFromRegion(regionp);
|
||||
|
||||
// Reset this regions timer, moving to longer intervals if there are lots of avatars around
|
||||
regionp->getRenderInfoRequestTimer().resetWithExpiry(SECS_BETWEEN_REGION_REQUEST + (2.f * num_avs));
|
||||
}
|
||||
}
|
||||
|
||||
// We scanned all the regions, reset the request timer.
|
||||
sRenderInfoReportTimer.resetWithExpiry(SECS_BETWEEN_REGION_SCANS);
|
||||
}
|
||||
|
||||
static LLCachedControl<U32> render_auto_mute_functions(gSavedSettings, "RenderAutoMuteFunctions", 0);
|
||||
static U32 prev_render_auto_mute_functions = (U32) -1;
|
||||
if (prev_render_auto_mute_functions != render_auto_mute_functions)
|
||||
{
|
||||
prev_render_auto_mute_functions = render_auto_mute_functions;
|
||||
|
||||
// Adjust menus
|
||||
BOOL show_items = (BOOL)(render_auto_mute_functions & 0x04);
|
||||
gMenuAvatarOther->setItemVisible( std::string("Normal"), show_items);
|
||||
gMenuAvatarOther->setItemVisible( std::string("Always use impostor"), show_items);
|
||||
gMenuAvatarOther->setItemVisible( std::string("Never use impostor"), show_items);
|
||||
gMenuAvatarOther->setItemVisible( std::string("Impostor seperator"), show_items);
|
||||
|
||||
gMenuAttachmentOther->setItemVisible( std::string("Normal"), show_items);
|
||||
gMenuAttachmentOther->setItemVisible( std::string("Always use impostor"), show_items);
|
||||
gMenuAttachmentOther->setItemVisible( std::string("Never use impostor"), show_items);
|
||||
gMenuAttachmentOther->setItemVisible( std::string("Impostor seperator"), show_items);
|
||||
|
||||
if (!show_items)
|
||||
{ // Turning off visual muting
|
||||
for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
|
||||
iter != LLCharacter::sInstances.end(); ++iter)
|
||||
{ // Make sure all AVs have the setting cleared
|
||||
LLVOAvatar* inst = (LLVOAvatar*) *iter;
|
||||
inst->setCachedVisualMute(false);
|
||||
}
|
||||
}
|
||||
mRenderInfoScanTimer.resetWithExpiry(SECS_BETWEEN_REGION_SCANS);
|
||||
}
|
||||
}
|
||||
|
||||
void LLAvatarRenderInfoAccountant::resetRenderInfoScanTimer()
|
||||
{
|
||||
// this will force the next frame to rescan
|
||||
mRenderInfoScanTimer.reset();
|
||||
}
|
||||
|
||||
// static
|
||||
// Make sRenderInfoReportTimer expire so the next call to idle() will scan and query a new region
|
||||
// called via LLViewerRegion::setCapabilitiesReceived() boost signals when the capabilities
|
||||
// Called via LLViewerRegion::setCapabilitiesReceived() boost signals when the capabilities
|
||||
// are returned for a new LLViewerRegion, and is the earliest time to get render info
|
||||
void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer(const LLUUID& region_id)
|
||||
void LLAvatarRenderInfoAccountant::scanNewRegion(const LLUUID& region_id)
|
||||
{
|
||||
if (logRenderInfo())
|
||||
{
|
||||
LL_INFOS() << "LRI: Viewer has new region capabilities, clearing global render info timer"
|
||||
<< " and timer for region " << region_id
|
||||
<< LL_ENDL;
|
||||
}
|
||||
LL_INFOS("AvatarRenderInfo") << region_id << LL_ENDL;
|
||||
|
||||
// Reset the global timer so it will scan regions immediately
|
||||
sRenderInfoReportTimer.reset();
|
||||
// Reset the global timer so it will scan regions on the next call to ::idle
|
||||
LLAvatarRenderInfoAccountant::getInstance()->resetRenderInfoScanTimer();
|
||||
|
||||
LLViewerRegion* regionp = LLWorld::instance().getRegionFromID(region_id);
|
||||
if (regionp)
|
||||
{ // Reset the region's timer so it will request data immediately
|
||||
{ // Reset the region's timers so we will:
|
||||
// * request render info from it immediately
|
||||
// * report on the following scan
|
||||
regionp->getRenderInfoRequestTimer().reset();
|
||||
regionp->getRenderInfoReportTimer().resetWithExpiry(SECS_BETWEEN_REGION_SCANS);
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS("AvatarRenderInfo") << "unable to resolve region "<<region_id<<LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLAvatarRenderInfoAccountant::logRenderInfo()
|
||||
{
|
||||
static LLCachedControl<bool> render_mute_logging_enabled(gSavedSettings, "RenderAutoMuteLogging", false);
|
||||
return render_mute_logging_enabled;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,24 +33,33 @@ class LLViewerRegion;
|
|||
|
||||
// Class to gather avatar rendering information
|
||||
// that is sent to or fetched from regions.
|
||||
class LLAvatarRenderInfoAccountant
|
||||
class LLAvatarRenderInfoAccountant : public LLSingleton<LLAvatarRenderInfoAccountant>
|
||||
{
|
||||
public:
|
||||
LLAvatarRenderInfoAccountant() {};
|
||||
~LLAvatarRenderInfoAccountant() {};
|
||||
private:
|
||||
LOG_CLASS(LLAvatarRenderInfoAccountant);
|
||||
|
||||
static void sendRenderInfoToRegion(LLViewerRegion * regionp);
|
||||
static void getRenderInfoFromRegion(LLViewerRegion * regionp);
|
||||
public:
|
||||
LLAvatarRenderInfoAccountant();
|
||||
~LLAvatarRenderInfoAccountant();
|
||||
|
||||
static void expireRenderInfoReportTimer(const LLUUID& region_id);
|
||||
void sendRenderInfoToRegion(LLViewerRegion * regionp);
|
||||
void getRenderInfoFromRegion(LLViewerRegion * regionp);
|
||||
|
||||
static void idle();
|
||||
void idle(); // called once per frame
|
||||
|
||||
static bool logRenderInfo();
|
||||
void resetRenderInfoScanTimer();
|
||||
|
||||
static void scanNewRegion(const LLUUID& region_id);
|
||||
|
||||
private:
|
||||
// Send data updates about once per minute, only need per-frame resolution
|
||||
static LLFrameTimer sRenderInfoReportTimer;
|
||||
private:
|
||||
// frequency of region scans,
|
||||
// further limited by per region Request and Report timers
|
||||
LLFrameTimer mRenderInfoScanTimer;
|
||||
|
||||
//
|
||||
LLCore::HttpRequest* mHttpRequest;
|
||||
LLCore::HttpHeaders* mHttpHeaders;
|
||||
LLCore::HttpOptions* mHttpOptions;
|
||||
};
|
||||
|
||||
#endif /* ! defined(LL_llavatarrenderinfoaccountant_H) */
|
||||
|
|
|
|||
|
|
@ -0,0 +1,94 @@
|
|||
/**
|
||||
* @file llfloaterdeleteprefpreset.cpp
|
||||
* @brief Floater to delete a graphics / camera preset
|
||||
*
|
||||
* $LicenseInfo:firstyear=2014&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2014, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llfloaterdeleteprefpreset.h"
|
||||
|
||||
#include "llbutton.h"
|
||||
#include "llcombobox.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llpresetsmanager.h"
|
||||
#include "llviewercontrol.h"
|
||||
|
||||
LLFloaterDeletePrefPreset::LLFloaterDeletePrefPreset(const LLSD &key)
|
||||
: LLFloater(key)
|
||||
{
|
||||
}
|
||||
|
||||
// virtual
|
||||
BOOL LLFloaterDeletePrefPreset::postBuild()
|
||||
{
|
||||
getChild<LLButton>("delete")->setCommitCallback(boost::bind(&LLFloaterDeletePrefPreset::onBtnDelete, this));
|
||||
getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterDeletePrefPreset::onBtnCancel, this));
|
||||
LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterDeletePrefPreset::onPresetsListChange, this));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLFloaterDeletePrefPreset::onOpen(const LLSD& key)
|
||||
{
|
||||
mSubdirectory = key.asString();
|
||||
std::string floater_title = getString(std::string("title_") + mSubdirectory);
|
||||
|
||||
setTitle(floater_title);
|
||||
|
||||
LLComboBox* combo = getChild<LLComboBox>("preset_combo");
|
||||
|
||||
EDefaultOptions option = DEFAULT_HIDE;
|
||||
LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo, option);
|
||||
}
|
||||
|
||||
void LLFloaterDeletePrefPreset::onBtnDelete()
|
||||
{
|
||||
LLComboBox* combo = getChild<LLComboBox>("preset_combo");
|
||||
std::string name = combo->getSimple();
|
||||
|
||||
if (!LLPresetsManager::getInstance()->deletePreset(mSubdirectory, name))
|
||||
{
|
||||
LLSD args;
|
||||
args["NAME"] = name;
|
||||
LLNotificationsUtil::add("PresetNotDeleted", args);
|
||||
}
|
||||
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void LLFloaterDeletePrefPreset::onPresetsListChange()
|
||||
{
|
||||
LLComboBox* combo = getChild<LLComboBox>("preset_combo");
|
||||
LLButton* delete_btn = getChild<LLButton>("delete");
|
||||
|
||||
EDefaultOptions option = DEFAULT_HIDE;
|
||||
LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo, option);
|
||||
|
||||
delete_btn->setEnabled(0 != combo->getItemCount());
|
||||
}
|
||||
|
||||
void LLFloaterDeletePrefPreset::onBtnCancel()
|
||||
{
|
||||
closeFloater();
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
/**
|
||||
* @file llfloaterdeleteprefpreset.h
|
||||
* @brief Floater to delete a graphics / camera preset
|
||||
|
||||
*
|
||||
* $LicenseInfo:firstyear=2014&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2014, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLFLOATERDELETEPREFPRESET_H
|
||||
#define LL_LLFLOATERDELETEPREFPRESET_H
|
||||
|
||||
#include "llfloater.h"
|
||||
|
||||
class LLComboBox;
|
||||
|
||||
class LLFloaterDeletePrefPreset : public LLFloater
|
||||
{
|
||||
|
||||
public:
|
||||
LLFloaterDeletePrefPreset(const LLSD &key);
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
void onBtnDelete();
|
||||
void onBtnCancel();
|
||||
|
||||
private:
|
||||
void onPresetsListChange();
|
||||
|
||||
std::string mSubdirectory;
|
||||
};
|
||||
|
||||
#endif // LL_LLFLOATERDELETEPREFPRESET_H
|
||||
|
|
@ -1,201 +0,0 @@
|
|||
/**
|
||||
* @file llfloaterhardwaresettings.cpp
|
||||
* @brief Menu of all the different graphics hardware settings
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llfloaterhardwaresettings.h"
|
||||
|
||||
// Viewer includes
|
||||
#include "llfloaterpreference.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewertexturelist.h"
|
||||
#include "llfeaturemanager.h"
|
||||
#include "llspinctrl.h"
|
||||
#include "llstartup.h"
|
||||
#include "lltextbox.h"
|
||||
#include "llcombobox.h"
|
||||
#include "pipeline.h"
|
||||
|
||||
// Linden library includes
|
||||
#include "llradiogroup.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llwindow.h"
|
||||
#include "llsliderctrl.h"
|
||||
|
||||
LLFloaterHardwareSettings::LLFloaterHardwareSettings(const LLSD& key)
|
||||
: LLFloater(key),
|
||||
|
||||
// these should be set on imminent refresh() call,
|
||||
// but init them anyway
|
||||
mUseVBO(0),
|
||||
mUseAniso(0),
|
||||
mFSAASamples(0),
|
||||
mGamma(0.0),
|
||||
mVideoCardMem(0),
|
||||
mFogRatio(0.0),
|
||||
mProbeHardwareOnStartup(FALSE)
|
||||
{
|
||||
}
|
||||
|
||||
LLFloaterHardwareSettings::~LLFloaterHardwareSettings()
|
||||
{
|
||||
}
|
||||
|
||||
void LLFloaterHardwareSettings::initCallbacks(void)
|
||||
{
|
||||
}
|
||||
|
||||
// menu maintenance functions
|
||||
|
||||
void LLFloaterHardwareSettings::refresh()
|
||||
{
|
||||
LLPanel::refresh();
|
||||
|
||||
mUseVBO = gSavedSettings.getBOOL("RenderVBOEnable");
|
||||
mUseAniso = gSavedSettings.getBOOL("RenderAnisotropic");
|
||||
mFSAASamples = gSavedSettings.getU32("RenderFSAASamples");
|
||||
mGamma = gSavedSettings.getF32("RenderGamma");
|
||||
mVideoCardMem = gSavedSettings.getS32("TextureMemory");
|
||||
mFogRatio = gSavedSettings.getF32("RenderFogRatio");
|
||||
mProbeHardwareOnStartup = gSavedSettings.getBOOL("ProbeHardwareOnStartup");
|
||||
|
||||
getChild<LLUICtrl>("fsaa")->setValue((LLSD::Integer) mFSAASamples);
|
||||
refreshEnabledState();
|
||||
}
|
||||
|
||||
void LLFloaterHardwareSettings::refreshEnabledState()
|
||||
{
|
||||
F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple");
|
||||
S32Megabytes min_tex_mem = LLViewerTextureList::getMinVideoRamSetting();
|
||||
S32Megabytes max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(false, mem_multiplier);
|
||||
getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMinValue(min_tex_mem.value());
|
||||
getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem.value());
|
||||
|
||||
if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") ||
|
||||
!gGLManager.mHasVertexBufferObject)
|
||||
{
|
||||
getChildView("vbo")->setEnabled(FALSE);
|
||||
}
|
||||
|
||||
if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderCompressTextures") ||
|
||||
!gGLManager.mHasVertexBufferObject)
|
||||
{
|
||||
getChildView("texture compression")->setEnabled(FALSE);
|
||||
}
|
||||
|
||||
// if no windlight shaders, turn off nighttime brightness, gamma, and fog distance
|
||||
LLSpinCtrl* gamma_ctrl = getChild<LLSpinCtrl>("gamma");
|
||||
gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders());
|
||||
getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders());
|
||||
getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders());
|
||||
|
||||
// anti-aliasing
|
||||
{
|
||||
LLUICtrl* fsaa_ctrl = getChild<LLUICtrl>("fsaa");
|
||||
LLTextBox* fsaa_text = getChild<LLTextBox>("antialiasing label");
|
||||
LLView* fsaa_restart = getChildView("antialiasing restart");
|
||||
|
||||
// Enable or disable the control, the "Antialiasing:" label and the restart warning
|
||||
// based on code support for the feature on the current hardware.
|
||||
|
||||
if (gPipeline.canUseAntiAliasing())
|
||||
{
|
||||
fsaa_ctrl->setEnabled(TRUE);
|
||||
|
||||
// borrow the text color from the gamma control for consistency
|
||||
fsaa_text->setColor(gamma_ctrl->getEnabledTextColor());
|
||||
|
||||
fsaa_restart->setVisible(!gSavedSettings.getBOOL("RenderDeferred"));
|
||||
}
|
||||
else
|
||||
{
|
||||
fsaa_ctrl->setEnabled(FALSE);
|
||||
fsaa_ctrl->setValue((LLSD::Integer) 0);
|
||||
|
||||
// borrow the text color from the gamma control for consistency
|
||||
fsaa_text->setColor(gamma_ctrl->getDisabledTextColor());
|
||||
|
||||
fsaa_restart->setVisible(FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
||||
BOOL LLFloaterHardwareSettings::postBuild()
|
||||
{
|
||||
childSetAction("OK", onBtnOK, this);
|
||||
|
||||
// Don't do this on Mac as their braindead GL versioning
|
||||
// sets this when 8x and 16x are indeed available
|
||||
//
|
||||
#if !LL_DARWIN
|
||||
if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f)
|
||||
{ //remove FSAA settings above "4x"
|
||||
LLComboBox* combo = getChild<LLComboBox>("fsaa");
|
||||
combo->remove("8x");
|
||||
combo->remove("16x");
|
||||
}
|
||||
#endif
|
||||
|
||||
refresh();
|
||||
center();
|
||||
|
||||
// load it up
|
||||
initCallbacks();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
void LLFloaterHardwareSettings::apply()
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
||||
|
||||
void LLFloaterHardwareSettings::cancel()
|
||||
{
|
||||
gSavedSettings.setBOOL("RenderVBOEnable", mUseVBO);
|
||||
gSavedSettings.setBOOL("RenderAnisotropic", mUseAniso);
|
||||
gSavedSettings.setU32("RenderFSAASamples", mFSAASamples);
|
||||
gSavedSettings.setF32("RenderGamma", mGamma);
|
||||
gSavedSettings.setS32("TextureMemory", mVideoCardMem);
|
||||
gSavedSettings.setF32("RenderFogRatio", mFogRatio);
|
||||
gSavedSettings.setBOOL("ProbeHardwareOnStartup", mProbeHardwareOnStartup );
|
||||
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloaterHardwareSettings::onBtnOK( void* userdata )
|
||||
{
|
||||
LLFloaterHardwareSettings *fp =(LLFloaterHardwareSettings *)userdata;
|
||||
fp->apply();
|
||||
fp->closeFloater(false);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
/**
|
||||
* @file llfloaterhardwaresettings.h
|
||||
* @brief Menu of all the different graphics hardware settings
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLFLOATER_HARDWARE_SETTINGS_H
|
||||
#define LL_LLFLOATER_HARDWARE_SETTINGS_H
|
||||
|
||||
#include "llfloater.h"
|
||||
|
||||
/// Menuing system for all of windlight's functionality
|
||||
class LLFloaterHardwareSettings : public LLFloater
|
||||
{
|
||||
friend class LLFloaterPreference;
|
||||
|
||||
public:
|
||||
|
||||
LLFloaterHardwareSettings(const LLSD& key);
|
||||
/*virtual*/ ~LLFloaterHardwareSettings();
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
|
||||
/// initialize all the callbacks for the menu
|
||||
void initCallbacks(void);
|
||||
|
||||
/// OK button
|
||||
static void onBtnOK( void* userdata );
|
||||
|
||||
//// menu management
|
||||
|
||||
/// show off our menu
|
||||
static void show();
|
||||
|
||||
/// return if the menu exists or not
|
||||
static bool isOpen();
|
||||
|
||||
/// sync up menu with parameters
|
||||
void refresh();
|
||||
|
||||
/// Apply the changed values.
|
||||
void apply();
|
||||
|
||||
/// don't apply the changed values
|
||||
void cancel();
|
||||
|
||||
/// refresh the enabled values
|
||||
void refreshEnabledState();
|
||||
|
||||
protected:
|
||||
BOOL mUseVBO;
|
||||
BOOL mUseAniso;
|
||||
BOOL mUseFBO;
|
||||
U32 mFSAASamples;
|
||||
F32 mGamma;
|
||||
S32 mVideoCardMem;
|
||||
F32 mFogRatio;
|
||||
BOOL mProbeHardwareOnStartup;
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
/**
|
||||
* @file llfloateloadprefpreset.cpp
|
||||
* @brief Floater to load a graphics / camera preset
|
||||
*
|
||||
* $LicenseInfo:firstyear=2015&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2015, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llfloaterloadprefpreset.h"
|
||||
|
||||
#include "llbutton.h"
|
||||
#include "llcombobox.h"
|
||||
#include "llfloaterpreference.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llpresetsmanager.h"
|
||||
#include "llviewercontrol.h"
|
||||
|
||||
LLFloaterLoadPrefPreset::LLFloaterLoadPrefPreset(const LLSD &key)
|
||||
: LLFloater(key)
|
||||
{
|
||||
}
|
||||
|
||||
// virtual
|
||||
BOOL LLFloaterLoadPrefPreset::postBuild()
|
||||
{
|
||||
getChild<LLButton>("ok")->setCommitCallback(boost::bind(&LLFloaterLoadPrefPreset::onBtnOk, this));
|
||||
getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterLoadPrefPreset::onBtnCancel, this));
|
||||
LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterLoadPrefPreset::onPresetsListChange, this));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLFloaterLoadPrefPreset::onOpen(const LLSD& key)
|
||||
{
|
||||
mSubdirectory = key.asString();
|
||||
std::string floater_title = getString(std::string("title_") + mSubdirectory);
|
||||
|
||||
setTitle(floater_title);
|
||||
|
||||
LLComboBox* combo = getChild<LLComboBox>("preset_combo");
|
||||
|
||||
EDefaultOptions option = DEFAULT_TOP;
|
||||
LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo, option);
|
||||
}
|
||||
|
||||
void LLFloaterLoadPrefPreset::onPresetsListChange()
|
||||
{
|
||||
LLComboBox* combo = getChild<LLComboBox>("preset_combo");
|
||||
|
||||
EDefaultOptions option = DEFAULT_TOP;
|
||||
LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo, option);
|
||||
}
|
||||
|
||||
void LLFloaterLoadPrefPreset::onBtnCancel()
|
||||
{
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void LLFloaterLoadPrefPreset::onBtnOk()
|
||||
{
|
||||
LLComboBox* combo = getChild<LLComboBox>("preset_combo");
|
||||
std::string name = combo->getSimple();
|
||||
|
||||
LLPresetsManager::getInstance()->loadPreset(mSubdirectory, name);
|
||||
|
||||
closeFloater();
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
/**
|
||||
* @file llfloaterloadprefpreset.h
|
||||
* @brief Floater to load a graphics / camera preset
|
||||
|
||||
*
|
||||
* $LicenseInfo:firstyear=2015&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2015, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLFLOATERLOADPREFPRESET_H
|
||||
#define LL_LLFLOATERLOADPREFPRESET_H
|
||||
|
||||
#include "llfloater.h"
|
||||
|
||||
class LLComboBox;
|
||||
|
||||
class LLFloaterLoadPrefPreset : public LLFloater
|
||||
{
|
||||
|
||||
public:
|
||||
LLFloaterLoadPrefPreset(const LLSD &key);
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
void onBtnOk();
|
||||
void onBtnCancel();
|
||||
|
||||
private:
|
||||
void onPresetsListChange();
|
||||
|
||||
std::string mSubdirectory;
|
||||
};
|
||||
|
||||
#endif // LL_LLFLOATERLOADPREFPRESET_H
|
||||
|
|
@ -48,7 +48,6 @@
|
|||
//#include "llfirstuse.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llfloaterabout.h"
|
||||
#include "llfloaterhardwaresettings.h"
|
||||
#include "llfloatersidepanelcontainer.h"
|
||||
#include "llfloaterimsession.h"
|
||||
#include "llkeyboard.h"
|
||||
|
|
@ -108,6 +107,11 @@
|
|||
|
||||
#include "lllogininstance.h" // to check if logged in yet
|
||||
#include "llsdserialize.h"
|
||||
#include "llpresetsmanager.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llpresetsmanager.h"
|
||||
#include "llfeaturemanager.h"
|
||||
#include "llviewertexturelist.h"
|
||||
|
||||
const F32 BANDWIDTH_UPDATER_TIMEOUT = 0.5f;
|
||||
char const* const VISIBILITY_DEFAULT = "default";
|
||||
|
|
@ -317,7 +321,6 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
|
|||
registered_dialog = true;
|
||||
}
|
||||
|
||||
mCommitCallbackRegistrar.add("Pref.Apply", boost::bind(&LLFloaterPreference::onBtnApply, this));
|
||||
mCommitCallbackRegistrar.add("Pref.Cancel", boost::bind(&LLFloaterPreference::onBtnCancel, this));
|
||||
mCommitCallbackRegistrar.add("Pref.OK", boost::bind(&LLFloaterPreference::onBtnOK, this));
|
||||
|
||||
|
|
@ -333,8 +336,8 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
|
|||
mCommitCallbackRegistrar.add("Pref.ClickEnablePopup", boost::bind(&LLFloaterPreference::onClickEnablePopup, this));
|
||||
mCommitCallbackRegistrar.add("Pref.ClickDisablePopup", boost::bind(&LLFloaterPreference::onClickDisablePopup, this));
|
||||
mCommitCallbackRegistrar.add("Pref.LogPath", boost::bind(&LLFloaterPreference::onClickLogPath, this));
|
||||
mCommitCallbackRegistrar.add("Pref.HardwareSettings", boost::bind(&LLFloaterPreference::onOpenHardwareSettings, this));
|
||||
mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this));
|
||||
mCommitCallbackRegistrar.add("Pref.AvatarImpostorsEnable", boost::bind(&LLFloaterPreference::onAvatarImpostorsEnable, this));
|
||||
mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreference::onVertexShaderEnable, this));
|
||||
mCommitCallbackRegistrar.add("Pref.WindowedMod", boost::bind(&LLFloaterPreference::onCommitWindowedMode, this));
|
||||
mCommitCallbackRegistrar.add("Pref.UpdateSliderText", boost::bind(&LLFloaterPreference::refreshUI,this));
|
||||
|
|
@ -542,12 +545,6 @@ void LLFloaterPreference::apply()
|
|||
if (panel)
|
||||
panel->apply();
|
||||
}
|
||||
// hardware menu apply
|
||||
LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::getTypedInstance<LLFloaterHardwareSettings>("prefs_hardware_settings");
|
||||
if (hardware_settings)
|
||||
{
|
||||
hardware_settings->apply();
|
||||
}
|
||||
|
||||
gViewerWindow->requestResolutionUpdate(); // for UIScaleFactor
|
||||
|
||||
|
|
@ -625,13 +622,6 @@ void LLFloaterPreference::cancel()
|
|||
// hide spellchecker settings folder
|
||||
LLFloaterReg::hideInstance("prefs_spellchecker");
|
||||
|
||||
// cancel hardware menu
|
||||
LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::getTypedInstance<LLFloaterHardwareSettings>("prefs_hardware_settings");
|
||||
if (hardware_settings)
|
||||
{
|
||||
hardware_settings->cancel();
|
||||
}
|
||||
|
||||
// reverts any changes to current skin
|
||||
gSavedSettings.setString("SkinCurrent", sSkin);
|
||||
|
||||
|
|
@ -657,7 +647,7 @@ void LLFloaterPreference::cancel()
|
|||
|
||||
void LLFloaterPreference::onOpen(const LLSD& key)
|
||||
{
|
||||
|
||||
|
||||
// this variable and if that follows it are used to properly handle do not disturb mode response message
|
||||
static bool initialized = FALSE;
|
||||
// if user is logged in and we haven't initialized do not disturb mode response yet, do it
|
||||
|
|
@ -735,6 +725,19 @@ void LLFloaterPreference::onOpen(const LLSD& key)
|
|||
// when the floater is opened. That will make cancel do its
|
||||
// job
|
||||
saveSettings();
|
||||
|
||||
// Make sure there is a default preference file
|
||||
LLPresetsManager::getInstance()->createMissingDefault();
|
||||
|
||||
bool started = (LLStartUp::getStartupState() == STATE_STARTED);
|
||||
|
||||
LLButton* load_btn = findChild<LLButton>("PrefLoadButton");
|
||||
LLButton* save_btn = findChild<LLButton>("PrefSaveButton");
|
||||
LLButton* delete_btn = findChild<LLButton>("PrefDeleteButton");
|
||||
|
||||
load_btn->setEnabled(started);
|
||||
save_btn->setEnabled(started);
|
||||
delete_btn->setEnabled(started);
|
||||
}
|
||||
|
||||
void LLFloaterPreference::onVertexShaderEnable()
|
||||
|
|
@ -742,6 +745,11 @@ void LLFloaterPreference::onVertexShaderEnable()
|
|||
refreshEnabledGraphics();
|
||||
}
|
||||
|
||||
void LLFloaterPreference::onAvatarImpostorsEnable()
|
||||
{
|
||||
refreshEnabledGraphics();
|
||||
}
|
||||
|
||||
//static
|
||||
void LLFloaterPreference::initDoNotDisturbResponse()
|
||||
{
|
||||
|
|
@ -766,6 +774,9 @@ void LLFloaterPreference::setHardwareDefaults()
|
|||
{
|
||||
LLFeatureManager::getInstance()->applyRecommendedSettings();
|
||||
refreshEnabledGraphics();
|
||||
gSavedSettings.setString("PresetGraphicActive", "");
|
||||
LLPresetsManager::getInstance()->triggerChangeSignal();
|
||||
|
||||
LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core");
|
||||
child_list_t::const_iterator iter = tabcontainer->getChildList()->begin();
|
||||
child_list_t::const_iterator end = tabcontainer->getChildList()->end();
|
||||
|
|
@ -778,6 +789,42 @@ void LLFloaterPreference::setHardwareDefaults()
|
|||
}
|
||||
}
|
||||
|
||||
void LLFloaterPreference::getControlNames(std::vector<std::string>& names)
|
||||
{
|
||||
LLView* view = findChild<LLView>("display");
|
||||
if (view)
|
||||
{
|
||||
std::list<LLView*> stack;
|
||||
stack.push_back(view);
|
||||
while(!stack.empty())
|
||||
{
|
||||
// Process view on top of the stack
|
||||
LLView* curview = stack.front();
|
||||
stack.pop_front();
|
||||
|
||||
LLUICtrl* ctrl = dynamic_cast<LLUICtrl*>(curview);
|
||||
if (ctrl)
|
||||
{
|
||||
LLControlVariable* control = ctrl->getControlVariable();
|
||||
if (control)
|
||||
{
|
||||
std::string control_name = control->getName();
|
||||
if (std::find(names.begin(), names.end(), control_name) == names.end())
|
||||
{
|
||||
names.push_back(control_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (child_list_t::const_iterator iter = curview->getChildList()->begin();
|
||||
iter != curview->getChildList()->end(); ++iter)
|
||||
{
|
||||
stack.push_back(*iter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLFloaterPreference::onClose(bool app_quitting)
|
||||
{
|
||||
|
|
@ -789,11 +836,6 @@ void LLFloaterPreference::onClose(bool app_quitting)
|
|||
}
|
||||
}
|
||||
|
||||
void LLFloaterPreference::onOpenHardwareSettings()
|
||||
{
|
||||
LLFloater* floater = LLFloaterReg::showInstance("prefs_hardware_settings");
|
||||
addDependentFloater(floater, FALSE);
|
||||
}
|
||||
// static
|
||||
void LLFloaterPreference::onBtnOK()
|
||||
{
|
||||
|
|
@ -853,24 +895,6 @@ void LLFloaterPreference::onBtnOK()
|
|||
LLFloaterPathfindingConsole* pPathfindingConsole = pathfindingConsoleHandle.get();
|
||||
pPathfindingConsole->onRegionBoundaryCross();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloaterPreference::onBtnApply( )
|
||||
{
|
||||
if (hasFocus())
|
||||
{
|
||||
LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus());
|
||||
if (cur_focus && cur_focus->acceptsTextInput())
|
||||
{
|
||||
cur_focus->onCommit();
|
||||
}
|
||||
}
|
||||
apply();
|
||||
saveSettings();
|
||||
|
||||
LLPanelLogin::updateLocationSelectorsVisibility();
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
@ -899,19 +923,12 @@ void LLFloaterPreference::updateUserInfo(const std::string& visibility, bool im_
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void LLFloaterPreference::refreshEnabledGraphics()
|
||||
{
|
||||
LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences");
|
||||
if (instance)
|
||||
{
|
||||
instance->refresh();
|
||||
//instance->refreshEnabledState();
|
||||
}
|
||||
LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::getTypedInstance<LLFloaterHardwareSettings>("prefs_hardware_settings");
|
||||
if (hardware_settings)
|
||||
{
|
||||
hardware_settings->refreshEnabledState();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1096,21 +1113,20 @@ void LLFloaterPreference::buildPopupLists()
|
|||
void LLFloaterPreference::refreshEnabledState()
|
||||
{
|
||||
LLComboBox* ctrl_reflections = getChild<LLComboBox>("Reflections");
|
||||
LLRadioGroup* radio_reflection_detail = getChild<LLRadioGroup>("ReflectionDetailRadio");
|
||||
LLTextBox* reflections_text = getChild<LLTextBox>("ReflectionsText");
|
||||
|
||||
// Reflections
|
||||
BOOL reflections = gSavedSettings.getBOOL("VertexShaderEnable")
|
||||
&& gGLManager.mHasCubeMap
|
||||
&& LLCubeMap::sUseCubeMaps;
|
||||
ctrl_reflections->setEnabled(reflections);
|
||||
reflections_text->setEnabled(reflections);
|
||||
|
||||
// Bump & Shiny
|
||||
LLCheckBoxCtrl* bumpshiny_ctrl = getChild<LLCheckBoxCtrl>("BumpShiny");
|
||||
bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump");
|
||||
bumpshiny_ctrl->setEnabled(bumpshiny ? TRUE : FALSE);
|
||||
|
||||
radio_reflection_detail->setEnabled(reflections);
|
||||
|
||||
// Avatar Mode
|
||||
// Enable Avatar Shaders
|
||||
LLCheckBoxCtrl* ctrl_avatar_vp = getChild<LLCheckBoxCtrl>("AvatarVertexProgram");
|
||||
|
|
@ -1129,38 +1145,47 @@ void LLFloaterPreference::refreshEnabledState()
|
|||
if (gSavedSettings.getBOOL("VertexShaderEnable") == FALSE ||
|
||||
gSavedSettings.getBOOL("RenderAvatarVP") == FALSE)
|
||||
{
|
||||
ctrl_avatar_cloth->setEnabled(false);
|
||||
ctrl_avatar_cloth->setEnabled(FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
ctrl_avatar_cloth->setEnabled(true);
|
||||
ctrl_avatar_cloth->setEnabled(TRUE);
|
||||
}
|
||||
|
||||
// Vertex Shaders
|
||||
// Global Shader Enable
|
||||
LLCheckBoxCtrl* ctrl_shader_enable = getChild<LLCheckBoxCtrl>("BasicShaders");
|
||||
// radio set for terrain detail mode
|
||||
LLRadioGroup* mRadioTerrainDetail = getChild<LLRadioGroup>("TerrainDetailRadio"); // can be linked with control var
|
||||
LLSliderCtrl* terrain_detail = getChild<LLSliderCtrl>("TerrainDetail"); // can be linked with control var
|
||||
LLTextBox* terrain_text = getChild<LLTextBox>("TerrainDetailText");
|
||||
|
||||
ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"));
|
||||
|
||||
BOOL shaders = ctrl_shader_enable->get();
|
||||
if (shaders)
|
||||
{
|
||||
mRadioTerrainDetail->setValue(1);
|
||||
mRadioTerrainDetail->setEnabled(FALSE);
|
||||
terrain_detail->setValue(1);
|
||||
terrain_detail->setEnabled(FALSE);
|
||||
terrain_text->setEnabled(FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
mRadioTerrainDetail->setEnabled(TRUE);
|
||||
terrain_detail->setEnabled(TRUE);
|
||||
terrain_text->setEnabled(TRUE);
|
||||
}
|
||||
|
||||
// WindLight
|
||||
LLCheckBoxCtrl* ctrl_wind_light = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders");
|
||||
|
||||
LLCheckBoxCtrl* ctrl_wind_light2 = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders2");
|
||||
LLSliderCtrl* sky = getChild<LLSliderCtrl>("SkyMeshDetail");
|
||||
LLTextBox* sky_text = getChild<LLTextBox>("SkyMeshDetailText");
|
||||
|
||||
// *HACK just checks to see if we can use shaders...
|
||||
// maybe some cards that use shaders, but don't support windlight
|
||||
ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders);
|
||||
ctrl_wind_light2->setEnabled(ctrl_shader_enable->getEnabled() && shaders);
|
||||
|
||||
sky->setEnabled(ctrl_wind_light->get() && shaders);
|
||||
sky_text->setEnabled(ctrl_wind_light->get() && shaders);
|
||||
|
||||
//Deferred/SSAO/Shadows
|
||||
LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders");
|
||||
|
|
@ -1180,6 +1205,7 @@ void LLFloaterPreference::refreshEnabledState()
|
|||
LLCheckBoxCtrl* ctrl_ssao = getChild<LLCheckBoxCtrl>("UseSSAO");
|
||||
LLCheckBoxCtrl* ctrl_dof = getChild<LLCheckBoxCtrl>("UseDoF");
|
||||
LLComboBox* ctrl_shadow = getChild<LLComboBox>("ShadowDetail");
|
||||
LLTextBox* shadow_text = getChild<LLTextBox>("RenderShadowDetailText");
|
||||
|
||||
// note, okay here to get from ctrl_deferred as it's twin, ctrl_deferred2 will alway match it
|
||||
enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE);
|
||||
|
|
@ -1192,7 +1218,69 @@ void LLFloaterPreference::refreshEnabledState()
|
|||
enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail");
|
||||
|
||||
ctrl_shadow->setEnabled(enabled);
|
||||
|
||||
shadow_text->setEnabled(enabled);
|
||||
|
||||
LLTextBox* maximum_arc_text = getChild<LLTextBox>("MaximumARCText");
|
||||
|
||||
enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseImpostors") && gSavedSettings.getBOOL("RenderUseImpostors");
|
||||
getChildView("MaximumARC")->setEnabled(enabled);
|
||||
maximum_arc_text->setEnabled(enabled);
|
||||
|
||||
// Hardware settings
|
||||
F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple");
|
||||
S32Megabytes min_tex_mem = LLViewerTextureList::getMinVideoRamSetting();
|
||||
S32Megabytes max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(false, mem_multiplier);
|
||||
getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMinValue(min_tex_mem.value());
|
||||
getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem.value());
|
||||
|
||||
if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") ||
|
||||
!gGLManager.mHasVertexBufferObject)
|
||||
{
|
||||
getChildView("vbo")->setEnabled(FALSE);
|
||||
}
|
||||
|
||||
if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderCompressTextures") ||
|
||||
!gGLManager.mHasVertexBufferObject)
|
||||
{
|
||||
getChildView("texture compression")->setEnabled(FALSE);
|
||||
}
|
||||
|
||||
// if no windlight shaders, turn off nighttime brightness, gamma, and fog distance
|
||||
LLUICtrl* gamma_ctrl = getChild<LLUICtrl>("gamma");
|
||||
gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders());
|
||||
getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders());
|
||||
getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders());
|
||||
getChildView("antialiasing restart")->setVisible(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred"));
|
||||
|
||||
/* Disabling this block of code because canUseAntiAliasing currently always returns true
|
||||
// anti-aliasing
|
||||
LLComboBox* fsaa_ctrl = getChild<LLComboBox>("fsaa");
|
||||
LLTextBox* fsaa_text = getChild<LLTextBox>("antialiasing label");
|
||||
LLTextBox* fsaa_restart = getChild<LLTextBox>("antialiasing restart");
|
||||
|
||||
// Enable or disable the control, the "Antialiasing:" label and the restart warning
|
||||
// based on code support for the feature on the current hardware.
|
||||
|
||||
if (gPipeline.canUseAntiAliasing())
|
||||
{
|
||||
fsaa_ctrl->setEnabled(TRUE);
|
||||
|
||||
LLColor4 color = LLUIColorTable::instance().getColor("LabelTextColor");
|
||||
fsaa_text->setColor(color);
|
||||
|
||||
fsaa_restart->setVisible(!gSavedSettings.getBOOL("RenderDeferred"));
|
||||
}
|
||||
else
|
||||
{
|
||||
fsaa_ctrl->setEnabled(FALSE);
|
||||
fsaa_ctrl->setValue((LLSD::Integer) 0);
|
||||
|
||||
LLColor4 color = LLUIColorTable::instance().getColor("LabelDisabledColor");
|
||||
fsaa_text->setColor(color);
|
||||
|
||||
fsaa_restart->setVisible(FALSE);
|
||||
}
|
||||
*/
|
||||
|
||||
// now turn off any features that are unavailable
|
||||
disableUnavailableSettings();
|
||||
|
|
@ -1206,16 +1294,21 @@ void LLFloaterPreference::refreshEnabledState()
|
|||
void LLFloaterPreference::disableUnavailableSettings()
|
||||
{
|
||||
LLComboBox* ctrl_reflections = getChild<LLComboBox>("Reflections");
|
||||
LLTextBox* reflections_text = getChild<LLTextBox>("ReflectionsText");
|
||||
LLCheckBoxCtrl* ctrl_avatar_vp = getChild<LLCheckBoxCtrl>("AvatarVertexProgram");
|
||||
LLCheckBoxCtrl* ctrl_avatar_cloth = getChild<LLCheckBoxCtrl>("AvatarCloth");
|
||||
LLCheckBoxCtrl* ctrl_shader_enable = getChild<LLCheckBoxCtrl>("BasicShaders");
|
||||
LLCheckBoxCtrl* ctrl_wind_light = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders");
|
||||
LLCheckBoxCtrl* ctrl_avatar_impostors = getChild<LLCheckBoxCtrl>("AvatarImpostors");
|
||||
LLSliderCtrl* ctrl_maximum_arc = getChild<LLSliderCtrl>("MaximumARC");
|
||||
LLTextBox* maximum_arc_text = getChild<LLTextBox>("MaximumARCText");
|
||||
LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders");
|
||||
LLCheckBoxCtrl* ctrl_deferred2 = getChild<LLCheckBoxCtrl>("UseLightShaders2");
|
||||
LLComboBox* ctrl_shadows = getChild<LLComboBox>("ShadowDetail");
|
||||
LLTextBox* shadows_text = getChild<LLTextBox>("RenderShadowDetailText");
|
||||
LLCheckBoxCtrl* ctrl_ssao = getChild<LLCheckBoxCtrl>("UseSSAO");
|
||||
LLCheckBoxCtrl* ctrl_dof = getChild<LLCheckBoxCtrl>("UseDoF");
|
||||
LLSliderCtrl* sky = getChild<LLSliderCtrl>("SkyMeshDetail");
|
||||
LLTextBox* sky_text = getChild<LLTextBox>("SkyMeshDetailText");
|
||||
|
||||
// if vertex shaders off, disable all shader related products
|
||||
if (!LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"))
|
||||
|
|
@ -1225,9 +1318,13 @@ void LLFloaterPreference::disableUnavailableSettings()
|
|||
|
||||
ctrl_wind_light->setEnabled(FALSE);
|
||||
ctrl_wind_light->setValue(FALSE);
|
||||
|
||||
|
||||
sky->setEnabled(FALSE);
|
||||
sky_text->setEnabled(FALSE);
|
||||
|
||||
ctrl_reflections->setEnabled(FALSE);
|
||||
ctrl_reflections->setValue(0);
|
||||
reflections_text->setEnabled(FALSE);
|
||||
|
||||
ctrl_avatar_vp->setEnabled(FALSE);
|
||||
ctrl_avatar_vp->setValue(FALSE);
|
||||
|
|
@ -1237,6 +1334,7 @@ void LLFloaterPreference::disableUnavailableSettings()
|
|||
|
||||
ctrl_shadows->setEnabled(FALSE);
|
||||
ctrl_shadows->setValue(0);
|
||||
shadows_text->setEnabled(FALSE);
|
||||
|
||||
ctrl_ssao->setEnabled(FALSE);
|
||||
ctrl_ssao->setValue(FALSE);
|
||||
|
|
@ -1256,9 +1354,13 @@ void LLFloaterPreference::disableUnavailableSettings()
|
|||
ctrl_wind_light->setEnabled(FALSE);
|
||||
ctrl_wind_light->setValue(FALSE);
|
||||
|
||||
sky->setEnabled(FALSE);
|
||||
sky_text->setEnabled(FALSE);
|
||||
|
||||
//deferred needs windlight, disable deferred
|
||||
ctrl_shadows->setEnabled(FALSE);
|
||||
ctrl_shadows->setValue(0);
|
||||
shadows_text->setEnabled(FALSE);
|
||||
|
||||
ctrl_ssao->setEnabled(FALSE);
|
||||
ctrl_ssao->setValue(FALSE);
|
||||
|
|
@ -1278,6 +1380,7 @@ void LLFloaterPreference::disableUnavailableSettings()
|
|||
{
|
||||
ctrl_shadows->setEnabled(FALSE);
|
||||
ctrl_shadows->setValue(0);
|
||||
shadows_text->setEnabled(FALSE);
|
||||
|
||||
ctrl_ssao->setEnabled(FALSE);
|
||||
ctrl_ssao->setValue(FALSE);
|
||||
|
|
@ -1303,6 +1406,7 @@ void LLFloaterPreference::disableUnavailableSettings()
|
|||
{
|
||||
ctrl_shadows->setEnabled(FALSE);
|
||||
ctrl_shadows->setValue(0);
|
||||
shadows_text->setEnabled(FALSE);
|
||||
}
|
||||
|
||||
// disabled reflections
|
||||
|
|
@ -1310,6 +1414,7 @@ void LLFloaterPreference::disableUnavailableSettings()
|
|||
{
|
||||
ctrl_reflections->setEnabled(FALSE);
|
||||
ctrl_reflections->setValue(FALSE);
|
||||
reflections_text->setEnabled(FALSE);
|
||||
}
|
||||
|
||||
// disabled av
|
||||
|
|
@ -1324,6 +1429,7 @@ void LLFloaterPreference::disableUnavailableSettings()
|
|||
//deferred needs AvatarVP, disable deferred
|
||||
ctrl_shadows->setEnabled(FALSE);
|
||||
ctrl_shadows->setValue(0);
|
||||
shadows_text->setEnabled(FALSE);
|
||||
|
||||
ctrl_ssao->setEnabled(FALSE);
|
||||
ctrl_ssao->setValue(FALSE);
|
||||
|
|
@ -1347,8 +1453,8 @@ void LLFloaterPreference::disableUnavailableSettings()
|
|||
// disabled impostors
|
||||
if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderUseImpostors"))
|
||||
{
|
||||
ctrl_avatar_impostors->setEnabled(FALSE);
|
||||
ctrl_avatar_impostors->setValue(FALSE);
|
||||
ctrl_maximum_arc->setEnabled(FALSE);
|
||||
maximum_arc_text->setEnabled(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1356,6 +1462,8 @@ void LLFloaterPreference::refresh()
|
|||
{
|
||||
LLPanel::refresh();
|
||||
|
||||
getChild<LLUICtrl>("fsaa")->setValue((LLSD::Integer) gSavedSettings.getU32("RenderFSAASamples"));
|
||||
|
||||
// sliders and their text boxes
|
||||
// mPostProcess = gSavedSettings.getS32("RenderGlowResolutionPow");
|
||||
// slider text boxes
|
||||
|
|
@ -1363,12 +1471,14 @@ void LLFloaterPreference::refresh()
|
|||
updateSliderText(getChild<LLSliderCtrl>("FlexibleMeshDetail", true), getChild<LLTextBox>("FlexibleMeshDetailText", true));
|
||||
updateSliderText(getChild<LLSliderCtrl>("TreeMeshDetail", true), getChild<LLTextBox>("TreeMeshDetailText", true));
|
||||
updateSliderText(getChild<LLSliderCtrl>("AvatarMeshDetail", true), getChild<LLTextBox>("AvatarMeshDetailText", true));
|
||||
updateSliderText(getChild<LLSliderCtrl>("AvatarMeshDetail2", true), getChild<LLTextBox>("AvatarMeshDetailText2", true));
|
||||
updateSliderText(getChild<LLSliderCtrl>("AvatarPhysicsDetail", true), getChild<LLTextBox>("AvatarPhysicsDetailText", true));
|
||||
updateSliderText(getChild<LLSliderCtrl>("TerrainMeshDetail", true), getChild<LLTextBox>("TerrainMeshDetailText", true));
|
||||
updateSliderText(getChild<LLSliderCtrl>("RenderPostProcess", true), getChild<LLTextBox>("PostProcessText", true));
|
||||
updateSliderText(getChild<LLSliderCtrl>("SkyMeshDetail", true), getChild<LLTextBox>("SkyMeshDetailText", true));
|
||||
|
||||
updateSliderText(getChild<LLSliderCtrl>("TerrainDetail", true), getChild<LLTextBox>("TerrainDetailText", true));
|
||||
updateImpostorsText(getChild<LLSliderCtrl>("MaxNumberAvatarDrawn", true), getChild<LLTextBox>("ImpostorsText", true));
|
||||
updateMaximumArcText(getChild<LLSliderCtrl>("MaximumARC", true), getChild<LLTextBox>("MaximumARCText", true));
|
||||
|
||||
refreshEnabledState();
|
||||
}
|
||||
|
||||
|
|
@ -1625,7 +1735,7 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b
|
|||
{
|
||||
if (text_box == NULL || ctrl== NULL)
|
||||
return;
|
||||
|
||||
|
||||
// get range and points when text should change
|
||||
F32 value = (F32)ctrl->getValue().asReal();
|
||||
F32 min = ctrl->getMinValue();
|
||||
|
|
@ -1634,7 +1744,7 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b
|
|||
llassert(range > 0);
|
||||
F32 midPoint = min + range / 3.0f;
|
||||
F32 highPoint = min + (2.0f * range / 3.0f);
|
||||
|
||||
|
||||
// choose the right text
|
||||
if (value < midPoint)
|
||||
{
|
||||
|
|
@ -1650,6 +1760,61 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b
|
|||
}
|
||||
}
|
||||
|
||||
void LLFloaterPreference::updateImpostorsText(LLSliderCtrl* ctrl, LLTextBox* text_box)
|
||||
{
|
||||
F32 value = (F32)ctrl->getValue().asReal();
|
||||
|
||||
if (value < IMPOSTORS_OFF)
|
||||
{
|
||||
text_box->setText(llformat("%0.0f", value));
|
||||
if (!gSavedSettings.getBOOL("RenderUseImpostors"))
|
||||
{
|
||||
gSavedSettings.setBOOL("RenderUseImpostors", true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
text_box->setText(LLTrans::getString("no_limit"));
|
||||
gSavedSettings.setBOOL("RenderUseImpostors", false);
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterPreference::updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* text_box)
|
||||
{
|
||||
F32 min_result = 20000.0f;
|
||||
F32 max_result = 300000.0f;
|
||||
|
||||
F32 value = (F32)ctrl->getValue().asReal();
|
||||
|
||||
if (101.0f == value)
|
||||
{
|
||||
// It has been decided that having the slider all the way to the right will be the off position, which
|
||||
// is a value of 101, so it is necessary to change value to 0 disable impostor generation.
|
||||
value = 0.0f;
|
||||
text_box->setText(LLTrans::getString("no_limit"));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// 100 is the maximum value of this control set in panel_preferences_graphics1.xml
|
||||
F32 minp = 1.0f;
|
||||
F32 maxp = 100.0f;
|
||||
|
||||
// The result should be between min_result and max_result
|
||||
F32 minv = log(min_result);
|
||||
F32 maxv = log(max_result);
|
||||
|
||||
// calculate adjustment factor
|
||||
F32 scale = (maxv - minv) / (maxp - minp);
|
||||
|
||||
value = exp(minv + scale * (value - minp));
|
||||
|
||||
text_box->setText(llformat("%0.0f", value));
|
||||
}
|
||||
|
||||
gSavedSettings.setU32("RenderAutoMuteRenderWeightLimit", (U32)value);
|
||||
}
|
||||
|
||||
void LLFloaterPreference::onChangeMaturity()
|
||||
{
|
||||
U8 sim_access = gSavedSettings.getU32("PreferredMaturity");
|
||||
|
|
@ -1849,6 +2014,9 @@ LLPanelPreference::LLPanelPreference()
|
|||
{
|
||||
mCommitCallbackRegistrar.add("Pref.setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2));
|
||||
mCommitCallbackRegistrar.add("Pref.updateMediaAutoPlayCheckbox", boost::bind(&LLPanelPreference::updateMediaAutoPlayCheckbox, this, _1));
|
||||
mCommitCallbackRegistrar.add("Pref.PrefDelete", boost::bind(&LLPanelPreference::deletePreset, this, _2));
|
||||
mCommitCallbackRegistrar.add("Pref.PrefSave", boost::bind(&LLPanelPreference::savePreset, this, _2));
|
||||
mCommitCallbackRegistrar.add("Pref.PrefLoad", boost::bind(&LLPanelPreference::loadPreset, this, _2));
|
||||
}
|
||||
|
||||
//virtual
|
||||
|
|
@ -2046,6 +2214,28 @@ void LLPanelPreference::updateMediaAutoPlayCheckbox(LLUICtrl* ctrl)
|
|||
}
|
||||
}
|
||||
|
||||
void LLPanelPreference::deletePreset(const LLSD& user_data)
|
||||
{
|
||||
std::string subdirectory = user_data.asString();
|
||||
LLFloaterReg::showInstance("delete_pref_preset", subdirectory);
|
||||
}
|
||||
|
||||
void LLPanelPreference::savePreset(const LLSD& user_data)
|
||||
{
|
||||
std::string subdirectory = user_data.asString();
|
||||
LLFloaterReg::showInstance("save_pref_preset", subdirectory);
|
||||
}
|
||||
|
||||
void LLPanelPreference::loadPreset(const LLSD& user_data)
|
||||
{
|
||||
std::string subdirectory = user_data.asString();
|
||||
LLFloaterReg::showInstance("load_pref_preset", subdirectory);
|
||||
}
|
||||
|
||||
void LLPanelPreference::setHardwareDefaults()
|
||||
{
|
||||
}
|
||||
|
||||
class LLPanelPreferencePrivacy : public LLPanelPreference
|
||||
{
|
||||
public:
|
||||
|
|
@ -2089,21 +2279,65 @@ static LLPanelInjector<LLPanelPreferencePrivacy> t_pref_privacy("panel_preferenc
|
|||
|
||||
BOOL LLPanelPreferenceGraphics::postBuild()
|
||||
{
|
||||
// Don't do this on Mac as their braindead GL versioning
|
||||
// sets this when 8x and 16x are indeed available
|
||||
//
|
||||
#if !LL_DARWIN
|
||||
if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f)
|
||||
{ //remove FSAA settings above "4x"
|
||||
LLComboBox* combo = getChild<LLComboBox>("fsaa");
|
||||
combo->remove("8x");
|
||||
combo->remove("16x");
|
||||
}
|
||||
#endif
|
||||
|
||||
resetDirtyChilds();
|
||||
setPresetText();
|
||||
|
||||
LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelPreferenceGraphics::onPresetsListChange, this));
|
||||
|
||||
return LLPanelPreference::postBuild();
|
||||
}
|
||||
|
||||
void LLPanelPreferenceGraphics::draw()
|
||||
{
|
||||
setPresetText();
|
||||
LLPanelPreference::draw();
|
||||
|
||||
LLButton* button_apply = findChild<LLButton>("Apply");
|
||||
|
||||
if (button_apply && button_apply->getVisible())
|
||||
{
|
||||
bool enable = hasDirtyChilds();
|
||||
|
||||
button_apply->setEnabled(enable);
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelPreferenceGraphics::onPresetsListChange()
|
||||
{
|
||||
resetDirtyChilds();
|
||||
setPresetText();
|
||||
}
|
||||
|
||||
void LLPanelPreferenceGraphics::setPresetText()
|
||||
{
|
||||
LLTextBox* preset_text = getChild<LLTextBox>("preset_text");
|
||||
|
||||
std::string preset_graphic_active = gSavedSettings.getString("PresetGraphicActive");
|
||||
|
||||
if (hasDirtyChilds() && !preset_graphic_active.empty())
|
||||
{
|
||||
gSavedSettings.setString("PresetGraphicActive", "");
|
||||
preset_graphic_active.clear();
|
||||
// This doesn't seem to cause an infinite recursion. This trigger is needed to cause the pulldown
|
||||
// panel to update.
|
||||
LLPresetsManager::getInstance()->triggerChangeSignal();
|
||||
}
|
||||
|
||||
if (!preset_graphic_active.empty())
|
||||
{
|
||||
preset_text->setText(preset_graphic_active);
|
||||
}
|
||||
else
|
||||
{
|
||||
preset_text->setText(LLTrans::getString("none_paren_cap"));
|
||||
}
|
||||
|
||||
preset_text->resetDirty();
|
||||
}
|
||||
|
||||
bool LLPanelPreferenceGraphics::hasDirtyChilds()
|
||||
{
|
||||
std::list<LLView*> view_stack;
|
||||
|
|
@ -2118,7 +2352,17 @@ bool LLPanelPreferenceGraphics::hasDirtyChilds()
|
|||
if (ctrl)
|
||||
{
|
||||
if (ctrl->isDirty())
|
||||
return true;
|
||||
{
|
||||
LLControlVariable* control = ctrl->getControlVariable();
|
||||
if (control)
|
||||
{
|
||||
std::string control_name = control->getName();
|
||||
if (!control_name.empty())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Push children onto the end of the work stack
|
||||
for (child_list_t::const_iterator iter = curview->getChildList()->begin();
|
||||
|
|
@ -2126,7 +2370,8 @@ bool LLPanelPreferenceGraphics::hasDirtyChilds()
|
|||
{
|
||||
view_stack.push_back(*iter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -2153,14 +2398,9 @@ void LLPanelPreferenceGraphics::resetDirtyChilds()
|
|||
}
|
||||
}
|
||||
}
|
||||
void LLPanelPreferenceGraphics::apply()
|
||||
{
|
||||
resetDirtyChilds();
|
||||
LLPanelPreference::apply();
|
||||
}
|
||||
|
||||
void LLPanelPreferenceGraphics::cancel()
|
||||
{
|
||||
resetDirtyChilds();
|
||||
LLPanelPreference::cancel();
|
||||
}
|
||||
void LLPanelPreferenceGraphics::saveSettings()
|
||||
|
|
|
|||
|
|
@ -58,6 +58,9 @@ typedef enum
|
|||
|
||||
} EGraphicsSettings;
|
||||
|
||||
// 65 is the maximum value for impostors set in the xml file. When the slider reaches this
|
||||
// value impostors are turned off.
|
||||
const U32 IMPOSTORS_OFF = 66;
|
||||
|
||||
// Floater to control preferences (display, audio, bandwidth, general.
|
||||
class LLFloaterPreference : public LLFloater, public LLAvatarPropertiesObserver, public LLConversationLogObserver
|
||||
|
|
@ -93,11 +96,11 @@ public:
|
|||
void saveAvatarProperties( void );
|
||||
void selectPrivacyPanel();
|
||||
void selectChatPanel();
|
||||
void getControlNames(std::vector<std::string>& names);
|
||||
|
||||
protected:
|
||||
void onBtnOK();
|
||||
void onBtnCancel();
|
||||
void onBtnApply();
|
||||
|
||||
void onClickClearCache(); // Clear viewer texture cache, vfs, and VO cache on next startup
|
||||
void onClickBrowserClearCache(); // Clear web history and caches as well as viewer caches above
|
||||
|
|
@ -111,11 +114,13 @@ protected:
|
|||
// if the custom settings box is clicked
|
||||
void onChangeCustom();
|
||||
void updateMeterText(LLUICtrl* ctrl);
|
||||
void onOpenHardwareSettings();
|
||||
// callback for defaults
|
||||
void setHardwareDefaults();
|
||||
void setRecommended();
|
||||
// callback for when client turns on shaders
|
||||
void onVertexShaderEnable();
|
||||
// callback for when client turns on impostors
|
||||
void onAvatarImpostorsEnable();
|
||||
|
||||
// callback for commit in the "Single click on land" and "Double click on land" comboboxes.
|
||||
void onClickActionChange();
|
||||
|
|
@ -157,6 +162,8 @@ public:
|
|||
void onChangeQuality(const LLSD& data);
|
||||
|
||||
void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box);
|
||||
void updateImpostorsText(LLSliderCtrl* ctrl, LLTextBox* text_box);
|
||||
void updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* text_box);
|
||||
void refreshUI();
|
||||
|
||||
void onCommitParcelMediaAutoPlayEnable();
|
||||
|
|
@ -209,7 +216,7 @@ public:
|
|||
virtual void apply();
|
||||
virtual void cancel();
|
||||
void setControlFalse(const LLSD& user_data);
|
||||
virtual void setHardwareDefaults(){};
|
||||
virtual void setHardwareDefaults();
|
||||
|
||||
// Disables "Allow Media to auto play" check box only when both
|
||||
// "Streaming Music" and "Media" are unchecked. Otherwise enables it.
|
||||
|
|
@ -218,7 +225,11 @@ public:
|
|||
// This function squirrels away the current values of the controls so that
|
||||
// cancel() can restore them.
|
||||
virtual void saveSettings();
|
||||
|
||||
|
||||
void deletePreset(const LLSD& user_data);
|
||||
void savePreset(const LLSD& user_data);
|
||||
void loadPreset(const LLSD& user_data);
|
||||
|
||||
class Updater;
|
||||
|
||||
protected:
|
||||
|
|
@ -242,14 +253,20 @@ class LLPanelPreferenceGraphics : public LLPanelPreference
|
|||
public:
|
||||
BOOL postBuild();
|
||||
void draw();
|
||||
void apply();
|
||||
void cancel();
|
||||
void saveSettings();
|
||||
void resetDirtyChilds();
|
||||
void setHardwareDefaults();
|
||||
void setPresetText();
|
||||
|
||||
static const std::string getPresetsPath();
|
||||
|
||||
protected:
|
||||
bool hasDirtyChilds();
|
||||
void resetDirtyChilds();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
void onPresetsListChange();
|
||||
};
|
||||
|
||||
class LLFloaterPreferenceProxy : public LLFloater
|
||||
|
|
|
|||
|
|
@ -0,0 +1,102 @@
|
|||
/**
|
||||
* @file llfloatersaveprefpreset.cpp
|
||||
* @brief Floater to save a graphics / camera preset
|
||||
*
|
||||
* $LicenseInfo:firstyear=2014&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2014, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llfloatersaveprefpreset.h"
|
||||
|
||||
#include "llbutton.h"
|
||||
#include "llcombobox.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llpresetsmanager.h"
|
||||
|
||||
LLFloaterSavePrefPreset::LLFloaterSavePrefPreset(const LLSD &key)
|
||||
: LLFloater(key)
|
||||
{
|
||||
}
|
||||
|
||||
// virtual
|
||||
BOOL LLFloaterSavePrefPreset::postBuild()
|
||||
{
|
||||
getChild<LLComboBox>("preset_combo")->setTextEntryCallback(boost::bind(&LLFloaterSavePrefPreset::onPresetNameEdited, this));
|
||||
getChild<LLComboBox>("preset_combo")->setCommitCallback(boost::bind(&LLFloaterSavePrefPreset::onPresetNameEdited, this));
|
||||
getChild<LLButton>("save")->setCommitCallback(boost::bind(&LLFloaterSavePrefPreset::onBtnSave, this));
|
||||
getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterSavePrefPreset::onBtnCancel, this));
|
||||
|
||||
LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterSavePrefPreset::onPresetsListChange, this));
|
||||
|
||||
mSaveButton = getChild<LLButton>("save");
|
||||
mPresetCombo = getChild<LLComboBox>("preset_combo");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLFloaterSavePrefPreset::onPresetNameEdited()
|
||||
{
|
||||
// Disable saving a preset having empty name.
|
||||
std::string name = mPresetCombo->getSimple();
|
||||
|
||||
mSaveButton->setEnabled(!name.empty());
|
||||
}
|
||||
|
||||
void LLFloaterSavePrefPreset::onOpen(const LLSD& key)
|
||||
{
|
||||
mSubdirectory = key.asString();
|
||||
|
||||
std::string floater_title = getString(std::string("title_") + mSubdirectory);
|
||||
|
||||
setTitle(floater_title);
|
||||
|
||||
EDefaultOptions option = DEFAULT_TOP;
|
||||
LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, mPresetCombo, option);
|
||||
|
||||
onPresetNameEdited();
|
||||
}
|
||||
|
||||
void LLFloaterSavePrefPreset::onBtnSave()
|
||||
{
|
||||
std::string name = mPresetCombo->getSimple();
|
||||
|
||||
if (!LLPresetsManager::getInstance()->savePreset(mSubdirectory, name))
|
||||
{
|
||||
LLSD args;
|
||||
args["NAME"] = name;
|
||||
LLNotificationsUtil::add("PresetNotSaved", args);
|
||||
}
|
||||
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void LLFloaterSavePrefPreset::onPresetsListChange()
|
||||
{
|
||||
EDefaultOptions option = DEFAULT_TOP;
|
||||
LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, mPresetCombo, option);
|
||||
}
|
||||
|
||||
void LLFloaterSavePrefPreset::onBtnCancel()
|
||||
{
|
||||
closeFloater();
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
/**
|
||||
* @file llfloatersaveprefpreset.h
|
||||
* @brief Floater to save a graphics / camera preset
|
||||
|
||||
*
|
||||
* $LicenseInfo:firstyear=2014&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2014, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLFLOATERSAVEPREFPRESET_H
|
||||
#define LL_LLFLOATERSAVEPREFPRESET_H
|
||||
|
||||
#include "llfloater.h"
|
||||
|
||||
class LLComboBox;
|
||||
|
||||
class LLFloaterSavePrefPreset : public LLFloater
|
||||
{
|
||||
|
||||
public:
|
||||
LLFloaterSavePrefPreset(const LLSD &key);
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
|
||||
void onBtnSave();
|
||||
void onBtnCancel();
|
||||
|
||||
private:
|
||||
LLComboBox* mPresetCombo;
|
||||
LLButton* mSaveButton;
|
||||
|
||||
void onPresetsListChange();
|
||||
void onPresetNameEdited();
|
||||
|
||||
std::string mSubdirectory;
|
||||
};
|
||||
|
||||
#endif // LL_LLFLOATERSAVEPREFPRESET_H
|
||||
|
|
@ -65,6 +65,9 @@ extern LLControlGroup gSavedSettings;
|
|||
static const LLUUID PARCEL_MEDIA_LIST_ITEM_UUID = LLUUID("CAB5920F-E484-4233-8621-384CF373A321");
|
||||
static const LLUUID PARCEL_AUDIO_LIST_ITEM_UUID = LLUUID("DF4B020D-8A24-4B95-AB5D-CA970D694822");
|
||||
|
||||
const F32 AUTO_CLOSE_FADE_TIME_START= 2.0f;
|
||||
const F32 AUTO_CLOSE_FADE_TIME_END = 3.0f;
|
||||
|
||||
//
|
||||
// LLPanelNearByMedia
|
||||
//
|
||||
|
|
@ -227,9 +230,6 @@ void LLPanelNearByMedia::reshape(S32 width, S32 height, BOOL called_from_parent)
|
|||
|
||||
}
|
||||
|
||||
const F32 AUTO_CLOSE_FADE_TIME_START= 4.0f;
|
||||
const F32 AUTO_CLOSE_FADE_TIME_END = 5.0f;
|
||||
|
||||
/*virtual*/
|
||||
void LLPanelNearByMedia::draw()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,188 @@
|
|||
/**
|
||||
* @file llpanelpresetspulldown.cpp
|
||||
* @brief A panel showing a quick way to pick presets
|
||||
*
|
||||
* $LicenseInfo:firstyear=2014&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2014, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llpanelpresetspulldown.h"
|
||||
|
||||
#include "llviewercontrol.h"
|
||||
#include "llstatusbar.h"
|
||||
|
||||
#include "llbutton.h"
|
||||
#include "lltabcontainer.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llfloaterpreference.h"
|
||||
#include "llpresetsmanager.h"
|
||||
#include "llsliderctrl.h"
|
||||
#include "llscrolllistctrl.h"
|
||||
|
||||
/* static */ const F32 LLPanelPresetsPulldown::sAutoCloseFadeStartTimeSec = 2.0f;
|
||||
/* static */ const F32 LLPanelPresetsPulldown::sAutoCloseTotalTimeSec = 3.0f;
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
/// Class LLPanelPresetsPulldown
|
||||
///----------------------------------------------------------------------------
|
||||
|
||||
// Default constructor
|
||||
LLPanelPresetsPulldown::LLPanelPresetsPulldown()
|
||||
{
|
||||
mHoverTimer.stop();
|
||||
|
||||
mCommitCallbackRegistrar.add("Presets.GoGraphicsPrefs", boost::bind(&LLPanelPresetsPulldown::onGraphicsButtonClick, this, _2));
|
||||
mCommitCallbackRegistrar.add("Presets.RowClick", boost::bind(&LLPanelPresetsPulldown::onRowClick, this, _2));
|
||||
|
||||
buildFromFile( "panel_presets_pulldown.xml");
|
||||
}
|
||||
|
||||
BOOL LLPanelPresetsPulldown::postBuild()
|
||||
{
|
||||
LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelPresetsPulldown::populatePanel, this));
|
||||
// Make sure there is a default preference file
|
||||
LLPresetsManager::getInstance()->createMissingDefault();
|
||||
|
||||
populatePanel();
|
||||
|
||||
return LLPanel::postBuild();
|
||||
}
|
||||
|
||||
void LLPanelPresetsPulldown::populatePanel()
|
||||
{
|
||||
std::string presets_dir = LLPresetsManager::getInstance()->getPresetsDir(PRESETS_GRAPHIC);
|
||||
LLPresetsManager::getInstance()->loadPresetNamesFromDir(presets_dir, mPresetNames, DEFAULT_TOP);
|
||||
|
||||
LLScrollListCtrl* scroll = getChild<LLScrollListCtrl>("preset_list");
|
||||
|
||||
if (scroll && mPresetNames.begin() != mPresetNames.end())
|
||||
{
|
||||
scroll->clearRows();
|
||||
|
||||
for (std::list<std::string>::const_iterator it = mPresetNames.begin(); it != mPresetNames.end(); ++it)
|
||||
{
|
||||
const std::string& name = *it;
|
||||
|
||||
LLSD row;
|
||||
row["columns"][0]["column"] = "preset_name";
|
||||
row["columns"][0]["value"] = name;
|
||||
|
||||
if (name == gSavedSettings.getString("PresetGraphicActive"))
|
||||
{
|
||||
row["columns"][1]["column"] = "icon";
|
||||
row["columns"][1]["type"] = "icon";
|
||||
row["columns"][1]["value"] = "Check_Mark";
|
||||
}
|
||||
|
||||
scroll->addElement(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
void LLPanelPresetsPulldown::onMouseEnter(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
mHoverTimer.stop();
|
||||
LLPanel::onMouseEnter(x,y,mask);
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
void LLPanelPresetsPulldown::onTopLost()
|
||||
{
|
||||
setVisible(FALSE);
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
void LLPanelPresetsPulldown::onMouseLeave(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
mHoverTimer.start();
|
||||
LLPanel::onMouseLeave(x,y,mask);
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
void LLPanelPresetsPulldown::onVisibilityChange ( BOOL new_visibility )
|
||||
{
|
||||
if (new_visibility)
|
||||
{
|
||||
mHoverTimer.start(); // timer will be stopped when mouse hovers over panel
|
||||
}
|
||||
else
|
||||
{
|
||||
mHoverTimer.stop();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelPresetsPulldown::onRowClick(const LLSD& user_data)
|
||||
{
|
||||
LLScrollListCtrl* scroll = getChild<LLScrollListCtrl>("preset_list");
|
||||
|
||||
if (scroll)
|
||||
{
|
||||
LLScrollListItem* item = scroll->getFirstSelected();
|
||||
if (item)
|
||||
{
|
||||
std::string name = item->getColumn(1)->getValue().asString();
|
||||
|
||||
LLPresetsManager::getInstance()->loadPreset(PRESETS_GRAPHIC, name);
|
||||
|
||||
setVisible(FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelPresetsPulldown::onGraphicsButtonClick(const LLSD& user_data)
|
||||
{
|
||||
// close the minicontrol, we're bringing up the big one
|
||||
setVisible(FALSE);
|
||||
|
||||
// bring up the prefs floater
|
||||
LLFloater* prefsfloater = LLFloaterReg::showInstance("preferences");
|
||||
if (prefsfloater)
|
||||
{
|
||||
// grab the 'graphics' panel from the preferences floater and
|
||||
// bring it the front!
|
||||
LLTabContainer* tabcontainer = prefsfloater->getChild<LLTabContainer>("pref core");
|
||||
LLPanel* graphicspanel = prefsfloater->getChild<LLPanel>("display");
|
||||
if (tabcontainer && graphicspanel)
|
||||
{
|
||||
tabcontainer->selectTabPanel(graphicspanel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLPanelPresetsPulldown::draw()
|
||||
{
|
||||
F32 alpha = mHoverTimer.getStarted()
|
||||
? clamp_rescale(mHoverTimer.getElapsedTimeF32(), sAutoCloseFadeStartTimeSec, sAutoCloseTotalTimeSec, 1.f, 0.f)
|
||||
: 1.0f;
|
||||
LLViewDrawContext context(alpha);
|
||||
|
||||
LLPanel::draw();
|
||||
|
||||
if (alpha == 0.f)
|
||||
{
|
||||
setVisible(FALSE);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
/**
|
||||
* @file llpanelpresetspulldown.h
|
||||
* @brief A panel showing a quick way to pick presets
|
||||
*
|
||||
* $LicenseInfo:firstyear=2014&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2014, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLPANELPRESETSPULLDOWN_H
|
||||
#define LL_LLPANELPRESETSPULLDOWN_H
|
||||
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "llpanel.h"
|
||||
|
||||
class LLFrameTimer;
|
||||
|
||||
class LLPanelPresetsPulldown : public LLPanel
|
||||
{
|
||||
public:
|
||||
LLPanelPresetsPulldown();
|
||||
/*virtual*/ void draw();
|
||||
/*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask);
|
||||
/*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask);
|
||||
/*virtual*/ void onTopLost();
|
||||
/*virtual*/ void onVisibilityChange ( BOOL new_visibility );
|
||||
/*virtual*/ BOOL postBuild();
|
||||
void populatePanel();
|
||||
|
||||
private:
|
||||
void onGraphicsButtonClick(const LLSD& user_data);
|
||||
void onRowClick(const LLSD& user_data);
|
||||
|
||||
std::list<std::string> mPresetNames;
|
||||
LLFrameTimer mHoverTimer;
|
||||
static const F32 sAutoCloseFadeStartTimeSec;
|
||||
static const F32 sAutoCloseTotalTimeSec;
|
||||
};
|
||||
|
||||
#endif // LL_LLPANELPRESETSPULLDOWN_H
|
||||
|
|
@ -40,8 +40,8 @@
|
|||
#include "llfloaterpreference.h"
|
||||
#include "llsliderctrl.h"
|
||||
|
||||
/* static */ const F32 LLPanelVolumePulldown::sAutoCloseFadeStartTimeSec = 4.0f;
|
||||
/* static */ const F32 LLPanelVolumePulldown::sAutoCloseTotalTimeSec = 5.0f;
|
||||
/* static */ const F32 LLPanelVolumePulldown::sAutoCloseFadeStartTimeSec = 2.0f;
|
||||
/* static */ const F32 LLPanelVolumePulldown::sAutoCloseTotalTimeSec = 3.0f;
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
/// Class LLPanelVolumePulldown
|
||||
|
|
|
|||
|
|
@ -0,0 +1,276 @@
|
|||
/**
|
||||
* @file llpresetsmanager.cpp
|
||||
* @brief Implementation for the LLPresetsManager class.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include <boost/assign/list_of.hpp>
|
||||
|
||||
#include "llpresetsmanager.h"
|
||||
|
||||
#include "lldiriterator.h"
|
||||
#include "llfloater.h"
|
||||
#include "llsdserialize.h"
|
||||
#include "lltrans.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llfloaterpreference.h"
|
||||
#include "llfloaterreg.h"
|
||||
|
||||
LLPresetsManager::LLPresetsManager()
|
||||
{
|
||||
}
|
||||
|
||||
LLPresetsManager::~LLPresetsManager()
|
||||
{
|
||||
}
|
||||
|
||||
void LLPresetsManager::triggerChangeSignal()
|
||||
{
|
||||
mPresetListChangeSignal();
|
||||
}
|
||||
|
||||
void LLPresetsManager::createMissingDefault()
|
||||
{
|
||||
std::string default_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, PRESETS_DIR, PRESETS_GRAPHIC, "default.xml");
|
||||
if (!gDirUtilp->fileExists(default_file))
|
||||
{
|
||||
LL_WARNS() << "No " << default_file << " found -- creating one" << LL_ENDL;
|
||||
|
||||
// Write current graphic settings to default.xml
|
||||
savePreset(PRESETS_GRAPHIC, PRESETS_DEFAULT);
|
||||
|
||||
if (gSavedSettings.getString("PresetGraphicActive").empty())
|
||||
{
|
||||
gSavedSettings.setString("PresetGraphicActive", PRESETS_DEFAULT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string LLPresetsManager::getPresetsDir(const std::string& subdirectory)
|
||||
{
|
||||
std::string presets_path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, PRESETS_DIR);
|
||||
std::string full_path;
|
||||
|
||||
if (!gDirUtilp->fileExists(presets_path))
|
||||
{
|
||||
LLFile::mkdir(presets_path);
|
||||
}
|
||||
|
||||
full_path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, PRESETS_DIR, subdirectory);
|
||||
if (!gDirUtilp->fileExists(full_path))
|
||||
{
|
||||
LLFile::mkdir(full_path);
|
||||
}
|
||||
|
||||
return full_path;
|
||||
}
|
||||
|
||||
void LLPresetsManager::loadPresetNamesFromDir(const std::string& dir, preset_name_list_t& presets, EDefaultOptions default_option)
|
||||
{
|
||||
LL_INFOS("AppInit") << "Loading list of preset names from " << dir << LL_ENDL;
|
||||
|
||||
mPresetNames.clear();
|
||||
|
||||
LLDirIterator dir_iter(dir, "*.xml");
|
||||
bool found = true;
|
||||
while (found)
|
||||
{
|
||||
std::string file;
|
||||
found = dir_iter.next(file);
|
||||
|
||||
if (found)
|
||||
{
|
||||
std::string path = gDirUtilp->add(dir, file);
|
||||
std::string name = gDirUtilp->getBaseFileName(LLURI::unescape(path), /*strip_exten = */ true);
|
||||
|
||||
if (PRESETS_DEFAULT != name)
|
||||
{
|
||||
mPresetNames.push_back(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (default_option)
|
||||
{
|
||||
case DEFAULT_SHOW:
|
||||
mPresetNames.push_back(LLTrans::getString(PRESETS_DEFAULT));
|
||||
break;
|
||||
|
||||
case DEFAULT_TOP:
|
||||
mPresetNames.push_front(LLTrans::getString(PRESETS_DEFAULT));
|
||||
break;
|
||||
|
||||
case DEFAULT_HIDE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
presets = mPresetNames;
|
||||
}
|
||||
|
||||
bool LLPresetsManager::savePreset(const std::string& subdirectory, const std::string& name)
|
||||
{
|
||||
llassert(!name.empty());
|
||||
|
||||
std::vector<std::string> name_list;
|
||||
|
||||
if(PRESETS_GRAPHIC == subdirectory)
|
||||
{
|
||||
gSavedSettings.setString("PresetGraphicActive", name);
|
||||
|
||||
LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences");
|
||||
if (instance)
|
||||
{
|
||||
instance->getControlNames(name_list);
|
||||
name_list.push_back("PresetGraphicActive");
|
||||
}
|
||||
}
|
||||
|
||||
if(PRESETS_CAMERA == subdirectory)
|
||||
{
|
||||
name_list = boost::assign::list_of
|
||||
("Placeholder");
|
||||
}
|
||||
|
||||
// make an empty llsd
|
||||
LLSD paramsData(LLSD::emptyMap());
|
||||
|
||||
for (std::vector<std::string>::iterator it = name_list.begin(); it != name_list.end(); ++it)
|
||||
{
|
||||
std::string ctrl_name = *it;
|
||||
LLControlVariable* ctrl = gSavedSettings.getControl(ctrl_name).get();
|
||||
std::string comment = ctrl->getComment();
|
||||
std::string type = gSavedSettings.typeEnumToString(ctrl->type());
|
||||
LLSD value = ctrl->getValue();
|
||||
|
||||
paramsData[ctrl_name]["Comment"] = comment;
|
||||
paramsData[ctrl_name]["Persist"] = 1;
|
||||
paramsData[ctrl_name]["Type"] = type;
|
||||
paramsData[ctrl_name]["Value"] = value;
|
||||
}
|
||||
|
||||
std::string pathName(getPresetsDir(subdirectory) + gDirUtilp->getDirDelimiter() + LLURI::escape(name) + ".xml");
|
||||
|
||||
// write to file
|
||||
llofstream presetsXML(pathName);
|
||||
if (!presetsXML.is_open())
|
||||
{
|
||||
LL_WARNS("Presets") << "Cannot open for output preset file " << pathName << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter();
|
||||
formatter->format(paramsData, presetsXML, LLSDFormatter::OPTIONS_PRETTY);
|
||||
presetsXML.close();
|
||||
|
||||
gSavedSettings.setString("PresetGraphicActive", name);
|
||||
|
||||
// signal interested parties
|
||||
triggerChangeSignal();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void LLPresetsManager::setPresetNamesInComboBox(const std::string& subdirectory, LLComboBox* combo, EDefaultOptions default_option)
|
||||
{
|
||||
combo->clearRows();
|
||||
|
||||
std::string presets_dir = getPresetsDir(subdirectory);
|
||||
|
||||
if (!presets_dir.empty())
|
||||
{
|
||||
std::list<std::string> preset_names;
|
||||
loadPresetNamesFromDir(presets_dir, preset_names, default_option);
|
||||
|
||||
std::string preset_graphic_active = gSavedSettings.getString("PresetGraphicActive");
|
||||
|
||||
if (preset_names.begin() != preset_names.end())
|
||||
{
|
||||
for (std::list<std::string>::const_iterator it = preset_names.begin(); it != preset_names.end(); ++it)
|
||||
{
|
||||
const std::string& name = *it;
|
||||
combo->add(name, LLSD().with(0, name));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
combo->setLabel(LLTrans::getString("preset_combo_label"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLPresetsManager::loadPreset(const std::string& subdirectory, const std::string& name)
|
||||
{
|
||||
std::string full_path(getPresetsDir(subdirectory) + gDirUtilp->getDirDelimiter() + LLURI::escape(name) + ".xml");
|
||||
|
||||
if(gSavedSettings.loadFromFile(full_path, false, true) > 0)
|
||||
{
|
||||
if(PRESETS_GRAPHIC == subdirectory)
|
||||
{
|
||||
gSavedSettings.setString("PresetGraphicActive", name);
|
||||
}
|
||||
|
||||
LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences");
|
||||
if (instance)
|
||||
{
|
||||
instance->refreshEnabledGraphics();
|
||||
}
|
||||
triggerChangeSignal();
|
||||
}
|
||||
}
|
||||
|
||||
bool LLPresetsManager::deletePreset(const std::string& subdirectory, const std::string& name)
|
||||
{
|
||||
if (PRESETS_DEFAULT == name)
|
||||
{
|
||||
LL_WARNS("Presets") << "You are not allowed to delete the default preset." << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (gDirUtilp->deleteFilesInDir(getPresetsDir(subdirectory), LLURI::escape(name) + ".xml") < 1)
|
||||
{
|
||||
LL_WARNS("Presets") << "Error removing preset " << name << " from disk" << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
// If you delete the preset that is currently marked as loaded then also indicate that no preset is loaded.
|
||||
if (gSavedSettings.getString("PresetGraphicActive") == name)
|
||||
{
|
||||
gSavedSettings.setString("PresetGraphicActive", "");
|
||||
}
|
||||
|
||||
// signal interested parties
|
||||
triggerChangeSignal();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
boost::signals2::connection LLPresetsManager::setPresetListChangeCallback(const preset_list_signal_t::slot_type& cb)
|
||||
{
|
||||
return mPresetListChangeSignal.connect(cb);
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
/**
|
||||
* @file llpresetsmanager.h
|
||||
* @brief Implementation for the LLPresetsManager class.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_PRESETSMANAGER_H
|
||||
#define LL_PRESETSMANAGER_H
|
||||
|
||||
#include "llcombobox.h"
|
||||
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
||||
static const std::string PRESETS_DEFAULT = "Default";
|
||||
static const std::string PRESETS_DIR = "presets";
|
||||
static const std::string PRESETS_GRAPHIC = "graphic";
|
||||
static const std::string PRESETS_CAMERA = "camera";
|
||||
|
||||
enum EDefaultOptions
|
||||
{
|
||||
DEFAULT_SHOW,
|
||||
DEFAULT_TOP,
|
||||
DEFAULT_HIDE // Do not display "Default" in a list
|
||||
};
|
||||
|
||||
class LLPresetsManager : public LLSingleton<LLPresetsManager>
|
||||
{
|
||||
public:
|
||||
|
||||
typedef std::list<std::string> preset_name_list_t;
|
||||
typedef boost::signals2::signal<void()> preset_list_signal_t;
|
||||
|
||||
void createMissingDefault();
|
||||
void triggerChangeSignal();
|
||||
static std::string getPresetsDir(const std::string& subdirectory);
|
||||
void setPresetNamesInComboBox(const std::string& subdirectory, LLComboBox* combo, EDefaultOptions default_option);
|
||||
void loadPresetNamesFromDir(const std::string& dir, preset_name_list_t& presets, EDefaultOptions default_option);
|
||||
bool savePreset(const std::string& subdirectory, const std::string & name);
|
||||
void loadPreset(const std::string& subdirectory, const std::string & name);
|
||||
bool deletePreset(const std::string& subdirectory, const std::string& name);
|
||||
|
||||
// Emitted when a preset gets loaded, deleted, or saved.
|
||||
boost::signals2::connection setPresetListChangeCallback(const preset_list_signal_t::slot_type& cb);
|
||||
|
||||
// Emitted when a preset gets loaded or saved.
|
||||
|
||||
preset_name_list_t mPresetNames;
|
||||
|
||||
LLPresetsManager();
|
||||
~LLPresetsManager();
|
||||
|
||||
preset_list_signal_t mPresetListChangeSignal;
|
||||
};
|
||||
|
||||
#endif // LL_PRESETSMANAGER_H
|
||||
|
|
@ -38,6 +38,7 @@
|
|||
#include "llfloaterbuycurrency.h"
|
||||
#include "llbuycurrencyhtml.h"
|
||||
#include "llpanelnearbymedia.h"
|
||||
#include "llpanelpresetspulldown.h"
|
||||
#include "llpanelvolumepulldown.h"
|
||||
#include "llfloaterregioninfo.h"
|
||||
#include "llfloaterscriptdebug.h"
|
||||
|
|
@ -170,6 +171,9 @@ BOOL LLStatusBar::postBuild()
|
|||
|
||||
mBtnStats = getChildView("stat_btn");
|
||||
|
||||
mIconPresets = getChild<LLIconCtrl>( "presets_icon" );
|
||||
mIconPresets->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterPresets, this));
|
||||
|
||||
mBtnVolume = getChild<LLButton>( "volume_btn" );
|
||||
mBtnVolume->setClickedCallback( onClickVolume, this );
|
||||
mBtnVolume->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterVolume, this));
|
||||
|
|
@ -223,6 +227,11 @@ BOOL LLStatusBar::postBuild()
|
|||
mSGPacketLoss = LLUICtrlFactory::create<LLStatGraph>(pgp);
|
||||
addChild(mSGPacketLoss);
|
||||
|
||||
mPanelPresetsPulldown = new LLPanelPresetsPulldown();
|
||||
addChild(mPanelPresetsPulldown);
|
||||
mPanelPresetsPulldown->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT);
|
||||
mPanelPresetsPulldown->setVisible(FALSE);
|
||||
|
||||
mPanelVolumePulldown = new LLPanelVolumePulldown();
|
||||
addChild(mPanelVolumePulldown);
|
||||
mPanelVolumePulldown->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT);
|
||||
|
|
@ -460,8 +469,32 @@ void LLStatusBar::onClickBuyCurrency()
|
|||
LLFirstUse::receiveLindens(false);
|
||||
}
|
||||
|
||||
void LLStatusBar::onMouseEnterPresets()
|
||||
{
|
||||
LLView* popup_holder = gViewerWindow->getRootView()->getChildView("popup_holder");
|
||||
LLIconCtrl* icon = getChild<LLIconCtrl>( "presets_icon" );
|
||||
LLRect icon_rect = icon->getRect();
|
||||
LLRect pulldown_rect = mPanelPresetsPulldown->getRect();
|
||||
pulldown_rect.setLeftTopAndSize(icon_rect.mLeft -
|
||||
(pulldown_rect.getWidth() - icon_rect.getWidth()),
|
||||
icon_rect.mBottom,
|
||||
pulldown_rect.getWidth(),
|
||||
pulldown_rect.getHeight());
|
||||
|
||||
pulldown_rect.translate(popup_holder->getRect().getWidth() - pulldown_rect.mRight, 0);
|
||||
mPanelPresetsPulldown->setShape(pulldown_rect);
|
||||
|
||||
// show the master presets pull-down
|
||||
LLUI::clearPopups();
|
||||
LLUI::addPopup(mPanelPresetsPulldown);
|
||||
mPanelNearByMedia->setVisible(FALSE);
|
||||
mPanelVolumePulldown->setVisible(FALSE);
|
||||
mPanelPresetsPulldown->setVisible(TRUE);
|
||||
}
|
||||
|
||||
void LLStatusBar::onMouseEnterVolume()
|
||||
{
|
||||
LLView* popup_holder = gViewerWindow->getRootView()->getChildView("popup_holder");
|
||||
LLButton* volbtn = getChild<LLButton>( "volume_btn" );
|
||||
LLRect vol_btn_rect = volbtn->getRect();
|
||||
LLRect volume_pulldown_rect = mPanelVolumePulldown->getRect();
|
||||
|
|
@ -471,12 +504,14 @@ void LLStatusBar::onMouseEnterVolume()
|
|||
volume_pulldown_rect.getWidth(),
|
||||
volume_pulldown_rect.getHeight());
|
||||
|
||||
volume_pulldown_rect.translate(popup_holder->getRect().getWidth() - volume_pulldown_rect.mRight, 0);
|
||||
mPanelVolumePulldown->setShape(volume_pulldown_rect);
|
||||
|
||||
|
||||
// show the master volume pull-down
|
||||
LLUI::clearPopups();
|
||||
LLUI::addPopup(mPanelVolumePulldown);
|
||||
mPanelPresetsPulldown->setVisible(FALSE);
|
||||
mPanelNearByMedia->setVisible(FALSE);
|
||||
mPanelVolumePulldown->setVisible(TRUE);
|
||||
}
|
||||
|
|
@ -500,6 +535,7 @@ void LLStatusBar::onMouseEnterNearbyMedia()
|
|||
LLUI::clearPopups();
|
||||
LLUI::addPopup(mPanelNearByMedia);
|
||||
|
||||
mPanelPresetsPulldown->setVisible(FALSE);
|
||||
mPanelVolumePulldown->setVisible(FALSE);
|
||||
mPanelNearByMedia->setVisible(TRUE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,8 +41,10 @@ class LLUICtrl;
|
|||
class LLUUID;
|
||||
class LLFrameTimer;
|
||||
class LLStatGraph;
|
||||
class LLPanelPresetsPulldown;
|
||||
class LLPanelVolumePulldown;
|
||||
class LLPanelNearByMedia;
|
||||
class LLIconCtrl;
|
||||
|
||||
class LLStatusBar
|
||||
: public LLPanel
|
||||
|
|
@ -89,6 +91,7 @@ private:
|
|||
void onClickBuyCurrency();
|
||||
void onVolumeChanged(const LLSD& newvalue);
|
||||
|
||||
void onMouseEnterPresets();
|
||||
void onMouseEnterVolume();
|
||||
void onMouseEnterNearbyMedia();
|
||||
void onClickScreen(S32 x, S32 y);
|
||||
|
|
@ -103,6 +106,7 @@ private:
|
|||
LLStatGraph *mSGPacketLoss;
|
||||
|
||||
LLView *mBtnStats;
|
||||
LLIconCtrl *mIconPresets;
|
||||
LLButton *mBtnVolume;
|
||||
LLTextBox *mBoxBalance;
|
||||
LLButton *mMediaToggle;
|
||||
|
|
@ -115,6 +119,7 @@ private:
|
|||
S32 mSquareMetersCommitted;
|
||||
LLFrameTimer* mBalanceTimer;
|
||||
LLFrameTimer* mHealthTimer;
|
||||
LLPanelPresetsPulldown* mPanelPresetsPulldown;
|
||||
LLPanelVolumePulldown* mPanelVolumePulldown;
|
||||
LLPanelNearByMedia* mPanelNearByMedia;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -167,11 +167,6 @@ static bool handleRenderPerfTestChanged(const LLSD& newvalue)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool handleRenderAvatarComplexityLimitChanged(const LLSD& newvalue)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool handleRenderTransparentWaterChanged(const LLSD& newvalue)
|
||||
{
|
||||
LLWorld::getInstance()->updateWaterObjects();
|
||||
|
|
@ -636,7 +631,6 @@ void settings_setup_listeners()
|
|||
gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||
gSavedSettings.getControl("RenderGammaFull")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||
gSavedSettings.getControl("RenderAvatarMaxVisible")->getSignal()->connect(boost::bind(&handleAvatarMaxVisibleChanged, _2));
|
||||
gSavedSettings.getControl("RenderAvatarComplexityLimit")->getSignal()->connect(boost::bind(&handleRenderAvatarComplexityLimitChanged, _2));
|
||||
gSavedSettings.getControl("RenderVolumeLODFactor")->getSignal()->connect(boost::bind(&handleVolumeLODChanged, _2));
|
||||
gSavedSettings.getControl("RenderAvatarLODFactor")->getSignal()->connect(boost::bind(&handleAvatarLODChanged, _2));
|
||||
gSavedSettings.getControl("RenderAvatarPhysicsLODFactor")->getSignal()->connect(boost::bind(&handleAvatarPhysicsLODChanged, _2));
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@
|
|||
#include "llfloaterconversationlog.h"
|
||||
#include "llfloaterconversationpreview.h"
|
||||
#include "llfloaterdeleteenvpreset.h"
|
||||
#include "llfloaterdeleteprefpreset.h"
|
||||
#include "llfloaterdestinations.h"
|
||||
#include "llfloaterdisplayname.h"
|
||||
#include "llfloatereditdaycycle.h"
|
||||
|
|
@ -68,7 +69,6 @@
|
|||
#include "llfloatergesture.h"
|
||||
#include "llfloatergodtools.h"
|
||||
#include "llfloatergroups.h"
|
||||
#include "llfloaterhardwaresettings.h"
|
||||
#include "llfloaterhelpbrowser.h"
|
||||
#include "llfloaterhud.h"
|
||||
#include "llfloaterimagepreview.h"
|
||||
|
|
@ -79,6 +79,7 @@
|
|||
#include "llfloaterlagmeter.h"
|
||||
#include "llfloaterland.h"
|
||||
#include "llfloaterlandholdings.h"
|
||||
#include "llfloaterloadprefpreset.h"
|
||||
#include "llfloatermap.h"
|
||||
#include "llfloatermediasettings.h"
|
||||
#include "llfloatermemleak.h"
|
||||
|
|
@ -100,6 +101,7 @@
|
|||
#include "llfloaterregioninfo.h"
|
||||
#include "llfloaterregionrestarting.h"
|
||||
#include "llfloaterreporter.h"
|
||||
#include "llfloatersaveprefpreset.h"
|
||||
#include "llfloatersceneloadstats.h"
|
||||
#include "llfloaterscriptdebug.h"
|
||||
#include "llfloaterscriptedprefs.h"
|
||||
|
|
@ -204,6 +206,7 @@ void LLViewerFloaterReg::registerFloaters()
|
|||
LLFloaterReg::add("compile_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCompileQueue>);
|
||||
LLFloaterReg::add("conversation", "floater_conversation_log.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterConversationLog>);
|
||||
|
||||
LLFloaterReg::add("delete_pref_preset", "floater_delete_pref_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterDeletePrefPreset>);
|
||||
LLFloaterReg::add("destinations", "floater_destinations.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterDestinations>);
|
||||
|
||||
LLFloaterReg::add("env_post_process", "floater_post_process.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPostProcess>);
|
||||
|
|
@ -240,6 +243,7 @@ void LLViewerFloaterReg::registerFloaters()
|
|||
|
||||
LLFloaterReg::add("lagmeter", "floater_lagmeter.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLagMeter>);
|
||||
LLFloaterReg::add("land_holdings", "floater_land_holdings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLandHoldings>);
|
||||
LLFloaterReg::add("load_pref_preset", "floater_load_pref_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLoadPrefPreset>);
|
||||
|
||||
LLFloaterReg::add("mem_leaking", "floater_mem_leaking.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMemLeak>);
|
||||
|
||||
|
|
@ -271,7 +275,6 @@ void LLViewerFloaterReg::registerFloaters()
|
|||
LLFloaterReg::add("places", "floater_places.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>);
|
||||
LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreference>);
|
||||
LLFloaterReg::add("prefs_proxy", "floater_preferences_proxy.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreferenceProxy>);
|
||||
LLFloaterReg::add("prefs_hardware_settings", "floater_hardware_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHardwareSettings>);
|
||||
LLFloaterReg::add("prefs_spellchecker_import", "floater_spellcheck_import.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSpellCheckerImport>);
|
||||
LLFloaterReg::add("prefs_translation", "floater_translation_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTranslationSettings>);
|
||||
LLFloaterReg::add("prefs_spellchecker", "floater_spellcheck.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSpellCheckerSettings>);
|
||||
|
|
@ -288,6 +291,7 @@ void LLViewerFloaterReg::registerFloaters()
|
|||
LLFloaterReg::add("preview_texture", "floater_preview_texture.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPreviewTexture>, "preview");
|
||||
LLFloaterReg::add("properties", "floater_inventory_item_properties.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterProperties>);
|
||||
LLFloaterReg::add("publish_classified", "floater_publish_classified.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPublishClassifiedFloater>);
|
||||
LLFloaterReg::add("save_pref_preset", "floater_save_pref_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSavePrefPreset>);
|
||||
LLFloaterReg::add("script_colors", "floater_script_ed_prefs.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterScriptEdPrefs>);
|
||||
|
||||
LLFloaterReg::add("telehubs", "floater_telehub.xml",&LLFloaterReg::build<LLFloaterTelehub>);
|
||||
|
|
|
|||
|
|
@ -978,10 +978,6 @@ U32 info_display_from_string(std::string info_display)
|
|||
{
|
||||
return LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY;
|
||||
}
|
||||
else if ("shame" == info_display)
|
||||
{
|
||||
return LLPipeline::RENDER_DEBUG_SHAME;
|
||||
}
|
||||
else if ("texture area" == info_display)
|
||||
{
|
||||
return LLPipeline::RENDER_DEBUG_TEXTURE_AREA;
|
||||
|
|
@ -1010,9 +1006,9 @@ U32 info_display_from_string(std::string info_display)
|
|||
{
|
||||
return LLPipeline::RENDER_DEBUG_COMPOSITION;
|
||||
}
|
||||
else if ("attachment bytes" == info_display)
|
||||
else if ("avatardrawinfo" == info_display)
|
||||
{
|
||||
return LLPipeline::RENDER_DEBUG_ATTACHMENT_BYTES;
|
||||
return (LLPipeline::RENDER_DEBUG_AVATAR_DRAW_INFO);
|
||||
}
|
||||
else if ("glow" == info_display)
|
||||
{
|
||||
|
|
@ -1048,6 +1044,7 @@ U32 info_display_from_string(std::string info_display)
|
|||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "unrecognized feature name '" << info_display << "'" << LL_ENDL;
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4933,12 +4933,7 @@ void LLViewerObject::setDebugText(const std::string &utf8text)
|
|||
|
||||
if (!mText)
|
||||
{
|
||||
mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT);
|
||||
mText->setFont(LLFontGL::getFontSansSerif());
|
||||
mText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP);
|
||||
mText->setMaxLines(-1);
|
||||
mText->setSourceObject(this);
|
||||
mText->setOnHUDAttachment(isHUDAttachment());
|
||||
initDebugTextHud();
|
||||
}
|
||||
mText->setColor(LLColor4::white);
|
||||
mText->setString(utf8text);
|
||||
|
|
@ -4947,6 +4942,16 @@ void LLViewerObject::setDebugText(const std::string &utf8text)
|
|||
updateText();
|
||||
}
|
||||
|
||||
void LLViewerObject::initDebugTextHud()
|
||||
{
|
||||
mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT);
|
||||
mText->setFont(LLFontGL::getFontSansSerif());
|
||||
mText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP);
|
||||
mText->setMaxLines(-1);
|
||||
mText->setSourceObject(this);
|
||||
mText->setOnHUDAttachment(isHUDAttachment());
|
||||
}
|
||||
|
||||
void LLViewerObject::setIcon(LLViewerTexture* icon_image)
|
||||
{
|
||||
if (!mIcon)
|
||||
|
|
|
|||
|
|
@ -402,6 +402,7 @@ public:
|
|||
|
||||
void setCanSelect(BOOL canSelect);
|
||||
|
||||
void initDebugTextHud();
|
||||
void setDebugText(const std::string &utf8text);
|
||||
void setIcon(LLViewerTexture* icon_image);
|
||||
void clearIcon();
|
||||
|
|
|
|||
|
|
@ -473,8 +473,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
|
|||
mImpl->mObjectPartition.push_back(NULL); //PARTITION_NONE
|
||||
mImpl->mVOCachePartition = getVOCachePartition();
|
||||
|
||||
mRenderInfoRequestTimer.resetWithExpiry(0.f); // Set timer to be expired
|
||||
setCapabilitiesReceivedCallback(boost::bind(&LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer, _1));
|
||||
setCapabilitiesReceivedCallback(boost::bind(&LLAvatarRenderInfoAccountant::scanNewRegion, _1));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -431,7 +431,8 @@ public:
|
|||
static BOOL sVOCacheCullingEnabled; //vo cache culling enabled or not.
|
||||
static S32 sLastCameraUpdated;
|
||||
|
||||
LLFrameTimer & getRenderInfoRequestTimer() { return mRenderInfoRequestTimer; };
|
||||
LLFrameTimer & getRenderInfoRequestTimer() { return mRenderInfoRequestTimer; };
|
||||
LLFrameTimer & getRenderInfoReportTimer() { return mRenderInfoReportTimer; };
|
||||
|
||||
struct CompareRegionByLastUpdate
|
||||
{
|
||||
|
|
@ -536,7 +537,8 @@ private:
|
|||
|
||||
// the materials capability throttle
|
||||
LLFrameTimer mMaterialsCapThrottleTimer;
|
||||
LLFrameTimer mRenderInfoRequestTimer;
|
||||
LLFrameTimer mRenderInfoRequestTimer;
|
||||
LLFrameTimer mRenderInfoReportTimer;
|
||||
};
|
||||
|
||||
inline BOOL LLViewerRegion::getRegionProtocol(U64 protocol) const
|
||||
|
|
|
|||
|
|
@ -767,12 +767,11 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
|
|||
LLSceneMonitor::getInstance()->freezeAvatar((LLCharacter*)this);
|
||||
}
|
||||
|
||||
mCachedVisualMute = !isSelf();
|
||||
mCachedVisualMute = !isSelf(); // default to muting everyone? hmmm....
|
||||
mCachedVisualMuteUpdateTime = LLFrameTimer::getTotalSeconds() + 5.0;
|
||||
mVisuallyMuteSetting = VISUAL_MUTE_NOT_SET;
|
||||
|
||||
F32 color_value = (F32) (getID().mData[0]);
|
||||
mMutedAVColor = calcMutedAVColor(color_value, 0, 256);
|
||||
mMutedAVColor = calcMutedAVColor(getID());
|
||||
}
|
||||
|
||||
std::string LLVOAvatar::avString() const
|
||||
|
|
@ -2521,7 +2520,7 @@ void LLVOAvatar::idleUpdateLoadingEffect()
|
|||
LLPartData::LL_PART_EMISSIVE_MASK | // LLPartData::LL_PART_FOLLOW_SRC_MASK |
|
||||
LLPartData::LL_PART_TARGET_POS_MASK );
|
||||
|
||||
if (!isTooComplex()) // do not generate particles for overly-complex avatars
|
||||
if (!isVisuallyMuted()) // if we are muting the avatar, don't render particles
|
||||
{
|
||||
setParticleSource(particle_parameters, getID());
|
||||
}
|
||||
|
|
@ -3067,24 +3066,17 @@ void LLVOAvatar::slamPosition()
|
|||
mRoot->updateWorldMatrixChildren();
|
||||
}
|
||||
|
||||
bool LLVOAvatar::isVisuallyMuted()
|
||||
bool LLVOAvatar::isVisuallyMuted() const
|
||||
{
|
||||
bool muted = false;
|
||||
|
||||
// Priority order (highest priority first)
|
||||
// * own avatar is never visually muted
|
||||
// * if on the "always draw normally" list, draw them normally
|
||||
// * if on the "always visually mute" list, mute them
|
||||
// * check against the render cost and attachment limits
|
||||
if (!isSelf())
|
||||
{
|
||||
static LLCachedControl<U32> render_auto_mute_functions(gSavedSettings, "RenderAutoMuteFunctions", 0);
|
||||
if (render_auto_mute_functions) // Hacky debug switch for developing feature
|
||||
{
|
||||
// Priority order (highest priority first)
|
||||
// * own avatar is never visually muted
|
||||
// * if on the "always draw normally" list, draw them normally
|
||||
// * if on the "always visually mute" list, mute them
|
||||
// * draw them normally if they meet the following criteria:
|
||||
// - within the closest N avatars OR on friends list OR in an IM chat
|
||||
// - AND aren't over the thresholds
|
||||
// * otherwise visually mute all other avatars
|
||||
|
||||
static LLCachedControl<U32> max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit", 0);
|
||||
static LLCachedControl<F32> max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit", 0.0);
|
||||
static LLCachedControl<U32> max_render_cost(gSavedSettings, "RenderAutoMuteRenderWeightLimit", 0);
|
||||
|
|
@ -3108,33 +3100,11 @@ bool LLVOAvatar::isVisuallyMuted()
|
|||
else
|
||||
{ // Determine if visually muted or not
|
||||
|
||||
U32 max_cost = (U32) (max_render_cost*(LLVOAvatar::sLODFactor+0.5));
|
||||
|
||||
muted = LLMuteList::getInstance()->isMuted(getID()) ||
|
||||
(mAttachmentGeometryBytes > max_attachment_bytes && max_attachment_bytes > 0) ||
|
||||
(mAttachmentSurfaceArea > max_attachment_area && max_attachment_area > 0.f) ||
|
||||
(mVisualComplexity > max_cost && max_render_cost > 0);
|
||||
|
||||
// Could be part of the grand || collection above, but yanked out to make the logic visible
|
||||
if (!muted)
|
||||
{
|
||||
if (sMaxVisible > 0)
|
||||
{ // They are above the visibilty rank - mute them
|
||||
muted = (mVisibilityRank > sMaxVisible);
|
||||
}
|
||||
|
||||
// Always draw friends or those in IMs. Needs UI?
|
||||
if ((render_auto_mute_functions & 0x02) &&
|
||||
(muted || sMaxVisible == 0)) // Don't mute friends or IMs
|
||||
{
|
||||
muted = !(LLAvatarTracker::instance().isBuddy(getID()));
|
||||
if (muted)
|
||||
{ // Not a friend, so they are muted ... are they in an IM?
|
||||
LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL,getID());
|
||||
muted = !gIMMgr->hasSession(session_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
muted = ( (max_render_cost > 0 && mVisualComplexity > max_render_cost)
|
||||
|| (max_attachment_bytes > 0 && mAttachmentGeometryBytes > max_attachment_bytes)
|
||||
|| (max_attachment_area > 0.f && mAttachmentSurfaceArea > max_attachment_area)
|
||||
|| LLMuteList::getInstance()->isMuted(getID())
|
||||
);
|
||||
|
||||
// Save visual mute state and set interval for updating
|
||||
const F64 SECONDS_BETWEEN_RENDER_AUTO_MUTE_UPDATES = 1.5;
|
||||
|
|
@ -3142,7 +3112,6 @@ bool LLVOAvatar::isVisuallyMuted()
|
|||
mCachedVisualMute = muted;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return muted;
|
||||
|
|
@ -6181,8 +6150,9 @@ BOOL LLVOAvatar::getIsCloud() const
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
if (isTooComplex())
|
||||
if (isVisuallyMuted())
|
||||
{
|
||||
// we can render the muted representation
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
|
@ -6433,16 +6403,6 @@ BOOL LLVOAvatar::isFullyLoaded() const
|
|||
return (mRenderUnloadedAvatar || mFullyLoaded);
|
||||
}
|
||||
|
||||
bool LLVOAvatar::isTooComplex() const
|
||||
{
|
||||
if (gSavedSettings.getS32("RenderAvatarComplexityLimit") > 0 && mVisualComplexity >= gSavedSettings.getS32("RenderAvatarComplexityLimit"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// findMotion()
|
||||
|
|
@ -8072,31 +8032,98 @@ void LLVOAvatar::getImpostorValues(LLVector4a* extents, LLVector3& angle, F32& d
|
|||
angle.mV[2] = da;
|
||||
}
|
||||
|
||||
|
||||
void LLVOAvatar::idleUpdateRenderCost()
|
||||
{
|
||||
static LLCachedControl<U32> max_render_cost(gSavedSettings, "RenderAutoMuteRenderWeightLimit", 0);
|
||||
static const U32 ARC_LIMIT = 20000;
|
||||
|
||||
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_ATTACHMENT_BYTES))
|
||||
{ //set debug text to attachment geometry bytes here so render cost will override
|
||||
setDebugText(llformat("%.1f KB, %.2f m^2", mAttachmentGeometryBytes/1024.f, mAttachmentSurfaceArea));
|
||||
}
|
||||
|
||||
if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME) && max_render_cost == 0)
|
||||
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AVATAR_DRAW_INFO))
|
||||
{
|
||||
return;
|
||||
}
|
||||
std::string info_line;
|
||||
F32 red_level;
|
||||
F32 green_level;
|
||||
LLColor4 info_color;
|
||||
LLFontGL::StyleFlags info_style;
|
||||
|
||||
if ( !mText )
|
||||
{
|
||||
initDebugTextHud();
|
||||
mText->setFadeDistance(20.0, 5.0); // limit clutter in large crowds
|
||||
}
|
||||
else
|
||||
{
|
||||
mText->clearString(); // clear debug text
|
||||
}
|
||||
|
||||
calculateUpdateRenderCost(); // Update mVisualComplexity if needed
|
||||
|
||||
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME))
|
||||
{
|
||||
std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus());
|
||||
setDebugText(llformat("%s %d", viz_string.c_str(), mVisualComplexity));
|
||||
F32 green = 1.f-llclamp(((F32) mVisualComplexity-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f);
|
||||
F32 red = llmin((F32) mVisualComplexity/(F32)ARC_LIMIT, 1.f);
|
||||
mText->setColor(LLColor4(red,green,0,1));
|
||||
/*
|
||||
* NOTE: the logic for whether or not each of the values below
|
||||
* controls muting MUST match that in the isVisuallyMuted method.
|
||||
*/
|
||||
|
||||
// Render Cost (ARC)
|
||||
calculateUpdateRenderCost(); // Update mVisualComplexity if needed
|
||||
|
||||
static LLCachedControl<U32> max_render_cost(gSavedSettings, "RenderAutoMuteRenderWeightLimit", 0);
|
||||
info_line = llformat("%d ARC", mVisualComplexity);
|
||||
|
||||
if (max_render_cost != 0) // zero means don't care, so don't bother coloring based on this
|
||||
{
|
||||
green_level = 1.f-llclamp(((F32) mVisualComplexity-(F32)max_render_cost)/(F32)max_render_cost, 0.f, 1.f);
|
||||
red_level = llmin((F32) mVisualComplexity/(F32)max_render_cost, 1.f);
|
||||
info_color.set(red_level, green_level, 0.0, 1.0);
|
||||
info_style = ( mVisualComplexity > max_render_cost
|
||||
? LLFontGL::BOLD : LLFontGL::NORMAL );
|
||||
}
|
||||
else
|
||||
{
|
||||
info_color.set(LLColor4::grey);
|
||||
info_style = LLFontGL::NORMAL;
|
||||
}
|
||||
mText->addLine(info_line, info_color, info_style);
|
||||
|
||||
// Visual rank
|
||||
info_line = llformat("%d rank", mVisibilityRank);
|
||||
// Use grey for imposters, white for normal rendering or no impostors
|
||||
info_color.set((sMaxVisible > 0 && mVisibilityRank > sMaxVisible) ? LLColor4::grey : LLColor4::white);
|
||||
info_style = LLFontGL::NORMAL;
|
||||
mText->addLine(info_line, info_color, info_style);
|
||||
|
||||
// Attachment Surface Area
|
||||
static LLCachedControl<F32> max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit", 0);
|
||||
info_line = llformat("%.2f m^2", mAttachmentSurfaceArea);
|
||||
|
||||
if (max_attachment_area != 0) // zero means don't care, so don't bother coloring based on this
|
||||
{
|
||||
green_level = 1.f-llclamp((mAttachmentSurfaceArea-max_attachment_area)/max_attachment_area, 0.f, 1.f);
|
||||
red_level = llmin(mAttachmentSurfaceArea/max_attachment_area, 1.f);
|
||||
info_color.set(red_level, green_level, 0.0, 1.0);
|
||||
info_style = ( mAttachmentSurfaceArea > max_attachment_area
|
||||
? LLFontGL::BOLD : LLFontGL::NORMAL );
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
info_color.set(LLColor4::grey);
|
||||
info_style = LLFontGL::NORMAL;
|
||||
}
|
||||
mText->addLine(info_line, info_color, info_style);
|
||||
|
||||
// Attachment byte limit
|
||||
static LLCachedControl<U32> max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit", 0);
|
||||
info_line = llformat("%.1f KB", mAttachmentGeometryBytes/1024.f);
|
||||
if (max_attachment_bytes != 0) // zero means don't care, so don't bother coloring based on this
|
||||
{
|
||||
green_level = 1.f-llclamp(((F32) mAttachmentGeometryBytes-(F32)max_attachment_bytes)/(F32)max_attachment_bytes, 0.f, 1.f);
|
||||
red_level = llmin((F32) mAttachmentGeometryBytes/(F32)max_attachment_bytes, 1.f);
|
||||
info_color.set(red_level, green_level, 0.0, 1.0);
|
||||
info_style = ( mAttachmentGeometryBytes > max_attachment_bytes
|
||||
? LLFontGL::BOLD : LLFontGL::NORMAL );
|
||||
}
|
||||
else
|
||||
{
|
||||
info_color.set(LLColor4::grey);
|
||||
info_style = LLFontGL::NORMAL;
|
||||
}
|
||||
mText->addLine(info_line, info_color, info_style);
|
||||
|
||||
updateText(); // corrects position
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -8117,7 +8144,8 @@ void LLVOAvatar::calculateUpdateRenderCost()
|
|||
|
||||
for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++)
|
||||
{
|
||||
const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index);
|
||||
const LLAvatarAppearanceDictionary::BakedEntry *baked_dict
|
||||
= LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index);
|
||||
ETextureIndex tex_index = baked_dict->mTextureIndex;
|
||||
if ((tex_index != TEX_SKIRT_BAKED) || (isWearingWearableType(LLWearableType::WT_SKIRT)))
|
||||
{
|
||||
|
|
@ -8129,11 +8157,11 @@ void LLVOAvatar::calculateUpdateRenderCost()
|
|||
}
|
||||
|
||||
|
||||
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
|
||||
iter != mAttachmentPoints.end();
|
||||
++iter)
|
||||
for (attachment_map_t::const_iterator attachment_point = mAttachmentPoints.begin();
|
||||
attachment_point != mAttachmentPoints.end();
|
||||
++attachment_point)
|
||||
{
|
||||
LLViewerJointAttachment* attachment = iter->second;
|
||||
LLViewerJointAttachment* attachment = attachment_point->second;
|
||||
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
|
||||
attachment_iter != attachment->mAttachedObjects.end();
|
||||
++attachment_iter)
|
||||
|
|
@ -8163,10 +8191,12 @@ void LLVOAvatar::calculateUpdateRenderCost()
|
|||
}
|
||||
}
|
||||
|
||||
for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter)
|
||||
for (LLVOVolume::texture_cost_t::iterator volume_texture = textures.begin();
|
||||
volume_texture != textures.end();
|
||||
++volume_texture)
|
||||
{
|
||||
// add the cost of each individual texture in the linkset
|
||||
cost += iter->second;
|
||||
cost += volume_texture->second;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8219,11 +8249,11 @@ void LLVOAvatar::calculateUpdateRenderCost()
|
|||
|
||||
|
||||
// static
|
||||
LLColor4 LLVOAvatar::calcMutedAVColor(F32 value, S32 range_low, S32 range_high)
|
||||
LLColor4 LLVOAvatar::calcMutedAVColor(const LLUUID av_id)
|
||||
{
|
||||
F32 clamped_value = llmin(value, (F32) range_high);
|
||||
clamped_value = llmax(value, (F32) range_low);
|
||||
F32 spectrum = (clamped_value / range_high); // spectrum is between 0 and 1.f
|
||||
// select a color based on the first byte of the agents uuid so any muted agent is always the same color
|
||||
F32 color_value = (F32) (av_id.mData[0]);
|
||||
F32 spectrum = (color_value / 256.0); // spectrum is between 0 and 1.f
|
||||
|
||||
// Array of colors. These are arranged so only one RGB color changes between each step,
|
||||
// and it loops back to red so there is an even distribution. It is not a heat map
|
||||
|
|
@ -8237,12 +8267,12 @@ LLColor4 LLVOAvatar::calcMutedAVColor(F32 value, S32 range_low, S32 range_high)
|
|||
|
||||
LLColor4 new_color = lerp(*spectrum_color[spectrum_index_1], *spectrum_color[spectrum_index_2], fractBetween);
|
||||
new_color.normalize();
|
||||
new_color *= 0.7f; // Tone it down a bit
|
||||
new_color *= 0.5f; // Tone it down
|
||||
|
||||
//LL_INFOS() << "From value " << std::setprecision(3) << value << " returning color " << new_color
|
||||
// << " using indexes " << spectrum_index_1 << ", " << spectrum_index_2
|
||||
// << " and fractBetween " << fractBetween
|
||||
// << LL_ENDL;
|
||||
LL_DEBUGS("AvatarMute") << "avatar "<< av_id << " color " << std::setprecision(3) << color_value << " returning color " << new_color
|
||||
<< " using indexes " << spectrum_index_1 << ", " << spectrum_index_2
|
||||
<< " and fractBetween " << fractBetween
|
||||
<< LL_ENDL;
|
||||
|
||||
return new_color;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -300,7 +300,6 @@ public:
|
|||
//--------------------------------------------------------------------
|
||||
public:
|
||||
BOOL isFullyLoaded() const;
|
||||
bool isTooComplex() const;
|
||||
bool visualParamWeightsAreDefault();
|
||||
virtual BOOL getIsCloud() const;
|
||||
BOOL isFullyTextured() const;
|
||||
|
|
@ -318,7 +317,7 @@ public:
|
|||
static void logPendingPhasesAllAvatars();
|
||||
void logMetricsTimerRecord(const std::string& phase_name, F32 elapsed, bool completed);
|
||||
|
||||
static LLColor4 calcMutedAVColor(F32 value, S32 range_low, S32 range_high);
|
||||
static LLColor4 calcMutedAVColor(const LLUUID av_id);
|
||||
|
||||
protected:
|
||||
LLViewerStats::PhaseMap& getPhases() { return mPhases; }
|
||||
|
|
@ -381,7 +380,7 @@ public:
|
|||
|
||||
public:
|
||||
U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0);
|
||||
bool isVisuallyMuted();
|
||||
bool isVisuallyMuted() const;
|
||||
void setCachedVisualMute(bool muted) { mCachedVisualMute = muted; };
|
||||
void forceUpdateVisualMuteSettings();
|
||||
|
||||
|
|
@ -418,8 +417,9 @@ private:
|
|||
S32 mUpdatePeriod;
|
||||
S32 mNumInitFaces; //number of faces generated when creating the avatar drawable, does not inculde splitted faces due to long vertex buffer.
|
||||
|
||||
bool mCachedVisualMute; // cached return value for isVisuallyMuted()
|
||||
F64 mCachedVisualMuteUpdateTime; // Time to update mCachedVisualMute
|
||||
// the isVisuallyMuted method uses these mutable values to avoid recalculating too frequently
|
||||
mutable bool mCachedVisualMute; // cached return value for isVisuallyMuted()
|
||||
mutable F64 mCachedVisualMuteUpdateTime; // Time to update mCachedVisualMute
|
||||
|
||||
VisualMuteSettings mVisuallyMuteSetting; // Always or never visually mute this AV
|
||||
|
||||
|
|
|
|||
|
|
@ -518,7 +518,7 @@ public:
|
|||
RENDER_DEBUG_BATCH_SIZE = 0x00004000,
|
||||
RENDER_DEBUG_ALPHA_BINS = 0x00008000,
|
||||
RENDER_DEBUG_RAYCAST = 0x00010000,
|
||||
RENDER_DEBUG_SHAME = 0x00020000,
|
||||
RENDER_DEBUG_AVATAR_DRAW_INFO = 0x00020000,
|
||||
RENDER_DEBUG_SHADOW_FRUSTA = 0x00040000,
|
||||
RENDER_DEBUG_SCULPTED = 0x00080000,
|
||||
RENDER_DEBUG_AVATAR_VOLUME = 0x00100000,
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 268 B |
|
|
@ -204,6 +204,8 @@ with the same filename but different name
|
|||
|
||||
<texture name="Facebook_Icon" file_name="icons/Facebook.png" preload="false" />
|
||||
|
||||
<texture name="Presets_Icon" file_name="icons/Presets_Icon.png" preload="true" />
|
||||
|
||||
<texture name="Favorite_Star_Active" file_name="navbar/Favorite_Star_Active.png" preload="false" />
|
||||
<texture name="Favorite_Star_Off" file_name="navbar/Favorite_Star_Off.png" preload="false" />
|
||||
<texture name="Favorite_Star_Press" file_name="navbar/Favorite_Star_Press.png" preload="false" />
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<floater
|
||||
legacy_header_height="18"
|
||||
height="130"
|
||||
help_topic="floater_delete_preset"
|
||||
layout="topleft"
|
||||
name="Delete Pref Preset"
|
||||
save_rect="true"
|
||||
title="DELETE PREF PRESET"
|
||||
width="300">
|
||||
|
||||
<string name="title_graphic">Delete Graphic Preset</string>
|
||||
<string name="title_camera">Delete Camera Preset</string>
|
||||
|
||||
<text
|
||||
follows="top|left|right"
|
||||
height="10"
|
||||
layout="topleft"
|
||||
left="20"
|
||||
name="Preset"
|
||||
top="30"
|
||||
width="200">
|
||||
Select a preset
|
||||
</text>
|
||||
<combo_box
|
||||
follows="top|left"
|
||||
layout="topleft"
|
||||
left="20"
|
||||
name="preset_combo"
|
||||
top_delta="20"
|
||||
width="200"/>
|
||||
<button
|
||||
follows="top|left"
|
||||
height="23"
|
||||
label="Delete"
|
||||
layout="topleft"
|
||||
top_delta="40"
|
||||
left="20"
|
||||
name="delete"
|
||||
width="70"/>
|
||||
<button
|
||||
follows="top|left"
|
||||
height="23"
|
||||
label="Cancel"
|
||||
layout="topleft"
|
||||
left_pad="20"
|
||||
name="cancel"
|
||||
width="70"/>
|
||||
</floater>
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<floater
|
||||
legacy_header_height="18"
|
||||
height="130"
|
||||
help_topic="floater_load_preset"
|
||||
layout="topleft"
|
||||
name="Load Pref Preset"
|
||||
save_rect="true"
|
||||
title="LOAD PREF PRESET"
|
||||
width="300">
|
||||
|
||||
<string name="title_graphic">Load Graphic Preset</string>
|
||||
<string name="title_camera">Load Camera Preset</string>
|
||||
|
||||
<text
|
||||
follows="top|left|right"
|
||||
height="16"
|
||||
layout="topleft"
|
||||
left="20"
|
||||
name="Preset"
|
||||
top="30"
|
||||
width="200">
|
||||
Select a preset
|
||||
</text>
|
||||
<combo_box
|
||||
follows="top|left"
|
||||
layout="topleft"
|
||||
left="20"
|
||||
name="preset_combo"
|
||||
top_delta="20"
|
||||
width="200"/>
|
||||
<button
|
||||
follows="top|left"
|
||||
height="23"
|
||||
label="OK"
|
||||
layout="topleft"
|
||||
top_delta="40"
|
||||
left="20"
|
||||
name="ok"
|
||||
width="70"/>
|
||||
<button
|
||||
follows="top|left"
|
||||
height="23"
|
||||
label="Cancel"
|
||||
layout="topleft"
|
||||
left_pad="20"
|
||||
name="cancel"
|
||||
width="70"/>
|
||||
</floater>
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
single_instance="true"
|
||||
title="PREFERENCES"
|
||||
width="658">
|
||||
<button
|
||||
<button
|
||||
follows="right|bottom"
|
||||
height="23"
|
||||
label="OK"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<floater
|
||||
legacy_header_height="18"
|
||||
height="145"
|
||||
help_topic="floater_save_preset"
|
||||
layout="topleft"
|
||||
name="Save Pref Preset"
|
||||
save_rect="true"
|
||||
title="SAVE PREF PRESET"
|
||||
width="300">
|
||||
|
||||
<string name="title_graphic">Save Graphic Preset</string>
|
||||
<string name="title_camera">Save Camera Preset</string>
|
||||
|
||||
<text
|
||||
follows="top|left|right"
|
||||
height="32"
|
||||
layout="topleft"
|
||||
word_wrap="true"
|
||||
left="20"
|
||||
name="Preset"
|
||||
top="30"
|
||||
width="200">
|
||||
Type a name for the preset or choose an existing preset.
|
||||
</text>
|
||||
<combo_box
|
||||
follows="top|left"
|
||||
layout="topleft"
|
||||
left="20"
|
||||
name="preset_combo"
|
||||
top_delta="35"
|
||||
allow_text_entry="true"
|
||||
width="200"/>
|
||||
<button
|
||||
follows="top|left"
|
||||
height="23"
|
||||
label="Save"
|
||||
layout="topleft"
|
||||
top_delta="40"
|
||||
left="20"
|
||||
name="save"
|
||||
width="70"/>
|
||||
<button
|
||||
follows="bottom|right"
|
||||
height="23"
|
||||
label="Cancel"
|
||||
layout="topleft"
|
||||
left_pad="20"
|
||||
name="cancel"
|
||||
width="70"/>
|
||||
</floater>
|
||||
|
|
@ -1533,14 +1533,14 @@
|
|||
parameter="scene_load_stats" />
|
||||
</menu_item_call>
|
||||
<menu_item_check
|
||||
label="Show Draw Weight for Avatars"
|
||||
name="Avatar Rendering Cost">
|
||||
label="Show Draw Information for Avatars"
|
||||
name="Avatar Draw Info">
|
||||
<menu_item_check.on_check
|
||||
function="Advanced.CheckInfoDisplay"
|
||||
parameter="shame" />
|
||||
parameter="avatardrawinfo" />
|
||||
<menu_item_check.on_click
|
||||
function="Advanced.ToggleInfoDisplay"
|
||||
parameter="shame" />
|
||||
parameter="avatardrawinfo" />
|
||||
</menu_item_check>
|
||||
</menu>
|
||||
<menu
|
||||
|
|
@ -2670,26 +2670,6 @@
|
|||
<menu_item_check.on_click
|
||||
function="Advanced.ToggleInfoDisplay"
|
||||
parameter="wind vectors" />
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Render Complexity"
|
||||
name="rendercomplexity">
|
||||
<menu_item_check.on_check
|
||||
function="Advanced.CheckInfoDisplay"
|
||||
parameter="rendercomplexity" />
|
||||
<menu_item_check.on_click
|
||||
function="Advanced.ToggleInfoDisplay"
|
||||
parameter="rendercomplexity" />
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Attachment Bytes"
|
||||
name="attachment bytes">
|
||||
<menu_item_check.on_check
|
||||
function="Advanced.CheckInfoDisplay"
|
||||
parameter="attachment bytes" />
|
||||
<menu_item_check.on_click
|
||||
function="Advanced.ToggleInfoDisplay"
|
||||
parameter="attachment bytes" />
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Sculpt"
|
||||
|
|
|
|||
|
|
@ -7670,6 +7670,20 @@ Are you sure you want to close all IMs?
|
|||
Attachment has been saved.
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="notifytip.tga"
|
||||
name="PresetNotSaved"
|
||||
type="notifytip">
|
||||
Error saving preset [NAME].
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="notifytip.tga"
|
||||
name="PresetNotDeleted"
|
||||
type="notifytip">
|
||||
Error deleting preset [NAME].
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="alertmodal.tga"
|
||||
name="UnableToFindHelpTopic"
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<panel
|
||||
background_opaque="true"
|
||||
background_visible="true"
|
||||
bg_opaque_image="Volume_Background"
|
||||
bg_alpha_image="Volume_Background"
|
||||
border_visible="false"
|
||||
border="false"
|
||||
chrome="true"
|
||||
follows="bottom"
|
||||
height="155"
|
||||
layout="topleft"
|
||||
name="presets_pulldown"
|
||||
width="225">
|
||||
<text
|
||||
type="string"
|
||||
length="1"
|
||||
follows="left|top"
|
||||
height="12"
|
||||
layout="topleft"
|
||||
top="4"
|
||||
left_delta="5"
|
||||
font.style="BOLD"
|
||||
name="Graphic Presets"
|
||||
width="120">
|
||||
Graphic Presets
|
||||
</text>
|
||||
<scroll_list
|
||||
follows="left|top"
|
||||
layout="topleft"
|
||||
column_padding="0"
|
||||
height="100"
|
||||
width="215"
|
||||
draw_heading="false"
|
||||
draw_stripes="false"
|
||||
bg_stripe_color="0.25 0.25 0.25 0.25"
|
||||
top_delta="15"
|
||||
left_delta="0"
|
||||
name="preset_list">
|
||||
<scroll_list.columns
|
||||
name="icon"
|
||||
width="16" />
|
||||
<scroll_list.columns
|
||||
relative_width="1"
|
||||
name="preset_name" />
|
||||
<scroll_list.commit_callback
|
||||
function="Presets.RowClick" />
|
||||
</scroll_list>
|
||||
<view_border
|
||||
bevel_style="none"
|
||||
follows="top|left"
|
||||
height="0"
|
||||
layout="topleft"
|
||||
left="5"
|
||||
name="horiz_separator"
|
||||
top_delta="105"
|
||||
width="215" />
|
||||
<button
|
||||
name="open_prefs_btn"
|
||||
label="Open Graphics Preferences"
|
||||
tool_tip = "Bring up graphics prefs"
|
||||
top_delta="5"
|
||||
left="15"
|
||||
height="20"
|
||||
width="200">
|
||||
<button.commit_callback
|
||||
function="Presets.GoGraphicsPrefs" />
|
||||
</button>
|
||||
</panel>
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
</panel.string>
|
||||
<panel
|
||||
height="18"
|
||||
left="-395"
|
||||
left="-416"
|
||||
width="185"
|
||||
top="1"
|
||||
follows="right|top"
|
||||
|
|
@ -105,6 +105,14 @@
|
|||
width="145">
|
||||
24:00 AM PST
|
||||
</text>
|
||||
<icon
|
||||
follows="right|top"
|
||||
height="16"
|
||||
image_name="Presets_Icon"
|
||||
left_pad="5"
|
||||
top="2"
|
||||
name="presets_icon"
|
||||
width="18" />
|
||||
<button
|
||||
follows="right|top"
|
||||
height="16"
|
||||
|
|
|
|||
|
|
@ -4045,5 +4045,10 @@ Try enclosing path to the editor with double quotes.
|
|||
<string name="loading_chat_logs">
|
||||
Loading...
|
||||
</string>
|
||||
|
||||
|
||||
<!-- Presets graphic/camera -->
|
||||
<string name="preset_combo_label">-Empty list-</string>
|
||||
<string name="Default">Default</string>
|
||||
<string name="none_paren_cap">(None)</string>
|
||||
<string name="no_limit">No Limit</string>
|
||||
</strings>
|
||||
|
|
|
|||
Loading…
Reference in New Issue