llviewercontrol.cpp 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345
  1. /**
  2. * @file llviewercontrol.cpp
  3. * @brief Viewer configuration
  4. * @author Richard Nelson
  5. *
  6. * $LicenseInfo:firstyear=2001&license=viewergpl$
  7. *
  8. * Copyright (c) 2001-2009, Linden Research, Inc.
  9. *
  10. * Second Life Viewer Source Code
  11. * The source code in this file ("Source Code") is provided by Linden Lab
  12. * to you under the terms of the GNU General Public License, version 2.0
  13. * ("GPL"), unless you have obtained a separate licensing agreement
  14. * ("Other License"), formally executed by you and Linden Lab. Terms of
  15. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  16. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  17. *
  18. * There are special exceptions to the terms and conditions of the GPL as
  19. * it is applied to this Source Code. View the full text of the exception
  20. * in the file doc/FLOSS-exception.txt in this software distribution, or
  21. * online at
  22. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  23. *
  24. * By copying, modifying or distributing this software, you acknowledge
  25. * that you have read and understood your obligations described above,
  26. * and agree to abide by those obligations.
  27. *
  28. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  29. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  30. * COMPLETENESS OR PERFORMANCE.
  31. * $/LicenseInfo$
  32. */
  33. #include "llviewerprecompiledheaders.h"
  34. #include "llviewercontrol.h"
  35. #include "llanimationstates.h" // For ANIM_AGENT_BENTO_IDLE
  36. #include "llaudioengine.h"
  37. #include "llavatarnamecache.h"
  38. #include "llcallbacklist.h" // For doAfterInterval()
  39. #include "llconsole.h"
  40. #include "llcorehttpcommon.h"
  41. #include "llerrorcontrol.h"
  42. #include "llfloater.h"
  43. #include "llgl.h"
  44. #include "llimagegl.h"
  45. #include "llkeyboard.h"
  46. #include "llnotifications.h"
  47. #include "llparcel.h"
  48. #include "llrender.h"
  49. #include "llspellcheck.h"
  50. #include "llsys.h"
  51. #include "llversionviewer.h"
  52. #include "llvolume.h"
  53. #include "llxmlrpctransaction.h"
  54. #include "llagent.h"
  55. #include "llagentwearables.h"
  56. #include "llappviewer.h"
  57. #include "llavatartracker.h"
  58. #include "llchatbar.h"
  59. #include "lldebugview.h"
  60. #include "lldrawpoolbump.h"
  61. #include "lldrawpooltree.h"
  62. #include "llenvironment.h"
  63. #include "llfasttimerview.h"
  64. #include "llfeaturemanager.h"
  65. #include "llflexibleobject.h"
  66. #include "hbfloaterdebugtags.h"
  67. #include "hbfloatereditenvsettings.h"
  68. #include "hbfloatersearch.h"
  69. #include "llfloaterstats.h"
  70. #include "llfloatervoicedevicesettings.h"
  71. #include "llfloaterwindlight.h"
  72. #include "llgridmanager.h" // For gIsInSecondLife
  73. #include "llgroupnotify.h"
  74. #include "llhudeffectlookat.h"
  75. #include "llinventorymodelfetch.h"
  76. #include "llmeshrepository.h"
  77. #include "llpanelminimap.h"
  78. #include "llpipeline.h"
  79. #include "llpreviewnotecard.h"
  80. #include "llpreviewscript.h"
  81. #include "llpuppetmotion.h"
  82. #include "llselectmgr.h"
  83. #include "llskinningutil.h"
  84. #include "llsky.h"
  85. #include "llstartup.h"
  86. #include "llstatusbar.h"
  87. #include "llsurfacepatch.h"
  88. #include "lltoolbar.h"
  89. #include "lltracker.h"
  90. #include "llvieweraudio.h"
  91. #include "hbviewerautomation.h"
  92. #include "llviewerdisplay.h"
  93. #include "llviewerjoystick.h"
  94. #include "llviewermenu.h"
  95. #include "llviewerobjectlist.h"
  96. #include "llviewerparcelmedia.h"
  97. #include "llviewerparcelmgr.h"
  98. #include "llviewershadermgr.h"
  99. #include "llviewertexturelist.h"
  100. #include "llviewerthrottle.h"
  101. #include "llviewerwindow.h"
  102. #include "llvoavatarself.h"
  103. #include "llvocache.h"
  104. #include "llvoiceclient.h"
  105. #include "llvosky.h"
  106. #include "llvosurfacepatch.h"
  107. #include "llvotree.h"
  108. #include "llvovolume.h"
  109. #include "llvowlsky.h"
  110. #include "llwlskyparammgr.h"
  111. #include "llworld.h"
  112. std::map<std::string, LLControlGroup*> gSettings;
  113. // Those two are saved at end of the session
  114. LLControlGroup gSavedSettings("Global");
  115. LLControlGroup gSavedPerAccountSettings("PerAccount");
  116. // Read-only
  117. LLControlGroup gColors("Colors");
  118. extern bool gUpdateDrawDistance;
  119. ////////////////////////////////////////////////////////////////////////////
  120. // Listeners
  121. static bool handleAutoReloadFailedPatchTexDelayChanged(const LLSD& newvalue)
  122. {
  123. LLSurfacePatch::setAutoReloadDelay(newvalue.asInteger());
  124. return true;
  125. }
  126. static bool handleDebugPermissionsChanged(const LLSD& newvalue)
  127. {
  128. dialog_refresh_all();
  129. return true;
  130. }
  131. static bool handleHighResSnapshotChanged(const LLSD& newvalue)
  132. {
  133. if (newvalue.asBoolean())
  134. {
  135. // High Res Snapshot active, must uncheck RenderUIInSnapshot
  136. gSavedSettings.setBool("RenderUIInSnapshot", false);
  137. }
  138. return true;
  139. }
  140. #if LL_FAST_TIMERS_ENABLED
  141. static bool handleFastTimersAlwaysEnabledChanged(const LLSD& newvalue)
  142. {
  143. if (gFastTimerViewp && gFastTimerViewp->getVisible())
  144. {
  145. // Nothing to do
  146. return true;
  147. }
  148. if (newvalue.asBoolean())
  149. {
  150. gEnableFastTimers = true;
  151. llinfos << "Fast timers enabled." << llendl;
  152. }
  153. else
  154. {
  155. gEnableFastTimers = false;
  156. llinfos << "Fast timers disabled." << llendl;
  157. }
  158. return true;
  159. }
  160. #endif // LL_FAST_TIMERS_ENABLED
  161. static bool handleRenderCompressTexturesChanged(const LLSD& newvalue)
  162. {
  163. if (gFeatureManager.isFeatureAvailable("RenderCompressTextures"))
  164. {
  165. LLImageGL::sCompressTextures =
  166. gGLManager.mGLVersion >= 2.1f &&
  167. gSavedSettings.getBool("RenderCompressTextures");
  168. LLImageGL::sCompressThreshold =
  169. gSavedSettings.getU32("RenderCompressThreshold");
  170. }
  171. return true;
  172. }
  173. static bool handleRenderFarClipChanged(const LLSD& newvalue)
  174. {
  175. gUpdateDrawDistance = true; // Updated in llviewerdisplay.cpp
  176. return true;
  177. }
  178. static bool handleSetShaderChanged(const LLSD& newvalue)
  179. {
  180. // Changing shader level may invalidate existing cached bump maps, as the
  181. // shader type determines the format of the bump map it expects - clear
  182. // and repopulate the bump cache
  183. gBumpImageList.destroyGL();
  184. gBumpImageList.restoreGL();
  185. LLPipeline::refreshCachedSettings();
  186. gViewerShaderMgrp->setShaders();
  187. return true;
  188. }
  189. static bool handleRenderDeferredChanged(const LLSD& newvalue)
  190. {
  191. if (gPipeline.isInit())
  192. {
  193. LLPipeline::refreshCachedSettings();
  194. gPipeline.releaseGLBuffers();
  195. gPipeline.createGLBuffers();
  196. gPipeline.resetVertexBuffers();
  197. gViewerShaderMgrp->setShaders();
  198. // Rebuild objects to make sure all will properly show up... HB
  199. handle_objects_visibility(NULL);
  200. }
  201. return true;
  202. }
  203. static bool handleReflectionProbesChanged(const LLSD& newvalue)
  204. {
  205. if (gPipeline.isInit())
  206. {
  207. LLPipeline::refreshCachedSettings();
  208. gPipeline.releaseGLBuffers();
  209. gPipeline.createGLBuffers();
  210. gPipeline.resetVertexBuffers();
  211. gViewerShaderMgrp->setShaders();
  212. // Rebuild all reflection probes. HB
  213. handle_refresh_probes(NULL);
  214. }
  215. return true;
  216. }
  217. static bool handlerScreenSpaceReflectionsChanged(const LLSD& newvalue)
  218. {
  219. static bool warned_once = false;
  220. bool handled = handleReflectionProbesChanged(newvalue);
  221. if (!warned_once && newvalue.asBoolean())
  222. {
  223. warned_once = true;
  224. gNotifications.add("ScreenSpaceReflectionsBroken");
  225. }
  226. return handled;
  227. }
  228. static bool handleAvatarPhysicsChanged(const LLSD& newvalue)
  229. {
  230. LLVOAvatar::sAvatarPhysics = newvalue.asBoolean();
  231. gAgent.sendAgentSetAppearance();
  232. return true;
  233. }
  234. static bool handleBakeOnMeshUploadsChanged(const LLSD& newvalue)
  235. {
  236. gAgent.setUploadedBakesLimit();
  237. return true;
  238. }
  239. #if LL_PUPPETRY
  240. static bool handlePuppetryAllowedChanged(const LLSD& newvalue)
  241. {
  242. LLPuppetMotion::updatePuppetryEnabling();
  243. return true;
  244. }
  245. #endif
  246. static bool handlePlayDefaultBentoAnimationChanged(const LLSD& newvalue)
  247. {
  248. EAnimRequest request = newvalue.asBoolean() ? ANIM_REQUEST_START
  249. : ANIM_REQUEST_STOP;
  250. gAgent.sendAnimationRequest(ANIM_AGENT_BENTO_IDLE, request);
  251. return true;
  252. }
  253. static bool handleRenderWaterReflectionTypeChanged(const LLSD& newvalue)
  254. {
  255. LLPipeline::refreshCachedSettings();
  256. gWorld.updateWaterObjects();
  257. return true;
  258. }
  259. static bool handleMeshMaxConcurrentRequestsChanged(const LLSD& newvalue)
  260. {
  261. LLMeshRepoThread::sMaxConcurrentRequests = (U32)newvalue.asInteger();
  262. return true;
  263. }
  264. static bool handleShadowsResized(const LLSD& newvalue)
  265. {
  266. gResizeShadowTexture = true;
  267. return true;
  268. }
  269. static bool handleRenderGLImageSyncInThread(const LLSD& newvalue)
  270. {
  271. LLImageGL::sSyncInThread = newvalue.asBoolean();
  272. return true;
  273. }
  274. static bool handleGLBufferChanged(const LLSD& newvalue)
  275. {
  276. LLPipeline::refreshCachedSettings();
  277. if (gPipeline.isInit())
  278. {
  279. gPipeline.releaseGLBuffers();
  280. gPipeline.createGLBuffers();
  281. }
  282. return true;
  283. }
  284. static bool handleLUTBufferChanged(const LLSD& newvalue)
  285. {
  286. if (gPipeline.isInit())
  287. {
  288. gPipeline.releaseLUTBuffers();
  289. gPipeline.createLUTBuffers();
  290. }
  291. return true;
  292. }
  293. static bool handleVolumeSettingsChanged(const LLSD& newvalue)
  294. {
  295. LLVOVolume::updateSettings();
  296. return true;
  297. }
  298. static bool handleSkyUseClassicCloudsChanged(const LLSD& newvalue)
  299. {
  300. if (!newvalue.asBoolean())
  301. {
  302. gWorld.killClouds();
  303. }
  304. return true;
  305. }
  306. static bool handleTerrainLODChanged(const LLSD& newvalue)
  307. {
  308. LLVOSurfacePatch::sLODFactor = (F32)newvalue.asReal();
  309. // Square lod factor to get exponential range of [0, 4] and keep a value of
  310. // 1 in the middle of the detail slider for consistency with other detail
  311. // sliders (see panel_preferences_graphics1.xml)
  312. LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor;
  313. return true;
  314. }
  315. static bool handleTreeSettingsChanged(const LLSD& newvalue)
  316. {
  317. LLVOTree::updateSettings();
  318. return true;
  319. }
  320. static bool handleFlexLODChanged(const LLSD& newvalue)
  321. {
  322. LLVolumeImplFlexible::sUpdateFactor = (F32)newvalue.asReal();
  323. return true;
  324. }
  325. static bool handleGammaChanged(const LLSD& newvalue)
  326. {
  327. F32 gamma = (F32)newvalue.asReal();
  328. if (gWindowp && gamma != gWindowp->getGamma())
  329. {
  330. // Only save it if it changed
  331. if (!gWindowp->setGamma(gamma))
  332. {
  333. llwarns << "Failed to set the display gamma to " << gamma
  334. << ". Restoring the default gamma." << llendl;
  335. gWindowp->restoreGamma();
  336. }
  337. }
  338. return true;
  339. }
  340. static bool handleMaxPartCountChanged(const LLSD& newvalue)
  341. {
  342. LLViewerPartSim::setMaxPartCount(newvalue.asInteger());
  343. return true;
  344. }
  345. static bool handleVideoMemoryChanged(const LLSD& newvalue)
  346. {
  347. // Note: not using newvalue.asInteger() because this callback is also
  348. // used after updating MaxBoundTexMem. HB
  349. gTextureList.updateMaxResidentTexMem(gSavedSettings.getS32("TextureMemory"));
  350. return true;
  351. }
  352. static bool handleBandwidthChanged(const LLSD& newvalue)
  353. {
  354. gViewerThrottle.setMaxBandwidth(newvalue.asInteger());
  355. return true;
  356. }
  357. static bool handleDebugConsoleMaxLinesChanged(const LLSD& newvalue)
  358. {
  359. if (gDebugViewp && gDebugViewp->mDebugConsolep)
  360. {
  361. gDebugViewp->mDebugConsolep->setMaxLines(newvalue.asInteger());
  362. }
  363. return true;
  364. }
  365. static bool handleChatConsoleMaxLinesChanged(const LLSD& newvalue)
  366. {
  367. if (gConsolep)
  368. {
  369. gConsolep->setMaxLines(newvalue.asInteger());
  370. }
  371. return true;
  372. }
  373. static bool handleChatFontSizeChanged(const LLSD& newvalue)
  374. {
  375. if (gConsolep)
  376. {
  377. gConsolep->setFontSize(newvalue.asInteger());
  378. }
  379. return true;
  380. }
  381. static bool handleChatPersistTimeChanged(const LLSD& newvalue)
  382. {
  383. if (gConsolep)
  384. {
  385. gConsolep->setLinePersistTime((F32) newvalue.asReal());
  386. }
  387. return true;
  388. }
  389. static bool handleAudioVolumeChanged(const LLSD& newvalue)
  390. {
  391. audio_update_volume(true);
  392. return true;
  393. }
  394. static bool handleStackMinimizedTopToBottom(const LLSD& newvalue)
  395. {
  396. LLFloaterView::setStackMinimizedTopToBottom(newvalue.asBoolean());
  397. return true;
  398. }
  399. static bool handleStackMinimizedRightToLeft(const LLSD& newvalue)
  400. {
  401. LLFloaterView::setStackMinimizedRightToLeft(newvalue.asBoolean());
  402. return true;
  403. }
  404. static bool handleStackScreenWidthFraction(const LLSD& newvalue)
  405. {
  406. LLFloaterView::setStackScreenWidthFraction(newvalue.asInteger());
  407. return true;
  408. }
  409. static bool handleJoystickChanged(const LLSD& newvalue)
  410. {
  411. LLViewerJoystick::getInstance()->setCameraNeedsUpdate(true);
  412. return true;
  413. }
  414. static bool handleAvatarOffsetChanged(const LLSD& newvalue)
  415. {
  416. if (isAgentAvatarValid())
  417. {
  418. gAgentAvatarp->scheduleHoverUpdate();
  419. }
  420. return true;
  421. }
  422. static bool handleCameraCollisionsChanged(const LLSD& newvalue)
  423. {
  424. if (newvalue.asBoolean())
  425. {
  426. gAgent.setCameraCollidePlane(LLVector4(0.f, 0.f, 0.f, 1.f));
  427. }
  428. return true;
  429. }
  430. static bool handleCameraChanged(const LLSD& newvalue)
  431. {
  432. gAgent.setupCameraView();
  433. return true;
  434. }
  435. static bool handleTrackFocusObjectChanged(const LLSD& newvalue)
  436. {
  437. gAgent.setObjectTracking(newvalue.asBoolean());
  438. return true;
  439. }
  440. static bool handlePrimMediaChanged(const LLSD& newvalue)
  441. {
  442. LLVOVolume::initSharedMedia();
  443. return true;
  444. }
  445. static bool handleAudioStreamMusicChanged(const LLSD& newvalue)
  446. {
  447. if (gAudiop)
  448. {
  449. if (newvalue.asBoolean())
  450. {
  451. LLParcel* parcel = gViewerParcelMgr.getAgentParcel();
  452. if (parcel && !parcel->getMusicURL().empty())
  453. {
  454. // If stream is already playing, do not call this otherwise
  455. // music will briefly stop
  456. if (!gAudiop->isInternetStreamPlaying())
  457. {
  458. LLViewerParcelMedia::playStreamingMusic(parcel);
  459. }
  460. }
  461. }
  462. else
  463. {
  464. gAudiop->stopInternetStream();
  465. }
  466. }
  467. return true;
  468. }
  469. static bool handleUseOcclusionChanged(const LLSD& newvalue)
  470. {
  471. LLPipeline::sUseOcclusion =
  472. newvalue.asBoolean() && !gUseWireframe &&
  473. gFeatureManager.isFeatureAvailable("UseOcclusion") ? 2 : 0;
  474. return true;
  475. }
  476. static bool handleNumpadControlChanged(const LLSD& newvalue)
  477. {
  478. if (gKeyboardp)
  479. {
  480. gKeyboardp->setNumpadDistinct((LLKeyboard::e_numpad_distinct)newvalue.asInteger());
  481. }
  482. return true;
  483. }
  484. static bool handleWLSkyDetailChanged(const LLSD& newvalue)
  485. {
  486. LLVOWLSky::updateSettings();
  487. return true;
  488. }
  489. static bool handleResetVertexBuffersChanged(const LLSD&)
  490. {
  491. LLVOVolume::sRenderMaxVBOSize = gSavedSettings.getU32("RenderMaxVBOSize");
  492. if (gPipeline.isInit())
  493. {
  494. gPipeline.resetVertexBuffers();
  495. }
  496. LLVOTree::updateSettings();
  497. return true;
  498. }
  499. static bool handleRenderGLUseVBCacheChanged(const LLSD& newvalue)
  500. {
  501. LLRender::sUseBufferCache = newvalue.asBoolean();
  502. if (gPipeline.isInit())
  503. {
  504. gPipeline.resetVertexBuffers();
  505. }
  506. return true;
  507. }
  508. static bool handleRenderUseBasecolorAsDiffuseChanged(const LLSD& newvalue)
  509. {
  510. if (!gUsePBRShaders) // Setting change has no effect in PBR mode
  511. {
  512. // Force-rebuild all objects in the render pipeline.
  513. handle_objects_visibility(NULL);
  514. doAfterInterval([]
  515. {
  516. gPipeline.resetVertexBuffers();
  517. },
  518. 1.f);
  519. }
  520. return true;
  521. }
  522. static bool handleRenderHDRIEnabledChanged(const LLSD& newvalue)
  523. {
  524. #if !LL_RESET_HDRI_SKY_ON_REFLECTION_MAP_RESET
  525. if (gUsePBRShaders)
  526. {
  527. // Always reset the reflection maps when toggling the HDRI sky preview.
  528. gPipeline.mReflectionMapManager.reset();
  529. }
  530. #endif
  531. load_hdri_sky(false);
  532. return true;
  533. }
  534. static bool handleRenderOptimizeMeshVertexCacheChanged(const LLSD& newvalue)
  535. {
  536. LLVolume::sOptimizeCache = newvalue.asBoolean();
  537. return true;
  538. }
  539. static bool handleNoVerifySSLCertChanged(const LLSD& newvalue)
  540. {
  541. LLXMLRPCTransaction::setVerifyCert(!newvalue.asBoolean());
  542. return true;
  543. }
  544. static bool handleEnableHTTP2Changed(const LLSD& newvalue)
  545. {
  546. LLCore::LLHttp::gEnabledHTTP2 = newvalue.asBoolean();
  547. return true;
  548. }
  549. static bool handlePingInterpolateChanged(const LLSD& newvalue)
  550. {
  551. LLViewerObject::setPingInterpolate(newvalue.asBoolean());
  552. return true;
  553. }
  554. static bool handleVelocityInterpolateChanged(const LLSD& newvalue)
  555. {
  556. LLViewerObject::setVelocityInterpolate(newvalue.asBoolean());
  557. return true;
  558. }
  559. static bool handleInterpolationTimesChanged(const LLSD& newvalue)
  560. {
  561. LLViewerObject::setUpdateInterpolationTimes(gSavedSettings.getF32("InterpolationTime"),
  562. gSavedSettings.getF32("InterpolationPhaseOut"),
  563. gSavedSettings.getF32("RegionCrossingInterpolationTime"));
  564. return true;
  565. }
  566. static bool handleRepartition(const LLSD&)
  567. {
  568. if (gPipeline.isInit())
  569. {
  570. gOctreeMaxCapacity = gSavedSettings.getU32("OctreeMaxNodeCapacity");
  571. gOctreeMinSize = gSavedSettings.getF32("OctreeMinimumNodeSize");
  572. gObjectList.repartitionObjects();
  573. }
  574. return true;
  575. }
  576. static bool handleRenderDynamicLODChanged(const LLSD& newvalue)
  577. {
  578. LLPipeline::sDynamicLOD = newvalue.asBoolean();
  579. return true;
  580. }
  581. static bool handleAvatarDebugSettingsChanged(const LLSD&)
  582. {
  583. LLVOAvatar::updateSettings();
  584. return true;
  585. }
  586. static bool handleDisplayNamesUsageChanged(const LLSD& newvalue)
  587. {
  588. LLAvatarNameCache::setUseDisplayNames((U32)newvalue.asInteger());
  589. LLVOAvatar::invalidateNameTags();
  590. gAvatarTracker.dirtyBuddies();
  591. return true;
  592. }
  593. static bool handleOmitResidentAsLastNameChanged(const LLSD& newvalue)
  594. {
  595. LLAvatarName::sOmitResidentAsLastName = newvalue.asBoolean();
  596. LLVOAvatar::invalidateNameTags();
  597. gAvatarTracker.dirtyBuddies();
  598. return true;
  599. }
  600. static bool handleLegacyNamesForFriendsChanged(const LLSD& newvalue)
  601. {
  602. LLAvatarName::sLegacyNamesForFriends = newvalue.asBoolean();
  603. gAvatarTracker.dirtyBuddies();
  604. return true;
  605. }
  606. static bool handleLegacyNamesForSpeakersChanged(const LLSD& newvalue)
  607. {
  608. LLAvatarName::sLegacyNamesForSpeakers = newvalue.asBoolean();
  609. return true;
  610. }
  611. static bool handleRenderResolutionDivisorChanged(const LLSD&)
  612. {
  613. gResizeScreenTexture = true;
  614. return true;
  615. }
  616. static bool handleDebugObjectIdChanged(const LLSD& newvalue)
  617. {
  618. LLUUID obj_id;
  619. obj_id.set(newvalue.asString(), false);
  620. LLViewerObject::setDebugObjectId(obj_id);
  621. return true;
  622. }
  623. static bool handleDebugViewsChanged(const LLSD& newvalue)
  624. {
  625. LLView::sDebugRects = newvalue.asBoolean();
  626. return true;
  627. }
  628. static bool handleFSFlushOnWriteChanged(const LLSD& newvalue)
  629. {
  630. LLFile::sFlushOnWrite = newvalue.asBoolean();
  631. return true;
  632. }
  633. static bool handlePreciseLogTimestampsChanged(const LLSD& newvalue)
  634. {
  635. bool enabled = newvalue.asBoolean();
  636. LLError::Log::sPreciseTimeStamp = enabled;
  637. llinfos << "Precise log file timestamps " << (enabled ? "en" : "dis")
  638. << "abled." << llendl;
  639. return true;
  640. }
  641. static bool handleUserLogFileChanged(const LLSD& newvalue)
  642. {
  643. std::string log_filename = newvalue.asString();
  644. LLFile::remove(log_filename);
  645. LLError::logToFile(log_filename);
  646. gAppViewerp->clearLogFilename();
  647. return true;
  648. }
  649. static bool handleUseAISForFetchingChanged(const LLSD& newvalue)
  650. {
  651. LLInventoryModelFetch::setUseAISFetching(newvalue.asBoolean());
  652. return true;
  653. }
  654. static bool handleTextureFetchBoostWithFetchesChanged(const LLSD& newvalue)
  655. {
  656. if (newvalue.asBoolean())
  657. {
  658. gNotifications.add("TextureFetchesBoostWithFetches");
  659. }
  660. return true;
  661. }
  662. static bool handleTextureFetchBoostWithSpeedChanged(const LLSD& newvalue)
  663. {
  664. if (newvalue.asBoolean())
  665. {
  666. gNotifications.add("TextureFetchesBoostWithSpeed");
  667. }
  668. return true;
  669. }
  670. static bool handleFullResBoostedTexturesChanged(const LLSD& newvalue)
  671. {
  672. if (newvalue.asBoolean())
  673. {
  674. gNotifications.add("TextureBoostedLoadFullRes");
  675. }
  676. return true;
  677. }
  678. static bool handleRestrainedLoveRelaxedTempAttachChanged(const LLSD& newvalue)
  679. {
  680. if (newvalue.asBoolean())
  681. {
  682. gNotifications.add("RLVRelaxedTempAttach");
  683. }
  684. return true;
  685. }
  686. static bool handleRestrainedLoveAutomaticRenameItemsChanged(const LLSD& newvalue)
  687. {
  688. if (!newvalue.asBoolean())
  689. {
  690. gNotifications.add("RLVNoAttachmentAutoRename");
  691. }
  692. return true;
  693. }
  694. bool handleHideGroupTitleChanged(const LLSD& newvalue)
  695. {
  696. gAgent.setHideGroupTitle(newvalue.asBoolean());
  697. return true;
  698. }
  699. bool handleDebugShowRenderInfoChanged(const LLSD& newvalue)
  700. {
  701. if (newvalue.asBoolean())
  702. {
  703. gPipeline.mNeedsDrawStats = true;
  704. }
  705. else if (!LLFloaterStats::findInstance())
  706. {
  707. gPipeline.mNeedsDrawStats = false;
  708. }
  709. return true;
  710. }
  711. bool handleDelayGLTextureDeleteChanged(const LLSD& newvalue)
  712. {
  713. LLImageGL::setDelayedTextureDelete(newvalue.asBoolean());
  714. return true;
  715. }
  716. bool handleEffectColorChanged(const LLSD& newvalue)
  717. {
  718. gAgent.setEffectColor(LLColor4(newvalue));
  719. return true;
  720. }
  721. bool handleLipSyncEnabledChanged(const LLSD& newvalue)
  722. {
  723. LLVOAvatar::sLipSyncEnabled = newvalue.asBoolean();
  724. return true;
  725. }
  726. bool handleVoiceServerTypeChanged(const LLSD&)
  727. {
  728. LLFloaterVoiceDeviceSettings* floaterp =
  729. LLFloaterVoiceDeviceSettings::findInstance();
  730. if (floaterp)
  731. {
  732. floaterp->cancel();
  733. }
  734. return true;
  735. }
  736. bool handleVoiceClientPrefsChanged(const LLSD& newvalue)
  737. {
  738. if (gVoiceClient.ready())
  739. {
  740. gVoiceClient.updateSettings();
  741. }
  742. return true;
  743. }
  744. static bool handleMiniMapCenterChanged(const LLSD& newvalue)
  745. {
  746. LLPanelMiniMap::sMiniMapCenter = newvalue.asInteger();
  747. return true;
  748. }
  749. static bool handleMiniMapRotateChanged(const LLSD& newvalue)
  750. {
  751. LLPanelMiniMap::sMiniMapRotate = newvalue.asBoolean();
  752. return true;
  753. }
  754. static bool handleNotecardEditorFontChanged(const LLSD&)
  755. {
  756. LLPreviewNotecard::refreshCachedSettings();
  757. return true;
  758. }
  759. static bool handleScriptEditorFontChanged(const LLSD&)
  760. {
  761. LLPreviewScript::refreshCachedSettings();
  762. return true;
  763. }
  764. static bool handleAllowColoredFontsChanged(const LLSD& newvalue)
  765. {
  766. LLFontGL::setColorUse(newvalue.asBoolean());
  767. return true;
  768. }
  769. static bool handleToolbarButtonsChanged(const LLSD&)
  770. {
  771. if (gToolBarp)
  772. {
  773. gToolBarp->layoutButtons();
  774. }
  775. return true;
  776. }
  777. static bool handleSpellCheckChanged(const LLSD& newvalue)
  778. {
  779. LLSpellCheck::getInstance()->setSpellCheck(gSavedSettings.getBool("SpellCheck"));
  780. LLSpellCheck::getInstance()->setShowMisspelled(gSavedSettings.getBool("SpellCheckShow"));
  781. LLSpellCheck::getInstance()->setDictionary(gSavedSettings.getString("SpellCheckLanguage"));
  782. return true;
  783. }
  784. static bool handleLanguageChanged(const LLSD& newvalue)
  785. {
  786. gAgent.updateLanguage();
  787. return true;
  788. }
  789. static bool handleUseOldStatusBarIconsChanged(const LLSD&)
  790. {
  791. if (gStatusBarp)
  792. {
  793. gStatusBarp->setIcons();
  794. }
  795. return true;
  796. }
  797. static bool handleSwapShoutWhisperShortcutsChanged(const LLSD& newvalue)
  798. {
  799. LLChatBar::sSwappedShortcuts = newvalue.asBoolean();
  800. return true;
  801. }
  802. static bool handleSearchURLChanged(const LLSD& newvalue)
  803. {
  804. // Do not propagate in OpenSim, since handleSearchURLChanged() is only
  805. // called for SL-specific settings (the search URL in OpenSim is set
  806. // via simulator features, not via saved settings).
  807. if (!gIsInSecondLife)
  808. {
  809. HBFloaterSearch::setSearchURL(newvalue.asString());
  810. }
  811. return true;
  812. }
  813. static bool handleVOCacheSettingChanged(const LLSD& newvalue)
  814. {
  815. LLVOCacheEntry::updateSettings();
  816. return true;
  817. }
  818. static bool handleUse360InterestListSettingChanged(const LLSD& newvalue)
  819. {
  820. LLViewerRegion* regionp = gAgent.getRegion();
  821. if (regionp)
  822. {
  823. regionp->setInterestListMode();
  824. }
  825. return true;
  826. }
  827. static bool handleShowPropLinesAtWaterSurfaceChanged(const LLSD&)
  828. {
  829. // Force an update of the property lines
  830. for (LLWorld::region_list_t::const_iterator
  831. iter = gWorld.getRegionList().begin(),
  832. end = gWorld.getRegionList().end();
  833. iter != end; ++iter)
  834. {
  835. (*iter)->dirtyHeights();
  836. }
  837. return true;
  838. }
  839. static bool handleLightshareEnabledChanged(const LLSD& newvalue)
  840. {
  841. if (!newvalue.asBoolean() && LLStartUp::isLoggedIn())
  842. {
  843. gWLSkyParamMgr.processLightshareReset(true);
  844. }
  845. return true;
  846. }
  847. static bool handleUseLocalEnvironmentChanged(const LLSD& newvalue)
  848. {
  849. if (newvalue.asBoolean())
  850. {
  851. gWLSkyParamMgr.setDirty();
  852. gWLSkyParamMgr.animate(false);
  853. gSavedSettings.setBool("UseParcelEnvironment", false);
  854. }
  855. else
  856. {
  857. HBFloaterLocalEnv::closeInstance();
  858. }
  859. return true;
  860. }
  861. static bool handleUseParcelEnvironmentChanged(const LLSD& newvalue)
  862. {
  863. if (newvalue.asBoolean())
  864. {
  865. LLFloaterWindlight::hideInstance();
  866. HBFloaterLocalEnv::closeInstance();
  867. gWLSkyParamMgr.setDirty();
  868. gWLSkyParamMgr.animate(false);
  869. gSavedSettings.setBool("UseLocalEnvironment", false);
  870. gSavedSettings.setBool("UseWLEstateTime", false);
  871. gEnvironment.clearEnvironment(LLEnvironment::ENV_LOCAL);
  872. gEnvironment.setSelectedEnvironment(LLEnvironment::ENV_PARCEL,
  873. LLEnvironment::TRANSITION_INSTANT);
  874. if (gAutomationp)
  875. {
  876. gAutomationp->onWindlightChange("parcel", "", "");
  877. }
  878. }
  879. return true;
  880. }
  881. static bool handleUseWLEstateTimeChanged(const LLSD& newvalue)
  882. {
  883. std::string time;
  884. if (newvalue.asBoolean())
  885. {
  886. gSavedSettings.setBool("UseLocalEnvironment", false);
  887. time = "region";
  888. LLEnvironment::setRegion();
  889. }
  890. else
  891. {
  892. time = "local";
  893. }
  894. if (gAutomationp)
  895. {
  896. gAutomationp->onWindlightChange(time, "", "");
  897. }
  898. return true;
  899. }
  900. static bool handlePrivateLookAtChanged(const LLSD& newvalue)
  901. {
  902. LLHUDEffectLookAt::updateSettings();
  903. return true;
  904. }
  905. ////////////////////////////////////////////////////////////////////////////
  906. // Let's shorten the sources, improve their readability, and guard against
  907. // crashes in case of a missing setting... HB
  908. static void add_listener(const char* name, bool(&func)(const LLSD&))
  909. {
  910. LLControlVariable* controlp = gSavedSettings.getControl(name);
  911. if (controlp)
  912. {
  913. controlp->getSignal()->connect(boost::bind(func, _2));
  914. }
  915. else
  916. {
  917. llwarns << "Could not find a global setting named: " << name << llendl;
  918. }
  919. }
  920. void settings_setup_listeners()
  921. {
  922. // User interface related settings
  923. add_listener("ChatConsoleMaxLines", handleChatConsoleMaxLinesChanged);
  924. add_listener("ChatFontSize", handleChatFontSizeChanged);
  925. add_listener("ChatPersistTime", handleChatPersistTimeChanged);
  926. add_listener("DebugConsoleMaxLines", handleDebugConsoleMaxLinesChanged);
  927. add_listener("DebugObjectId", handleDebugObjectIdChanged);
  928. add_listener("DebugViews", handleDebugViewsChanged);
  929. add_listener("DisplayNamesUsage", handleDisplayNamesUsageChanged);
  930. add_listener("DisplayGamma", handleGammaChanged);
  931. add_listener("Language", handleLanguageChanged);
  932. add_listener("LanguageIsPublic", handleLanguageChanged);
  933. add_listener("LegacyNamesForFriends", handleLegacyNamesForFriendsChanged);
  934. add_listener("LegacyNamesForSpeakers",
  935. handleLegacyNamesForSpeakersChanged);
  936. add_listener("MiniMapCenter", handleMiniMapCenterChanged);
  937. add_listener("MiniMapRotate", handleMiniMapRotateChanged);
  938. add_listener("NotecardEditorFont", handleNotecardEditorFontChanged);
  939. add_listener("OmitResidentAsLastName",
  940. handleOmitResidentAsLastNameChanged);
  941. add_listener("ShowBuildButton", handleToolbarButtonsChanged);
  942. add_listener("ShowChatButton", handleToolbarButtonsChanged);
  943. add_listener("ShowFlyButton", handleToolbarButtonsChanged);
  944. add_listener("ShowFriendsButton", handleToolbarButtonsChanged);
  945. add_listener("ShowGroupsButton", handleToolbarButtonsChanged);
  946. add_listener("ShowIMButton", handleToolbarButtonsChanged);
  947. add_listener("ShowInventoryButton", handleToolbarButtonsChanged);
  948. add_listener("ShowMapButton", handleToolbarButtonsChanged);
  949. add_listener("ShowMiniMapButton", handleToolbarButtonsChanged);
  950. add_listener("ShowPropLinesAtWaterSurface",
  951. handleShowPropLinesAtWaterSurfaceChanged);
  952. add_listener("ShowRadarButton", handleToolbarButtonsChanged);
  953. add_listener("ShowSearchButton", handleToolbarButtonsChanged);
  954. add_listener("ShowSnapshotButton", handleToolbarButtonsChanged);
  955. add_listener("StackMinimizedTopToBottom", handleStackMinimizedTopToBottom);
  956. add_listener("StackMinimizedRightToLeft", handleStackMinimizedRightToLeft);
  957. add_listener("StackScreenWidthFraction", handleStackScreenWidthFraction);
  958. add_listener("SwapShoutWhisperShortcuts",
  959. handleSwapShoutWhisperShortcutsChanged);
  960. add_listener("SystemLanguage", handleLanguageChanged);
  961. add_listener("UseOldStatusBarIcons", handleUseOldStatusBarIconsChanged);
  962. add_listener("ScriptEditorFont", handleScriptEditorFontChanged);
  963. add_listener("AllowColoredFonts", handleAllowColoredFontsChanged);
  964. // Joystick related settings
  965. add_listener("JoystickAxis0", handleJoystickChanged);
  966. add_listener("JoystickAxis1", handleJoystickChanged);
  967. add_listener("JoystickAxis2", handleJoystickChanged);
  968. add_listener("JoystickAxis3", handleJoystickChanged);
  969. add_listener("JoystickAxis4", handleJoystickChanged);
  970. add_listener("JoystickAxis5", handleJoystickChanged);
  971. add_listener("JoystickAxis6", handleJoystickChanged);
  972. add_listener("FlycamAxisScale0", handleJoystickChanged);
  973. add_listener("FlycamAxisScale1", handleJoystickChanged);
  974. add_listener("FlycamAxisScale2", handleJoystickChanged);
  975. add_listener("FlycamAxisScale3", handleJoystickChanged);
  976. add_listener("FlycamAxisScale4", handleJoystickChanged);
  977. add_listener("FlycamAxisScale5", handleJoystickChanged);
  978. add_listener("FlycamAxisScale6", handleJoystickChanged);
  979. add_listener("FlycamAxisDeadZone0", handleJoystickChanged);
  980. add_listener("FlycamAxisDeadZone1", handleJoystickChanged);
  981. add_listener("FlycamAxisDeadZone2", handleJoystickChanged);
  982. add_listener("FlycamAxisDeadZone3", handleJoystickChanged);
  983. add_listener("FlycamAxisDeadZone4", handleJoystickChanged);
  984. add_listener("FlycamAxisDeadZone5", handleJoystickChanged);
  985. add_listener("FlycamAxisDeadZone6", handleJoystickChanged);
  986. add_listener("AvatarAxisScale0", handleJoystickChanged);
  987. add_listener("AvatarAxisScale1", handleJoystickChanged);
  988. add_listener("AvatarAxisScale2", handleJoystickChanged);
  989. add_listener("AvatarAxisScale3", handleJoystickChanged);
  990. add_listener("AvatarAxisScale4", handleJoystickChanged);
  991. add_listener("AvatarAxisScale5", handleJoystickChanged);
  992. add_listener("AvatarAxisDeadZone0", handleJoystickChanged);
  993. add_listener("AvatarAxisDeadZone1", handleJoystickChanged);
  994. add_listener("AvatarAxisDeadZone2", handleJoystickChanged);
  995. add_listener("AvatarAxisDeadZone3", handleJoystickChanged);
  996. add_listener("AvatarAxisDeadZone4", handleJoystickChanged);
  997. add_listener("AvatarAxisDeadZone5", handleJoystickChanged);
  998. add_listener("BuildAxisScale0", handleJoystickChanged);
  999. add_listener("BuildAxisScale1", handleJoystickChanged);
  1000. add_listener("BuildAxisScale2", handleJoystickChanged);
  1001. add_listener("BuildAxisScale3", handleJoystickChanged);
  1002. add_listener("BuildAxisScale4", handleJoystickChanged);
  1003. add_listener("BuildAxisScale5", handleJoystickChanged);
  1004. add_listener("BuildAxisDeadZone0", handleJoystickChanged);
  1005. add_listener("BuildAxisDeadZone1", handleJoystickChanged);
  1006. add_listener("BuildAxisDeadZone2", handleJoystickChanged);
  1007. add_listener("BuildAxisDeadZone3", handleJoystickChanged);
  1008. add_listener("BuildAxisDeadZone4", handleJoystickChanged);
  1009. add_listener("BuildAxisDeadZone5", handleJoystickChanged);
  1010. add_listener("NumpadControl", handleNumpadControlChanged);
  1011. // Avatar related settings
  1012. add_listener("AvatarOffsetZ", handleAvatarOffsetChanged);
  1013. add_listener("AvatarPhysics", handleAvatarPhysicsChanged);
  1014. add_listener("OSAllowBakeOnMeshUploads", handleBakeOnMeshUploadsChanged);
  1015. #if LL_PUPPETRY
  1016. add_listener("PuppetryAllowed", handlePuppetryAllowedChanged);
  1017. #endif
  1018. add_listener("PlayDefaultBentoAnimation",
  1019. handlePlayDefaultBentoAnimationChanged);
  1020. // Camera related settings
  1021. add_listener("CameraIgnoreCollisions", handleCameraCollisionsChanged);
  1022. add_listener("CameraFrontView", handleCameraChanged);
  1023. add_listener("CameraOffsetDefault", handleCameraChanged);
  1024. add_listener("FirstPersonAvatarVisible", handleAvatarDebugSettingsChanged);
  1025. add_listener("FocusOffsetDefault", handleCameraChanged);
  1026. add_listener("FocusOffsetFrontView", handleCameraChanged);
  1027. add_listener("CameraOffsetFrontView", handleCameraChanged);
  1028. add_listener("TrackFocusObject", handleTrackFocusObjectChanged);
  1029. // Rendering related settings
  1030. add_listener("DebugShowRenderInfo", handleDebugShowRenderInfoChanged);
  1031. add_listener("DelayGLTextureDelete", handleDelayGLTextureDeleteChanged);
  1032. add_listener("EffectColor", handleEffectColorChanged);
  1033. add_listener("OctreeStaticObjectSizeFactor", handleRepartition);
  1034. add_listener("OctreeDistanceFactor", handleRepartition);
  1035. add_listener("OctreeMaxNodeCapacity", handleRepartition);
  1036. add_listener("OctreeMinimumNodeSize", handleRepartition);
  1037. add_listener("OctreeAlphaDistanceFactor", handleRepartition);
  1038. add_listener("OctreeAttachmentSizeFactor", handleRepartition);
  1039. add_listener("RenderAnimateTrees", handleResetVertexBuffersChanged);
  1040. add_listener("RenderAutoMaskAlphaDeferred",
  1041. handleResetVertexBuffersChanged);
  1042. add_listener("RenderAutoMaskAlphaNonDeferred",
  1043. handleResetVertexBuffersChanged);
  1044. add_listener("RenderAvatarCloth", handleSetShaderChanged);
  1045. add_listener("RenderAvatarLODFactor", handleAvatarDebugSettingsChanged);
  1046. add_listener("RenderAvatarMaxNonImpostors",
  1047. handleAvatarDebugSettingsChanged);
  1048. add_listener("RenderAvatarMaxPuppets", handleAvatarDebugSettingsChanged);
  1049. add_listener("RenderAvatarPhysicsLODFactor",
  1050. handleAvatarDebugSettingsChanged);
  1051. add_listener("RenderCompressTextures",
  1052. handleRenderCompressTexturesChanged);
  1053. add_listener("RenderCompressThreshold",
  1054. handleRenderCompressTexturesChanged);
  1055. add_listener("RenderDeferred", handleRenderDeferredChanged);
  1056. add_listener("RenderDeferredNoise", handleGLBufferChanged);
  1057. add_listener("RenderDeferredSSAO", handleSetShaderChanged);
  1058. add_listener("RenderDepthOfField", handleGLBufferChanged);
  1059. add_listener("RenderDynamicLOD", handleRenderDynamicLODChanged);
  1060. add_listener("RenderFarClip", handleRenderFarClipChanged);
  1061. add_listener("RenderFlexTimeFactor", handleFlexLODChanged);
  1062. #if 0 // This should only taken into account after a restart. HB
  1063. add_listener("RenderFSAASamples", handleGLBufferChanged);
  1064. #endif
  1065. add_listener("RenderDeferredAAQuality", handleGLBufferChanged);
  1066. add_listener("RenderDeferredDisplayGamma", handleSetShaderChanged);
  1067. add_listener("RenderGLImageSyncInThread", handleRenderGLImageSyncInThread);
  1068. add_listener("RenderGlow", handleGLBufferChanged);
  1069. add_listener("RenderGlowResolutionPow", handleGLBufferChanged);
  1070. add_listener("RenderHideGroupTitle", handleHideGroupTitleChanged);
  1071. add_listener("RenderHideGroupTitleAll", handleAvatarDebugSettingsChanged);
  1072. add_listener("RenderMaxPartCount", handleMaxPartCountChanged);
  1073. add_listener("RenderMaxTextureIndex", handleSetShaderChanged);
  1074. add_listener("RenderUseDepthClamp", handleSetShaderChanged);
  1075. add_listener("RenderMaxVBOSize", handleResetVertexBuffersChanged);
  1076. add_listener("RenderName", handleAvatarDebugSettingsChanged);
  1077. add_listener("RenderOptimizeMeshVertexCache",
  1078. handleRenderOptimizeMeshVertexCacheChanged);
  1079. add_listener("RenderReflectionProbes", handleReflectionProbesChanged);
  1080. add_listener("RenderReflectionProbeLevel", handleReflectionProbesChanged);
  1081. add_listener("RenderReflectionProbeResolution",
  1082. handleReflectionProbesChanged);
  1083. add_listener("RenderHeroProbeResLevel", handleReflectionProbesChanged);
  1084. add_listener("RenderHeroProbeDistance", handleReflectionProbesChanged);
  1085. add_listener("RenderHeroProbesMaxCount", handleReflectionProbesChanged);
  1086. add_listener("RenderResolutionDivisor",
  1087. handleRenderResolutionDivisorChanged);
  1088. add_listener("RenderScreenSpaceReflections",
  1089. handlerScreenSpaceReflectionsChanged);
  1090. add_listener("RenderShadowDetail", handleSetShaderChanged);
  1091. add_listener("RenderShadowResolutionScale", handleShadowsResized);
  1092. add_listener("RenderSpecularExponent", handleLUTBufferChanged);
  1093. add_listener("RenderSpecularResX", handleLUTBufferChanged);
  1094. add_listener("RenderSpecularResY", handleLUTBufferChanged);
  1095. add_listener("RenderTerrainLODFactor", handleTerrainLODChanged);
  1096. add_listener("RenderTerrainPBRBlendFactor", handleSetShaderChanged);
  1097. add_listener("RenderTerrainPBRDetail", handleSetShaderChanged);
  1098. add_listener("RenderTerrainPBREnabled", handleSetShaderChanged);
  1099. add_listener("RenderTerrainPBRScale", handleSetShaderChanged);
  1100. add_listener("RenderTerrainPBRTriplanar", handleSetShaderChanged);
  1101. add_listener("RenderTransparentWater", handleSetShaderChanged);
  1102. add_listener("RenderWaterReflectionType",
  1103. handleRenderWaterReflectionTypeChanged);
  1104. add_listener("RenderTreeAnimationDamping", handleTreeSettingsChanged);
  1105. add_listener("RenderTreeTrunkStiffness", handleTreeSettingsChanged);
  1106. add_listener("RenderTreeWindSensitivity", handleTreeSettingsChanged);
  1107. add_listener("RenderTreeLODFactor", handleTreeSettingsChanged);
  1108. add_listener("RenderGLUseVBCache", handleRenderGLUseVBCacheChanged);
  1109. add_listener("RenderUseBasecolorAsDiffuse",
  1110. handleRenderUseBasecolorAsDiffuseChanged);
  1111. add_listener("RenderHDRIEnabled", handleRenderHDRIEnabledChanged);
  1112. add_listener("RenderVolumeLODFactor", handleVolumeSettingsChanged);
  1113. add_listener("SkyUseClassicClouds", handleSkyUseClassicCloudsChanged);
  1114. add_listener("UseOcclusion", handleUseOcclusionChanged);
  1115. add_listener("WLSkyDetail", handleWLSkyDetailChanged);
  1116. // Network related settings
  1117. add_listener("EnableHTTP2", handleEnableHTTP2Changed);
  1118. add_listener("InterpolationTime", handleInterpolationTimesChanged);
  1119. add_listener("InterpolationPhaseOut", handleInterpolationTimesChanged);
  1120. add_listener("RegionCrossingInterpolationTime",
  1121. handleInterpolationTimesChanged);
  1122. add_listener("MeshMaxConcurrentRequests",
  1123. handleMeshMaxConcurrentRequestsChanged);
  1124. add_listener("NoVerifySSLCert", handleNoVerifySSLCertChanged);
  1125. add_listener("PingInterpolate", handlePingInterpolateChanged);
  1126. add_listener("SearchURL", handleSearchURLChanged);
  1127. add_listener("ThrottleBandwidthKbps", handleBandwidthChanged);
  1128. add_listener("ThrottleBandwidthKbpsOS", handleBandwidthChanged);
  1129. add_listener("VelocityInterpolate", handleVelocityInterpolateChanged);
  1130. // Obects cache related settings
  1131. add_listener("BiasedObjectRetention", handleVOCacheSettingChanged);
  1132. add_listener("NonVisibleObjectsInMemoryTime", handleVOCacheSettingChanged);
  1133. add_listener("SceneLoadMinRadius", handleVOCacheSettingChanged);
  1134. add_listener("SceneLoadFrontPixelThreshold", handleVOCacheSettingChanged);
  1135. add_listener("SceneLoadRearPixelThreshold", handleVOCacheSettingChanged);
  1136. add_listener("SceneLoadRearMaxRadiusFraction",
  1137. handleVOCacheSettingChanged);
  1138. add_listener("Use360InterestList", handleUse360InterestListSettingChanged);
  1139. // Audio and media related settings
  1140. add_listener("AudioLevelMaster", handleAudioVolumeChanged);
  1141. add_listener("AudioLevelSFX", handleAudioVolumeChanged);
  1142. add_listener("AudioLevelUI", handleAudioVolumeChanged);
  1143. add_listener("AudioLevelAmbient", handleAudioVolumeChanged);
  1144. add_listener("AudioLevelMic", handleVoiceClientPrefsChanged);
  1145. add_listener("AudioLevelMusic", handleAudioVolumeChanged);
  1146. add_listener("AudioLevelMedia", handleAudioVolumeChanged);
  1147. add_listener("AudioLevelVoice", handleAudioVolumeChanged);
  1148. add_listener("AudioLevelDoppler", handleAudioVolumeChanged);
  1149. add_listener("AudioLevelRolloff", handleAudioVolumeChanged);
  1150. add_listener("AudioLevelUnderwaterRolloff", handleAudioVolumeChanged);
  1151. add_listener("AudioLevelWind", handleAudioVolumeChanged);
  1152. add_listener("DisableWindAudio", handleAudioVolumeChanged);
  1153. add_listener("EnableStreamingMusic", handleAudioStreamMusicChanged);
  1154. add_listener("EnableStreamingMedia", handlePrimMediaChanged);
  1155. add_listener("PrimMediaMasterEnabled", handlePrimMediaChanged);
  1156. add_listener("MuteAudio", handleAudioVolumeChanged);
  1157. add_listener("MuteMusic", handleAudioVolumeChanged);
  1158. add_listener("MuteMedia", handleAudioVolumeChanged);
  1159. add_listener("MuteVoice", handleAudioVolumeChanged);
  1160. add_listener("MuteAmbient", handleAudioVolumeChanged);
  1161. add_listener("MuteUI", handleAudioVolumeChanged);
  1162. // Voice related settings
  1163. add_listener("EnableVoiceChat", handleVoiceClientPrefsChanged);
  1164. add_listener("LipSyncEnabled", handleLipSyncEnabledChanged);
  1165. add_listener("PTTCurrentlyEnabled", handleVoiceClientPrefsChanged);
  1166. add_listener("PushToTalkButton", handleVoiceClientPrefsChanged);
  1167. add_listener("PushToTalkToggle", handleVoiceClientPrefsChanged);
  1168. add_listener("VoiceEarLocation", handleVoiceClientPrefsChanged);
  1169. add_listener("VoiceInputAudioDevice", handleVoiceClientPrefsChanged);
  1170. add_listener("VoiceOutputAudioDevice", handleVoiceClientPrefsChanged);
  1171. add_listener("VoiceServerType", handleVoiceServerTypeChanged);
  1172. add_listener("VoiceWebRTCInputAudioDevice", handleVoiceClientPrefsChanged);
  1173. add_listener("VoiceWebRTCOutputAudioDevice",
  1174. handleVoiceClientPrefsChanged);
  1175. // Memory related settings
  1176. add_listener("MaxBoundTexMem", handleVideoMemoryChanged);
  1177. add_listener("TextureMemory", handleVideoMemoryChanged);
  1178. add_listener("TexMemMultiplier", handleVideoMemoryChanged);
  1179. add_listener("VRAMOverride", handleVideoMemoryChanged);
  1180. // Spell checking related settings
  1181. add_listener("SpellCheck", handleSpellCheckChanged);
  1182. add_listener("SpellCheckShow", handleSpellCheckChanged);
  1183. add_listener("SpellCheckLanguage", handleSpellCheckChanged);
  1184. // Environment related settings
  1185. add_listener("LightshareEnabled", handleLightshareEnabledChanged);
  1186. add_listener("UseLocalEnvironment", handleUseLocalEnvironmentChanged);
  1187. add_listener("UseParcelEnvironment", handleUseParcelEnvironmentChanged);
  1188. add_listener("UseWLEstateTime", handleUseWLEstateTimeChanged);
  1189. // Privacy related settings
  1190. add_listener("PrivateLookAt", handlePrivateLookAtChanged);
  1191. add_listener("PrivateLookAtLimit", handlePrivateLookAtChanged);
  1192. // Miscellaneous settings
  1193. add_listener("AutoReloadFailedPatchTexDelay",
  1194. handleAutoReloadFailedPatchTexDelayChanged);
  1195. add_listener("DebugPermissions", handleDebugPermissionsChanged);
  1196. #if LL_FAST_TIMERS_ENABLED
  1197. add_listener("FastTimersAlwaysEnabled",
  1198. handleFastTimersAlwaysEnabledChanged);
  1199. #endif
  1200. add_listener("FSFlushOnWrite", handleFSFlushOnWriteChanged);
  1201. add_listener("HighResSnapshot", handleHighResSnapshotChanged);
  1202. add_listener("TextureFetchBoostWithFetches",
  1203. handleTextureFetchBoostWithFetchesChanged);
  1204. add_listener("TextureFetchBoostWithSpeed",
  1205. handleTextureFetchBoostWithSpeedChanged);
  1206. add_listener("FullResBoostedTextures",
  1207. handleFullResBoostedTexturesChanged);
  1208. //MK
  1209. add_listener("RestrainedLoveRelaxedTempAttach",
  1210. handleRestrainedLoveRelaxedTempAttachChanged);
  1211. add_listener("RestrainedLoveAutomaticRenameItems",
  1212. handleRestrainedLoveAutomaticRenameItemsChanged);
  1213. //mk
  1214. add_listener("PreciseLogTimestamps", handlePreciseLogTimestampsChanged);
  1215. add_listener("UserLogFile", handleUserLogFileChanged);
  1216. add_listener("UseAISForFetching", handleUseAISForFetchingChanged);
  1217. }