summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/CMakeLists.txt47
-rw-r--r--indra/newview/VIEWER_VERSION.txt2
-rw-r--r--indra/newview/app_settings/cmd_line.xml28
-rw-r--r--indra/newview/app_settings/settings.xml676
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/materialF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl2
-rw-r--r--indra/newview/featuretable_mac.txt14
-rw-r--r--indra/newview/gltfscenemanager.cpp59
-rw-r--r--indra/newview/groupchatlistener.cpp97
-rw-r--r--indra/newview/groupchatlistener.h23
-rwxr-xr-xindra/newview/linux_tools/wrapper.sh46
-rw-r--r--indra/newview/llagentcamera.cpp10
-rw-r--r--indra/newview/llagentlistener.cpp280
-rw-r--r--indra/newview/llagentlistener.h15
-rw-r--r--indra/newview/llaisapi.cpp2
-rw-r--r--indra/newview/llappearancelistener.cpp146
-rw-r--r--indra/newview/llappearancelistener.h (renamed from indra/newview/llappviewerlinux_api_dbus.h)34
-rw-r--r--indra/newview/llappearancemgr.cpp76
-rw-r--r--indra/newview/llappearancemgr.h8
-rw-r--r--indra/newview/llappviewer.cpp141
-rw-r--r--indra/newview/llappviewer.h6
-rw-r--r--indra/newview/llappviewerlinux.cpp344
-rw-r--r--indra/newview/llappviewerlinux.h28
-rw-r--r--indra/newview/llappviewerlinux_api.h143
-rw-r--r--indra/newview/llappviewerlinux_api.xml14
-rw-r--r--indra/newview/llappviewerlinux_api_dbus.cpp126
-rw-r--r--indra/newview/llappviewerlinux_api_dbus_syms_raw.inc9
-rw-r--r--indra/newview/llappviewerlistener.cpp20
-rw-r--r--indra/newview/llappviewerlistener.h5
-rw-r--r--indra/newview/llappviewerwin32.cpp36
-rw-r--r--indra/newview/llblocklist.cpp2
-rw-r--r--indra/newview/llbox.cpp25
-rw-r--r--indra/newview/llcallbacklist.cpp305
-rw-r--r--indra/newview/llchathistory.cpp44
-rw-r--r--indra/newview/llchathistory.h3
-rw-r--r--indra/newview/llchatitemscontainerctrl.cpp5
-rw-r--r--indra/newview/llchatitemscontainerctrl.h6
-rw-r--r--indra/newview/llchatmsgbox.cpp10
-rw-r--r--indra/newview/llchiclet.cpp12
-rw-r--r--indra/newview/llcofwearables.cpp10
-rw-r--r--indra/newview/llconversationloglist.cpp5
-rw-r--r--indra/newview/llconversationview.cpp2
-rw-r--r--indra/newview/lldirpicker.cpp49
-rw-r--r--indra/newview/lldirpicker.h2
-rw-r--r--indra/newview/lldonotdisturbnotificationstorage.h2
-rw-r--r--indra/newview/lldynamictexture.cpp4
-rw-r--r--indra/newview/llexpandabletextbox.cpp24
-rw-r--r--indra/newview/llface.cpp15
-rw-r--r--indra/newview/llfavoritesbar.cpp2
-rw-r--r--indra/newview/llfeaturemanager.cpp44
-rw-r--r--indra/newview/llfilepicker.cpp5
-rw-r--r--indra/newview/llfilepicker.h32
-rw-r--r--indra/newview/llfloaterauction.cpp8
-rw-r--r--indra/newview/llfloateravatarpicker.cpp2
-rw-r--r--indra/newview/llfloateravatarrendersettings.cpp4
-rw-r--r--indra/newview/llfloaterbeacons.cpp2
-rw-r--r--indra/newview/llfloaterbulkpermission.cpp12
-rw-r--r--indra/newview/llfloaterbump.cpp18
-rw-r--r--indra/newview/llfloaterbuyland.cpp25
-rw-r--r--indra/newview/llfloaterbuyland.h2
-rw-r--r--indra/newview/llfloaterbvhpreview.cpp7
-rw-r--r--indra/newview/llfloatercamera.cpp16
-rw-r--r--indra/newview/llfloatercamerapresets.cpp4
-rw-r--r--indra/newview/llfloaterconversationlog.cpp2
-rw-r--r--indra/newview/llfloatercreatelandmark.cpp14
-rw-r--r--indra/newview/llfloatercreatelandmark.h3
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp4
-rw-r--r--indra/newview/llfloateremojipicker.cpp60
-rw-r--r--indra/newview/llfloateremojipicker.h1
-rw-r--r--indra/newview/llfloatergesture.cpp10
-rw-r--r--indra/newview/llfloatergltfasseteditor.cpp12
-rw-r--r--indra/newview/llfloatergodtools.cpp41
-rw-r--r--indra/newview/llfloaterimagepreview.cpp14
-rw-r--r--indra/newview/llfloaterimcontainer.cpp6
-rw-r--r--indra/newview/llfloaterimnearbychat.cpp5
-rw-r--r--indra/newview/llfloaterimnearbychathandler.cpp13
-rw-r--r--indra/newview/llfloaterimnearbychatlistener.cpp35
-rw-r--r--indra/newview/llfloaterimnearbychatlistener.h6
-rw-r--r--indra/newview/llfloaterimsession.cpp2
-rw-r--r--indra/newview/llfloaterimsessiontab.cpp6
-rw-r--r--indra/newview/llfloaterinspect.cpp6
-rw-r--r--indra/newview/llfloaterlagmeter.cpp2
-rw-r--r--indra/newview/llfloaterland.cpp10
-rw-r--r--indra/newview/llfloaterland.h2
-rw-r--r--indra/newview/llfloaterlinkreplace.cpp8
-rw-r--r--indra/newview/llfloaterlinkreplace.h6
-rw-r--r--indra/newview/llfloaterluadebug.cpp168
-rw-r--r--indra/newview/llfloaterluadebug.h72
-rw-r--r--indra/newview/llfloaterluascripts.cpp131
-rw-r--r--indra/newview/llfloaterluascripts.h54
-rw-r--r--indra/newview/llfloatermarketplacelistings.cpp2
-rw-r--r--indra/newview/llfloatermemleak.cpp12
-rw-r--r--indra/newview/llfloatermodelpreview.cpp15
-rw-r--r--indra/newview/llfloatermyenvironment.cpp8
-rw-r--r--indra/newview/llfloaternotificationsconsole.cpp2
-rw-r--r--indra/newview/llfloateropenobject.cpp4
-rw-r--r--indra/newview/llfloaterperformance.cpp14
-rw-r--r--indra/newview/llfloaterperformance.h2
-rw-r--r--indra/newview/llfloaterperms.cpp6
-rw-r--r--indra/newview/llfloaterpostprocess.cpp229
-rw-r--r--indra/newview/llfloaterpostprocess.h72
-rw-r--r--indra/newview/llfloaterpreference.cpp142
-rw-r--r--indra/newview/llfloaterpreference.h4
-rw-r--r--indra/newview/llfloaterpreferencesgraphicsadvanced.cpp12
-rw-r--r--indra/newview/llfloaterpreferencesgraphicsadvanced.h1
-rw-r--r--indra/newview/llfloaterpreferenceviewadvanced.cpp2
-rw-r--r--indra/newview/llfloaterregioninfo.cpp15
-rw-r--r--indra/newview/llfloaterregioninfo.h1
-rw-r--r--indra/newview/llfloaterregionrestarting.h8
-rw-r--r--indra/newview/llfloaterscriptedprefs.cpp4
-rw-r--r--indra/newview/llfloatersettingscolor.cpp4
-rw-r--r--indra/newview/llfloatersettingsdebug.cpp29
-rw-r--r--indra/newview/llfloatersettingsdebug.h3
-rw-r--r--indra/newview/llfloatersnapshot.cpp3
-rw-r--r--indra/newview/llfloatertestinspectors.cpp4
-rw-r--r--indra/newview/llfloatertools.cpp30
-rw-r--r--indra/newview/llfloatertopobjects.cpp20
-rw-r--r--indra/newview/llfloatertoybox.cpp4
-rw-r--r--indra/newview/llfloateruipreview.cpp2
-rw-r--r--indra/newview/llfloatervoiceeffect.cpp6
-rw-r--r--indra/newview/llfloaterwebcontent.cpp14
-rwxr-xr-xindra/newview/llfloaterworldmap.cpp22
-rw-r--r--indra/newview/llflyoutcombobtn.cpp2
-rw-r--r--indra/newview/llglsandbox.cpp165
-rw-r--r--indra/newview/llgroupactions.cpp8
-rw-r--r--indra/newview/llgrouplist.cpp2
-rw-r--r--indra/newview/llhttpretrypolicy.cpp5
-rw-r--r--indra/newview/llhudeffectblob.cpp11
-rw-r--r--indra/newview/llhudicon.cpp7
-rw-r--r--indra/newview/llhudnametag.cpp14
-rw-r--r--indra/newview/llhudrender.cpp1
-rw-r--r--indra/newview/llimprocessing.cpp2
-rw-r--r--indra/newview/llimview.cpp2
-rw-r--r--indra/newview/llimview.h2
-rw-r--r--indra/newview/llinspectgroup.cpp6
-rw-r--r--indra/newview/llinspectobject.cpp16
-rw-r--r--indra/newview/llinventorybridge.cpp22
-rw-r--r--indra/newview/llinventorybridge.h5
-rw-r--r--indra/newview/llinventoryfilter.cpp6
-rw-r--r--indra/newview/llinventoryfilter.h2
-rw-r--r--indra/newview/llinventoryfunctions.cpp13
-rw-r--r--indra/newview/llinventoryfunctions.h18
-rw-r--r--indra/newview/llinventorygallerymenu.cpp17
-rw-r--r--indra/newview/llinventorylistener.cpp392
-rw-r--r--indra/newview/llinventorylistener.h53
-rw-r--r--indra/newview/llinventorymodel.cpp22
-rw-r--r--indra/newview/llinventorymodelbackgroundfetch.cpp17
-rw-r--r--indra/newview/llinventorypanel.cpp26
-rw-r--r--indra/newview/lljoystickbutton.cpp28
-rw-r--r--indra/newview/lllocalbitmaps.cpp9
-rw-r--r--indra/newview/lllocalbitmaps.h3
-rw-r--r--indra/newview/lllocalgltfmaterials.cpp9
-rw-r--r--indra/newview/lllocalgltfmaterials.h3
-rw-r--r--indra/newview/lllocationinputctrl.cpp2
-rw-r--r--indra/newview/llluamanager.cpp483
-rw-r--r--indra/newview/llluamanager.h133
-rw-r--r--indra/newview/llmanip.cpp3
-rw-r--r--indra/newview/llmanipscale.cpp35
-rw-r--r--indra/newview/llmediactrl.cpp18
-rw-r--r--indra/newview/llmediadataclient.h4
-rw-r--r--indra/newview/llmeshrepository.cpp57
-rw-r--r--indra/newview/llmeshrepository.h4
-rw-r--r--indra/newview/llmodelpreview.cpp150
-rw-r--r--indra/newview/llnetmap.cpp20
-rw-r--r--indra/newview/lloutfitgallery.cpp6
-rw-r--r--indra/newview/lloutfitslist.cpp12
-rw-r--r--indra/newview/llpanelblockedlist.cpp2
-rw-r--r--indra/newview/llpaneleditwearable.cpp4
-rw-r--r--indra/newview/llpanelemojicomplete.cpp6
-rw-r--r--indra/newview/llpanelface.cpp3
-rw-r--r--indra/newview/llpanelface.h5
-rw-r--r--indra/newview/llpanelgroupbulk.cpp32
-rw-r--r--indra/newview/llpanelgroupbulkban.cpp33
-rw-r--r--indra/newview/llpanelgroupbulkimpl.h3
-rw-r--r--indra/newview/llpanellandmarks.cpp8
-rw-r--r--indra/newview/llpanellogin.cpp57
-rw-r--r--indra/newview/llpanellogin.h2
-rw-r--r--indra/newview/llpanelloginlistener.cpp196
-rw-r--r--indra/newview/llpanelloginlistener.h2
-rw-r--r--indra/newview/llpanelmaininventory.cpp268
-rw-r--r--indra/newview/llpanelmediasettingssecurity.cpp4
-rw-r--r--indra/newview/llpanelnearbymedia.cpp26
-rw-r--r--indra/newview/llpanelobject.cpp2
-rw-r--r--indra/newview/llpanelobjectinventory.cpp18
-rw-r--r--indra/newview/llpaneloutfitedit.cpp4
-rw-r--r--indra/newview/llpanelpeople.cpp47
-rw-r--r--indra/newview/llpanelpeoplemenus.cpp22
-rw-r--r--indra/newview/llpanelplaceprofile.cpp5
-rw-r--r--indra/newview/llpanelplaceprofile.h2
-rw-r--r--indra/newview/llpanelplaces.cpp2
-rw-r--r--indra/newview/llpanelpresetscamerapulldown.cpp4
-rw-r--r--indra/newview/llpanelpresetspulldown.cpp6
-rw-r--r--indra/newview/llpanelprimmediacontrols.cpp44
-rw-r--r--indra/newview/llpanelprofile.cpp2
-rw-r--r--indra/newview/llpanelprofilepicks.cpp42
-rw-r--r--indra/newview/llpanelprofilepicks.h10
-rw-r--r--indra/newview/llpanelsnapshot.cpp12
-rw-r--r--indra/newview/llpanelsnapshotinventory.cpp132
-rw-r--r--indra/newview/llpanelsnapshotlocal.cpp22
-rw-r--r--indra/newview/llpanelsnapshotoptions.cpp45
-rw-r--r--indra/newview/llpanelsnapshotpostcard.cpp24
-rw-r--r--indra/newview/llpanelsnapshotprofile.cpp22
-rw-r--r--indra/newview/llpanelteleporthistory.cpp9
-rw-r--r--indra/newview/llpaneltopinfobar.cpp2
-rw-r--r--indra/newview/llpanelvoiceeffect.cpp2
-rw-r--r--indra/newview/llpanelvolume.cpp2
-rw-r--r--indra/newview/llpanelvolumepulldown.cpp8
-rw-r--r--indra/newview/llpanelwearing.cpp6
-rw-r--r--indra/newview/llphysicsshapebuilderutil.cpp53
-rw-r--r--indra/newview/llphysicsshapebuilderutil.h2
-rw-r--r--indra/newview/llpreviewanim.cpp2
-rw-r--r--indra/newview/llpreviewscript.cpp2
-rw-r--r--indra/newview/llsaveoutfitcombobtn.cpp2
-rw-r--r--indra/newview/llsecapi.h2
-rw-r--r--indra/newview/llsetkeybinddialog.cpp6
-rw-r--r--indra/newview/llsnapshotlivepreview.cpp64
-rw-r--r--indra/newview/llspeakers.h4
-rw-r--r--indra/newview/llstartup.cpp7
-rw-r--r--indra/newview/lltoast.cpp30
-rw-r--r--indra/newview/lltoast.h6
-rw-r--r--indra/newview/lltoastalertpanel.h10
-rw-r--r--indra/newview/lltoastimpanel.cpp5
-rw-r--r--indra/newview/lltoolmgr.cpp4
-rw-r--r--indra/newview/lltoolmorph.cpp7
-rw-r--r--indra/newview/lltoolplacer.cpp8
-rw-r--r--indra/newview/lltoolplacer.h4
-rw-r--r--indra/newview/lltoolselect.cpp9
-rw-r--r--indra/newview/lluilistener.cpp368
-rw-r--r--indra/newview/lluilistener.h23
-rw-r--r--indra/newview/llurldispatcher.cpp9
-rw-r--r--indra/newview/llviewerchat.cpp9
-rw-r--r--indra/newview/llviewercontrollistener.cpp7
-rw-r--r--indra/newview/llviewerdisplay.cpp210
-rw-r--r--indra/newview/llviewerdisplay.h2
-rw-r--r--indra/newview/llviewerfloaterreg.cpp7
-rw-r--r--indra/newview/llviewerinventory.cpp3
-rw-r--r--indra/newview/llviewerjointattachment.cpp8
-rw-r--r--indra/newview/llviewerjointmesh.cpp14
-rw-r--r--indra/newview/llviewermedia.cpp29
-rw-r--r--indra/newview/llviewermenu.cpp352
-rw-r--r--indra/newview/llviewermenu.h1
-rw-r--r--indra/newview/llviewermenufile.cpp18
-rw-r--r--indra/newview/llviewermenufile.h2
-rw-r--r--indra/newview/llviewermessage.cpp64
-rw-r--r--indra/newview/llviewerobject.cpp169
-rw-r--r--indra/newview/llviewerobject.h2
-rw-r--r--indra/newview/llviewerobjectlist.cpp5
-rw-r--r--indra/newview/llviewerparcelmediaautoplay.h2
-rwxr-xr-xindra/newview/llviewerparceloverlay.cpp298
-rw-r--r--indra/newview/llviewerparceloverlay.h18
-rwxr-xr-xindra/newview/llviewerregion.cpp1
-rw-r--r--indra/newview/llviewerstats.cpp7
-rw-r--r--indra/newview/llviewerstatsrecorder.cpp2
-rw-r--r--indra/newview/llviewertexteditor.cpp10
-rw-r--r--indra/newview/llviewertexturelist.cpp2
-rw-r--r--indra/newview/llviewerwindow.cpp36
-rw-r--r--indra/newview/llviewerwindowlistener.cpp54
-rw-r--r--indra/newview/llvoavatar.cpp82
-rw-r--r--indra/newview/llvoavatar.h2
-rw-r--r--indra/newview/llvograss.cpp1
-rw-r--r--indra/newview/llvoicevivox.cpp1
-rw-r--r--indra/newview/llvoicewebrtc.cpp12
-rw-r--r--indra/newview/llvopartgroup.cpp58
-rw-r--r--indra/newview/llvosurfacepatch.cpp1
-rw-r--r--indra/newview/llvovolume.cpp29
-rw-r--r--indra/newview/llvovolume.h1
-rw-r--r--indra/newview/llwatchdog.cpp34
-rw-r--r--indra/newview/llwatchdog.h12
-rw-r--r--indra/newview/llwearableitemslist.cpp13
-rw-r--r--indra/newview/llwearableitemslist.h8
-rw-r--r--indra/newview/llwindowlistener.cpp2
-rwxr-xr-xindra/newview/llworldmapview.cpp25
-rw-r--r--indra/newview/pipeline.cpp44
-rw-r--r--indra/newview/scripts/lua/frame_profile.lua24
-rw-r--r--indra/newview/scripts/lua/frame_profile_quit.lua34
-rw-r--r--indra/newview/scripts/lua/luafloater_camera_control.xml244
-rw-r--r--indra/newview/scripts/lua/luafloater_demo.xml93
-rw-r--r--indra/newview/scripts/lua/luafloater_gesture_list.xml21
-rw-r--r--indra/newview/scripts/lua/luafloater_outfits_list.xml51
-rw-r--r--indra/newview/scripts/lua/luafloater_speedometer.xml35
-rw-r--r--indra/newview/scripts/lua/qtest.lua146
-rw-r--r--indra/newview/scripts/lua/require/ErrorQueue.lua37
-rw-r--r--indra/newview/scripts/lua/require/LLAgent.lua143
-rw-r--r--indra/newview/scripts/lua/require/LLAppearance.lua31
-rw-r--r--indra/newview/scripts/lua/require/LLChat.lua39
-rw-r--r--indra/newview/scripts/lua/require/LLDebugSettings.lua17
-rw-r--r--indra/newview/scripts/lua/require/LLFloaterAbout.lua11
-rw-r--r--indra/newview/scripts/lua/require/LLGesture.lua23
-rw-r--r--indra/newview/scripts/lua/require/LLInventory.lua67
-rw-r--r--indra/newview/scripts/lua/require/LLListener.lua50
-rw-r--r--indra/newview/scripts/lua/require/Queue.lua51
-rw-r--r--indra/newview/scripts/lua/require/Region.lua17
-rw-r--r--indra/newview/scripts/lua/require/UI.lua243
-rw-r--r--indra/newview/scripts/lua/require/UI/Floater.lua146
-rw-r--r--indra/newview/scripts/lua/require/UI/popup.lua82
-rw-r--r--indra/newview/scripts/lua/require/WaitQueue.lua88
-rw-r--r--indra/newview/scripts/lua/require/coro.lua67
-rw-r--r--indra/newview/scripts/lua/require/fiber.lua346
-rw-r--r--indra/newview/scripts/lua/require/inspect.lua371
-rw-r--r--indra/newview/scripts/lua/require/leap.lua550
-rw-r--r--indra/newview/scripts/lua/require/login.lua42
-rw-r--r--indra/newview/scripts/lua/require/logout.lua7
-rw-r--r--indra/newview/scripts/lua/require/mapargs.lua73
-rw-r--r--indra/newview/scripts/lua/require/printf.lua19
-rw-r--r--indra/newview/scripts/lua/require/result_view.lua98
-rw-r--r--indra/newview/scripts/lua/require/startup.lua100
-rw-r--r--indra/newview/scripts/lua/require/timers.lua122
-rw-r--r--indra/newview/scripts/lua/require/util.lua114
-rw-r--r--indra/newview/scripts/lua/test_LLAppearance.lua114
-rw-r--r--indra/newview/scripts/lua/test_LLChat.lua18
-rw-r--r--indra/newview/scripts/lua/test_LLChatListener.lua39
-rw-r--r--indra/newview/scripts/lua/test_LLFloaterAbout.lua6
-rw-r--r--indra/newview/scripts/lua/test_LLGesture.lua26
-rw-r--r--indra/newview/scripts/lua/test_LLInventory.lua24
-rw-r--r--indra/newview/scripts/lua/test_animation.lua32
-rw-r--r--indra/newview/scripts/lua/test_atexit.lua3
-rw-r--r--indra/newview/scripts/lua/test_autopilot.lua22
-rw-r--r--indra/newview/scripts/lua/test_callables.lua6
-rw-r--r--indra/newview/scripts/lua/test_camera_control.lua49
-rw-r--r--indra/newview/scripts/lua/test_flycam.lua38
-rw-r--r--indra/newview/scripts/lua/test_group_chat.lua14
-rw-r--r--indra/newview/scripts/lua/test_inv_resultset.lua18
-rw-r--r--indra/newview/scripts/lua/test_login.lua10
-rw-r--r--indra/newview/scripts/lua/test_logout.lua3
-rw-r--r--indra/newview/scripts/lua/test_luafloater_demo.lua39
-rw-r--r--indra/newview/scripts/lua/test_luafloater_gesture_list.lua27
-rw-r--r--indra/newview/scripts/lua/test_luafloater_speedometer.lua31
-rw-r--r--indra/newview/scripts/lua/test_mapargs.lua68
-rw-r--r--indra/newview/scripts/lua/test_popup.lua10
-rw-r--r--indra/newview/scripts/lua/test_result_view.lua55
-rw-r--r--indra/newview/scripts/lua/test_setdtor.lua91
-rw-r--r--indra/newview/scripts/lua/test_snapshot.lua15
-rw-r--r--indra/newview/scripts/lua/test_timers.lua63
-rw-r--r--indra/newview/scripts/lua/test_toolbars.lua26
-rw-r--r--indra/newview/scripts/lua/test_top_menu.lua52
-rw-r--r--indra/newview/scripts/lua/testmod.lua2
-rw-r--r--indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/de/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/de/strings.xml1
-rw-r--r--indra/newview/skins/default/xui/en/floater_emoji_picker.xml1
-rw-r--r--indra/newview/skins/default/xui/en/floater_fast_timers.xml2
-rw-r--r--indra/newview/skins/default/xui/en/floater_gltf_asset_editor.xml8
-rw-r--r--indra/newview/skins/default/xui/en/floater_lua_debug.xml108
-rw-r--r--indra/newview/skins/default/xui/en/floater_lua_scripts.xml36
-rw-r--r--indra/newview/skins/default/xui/en/floater_post_process.xml426
-rw-r--r--indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml53
-rw-r--r--indra/newview/skins/default/xui/en/floater_settings_debug.xml31
-rw-r--r--indra/newview/skins/default/xui/en/floater_world_map.xml3
-rw-r--r--indra/newview/skins/default/xui/en/menu_lua_scripts.xml19
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml78
-rw-r--r--indra/newview/skins/default/xui/en/mime_types_linux.xml70
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_group_roles.xml1179
-rw-r--r--indra/newview/skins/default/xui/en/panel_login_first.xml1
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml40
-rw-r--r--indra/newview/skins/default/xui/en/panel_profile_pick.xml20
-rw-r--r--indra/newview/skins/default/xui/en/panel_region_environment.xml9
-rw-r--r--indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml4
-rw-r--r--indra/newview/skins/default/xui/en/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml8
-rw-r--r--indra/newview/skins/default/xui/es/panel_snapshot_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/es/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/es/strings.xml1
-rw-r--r--indra/newview/skins/default/xui/fr/panel_snapshot_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/fr/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/fr/strings.xml1
-rw-r--r--indra/newview/skins/default/xui/it/panel_snapshot_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/it/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/it/strings.xml1
-rw-r--r--indra/newview/skins/default/xui/ja/panel_snapshot_inventory.xml4
-rw-r--r--indra/newview/skins/default/xui/ja/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/pl/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/pl/strings.xml1
-rw-r--r--indra/newview/skins/default/xui/pt/panel_snapshot_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/pt/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/pt/strings.xml1
-rw-r--r--indra/newview/skins/default/xui/ru/panel_snapshot_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/ru/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/ru/strings.xml1
-rw-r--r--indra/newview/skins/default/xui/tr/panel_snapshot_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/tr/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/tr/strings.xml1
-rw-r--r--indra/newview/skins/default/xui/zh/panel_snapshot_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/zh/panel_snapshot_options.xml2
-rw-r--r--indra/newview/tests/cppfeatures_test.cpp2
-rw-r--r--indra/newview/tests/llluamanager_test.cpp523
-rwxr-xr-xindra/newview/viewer_manifest.py227
391 files changed, 12256 insertions, 4941 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index ec27b3d415..421c3fbed4 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -46,6 +46,7 @@ include(VisualLeakDetector)
include(VulkanGltf)
include(ZLIBNG)
include(LLPrimitive)
+include(Lualibs)
if (NOT HAVOK_TPV)
# When using HAVOK_TPV, the library is precompiled, so no need for this
@@ -92,6 +93,7 @@ set(viewer_SOURCE_FILES
llagentwearables.cpp
llanimstatelabels.cpp
llappcorehttp.cpp
+ llappearancelistener.cpp
llappearancemgr.cpp
llappviewer.cpp
llappviewerlistener.cpp
@@ -245,6 +247,8 @@ set(viewer_SOURCE_FILES
llfloaterlandholdings.cpp
llfloaterlinkreplace.cpp
llfloaterloadprefpreset.cpp
+ llfloaterluadebug.cpp
+ llfloaterluascripts.cpp
llfloatermarketplacelistings.cpp
llfloatermap.cpp
llfloatermediasettings.cpp
@@ -267,7 +271,6 @@ set(viewer_SOURCE_FILES
llfloaterpay.cpp
llfloaterperformance.cpp
llfloaterperms.cpp
- llfloaterpostprocess.cpp
llfloaterprofile.cpp
llfloaterpreference.cpp
llfloaterpreferencesgraphicsadvanced.cpp
@@ -359,6 +362,7 @@ set(viewer_SOURCE_FILES
llinventorygallerymenu.cpp
llinventoryicon.cpp
llinventoryitemslist.cpp
+ llinventorylistener.cpp
llinventorylistitem.cpp
llinventorymodel.cpp
llinventorymodelbackgroundfetch.cpp
@@ -378,6 +382,7 @@ set(viewer_SOURCE_FILES
lllogchat.cpp
llloginhandler.cpp
lllogininstance.cpp
+ llluamanager.cpp
llmachineid.cpp
llmanip.cpp
llmaniprotate.cpp
@@ -764,6 +769,7 @@ set(viewer_HEADER_FILES
llanimstatelabels.h
llappcorehttp.h
llappearance.h
+ llappearancelistener.h
llappearancemgr.h
llappviewer.h
llappviewerlistener.h
@@ -920,6 +926,8 @@ set(viewer_HEADER_FILES
llfloaterlandholdings.h
llfloaterlinkreplace.h
llfloaterloadprefpreset.h
+ llfloaterluadebug.h
+ llfloaterluascripts.h
llfloatermap.h
llfloatermarketplacelistings.h
llfloatermediasettings.h
@@ -942,7 +950,6 @@ set(viewer_HEADER_FILES
llfloaterpay.h
llfloaterperformance.h
llfloaterperms.h
- llfloaterpostprocess.h
llfloaterprofile.h
llfloaterpreference.h
llfloaterpreferencesgraphicsadvanced.h
@@ -1032,6 +1039,7 @@ set(viewer_HEADER_FILES
llinventorygallerymenu.h
llinventoryicon.h
llinventoryitemslist.h
+ llinventorylistener.h
llinventorylistitem.h
llinventorymodel.h
llinventorymodelbackgroundfetch.h
@@ -1051,6 +1059,7 @@ set(viewer_HEADER_FILES
lllogchat.h
llloginhandler.h
lllogininstance.h
+ llluamanager.h
llmachineid.h
llmanip.h
llmaniprotate.h
@@ -1465,7 +1474,6 @@ if (LINUX)
PROPERTIES
COMPILE_DEFINITIONS "${VIEWER_CHANNEL_VERSION_DEFINES}"
)
- LIST(APPEND viewer_SOURCE_FILES llappviewerlinux_api_dbus.cpp)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")
endif (LINUX)
@@ -1627,6 +1635,13 @@ set_source_files_properties(${viewer_SHADER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
list(APPEND viewer_SOURCE_FILES ${viewer_SHADER_FILES})
+# Add lua script sources
+file(GLOB_RECURSE viewer_LUA_SCRIPT_FILES LIST_DIRECTORIES FALSE
+ ${CMAKE_CURRENT_SOURCE_DIR}/scripts/lua/*.lua)
+source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/scripts/lua PREFIX "LUA Scripts" FILES ${viewer_LUA_SCRIPT_FILES})
+set_source_files_properties(${viewer_LUA_SCRIPT_FILES}
+ PROPERTIES HEADER_FILE_ONLY TRUE)
+list(APPEND viewer_SOURCE_FILES ${viewer_LUA_SCRIPT_FILES})
set(viewer_APPSETTINGS_FILES
app_settings/anim.ini
@@ -1827,20 +1842,6 @@ if (WINDOWS)
if (PACKAGE)
add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.xz
- COMMAND ${PYTHON_EXECUTABLE}
- ARGS
- ${CMAKE_CURRENT_SOURCE_DIR}/event_host_manifest.py
- ${CMAKE_CURRENT_SOURCE_DIR}/..
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CFG_INTDIR}
- DEPENDS
- lleventhost
- ${EVENT_HOST_SCRIPTS}
- ${CMAKE_CURRENT_SOURCE_DIR}/event_host_manifest.py
- )
-
- add_custom_command(
OUTPUT ${CMAKE_CFG_INTDIR}/touched.bat
COMMAND ${PYTHON_EXECUTABLE}
ARGS
@@ -1869,9 +1870,6 @@ if (WINDOWS)
add_custom_target(llpackage ALL DEPENDS
${CMAKE_CFG_INTDIR}/touched.bat
)
- # temporarily disable packaging of event_host until hg subrepos get
- # sorted out on the parabuild cluster...
- #${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.xz)
endif (PACKAGE)
elseif (DARWIN)
@@ -1933,12 +1931,13 @@ target_link_libraries(${VIEWER_BINARY_NAME}
llcommon
llmeshoptimizer
llwebrtc
- ll::ndof
lllogin
llprimitive
llappearance
${LLPHYSICSEXTENSIONS_LIBRARIES}
ll::bugsplat
+ ll::lualibs
+ ll::ndof
ll::tracy
ll::openxr
)
@@ -2315,6 +2314,11 @@ if (LL_TESTS)
"${test_libs}"
)
+ LL_ADD_INTEGRATION_TEST(llluamanager
+ "llluamanager.cpp"
+ "${test_libs};ll::lualibs"
+ )
+
LL_ADD_INTEGRATION_TEST(llsechandler_basic
llsechandler_basic.cpp
"${test_libs}"
@@ -2369,4 +2373,3 @@ if (LL_TESTS)
endif (LL_TESTS)
check_message_template(${VIEWER_BINARY_NAME})
-
diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt
index e0eaaa0bbc..0f9f025fe4 100644
--- a/indra/newview/VIEWER_VERSION.txt
+++ b/indra/newview/VIEWER_VERSION.txt
@@ -1 +1 @@
-7.1.11
+7.1.12
diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml
index e16a5c7e76..e610775332 100644
--- a/indra/newview/app_settings/cmd_line.xml
+++ b/indra/newview/app_settings/cmd_line.xml
@@ -195,7 +195,33 @@
<string>LogPerformance</string>
</map>
- <key>multiple</key>
+ <key>lua</key>
+ <map>
+ <key>desc</key>
+ <string>Run specified Lua chunk</string>
+ <key>count</key>
+ <integer>1</integer>
+ <!-- you can specify multiple such chunks -->
+ <key>compose</key>
+ <boolean>true</boolean>
+ <key>map-to</key>
+ <string>LuaChunk</string>
+ </map>
+
+ <key>luafile</key>
+ <map>
+ <key>desc</key>
+ <string>Run specified Lua script</string>
+ <key>count</key>
+ <integer>1</integer>
+ <!-- you can specify multiple such scripts -->
+ <key>compose</key>
+ <boolean>true</boolean>
+ <key>map-to</key>
+ <string>LuaScript</string>
+ </map>
+
+ <key>multiple</key>
<map>
<key>desc</key>
<string>Allow multiple viewers.</string>
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 5f672cc218..55ccfaa715 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -68,7 +68,7 @@
<key>Value</key>
<integer>1</integer>
</map>
- <key>CrashHostUrl</key>
+ <key>CrashHostUrl</key>
<map>
<key>Comment</key>
<string>A URL pointing to a crash report handler; overrides cluster negotiation to locate crash handler.</string>
@@ -346,7 +346,7 @@
<key>Value</key>
<real>0.5</real>
</map>
- <key>AudioStreamingMedia</key>
+ <key>AudioStreamingMedia</key>
<map>
<key>Comment</key>
<string>Enable streaming</string>
@@ -1314,7 +1314,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
- <integer>0</integer>
+ <integer>0</integer>
</map>
<key>CameraPositionSmoothing</key>
<map>
@@ -1952,17 +1952,17 @@
<key>Value</key>
<string />
</map>
- <key>DebugAvatarRezTime</key>
- <map>
- <key>Comment</key>
- <string>Display times for avatars to resolve.</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>0</integer>
- </map>
+ <key>DebugAvatarRezTime</key>
+ <map>
+ <key>Comment</key>
+ <string>Display times for avatars to resolve.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>DebugAvatarLocalTexLoadedTime</key>
<map>
<key>Comment</key>
@@ -2337,39 +2337,39 @@
<key>Value</key>
<integer>0</integer>
</map>
- <key>DefaultFemaleAvatar</key>
- <map>
- <key>Comment</key>
- <string>Default Female Avatar</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>String</string>
- <key>Value</key>
- <string>Female Shape &amp; Outfit</string>
- </map>
- <key>DefaultLoginLocation</key>
- <map>
- <key>Comment</key>
- <string>Startup destination default (if not specified on command line)</string>
- <key>Persist</key>
- <integer>0</integer>
- <key>Type</key>
- <string>String</string>
- <key>Value</key>
- <string/>
- </map>
- <key>DefaultMaleAvatar</key>
- <map>
- <key>Comment</key>
- <string>Default Male Avatar</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>String</string>
- <key>Value</key>
- <string>Male Shape &amp; Outfit</string>
- </map>
+ <key>DefaultFemaleAvatar</key>
+ <map>
+ <key>Comment</key>
+ <string>Default Female Avatar</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string>Female Shape &amp; Outfit</string>
+ </map>
+ <key>DefaultLoginLocation</key>
+ <map>
+ <key>Comment</key>
+ <string>Startup destination default (if not specified on command line)</string>
+ <key>Persist</key>
+ <integer>0</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string/>
+ </map>
+ <key>DefaultMaleAvatar</key>
+ <map>
+ <key>Comment</key>
+ <string>Default Male Avatar</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string>Male Shape &amp; Outfit</string>
+ </map>
<key>DestinationGuideURL</key>
<map>
<key>Comment</key>
@@ -2744,7 +2744,7 @@
<key>Value</key>
<integer>0</integer>
</map>
- <key>FirstSelectedEnabledPopups</key>
+ <key>FirstSelectedEnabledPopups</key>
<map>
<key>Comment</key>
<string>Return false if there is not enable popup selected in the list of floater preferences popups</string>
@@ -3566,39 +3566,39 @@
<key>Value</key>
<integer>0</integer>
</map>
- <key>InventoryLinking</key>
- <map>
- <key>Comment</key>
- <string>Enable ability to create links to folders and items via "Paste as link".</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>1</integer>
- </map>
- <key>InventoryOutboxLogging</key>
- <map>
- <key>Comment</key>
- <string>Enable debug output associated with the Merchant Outbox.</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>0</integer>
- </map>
- <key>InventoryOutboxMakeVisible</key>
- <map>
- <key>Comment</key>
- <string>Enable making the Merchant Outbox and Inbox visible in the inventory for debug purposes.</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>0</integer>
- </map>
+ <key>InventoryLinking</key>
+ <map>
+ <key>Comment</key>
+ <string>Enable ability to create links to folders and items via "Paste as link".</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>InventoryOutboxLogging</key>
+ <map>
+ <key>Comment</key>
+ <string>Enable debug output associated with the Merchant Outbox.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>InventoryOutboxMakeVisible</key>
+ <map>
+ <key>Comment</key>
+ <string>Enable making the Merchant Outbox and Inbox visible in the inventory for debug purposes.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>InventoryOutboxMaxFolderCount</key>
<map>
<key>Comment</key>
@@ -3852,8 +3852,8 @@
<key>Value</key>
<real>0.25</real>
</map>
- <key>Jpeg2000AdvancedCompression</key>
- <map>
+ <key>Jpeg2000AdvancedCompression</key>
+ <map>
<key>Comment</key>
<string>Use advanced Jpeg2000 compression options (precincts, blocks, ordering, markers)</string>
<key>Persist</key>
@@ -3862,9 +3862,9 @@
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
- </map>
- <key>Jpeg2000PrecinctsSize</key>
- <map>
+ </map>
+ <key>Jpeg2000PrecinctsSize</key>
+ <map>
<key>Comment</key>
<string>Size of image precincts. Assumed square and same for all levels. Must be power of 2.</string>
<key>Persist</key>
@@ -3873,9 +3873,9 @@
<string>S32</string>
<key>Value</key>
<integer>256</integer>
- </map>
- <key>Jpeg2000BlocksSize</key>
- <map>
+ </map>
+ <key>Jpeg2000BlocksSize</key>
+ <map>
<key>Comment</key>
<string>Size of encoding blocks. Assumed square and same for all levels. Must be power of 2. Max 64, Min 4.</string>
<key>Persist</key>
@@ -3884,7 +3884,7 @@
<string>S32</string>
<key>Value</key>
<integer>64</integer>
- </map>
+ </map>
<key>KeepAspectForSnapshot</key>
<map>
<key>Comment</key>
@@ -3962,6 +3962,78 @@
<key>Value</key>
<string>Monospace</string>
</map>
+ <key>LuaAutorunPath</key>
+ <map>
+ <key>Comment</key>
+ <string>Directories containing scripts to autorun at viewer startup</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>LLSD</string>
+ <key>Value</key>
+ <array>
+ <string>scripts/lua/auto</string>
+ </array>
+ </map>
+ <key>LuaChunk</key>
+ <map>
+ <key>Comment</key>
+ <string>Zero or more Lua chunks to run from command line</string>
+ <key>Persist</key>
+ <integer>0</integer>
+ <key>Type</key>
+ <string>LLSD</string>
+ <key>Value</key>
+ <array />
+ </map>
+ <key>LuaCommandPath</key>
+ <map>
+ <key>Comment</key>
+ <string>Directories containing scripts recognized as chat slash commands</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>LLSD</string>
+ <key>Value</key>
+ <array>
+ <string>scripts/lua</string>
+ </array>
+ </map>
+ <key>LuaFeature</key>
+ <map>
+ <key>Comment</key>
+ <string>Enable viewer's Lua script engine.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>LuaRequirePath</key>
+ <map>
+ <key>Comment</key>
+ <string>Directories containing Lua modules loadable by require()</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>LLSD</string>
+ <key>Value</key>
+ <array>
+ <string>scripts/lua/require</string>
+ </array>
+ </map>
+ <key>LuaScript</key>
+ <map>
+ <key>Comment</key>
+ <string>Zero or more Lua script files to run from command line</string>
+ <key>Persist</key>
+ <integer>0</integer>
+ <key>Type</key>
+ <string>LLSD</string>
+ <key>Value</key>
+ <array />
+ </map>
<key>GridStatusRSS</key>
<map>
<key>Comment</key>
@@ -4492,17 +4564,17 @@
<key>Value</key>
<string />
</map>
- <key>MarketplaceListingsLogging</key>
- <map>
- <key>Comment</key>
- <string>Enable debug output associated with the Marketplace Listings (SLM) API.</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>0</integer>
- </map>
+ <key>MarketplaceListingsLogging</key>
+ <map>
+ <key>Comment</key>
+ <string>Enable debug output associated with the Marketplace Listings (SLM) API.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>MarketplaceURL</key>
<map>
<key>Comment</key>
@@ -4965,6 +5037,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>MediaPluginPipeWireVolumeCatcher</key>
+ <map>
+ <key>Comment</key>
+ <string>Use PipeWire instead of PulseAudio for controlling web media volume.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>MediaControlFadeTime</key>
<map>
<key>Comment</key>
@@ -5388,28 +5471,28 @@
<key>Value</key>
<integer>1000</integer>
</map>
- <key>FakeInitialOutfitName</key>
- <map>
- <key>Comment</key>
- <string>Pretend that this is first time login and specified name was chosen</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
+ <key>FakeInitialOutfitName</key>
+ <map>
+ <key>Comment</key>
+ <string>Pretend that this is first time login and specified name was chosen</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
<string>String</string>
<key>Value</key>
<string />
- </map>
- <key>MyOutfitsAutofill</key>
- <map>
- <key>Comment</key>
- <string>Always autofill My Outfits from library when empty (else happens just once).</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>0</integer>
- </map>
+ </map>
+ <key>MyOutfitsAutofill</key>
+ <map>
+ <key>Comment</key>
+ <string>Always autofill My Outfits from library when empty (else happens just once).</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>NearMeRange</key>
<map>
<key>Comment</key>
@@ -5518,7 +5601,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
- <integer>0</integer>
+ <integer>0</integer>
</map>
<key>NonvisibleObjectsInMemoryTime</key>
<map>
@@ -5529,7 +5612,7 @@
<key>Type</key>
<string>U32</string>
<key>Value</key>
- <integer>64</integer>
+ <integer>64</integer>
</map>
<key>NoPreload</key>
<map>
@@ -6441,7 +6524,7 @@
<key>Value</key>
<real>6.0</real>
</map>
- <key>PreferredMaturity</key>
+ <key>PreferredMaturity</key>
<map>
<key>Comment</key>
<string>Setting for the user's preferred maturity level (consts in indra_constants.h)</string>
@@ -6450,7 +6533,7 @@
<key>Type</key>
<string>U32</string>
<key>Value</key>
- <integer>13</integer>
+ <integer>13</integer>
</map>
<key>PreviewAmbientColor</key>
<map>
@@ -6620,8 +6703,8 @@
</map>
<key>PrimMediaMasterEnabled</key>
- <map>
- <key>Comment</key>
+ <map>
+ <key>Comment</key>
<string>Whether or not Media on a Prim is enabled.</string>
<key>Persist</key>
<integer>1</integer>
@@ -6630,9 +6713,9 @@
<key>Value</key>
<integer>1</integer>
</map>
- <key>PrimMediaControlsUseHoverControlSet</key>
- <map>
- <key>Comment</key>
+ <key>PrimMediaControlsUseHoverControlSet</key>
+ <map>
+ <key>Comment</key>
<string>Whether or not hovering over prim media uses minimal "hover" controls or the authored control set.</string>
<key>Persist</key>
<integer>1</integer>
@@ -6641,17 +6724,17 @@
<key>Value</key>
<integer>0</integer>
</map>
- <key>PrimMediaDragNDrop</key>
- <map>
- <key>Comment</key>
- <string>Enable drag and drop of URLs onto prim faces</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>1</integer>
- </map>
+ <key>PrimMediaDragNDrop</key>
+ <map>
+ <key>Comment</key>
+ <string>Enable drag and drop of URLs onto prim faces</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
<key>PrimMediaMaxRetries</key>
<map>
<key>Comment</key>
@@ -6685,7 +6768,7 @@
<key>Value</key>
<real>5.0</real>
</map>
- <key>PrimMediaMaxSortedQueueSize</key>
+ <key>PrimMediaMaxSortedQueueSize</key>
<map>
<key>Comment</key>
<string>Maximum number of objects the viewer will load media for initially</string>
@@ -6696,7 +6779,7 @@
<key>Value</key>
<integer>100000</integer>
</map>
- <key>PrimMediaMaxRoundRobinQueueSize</key>
+ <key>PrimMediaMaxRoundRobinQueueSize</key>
<map>
<key>Comment</key>
<string>Maximum number of objects the viewer will continuously update media for</string>
@@ -7330,6 +7413,17 @@
<key>Value</key>
<integer>-1</integer>
</map>
+ <key>RenderBufferClearOnInvalidate</key>
+ <map>
+ <key>Comment</key>
+ <string>Whether to call glClear on render buffers that will be fully overwritten with new contents</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>RenderCompressTextures</key>
<map>
<key>Comment</key>
@@ -8855,17 +8949,17 @@
<key>Value</key>
<integer>1024</integer>
</map>
- <key>RenderHeroProbeDistance</key>
- <map>
- <key>Comment</key>
- <string>Distance in meters for hero probes to render out to.</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>F32</string>
- <key>Value</key>
- <real>8</real>
- </map>
+ <key>RenderHeroProbeDistance</key>
+ <map>
+ <key>Comment</key>
+ <string>Distance in meters for hero probes to render out to.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>8</real>
+ </map>
<key>RenderHeroProbeUpdateRate</key>
<map>
<key>Comment</key>
@@ -9430,17 +9524,17 @@
<key>Value</key>
<integer>1</integer>
</map>
- <key>RenderTransparentWater</key>
- <map>
- <key>Comment</key>
- <string>Render water as transparent. Setting to false renders water as opaque with a simple texture applied.</string>
+ <key>RenderTransparentWater</key>
+ <map>
+ <key>Comment</key>
+ <string>Render water as transparent. Setting to false renders water as opaque with a simple texture applied.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
- </map>
+ </map>
<key>RenderTreeLODFactor</key>
<map>
<key>Comment</key>
@@ -9733,18 +9827,18 @@
<key>Value</key>
<integer>1</integer>
</map>
- <key>RenderPreferStreamDraw</key>
- <map>
- <key>Comment</key>
- <string>Use GL_STREAM_DRAW in place of GL_DYNAMIC_DRAW</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>0</integer>
- </map>
- <key>RenderVolumeLODFactor</key>
+ <key>RenderPreferStreamDraw</key>
+ <map>
+ <key>Comment</key>
+ <string>Use GL_STREAM_DRAW in place of GL_DYNAMIC_DRAW</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>RenderVolumeLODFactor</key>
<map>
<key>Comment</key>
<string>Controls level of detail of primitives (multiplier for current screen area when calculated level of detail)</string>
@@ -9876,17 +9970,17 @@
<key>Value</key>
<integer>0</integer>
</map>
- <key>ReportBugURL</key>
- <map>
- <key>Comment</key>
- <string>URL used for filing bugs from viewer</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>String</string>
- <key>Value</key>
- <string>https://feedback.secondlife.com/</string>
- </map>
+ <key>ReportBugURL</key>
+ <map>
+ <key>Comment</key>
+ <string>URL used for filing bugs from viewer</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string>https://feedback.secondlife.com/</string>
+ </map>
<key>RestrainedLove</key>
<map>
<key>Comment</key>
@@ -9964,7 +10058,7 @@
<key>Value</key>
<boolean>1</boolean>
</map>
- <key>RevokePermsOnStopAnimation</key>
+ <key>RevokePermsOnStopAnimation</key>
<map>
<key>Comment</key>
<string>Clear animation permssions when choosing "Stop Animating Me"</string>
@@ -10217,39 +10311,39 @@
<key>Value</key>
<real>400.0</real>
</map>
- <key>SceneLoadingMonitorEnabled</key>
- <map>
- <key>Comment</key>
- <string>Enabled scene loading monitor if set</string>
- <key>Persist</key>
- <integer>0</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>0</integer>
- </map>
- <key>SceneLoadingMonitorSampleTime</key>
- <map>
- <key>Comment</key>
- <string>Time between screen samples when monitor scene load (seconds)</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>F32</string>
- <key>Value</key>
- <real>0.25</real>
- </map>
- <key>SceneLoadingMonitorPixelDiffThreshold</key>
- <map>
- <key>Comment</key>
- <string>Amount of pixels changed required to consider the scene as still loading (square root of fraction of pixels on screen)</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>F32</string>
- <key>Value</key>
- <real>0.02</real>
- </map>
+ <key>SceneLoadingMonitorEnabled</key>
+ <map>
+ <key>Comment</key>
+ <string>Enabled scene loading monitor if set</string>
+ <key>Persist</key>
+ <integer>0</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>SceneLoadingMonitorSampleTime</key>
+ <map>
+ <key>Comment</key>
+ <string>Time between screen samples when monitor scene load (seconds)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>0.25</real>
+ </map>
+ <key>SceneLoadingMonitorPixelDiffThreshold</key>
+ <map>
+ <key>Comment</key>
+ <string>Amount of pixels changed required to consider the scene as still loading (square root of fraction of pixels on screen)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>0.02</real>
+ </map>
<key>ScriptHelpFollowsCursor</key>
<map>
<key>Comment</key>
@@ -10426,7 +10520,7 @@
<key>Value</key>
<integer>0</integer>
</map>
- <key>AvatarNameTagMode</key>
+ <key>AvatarNameTagMode</key>
<map>
<key>Comment</key>
<string>Select Avatar Name Tag Mode</string>
@@ -10635,7 +10729,7 @@
<key>Value</key>
<integer>1</integer>
</map>
- <key>ShowScriptErrors</key>
+ <key>ShowScriptErrors</key>
<map>
<key>Comment</key>
<string>Show script errors</string>
@@ -10646,7 +10740,7 @@
<key>Value</key>
<integer>1</integer>
</map>
- <key>ShowScriptErrorsLocation</key>
+ <key>ShowScriptErrorsLocation</key>
<map>
<key>Comment</key>
<string>Show script error in chat (0) or window (1).</string>
@@ -10905,8 +10999,8 @@
<string>Display results of find events that are flagged as moderate</string>
<key>Persist</key>
<integer>1</integer>
- <key>HideFromEditor</key>
- <integer>1</integer>
+ <key>HideFromEditor</key>
+ <integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
@@ -10918,8 +11012,8 @@
<string>Display results of find events that are flagged as adult</string>
<key>Persist</key>
<integer>1</integer>
- <key>HideFromEditor</key>
- <integer>1</integer>
+ <key>HideFromEditor</key>
+ <integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
@@ -10931,8 +11025,8 @@
<string>Display results of find land sales that are flagged as general</string>
<key>Persist</key>
<integer>1</integer>
- <key>HideFromEditor</key>
- <integer>1</integer>
+ <key>HideFromEditor</key>
+ <integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
@@ -10944,8 +11038,8 @@
<string>Display results of find land sales that are flagged as moderate</string>
<key>Persist</key>
<integer>1</integer>
- <key>HideFromEditor</key>
- <integer>1</integer>
+ <key>HideFromEditor</key>
+ <integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
@@ -10957,8 +11051,8 @@
<string>Display results of find land sales that are flagged as adult</string>
<key>Persist</key>
<integer>1</integer>
- <key>HideFromEditor</key>
- <integer>1</integer>
+ <key>HideFromEditor</key>
+ <integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
@@ -10970,8 +11064,8 @@
<string>Display results of find places or find popular that are in general sims</string>
<key>Persist</key>
<integer>1</integer>
- <key>HideFromEditor</key>
- <integer>1</integer>
+ <key>HideFromEditor</key>
+ <integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
@@ -10983,8 +11077,8 @@
<string>Display results of find places or find popular that are in moderate sims</string>
<key>Persist</key>
<integer>1</integer>
- <key>HideFromEditor</key>
- <integer>1</integer>
+ <key>HideFromEditor</key>
+ <integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
@@ -10996,8 +11090,8 @@
<string>Display results of find places or find popular that are in adult sims</string>
<key>Persist</key>
<integer>1</integer>
- <key>HideFromEditor</key>
- <integer>1</integer>
+ <key>HideFromEditor</key>
+ <integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
@@ -11135,17 +11229,17 @@
<key>Value</key>
<integer>0</integer>
</map>
- <key>ShowTutorial</key>
- <map>
- <key>Comment</key>
- <string>Show tutorial window on login</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>0</integer>
- </map>
+ <key>ShowTutorial</key>
+ <map>
+ <key>Comment</key>
+ <string>Show tutorial window on login</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>ShowVoiceVisualizersInCalls</key>
<map>
<key>Comment</key>
@@ -13796,17 +13890,17 @@
<key>Value</key>
<real>0.40000000596</real>
</map>
- <key>moapbeacon</key>
- <map>
- <key>Comment</key>
- <string>Beacon / Highlight media on a prim sources</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>0</integer>
- </map>
+ <key>moapbeacon</key>
+ <map>
+ <key>Comment</key>
+ <string>Beacon / Highlight media on a prim sources</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>particlesbeacon</key>
<map>
<key>Comment</key>
@@ -13906,17 +14000,17 @@
<key>Value</key>
<integer>0</integer>
</map>
- <key>SLURLDragNDrop</key>
- <map>
- <key>Comment</key>
- <string>Enable drag and drop of SLURLs onto the viewer</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>1</integer>
- </map>
+ <key>SLURLDragNDrop</key>
+ <map>
+ <key>Comment</key>
+ <string>Enable drag and drop of SLURLs onto the viewer</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
<key>SLURLPassToOtherInstance</key>
<map>
<key>Comment</key>
@@ -14104,10 +14198,10 @@
<string>LLSD</string>
<key>Value</key>
<array>
- <string>snapshot</string>
- <string>postcard</string>
- <string>mini_map</string>
- <string>beacons</string>
+ <string>snapshot</string>
+ <string>postcard</string>
+ <string>mini_map</string>
+ <string>beacons</string>
</array>
</map>
<key>LandmarksSortedByDate</key>
@@ -14868,7 +14962,7 @@
<key>Value</key>
<integer>0</integer>
</map>
- <key>LocalTerrainAsset1</key>
+ <key>LocalTerrainAsset1</key>
<map>
<key>Comment</key>
<string>If set to a non-null UUID, overrides the terrain asset locally for all regions with material assets. Local terrain assets are not visible to others. Please keep in mind that this debug setting may be temporary. Do not rely on this setting existing in future viewer builds.</string>
@@ -14879,7 +14973,7 @@
<key>Value</key>
<string>00000000-0000-0000-0000-000000000000</string>
</map>
- <key>LocalTerrainAsset2</key>
+ <key>LocalTerrainAsset2</key>
<map>
<key>Comment</key>
<string>If set to a non-null UUID, overrides the terrain asset locally for all regions with material assets. Local terrain assets are not visible to others. Please keep in mind that this debug setting may be temporary. Do not rely on this setting existing in future viewer builds.</string>
@@ -14890,7 +14984,7 @@
<key>Value</key>
<string>00000000-0000-0000-0000-000000000000</string>
</map>
- <key>LocalTerrainAsset3</key>
+ <key>LocalTerrainAsset3</key>
<map>
<key>Comment</key>
<string>If set to a non-null UUID, overrides the terrain asset locally for all regions with material assets. Local terrain assets are not visible to others. Please keep in mind that this debug setting may be temporary. Do not rely on this setting existing in future viewer builds.</string>
@@ -14901,7 +14995,7 @@
<key>Value</key>
<string>00000000-0000-0000-0000-000000000000</string>
</map>
- <key>LocalTerrainAsset4</key>
+ <key>LocalTerrainAsset4</key>
<map>
<key>Comment</key>
<string>If set to a non-null UUID, overrides the terrain asset locally for all regions with material assets. Local terrain assets are not visible to others. Please keep in mind that this debug setting may be temporary. Do not rely on this setting existing in future viewer builds.</string>
@@ -15165,7 +15259,7 @@
<key>Value</key>
<integer>2048</integer>
</map>
- <key>PathfindingRetrieveNeighboringRegion</key>
+ <key>PathfindingRetrieveNeighboringRegion</key>
<map>
<key>Comment</key>
<string>Download a neighboring region when visualizing a pathfinding navmesh (default val 99 means do not download neighbors).</string>
@@ -15174,9 +15268,9 @@
<key>Type</key>
<string>U32</string>
<key>Value</key>
- <integer>99</integer>
+ <integer>99</integer>
</map>
- <key>PathfindingNavMeshClear</key>
+ <key>PathfindingNavMeshClear</key>
<map>
<key>Comment</key>
<string>Background color when displaying pathfinding navmesh.</string>
@@ -15336,7 +15430,7 @@
<real>1.0</real>
</array>
</map>
- <key>PathfindingTestPathValidEndColor</key>
+ <key>PathfindingTestPathValidEndColor</key>
<map>
<key>Comment</key>
<string>Color of the pathfinding test-pathing tool end-point when the path is valid.</string>
@@ -15368,7 +15462,7 @@
<real>1.0</real>
</array>
</map>
- <key>PathfindingTestPathColor</key>
+ <key>PathfindingTestPathColor</key>
<map>
<key>Comment</key>
<string>Color of the pathfinding test-path when the path is valid.</string>
@@ -16016,17 +16110,17 @@
<key>Value</key>
<real>300</real>
</map>
- <key>StatsReportFileInterval</key>
- <map>
- <key>Comment</key>
- <string>Interval to save viewer stats file data</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>F32</string>
- <key>Value</key>
- <real>0.2</real>
- </map>
+ <key>StatsReportFileInterval</key>
+ <map>
+ <key>Comment</key>
+ <string>Interval to save viewer stats file data</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>F32</string>
+ <key>Value</key>
+ <real>0.2</real>
+ </map>
<key>StatsReportSkipZeroDataSaves</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index 210ecce8db..e9f849a8c0 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -79,7 +79,7 @@ float getAmbientClamp();
void mirrorClip(vec3 pos);
-void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 legacyenv,
+void sampleReflectionProbesLegacy(out vec3 ambenv, out vec3 glossenv, out vec3 legacyenv,
vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent, vec3 amblit_linear);
vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight, float ambiance)
diff --git a/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl
index d178bf22b6..4fb24ca0b1 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl
@@ -55,7 +55,7 @@ vec4 sampleReflectionProbesDebug(vec3 pos)
return vec4(0, 0, 0, 0);
}
-void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 legacyenv,
+void sampleReflectionProbesLegacy(out vec3 ambenv, out vec3 glossenv, out vec3 legacyenv,
vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent, vec3 amblit_linear)
{
ambenv = vec3(reflection_probe_ambiance * 0.25);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl
index 03dc3d7113..5e38864d38 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl
@@ -48,7 +48,7 @@ vec3 linear_to_srgb(vec3 c);
vec3 srgb_to_linear(vec3 c);
// reflection probe interface
-void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 legacyenv,
+void sampleReflectionProbesLegacy(out vec3 ambenv, out vec3 glossenv, out vec3 legacyenv,
vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent, vec3 amblit_linear);
void applyLegacyEnv(inout vec3 color, vec3 legacyenv, vec4 spec, vec3 pos, vec3 norm, float envIntensity);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
index 26ab0406f6..5ee9aea09d 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
@@ -60,7 +60,7 @@ out vec4 frag_color;
float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen);
#endif
-void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 legacyenv,
+void sampleReflectionProbesLegacy(out vec3 ambenv, out vec3 glossenv, out vec3 legacyenv,
vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent, vec3 amblit_linear);
void applyGlossEnv(inout vec3 color, vec3 glossenv, vec4 spec, vec3 pos, vec3 norm);
void applyLegacyEnv(inout vec3 color, vec3 legacyenv, vec4 spec, vec3 pos, vec3 norm, float envIntensity);
@@ -280,10 +280,10 @@ float getShadow(vec3 pos, vec3 norm)
#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND)
return sampleDirectionalShadow(pos, norm, vary_texcoord0.xy);
#else
- return 1;
+ return 1.;
#endif
#else
- return 1;
+ return 1.;
#endif
}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
index 5dfa196cf6..4bae7b6deb 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
@@ -837,7 +837,7 @@ vec4 sampleReflectionProbesDebug(vec3 pos)
return col;
}
-void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 legacyenv,
+void sampleReflectionProbesLegacy(out vec3 ambenv, out vec3 glossenv, out vec3 legacyenv,
vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent, vec3 amblit)
{
float reflection_lods = max_probe_lod;
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index ca88fe7482..4231d8580e 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -69,7 +69,7 @@ vec3 scaleSoftClipFragLinear(vec3 l);
// reflection probe interface
void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent, vec3 amblit_linear);
-void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 legacyenv,
+void sampleReflectionProbesLegacy(out vec3 ambenv, out vec3 glossenv, out vec3 legacyenv,
vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent, vec3 amblit_linear);
void applyGlossEnv(inout vec3 color, vec3 glossenv, vec4 spec, vec3 pos, vec3 norm);
void applyLegacyEnv(inout vec3 color, vec3 legacyenv, vec4 spec, vec3 pos, vec3 norm, float envIntensity);
diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt
index 2e220d2b1c..06ad730a40 100644
--- a/indra/newview/featuretable_mac.txt
+++ b/indra/newview/featuretable_mac.txt
@@ -1,4 +1,4 @@
-version 60
+version 61
// The version number above should be incremented IF AND ONLY IF some
// change has been made that is sufficiently important to justify
// resetting the graphics preferences of all users to the recommended
@@ -68,7 +68,8 @@ RenderFSAASamples 1 3
RenderMaxTextureIndex 1 16
RenderGLContextCoreProfile 1 1
RenderGLMultiThreadedTextures 1 0
-RenderGLMultiThreadedMedia 1 0
+RenderGLMultiThreadedMedia 1 1
+RenderAppleUseMultGL 1 1
RenderReflectionsEnabled 1 1
RenderReflectionProbeDetail 1 2
RenderScreenSpaceReflections 1 1
@@ -381,6 +382,15 @@ list Intel
RenderAnisotropic 1 0
RenderFSAASamples 1 0
+// AppleGPU and NonAppleGPU can be thought of as Apple silicon vs Intel Mac
+list AppleGPU
+RenderGLMultiThreadedMedia 1 1
+RenderAppleUseMultGL 1 1
+
+list NonAppleGPU
+RenderGLMultiThreadedMedia 1 0
+RenderAppleUseMultGL 1 0
+
list GL3
RenderFSAASamples 0 0
RenderReflectionProbeDetail 0 0
diff --git a/indra/newview/gltfscenemanager.cpp b/indra/newview/gltfscenemanager.cpp
index ce54fa4c12..ed66753267 100644
--- a/indra/newview/gltfscenemanager.cpp
+++ b/indra/newview/gltfscenemanager.cpp
@@ -371,43 +371,46 @@ void GLTFSceneManager::addGLTFObject(LLViewerObject* obj, LLUUID gltf_id)
//static
void GLTFSceneManager::onGLTFBinLoadComplete(const LLUUID& id, LLAssetType::EType asset_type, void* user_data, S32 status, LLExtStat ext_status)
{
- LLViewerObject* obj = (LLViewerObject*)user_data;
- llassert(asset_type == LLAssetType::AT_GLTF_BIN);
-
- if (status == LL_ERR_NOERR)
- {
- if (obj)
+ LLAppViewer::instance()->postToMainCoro([=]()
{
- // find the Buffer with the given id in the asset
- if (obj->mGLTFAsset)
- {
- obj->mGLTFAsset->mPendingBuffers--;
-
+ LLViewerObject* obj = (LLViewerObject*)user_data;
+ llassert(asset_type == LLAssetType::AT_GLTF_BIN);
- if (obj->mGLTFAsset->mPendingBuffers == 0)
+ if (status == LL_ERR_NOERR)
+ {
+ if (obj)
{
- if (obj->mGLTFAsset->prep())
+ // find the Buffer with the given id in the asset
+ if (obj->mGLTFAsset)
{
- GLTFSceneManager& mgr = GLTFSceneManager::instance();
- if (std::find(mgr.mObjects.begin(), mgr.mObjects.end(), obj) == mgr.mObjects.end())
+ obj->mGLTFAsset->mPendingBuffers--;
+
+
+ if (obj->mGLTFAsset->mPendingBuffers == 0)
{
- GLTFSceneManager::instance().mObjects.push_back(obj);
+ if (obj->mGLTFAsset->prep())
+ {
+ GLTFSceneManager& mgr = GLTFSceneManager::instance();
+ if (std::find(mgr.mObjects.begin(), mgr.mObjects.end(), obj) == mgr.mObjects.end())
+ {
+ GLTFSceneManager::instance().mObjects.push_back(obj);
+ }
+ }
+ else
+ {
+ LL_WARNS("GLTF") << "Failed to prepare GLTF asset: " << id << LL_ENDL;
+ obj->mGLTFAsset = nullptr;
+ }
}
}
- else
- {
- LL_WARNS("GLTF") << "Failed to prepare GLTF asset: " << id << LL_ENDL;
- obj->mGLTFAsset = nullptr;
- }
}
}
- }
- }
- else
- {
- LL_WARNS("GLTF") << "Failed to load GLTF asset: " << id << LL_ENDL;
- obj->unref();
- }
+ else
+ {
+ LL_WARNS("GLTF") << "Failed to load GLTF asset: " << id << LL_ENDL;
+ obj->unref();
+ }
+ });
}
//static
diff --git a/indra/newview/groupchatlistener.cpp b/indra/newview/groupchatlistener.cpp
index 43507f13e9..e48cbe824a 100644
--- a/indra/newview/groupchatlistener.cpp
+++ b/indra/newview/groupchatlistener.cpp
@@ -2,11 +2,11 @@
* @file groupchatlistener.cpp
* @author Nat Goodspeed
* @date 2011-04-11
- * @brief Implementation for groupchatlistener.
+ * @brief Implementation for LLGroupChatListener.
*
- * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2024&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
+ * Copyright (C) 2024, 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
@@ -34,43 +34,82 @@
// std headers
// external library headers
// other Linden headers
+#include "llchat.h"
#include "llgroupactions.h"
#include "llimview.h"
+static const F64 GROUP_CHAT_THROTTLE_PERIOD = 1.f;
-namespace {
- void startIm_wrapper(LLSD const & event)
+LLGroupChatListener::LLGroupChatListener():
+ LLEventAPI("GroupChat",
+ "API to enter, leave, send and intercept group chat messages"),
+ mIMThrottle("sendGroupIM", &LLGroupChatListener::sendGroupIM_, this,
+ GROUP_CHAT_THROTTLE_PERIOD)
+{
+ add("startGroupChat",
+ "Enter a group chat in group with UUID [\"group_id\"]\n"
+ "Assumes the logged-in agent is already a member of this group.",
+ &LLGroupChatListener::startGroupChat,
+ llsd::map("group_id", LLSD()));
+ add("leaveGroupChat",
+ "Leave a group chat in group with UUID [\"group_id\"]\n"
+ "Assumes a prior successful startIM request.",
+ &LLGroupChatListener::leaveGroupChat,
+ llsd::map("group_id", LLSD()));
+ add("sendGroupIM",
+ "send a [\"message\"] to group with UUID [\"group_id\"]",
+ &LLGroupChatListener::sendGroupIM,
+ llsd::map("message", LLSD(), "group_id", LLSD()));
+}
+
+bool is_in_group(LLEventAPI::Response &response, const LLSD &data)
+{
+ if (!LLGroupActions::isInGroup(data["group_id"]))
{
- LLUUID session_id = LLGroupActions::startIM(event["id"].asUUID());
- sendReply(LLSDMap("session_id", LLSD(session_id)), event);
+ response.error(stringize("You are not the member of the group:", std::quoted(data["group_id"].asString())));
+ return false;
}
+ return true;
+}
- void send_message_wrapper(const std::string& text, const LLUUID& session_id, const LLUUID& group_id)
+void LLGroupChatListener::startGroupChat(LLSD const &data)
+{
+ Response response(LLSD(), data);
+ if (!is_in_group(response, data))
+ {
+ return;
+ }
+ if (LLGroupActions::startIM(data["group_id"]).isNull())
{
- LLIMModel::sendMessage(text, session_id, group_id, IM_SESSION_GROUP_START);
+ return response.error(stringize("Failed to start group chat session ", std::quoted(data["group_id"].asString())));
}
}
+void LLGroupChatListener::leaveGroupChat(LLSD const &data)
+{
+ Response response(LLSD(), data);
+ if (is_in_group(response, data))
+ {
+ LLGroupActions::endIM(data["group_id"].asUUID());
+ }
+}
-GroupChatListener::GroupChatListener():
- LLEventAPI("GroupChat",
- "API to enter, leave, send and intercept group chat messages")
+void LLGroupChatListener::sendGroupIM(LLSD const &data)
{
- add("startIM",
- "Enter a group chat in group with UUID [\"id\"]\n"
- "Assumes the logged-in agent is already a member of this group.",
- &startIm_wrapper);
- add("endIM",
- "Leave a group chat in group with UUID [\"id\"]\n"
- "Assumes a prior successful startIM request.",
- &LLGroupActions::endIM,
- llsd::array("id"));
- add("sendIM",
- "send a groupchat IM",
- &send_message_wrapper,
- llsd::array("text", "session_id", "group_id"));
+ Response response(LLSD(), data);
+ if (!is_in_group(response, data))
+ {
+ return;
+ }
+
+ mIMThrottle(data["group_id"], data["message"]);
+}
+
+void LLGroupChatListener::sendGroupIM_(const LLUUID& group_id, const std::string& message)
+{
+ LLIMModel::sendMessage(LUA_PREFIX + message,
+ gIMMgr->computeSessionID(IM_SESSION_GROUP_START, group_id),
+ group_id,
+ IM_SESSION_SEND);
}
-/*
- static void sendMessage(const std::string& utf8_text, const LLUUID& im_session_id,
- const LLUUID& other_participant_id, EInstantMessage dialog);
-*/
+
diff --git a/indra/newview/groupchatlistener.h b/indra/newview/groupchatlistener.h
index 3819ac59b7..a75fecb254 100644
--- a/indra/newview/groupchatlistener.h
+++ b/indra/newview/groupchatlistener.h
@@ -4,9 +4,9 @@
* @date 2011-04-11
* @brief
*
- * $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2024&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
+ * Copyright (C) 2024, 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
@@ -26,15 +26,24 @@
* $/LicenseInfo$
*/
-#if ! defined(LL_GROUPCHATLISTENER_H)
-#define LL_GROUPCHATLISTENER_H
+#if ! defined(LL_LLGROUPCHATLISTENER_H)
+#define LL_LLGROUPCHATLISTENER_H
#include "lleventapi.h"
+#include "throttle.h"
-class GroupChatListener: public LLEventAPI
+class LLGroupChatListener: public LLEventAPI
{
public:
- GroupChatListener();
+ LLGroupChatListener();
+
+private:
+ void startGroupChat(LLSD const &data);
+ void leaveGroupChat(LLSD const &data);
+ void sendGroupIM(LLSD const &data);
+ void sendGroupIM_(const LLUUID& group_id, const std::string& message);
+
+ LogThrottle<LLError::LEVEL_DEBUG, void(const LLUUID&, const std::string&)> mIMThrottle;
};
-#endif /* ! defined(LL_GROUPCHATLISTENER_H) */
+#endif /* ! defined(LL_LLGROUPCHATLISTENER_H) */
diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh
index eb3ead433b..a027aaf6d1 100755
--- a/indra/newview/linux_tools/wrapper.sh
+++ b/indra/newview/linux_tools/wrapper.sh
@@ -58,21 +58,14 @@ fi
## - Avoids an often-buggy X feature that doesn't really benefit us anyway.
export SDL_VIDEO_X11_DGAMOUSE=0
-## - Works around a problem with misconfigured 64-bit systems not finding GL
-I386_MULTIARCH="$(dpkg-architecture -ai386 -qDEB_HOST_MULTIARCH 2>/dev/null)"
-MULTIARCH_ERR=$?
-if [ $MULTIARCH_ERR -eq 0 ]; then
- echo 'Multi-arch support detected.'
- MULTIARCH_GL_DRIVERS="/usr/lib/${I386_MULTIARCH}/dri"
- export LIBGL_DRIVERS_PATH="${LIBGL_DRIVERS_PATH}:${MULTIARCH_GL_DRIVERS}:/usr/lib64/dri:/usr/lib32/dri:/usr/lib/dri"
-else
- export LIBGL_DRIVERS_PATH="${LIBGL_DRIVERS_PATH}:/usr/lib64/dri:/usr/lib32/dri:/usr/lib/dri"
-fi
-
## - The 'scim' GTK IM module widely crashes the viewer. Avoid it.
if [ "$GTK_IM_MODULE" = "scim" ]; then
export GTK_IM_MODULE=xim
fi
+if [ "$XMODIFIERS" = "" ]; then
+ ## IME is valid only for fcitx, not when using ibus
+ export XMODIFIERS="@im=fcitx"
+fi
## - Automatically work around the ATI mouse cursor crash bug:
## (this workaround is disabled as most fglrx users do not see the bug)
@@ -98,25 +91,6 @@ cd "${RUN_PATH}"
## Before we mess with LD_LIBRARY_PATH, save the old one to restore for
## subprocesses that care.
export SAVED_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
-
-# if [ -n "$LL_TCMALLOC" ]; then
-# tcmalloc_libs='/usr/lib/libtcmalloc.so.0 /usr/lib/libstacktrace.so.0 /lib/libpthread.so.0'
-# all=1
-# for f in $tcmalloc_libs; do
-# if [ ! -f $f ]; then
-# all=0
-# fi
-# done
-# if [ $all != 1 ]; then
-# echo 'Cannot use tcmalloc libraries: components missing' 1>&2
-# else
-# export LD_PRELOAD=$(echo $tcmalloc_libs | tr ' ' :)
-# if [ -z "$HEAPCHECK" -a -z "$HEAPPROFILE" ]; then
-# export HEAPCHECK=${HEAPCHECK:-normal}
-# fi
-# fi
-#fi
-
export LD_LIBRARY_PATH="$PWD/lib:${LD_LIBRARY_PATH}"
# Copy "$@" to ARGS array specifically to delete the --skip-gridargs switch.
@@ -140,18 +114,6 @@ LL_RUN_ERR=$?
if [ $LL_RUN_ERR -ne 0 ]; then
# generic error running the binary
echo '*** Bad shutdown ($LL_RUN_ERR). ***'
- if [ "$(uname -m)" = "x86_64" ]; then
- echo
- cat << EOFMARKER
-You are running the Second Life Viewer on a x86_64 platform. The
-most common problems when launching the Viewer (particularly
-'bin/do-not-directly-run-secondlife-bin: not found' and 'error while
-loading shared libraries') may be solved by installing your Linux
-distribution's 32-bit compatibility packages.
-For example, on Ubuntu and other Debian-based Linuxes you might run:
-$ sudo apt-get install ia32-libs ia32-libs-gtk ia32-libs-kde ia32-libs-sdl
-EOFMARKER
- fi
fi
echo
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index 81e79a2ed9..d4767e18af 100644
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -1988,16 +1988,6 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(bool *hit_limit)
isConstrained = true;
}
}
-
-// JC - Could constrain camera based on parcel stuff here.
-// LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(camera_position_global);
-//
-// if (regionp && !regionp->mParcelOverlay->isBuildCameraAllowed(regionp->getPosRegionFromGlobal(camera_position_global)))
-// {
-// camera_position_global = last_position_global;
-//
-// isConstrained = true;
-// }
}
// Don't let camera go underground
diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp
index 0c120ae01d..14e443ec4e 100644
--- a/indra/newview/llagentlistener.cpp
+++ b/indra/newview/llagentlistener.cpp
@@ -31,23 +31,30 @@
#include "llagentlistener.h"
#include "llagent.h"
+#include "llagentcamera.h"
#include "llvoavatar.h"
#include "llcommandhandler.h"
+#include "llinventorymodel.h"
#include "llslurl.h"
#include "llurldispatcher.h"
#include "llviewernetwork.h"
#include "llviewerobject.h"
#include "llviewerobjectlist.h"
#include "llviewerregion.h"
+#include "llvoavatarself.h"
#include "llsdutil.h"
#include "llsdutil_math.h"
#include "lltoolgrab.h"
#include "llhudeffectlookat.h"
#include "llagentcamera.h"
+#include <functional>
+
+static const F64 PLAY_ANIM_THROTTLE_PERIOD = 1.f;
LLAgentListener::LLAgentListener(LLAgent &agent)
: LLEventAPI("LLAgent",
"LLAgent listener to (e.g.) teleport, sit, stand, etc."),
+ mPlayAnimThrottle("playAnimation", &LLAgentListener::playAnimation_, this, PLAY_ANIM_THROTTLE_PERIOD),
mAgent(agent)
{
add("requestTeleport",
@@ -69,13 +76,6 @@ LLAgentListener::LLAgentListener(LLAgent &agent)
add("resetAxes",
"Set the agent to a fixed orientation (optionally specify [\"lookat\"] = array of [x, y, z])",
&LLAgentListener::resetAxes);
- add("getAxes",
- "Obsolete - use getPosition instead\n"
- "Send information about the agent's orientation on [\"reply\"]:\n"
- "[\"euler\"]: map of {roll, pitch, yaw}\n"
- "[\"quat\"]: array of [x, y, z, w] quaternion values",
- &LLAgentListener::getAxes,
- LLSDMap("reply", LLSD()));
add("getPosition",
"Send information about the agent's position and orientation on [\"reply\"]:\n"
"[\"region\"]: array of region {x, y, z} position\n"
@@ -87,33 +87,34 @@ LLAgentListener::LLAgentListener(LLAgent &agent)
add("startAutoPilot",
"Start the autopilot system using the following parameters:\n"
"[\"target_global\"]: array of target global {x, y, z} position\n"
- "[\"stop_distance\"]: target maxiumum distance from target [default: autopilot guess]\n"
+ "[\"stop_distance\"]: maximum stop distance from target [default: autopilot guess]\n"
"[\"target_rotation\"]: array of [x, y, z, w] quaternion values [default: no target]\n"
"[\"rotation_threshold\"]: target maximum angle from target facing rotation [default: 0.03 radians]\n"
- "[\"behavior_name\"]: name of the autopilot behavior [default: \"\"]"
- "[\"allow_flying\"]: allow flying during autopilot [default: True]",
- //"[\"callback_pump\"]: pump to send success/failure and callback data to [default: none]\n"
- //"[\"callback_data\"]: data to send back during a callback [default: none]",
- &LLAgentListener::startAutoPilot);
+ "[\"behavior_name\"]: name of the autopilot behavior [default: \"\"]\n"
+ "[\"allow_flying\"]: allow flying during autopilot [default: True]\n"
+ "event with [\"success\"] flag is sent to 'LLAutopilot' event pump, when auto pilot is terminated",
+ &LLAgentListener::startAutoPilot,
+ llsd::map("target_global", LLSD()));
add("getAutoPilot",
"Send information about current state of the autopilot system to [\"reply\"]:\n"
"[\"enabled\"]: boolean indicating whether or not autopilot is enabled\n"
"[\"target_global\"]: array of target global {x, y, z} position\n"
"[\"leader_id\"]: uuid of target autopilot is following\n"
- "[\"stop_distance\"]: target maximum distance from target\n"
+ "[\"stop_distance\"]: maximum stop distance from target\n"
"[\"target_distance\"]: last known distance from target\n"
"[\"use_rotation\"]: boolean indicating if autopilot has a target facing rotation\n"
"[\"target_facing\"]: array of {x, y} target direction to face\n"
"[\"rotation_threshold\"]: target maximum angle from target facing rotation\n"
"[\"behavior_name\"]: name of the autopilot behavior",
&LLAgentListener::getAutoPilot,
- LLSDMap("reply", LLSD()));
+ llsd::map("reply", LLSD()));
add("startFollowPilot",
"[\"leader_id\"]: uuid of target to follow using the autopilot system (optional with avatar_name)\n"
"[\"avatar_name\"]: avatar name to follow using the autopilot system (optional with leader_id)\n"
"[\"allow_flying\"]: allow flying during autopilot [default: True]\n"
- "[\"stop_distance\"]: target maxiumum distance from target [default: autopilot guess]",
- &LLAgentListener::startFollowPilot);
+ "[\"stop_distance\"]: maximum stop distance from target [default: autopilot guess]",
+ &LLAgentListener::startFollowPilot,
+ llsd::map("reply", LLSD()));
add("setAutoPilotTarget",
"Update target for currently running autopilot:\n"
"[\"target_global\"]: array of target global {x, y, z} position",
@@ -138,6 +139,43 @@ LLAgentListener::LLAgentListener(LLAgent &agent)
"[\"contrib\"]: user's land contribution to this group\n",
&LLAgentListener::getGroups,
LLSDMap("reply", LLSD()));
+ //camera params are similar to LSL, see https://wiki.secondlife.com/wiki/LlSetCameraParams
+ add("setCameraParams",
+ "Set Follow camera params, and then activate it:\n"
+ "[\"camera_pos\"]: vector3, camera position in region coordinates\n"
+ "[\"focus_pos\"]: vector3, what the camera is aimed at (in region coordinates)\n"
+ "[\"focus_offset\"]: vector3, adjusts the camera focus position relative to the target, default is (1, 0, 0)\n"
+ "[\"distance\"]: float (meters), distance the camera wants to be from its target, default is 3\n"
+ "[\"focus_threshold\"]: float (meters), sets the radius of a sphere around the camera's target position within which its focus is not affected by target motion, default is 1\n"
+ "[\"camera_threshold\"]: float (meters), sets the radius of a sphere around the camera's ideal position within which it is not affected by target motion, default is 1\n"
+ "[\"focus_lag\"]: float (seconds), how much the camera lags as it tries to aim towards the target, default is 0.1\n"
+ "[\"camera_lag\"]: float (seconds), how much the camera lags as it tries to move towards its 'ideal' position, default is 0.1\n"
+ "[\"camera_pitch\"]: float (degrees), adjusts the angular amount that the camera aims straight ahead vs. straight down, maintaining the same distance, default is 0\n"
+ "[\"behindness_angle\"]: float (degrees), sets the angle in degrees within which the camera is not constrained by changes in target rotation, default is 10\n"
+ "[\"behindness_lag\"]: float (seconds), sets how strongly the camera is forced to stay behind the target if outside of behindness angle, default is 0\n"
+ "[\"camera_locked\"]: bool, locks the camera position so it will not move\n"
+ "[\"focus_locked\"]: bool, locks the camera focus so it will not move",
+ &LLAgentListener::setFollowCamParams);
+ add("setFollowCamActive",
+ "Turns on or off scripted control of the camera using boolean [\"active\"]",
+ &LLAgentListener::setFollowCamActive,
+ llsd::map("active", LLSD()));
+ add("removeCameraParams",
+ "Reset Follow camera params",
+ &LLAgentListener::removeFollowCamParams);
+
+ add("playAnimation",
+ "Play [\"item_id\"] animation locally (by default) or [\"inworld\"] (when set to true)",
+ &LLAgentListener::playAnimation,
+ llsd::map("item_id", LLSD(), "reply", LLSD()));
+ add("stopAnimation",
+ "Stop playing [\"item_id\"] animation",
+ &LLAgentListener::stopAnimation,
+ llsd::map("item_id", LLSD(), "reply", LLSD()));
+ add("getAnimationInfo",
+ "Return information about [\"item_id\"] animation",
+ &LLAgentListener::getAnimationInfo,
+ llsd::map("item_id", LLSD(), "reply", LLSD()));
}
void LLAgentListener::requestTeleport(LLSD const & event_data) const
@@ -168,7 +206,7 @@ void LLAgentListener::requestSit(LLSD const & event_data) const
//mAgent.getAvatarObject()->sitOnObject();
// shamelessly ripped from llviewermenu.cpp:handle_sit_or_stand()
// *TODO - find a permanent place to share this code properly.
-
+ Response response(LLSD(), event_data);
LLViewerObject *object = NULL;
if (event_data.has("obj_uuid"))
{
@@ -177,7 +215,13 @@ void LLAgentListener::requestSit(LLSD const & event_data) const
else if (event_data.has("position"))
{
LLVector3 target_position = ll_vector3_from_sd(event_data["position"]);
- object = findObjectClosestTo(target_position);
+ object = findObjectClosestTo(target_position, true);
+ }
+ else
+ {
+ //just sit on the ground
+ mAgent.setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);
+ return;
}
if (object && object->getPCode() == LL_PCODE_VOLUME)
@@ -194,8 +238,7 @@ void LLAgentListener::requestSit(LLSD const & event_data) const
}
else
{
- LL_WARNS() << "LLAgent requestSit could not find the sit target: "
- << event_data << LL_ENDL;
+ response.error("requestSit could not find the sit target");
}
}
@@ -205,7 +248,7 @@ void LLAgentListener::requestStand(LLSD const & event_data) const
}
-LLViewerObject * LLAgentListener::findObjectClosestTo( const LLVector3 & position ) const
+LLViewerObject * LLAgentListener::findObjectClosestTo(const LLVector3 & position, bool sit_target) const
{
LLViewerObject *object = NULL;
@@ -216,8 +259,13 @@ LLViewerObject * LLAgentListener::findObjectClosestTo( const LLVector3 & positio
while (cur_index < num_objects)
{
LLViewerObject * cur_object = gObjectList.getObject(cur_index++);
- if (cur_object)
- { // Calculate distance from the target position
+ if (cur_object && !cur_object->isAttachment())
+ {
+ if(sit_target && (cur_object->getPCode() != LL_PCODE_VOLUME))
+ {
+ continue;
+ }
+ // Calculate distance from the target position
LLVector3 target_diff = cur_object->getPositionRegion() - position;
F32 distance_to_target = target_diff.length();
if (distance_to_target < min_distance)
@@ -296,22 +344,6 @@ void LLAgentListener::resetAxes(const LLSD& event_data) const
}
}
-void LLAgentListener::getAxes(const LLSD& event_data) const
-{
- LLQuaternion quat(mAgent.getQuat());
- F32 roll, pitch, yaw;
- quat.getEulerAngles(&roll, &pitch, &yaw);
- // The official query API for LLQuaternion's [x, y, z, w] values is its
- // public member mQ...
- LLSD reply = LLSD::emptyMap();
- reply["quat"] = llsd_copy_array(boost::begin(quat.mQ), boost::end(quat.mQ));
- reply["euler"] = LLSD::emptyMap();
- reply["euler"]["roll"] = roll;
- reply["euler"]["pitch"] = pitch;
- reply["euler"]["yaw"] = yaw;
- sendReply(reply, event_data);
-}
-
void LLAgentListener::getPosition(const LLSD& event_data) const
{
F32 roll, pitch, yaw;
@@ -333,14 +365,13 @@ void LLAgentListener::getPosition(const LLSD& event_data) const
void LLAgentListener::startAutoPilot(LLSD const & event_data)
{
- LLQuaternion target_rotation_value;
LLQuaternion* target_rotation = NULL;
if (event_data.has("target_rotation"))
{
- target_rotation_value = ll_quaternion_from_sd(event_data["target_rotation"]);
+ LLQuaternion target_rotation_value = ll_quaternion_from_sd(event_data["target_rotation"]);
target_rotation = &target_rotation_value;
}
- // *TODO: Use callback_pump and callback_data
+
F32 rotation_threshold = 0.03f;
if (event_data.has("rotation_threshold"))
{
@@ -360,13 +391,24 @@ void LLAgentListener::startAutoPilot(LLSD const & event_data)
stop_distance = (F32)event_data["stop_distance"].asReal();
}
+ std::string behavior_name = LLCoros::getName();
+ if (event_data.has("behavior_name"))
+ {
+ behavior_name = event_data["behavior_name"].asString();
+ }
+
// Clear follow target, this is doing a path
mFollowTarget.setNull();
+ auto finish_cb = [](bool success, void*)
+ {
+ LLEventPumps::instance().obtain("LLAutopilot").post(llsd::map("success", success));
+ };
+
mAgent.startAutoPilotGlobal(ll_vector3d_from_sd(event_data["target_global"]),
- event_data["behavior_name"],
+ behavior_name,
target_rotation,
- NULL, NULL,
+ finish_cb, NULL,
stop_distance,
rotation_threshold,
allow_flying);
@@ -374,7 +416,7 @@ void LLAgentListener::startAutoPilot(LLSD const & event_data)
void LLAgentListener::getAutoPilot(const LLSD& event_data) const
{
- LLSD reply = LLSD::emptyMap();
+ Response reply(LLSD(), event_data);
LLSD::Boolean enabled = mAgent.getAutoPilot();
reply["enabled"] = enabled;
@@ -403,12 +445,11 @@ void LLAgentListener::getAutoPilot(const LLSD& event_data) const
reply["rotation_threshold"] = mAgent.getAutoPilotRotationThreshold();
reply["behavior_name"] = mAgent.getAutoPilotBehaviorName();
reply["fly"] = (LLSD::Boolean) mAgent.getFlying();
-
- sendReply(reply, event_data);
}
void LLAgentListener::startFollowPilot(LLSD const & event_data)
{
+ Response response(LLSD(), event_data);
LLUUID target_id;
bool allow_flying = true;
@@ -442,6 +483,10 @@ void LLAgentListener::startFollowPilot(LLSD const & event_data)
}
}
}
+ else
+ {
+ return response.error("'leader_id' or 'avatar_name' should be specified");
+ }
F32 stop_distance = 0.f;
if (event_data.has("stop_distance"))
@@ -449,13 +494,16 @@ void LLAgentListener::startFollowPilot(LLSD const & event_data)
stop_distance = (F32)event_data["stop_distance"].asReal();
}
- if (target_id.notNull())
+ if (!gObjectList.findObject(target_id))
{
- mAgent.setFlying(allow_flying);
- mFollowTarget = target_id; // Save follow target so we can report distance later
-
- mAgent.startFollowPilot(target_id, allow_flying, stop_distance);
+ std::string target_info = event_data.has("leader_id") ? event_data["leader_id"] : event_data["avatar_name"];
+ return response.error(stringize("Target ", std::quoted(target_info), " was not found"));
}
+
+ mAgent.setFlying(allow_flying);
+ mFollowTarget = target_id; // Save follow target so we can report distance later
+
+ mAgent.startFollowPilot(target_id, allow_flying, stop_distance);
}
void LLAgentListener::setAutoPilotTarget(LLSD const & event_data) const
@@ -519,3 +567,129 @@ void LLAgentListener::getGroups(const LLSD& event) const
}
sendReply(LLSDMap("groups", reply), event);
}
+
+/*----------------------------- camera control -----------------------------*/
+// specialize LLSDParam to support (const LLVector3&) arguments -- this
+// wouldn't even be necessary except that the relevant LLVector3 constructor
+// is explicitly explicit
+template <>
+class LLSDParam<const LLVector3&>: public LLSDParamBase
+{
+public:
+ LLSDParam(const LLSD& value): value(LLVector3(value)) {}
+
+ operator const LLVector3&() const { return value; }
+
+private:
+ LLVector3 value;
+};
+
+// accept any of a number of similar LLFollowCamMgr methods with different
+// argument types, and return a wrapper lambda that accepts LLSD and converts
+// to the target argument type
+template <typename T>
+auto wrap(void (LLFollowCamMgr::*method)(const LLUUID& source, T arg))
+{
+ return [method](LLFollowCamMgr& followcam, const LLUUID& source, const LLSD& arg)
+ { (followcam.*method)(source, LLSDParam<T>(arg)); };
+}
+
+// table of supported LLFollowCamMgr methods,
+// with the corresponding setFollowCamParams() argument keys
+static std::pair<std::string, std::function<void(LLFollowCamMgr&, const LLUUID&, const LLSD&)>>
+cam_params[] =
+{
+ { "camera_pos", wrap(&LLFollowCamMgr::setPosition) },
+ { "focus_pos", wrap(&LLFollowCamMgr::setFocus) },
+ { "focus_offset", wrap(&LLFollowCamMgr::setFocusOffset) },
+ { "camera_locked", wrap(&LLFollowCamMgr::setPositionLocked) },
+ { "focus_locked", wrap(&LLFollowCamMgr::setFocusLocked) },
+ { "distance", wrap(&LLFollowCamMgr::setDistance) },
+ { "focus_threshold", wrap(&LLFollowCamMgr::setFocusThreshold) },
+ { "camera_threshold", wrap(&LLFollowCamMgr::setPositionThreshold) },
+ { "focus_lag", wrap(&LLFollowCamMgr::setFocusLag) },
+ { "camera_lag", wrap(&LLFollowCamMgr::setPositionLag) },
+ { "camera_pitch", wrap(&LLFollowCamMgr::setPitch) },
+ { "behindness_lag", wrap(&LLFollowCamMgr::setBehindnessLag) },
+ { "behindness_angle", wrap(&LLFollowCamMgr::setBehindnessAngle) },
+};
+
+void LLAgentListener::setFollowCamParams(const LLSD& event) const
+{
+ auto& followcam{ LLFollowCamMgr::instance() };
+ for (const auto& pair : cam_params)
+ {
+ if (event.has(pair.first))
+ {
+ pair.second(followcam, gAgentID, event[pair.first]);
+ }
+ }
+ followcam.setCameraActive(gAgentID, true);
+}
+
+void LLAgentListener::setFollowCamActive(LLSD const & event) const
+{
+ LLFollowCamMgr::getInstance()->setCameraActive(gAgentID, event["active"]);
+}
+
+void LLAgentListener::removeFollowCamParams(LLSD const & event) const
+{
+ LLFollowCamMgr::getInstance()->removeFollowCamParams(gAgentID);
+}
+
+LLViewerInventoryItem* get_anim_item(LLEventAPI::Response &response, const LLSD &event_data)
+{
+ LLViewerInventoryItem* item = gInventory.getItem(event_data["item_id"].asUUID());
+ if (!item || (item->getInventoryType() != LLInventoryType::IT_ANIMATION))
+ {
+ response.error(stringize("Animation item ", std::quoted(event_data["item_id"].asString()), " was not found"));
+ return NULL;
+ }
+ return item;
+}
+
+void LLAgentListener::playAnimation(LLSD const &event_data)
+{
+ Response response(LLSD(), event_data);
+ if (LLViewerInventoryItem* item = get_anim_item(response, event_data))
+ {
+ mPlayAnimThrottle(item->getAssetUUID(), event_data["inworld"].asBoolean());
+ }
+}
+
+void LLAgentListener::playAnimation_(const LLUUID& asset_id, const bool inworld)
+{
+ if (inworld)
+ {
+ mAgent.sendAnimationRequest(asset_id, ANIM_REQUEST_START);
+ }
+ else
+ {
+ gAgentAvatarp->startMotion(asset_id);
+ }
+}
+
+void LLAgentListener::stopAnimation(LLSD const &event_data)
+{
+ Response response(LLSD(), event_data);
+ if (LLViewerInventoryItem* item = get_anim_item(response, event_data))
+ {
+ gAgentAvatarp->stopMotion(item->getAssetUUID());
+ mAgent.sendAnimationRequest(item->getAssetUUID(), ANIM_REQUEST_STOP);
+ }
+}
+
+void LLAgentListener::getAnimationInfo(LLSD const &event_data)
+{
+ Response response(LLSD(), event_data);
+ if (LLViewerInventoryItem* item = get_anim_item(response, event_data))
+ {
+ // if motion exists, will return existing one
+ LLMotion* motion = gAgentAvatarp->createMotion(item->getAssetUUID());
+ response["anim_info"] = llsd::map("duration", motion->getDuration(),
+ "is_loop", motion->getLoop(),
+ "num_joints", motion->getNumJointMotions(),
+ "asset_id", item->getAssetUUID(),
+ "priority", motion->getPriority());
+ }
+}
diff --git a/indra/newview/llagentlistener.h b/indra/newview/llagentlistener.h
index c544d089ce..05724ff443 100644
--- a/indra/newview/llagentlistener.h
+++ b/indra/newview/llagentlistener.h
@@ -31,6 +31,7 @@
#define LL_LLAGENTLISTENER_H
#include "lleventapi.h"
+#include "throttle.h"
class LLAgent;
class LLSD;
@@ -48,7 +49,6 @@ private:
void requestStand(LLSD const & event_data) const;
void requestTouch(LLSD const & event_data) const;
void resetAxes(const LLSD& event_data) const;
- void getAxes(const LLSD& event_data) const;
void getGroups(const LLSD& event) const;
void getPosition(const LLSD& event_data) const;
void startAutoPilot(const LLSD& event_data);
@@ -58,11 +58,22 @@ private:
void stopAutoPilot(const LLSD& event_data) const;
void lookAt(LLSD const & event_data) const;
- LLViewerObject * findObjectClosestTo( const LLVector3 & position ) const;
+ void setFollowCamParams(LLSD const & event_data) const;
+ void setFollowCamActive(LLSD const & event_data) const;
+ void removeFollowCamParams(LLSD const & event_data) const;
+
+ void playAnimation(LLSD const &event_data);
+ void playAnimation_(const LLUUID& asset_id, const bool inworld);
+ void stopAnimation(LLSD const &event_data);
+ void getAnimationInfo(LLSD const &event_data);
+
+ LLViewerObject * findObjectClosestTo( const LLVector3 & position, bool sit_target = false ) const;
private:
LLAgent & mAgent;
LLUUID mFollowTarget;
+
+ LogThrottle<LLError::LEVEL_DEBUG, void(const LLUUID &, const bool)> mPlayAnimThrottle;
};
#endif // LL_LLAGENTLISTENER_H
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index ce4e8e9392..11c5ffecb6 100644
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -1385,8 +1385,6 @@ void AISUpdate::parseCategory(const LLSD& category_map, S32 depth)
&& curr_cat->getVersion() > LLViewerInventoryCategory::VERSION_UNKNOWN
&& version > curr_cat->getVersion())
{
- // Potentially should new_cat->setVersion(unknown) here,
- // but might be waiting for a callback that would increment
LL_DEBUGS("Inventory") << "Category " << category_id
<< " is stale. Known version: " << curr_cat->getVersion()
<< " server version: " << version << LL_ENDL;
diff --git a/indra/newview/llappearancelistener.cpp b/indra/newview/llappearancelistener.cpp
new file mode 100644
index 0000000000..0dab352311
--- /dev/null
+++ b/indra/newview/llappearancelistener.cpp
@@ -0,0 +1,146 @@
+/**
+ * @file llappearancelistener.cpp
+ *
+ * $LicenseInfo:firstyear=2024&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2024, 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 "llappearancelistener.h"
+
+#include "llappearancemgr.h"
+#include "llinventoryfunctions.h"
+#include "lltransutil.h"
+#include "llwearableitemslist.h"
+#include "stringize.h"
+
+LLAppearanceListener::LLAppearanceListener()
+ : LLEventAPI("LLAppearance",
+ "API to wear a specified outfit and wear/remove individual items")
+{
+ add("wearOutfit",
+ "Wear outfit by folder id: [\"folder_id\"] OR by folder name: [\"folder_name\"]\n"
+ "When [\"append\"] is true, outfit will be added to COF\n"
+ "otherwise it will replace current oufit",
+ &LLAppearanceListener::wearOutfit);
+
+ add("wearItems",
+ "Wear items by id: [items_id]",
+ &LLAppearanceListener::wearItems,
+ llsd::map("items_id", LLSD(), "replace", LLSD()));
+
+ add("detachItems",
+ "Detach items by id: [items_id]",
+ &LLAppearanceListener::detachItems,
+ llsd::map("items_id", LLSD()));
+
+ add("getOutfitsList",
+ "Return the table with Outfits info(id and name)",
+ &LLAppearanceListener::getOutfitsList);
+
+ add("getOutfitItems",
+ "Return the table of items with info(id : name, wearable_type, is_worn) inside specified outfit folder",
+ &LLAppearanceListener::getOutfitItems);
+}
+
+
+void LLAppearanceListener::wearOutfit(LLSD const &data)
+{
+ Response response(LLSD(), data);
+ if (!data.has("folder_id") && !data.has("folder_name"))
+ {
+ return response.error("Either [folder_id] or [folder_name] is required");
+ }
+
+ std::string error_msg;
+ bool result(false);
+ bool append = data.has("append") ? data["append"].asBoolean() : false;
+ if (data.has("folder_id"))
+ {
+ result = LLAppearanceMgr::instance().wearOutfit(data["folder_id"].asUUID(), error_msg, append);
+ }
+ else
+ {
+ result = LLAppearanceMgr::instance().wearOutfitByName(data["folder_name"].asString(), error_msg, append);
+ }
+
+ if (!result)
+ {
+ response.error(error_msg);
+ }
+}
+
+void LLAppearanceListener::wearItems(LLSD const &data)
+{
+ LLAppearanceMgr::instance().wearItemsOnAvatar(
+ LLSDParam<uuid_vec_t>(data["items_id"]),
+ true, data["replace"].asBoolean());
+}
+
+void LLAppearanceListener::detachItems(LLSD const &data)
+{
+ LLAppearanceMgr::instance().removeItemsFromAvatar(
+ LLSDParam<uuid_vec_t>(data["items_id"]));
+}
+
+void LLAppearanceListener::getOutfitsList(LLSD const &data)
+{
+ Response response(LLSD(), data);
+ const LLUUID outfits_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS);
+
+ LLInventoryModel::cat_array_t cat_array;
+ LLInventoryModel::item_array_t item_array;
+
+ LLIsType is_category(LLAssetType::AT_CATEGORY);
+ gInventory.collectDescendentsIf(outfits_id, cat_array, item_array, LLInventoryModel::EXCLUDE_TRASH, is_category);
+
+ response["outfits"] = llsd::toMap(cat_array,
+ [](const LLPointer<LLViewerInventoryCategory> &cat)
+ { return std::make_pair(cat->getUUID().asString(), cat->getName()); });
+}
+
+void LLAppearanceListener::getOutfitItems(LLSD const &data)
+{
+ Response response(LLSD(), data);
+ LLUUID outfit_id(data["outfit_id"].asUUID());
+ LLViewerInventoryCategory *cat = gInventory.getCategory(outfit_id);
+ if (!cat || cat->getPreferredType() != LLFolderType::FT_OUTFIT)
+ {
+ return response.error(stringize(LLTrans::getString("OutfitNotFound"), outfit_id.asString()));
+ }
+ LLInventoryModel::cat_array_t cat_array;
+ LLInventoryModel::item_array_t item_array;
+
+ LLFindOutfitItems collector = LLFindOutfitItems();
+ gInventory.collectDescendentsIf(outfit_id, cat_array, item_array, LLInventoryModel::EXCLUDE_TRASH, collector);
+
+ response["items"] = llsd::toMap(item_array,
+ [](const LLPointer<LLViewerInventoryItem> &it)
+ {
+ return std::make_pair(
+ it->getUUID().asString(),
+ llsd::map(
+ "name", it->getName(),
+ "wearable_type", LLWearableType::getInstance()->getTypeName(it->isWearableType() ? it->getWearableType() : LLWearableType::WT_NONE),
+ "is_worn", get_is_item_worn(it)));
+ });
+}
diff --git a/indra/newview/llappviewerlinux_api_dbus.h b/indra/newview/llappearancelistener.h
index 2f4492bd7a..04c5eac2eb 100644
--- a/indra/newview/llappviewerlinux_api_dbus.h
+++ b/indra/newview/llappearancelistener.h
@@ -1,10 +1,9 @@
/**
- * @file llappviewerlinux_api_dbus.h
- * @brief DBus-glib symbol handling
+ * @file llappearancelistener.h
*
- * $LicenseInfo:firstyear=2008&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2024&license=viewerlgpl$
* Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * Copyright (C) 2024, 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
@@ -24,21 +23,24 @@
* $/LicenseInfo$
*/
-#include "linden_common.h"
-#if LL_DBUS_ENABLED
+#ifndef LL_LLAPPEARANCELISTENER_H
+#define LL_LLAPPEARANCELISTENER_H
-extern "C" {
-#include <dbus/dbus-glib.h>
-}
+#include "lleventapi.h"
-#define DBUSGLIB_DYLIB_DEFAULT_NAME "libdbus-glib-1.so.2"
+class LLAppearanceListener : public LLEventAPI
+{
+public:
+ LLAppearanceListener();
-bool grab_dbus_syms(std::string dbus_dso_name);
-void ungrab_dbus_syms();
+private:
+ void wearOutfit(LLSD const &data);
+ void wearItems(LLSD const &data);
+ void detachItems(LLSD const &data);
+ void getOutfitsList(LLSD const &data);
+ void getOutfitItems(LLSD const &data);
+};
-#define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) extern RTN (*ll##DBUSSYM)(__VA_ARGS__)
-#include "llappviewerlinux_api_dbus_syms_raw.inc"
-#undef LL_DBUS_SYM
+#endif // LL_LLAPPEARANCELISTENER_H
-#endif // LL_DBUS_ENABLED
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 946d674e8b..2877bb7c49 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -31,6 +31,7 @@
#include "llagent.h"
#include "llagentcamera.h"
#include "llagentwearables.h"
+#include "llappearancelistener.h"
#include "llappearancemgr.h"
#include "llattachmentsmgr.h"
#include "llcommandhandler.h"
@@ -48,6 +49,7 @@
#include "lloutfitslist.h"
#include "llselectmgr.h"
#include "llsidepanelappearance.h"
+#include "lltransutil.h"
#include "llviewerobjectlist.h"
#include "llvoavatar.h"
#include "llvoavatarself.h"
@@ -66,6 +68,8 @@
#include "llavatarpropertiesprocessor.h"
+LLAppearanceListener sAppearanceListener;
+
namespace
{
const S32 BAKE_RETRY_MAX_COUNT = 5;
@@ -113,26 +117,16 @@ public:
LLOutfitUnLockTimer(F32 period) : LLEventTimer(period)
{
// restart timer on BOF changed event
- LLOutfitObserver::instance().addBOFChangedCallback(boost::bind(
- &LLOutfitUnLockTimer::reset, this));
+ LLOutfitObserver::instance().addBOFChangedCallback([this]{ start(); });
stop();
}
- /*virtual*/
- bool tick()
+ bool tick() override
{
- if(mEventTimer.hasExpired())
- {
- LLAppearanceMgr::instance().setOutfitLocked(false);
- }
+ LLAppearanceMgr::instance().setOutfitLocked(false);
return false;
}
- void stop() { mEventTimer.stop(); }
- void start() { mEventTimer.start(); }
- void reset() { mEventTimer.reset(); }
- bool getStarted() { return mEventTimer.getStarted(); }
-
- LLTimer& getEventTimer() { return mEventTimer;}
+ bool getStarted() { return isRunning(); }
};
// support for secondlife:///app/appearance SLapps
@@ -327,7 +321,7 @@ public:
// virtual
// Will be deleted after returning true - only safe to do this if all callbacks have fired.
- bool tick()
+ bool tick() override
{
// mPendingRequests will be zero if all requests have been
// responded to. mWaitTimes.empty() will be true if we have
@@ -620,8 +614,8 @@ void LLBrokenLinkObserver::changed(U32 mask)
if (id == mUUID)
{
// Might not be processed yet and it is not a
- // good idea to update appearane here, postpone.
- doOnIdleOneTime([this]()
+ // good idea to update appearance here, postpone.
+ doOnIdleOneTime([this]
{
postProcess();
});
@@ -1707,7 +1701,6 @@ void LLAppearanceMgr::setOutfitLocked(bool locked)
mOutfitLocked = locked;
if (locked)
{
- mUnlockOutfitTimer->reset();
mUnlockOutfitTimer->start();
}
else
@@ -2906,8 +2899,18 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego
LLAppearanceMgr::changeOutfit(true, category->getUUID(), append);
}
-// FIXME do we really want to search entire inventory for matching name?
-void LLAppearanceMgr::wearOutfitByName(const std::string& name)
+bool LLAppearanceMgr::wearOutfitByName(const std::string& name, bool append)
+{
+ std::string error_msg;
+ if(!wearOutfitByName(name, error_msg, append))
+ {
+ LL_WARNS() << error_msg << LL_ENDL;
+ return false;
+ }
+ return true;
+}
+
+bool LLAppearanceMgr::wearOutfitByName(const std::string& name, std::string& error_msg, bool append)
{
LL_INFOS("Avatar") << self_av_string() << "Wearing category " << name << LL_ENDL;
@@ -2940,15 +2943,38 @@ void LLAppearanceMgr::wearOutfitByName(const std::string& name)
}
}
- if(cat)
+ return wearOutfit(stringize(std::quoted(name)), cat, error_msg, copy_items, append);
+}
+
+bool LLAppearanceMgr::wearOutfit(const LLUUID &cat_id, std::string &error_msg, bool append)
+{
+ LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);
+ return wearOutfit(stringize(cat_id), cat, error_msg, false, append);
+}
+
+bool LLAppearanceMgr::wearOutfit(const std::string &desc, LLInventoryCategory* cat,
+ std::string &error_msg, bool copy_items, bool append)
+{
+ if (!cat)
+ {
+ error_msg = stringize(LLTrans::getString("OutfitNotFound"), desc);
+ return false;
+ }
+ // don't allow wearing a system folder
+ if (LLFolderType::lookupIsProtectedType(cat->getPreferredType()))
{
- LLAppearanceMgr::wearInventoryCategory(cat, copy_items, false);
+ error_msg = stringize(LLTrans::getString("SystemFolderNotWorn"), std::quoted(cat->getName()));
+ return false;
}
- else
+ bool can_wear = append ? getCanAddToCOF(cat->getUUID()) : getCanReplaceCOF(cat->getUUID());
+ if (!can_wear)
{
- LL_WARNS() << "Couldn't find outfit " <<name<< " in wearOutfitByName()"
- << LL_ENDL;
+ std::string msg = append ? LLTrans::getString("OutfitNotAdded") : LLTrans::getString("OutfitNotReplaced");
+ error_msg = stringize(msg, std::quoted(cat->getName()), " , id: ", cat->getUUID());
+ return false;
}
+ wearInventoryCategory(cat, copy_items, append);
+ return true;
}
bool areMatchingWearables(const LLViewerInventoryItem *a, const LLViewerInventoryItem *b)
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 6c45a32856..9e624f593f 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -59,7 +59,9 @@ public:
void wearInventoryCategory(LLInventoryCategory* category, bool copy, bool append);
void wearInventoryCategoryOnAvatar(LLInventoryCategory* category, bool append);
void wearCategoryFinal(const LLUUID& cat_id, bool copy_items, bool append);
- void wearOutfitByName(const std::string& name);
+ bool wearOutfit(const LLUUID &cat_id, std::string &error_msg, bool append = false);
+ bool wearOutfitByName(const std::string &name, std::string &error_msg, bool append = false);
+ bool wearOutfitByName(const std::string &name, bool append = false);
void changeOutfit(bool proceed, const LLUUID& category, bool append);
void replaceCurrentOutfit(const LLUUID& new_outfit);
void renameOutfit(const LLUUID& outfit_id);
@@ -261,6 +263,10 @@ private:
static void onOutfitRename(const LLSD& notification, const LLSD& response);
+ // used by both wearOutfit(LLUUID) and wearOutfitByName(std::string)
+ bool wearOutfit(const std::string &desc, LLInventoryCategory* cat,
+ std::string &error_msg, bool copy_items, bool append);
+
bool mAttachmentInvLinkEnabled;
bool mOutfitIsDirty;
bool mIsInUpdateAppearanceFromCOF; // to detect recursive calls.
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 3c748b7b06..291d549f28 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -29,6 +29,7 @@
#include "llappviewer.h"
// Viewer includes
+#include "coro_scheduler.h"
#include "llversioninfo.h"
#include "llfeaturemanager.h"
#include "lluictrlfactory.h"
@@ -60,6 +61,7 @@
#include "llslurl.h"
#include "llstartup.h"
#include "llfocusmgr.h"
+#include "llluamanager.h"
#include "llurlfloaterdispatchhandler.h"
#include "llviewerjoystick.h"
#include "llcalc.h"
@@ -111,10 +113,12 @@
#include "llgltfmateriallist.h"
// Linden library includes
+#include "fsyspath.h"
#include "llavatarnamecache.h"
#include "lldiriterator.h"
#include "llexperiencecache.h"
#include "llimagej2c.h"
+#include "llluamanager.h"
#include "llmemory.h"
#include "llprimitive.h"
#include "llurlaction.h"
@@ -180,7 +184,6 @@
#include "lltracker.h"
#include "llviewerparcelmgr.h"
#include "llworldmapview.h"
-#include "llpostprocess.h"
#include "lldebugview.h"
#include "llconsole.h"
@@ -384,6 +387,9 @@ static std::string gLaunchFileOnQuit;
// Used on Win32 for other apps to identify our window (eg, win_setup)
const char* const VIEWER_WINDOW_CLASSNAME = "Second Life";
+void processComposeSwitch(const std::string&, const std::string&,
+ const std::function<void(const LLSD&)>&);
+
//----------------------------------------------------------------------------
// List of entries from strings.xml to always replace
@@ -759,6 +765,8 @@ bool LLAppViewer::init()
//set the max heap size.
initMaxHeapSize() ;
LLCoros::instance().setStackSize(gSavedSettings.getS32("CoroutineStackSize"));
+ // Use our custom scheduler for coroutine scheduling.
+ llcoro::scheduler::use();
// Although initLoggingAndGetLastDuration() is the right place to mess with
// setFatalFunction(), we can't query gSavedSettings until after
@@ -1141,7 +1149,7 @@ bool LLAppViewer::init()
gGLActive = false;
-#if LL_RELEASE_FOR_DOWNLOAD
+#if LL_RELEASE_FOR_DOWNLOAD && !LL_LINUX
// Skip updater if this is a non-interactive instance
if (!gSavedSettings.getBOOL("CmdLineSkipUpdater") && !gNonInteractive)
{
@@ -1204,22 +1212,10 @@ bool LLAppViewer::init()
}
#endif //LL_RELEASE_FOR_DOWNLOAD
- {
- // Iterate over --leap command-line options. But this is a bit tricky: if
- // there's only one, it won't be an array at all.
- LLSD LeapCommand(gSavedSettings.getLLSD("LeapCommand"));
- LL_DEBUGS("InitInfo") << "LeapCommand: " << LeapCommand << LL_ENDL;
- if (LeapCommand.isDefined() && !LeapCommand.isArray())
- {
- // If LeapCommand is actually a scalar value, make an array of it.
- // Have to do it in two steps because LeapCommand.append(LeapCommand)
- // trashes content! :-P
- LLSD item(LeapCommand);
- LeapCommand.append(item);
- }
- for (const auto& leap : llsd::inArray(LeapCommand))
+ processComposeSwitch(
+ "--leap", "LeapCommand",
+ [](const LLSD& leap)
{
- LL_INFOS("InitInfo") << "processing --leap \"" << leap << '"' << LL_ENDL;
// We don't have any better description of this plugin than the
// user-specified command line. Passing "" causes LLLeap to derive a
// description from the command line itself.
@@ -1227,8 +1223,40 @@ bool LLAppViewer::init()
// don't consider any one --leap command mission-critical, so if one
// fails, log it, shrug and carry on.
LLLeap::create("", leap, false); // exception=false
- }
- }
+ });
+ processComposeSwitch(
+ "--lua", "LuaChunk",
+ [](const LLSD& chunk)
+ {
+ // no completion callback: we don't need to know
+ LLLUAmanager::runScriptLine(chunk);
+ });
+ processComposeSwitch(
+ "--luafile", "LuaScript",
+ [](const LLSD& script)
+ {
+ // no completion callback: we don't need to know
+ LLLUAmanager::runScriptFile(script);
+ });
+ processComposeSwitch(
+ "LuaAutorunPath", "LuaAutorunPath",
+ [](const LLSD& directory)
+ {
+ // each directory can be relative to the viewer's install
+ // directory -- if directory is already absolute, operator/()
+ // preserves it
+ fsyspath abspath(fsyspath(gDirUtilp->getAppRODataDir()) /
+ fsyspath(directory.asString()));
+ std::string absdir(fsyspath(abspath).string());
+ LL_DEBUGS("InitInfo") << "LuaAutorunPath: " << absdir << LL_ENDL;
+ LLDirIterator scripts(absdir, "*.lua");
+ std::string script;
+ while (scripts.next(script))
+ {
+ LL_DEBUGS("InitInfo") << "LuaAutorunPath: " << absdir << ": " << script << LL_ENDL;
+ LLLUAmanager::runScriptFile(fsyspath(abspath / fsyspath(script)).string(), true);
+ }
+ });
if (gSavedSettings.getBOOL("QAMode") && gSavedSettings.getS32("QAModeEventHostPort") > 0)
{
@@ -1304,6 +1332,27 @@ bool LLAppViewer::init()
return true;
}
+void processComposeSwitch(const std::string& option,
+ const std::string& setting,
+ const std::function<void(const LLSD&)>& action)
+{
+ // Iterate over 'option' command-line options. But this is a bit tricky:
+ // if there's only one, it won't be an array at all.
+ LLSD args(gSavedSettings.getLLSD(setting));
+ LL_DEBUGS("InitInfo") << option << ": " << args << LL_ENDL;
+ if (args.isDefined() && ! args.isArray())
+ {
+ // If args is actually a scalar value, make an array of it. Have to do
+ // it in two steps because args.append(args) trashes content! :-P
+ args.append(LLSD(args));
+ }
+ for (const auto& arg : llsd::inArray(args))
+ {
+ LL_INFOS("InitInfo") << "processing " << option << ' ' << arg << LL_ENDL;
+ action(arg);
+ }
+}
+
void LLAppViewer::initMaxHeapSize()
{
//set the max heap size.
@@ -1929,8 +1978,6 @@ bool LLAppViewer::cleanup()
SUBSYSTEM_CLEANUP(LLAvatarAppearance);
- SUBSYSTEM_CLEANUP(LLPostProcess);
-
LLTracker::cleanupInstance();
// *FIX: This is handled in LLAppViewerWin32::cleanup().
@@ -2379,6 +2426,14 @@ void LLAppViewer::initLoggingAndGetLastDuration()
{
LL_WARNS("MarkerFile") << duration_log_msg << LL_ENDL;
}
+
+ std::string user_data_path_cef_log = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "cef.log");
+ if (gDirUtilp->fileExists(user_data_path_cef_log))
+ {
+ std::string user_data_path_cef_old = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "cef.old");
+ LLFile::remove(user_data_path_cef_old, ENOENT);
+ LLFile::rename(user_data_path_cef_log, user_data_path_cef_old);
+ }
}
}
@@ -3005,9 +3060,10 @@ void LLAppViewer::initStrings()
std::string strings_path_full = gDirUtilp->findSkinnedFilenameBaseLang(LLDir::XUI, strings_file);
if (strings_path_full.empty() || !LLFile::isfile(strings_path_full))
{
+ std::string crash_reason;
if (strings_path_full.empty())
{
- LL_WARNS() << "The file '" << strings_file << "' is not found" << LL_ENDL;
+ crash_reason = "The file '" + strings_file + "' is not found";
}
else
{
@@ -3015,24 +3071,23 @@ void LLAppViewer::initStrings()
int rc = LLFile::stat(strings_path_full, &st);
if (rc != 0)
{
- LL_WARNS() << "The file '" << strings_path_full << "' failed to get status. Error code: " << rc << LL_ENDL;
+ crash_reason = "The file '" + strings_path_full + "' failed to get status. Error code: " + std::to_string(rc);
}
else if (S_ISDIR(st.st_mode))
{
- LL_WARNS() << "The filename '" << strings_path_full << "' is a directory name" << LL_ENDL;
+ crash_reason = "The filename '" + strings_path_full + "' is a directory name";
}
else
{
- LL_WARNS() << "The filename '" << strings_path_full << "' doesn't seem to be a regular file name" << LL_ENDL;
+ crash_reason = "The filename '" + strings_path_full + "' doesn't seem to be a regular file name";
}
}
// initial check to make sure files are there failed
gDirUtilp->dumpCurrentDirectories(LLError::LEVEL_WARN);
LLError::LLUserWarningMsg::showMissingFiles();
- LL_ERRS() << "Viewer failed to find localization and UI files."
- << " Please reinstall viewer from https://secondlife.com/support/downloads"
- << " and contact https://support.secondlife.com if issue persists after reinstall." << LL_ENDL;
+ LL_ERRS() << "Viewer failed to open some of localization and UI files."
+ << " " << crash_reason << "." << LL_ENDL;
}
LLTransUtil::parseStrings(strings_file, default_trans_args);
LLTransUtil::parseLanguageStrings("language_settings.xml");
@@ -3292,10 +3347,10 @@ LLSD LLAppViewer::getViewerInfo() const
LLVector3d pos = gAgent.getPositionGlobal();
info["POSITION"] = ll_sd_from_vector3d(pos);
info["POSITION_LOCAL"] = ll_sd_from_vector3(gAgent.getPosAgentFromGlobal(pos));
- info["REGION"] = gAgent.getRegion()->getName();
+ info["REGION"] = region->getName();
boost::regex regex("\\.(secondlife|lindenlab)\\..*");
- info["HOSTNAME"] = boost::regex_replace(gAgent.getRegion()->getSimHostName(), regex, "");
+ info["HOSTNAME"] = boost::regex_replace(region->getSimHostName(), regex, "");
info["SERVER_VERSION"] = gLastVersionChannel;
LLSLURL slurl;
LLAgentUI::buildSLURL(slurl);
@@ -4613,7 +4668,6 @@ void LLAppViewer::idle()
LLFrameTimer::updateFrameTime();
LLFrameTimer::updateFrameCount();
- LLEventTimer::updateClass();
LLPerfStats::updateClass();
// LLApp::stepFrame() performs the above three calls plus mRunner.run().
@@ -5549,9 +5603,9 @@ void LLAppViewer::forceErrorThreadCrash()
thread->start();
}
-void LLAppViewer::initMainloopTimeout(const std::string& state, F32 secs)
+void LLAppViewer::initMainloopTimeout(std::string_view state, F32 secs)
{
- if(!mMainloopTimeout)
+ if (!mMainloopTimeout)
{
mMainloopTimeout = new LLWatchdogTimeout();
resumeMainloopTimeout(state, secs);
@@ -5560,20 +5614,20 @@ void LLAppViewer::initMainloopTimeout(const std::string& state, F32 secs)
void LLAppViewer::destroyMainloopTimeout()
{
- if(mMainloopTimeout)
+ if (mMainloopTimeout)
{
delete mMainloopTimeout;
- mMainloopTimeout = NULL;
+ mMainloopTimeout = nullptr;
}
}
-void LLAppViewer::resumeMainloopTimeout(const std::string& state, F32 secs)
+void LLAppViewer::resumeMainloopTimeout(std::string_view state, F32 secs)
{
- if(mMainloopTimeout)
+ if (mMainloopTimeout)
{
- if(secs < 0.0f)
+ if (secs < 0.0f)
{
- static LLCachedControl<F32> mainloop_timeout(gSavedSettings, "MainloopTimeoutDefault", 60);
+ static LLCachedControl<F32> mainloop_timeout(gSavedSettings, "MainloopTimeoutDefault", 60.f);
secs = mainloop_timeout;
}
@@ -5584,19 +5638,19 @@ void LLAppViewer::resumeMainloopTimeout(const std::string& state, F32 secs)
void LLAppViewer::pauseMainloopTimeout()
{
- if(mMainloopTimeout)
+ if (mMainloopTimeout)
{
mMainloopTimeout->stop();
}
}
-void LLAppViewer::pingMainloopTimeout(const std::string& state, F32 secs)
+void LLAppViewer::pingMainloopTimeout(std::string_view state, F32 secs)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_APP;
- if(mMainloopTimeout)
+ if (mMainloopTimeout)
{
- if(secs < 0.0f)
+ if (secs < 0.0f)
{
static LLCachedControl<F32> mainloop_timeout(gSavedSettings, "MainloopTimeoutDefault", 60);
secs = mainloop_timeout;
@@ -5723,4 +5777,3 @@ void LLAppViewer::metricsSend(bool enable_reporting)
// resolution in time.
gViewerAssetStats->restart();
}
-
diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h
index 4ce4259ed8..6e02869fba 100644
--- a/indra/newview/llappviewer.h
+++ b/indra/newview/llappviewer.h
@@ -183,11 +183,11 @@ public:
// For thread debugging.
// llstartup needs to control init.
// llworld, send_agent_pause() also controls pause/resume.
- void initMainloopTimeout(const std::string& state, F32 secs = -1.0f);
+ void initMainloopTimeout(std::string_view state, F32 secs = -1.0f);
void destroyMainloopTimeout();
void pauseMainloopTimeout();
- void resumeMainloopTimeout(const std::string& state = "", F32 secs = -1.0f);
- void pingMainloopTimeout(const std::string& state, F32 secs = -1.0f);
+ void resumeMainloopTimeout(std::string_view state = "", F32 secs = -1.0f);
+ void pingMainloopTimeout(std::string_view state, F32 secs = -1.0f);
// Handle the 'login completed' event.
// *NOTE:Mani Fix this for login abstraction!!
diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp
index 1709970156..38f2f1ae7f 100644
--- a/indra/newview/llappviewerlinux.cpp
+++ b/indra/newview/llappviewerlinux.cpp
@@ -40,17 +40,56 @@
#include <exception>
-#if LL_DBUS_ENABLED
-# include "llappviewerlinux_api_dbus.h"
-
-// regrettable hacks to give us better runtime compatibility with older systems inside llappviewerlinux_api.h:
-#define llg_return_if_fail(COND) do{if (!(COND)) return;}while(0)
-#undef g_return_if_fail
-#define g_return_if_fail(COND) llg_return_if_fail(COND)
-// The generated API
-# include "llappviewerlinux_api.h"
+#include <gio/gio.h>
+#include <resolv.h>
+
+#if (__GLIBC__*1000 + __GLIBC_MINOR__) >= 2034
+extern "C"
+{
+ int __res_nquery(res_state statep,
+ const char *dname, int qclass, int type,
+ unsigned char *answer, int anslen)
+ {
+ return res_nquery( statep, dname, qclass, type, answer, anslen );
+ }
+
+ int __dn_expand(const unsigned char *msg,
+ const unsigned char *eomorig,
+ const unsigned char *comp_dn, char *exp_dn,
+ int length)
+ {
+ return dn_expand( msg,eomorig,comp_dn,exp_dn,length);
+ }
+}
#endif
+#if LL_SEND_CRASH_REPORTS
+#include "breakpad/client/linux/handler/exception_handler.h"
+#include "breakpad/common/linux/http_upload.h"
+#include "lldir.h"
+#include "../llcrashlogger/llcrashlogger.h"
+#include "boost/json.hpp"
+#endif
+
+#define VIEWERAPI_SERVICE "com.secondlife.ViewerAppAPIService"
+#define VIEWERAPI_PATH "/com/secondlife/ViewerAppAPI"
+#define VIEWERAPI_INTERFACE "com.secondlife.ViewerAppAPI"
+
+static const char * DBUS_SERVER = "<node name=\"/com/secondlife/ViewerAppAPI\">\n"
+ " <interface name=\"com.secondlife.ViewerAppAPI\">\n"
+ " <annotation name=\"org.freedesktop.DBus.GLib.CSymbol\" value=\"viewer_app_api\"/>\n"
+ " <method name=\"GoSLURL\">\n"
+ " <annotation name=\"org.freedesktop.DBus.GLib.CSymbol\" value=\"dispatchSLURL\"/>\n"
+ " <arg type=\"s\" name=\"slurl\" direction=\"in\" />\n"
+ " </method>\n"
+ " </interface>\n"
+ "</node>";
+
+typedef struct
+{
+ GObject parent;
+} ViewerAppAPI;
+
namespace
{
int gArgC = 0;
@@ -81,6 +120,8 @@ int main( int argc, char **argv )
// install unexpected exception handler
gOldTerminateHandler = std::set_terminate(exceptionTerminateHandler);
+ unsetenv( "LD_PRELOAD" ); // <FS:ND/> Get rid of any preloading, we do not want this to happen during startup of plugins.
+
bool ok = viewer_app_ptr->init();
if(!ok)
{
@@ -114,21 +155,76 @@ LLAppViewerLinux::~LLAppViewerLinux()
{
}
-bool LLAppViewerLinux::init()
+#if LL_SEND_CRASH_REPORTS
+std::string gCrashLogger;
+std::string gVersion;
+std::string gBugsplatDB;
+std::string gCrashBehavior;
+
+static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* context, bool succeeded)
{
- // g_thread_init() must be called before *any* use of glib, *and*
- // before any mutexes are held, *and* some of our third-party
- // libraries likes to use glib functions; in short, do this here
- // really early in app startup!
- if (!g_thread_supported ()) g_thread_init (NULL);
+ if( fork() == 0 )
+ execl( gCrashLogger.c_str(), gCrashLogger.c_str(), descriptor.path(), gVersion.c_str(), gBugsplatDB.c_str(), gCrashBehavior.c_str(), nullptr );
+ return succeeded;
+}
+void setupBreadpad()
+{
+ std::string build_data_fname(gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "build_data.json"));
+ gCrashLogger = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "linux-crash-logger.bin");
+
+ llifstream inf(build_data_fname.c_str());
+ if(!inf.is_open())
+ {
+ LL_WARNS("BUGSPLAT") << "Can't initialize BugSplat, can't read '" << build_data_fname << "'" << LL_ENDL;
+ return;
+ }
+
+ boost::json::error_code ec;
+ boost::json::value build_data = boost::json::parse(inf, ec);
+ if(ec.failed())
+ {
+ LL_WARNS("BUGSPLAT") << "Can't initialize BugSplat, can't parse '" << build_data_fname << "': "
+ << ec.what() << LL_ENDL;
+ return;
+ }
+
+ if (!build_data.is_object() || !build_data.as_object().contains("BugSplat DB"))
+ {
+ LL_WARNS("BUGSPLAT") << "Can't initialize BugSplat, no 'BugSplat DB' entry in '" << build_data_fname
+ << "'" << LL_ENDL;
+ return;
+ }
+
+ gVersion = STRINGIZE(
+ LL_VIEWER_VERSION_MAJOR << '.' << LL_VIEWER_VERSION_MINOR << '.' << LL_VIEWER_VERSION_PATCH
+ << '.' << LL_VIEWER_VERSION_BUILD);
+
+ boost::json::value BugSplat_DB = build_data.at("BugSplat DB");
+ gBugsplatDB = boost::json::value_to<std::string>(BugSplat_DB);
+
+ LL_INFOS("BUGSPLAT") << "Initializing with crash logger: " << gCrashLogger << " database: " << gBugsplatDB << " version: " << gVersion << LL_ENDL;
+
+ google_breakpad::MinidumpDescriptor *descriptor = new google_breakpad::MinidumpDescriptor(gDirUtilp->getExpandedFilename(LL_PATH_DUMP, ""));
+ google_breakpad::ExceptionHandler *eh = new google_breakpad::ExceptionHandler(*descriptor, NULL, dumpCallback, NULL, true, -1);
+}
+#endif
+
+bool LLAppViewerLinux::init()
+{
bool success = LLAppViewer::init();
#if LL_SEND_CRASH_REPORTS
- if (success)
+ S32 nCrashSubmitBehavior = gCrashSettings.getS32("CrashSubmitBehavior");
+
+ // For the first version we just consider always send and create a nice dialog for CRASH_BEHAVIOR_ASK later.
+ if (success && nCrashSubmitBehavior != CRASH_BEHAVIOR_NEVER_SEND )
{
- LLAppViewer* pApp = LLAppViewer::instance();
- pApp->initCrashReporting();
+ if( nCrashSubmitBehavior == CRASH_BEHAVIOR_ASK )
+ gCrashBehavior = "ask";
+ else
+ gCrashBehavior = "send";
+ setupBreadpad();
}
#endif
@@ -143,7 +239,7 @@ bool LLAppViewerLinux::restoreErrorTrap()
}
/////////////////////////////////////////
-#if LL_DBUS_ENABLED
+#if LL_GLIB
typedef struct
{
@@ -153,101 +249,77 @@ typedef struct
static void viewerappapi_init(ViewerAppAPI *server);
static void viewerappapi_class_init(ViewerAppAPIClass *klass);
-///
-
-// regrettable hacks to give us better runtime compatibility with older systems in general
-static GType llg_type_register_static_simple_ONCE(GType parent_type,
- const gchar *type_name,
- guint class_size,
- GClassInitFunc class_init,
- guint instance_size,
- GInstanceInitFunc instance_init,
- GTypeFlags flags)
-{
- static GTypeInfo type_info;
- memset(&type_info, 0, sizeof(type_info));
-
- type_info.class_size = class_size;
- type_info.class_init = class_init;
- type_info.instance_size = instance_size;
- type_info.instance_init = instance_init;
-
- return g_type_register_static(parent_type, type_name, &type_info, flags);
-}
-#define llg_intern_static_string(S) (S)
-#define g_intern_static_string(S) llg_intern_static_string(S)
-#define g_type_register_static_simple(parent_type, type_name, class_size, class_init, instance_size, instance_init, flags) llg_type_register_static_simple_ONCE(parent_type, type_name, class_size, class_init, instance_size, instance_init, flags)
-
G_DEFINE_TYPE(ViewerAppAPI, viewerappapi, G_TYPE_OBJECT);
void viewerappapi_class_init(ViewerAppAPIClass *klass)
{
}
-static bool dbus_server_init = false;
-
-void viewerappapi_init(ViewerAppAPI *server)
+static void dispatchSLURL(gchar const *slurl)
{
- // Connect to the default DBUS, register our service/API.
-
- if (!dbus_server_init)
- {
- GError *error = NULL;
-
- server->connection = lldbus_g_bus_get(DBUS_BUS_SESSION, &error);
- if (server->connection)
- {
- lldbus_g_object_type_install_info(viewerappapi_get_type(), &dbus_glib_viewerapp_object_info);
+ LL_INFOS() << "Was asked to go to slurl: " << slurl << LL_ENDL;
- lldbus_g_connection_register_g_object(server->connection, VIEWERAPI_PATH, G_OBJECT(server));
+ std::string url = slurl;
+ LLMediaCtrl* web = NULL;
+ const bool trusted_browser = false;
+ LLURLDispatcher::dispatch(url, "", web, trusted_browser);
+}
- DBusGProxy *serverproxy = lldbus_g_proxy_new_for_name(server->connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
+static void DoMethodeCall (GDBusConnection *connection,
+ const gchar *sender,
+ const gchar *object_path,
+ const gchar *interface_name,
+ const gchar *method_name,
+ GVariant *parameters,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ LL_INFOS() << "DBUS message " << method_name << " from: " << sender << " interface: " << interface_name << LL_ENDL;
+ const gchar *slurl;
- guint request_name_ret_unused;
- // akin to org_freedesktop_DBus_request_name
- if (lldbus_g_proxy_call(serverproxy, "RequestName", &error, G_TYPE_STRING, VIEWERAPI_SERVICE, G_TYPE_UINT, 0, G_TYPE_INVALID, G_TYPE_UINT, &request_name_ret_unused, G_TYPE_INVALID))
- {
- // total success.
- dbus_server_init = true;
- }
- else
- {
- LL_WARNS() << "Unable to register service name: " << error->message << LL_ENDL;
- }
+ g_variant_get (parameters, "(&s)", &slurl);
+ dispatchSLURL(slurl);
+}
- g_object_unref(serverproxy);
- }
- else
+GDBusNodeInfo *gBusNodeInfo = nullptr;
+static const GDBusInterfaceVTable interface_vtable =
{
- g_warning("Unable to connect to dbus: %s", error->message);
- }
-
- if (error)
- g_error_free(error);
- }
+ DoMethodeCall
+ };
+static void busAcquired(GDBusConnection *connection, const gchar *name, gpointer user_data)
+{
+ auto id = g_dbus_connection_register_object(connection,
+ VIEWERAPI_PATH,
+ gBusNodeInfo->interfaces[0],
+ &interface_vtable,
+ NULL, /* user_data */
+ NULL, /* user_data_free_func */
+ NULL); /* GError** */
+ g_assert (id > 0);
}
-gboolean viewer_app_api_GoSLURL(ViewerAppAPI *obj, gchar *slurl, gboolean **success_rtn, GError **error)
+static void nameAcquired(GDBusConnection *connection, const gchar *name, gpointer user_data)
{
- bool success = false;
-
- LL_INFOS() << "Was asked to go to slurl: " << slurl << LL_ENDL;
+}
- std::string url = slurl;
- LLMediaCtrl* web = NULL;
- const bool trusted_browser = false;
- if (LLURLDispatcher::dispatch(url, "", web, trusted_browser))
- {
- // bring window to foreground, as it has just been "launched" from a URL
- // todo: hmm, how to get there from here?
- //xxx->mWindow->bringToFront();
- success = true;
- }
+static void nameLost(GDBusConnection *connection, const gchar *name, gpointer user_data)
+{
- *success_rtn = g_new (gboolean, 1);
- (*success_rtn)[0] = (gboolean)success;
+}
+void viewerappapi_init(ViewerAppAPI *server)
+{
+ gBusNodeInfo = g_dbus_node_info_new_for_xml (DBUS_SERVER, NULL);
+ g_assert (gBusNodeInfo != NULL);
+
+ g_bus_own_name(G_BUS_TYPE_SESSION,
+ VIEWERAPI_SERVICE,
+ G_BUS_NAME_OWNER_FLAGS_NONE,
+ busAcquired,
+ nameAcquired,
+ nameLost,
+ NULL,
+ NULL);
- return TRUE; // the invokation succeeded, even if the actual dispatch didn't.
}
///
@@ -255,13 +327,6 @@ gboolean viewer_app_api_GoSLURL(ViewerAppAPI *obj, gchar *slurl, gboolean **succ
//virtual
bool LLAppViewerLinux::initSLURLHandler()
{
- if (!grab_dbus_syms(DBUSGLIB_DYLIB_DEFAULT_NAME))
- {
- return false; // failed
- }
-
- g_type_init();
-
//ViewerAppAPI *api_server = (ViewerAppAPI*)
g_object_new(viewerappapi_get_type(), NULL);
@@ -271,49 +336,49 @@ bool LLAppViewerLinux::initSLURLHandler()
//virtual
bool LLAppViewerLinux::sendURLToOtherInstance(const std::string& url)
{
- if (!grab_dbus_syms(DBUSGLIB_DYLIB_DEFAULT_NAME))
+ auto *pBus = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, nullptr);
+
+ if( !pBus )
{
- return false; // failed
+ LL_WARNS() << "Getting dbus failed." << LL_ENDL;
+ return false;
}
- bool success = false;
- DBusGConnection *bus;
- GError *error = NULL;
-
- g_type_init();
+ auto pProxy = g_dbus_proxy_new_sync(pBus, G_DBUS_PROXY_FLAGS_NONE, nullptr,
+ VIEWERAPI_SERVICE, VIEWERAPI_PATH,
+ VIEWERAPI_INTERFACE, nullptr, nullptr);
- bus = lldbus_g_bus_get (DBUS_BUS_SESSION, &error);
- if (bus)
+ if( !pProxy )
{
- gboolean rtn = FALSE;
- DBusGProxy *remote_object =
- lldbus_g_proxy_new_for_name(bus, VIEWERAPI_SERVICE, VIEWERAPI_PATH, VIEWERAPI_INTERFACE);
-
- if (lldbus_g_proxy_call(remote_object, "GoSLURL", &error,
- G_TYPE_STRING, url.c_str(), G_TYPE_INVALID,
- G_TYPE_BOOLEAN, &rtn, G_TYPE_INVALID))
- {
- success = rtn;
- }
- else
- {
- LL_INFOS() << "Call-out to other instance failed (perhaps not running): " << error->message << LL_ENDL;
- }
-
- g_object_unref(G_OBJECT(remote_object));
+ LL_WARNS() << "Cannot create new dbus proxy." << LL_ENDL;
+ g_object_unref( pBus );
+ return false;
}
- else
+
+ auto *pArgs = g_variant_new( "(s)", url.c_str() );
+ if( !pArgs )
{
- LL_WARNS() << "Couldn't connect to session bus: " << error->message << LL_ENDL;
+ LL_WARNS() << "Cannot create new variant." << LL_ENDL;
+ g_object_unref( pBus );
+ return false;
}
- if (error)
- g_error_free(error);
+ auto pRes = g_dbus_proxy_call_sync(pProxy,
+ "GoSLURL",
+ pArgs,
+ G_DBUS_CALL_FLAGS_NONE,
+ -1, nullptr, nullptr);
- return success;
+
+
+ if( pRes )
+ g_variant_unref( pRes );
+ g_object_unref( pProxy );
+ g_object_unref( pBus );
+ return true;
}
-#else // LL_DBUS_ENABLED
+#else // LL_GLIB
bool LLAppViewerLinux::initSLURLHandler()
{
return false; // not implemented without dbus
@@ -322,7 +387,7 @@ bool LLAppViewerLinux::sendURLToOtherInstance(const std::string& url)
{
return false; // not implemented without dbus
}
-#endif // LL_DBUS_ENABLED
+#endif // LL_GLIB
void LLAppViewerLinux::initCrashReporting(bool reportFreeze)
{
@@ -338,15 +403,18 @@ void LLAppViewerLinux::initCrashReporting(bool reportFreeze)
pid_str << LLApp::getPid();
std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, "");
std::string appname = gDirUtilp->getExecutableFilename();
+ std::string grid{ LLGridManager::getInstance()->getGridId() };
+ std::string title{ LLAppViewer::instance()->getSecondLifeTitle() };
+ std::string pidstr{ pid_str.str() };
// launch the actual crash logger
const char * cmdargv[] =
{cmd.c_str(),
"-user",
- (char*)LLGridManager::getInstance()->getGridId().c_str(),
+ grid.c_str(),
"-name",
- LLAppViewer::instance()->getSecondLifeTitle().c_str(),
+ title.c_str(),
"-pid",
- pid_str.str().c_str(),
+ pidstr.c_str(),
"-dumpdir",
logdir.c_str(),
"-procname",
diff --git a/indra/newview/llappviewerlinux.h b/indra/newview/llappviewerlinux.h
index dde223878d..460ca721f1 100644
--- a/indra/newview/llappviewerlinux.h
+++ b/indra/newview/llappviewerlinux.h
@@ -27,17 +27,6 @@
#ifndef LL_LLAPPVIEWERLINUX_H
#define LL_LLAPPVIEWERLINUX_H
-extern "C" {
-# include <glib.h>
-}
-
-#if LL_DBUS_ENABLED
-extern "C" {
-# include <glib-object.h>
-# include <dbus/dbus-glib.h>
-}
-#endif
-
#ifndef LL_LLAPPVIEWER_H
#include "llappviewer.h"
#endif
@@ -70,21 +59,4 @@ protected:
virtual bool sendURLToOtherInstance(const std::string& url);
};
-#if LL_DBUS_ENABLED
-typedef struct
-{
- GObject parent;
- DBusGConnection *connection;
-} ViewerAppAPI;
-
-extern "C" {
- gboolean viewer_app_api_GoSLURL(ViewerAppAPI *obj, gchar *slurl, gboolean **success_rtn, GError **error);
-}
-
-#define VIEWERAPI_SERVICE "com.secondlife.ViewerAppAPIService"
-#define VIEWERAPI_PATH "/com/secondlife/ViewerAppAPI"
-#define VIEWERAPI_INTERFACE "com.secondlife.ViewerAppAPI"
-
-#endif // LL_DBUS_ENABLED
-
#endif // LL_LLAPPVIEWERLINUX_H
diff --git a/indra/newview/llappviewerlinux_api.h b/indra/newview/llappviewerlinux_api.h
deleted file mode 100644
index 3d1324dd19..0000000000
--- a/indra/newview/llappviewerlinux_api.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/* Generated by dbus-binding-tool; do not edit! */
-/**
- * $LicenseInfo:firstyear=2008&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 __dbus_glib_marshal_viewerapp_MARSHAL_H__
-#define __dbus_glib_marshal_viewerapp_MARSHAL_H__
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#ifdef G_ENABLE_DEBUG
-#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
-#define g_marshal_value_peek_char(v) g_value_get_char (v)
-#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)
-#define g_marshal_value_peek_int(v) g_value_get_int (v)
-#define g_marshal_value_peek_uint(v) g_value_get_uint (v)
-#define g_marshal_value_peek_long(v) g_value_get_long (v)
-#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v)
-#define g_marshal_value_peek_int64(v) g_value_get_int64 (v)
-#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v)
-#define g_marshal_value_peek_enum(v) g_value_get_enum (v)
-#define g_marshal_value_peek_flags(v) g_value_get_flags (v)
-#define g_marshal_value_peek_float(v) g_value_get_float (v)
-#define g_marshal_value_peek_double(v) g_value_get_double (v)
-#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v)
-#define g_marshal_value_peek_param(v) g_value_get_param (v)
-#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v)
-#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v)
-#define g_marshal_value_peek_object(v) g_value_get_object (v)
-#else /* !G_ENABLE_DEBUG */
-/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
- * Do not access GValues directly in your code. Instead, use the
- * g_value_get_*() functions
- */
-#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int
-#define g_marshal_value_peek_char(v) (v)->data[0].v_int
-#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint
-#define g_marshal_value_peek_int(v) (v)->data[0].v_int
-#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint
-#define g_marshal_value_peek_long(v) (v)->data[0].v_long
-#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong
-#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64
-#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64
-#define g_marshal_value_peek_enum(v) (v)->data[0].v_long
-#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong
-#define g_marshal_value_peek_float(v) (v)->data[0].v_float
-#define g_marshal_value_peek_double(v) (v)->data[0].v_double
-#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer
-#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer
-#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer
-#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer
-#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer
-#endif /* !G_ENABLE_DEBUG */
-
-
-/* BOOLEAN:STRING,POINTER,POINTER (/tmp/dbus-binding-tool-c-marshallers.5XXD8T:1) */
-extern void dbus_glib_marshal_viewerapp_BOOLEAN__STRING_POINTER_POINTER (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
-void
-dbus_glib_marshal_viewerapp_BOOLEAN__STRING_POINTER_POINTER (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data)
-{
- typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_POINTER_POINTER) (gpointer data1,
- gpointer arg_1,
- gpointer arg_2,
- gpointer arg_3,
- gpointer data2);
- register GMarshalFunc_BOOLEAN__STRING_POINTER_POINTER callback;
- register GCClosure *cc = (GCClosure*) closure;
- register gpointer data1, data2;
- gboolean v_return;
-
- g_return_if_fail (return_value != NULL);
- g_return_if_fail (n_param_values == 4);
-
- if (G_CCLOSURE_SWAP_DATA (closure))
- {
- data1 = closure->data;
- data2 = g_value_peek_pointer (param_values + 0);
- }
- else
- {
- data1 = g_value_peek_pointer (param_values + 0);
- data2 = closure->data;
- }
- callback = (GMarshalFunc_BOOLEAN__STRING_POINTER_POINTER) (marshal_data ? marshal_data : cc->callback);
-
- v_return = callback (data1,
- g_marshal_value_peek_string (param_values + 1),
- g_marshal_value_peek_pointer (param_values + 2),
- g_marshal_value_peek_pointer (param_values + 3),
- data2);
-
- g_value_set_boolean (return_value, v_return);
-}
-
-G_END_DECLS
-
-#endif /* __dbus_glib_marshal_viewerapp_MARSHAL_H__ */
-
-#include <dbus/dbus-glib.h>
-static const DBusGMethodInfo dbus_glib_viewerapp_methods[] = {
- { (GCallback) viewer_app_api_GoSLURL, dbus_glib_marshal_viewerapp_BOOLEAN__STRING_POINTER_POINTER, 0 },
-};
-
-const DBusGObjectInfo dbus_glib_viewerapp_object_info = {
- 0,
- dbus_glib_viewerapp_methods,
- 1,
-"com.secondlife.ViewerAppAPI\0GoSLURL\0S\0slurl\0I\0s\0success_ret\0O\0F\0N\0b\0\0\0",
-"\0",
-"\0"
-};
-
diff --git a/indra/newview/llappviewerlinux_api.xml b/indra/newview/llappviewerlinux_api.xml
deleted file mode 100644
index fac35b7adc..0000000000
--- a/indra/newview/llappviewerlinux_api.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<!-- dbus-binding-tool -mode=glib-server llappviewerlinux_api.xml -prefix=viewerapp -output=llappviewerlinux_api.h -->
-
-<node name="/com/secondlife/ViewerAppAPI">
- <interface name="com.secondlife.ViewerAppAPI">
- <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="viewer_app_api"/>
- <method name="GoSLURL">
- <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="viewer_app_api_GoSLURL"/>
- <arg type="s" name="slurl" direction="in" />
- <arg type="b" name="success_ret" direction="out" />
- </method>
- </interface>
-</node>
diff --git a/indra/newview/llappviewerlinux_api_dbus.cpp b/indra/newview/llappviewerlinux_api_dbus.cpp
deleted file mode 100644
index 9aed8a98d4..0000000000
--- a/indra/newview/llappviewerlinux_api_dbus.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/**
- * @file llappviewerlinux_api_dbus.cpp
- * @brief dynamic DBus symbol-grabbing code
- *
- * $LicenseInfo:firstyear=2008&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$
- */
-
-#if LL_DBUS_ENABLED
-
-#include "linden_common.h"
-
-extern "C" {
-#include <dbus/dbus-glib.h>
-
-#include "apr_pools.h"
-#include "apr_dso.h"
-}
-
-#define DEBUGMSG(...) do { LL_DEBUGS() << llformat(__VA_ARGS__) << LL_ENDL; } while(0)
-#define INFOMSG(...) do { LL_INFOS() << llformat(__VA_ARGS__) << LL_ENDL; } while(0)
-#define WARNMSG(...) do { LL_WARNS() << llformat(__VA_ARGS__) << LL_ENDL; } while(0)
-
-#define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) RTN (*ll##DBUSSYM)(__VA_ARGS__) = NULL
-#include "llappviewerlinux_api_dbus_syms_raw.inc"
-#undef LL_DBUS_SYM
-
-static bool sSymsGrabbed = false;
-static apr_pool_t *sSymDBUSDSOMemoryPool = NULL;
-static apr_dso_handle_t *sSymDBUSDSOHandleG = NULL;
-
-bool grab_dbus_syms(std::string dbus_dso_name)
-{
- if (sSymsGrabbed)
- {
- // already have grabbed good syms
- return true;
- }
-
- bool sym_error = false;
- bool rtn = false;
- apr_status_t rv;
- apr_dso_handle_t *sSymDBUSDSOHandle = NULL;
-
-#define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) do{rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll##DBUSSYM, sSymDBUSDSOHandle, #DBUSSYM); if (rv != APR_SUCCESS) {INFOMSG("Failed to grab symbol: %s", #DBUSSYM); if (REQUIRED) sym_error = true;} else DEBUGMSG("grabbed symbol: %s from %p", #DBUSSYM, (void*)ll##DBUSSYM);}while(0)
-
- //attempt to load the shared library
- apr_pool_create(&sSymDBUSDSOMemoryPool, NULL);
-
- if ( APR_SUCCESS == (rv = apr_dso_load(&sSymDBUSDSOHandle,
- dbus_dso_name.c_str(),
- sSymDBUSDSOMemoryPool) ))
- {
- INFOMSG("Found DSO: %s", dbus_dso_name.c_str());
-
-#include "llappviewerlinux_api_dbus_syms_raw.inc"
-
- if ( sSymDBUSDSOHandle )
- {
- sSymDBUSDSOHandleG = sSymDBUSDSOHandle;
- sSymDBUSDSOHandle = NULL;
- }
-
- rtn = !sym_error;
- }
- else
- {
- INFOMSG("Couldn't load DSO: %s", dbus_dso_name.c_str());
- rtn = false; // failure
- }
-
- if (sym_error)
- {
- WARNMSG("Failed to find necessary symbols in DBUS-GLIB libraries.");
- }
-#undef LL_DBUS_SYM
-
- sSymsGrabbed = rtn;
- return rtn;
-}
-
-
-void ungrab_dbus_syms()
-{
- // should be safe to call regardless of whether we've
- // actually grabbed syms.
-
- if ( sSymDBUSDSOHandleG )
- {
- apr_dso_unload(sSymDBUSDSOHandleG);
- sSymDBUSDSOHandleG = NULL;
- }
-
- if ( sSymDBUSDSOMemoryPool )
- {
- apr_pool_destroy(sSymDBUSDSOMemoryPool);
- sSymDBUSDSOMemoryPool = NULL;
- }
-
- // NULL-out all of the symbols we'd grabbed
-#define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) do{ll##DBUSSYM = NULL;}while(0)
-#include "llappviewerlinux_api_dbus_syms_raw.inc"
-#undef LL_DBUS_SYM
-
- sSymsGrabbed = false;
-}
-
-#endif // LL_DBUS_ENABLED
diff --git a/indra/newview/llappviewerlinux_api_dbus_syms_raw.inc b/indra/newview/llappviewerlinux_api_dbus_syms_raw.inc
deleted file mode 100644
index c0548e2fba..0000000000
--- a/indra/newview/llappviewerlinux_api_dbus_syms_raw.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-
-// required symbols to grab
-LL_DBUS_SYM(true, dbus_g_bus_get, DBusGConnection*, DBusBusType, GError**);
-LL_DBUS_SYM(true, dbus_g_proxy_new_for_name, DBusGProxy*, DBusGConnection*, const char *, const char*, const char*);
-LL_DBUS_SYM(true, dbus_g_proxy_call, gboolean, DBusGProxy*, const char*, GError**, GType, ...);
-LL_DBUS_SYM(true, dbus_g_object_type_install_info, void, GType, const DBusGObjectInfo*);
-LL_DBUS_SYM(true, dbus_g_connection_register_g_object, void, DBusGConnection*, const char*, GObject*);
-
-// optional symbols to grab
diff --git a/indra/newview/llappviewerlistener.cpp b/indra/newview/llappviewerlistener.cpp
index 6d519b6fef..4690c91b61 100644
--- a/indra/newview/llappviewerlistener.cpp
+++ b/indra/newview/llappviewerlistener.cpp
@@ -35,6 +35,7 @@
// external library headers
// other Linden headers
#include "llappviewer.h"
+#include "workqueue.h"
LLAppViewerListener::LLAppViewerListener(const LLAppViewerGetter& getter):
LLEventAPI("LLAppViewer",
@@ -42,6 +43,9 @@ LLAppViewerListener::LLAppViewerListener(const LLAppViewerGetter& getter):
mAppViewerGetter(getter)
{
// add() every method we want to be able to invoke via this event API.
+ add("userQuit",
+ "Ask to quit with user confirmation prompt",
+ &LLAppViewerListener::userQuit);
add("requestQuit",
"Ask to quit nicely",
&LLAppViewerListener::requestQuit);
@@ -50,14 +54,26 @@ LLAppViewerListener::LLAppViewerListener(const LLAppViewerGetter& getter):
&LLAppViewerListener::forceQuit);
}
+void LLAppViewerListener::userQuit(const LLSD& event)
+{
+ LL_INFOS() << "Listener requested user quit" << LL_ENDL;
+ // Trying to engage this from (e.g.) a Lua-hosting C++ coroutine runs
+ // afoul of an assert in the logging machinery that LLMutex must be locked
+ // only from the main coroutine.
+ LL::WorkQueue::getInstance("mainloop")->post(
+ [appviewer=mAppViewerGetter()]{ appviewer->userQuit(); });
+}
+
void LLAppViewerListener::requestQuit(const LLSD& event)
{
LL_INFOS() << "Listener requested quit" << LL_ENDL;
- mAppViewerGetter()->requestQuit();
+ LL::WorkQueue::getInstance("mainloop")->post(
+ [appviewer=mAppViewerGetter()]{ appviewer->requestQuit(); });
}
void LLAppViewerListener::forceQuit(const LLSD& event)
{
LL_INFOS() << "Listener requested force quit" << LL_ENDL;
- mAppViewerGetter()->forceQuit();
+ LL::WorkQueue::getInstance("mainloop")->post(
+ [appviewer=mAppViewerGetter()]{ appviewer->forceQuit(); });
}
diff --git a/indra/newview/llappviewerlistener.h b/indra/newview/llappviewerlistener.h
index 5ade3d3e04..e116175eb7 100644
--- a/indra/newview/llappviewerlistener.h
+++ b/indra/newview/llappviewerlistener.h
@@ -30,7 +30,7 @@
#define LL_LLAPPVIEWERLISTENER_H
#include "lleventapi.h"
-#include <boost/function.hpp>
+#include <functional>
class LLAppViewer;
class LLSD;
@@ -39,11 +39,12 @@ class LLSD;
class LLAppViewerListener: public LLEventAPI
{
public:
- typedef boost::function<LLAppViewer*(void)> LLAppViewerGetter;
+ typedef std::function<LLAppViewer*(void)> LLAppViewerGetter;
/// Bind the LLAppViewer instance to use (e.g. LLAppViewer::instance()).
LLAppViewerListener(const LLAppViewerGetter& getter);
private:
+ void userQuit(const LLSD& event);
void requestQuit(const LLSD& event);
void forceQuit(const LLSD& event);
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index c5686f160a..ad817d5747 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -389,17 +389,10 @@ void ll_nvapi_init(NvDRSSessionHandle hSession)
}
}
-//#define DEBUGGING_SEH_FILTER 1
-#if DEBUGGING_SEH_FILTER
-# define WINMAIN DebuggingWinMain
-#else
-# define WINMAIN wWinMain
-#endif
-
-int APIENTRY WINMAIN(HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- PWSTR pCmdLine,
- int nCmdShow)
+int APIENTRY wWinMain(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ PWSTR pCmdLine,
+ int nCmdShow)
{
// Call Tracy first thing to have it allocate memory
// https://github.com/wolfpld/tracy/issues/196
@@ -548,27 +541,6 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
return 0;
}
-#if DEBUGGING_SEH_FILTER
-// The compiler doesn't like it when you use __try/__except blocks
-// in a method that uses object destructors. Go figure.
-// This winmain just calls the real winmain inside __try.
-// The __except calls our exception filter function. For debugging purposes.
-int APIENTRY wWinMain(HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- PWSTR lpCmdLine,
- int nCmdShow)
-{
- __try
- {
- WINMAIN(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
- }
- __except( viewer_windows_exception_handler( GetExceptionInformation() ) )
- {
- _tprintf( _T("Exception handled.\n") );
- }
-}
-#endif
-
void LLAppViewerWin32::disableWinErrorReporting()
{
std::string executable_name = gDirUtilp->getExecutableFilename();
diff --git a/indra/newview/llblocklist.cpp b/indra/newview/llblocklist.cpp
index 89516a8a84..bb1e3405d7 100644
--- a/indra/newview/llblocklist.cpp
+++ b/indra/newview/llblocklist.cpp
@@ -50,7 +50,7 @@ LLBlockList::LLBlockList(const Params& p)
mMuteListSize = static_cast<U32>(LLMuteList::getInstance()->getMutes().size());
// Set up context menu.
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ ScopedRegistrarHelper registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
registrar.add ("Block.Action", boost::bind(&LLBlockList::onCustomAction, this, _2));
diff --git a/indra/newview/llbox.cpp b/indra/newview/llbox.cpp
index dd12a02907..d0787a3902 100644
--- a/indra/newview/llbox.cpp
+++ b/indra/newview/llbox.cpp
@@ -76,16 +76,23 @@ void LLBox::renderface(S32 which_face)
{7, 4, 0, 3}
};
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLES);
+ {
//gGL.normal3fv(&normals[which_face][0]);
- gGL.texCoord2f(1,0);
- gGL.vertex3fv(&mVertex[ faces[which_face][0] ][0]);
- gGL.texCoord2f(1,1);
- gGL.vertex3fv(&mVertex[ faces[which_face][1] ][0]);
- gGL.texCoord2f(0,1);
- gGL.vertex3fv(&mVertex[ faces[which_face][2] ][0]);
- gGL.texCoord2f(0,0);
- gGL.vertex3fv(&mVertex[ faces[which_face][3] ][0]);
+ gGL.texCoord2f(1.f, 0.f);
+ gGL.vertex3fv(&mVertex[faces[which_face][0]][0]);
+ gGL.texCoord2f(1.f, 1.f);
+ gGL.vertex3fv(&mVertex[faces[which_face][1]][0]);
+ gGL.texCoord2f(0.f, 1.f);
+ gGL.vertex3fv(&mVertex[faces[which_face][2]][0]);
+
+ gGL.texCoord2f(1.f, 0.f);
+ gGL.vertex3fv(&mVertex[faces[which_face][0]][0]);
+ gGL.texCoord2f(0.f, 1.f);
+ gGL.vertex3fv(&mVertex[faces[which_face][2]][0]);
+ gGL.texCoord2f(0.f, 0.f);
+ gGL.vertex3fv(&mVertex[faces[which_face][3]][0]);
+ }
gGL.end();
}
diff --git a/indra/newview/llcallbacklist.cpp b/indra/newview/llcallbacklist.cpp
deleted file mode 100644
index c474f2885b..0000000000
--- a/indra/newview/llcallbacklist.cpp
+++ /dev/null
@@ -1,305 +0,0 @@
-/**
- * @file llcallbacklist.cpp
- * @brief A simple list of callback functions to call.
- *
- * $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 "llcallbacklist.h"
-#include "lleventtimer.h"
-
-// Library includes
-#include "llerror.h"
-
-
-//
-// Globals
-//
-LLCallbackList gIdleCallbacks;
-
-//
-// Member functions
-//
-
-LLCallbackList::LLCallbackList()
-{
- // nothing
-}
-
-LLCallbackList::~LLCallbackList()
-{
-}
-
-
-void LLCallbackList::addFunction( callback_t func, void *data)
-{
- if (!func)
- {
- LL_ERRS() << "LLCallbackList::addFunction - function is NULL" << LL_ENDL;
- return;
- }
-
- // only add one callback per func/data pair
- callback_pair_t t(func, data);
- callback_list_t::iterator iter = std::find(mCallbackList.begin(), mCallbackList.end(), t);
- if (iter == mCallbackList.end())
- {
- mCallbackList.push_back(t);
- }
-}
-
-
-BOOL LLCallbackList::containsFunction( callback_t func, void *data)
-{
- callback_pair_t t(func, data);
- callback_list_t::iterator iter = std::find(mCallbackList.begin(), mCallbackList.end(), t);
- if (iter != mCallbackList.end())
- {
- return TRUE;
- }
- else
- {
- return FALSE;
- }
-}
-
-
-BOOL LLCallbackList::deleteFunction( callback_t func, void *data)
-{
- callback_pair_t t(func, data);
- callback_list_t::iterator iter = std::find(mCallbackList.begin(), mCallbackList.end(), t);
- if (iter != mCallbackList.end())
- {
- mCallbackList.erase(iter);
- return TRUE;
- }
- else
- {
- return FALSE;
- }
-}
-
-
-void LLCallbackList::deleteAllFunctions()
-{
- mCallbackList.clear();
-}
-
-
-void LLCallbackList::callFunctions()
-{
- for (callback_list_t::iterator iter = mCallbackList.begin(); iter != mCallbackList.end(); )
- {
- callback_list_t::iterator curiter = iter++;
- curiter->first(curiter->second);
- }
-}
-
-// Shim class to allow arbitrary boost::bind
-// expressions to be run as one-time idle callbacks.
-class OnIdleCallbackOneTime
-{
-public:
- OnIdleCallbackOneTime(nullary_func_t callable):
- mCallable(callable)
- {
- }
- static void onIdle(void *data)
- {
- gIdleCallbacks.deleteFunction(onIdle, data);
- OnIdleCallbackOneTime* self = reinterpret_cast<OnIdleCallbackOneTime*>(data);
- self->call();
- delete self;
- }
- void call()
- {
- mCallable();
- }
-private:
- nullary_func_t mCallable;
-};
-
-void doOnIdleOneTime(nullary_func_t callable)
-{
- OnIdleCallbackOneTime* cb_functor = new OnIdleCallbackOneTime(callable);
- gIdleCallbacks.addFunction(&OnIdleCallbackOneTime::onIdle,cb_functor);
-}
-
-// Shim class to allow generic boost functions to be run as
-// recurring idle callbacks. Callable should return true when done,
-// false to continue getting called.
-class OnIdleCallbackRepeating
-{
-public:
- OnIdleCallbackRepeating(bool_func_t callable):
- mCallable(callable)
- {
- }
- // Will keep getting called until the callable returns true.
- static void onIdle(void *data)
- {
- OnIdleCallbackRepeating* self = reinterpret_cast<OnIdleCallbackRepeating*>(data);
- bool done = self->call();
- if (done)
- {
- gIdleCallbacks.deleteFunction(onIdle, data);
- delete self;
- }
- }
- bool call()
- {
- return mCallable();
- }
-private:
- bool_func_t mCallable;
-};
-
-void doOnIdleRepeating(bool_func_t callable)
-{
- OnIdleCallbackRepeating* cb_functor = new OnIdleCallbackRepeating(callable);
- gIdleCallbacks.addFunction(&OnIdleCallbackRepeating::onIdle,cb_functor);
-}
-
-class NullaryFuncEventTimer: public LLEventTimer
-{
-public:
- NullaryFuncEventTimer(nullary_func_t callable, F32 seconds):
- LLEventTimer(seconds),
- mCallable(callable)
- {
- }
-
-private:
- bool tick()
- {
- mCallable();
- return true;
- }
-
- nullary_func_t mCallable;
-};
-
-// Call a given callable once after specified interval.
-void doAfterInterval(nullary_func_t callable, F32 seconds)
-{
- new NullaryFuncEventTimer(callable, seconds);
-}
-
-class BoolFuncEventTimer: public LLEventTimer
-{
-public:
- BoolFuncEventTimer(bool_func_t callable, F32 seconds):
- LLEventTimer(seconds),
- mCallable(callable)
- {
- }
-private:
- bool tick()
- {
- return mCallable();
- }
-
- bool_func_t mCallable;
-};
-
-// Call a given callable every specified number of seconds, until it returns true.
-void doPeriodically(bool_func_t callable, F32 seconds)
-{
- new BoolFuncEventTimer(callable, seconds);
-}
-
-#ifdef _DEBUG
-
-void test1(void *data)
-{
- S32 *s32_data = (S32 *)data;
- LL_INFOS() << "testfunc1 " << *s32_data << LL_ENDL;
-}
-
-
-void test2(void *data)
-{
- S32 *s32_data = (S32 *)data;
- LL_INFOS() << "testfunc2 " << *s32_data << LL_ENDL;
-}
-
-
-void
-LLCallbackList::test()
-{
- S32 a = 1;
- S32 b = 2;
- LLCallbackList *list = new LLCallbackList;
-
- LL_INFOS() << "Testing LLCallbackList" << LL_ENDL;
-
- if (!list->deleteFunction(NULL))
- {
- LL_INFOS() << "passed 1" << LL_ENDL;
- }
- else
- {
- LL_INFOS() << "error, removed function from empty list" << LL_ENDL;
- }
-
- // LL_INFOS() << "This should crash" << LL_ENDL;
- // list->addFunction(NULL);
-
- list->addFunction(&test1, &a);
- list->addFunction(&test1, &a);
-
- LL_INFOS() << "Expect: test1 1, test1 1" << LL_ENDL;
- list->callFunctions();
-
- list->addFunction(&test1, &b);
- list->addFunction(&test2, &b);
-
- LL_INFOS() << "Expect: test1 1, test1 1, test1 2, test2 2" << LL_ENDL;
- list->callFunctions();
-
- if (list->deleteFunction(&test1, &b))
- {
- LL_INFOS() << "passed 3" << LL_ENDL;
- }
- else
- {
- LL_INFOS() << "error removing function" << LL_ENDL;
- }
-
- LL_INFOS() << "Expect: test1 1, test1 1, test2 2" << LL_ENDL;
- list->callFunctions();
-
- list->deleteAllFunctions();
-
- LL_INFOS() << "Expect nothing" << LL_ENDL;
- list->callFunctions();
-
- LL_INFOS() << "nothing :-)" << LL_ENDL;
-
- delete list;
-
- LL_INFOS() << "test complete" << LL_ENDL;
-}
-
-#endif // _DEBUG
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index a48e22bc73..3e02820feb 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -125,6 +125,7 @@ public:
mUserNameTextBox(NULL),
mTimeBoxTextBox(NULL),
mNeedsTimeBox(true),
+ mIsFromScript(false),
mAvatarNameCacheConnection()
{}
@@ -658,11 +659,13 @@ public:
const LLUUID& getAvatarId () const { return mAvatarID;}
- void setup(const LLChat& chat, const LLStyle::Params& style_params, const LLSD& args)
+ void setup(const LLChat& chat, const LLStyle::Params& style_params, const LLSD& args, bool is_script)
{
mAvatarID = chat.mFromID;
mSessionID = chat.mSessionID;
mSourceType = chat.mSourceType;
+ mIsFromScript = is_script;
+ mPrefix = mIsFromScript ? LLTrans::getString("ScriptBy") : "";
// To be able to report a message, we need a copy of it's text
// and it's easier to store text directly than trying to get
@@ -732,7 +735,7 @@ public:
username_end == (chat.mFromName.length() - 1))
{
mFrom = chat.mFromName.substr(0, username_start);
- user_name->setValue(mFrom);
+ user_name->setValue(mPrefix + mFrom);
if (gSavedSettings.getBOOL("NameTagShowUsernames"))
{
@@ -774,7 +777,7 @@ public:
switch (mSourceType)
{
case CHAT_SOURCE_AGENT:
- icon->setValue(chat.mFromID);
+ icon->setValue(mIsFromScript ? LLSD("Inv_Script") : LLSD(chat.mFromID));
break;
case CHAT_SOURCE_OBJECT:
icon->setValue(LLSD("OBJECT_Icon"));
@@ -787,7 +790,7 @@ public:
icon->setValue(LLSD("Command_Destinations_Icon"));
break;
case CHAT_SOURCE_UNKNOWN:
- icon->setValue(LLSD("Unknown_Icon"));
+ icon->setValue(mIsFromScript ? LLSD("Inv_Script") : LLSD("Unknown_Icon"));
}
// In case the message came from an object, save the object info
@@ -868,7 +871,7 @@ protected:
LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandleObject.get();
if (!menu)
{
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ ScopedRegistrarHelper registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar registrar_enable;
registrar.add("ObjectIcon.Action", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemClicked, this, _2));
registrar_enable.add("ObjectIcon.Visible", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemVisible, this, _2));
@@ -896,9 +899,9 @@ protected:
LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandleAvatar.get();
if (!menu)
{
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ ScopedRegistrarHelper registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar registrar_enable;
- registrar.add("AvatarIcon.Action", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemClicked, this, _2));
+ registrar.add("AvatarIcon.Action", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemClicked, this, _2), cb_info::UNTRUSTED_BLOCK);
registrar_enable.add("AvatarIcon.Check", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemChecked, this, _2));
registrar_enable.add("AvatarIcon.Enable", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemEnabled, this, _2));
registrar_enable.add("AvatarIcon.Visible", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemVisible, this, _2));
@@ -1029,7 +1032,7 @@ private:
mFrom = av_name.getDisplayName();
LLTextBox* user_name = getChild<LLTextBox>("user_name");
- user_name->setValue( LLSD(av_name.getDisplayName() ) );
+ user_name->setValue(LLSD(mPrefix + av_name.getDisplayName()));
user_name->setToolTip( av_name.getUserName() );
if (gSavedSettings.getBOOL("NameTagShowUsernames") &&
@@ -1071,6 +1074,9 @@ protected:
bool mNeedsTimeBox;
+ bool mIsFromScript;
+ std::string mPrefix;
+
private:
boost::signals2::connection mAvatarNameCacheConnection;
};
@@ -1088,6 +1094,7 @@ LLChatHistory::LLChatHistory(const LLChatHistory::Params& p)
mTopHeaderPad(p.top_header_pad),
mBottomHeaderPad(p.bottom_header_pad),
mIsLastMessageFromLog(false),
+ mIsLastFromScript(false),
mNotifyAboutUnreadMsg(p.notify_unread_msg)
{
LLTextEditor::Params editor_params(p);
@@ -1185,11 +1192,11 @@ LLView* LLChatHistory::getSeparator()
return separator;
}
-LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style_params, const LLSD& args)
+LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style_params, const LLSD& args, bool is_script)
{
LLChatHistoryHeader* header = LLChatHistoryHeader::createInstance(mMessageHeaderFilename);
if (header)
- header->setup(chat, style_params, args);
+ header->setup(chat, style_params, args, is_script);
return header;
}
@@ -1260,8 +1267,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
name_params.color(name_color);
name_params.readonly_color(name_color);
- std::string prefix = chat.mText.substr(0, 4);
-
+ auto [message, is_lua] = LLStringUtil::withoutPrefix(chat.mText, LUA_PREFIX);
+ std::string prefix = message.substr(0, 4);
//IRC styled /me messages.
bool irc_me = prefix == "/me " || prefix == "/me'";
@@ -1337,6 +1344,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
// names showing
if (args["show_names_for_p2p_conv"].asBoolean() && utf8str_trim(chat.mFromName).size())
{
+ std::string script_prefix = is_lua ? LLTrans::getString("ScriptBy") : "";
// Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text.
if (chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mFromID.notNull())
{
@@ -1361,7 +1369,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
link_params.overwriteFrom(LLStyleMap::instance().lookupAgent(chat.mFromID));
// Add link to avatar's inspector and delimiter to message.
- mEditor->appendText(std::string(link_params.link_href) + delimiter,
+ mEditor->appendText(script_prefix + std::string(link_params.link_href) + delimiter,
prependNewLineState, link_params);
prependNewLineState = false;
}
@@ -1374,7 +1382,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
}
else
{
- mEditor->appendText("<nolink>" + chat.mFromName + "</nolink>" + delimiter,
+ mEditor->appendText(script_prefix + "<nolink>" + chat.mFromName + "</nolink>" + delimiter,
prependNewLineState, body_message_params);
prependNewLineState = false;
}
@@ -1395,7 +1403,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
&& mLastFromID == chat.mFromID
&& mLastMessageTime.notNull()
&& (new_message_time.secondsSinceEpoch() - mLastMessageTime.secondsSinceEpoch()) < 60.0
- && mIsLastMessageFromLog == message_from_log) //distinguish between current and previous chat session's histories
+ && mIsLastMessageFromLog == message_from_log //distinguish between current and previous chat session's histories
+ && mIsLastFromScript == is_lua)
{
view = getSeparator();
if (!view)
@@ -1410,7 +1419,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
}
else
{
- view = getHeader(chat, name_params, args);
+ view = getHeader(chat, name_params, args, is_lua);
if (!view)
{
LL_WARNS() << "Failed to create header from " << mMessageHeaderFilename << ": can't append to history" << LL_ENDL;
@@ -1439,6 +1448,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
mLastFromID = chat.mFromID;
mLastMessageTime = new_message_time;
mIsLastMessageFromLog = message_from_log;
+ mIsLastFromScript = is_lua;
}
// body of the message processing
@@ -1493,7 +1503,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
// usual messages showing
else if (!teleport_separator)
{
- std::string message = irc_me ? chat.mText.substr(3) : chat.mText;
+ message = irc_me ? message.substr(3) : message;
//MESSAGE TEXT PROCESSING
//*HACK getting rid of redundant sender names in system notifications sent using sender name (see EXT-5010)
diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h
index b8364ff860..8acbea6ed5 100644
--- a/indra/newview/llchathistory.h
+++ b/indra/newview/llchathistory.h
@@ -101,7 +101,7 @@ class LLChatHistory : public LLUICtrl
* Builds a message header.
* @return pointer to LLView header object.
*/
- LLView* getHeader(const LLChat& chat,const LLStyle::Params& style_params, const LLSD& args);
+ LLView* getHeader(const LLChat& chat,const LLStyle::Params& style_params, const LLSD& args, bool is_script = false);
public:
~LLChatHistory();
LLSD getValue() const;
@@ -127,6 +127,7 @@ class LLChatHistory : public LLUICtrl
LLDate mLastMessageTime;
bool mIsLastMessageFromLog;
bool mNotifyAboutUnreadMsg;
+ bool mIsLastFromScript;
//std::string mLastMessageTimeStr;
std::string mMessageHeaderFilename;
diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp
index 550dfeb802..f1ed55e647 100644
--- a/indra/newview/llchatitemscontainerctrl.cpp
+++ b/indra/newview/llchatitemscontainerctrl.cpp
@@ -188,6 +188,7 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification)
int sType = notification["source"].asInteger();
mSourceType = (EChatSourceType)sType;
+ mIsFromScript = notification["is_lua"].asBoolean();
std::string color_name = notification["text_color"].asString();
@@ -215,7 +216,7 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification)
{
std::string str_sender;
- str_sender = fromName;
+ str_sender = mIsFromScript ? LLTrans::getString("ScriptBy") + fromName : fromName;
str_sender+=" ";
@@ -397,7 +398,7 @@ void LLFloaterIMNearbyChatToastPanel::draw()
else if(mSourceType == CHAT_SOURCE_SYSTEM)
icon->setValue(LLSD("SL_Logo"));
else if(mSourceType == CHAT_SOURCE_AGENT)
- icon->setValue(mFromID);
+ icon->setValue(mIsFromScript ? LLSD("Inv_Script") : LLSD(mFromID));
else if(!mFromID.isNull())
icon->setValue(mFromID);
}
diff --git a/indra/newview/llchatitemscontainerctrl.h b/indra/newview/llchatitemscontainerctrl.h
index 4ae73a0c43..54b757d217 100644
--- a/indra/newview/llchatitemscontainerctrl.h
+++ b/indra/newview/llchatitemscontainerctrl.h
@@ -48,7 +48,8 @@ protected:
LLFloaterIMNearbyChatToastPanel()
:
mIsDirty(false),
- mSourceType(CHAT_SOURCE_OBJECT)
+ mSourceType(CHAT_SOURCE_OBJECT),
+ mIsFromScript(false)
{};
public:
~LLFloaterIMNearbyChatToastPanel(){}
@@ -58,6 +59,8 @@ public:
const LLUUID& getFromID() const { return mFromID;}
const std::string& getFromName() const { return mFromName; }
+ bool isFromScript() { return mIsFromScript; }
+
//void addText (const std::string& message , const LLStyle::Params& input_params = LLStyle::Params());
//void setMessage (const LLChat& msg);
void snapToMessageHeight ();
@@ -88,6 +91,7 @@ private:
std::string mFromName;
EChatSourceType mSourceType;
LLChatMsgBox* mMsgText;
+ bool mIsFromScript;
diff --git a/indra/newview/llchatmsgbox.cpp b/indra/newview/llchatmsgbox.cpp
index b70b3eac95..eacbb4366d 100644
--- a/indra/newview/llchatmsgbox.cpp
+++ b/indra/newview/llchatmsgbox.cpp
@@ -41,6 +41,16 @@ public:
mEditor(NULL)
{}
+ /*virtual*/ LLTextSegmentPtr clone(LLTextBase& target) const
+ {
+ ChatSeparator* copy = new ChatSeparator(mStart, mEnd);
+ if (mEditor)
+ {
+ copy->mEditor = &target;
+ }
+ return copy;
+ }
+
/*virtual*/ void linkToDocument(class LLTextBase* editor)
{
mEditor = editor;
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index 4c0f160f6f..ec2b570ccd 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -210,9 +210,9 @@ void LLNotificationChiclet::createMenu()
return;
}
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ ScopedRegistrarHelper registrar;
registrar.add("NotificationWellChicletMenu.Action",
- boost::bind(&LLNotificationChiclet::onMenuItemClicked, this, _2));
+ boost::bind(&LLNotificationChiclet::onMenuItemClicked, this, _2), cb_info::UNTRUSTED_BLOCK);
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
enable_registrar.add("NotificationWellChicletMenu.EnableItem",
@@ -1132,8 +1132,8 @@ void LLScriptChiclet::createPopupMenu()
if(!canCreateMenu())
return;
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
- registrar.add("ScriptChiclet.Action", boost::bind(&LLScriptChiclet::onMenuItemClicked, this, _2));
+ ScopedRegistrarHelper registrar;
+ registrar.add("ScriptChiclet.Action", boost::bind(&LLScriptChiclet::onMenuItemClicked, this, _2), cb_info::UNTRUSTED_BLOCK);
LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>
("menu_script_chiclet.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
@@ -1215,8 +1215,8 @@ void LLInvOfferChiclet::createPopupMenu()
if(!canCreateMenu())
return;
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
- registrar.add("InvOfferChiclet.Action", boost::bind(&LLInvOfferChiclet::onMenuItemClicked, this, _2));
+ ScopedRegistrarHelper registrar;
+ registrar.add("InvOfferChiclet.Action", boost::bind(&LLInvOfferChiclet::onMenuItemClicked, this, _2), cb_info::UNTRUSTED_BLOCK);
LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>
("menu_inv_offer_chiclet.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp
index 47803edc73..b9df091f54 100644
--- a/indra/newview/llcofwearables.cpp
+++ b/indra/newview/llcofwearables.cpp
@@ -138,7 +138,7 @@ protected:
/*virtual*/ LLContextMenu* createMenu()
{
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ LLUICtrl::ScopedRegistrarHelper registrar;
registrar.add("Attachment.Touch", boost::bind(handleMultiple, handle_attachment_touch, mUUIDs));
registrar.add("Attachment.Edit", boost::bind(handleMultiple, handle_item_edit, mUUIDs));
@@ -191,7 +191,7 @@ protected:
/*virtual*/ LLContextMenu* createMenu()
{
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ LLUICtrl::ScopedRegistrarHelper registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
LLUUID selected_id = mUUIDs.back();
@@ -251,9 +251,9 @@ protected:
LLUUID selected_id = mUUIDs.back();
LLPanelOutfitEdit* panel_oe = dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit"));
- registrar.add("BodyPart.Replace", boost::bind(&LLPanelOutfitEdit::onReplaceMenuItemClicked, panel_oe, selected_id));
- registrar.add("BodyPart.Edit", boost::bind(LLAgentWearables::editWearable, selected_id));
- registrar.add("BodyPart.Create", boost::bind(&CofBodyPartContextMenu::createNew, this, selected_id));
+ registrar.add("BodyPart.Replace", { boost::bind(&LLPanelOutfitEdit::onReplaceMenuItemClicked, panel_oe, selected_id) });
+ registrar.add("BodyPart.Edit", { boost::bind(LLAgentWearables::editWearable, selected_id) });
+ registrar.add("BodyPart.Create", { boost::bind(&CofBodyPartContextMenu::createNew, this, selected_id) });
enable_registrar.add("BodyPart.OnEnable", boost::bind(&CofBodyPartContextMenu::onEnable, this, _2));
diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp
index 65863f0a5e..8376f5463c 100644
--- a/indra/newview/llconversationloglist.cpp
+++ b/indra/newview/llconversationloglist.cpp
@@ -47,11 +47,11 @@ LLConversationLogList::LLConversationLogList(const Params& p)
LLConversationLog::instance().addObserver(this);
// Set up context menu.
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ ScopedRegistrarHelper registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar check_registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
- registrar.add ("Calllog.Action", boost::bind(&LLConversationLogList::onCustomAction, this, _2));
+ registrar.add ("Calllog.Action", boost::bind(&LLConversationLogList::onCustomAction, this, _2), cb_info::UNTRUSTED_BLOCK);
check_registrar.add ("Calllog.Check", boost::bind(&LLConversationLogList::isActionChecked,this, _2));
enable_registrar.add("Calllog.Enable", boost::bind(&LLConversationLogList::isActionEnabled,this, _2));
@@ -95,6 +95,7 @@ bool LLConversationLogList::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
context_menu->buildDrawLabels();
context_menu->updateParent(LLMenuGL::sMenuContainer);
+
LLMenuGL::showPopup(this, context_menu, x, y);
}
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index b19b6f8dec..a1f627c8cc 100644
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -313,7 +313,7 @@ void LLConversationViewSession::draw()
{
// update the rotation angle of open folder arrow
updateLabelRotation();
- drawOpenFolderArrow(default_params, sFgColor);
+ drawOpenFolderArrow();
}
LLView::draw();
}
diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp
index e967ff3df2..51157fa430 100644
--- a/indra/newview/lldirpicker.cpp
+++ b/indra/newview/lldirpicker.cpp
@@ -41,6 +41,11 @@
# include "llfilepicker.h"
#endif
+#ifdef LL_FLTK
+ #include "FL/Fl.H"
+ #include "FL/Fl_Native_File_Chooser.H"
+#endif
+
#if LL_WINDOWS
#include <shlobj.h>
#endif
@@ -214,20 +219,28 @@ LLDirPicker::LLDirPicker() :
mFileName(NULL),
mLocked(false)
{
+#ifndef LL_FLTK
mFilePicker = new LLFilePicker();
+#endif
reset();
}
LLDirPicker::~LLDirPicker()
{
+#ifndef LL_FLTK
delete mFilePicker;
+#endif
}
void LLDirPicker::reset()
{
+#ifndef LL_FLTK
if (mFilePicker)
mFilePicker->reset();
+#else
+ mDir = "";
+#endif
}
bool LLDirPicker::getDir(std::string* filename, bool blocking)
@@ -240,33 +253,39 @@ bool LLDirPicker::getDir(std::string* filename, bool blocking)
return false;
}
-#if !LL_MESA_HEADLESS
-
- if (mFilePicker)
+#ifdef LL_FLTK
+ gViewerWindow->getWindow()->beforeDialog();
+ Fl_Native_File_Chooser flDlg;
+ flDlg.title(LLTrans::getString("choose_the_directory").c_str());
+ flDlg.type(Fl_Native_File_Chooser::BROWSE_DIRECTORY );
+ int res = flDlg.show();
+ gViewerWindow->getWindow()->afterDialog();
+ if( res == 0 )
{
- GtkWindow* picker = mFilePicker->buildFilePicker(false, true,
- "dirpicker");
-
- if (picker)
- {
- gtk_window_set_title(GTK_WINDOW(picker), LLTrans::getString("choose_the_directory").c_str());
- gtk_widget_show_all(GTK_WIDGET(picker));
- gtk_main();
- return (!mFilePicker->getFirstFile().empty());
- }
+ char const *pDir = flDlg.filename(0);
+ if( pDir )
+ mDir = pDir;
}
-#endif // !LL_MESA_HEADLESS
-
+ else if( res == -1 )
+ {
+ LL_WARNS() << "FLTK failed: " << flDlg.errmsg() << LL_ENDL;
+ }
+ return !mDir.empty();
+#endif
return false;
}
std::string LLDirPicker::getDirName()
{
+#ifndef LL_FLTK
if (mFilePicker)
{
return mFilePicker->getFirstFile();
}
return "";
+#else
+ return mDir;
+#endif
}
#else // not implemented
diff --git a/indra/newview/lldirpicker.h b/indra/newview/lldirpicker.h
index dc740caab2..2ac3db7c2e 100644
--- a/indra/newview/lldirpicker.h
+++ b/indra/newview/lldirpicker.h
@@ -77,8 +77,10 @@ private:
#if LL_LINUX || LL_DARWIN
// On Linux we just implement LLDirPicker on top of LLFilePicker
+#ifndef LL_FLTK
LLFilePicker *mFilePicker;
#endif
+#endif
std::string* mFileName;
diff --git a/indra/newview/lldonotdisturbnotificationstorage.h b/indra/newview/lldonotdisturbnotificationstorage.h
index 6683646a9b..0dc2515e02 100644
--- a/indra/newview/lldonotdisturbnotificationstorage.h
+++ b/indra/newview/lldonotdisturbnotificationstorage.h
@@ -42,7 +42,7 @@ public:
~LLDoNotDisturbNotificationStorageTimer();
public:
- bool tick();
+ bool tick() override;
};
class LLDoNotDisturbNotificationStorage : public LLParamSingleton<LLDoNotDisturbNotificationStorage>, public LLNotificationStorage
diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp
index 0b9f76e7f6..33325e352f 100644
--- a/indra/newview/lldynamictexture.cpp
+++ b/indra/newview/lldynamictexture.cpp
@@ -200,8 +200,8 @@ bool LLViewerDynamicTexture::updateAllInstances()
}
llassert(preview_target.getWidth() >= LLPipeline::MAX_PREVIEW_WIDTH);
llassert(preview_target.getHeight() >= LLPipeline::MAX_PREVIEW_WIDTH);
- llassert(bake_target.getWidth() >= LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH);
- llassert(bake_target.getHeight() >= LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT);
+ llassert(bake_target.getWidth() >= (U32) LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH);
+ llassert(bake_target.getHeight() >= (U32) LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT);
preview_target.bindTarget();
preview_target.clear();
diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp
index 748e10160c..093f978e74 100644
--- a/indra/newview/llexpandabletextbox.cpp
+++ b/indra/newview/llexpandabletextbox.cpp
@@ -42,9 +42,18 @@ public:
mEditor(editor),
mStyle(style),
mExpanderLabel(utf8str_to_wstring(more_text))
- {}
+ {
+ }
+
+ /*virtual*/ LLTextSegmentPtr clone(LLTextBase& target) const
+ {
+ LLStyleSP sp((&target == &mEditor) ? mStyle : mStyle->clone());
+ LLExpanderSegment* copy = new LLExpanderSegment(sp, mStart, mEnd, LLStringUtil::null, target);
+ copy->mExpanderLabel = mExpanderLabel;
+ return copy;
+ }
- /*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const
+ /*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const
{
// more label always spans width of text box
if (num_chars == 0)
@@ -59,11 +68,13 @@ public:
}
return true;
}
- /*virtual*/ S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const
+
+ /*virtual*/ S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const
{
return start_offset;
}
- /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const
+
+ /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const
{
// require full line to ourselves
if (line_offset == 0)
@@ -77,7 +88,8 @@ public:
return 0;
}
}
- /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect)
+
+ /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect)
{
F32 right_x;
mStyle->getFont()->render(mExpanderLabel, start,
@@ -91,6 +103,7 @@ public:
mEditor.getUseEllipses(), mEditor.getUseColor());
return right_x;
}
+
/*virtual*/ bool canEdit() const { return false; }
// eat handleMouseDown event so we get the mouseup event
/*virtual*/ bool handleMouseDown(S32 x, S32 y, MASK mask) { return true; }
@@ -100,6 +113,7 @@ public:
LLUI::getInstance()->getWindow()->setCursor(UI_CURSOR_HAND);
return true;
}
+
private:
LLTextBase& mEditor;
LLStyleSP mStyle;
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index ce68474211..f3cb07739d 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -58,12 +58,6 @@
#include "llmeshrepository.h"
#include "llskinningutil.h"
-#if LL_LINUX
-// Work-around spurious used before init warning on Vector4a
-//
-#pragma GCC diagnostic ignored "-Wuninitialized"
-#endif
-
#define LL_MAX_INDICES_COUNT 1000000
static LLStaticHashedString sTextureIndexIn("texture_index_in");
@@ -842,7 +836,6 @@ bool LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f,
//VECTORIZE THIS
LLMatrix4a mat_vert;
mat_vert.loadu(mat_vert_in);
- LLVector4a new_extents[2];
llassert(less_than_max_mag(face.mExtents[0]));
llassert(less_than_max_mag(face.mExtents[1]));
@@ -2268,6 +2261,14 @@ bool LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius)
center.mul(0.5f);
size.setSub(mRiggedExtents[1], mRiggedExtents[0]);
}
+ else if (mDrawablep && mVObjp.notNull() && mVObjp->getPartitionType() == LLViewerRegion::PARTITION_PARTICLE && mDrawablep->getSpatialGroup())
+ { // use box of spatial group for particles (over approximates size, but we don't actually have a good size per particle)
+ LLSpatialGroup* group = mDrawablep->getSpatialGroup();
+ const LLVector4a* extents = group->getExtents();
+ size.setSub(extents[1], extents[0]);
+ center.setAdd(extents[1], extents[0]);
+ center.mul(0.5f);
+ }
else
{
center.load3(getPositionAgent().mV);
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 377710c170..49fd6a29a2 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -430,7 +430,7 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p)
{
// Register callback for menus with current registrar (will be parent panel's registrar)
LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Favorites.DoToSelected",
- boost::bind(&LLFavoritesBarCtrl::doToSelected, this, _2));
+ { boost::bind(&LLFavoritesBarCtrl::doToSelected, this, _2), cb_info::UNTRUSTED_BLOCK });
// Add this if we need to selectively enable items
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Favorites.EnableSelected",
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index aa04221f4b..fcc3423b4d 100644
--- a/indra/newview/llfeaturemanager.cpp
+++ b/indra/newview/llfeaturemanager.cpp
@@ -40,6 +40,7 @@
#include "llappviewer.h"
#include "llbufferstream.h"
+#include "llexception.h"
#include "llnotificationsutil.h"
#include "llviewercontrol.h"
#include "llworld.h"
@@ -377,33 +378,6 @@ bool LLFeatureManager::parseFeatureTable(std::string filename)
F32 gpu_benchmark();
-#if LL_WINDOWS
-
-F32 logExceptionBenchmark()
-{
- // FIXME: gpu_benchmark uses many C++ classes on the stack to control state.
- // SEH exceptions with our current exception handling options do not call
- // destructors for these classes, resulting in an undefined state should
- // this handler be invoked.
- F32 gbps = -1;
- __try
- {
- gbps = gpu_benchmark();
- }
- __except (msc_exception_filter(GetExceptionCode(), GetExceptionInformation()))
- {
- // HACK - ensure that profiling is disabled
- LLGLSLShader::finishProfile(false);
-
- // convert to C++ styled exception
- char integer_string[32];
- sprintf(integer_string, "SEH, code: %lu\n", GetExceptionCode());
- throw std::exception(integer_string);
- }
- return gbps;
-}
-#endif
-
bool LLFeatureManager::loadGPUClass()
{
if (!gSavedSettings.getBOOL("SkipBenchmark"))
@@ -413,14 +387,12 @@ bool LLFeatureManager::loadGPUClass()
F32 gbps;
try
{
-#if LL_WINDOWS
- gbps = logExceptionBenchmark();
-#else
- gbps = gpu_benchmark();
-#endif
+ gbps = LL::seh::catcher(gpu_benchmark);
}
catch (const std::exception& e)
{
+ // HACK - ensure that profiling is disabled
+ LLGLSLShader::finishProfile();
gbps = -1.f;
LL_WARNS("RenderInit") << "GPU benchmark failed: " << e.what() << LL_ENDL;
}
@@ -656,6 +628,14 @@ void LLFeatureManager::applyBaseMasks()
{
maskFeatures("Intel");
}
+ if (gGLManager.mIsApple)
+ {
+ maskFeatures("AppleGPU");
+ }
+ else
+ {
+ maskFeatures("NonAppleGPU");
+ }
if (gGLManager.mGLVersion < 3.f)
{
maskFeatures("OpenGLPre30");
diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index 0afb275d13..d5e3627d8e 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -65,6 +65,7 @@ LLFilePicker LLFilePicker::sInstance;
#define MATERIAL_TEXTURES_FILTER L"GLTF Import (*.gltf; *.glb; *.tga; *.bmp; *.jpg; *.jpeg; *.png)\0*.gltf;*.glb;*.tga;*.bmp;*.jpg;*.jpeg;*.png\0"
#define SCRIPT_FILTER L"Script files (*.lsl)\0*.lsl\0"
#define DICTIONARY_FILTER L"Dictionary files (*.dic; *.xcu)\0*.dic;*.xcu\0"
+#define LUA_FILTER L"Script files (*.lua)\0*.lua\0"
#endif
#ifdef LL_DARWIN
@@ -241,6 +242,10 @@ bool LLFilePicker::setupFilter(ELoadFilter filter)
mOFN.lpstrFilter = DICTIONARY_FILTER \
L"\0";
break;
+ case FFLOAD_LUA:
+ mOFN.lpstrFilter = LUA_FILTER \
+ L"\0";
+ break;
default:
res = false;
break;
diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h
index 75ff14f4cf..e0bd32fe70 100644
--- a/indra/newview/llfilepicker.h
+++ b/indra/newview/llfilepicker.h
@@ -54,19 +54,8 @@
#include <commdlg.h>
#endif
-extern "C" {
-// mostly for Linux, possible on others
-#if LL_GTK
-# include "gtk/gtk.h"
-#endif // LL_GTK
-}
-
class LLFilePicker
{
-#ifdef LL_GTK
- friend class LLDirPicker;
- friend void chooser_responder(GtkWidget *, gint, gpointer);
-#endif // LL_GTK
public:
// calling this before main() is undefined
static LLFilePicker& instance( void ) { return sInstance; }
@@ -90,6 +79,7 @@ public:
FFLOAD_MATERIAL = 15,
FFLOAD_MATERIAL_TEXTURE = 16,
FFLOAD_HDRI = 17,
+ FFLOAD_LUA = 18,
};
enum ESaveFilter
@@ -184,14 +174,12 @@ private:
void *userdata);
#endif
-#if LL_GTK
- static void add_to_selectedfiles(gpointer data, gpointer user_data);
- static void chooser_responder(GtkWidget *widget, gint response, gpointer user_data);
- // we remember the last path that was accessed for a particular usage
- std::map <std::string, std::string> mContextToPathMap;
- std::string mCurContextName;
- // we also remember the extension of the last added file.
- std::string mCurrentExtension;
+#if LL_FLTK
+ enum EType
+ {
+ eSaveFile, eOpenFile, eOpenMultiple
+ };
+ bool openFileDialog( int32_t filter, bool blocking, EType aType );
#endif
std::vector<std::string> mFiles;
@@ -200,12 +188,6 @@ private:
static LLFilePicker sInstance;
-protected:
-#if LL_GTK
- GtkWindow* buildFilePicker(bool is_save, bool is_folder,
- std::string context = "generic");
-#endif
-
public:
// don't call these directly please.
LLFilePicker();
diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp
index a87ddfd76e..4608d3913b 100644
--- a/indra/newview/llfloaterauction.cpp
+++ b/indra/newview/llfloaterauction.cpp
@@ -75,10 +75,10 @@ LLFloaterAuction::LLFloaterAuction(const LLSD& key)
: LLFloater(key),
mParcelID(-1)
{
- mCommitCallbackRegistrar.add("ClickSnapshot", boost::bind(&LLFloaterAuction::onClickSnapshot, this));
- mCommitCallbackRegistrar.add("ClickSellToAnyone", boost::bind(&LLFloaterAuction::onClickSellToAnyone, this));
- mCommitCallbackRegistrar.add("ClickStartAuction", boost::bind(&LLFloaterAuction::onClickStartAuction, this));
- mCommitCallbackRegistrar.add("ClickResetParcel", boost::bind(&LLFloaterAuction::onClickResetParcel, this));
+ mCommitCallbackRegistrar.add("ClickSnapshot", { boost::bind(&LLFloaterAuction::onClickSnapshot, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("ClickSellToAnyone", { boost::bind(&LLFloaterAuction::onClickSellToAnyone, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("ClickStartAuction", { boost::bind(&LLFloaterAuction::onClickStartAuction, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("ClickResetParcel", { boost::bind(&LLFloaterAuction::onClickResetParcel, this), cb_info::UNTRUSTED_BLOCK });
}
// Destroys the object
diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp
index 08a54b7369..196c9e8818 100644
--- a/indra/newview/llfloateravatarpicker.cpp
+++ b/indra/newview/llfloateravatarpicker.cpp
@@ -111,7 +111,7 @@ LLFloaterAvatarPicker::LLFloaterAvatarPicker(const LLSD& key)
mContextConeOutAlpha(CONTEXT_CONE_OUT_ALPHA),
mContextConeFadeTime(CONTEXT_CONE_FADE_TIME)
{
- mCommitCallbackRegistrar.add("Refresh.FriendList", boost::bind(&LLFloaterAvatarPicker::populateFriend, this));
+ mCommitCallbackRegistrar.add("Refresh.FriendList", { boost::bind(&LLFloaterAvatarPicker::populateFriend, this), cb_info::UNTRUSTED_THROTTLE });
}
bool LLFloaterAvatarPicker::postBuild()
diff --git a/indra/newview/llfloateravatarrendersettings.cpp b/indra/newview/llfloateravatarrendersettings.cpp
index 9101e6eb29..16e2903324 100644
--- a/indra/newview/llfloateravatarrendersettings.cpp
+++ b/indra/newview/llfloateravatarrendersettings.cpp
@@ -51,7 +51,7 @@ protected:
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
- registrar.add("Settings.SetRendering", boost::bind(&LLFloaterAvatarRenderSettings::onCustomAction, mFloaterSettings, _2, mUUIDs.front()));
+ registrar.add("Settings.SetRendering", { boost::bind(&LLFloaterAvatarRenderSettings::onCustomAction, mFloaterSettings, _2, mUUIDs.front()) });
enable_registrar.add("Settings.IsSelected", boost::bind(&LLFloaterAvatarRenderSettings::isActionChecked, mFloaterSettings, _2, mUUIDs.front()));
LLContextMenu* menu = createFromFile("menu_avatar_rendering_settings.xml");
@@ -75,7 +75,7 @@ LLFloaterAvatarRenderSettings::LLFloaterAvatarRenderSettings(const LLSD& key)
{
mContextMenu = new LLSettingsContextMenu(this);
LLRenderMuteList::getInstance()->addObserver(&sAvatarRenderMuteListObserver);
- mCommitCallbackRegistrar.add("Settings.AddNewEntry", boost::bind(&LLFloaterAvatarRenderSettings::onClickAdd, this, _2));
+ mCommitCallbackRegistrar.add("Settings.AddNewEntry", {boost::bind(&LLFloaterAvatarRenderSettings::onClickAdd, this, _2)});
}
LLFloaterAvatarRenderSettings::~LLFloaterAvatarRenderSettings()
diff --git a/indra/newview/llfloaterbeacons.cpp b/indra/newview/llfloaterbeacons.cpp
index 11c1c2a9f2..1b975f3553 100644
--- a/indra/newview/llfloaterbeacons.cpp
+++ b/indra/newview/llfloaterbeacons.cpp
@@ -49,7 +49,7 @@ LLFloaterBeacons::LLFloaterBeacons(const LLSD& seed)
LLPipeline::setRenderHighlights( gSavedSettings.getBOOL("renderhighlights"));
LLPipeline::setRenderBeacons( gSavedSettings.getBOOL("renderbeacons"));
LLPipeline::setRenderMOAPBeacons( gSavedSettings.getBOOL("moapbeacon"));
- mCommitCallbackRegistrar.add("Beacons.UICheck", boost::bind(&LLFloaterBeacons::onClickUICheck, this,_1));
+ mCommitCallbackRegistrar.add("Beacons.UICheck", { boost::bind(&LLFloaterBeacons::onClickUICheck, this,_1) });
}
bool LLFloaterBeacons::postBuild()
diff --git a/indra/newview/llfloaterbulkpermission.cpp b/indra/newview/llfloaterbulkpermission.cpp
index c09c02d32b..1d670bfb8c 100644
--- a/indra/newview/llfloaterbulkpermission.cpp
+++ b/indra/newview/llfloaterbulkpermission.cpp
@@ -56,12 +56,12 @@ LLFloaterBulkPermission::LLFloaterBulkPermission(const LLSD& seed)
mDone(false)
{
mID.generate();
- mCommitCallbackRegistrar.add("BulkPermission.Ok", boost::bind(&LLFloaterBulkPermission::onOkBtn, this));
- mCommitCallbackRegistrar.add("BulkPermission.Apply", boost::bind(&LLFloaterBulkPermission::onApplyBtn, this));
- mCommitCallbackRegistrar.add("BulkPermission.Close", boost::bind(&LLFloaterBulkPermission::onCloseBtn, this));
- mCommitCallbackRegistrar.add("BulkPermission.CheckAll", boost::bind(&LLFloaterBulkPermission::onCheckAll, this));
- mCommitCallbackRegistrar.add("BulkPermission.UncheckAll", boost::bind(&LLFloaterBulkPermission::onUncheckAll, this));
- mCommitCallbackRegistrar.add("BulkPermission.CommitCopy", boost::bind(&LLFloaterBulkPermission::onCommitCopy, this));
+ mCommitCallbackRegistrar.add("BulkPermission.Ok", { boost::bind(&LLFloaterBulkPermission::onOkBtn, this) });
+ mCommitCallbackRegistrar.add("BulkPermission.Apply", { boost::bind(&LLFloaterBulkPermission::onApplyBtn, this) });
+ mCommitCallbackRegistrar.add("BulkPermission.Close", { boost::bind(&LLFloaterBulkPermission::onCloseBtn, this) });
+ mCommitCallbackRegistrar.add("BulkPermission.CheckAll", { boost::bind(&LLFloaterBulkPermission::onCheckAll, this) });
+ mCommitCallbackRegistrar.add("BulkPermission.UncheckAll", { boost::bind(&LLFloaterBulkPermission::onUncheckAll, this) });
+ mCommitCallbackRegistrar.add("BulkPermission.CommitCopy", { boost::bind(&LLFloaterBulkPermission::onCommitCopy, this) });
}
bool LLFloaterBulkPermission::postBuild()
diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp
index 162ad5e108..d56e6cdf20 100644
--- a/indra/newview/llfloaterbump.cpp
+++ b/indra/newview/llfloaterbump.cpp
@@ -51,18 +51,18 @@
LLFloaterBump::LLFloaterBump(const LLSD& key)
: LLFloater(key)
{
- mCommitCallbackRegistrar.add("Avatar.SendIM", boost::bind(&LLFloaterBump::startIM, this));
- mCommitCallbackRegistrar.add("Avatar.ReportAbuse", boost::bind(&LLFloaterBump::reportAbuse, this));
- mCommitCallbackRegistrar.add("ShowAgentProfile", boost::bind(&LLFloaterBump::showProfile, this));
- mCommitCallbackRegistrar.add("Avatar.InviteToGroup", boost::bind(&LLFloaterBump::inviteToGroup, this));
- mCommitCallbackRegistrar.add("Avatar.Call", boost::bind(&LLFloaterBump::startCall, this));
+ mCommitCallbackRegistrar.add("Avatar.SendIM", { boost::bind(&LLFloaterBump::startIM, this), cb_info::UNTRUSTED_THROTTLE });
+ mCommitCallbackRegistrar.add("Avatar.ReportAbuse", { boost::bind(&LLFloaterBump::reportAbuse, this), cb_info::UNTRUSTED_THROTTLE });
+ mCommitCallbackRegistrar.add("ShowAgentProfile", { boost::bind(&LLFloaterBump::showProfile, this), cb_info::UNTRUSTED_THROTTLE });
+ mCommitCallbackRegistrar.add("Avatar.InviteToGroup", { boost::bind(&LLFloaterBump::inviteToGroup, this), cb_info::UNTRUSTED_THROTTLE });
+ mCommitCallbackRegistrar.add("Avatar.Call", { boost::bind(&LLFloaterBump::startCall, this), cb_info::UNTRUSTED_BLOCK });
mEnableCallbackRegistrar.add("Avatar.EnableCall", boost::bind(&LLAvatarActions::canCall));
- mCommitCallbackRegistrar.add("Avatar.AddFriend", boost::bind(&LLFloaterBump::addFriend, this));
+ mCommitCallbackRegistrar.add("Avatar.AddFriend", { boost::bind(&LLFloaterBump::addFriend, this), cb_info::UNTRUSTED_THROTTLE });
mEnableCallbackRegistrar.add("Avatar.EnableAddFriend", boost::bind(&LLFloaterBump::enableAddFriend, this));
- mCommitCallbackRegistrar.add("Avatar.Mute", boost::bind(&LLFloaterBump::muteAvatar, this));
+ mCommitCallbackRegistrar.add("Avatar.Mute", { boost::bind(&LLFloaterBump::muteAvatar, this), cb_info::UNTRUSTED_BLOCK });
mEnableCallbackRegistrar.add("Avatar.EnableMute", boost::bind(&LLFloaterBump::enableMute, this));
- mCommitCallbackRegistrar.add("PayObject", boost::bind(&LLFloaterBump::payAvatar, this));
- mCommitCallbackRegistrar.add("Tools.LookAtSelection", boost::bind(&LLFloaterBump::zoomInAvatar, this));
+ mCommitCallbackRegistrar.add("PayObject", { boost::bind(&LLFloaterBump::payAvatar, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Tools.LookAtSelection", { boost::bind(&LLFloaterBump::zoomInAvatar, this) });
}
diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp
index 11505e3047..a38cc94328 100644
--- a/indra/newview/llfloaterbuyland.cpp
+++ b/indra/newview/llfloaterbuyland.cpp
@@ -163,6 +163,7 @@ public:
void updateParcelInfo();
void updateCovenantInfo();
static void onChangeAgreeCovenant(LLUICtrl* ctrl, void* user_data);
+ void updateFloaterCovenant(const LLTextBase* source, const LLUUID &asset_id);
void updateFloaterCovenantText(const std::string& string, const LLUUID &asset_id);
void updateFloaterEstateName(const std::string& name);
void updateFloaterLastModified(const std::string& text);
@@ -201,6 +202,8 @@ public:
void onVisibilityChanged ( const LLSD& new_visibility );
+private:
+ void onCovenantTextUpdated(const LLUUID& asset_id);
};
// static
@@ -222,6 +225,15 @@ void LLFloaterBuyLand::buyLand(
}
// static
+void LLFloaterBuyLand::updateCovenant(const LLTextBase* source, const LLUUID& asset_id)
+{
+ if (LLFloaterBuyLandUI* floater = LLFloaterReg::findTypedInstance<LLFloaterBuyLandUI>("buy_land"))
+ {
+ floater->updateFloaterCovenant(source, asset_id);
+ }
+}
+
+// static
void LLFloaterBuyLand::updateCovenantText(const std::string& string, const LLUUID &asset_id)
{
LLFloaterBuyLandUI* floater = LLFloaterReg::findTypedInstance<LLFloaterBuyLandUI>("buy_land");
@@ -560,11 +572,24 @@ void LLFloaterBuyLandUI::onChangeAgreeCovenant(LLUICtrl* ctrl, void* user_data)
}
}
+void LLFloaterBuyLandUI::updateFloaterCovenant(const LLTextBase* source, const LLUUID& asset_id)
+{
+ LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("covenant_editor");
+ editor->copyContents(source);
+
+ onCovenantTextUpdated(asset_id);
+}
+
void LLFloaterBuyLandUI::updateFloaterCovenantText(const std::string &string, const LLUUID& asset_id)
{
LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("covenant_editor");
editor->setText(string);
+ onCovenantTextUpdated(asset_id);
+}
+
+void LLFloaterBuyLandUI::onCovenantTextUpdated(const LLUUID& asset_id)
+{
LLCheckBoxCtrl* check = getChild<LLCheckBoxCtrl>("agree_covenant");
LLTextBox* box = getChild<LLTextBox>("covenant_text");
if (asset_id.isNull())
diff --git a/indra/newview/llfloaterbuyland.h b/indra/newview/llfloaterbuyland.h
index f750a4017a..732312f10f 100644
--- a/indra/newview/llfloaterbuyland.h
+++ b/indra/newview/llfloaterbuyland.h
@@ -27,6 +27,7 @@
#ifndef LL_LLFLOATERBUYLAND_H
#define LL_LLFLOATERBUYLAND_H
+class LLTextBase;
class LLFloater;
class LLViewerRegion;
class LLParcelSelection;
@@ -37,6 +38,7 @@ public:
static void buyLand(LLViewerRegion* region,
LLSafeHandle<LLParcelSelection> parcel,
bool is_for_group);
+ static void updateCovenant(const LLTextBase* source, const LLUUID& asset_id);
static void updateCovenantText(const std::string& string, const LLUUID& asset_id);
static void updateEstateName(const std::string& name);
static void updateLastModified(const std::string& text);
diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp
index 3d81d01e16..b94c31ec04 100644
--- a/indra/newview/llfloaterbvhpreview.cpp
+++ b/indra/newview/llfloaterbvhpreview.cpp
@@ -406,7 +406,7 @@ void LLFloaterBvhPreview::draw()
gGL.getTexUnit(0)->bind(mAnimPreview);
- gGL.begin( LLRender::QUADS );
+ gGL.begin(LLRender::TRIANGLES);
{
gGL.texCoord2f(0.f, 1.f);
gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
@@ -414,6 +414,11 @@ void LLFloaterBvhPreview::draw()
gGL.vertex2i(PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
gGL.texCoord2f(1.f, 0.f);
gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
+
+ gGL.texCoord2f(0.f, 1.f);
+ gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
+ gGL.texCoord2f(1.f, 0.f);
+ gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
gGL.texCoord2f(1.f, 1.f);
gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
}
diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp
index 4a5a755696..2322103009 100644
--- a/indra/newview/llfloatercamera.cpp
+++ b/indra/newview/llfloatercamera.cpp
@@ -169,11 +169,11 @@ static LLPanelInjector<LLPanelCameraZoom> t_camera_zoom_panel("camera_zoom_panel
void LLPanelCameraZoom::onCreate()
{
- mCommitCallbackRegistrar.add("Zoom.minus", boost::bind(&LLPanelCameraZoom::onZoomMinusHeldDown, this));
- mCommitCallbackRegistrar.add("Zoom.plus", boost::bind(&LLPanelCameraZoom::onZoomPlusHeldDown, this));
- mCommitCallbackRegistrar.add("Slider.value_changed", boost::bind(&LLPanelCameraZoom::onSliderValueChanged, this));
- mCommitCallbackRegistrar.add("Camera.track", boost::bind(&LLPanelCameraZoom::onCameraTrack, this));
- mCommitCallbackRegistrar.add("Camera.rotate", boost::bind(&LLPanelCameraZoom::onCameraRotate, this));
+ mCommitCallbackRegistrar.add("Zoom.minus", { boost::bind(&LLPanelCameraZoom::onZoomMinusHeldDown, this) });
+ mCommitCallbackRegistrar.add("Zoom.plus", { boost::bind(&LLPanelCameraZoom::onZoomPlusHeldDown, this) });
+ mCommitCallbackRegistrar.add("Slider.value_changed", { boost::bind(&LLPanelCameraZoom::onSliderValueChanged, this) });
+ mCommitCallbackRegistrar.add("Camera.track", { boost::bind(&LLPanelCameraZoom::onCameraTrack, this) });
+ mCommitCallbackRegistrar.add("Camera.rotate", { boost::bind(&LLPanelCameraZoom::onCameraRotate, this) });
}
bool LLPanelCameraZoom::postBuild()
@@ -461,9 +461,9 @@ LLFloaterCamera::LLFloaterCamera(const LLSD& val)
mPrevMode(CAMERA_CTRL_MODE_PAN)
{
LLHints::getInstance()->registerHintTarget("view_popup", getHandle());
- mCommitCallbackRegistrar.add("CameraPresets.ChangeView", boost::bind(&LLFloaterCamera::onClickCameraItem, _2));
- mCommitCallbackRegistrar.add("CameraPresets.Save", boost::bind(&LLFloaterCamera::onSavePreset, this));
- mCommitCallbackRegistrar.add("CameraPresets.ShowPresetsList", boost::bind(&LLFloaterReg::showInstance, "camera_presets", LLSD(), false));
+ mCommitCallbackRegistrar.add("CameraPresets.ChangeView", {boost::bind(&LLFloaterCamera::onClickCameraItem, _2)});
+ mCommitCallbackRegistrar.add("CameraPresets.Save", {boost::bind(&LLFloaterCamera::onSavePreset, this)});
+ mCommitCallbackRegistrar.add("CameraPresets.ShowPresetsList", {boost::bind(&LLFloaterReg::showInstance, "camera_presets", LLSD(), false)});
}
// virtual
diff --git a/indra/newview/llfloatercamerapresets.cpp b/indra/newview/llfloatercamerapresets.cpp
index b033af2564..d527541b76 100644
--- a/indra/newview/llfloatercamerapresets.cpp
+++ b/indra/newview/llfloatercamerapresets.cpp
@@ -90,8 +90,8 @@ LLCameraPresetFlatItem::LLCameraPresetFlatItem(const std::string &preset_name, b
mPresetName(preset_name),
mIsDefaultPrest(is_default)
{
- mCommitCallbackRegistrar.add("CameraPresets.Delete", boost::bind(&LLCameraPresetFlatItem::onDeleteBtnClick, this));
- mCommitCallbackRegistrar.add("CameraPresets.Reset", boost::bind(&LLCameraPresetFlatItem::onResetBtnClick, this));
+ mCommitCallbackRegistrar.add("CameraPresets.Delete", { boost::bind(&LLCameraPresetFlatItem::onDeleteBtnClick, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("CameraPresets.Reset", { boost::bind(&LLCameraPresetFlatItem::onResetBtnClick, this), cb_info::UNTRUSTED_BLOCK });
buildFromFile("panel_camera_preset_item.xml");
}
diff --git a/indra/newview/llfloaterconversationlog.cpp b/indra/newview/llfloaterconversationlog.cpp
index 97399c9cf7..dc0f4ae555 100644
--- a/indra/newview/llfloaterconversationlog.cpp
+++ b/indra/newview/llfloaterconversationlog.cpp
@@ -35,7 +35,7 @@ LLFloaterConversationLog::LLFloaterConversationLog(const LLSD& key)
: LLFloater(key),
mConversationLogList(NULL)
{
- mCommitCallbackRegistrar.add("CallLog.Action", boost::bind(&LLFloaterConversationLog::onCustomAction, this, _2));
+ mCommitCallbackRegistrar.add("CallLog.Action", { boost::bind(&LLFloaterConversationLog::onCustomAction, this, _2) });
mEnableCallbackRegistrar.add("CallLog.Check", boost::bind(&LLFloaterConversationLog::isActionChecked, this, _2));
}
diff --git a/indra/newview/llfloatercreatelandmark.cpp b/indra/newview/llfloatercreatelandmark.cpp
index 2ce8a7a212..77ea544c5d 100644
--- a/indra/newview/llfloatercreatelandmark.cpp
+++ b/indra/newview/llfloatercreatelandmark.cpp
@@ -31,6 +31,7 @@
#include "llagent.h"
#include "llagentui.h"
#include "llcombobox.h"
+#include "llfloaterreg.h"
#include "llinventoryfunctions.h"
#include "llinventoryobserver.h"
#include "lllandmarkactions.h"
@@ -286,8 +287,7 @@ void LLFloaterCreateLandmark::onCreateFolderClicked()
std::string folder_name = resp["message"].asString();
if (!folder_name.empty())
{
- inventory_func_type func = boost::bind(&LLFloaterCreateLandmark::folderCreatedCallback, this, _1);
- gInventory.createNewCategory(mLandmarksID, LLFolderType::FT_NONE, folder_name, func);
+ gInventory.createNewCategory(mLandmarksID, LLFolderType::FT_NONE, folder_name, folderCreatedCallback);
gInventory.notifyObservers();
}
}
@@ -296,7 +296,11 @@ void LLFloaterCreateLandmark::onCreateFolderClicked()
void LLFloaterCreateLandmark::folderCreatedCallback(LLUUID folder_id)
{
- populateFoldersList(folder_id);
+ LLFloaterCreateLandmark* floater = LLFloaterReg::findTypedInstance<LLFloaterCreateLandmark>("add_landmark");
+ if (floater && !floater->isDead())
+ {
+ floater->populateFoldersList(folder_id);
+ }
}
void LLFloaterCreateLandmark::onSaveClicked()
@@ -389,6 +393,7 @@ void LLFloaterCreateLandmark::setItem(const uuid_set_t& items)
{
mItem = item;
mAssetID = mItem->getAssetUUID();
+ mParentID = mItem->getParentUUID();
setVisibleAndFrontmost(true);
break;
}
@@ -418,8 +423,7 @@ void LLFloaterCreateLandmark::updateItem(const uuid_set_t& items, U32 mask)
closeFloater();
}
- LLUUID folder_id = mFolderCombo->getValue().asUUID();
- if (folder_id != mItem->getParentUUID())
+ if (mParentID != mItem->getParentUUID())
{
// user moved landmark in inventory,
// assume that we are done all other changes should already be commited
diff --git a/indra/newview/llfloatercreatelandmark.h b/indra/newview/llfloatercreatelandmark.h
index fa6d001b8e..bcf9d8578c 100644
--- a/indra/newview/llfloatercreatelandmark.h
+++ b/indra/newview/llfloatercreatelandmark.h
@@ -62,13 +62,14 @@ private:
void onSaveClicked();
void onCancelClicked();
- void folderCreatedCallback(LLUUID folder_id);
+ static void folderCreatedCallback(LLUUID folder_id);
LLComboBox* mFolderCombo;
LLLineEditor* mLandmarkTitleEditor;
LLTextEditor* mNotesEditor;
LLUUID mLandmarksID;
LLUUID mAssetID;
+ LLUUID mParentID;
LLLandmarksInventoryObserver* mInventoryObserver;
LLPointer<LLInventoryItem> mItem;
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index fd58cd8aaf..626f06ce7e 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -183,8 +183,8 @@ LLFloaterEditExtDayCycle::LLFloaterEditExtDayCycle(const LLSD &key) :
mLoadTrack(nullptr),
mClearTrack(nullptr)
{
- mCommitCallbackRegistrar.add(EVNT_DAYTRACK, [this](LLUICtrl *ctrl, const LLSD &data) { onTrackSelectionCallback(data); });
- mCommitCallbackRegistrar.add(EVNT_PLAY, [this](LLUICtrl *ctrl, const LLSD &data) { onPlayActionCallback(data); });
+ mCommitCallbackRegistrar.add(EVNT_DAYTRACK, { [this](LLUICtrl *ctrl, const LLSD &data) { onTrackSelectionCallback(data); }});
+ mCommitCallbackRegistrar.add(EVNT_PLAY, { [this](LLUICtrl *ctrl, const LLSD &data) { onPlayActionCallback(data); }});
mScratchSky = LLSettingsVOSky::buildDefaultSky();
mScratchWater = LLSettingsVOWater::buildDefaultWater();
diff --git a/indra/newview/llfloateremojipicker.cpp b/indra/newview/llfloateremojipicker.cpp
index cc13e5d059..ffbda0265d 100644
--- a/indra/newview/llfloateremojipicker.cpp
+++ b/indra/newview/llfloateremojipicker.cpp
@@ -57,8 +57,7 @@ static const S32 USED_EMOJIS_IMAGE_INDEX = 0x23F2;
// https://www.compart.com/en/unicode/U+1F6D1
static const S32 EMPTY_LIST_IMAGE_INDEX = 0x1F6D1;
// The following categories should follow the required alphabetic order
-static const std::string RECENTLY_USED_CATEGORY = "1 recently used";
-static const std::string FREQUENTLY_USED_CATEGORY = "2 frequently used";
+static const std::string FREQUENTLY_USED_CATEGORY = "frequently used";
// Floater state related variables
static std::list<llwchar> sRecentlyUsed;
@@ -436,6 +435,7 @@ void LLFloaterEmojiPicker::fillGroups()
LLButton::Params params;
params.font = LLFontGL::getFontEmojiLarge();
+ params.name = "all_categories";
LLRect rect;
rect.mTop = mGroups->getRect().getHeight();
@@ -445,11 +445,10 @@ void LLFloaterEmojiPicker::fillGroups()
params.name = "all_categories";
createGroupButton(params, rect, ALL_EMOJIS_IMAGE_INDEX);
- // Create group and button for "Recently used" and/or "Frequently used"
- if (!sRecentlyUsed.empty() || !sFrequentlyUsed.empty())
+ // Create group and button for "Frequently used"
+ if (!sFrequentlyUsed.empty())
{
std::map<std::string, std::vector<LLEmojiSearchResult>> cats;
- fillCategoryRecentlyUsed(cats);
fillCategoryFrequentlyUsed(cats);
if (!cats.empty())
@@ -482,40 +481,6 @@ void LLFloaterEmojiPicker::fillGroups()
resizeGroupButtons();
}
-void LLFloaterEmojiPicker::fillCategoryRecentlyUsed(std::map<std::string, std::vector<LLEmojiSearchResult>>& cats)
-{
- if (sRecentlyUsed.empty())
- return;
-
- std::vector<LLEmojiSearchResult> emojis;
-
- // In case of empty mFilterPattern we'd use sRecentlyUsed directly
- if (!mFilterPattern.empty())
- {
- // List all emojis in "Recently used"
- const LLEmojiDictionary::emoji2descr_map_t& emoji2descr = LLEmojiDictionary::instance().getEmoji2Descr();
- std::size_t begin, end;
- for (llwchar emoji : sRecentlyUsed)
- {
- auto e2d = emoji2descr.find(emoji);
- if (e2d != emoji2descr.end() && !e2d->second->ShortCodes.empty())
- {
- for (const std::string& shortcode : e2d->second->ShortCodes)
- {
- if (LLEmojiDictionary::searchInShortCode(begin, end, shortcode, mFilterPattern))
- {
- emojis.emplace_back(emoji, shortcode, begin, end);
- }
- }
- }
- }
- if (emojis.empty())
- return;
- }
-
- cats.emplace(std::make_pair(RECENTLY_USED_CATEGORY, emojis));
-}
-
void LLFloaterEmojiPicker::fillCategoryFrequentlyUsed(std::map<std::string, std::vector<LLEmojiSearchResult>>& cats)
{
if (sFrequentlyUsed.empty())
@@ -756,7 +721,6 @@ void LLFloaterEmojiPicker::fillEmojisCategory(const std::vector<LLEmojiSearchRes
{
// Place the category title
std::string title =
- category == RECENTLY_USED_CATEGORY ? getString("title_for_recently_used") :
category == FREQUENTLY_USED_CATEGORY ? getString("title_for_frequently_used") :
isupper(category.front()) ? category : LLStringUtil::capitalize(category);
LLEmojiGridDivider* div = new LLEmojiGridDivider(row_panel_params, title);
@@ -769,21 +733,7 @@ void LLFloaterEmojiPicker::fillEmojisCategory(const std::vector<LLEmojiSearchRes
{
const LLEmojiDictionary::emoji2descr_map_t& emoji2descr = LLEmojiDictionary::instance().getEmoji2Descr();
LLEmojiSearchResult emoji { 0, "", 0, 0 };
- if (category == RECENTLY_USED_CATEGORY)
- {
- for (llwchar code : sRecentlyUsed)
- {
- const LLEmojiDictionary::emoji2descr_map_t::const_iterator& e2d = emoji2descr.find(code);
- if (e2d != emoji2descr.end() && !e2d->second->ShortCodes.empty())
- {
- emoji.Character = code;
- emoji.String = e2d->second->ShortCodes.front();
- createEmojiIcon(emoji, category, row_panel_params, row_list_params, icon_params,
- icon_rect, max_icons, bg, row, icon_index);
- }
- }
- }
- else if (category == FREQUENTLY_USED_CATEGORY)
+ if (category == FREQUENTLY_USED_CATEGORY)
{
for (const auto& code : sFrequentlyUsed)
{
diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h
index 669683eb9e..b807adb67d 100644
--- a/indra/newview/llfloateremojipicker.h
+++ b/indra/newview/llfloateremojipicker.h
@@ -60,7 +60,6 @@ public:
private:
void initialize();
void fillGroups();
- void fillCategoryRecentlyUsed(std::map<std::string, std::vector<LLEmojiSearchResult>>& cats);
void fillCategoryFrequentlyUsed(std::map<std::string, std::vector<LLEmojiSearchResult>>& cats);
void fillGroupEmojis(std::map<std::string, std::vector<LLEmojiSearchResult>>& cats, U32 index);
void createGroupButton(LLButton::Params& params, const LLRect& rect, llwchar emoji);
diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp
index 936096d8fe..0ff958c19b 100644
--- a/indra/newview/llfloatergesture.cpp
+++ b/indra/newview/llfloatergesture.cpp
@@ -122,11 +122,11 @@ LLFloaterGesture::LLFloaterGesture(const LLSD& key)
mObserver = new LLFloaterGestureObserver(this);
LLGestureMgr::instance().addObserver(mObserver);
- mCommitCallbackRegistrar.add("Gesture.Action.ToggleActiveState", boost::bind(&LLFloaterGesture::onActivateBtnClick, this));
- mCommitCallbackRegistrar.add("Gesture.Action.ShowPreview", boost::bind(&LLFloaterGesture::onClickEdit, this));
- mCommitCallbackRegistrar.add("Gesture.Action.CopyPaste", boost::bind(&LLFloaterGesture::onCopyPasteAction, this, _2));
- mCommitCallbackRegistrar.add("Gesture.Action.SaveToCOF", boost::bind(&LLFloaterGesture::addToCurrentOutFit, this));
- mCommitCallbackRegistrar.add("Gesture.Action.Rename", boost::bind(&LLFloaterGesture::onRenameSelected, this));
+ mCommitCallbackRegistrar.add("Gesture.Action.ToggleActiveState", { boost::bind(&LLFloaterGesture::onActivateBtnClick, this) });
+ mCommitCallbackRegistrar.add("Gesture.Action.ShowPreview", { boost::bind(&LLFloaterGesture::onClickEdit, this) });
+ mCommitCallbackRegistrar.add("Gesture.Action.CopyPaste", { boost::bind(&LLFloaterGesture::onCopyPasteAction, this, _2) });
+ mCommitCallbackRegistrar.add("Gesture.Action.SaveToCOF", { boost::bind(&LLFloaterGesture::addToCurrentOutFit, this) });
+ mCommitCallbackRegistrar.add("Gesture.Action.Rename", { boost::bind(&LLFloaterGesture::onRenameSelected, this) });
mEnableCallbackRegistrar.add("Gesture.EnableAction", boost::bind(&LLFloaterGesture::isActionEnabled, this, _2));
}
diff --git a/indra/newview/llfloatergltfasseteditor.cpp b/indra/newview/llfloatergltfasseteditor.cpp
index d2cf24f1dd..002fb3996f 100644
--- a/indra/newview/llfloatergltfasseteditor.cpp
+++ b/indra/newview/llfloatergltfasseteditor.cpp
@@ -46,8 +46,8 @@ LLFloaterGLTFAssetEditor::LLFloaterGLTFAssetEditor(const LLSD& key)
{
setTitle("GLTF Asset Editor (WIP)");
- mCommitCallbackRegistrar.add("PanelObject.menuDoToSelected", [this](LLUICtrl* ctrl, const LLSD& data) { onMenuDoToSelected(data); });
- mEnableCallbackRegistrar.add("PanelObject.menuEnable", [this](LLUICtrl* ctrl, const LLSD& data) { return onMenuEnableItem(data); });
+ mCommitCallbackRegistrar.add("PanelObject.menuDoToSelected", { [this](LLUICtrl* ctrl, const LLSD& data) { onMenuDoToSelected(data); }});
+ mEnableCallbackRegistrar.add("PanelObject.menuEnable", { [this](LLUICtrl* ctrl, const LLSD& data) { return onMenuEnableItem(data); }});
}
LLFloaterGLTFAssetEditor::~LLFloaterGLTFAssetEditor()
@@ -209,7 +209,7 @@ void LLFloaterGLTFAssetEditor::loadFromNode(S32 node_id, LLFolderViewFolder* par
std::string name = node.mName;
if (node.mName.empty())
{
- name = getString("node_tittle");
+ name = getString("node_title");
}
else
{
@@ -243,7 +243,7 @@ void LLFloaterGLTFAssetEditor::loadFromNode(S32 node_id, LLFolderViewFolder* par
std::string name = mAsset->mMeshes[node.mMesh].mName;
if (name.empty())
{
- name = getString("mesh_tittle");
+ name = getString("mesh_title");
}
loadItem(node.mMesh, name, LLGLTFFolderItem::TYPE_MESH, view);
}
@@ -253,7 +253,7 @@ void LLFloaterGLTFAssetEditor::loadFromNode(S32 node_id, LLFolderViewFolder* par
std::string name = mAsset->mSkins[node.mSkin].mName;
if (name.empty())
{
- name = getString("skin_tittle");
+ name = getString("skin_title");
}
loadItem(node.mSkin, name, LLGLTFFolderItem::TYPE_SKIN, view);
}
@@ -306,7 +306,7 @@ void LLFloaterGLTFAssetEditor::loadFromSelection()
std::string name = scene.mName;
if (scene.mName.empty())
{
- name = getString("scene_tittle");
+ name = getString("scene_title");
}
else
{
diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp
index 6c1d5b5cca..f2884c3a6e 100644
--- a/indra/newview/llfloatergodtools.cpp
+++ b/indra/newview/llfloatergodtools.cpp
@@ -431,15 +431,15 @@ const F32 PRICE_PER_METER_DEFAULT = 1.f;
LLPanelRegionTools::LLPanelRegionTools()
: LLPanel()
{
- mCommitCallbackRegistrar.add("RegionTools.ChangeAnything", boost::bind(&LLPanelRegionTools::onChangeAnything, this));
- mCommitCallbackRegistrar.add("RegionTools.ChangePrelude", boost::bind(&LLPanelRegionTools::onChangePrelude, this));
- mCommitCallbackRegistrar.add("RegionTools.BakeTerrain", boost::bind(&LLPanelRegionTools::onBakeTerrain, this));
- mCommitCallbackRegistrar.add("RegionTools.RevertTerrain", boost::bind(&LLPanelRegionTools::onRevertTerrain, this));
- mCommitCallbackRegistrar.add("RegionTools.SwapTerrain", boost::bind(&LLPanelRegionTools::onSwapTerrain, this));
- mCommitCallbackRegistrar.add("RegionTools.Refresh", boost::bind(&LLPanelRegionTools::onRefresh, this));
- mCommitCallbackRegistrar.add("RegionTools.ApplyChanges", boost::bind(&LLPanelRegionTools::onApplyChanges, this));
- mCommitCallbackRegistrar.add("RegionTools.SelectRegion", boost::bind(&LLPanelRegionTools::onSelectRegion, this));
- mCommitCallbackRegistrar.add("RegionTools.SaveState", boost::bind(&LLPanelRegionTools::onSaveState, this));
+ mCommitCallbackRegistrar.add("RegionTools.ChangeAnything", { boost::bind(&LLPanelRegionTools::onChangeAnything, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("RegionTools.ChangePrelude", { boost::bind(&LLPanelRegionTools::onChangePrelude, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("RegionTools.BakeTerrain", { boost::bind(&LLPanelRegionTools::onBakeTerrain, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("RegionTools.RevertTerrain", { boost::bind(&LLPanelRegionTools::onRevertTerrain, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("RegionTools.SwapTerrain", { boost::bind(&LLPanelRegionTools::onSwapTerrain, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("RegionTools.Refresh", { boost::bind(&LLPanelRegionTools::onRefresh, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("RegionTools.ApplyChanges", { boost::bind(&LLPanelRegionTools::onApplyChanges, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("RegionTools.SelectRegion", { boost::bind(&LLPanelRegionTools::onSelectRegion, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("RegionTools.SaveState", { boost::bind(&LLPanelRegionTools::onSaveState, this), cb_info::UNTRUSTED_BLOCK });
}
bool LLPanelRegionTools::postBuild()
@@ -854,7 +854,8 @@ void LLPanelRegionTools::onSelectRegion()
LLPanelGridTools::LLPanelGridTools() :
LLPanel()
{
- mCommitCallbackRegistrar.add("GridTools.FlushMapVisibilityCaches", boost::bind(&LLPanelGridTools::onClickFlushMapVisibilityCaches, this));
+ mCommitCallbackRegistrar.add("GridTools.FlushMapVisibilityCaches",
+ { boost::bind(&LLPanelGridTools::onClickFlushMapVisibilityCaches, this), cb_info::UNTRUSTED_BLOCK });
}
// Destroys the object
@@ -929,15 +930,15 @@ LLPanelObjectTools::LLPanelObjectTools()
: LLPanel(),
mTargetAvatar()
{
- mCommitCallbackRegistrar.add("ObjectTools.ChangeAnything", boost::bind(&LLPanelObjectTools::onChangeAnything, this));
- mCommitCallbackRegistrar.add("ObjectTools.DeletePublicOwnedBy", boost::bind(&LLPanelObjectTools::onClickDeletePublicOwnedBy, this));
- mCommitCallbackRegistrar.add("ObjectTools.DeleteAllScriptedOwnedBy", boost::bind(&LLPanelObjectTools::onClickDeleteAllScriptedOwnedBy, this));
- mCommitCallbackRegistrar.add("ObjectTools.DeleteAllOwnedBy", boost::bind(&LLPanelObjectTools::onClickDeleteAllOwnedBy, this));
- mCommitCallbackRegistrar.add("ObjectTools.ApplyChanges", boost::bind(&LLPanelObjectTools::onApplyChanges, this));
- mCommitCallbackRegistrar.add("ObjectTools.Set", boost::bind(&LLPanelObjectTools::onClickSet, this));
- mCommitCallbackRegistrar.add("ObjectTools.GetTopColliders", boost::bind(&LLPanelObjectTools::onGetTopColliders, this));
- mCommitCallbackRegistrar.add("ObjectTools.GetTopScripts", boost::bind(&LLPanelObjectTools::onGetTopScripts, this));
- mCommitCallbackRegistrar.add("ObjectTools.GetScriptDigest", boost::bind(&LLPanelObjectTools::onGetScriptDigest, this));
+ mCommitCallbackRegistrar.add("ObjectTools.ChangeAnything", { boost::bind(&LLPanelObjectTools::onChangeAnything, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("ObjectTools.DeletePublicOwnedBy", { boost::bind(&LLPanelObjectTools::onClickDeletePublicOwnedBy, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("ObjectTools.DeleteAllScriptedOwnedBy", { boost::bind(&LLPanelObjectTools::onClickDeleteAllScriptedOwnedBy, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("ObjectTools.DeleteAllOwnedBy", { boost::bind(&LLPanelObjectTools::onClickDeleteAllOwnedBy, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("ObjectTools.ApplyChanges", { boost::bind(&LLPanelObjectTools::onApplyChanges, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("ObjectTools.Set", { boost::bind(&LLPanelObjectTools::onClickSet, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("ObjectTools.GetTopColliders", { boost::bind(&LLPanelObjectTools::onGetTopColliders, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("ObjectTools.GetTopScripts", { boost::bind(&LLPanelObjectTools::onGetTopScripts, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("ObjectTools.GetScriptDigest", { boost::bind(&LLPanelObjectTools::onGetScriptDigest, this), cb_info::UNTRUSTED_BLOCK });
}
// Destroys the object
@@ -1224,7 +1225,7 @@ const std::string AGENT_REGION = "Agent Region";
LLPanelRequestTools::LLPanelRequestTools():
LLPanel()
{
- mCommitCallbackRegistrar.add("GodTools.Request", boost::bind(&LLPanelRequestTools::onClickRequest, this));
+ mCommitCallbackRegistrar.add("GodTools.Request", {boost::bind(&LLPanelRequestTools::onClickRequest, this), cb_info::UNTRUSTED_BLOCK });
}
LLPanelRequestTools::~LLPanelRequestTools()
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp
index 711c33e73d..989e1d8d04 100644
--- a/indra/newview/llfloaterimagepreview.cpp
+++ b/indra/newview/llfloaterimagepreview.cpp
@@ -285,7 +285,7 @@ void LLFloaterImagePreview::draw()
}
gGL.color3f(1.f, 1.f, 1.f);
- gGL.begin( LLRender::QUADS );
+ gGL.begin(LLRender::TRIANGLES);
{
gGL.texCoord2f(mPreviewImageRect.mLeft, mPreviewImageRect.mTop);
gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
@@ -293,6 +293,11 @@ void LLFloaterImagePreview::draw()
gGL.vertex2i(PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
gGL.texCoord2f(mPreviewImageRect.mRight, mPreviewImageRect.mBottom);
gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
+
+ gGL.texCoord2f(mPreviewImageRect.mRight, mPreviewImageRect.mBottom);
+ gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
+ gGL.texCoord2f(mPreviewImageRect.mLeft, mPreviewImageRect.mTop);
+ gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
gGL.texCoord2f(mPreviewImageRect.mRight, mPreviewImageRect.mTop);
gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
}
@@ -317,7 +322,7 @@ void LLFloaterImagePreview::draw()
gGL.getTexUnit(0)->bind(mAvatarPreview);
}
- gGL.begin( LLRender::QUADS );
+ gGL.begin(LLRender::TRIANGLES);
{
gGL.texCoord2f(0.f, 1.f);
gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
@@ -325,6 +330,11 @@ void LLFloaterImagePreview::draw()
gGL.vertex2i(PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
gGL.texCoord2f(1.f, 0.f);
gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
+
+ gGL.texCoord2f(1.f, 0.f);
+ gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
+ gGL.texCoord2f(0.f, 1.f);
+ gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
gGL.texCoord2f(1.f, 1.f);
gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
}
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index e55bf50724..1e2d790cfc 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -76,14 +76,14 @@ LLFloaterIMContainer::LLFloaterIMContainer(const LLSD& seed, const Params& param
mConversationEventQueue()
{
mEnableCallbackRegistrar.add("IMFloaterContainer.Check", boost::bind(&LLFloaterIMContainer::isActionChecked, this, _2));
- mCommitCallbackRegistrar.add("IMFloaterContainer.Action", boost::bind(&LLFloaterIMContainer::onCustomAction, this, _2));
+ mCommitCallbackRegistrar.add("IMFloaterContainer.Action", { boost::bind(&LLFloaterIMContainer::onCustomAction, this, _2) });
mEnableCallbackRegistrar.add("Avatar.CheckItem", boost::bind(&LLFloaterIMContainer::checkContextMenuItem, this, _2));
mEnableCallbackRegistrar.add("Avatar.EnableItem", boost::bind(&LLFloaterIMContainer::enableContextMenuItem, this, _2));
mEnableCallbackRegistrar.add("Avatar.VisibleItem", boost::bind(&LLFloaterIMContainer::visibleContextMenuItem, this, _2));
- mCommitCallbackRegistrar.add("Avatar.DoToSelected", boost::bind(&LLFloaterIMContainer::doToSelected, this, _2));
+ mCommitCallbackRegistrar.add("Avatar.DoToSelected", { boost::bind(&LLFloaterIMContainer::doToSelected, this, _2) });
- mCommitCallbackRegistrar.add("Group.DoToSelected", boost::bind(&LLFloaterIMContainer::doToSelectedGroup, this, _2));
+ mCommitCallbackRegistrar.add("Group.DoToSelected", { boost::bind(&LLFloaterIMContainer::doToSelectedGroup, this, _2) });
// Firstly add our self to IMSession observers, so we catch session events
LLIMMgr::getInstance()->addSessionObserver(this);
diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp
index 28c651f0cd..6c3e8391cd 100644
--- a/indra/newview/llfloaterimnearbychat.cpp
+++ b/indra/newview/llfloaterimnearbychat.cpp
@@ -52,6 +52,7 @@
#include "llfirstuse.h"
#include "llfloaterimnearbychat.h"
+#include "llfloaterimnearbychatlistener.h"
#include "llagent.h" // gAgent
#include "llgesturemgr.h"
#include "llmultigesture.h"
@@ -71,6 +72,8 @@
S32 LLFloaterIMNearbyChat::sLastSpecialChatChannel = 0;
+static LLFloaterIMNearbyChatListener sChatListener;
+
constexpr S32 EXPANDED_HEIGHT = 266;
constexpr S32 COLLAPSED_HEIGHT = 60;
constexpr S32 EXPANDED_MIN_HEIGHT = 150;
@@ -106,7 +109,7 @@ LLFloaterIMNearbyChat::LLFloaterIMNearbyChat(const LLSD& llsd)
// Required by LLFloaterIMSessionTab::mGearBtn
// But nearby floater has no 'per agent' menu items,
mEnableCallbackRegistrar.add("Avatar.EnableGearItem", boost::bind(&cb_do_nothing));
- mCommitCallbackRegistrar.add("Avatar.GearDoToSelected", boost::bind(&cb_do_nothing));
+ mCommitCallbackRegistrar.add("Avatar.GearDoToSelected", { boost::bind(&cb_do_nothing) });
mEnableCallbackRegistrar.add("Avatar.CheckGearItem", boost::bind(&cb_do_nothing));
mMinFloaterHeight = EXPANDED_MIN_HEIGHT;
diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp
index c920a3c898..20bf896562 100644
--- a/indra/newview/llfloaterimnearbychathandler.cpp
+++ b/indra/newview/llfloaterimnearbychathandler.cpp
@@ -300,12 +300,13 @@ void LLFloaterIMNearbyChatScreenChannel::addChat(LLSD& chat)
{
LLUUID fromID = chat["from_id"].asUUID(); // agent id or object id
std::string from = chat["from"].asString();
+ bool is_lua = chat["is_lua"].asBoolean();
LLToast* toast = m_active_toasts[0].get();
if (toast)
{
LLFloaterIMNearbyChatToastPanel* panel = dynamic_cast<LLFloaterIMNearbyChatToastPanel*>(toast->getPanel());
- if (panel && panel->messageID() == fromID && panel->getFromName() == from && panel->canAddText())
+ if (panel && panel->messageID() == fromID && panel->getFromName() == from && panel->isFromScript() == is_lua && panel->canAddText())
{
panel->addMessage(chat);
toast->reshapeToPanel();
@@ -596,17 +597,22 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
{
// Handle IRC styled messages.
std::string toast_msg;
+ std::string msg_text = without_LUA_PREFIX(chat_msg.mText, chat_msg.mIsScript);
if (chat_msg.mChatStyle == CHAT_STYLE_IRC)
{
+ if (chat_msg.mIsScript)
+ {
+ toast_msg += LLTrans::getString("ScriptStr");
+ }
if (!chat_msg.mFromName.empty())
{
toast_msg += chat_msg.mFromName;
}
- toast_msg += chat_msg.mText.substr(3);
+ toast_msg += msg_text.substr(3);
}
else
{
- toast_msg = chat_msg.mText;
+ toast_msg = msg_text;
}
bool chat_overlaps = false;
@@ -666,6 +672,7 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
chat["color_alpha"] = r_color_alpha;
chat["font_size"] = (S32)LLViewerChat::getChatFontSize() ;
chat["message"] = toast_msg;
+ chat["is_lua"] = chat_msg.mIsScript;
channel->addChat(chat);
}
diff --git a/indra/newview/llfloaterimnearbychatlistener.cpp b/indra/newview/llfloaterimnearbychatlistener.cpp
index 43173d3680..0618741cc4 100644
--- a/indra/newview/llfloaterimnearbychatlistener.cpp
+++ b/indra/newview/llfloaterimnearbychatlistener.cpp
@@ -34,12 +34,14 @@
#include "llagent.h"
#include "llchat.h"
#include "llviewercontrol.h"
+#include "stringize.h"
+static const F32 CHAT_THROTTLE_PERIOD = 1.f;
-LLFloaterIMNearbyChatListener::LLFloaterIMNearbyChatListener(LLFloaterIMNearbyChat & chatbar)
+LLFloaterIMNearbyChatListener::LLFloaterIMNearbyChatListener()
: LLEventAPI("LLChatBar",
"LLChatBar listener to (e.g.) sendChat, etc."),
- mChatbar(chatbar)
+ mLastThrottleTime(0)
{
add("sendChat",
"Send chat to the simulator:\n"
@@ -51,10 +53,19 @@ LLFloaterIMNearbyChatListener::LLFloaterIMNearbyChatListener(LLFloaterIMNearbyCh
// "sendChat" command
-void LLFloaterIMNearbyChatListener::sendChat(LLSD const & chat_data) const
+void LLFloaterIMNearbyChatListener::sendChat(LLSD const & chat_data)
{
+ F64 cur_time = LLTimer::getElapsedSeconds();
+
+ if (cur_time < mLastThrottleTime + CHAT_THROTTLE_PERIOD)
+ {
+ LL_DEBUGS("LLFloaterIMNearbyChatListener") << "'sendChat' was throttled" << LL_ENDL;
+ return;
+ }
+ mLastThrottleTime = cur_time;
+
// Extract the data
- std::string chat_text = chat_data["message"].asString();
+ std::string chat_text = LUA_PREFIX + chat_data["message"].asString();
S32 channel = 0;
if (chat_data.has("channel"))
@@ -81,20 +92,14 @@ void LLFloaterIMNearbyChatListener::sendChat(LLSD const & chat_data) const
}
// Have to prepend /42 style channel numbers
- std::string chat_to_send;
- if (channel == 0)
- {
- chat_to_send = chat_text;
- }
- else
+ if (channel)
{
- chat_to_send += "/";
- chat_to_send += chat_data["channel"].asString();
- chat_to_send += " ";
- chat_to_send += chat_text;
+ chat_text = stringize("/", chat_data["channel"].asString(), " ", chat_text);
}
// Send it as if it was typed in
- mChatbar.sendChatFromViewer(chat_to_send, type_o_chat, ((bool)(channel == 0)) && gSavedSettings.getBOOL("PlayChatAnim"));
+ LLFloaterIMNearbyChat::sendChatFromViewer(chat_text, type_o_chat,
+ (channel == 0) &&
+ gSavedSettings.getBOOL("PlayChatAnim"));
}
diff --git a/indra/newview/llfloaterimnearbychatlistener.h b/indra/newview/llfloaterimnearbychatlistener.h
index 96184d95b3..18a8bacfaa 100644
--- a/indra/newview/llfloaterimnearbychatlistener.h
+++ b/indra/newview/llfloaterimnearbychatlistener.h
@@ -38,12 +38,12 @@ class LLFloaterIMNearbyChat;
class LLFloaterIMNearbyChatListener : public LLEventAPI
{
public:
- LLFloaterIMNearbyChatListener(LLFloaterIMNearbyChat & chatbar);
+ LLFloaterIMNearbyChatListener();
private:
- void sendChat(LLSD const & chat_data) const;
+ void sendChat(LLSD const & chat_data);
- LLFloaterIMNearbyChat & mChatbar;
+ F64 mLastThrottleTime{ 0.0 };
};
#endif // LL_LLFLOATERIMNEARBYCHATLISTENER_H
diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp
index 97e0d01b52..e85aac3810 100644
--- a/indra/newview/llfloaterimsession.cpp
+++ b/indra/newview/llfloaterimsession.cpp
@@ -92,7 +92,7 @@ LLFloaterIMSession::LLFloaterIMSession(const LLUUID& session_id)
LLTransientFloaterMgr::getInstance()->addControlView(LLTransientFloaterMgr::IM, this);
mEnableCallbackRegistrar.add("Avatar.EnableGearItem", boost::bind(&LLFloaterIMSession::enableGearMenuItem, this, _2));
- mCommitCallbackRegistrar.add("Avatar.GearDoToSelected", boost::bind(&LLFloaterIMSession::GearDoToSelected, this, _2));
+ mCommitCallbackRegistrar.add("Avatar.GearDoToSelected", { boost::bind(&LLFloaterIMSession::GearDoToSelected, this, _2), cb_info::UNTRUSTED_BLOCK });
mEnableCallbackRegistrar.add("Avatar.CheckGearItem", boost::bind(&LLFloaterIMSession::checkGearMenuItem, this, _2));
mVoiceChannelChanged = LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLFloaterIMSession::onVoiceChannelChanged, this, _1));
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index fe0916bf15..b2f2984c65 100644
--- a/indra/newview/llfloaterimsessiontab.cpp
+++ b/indra/newview/llfloaterimsessiontab.cpp
@@ -82,7 +82,7 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id)
mSession = LLIMModel::getInstance()->findIMSession(mSessionID);
mCommitCallbackRegistrar.add("IMSession.Menu.Action",
- boost::bind(&LLFloaterIMSessionTab::onIMSessionMenuItemClicked, this, _2));
+ { boost::bind(&LLFloaterIMSessionTab::onIMSessionMenuItemClicked, this, _2) });
mEnableCallbackRegistrar.add("IMSession.Menu.CompactExpandedModes.CheckItem",
boost::bind(&LLFloaterIMSessionTab::onIMCompactExpandedMenuItemCheck, this, _2));
mEnableCallbackRegistrar.add("IMSession.Menu.ShowModes.CheckItem",
@@ -93,8 +93,8 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id)
// Right click menu handling
mEnableCallbackRegistrar.add("Avatar.CheckItem", boost::bind(&LLFloaterIMSessionTab::checkContextMenuItem, this, _2));
mEnableCallbackRegistrar.add("Avatar.EnableItem", boost::bind(&LLFloaterIMSessionTab::enableContextMenuItem, this, _2));
- mCommitCallbackRegistrar.add("Avatar.DoToSelected", boost::bind(&LLFloaterIMSessionTab::doToSelected, this, _2));
- mCommitCallbackRegistrar.add("Group.DoToSelected", boost::bind(&cb_group_do_nothing));
+ mCommitCallbackRegistrar.add("Avatar.DoToSelected", { boost::bind(&LLFloaterIMSessionTab::doToSelected, this, _2) });
+ mCommitCallbackRegistrar.add("Group.DoToSelected", { boost::bind(&cb_group_do_nothing) });
mMinFloaterHeight = getMinHeight();
}
diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp
index 4f993ca0e1..0f1eb0cef0 100644
--- a/indra/newview/llfloaterinspect.cpp
+++ b/indra/newview/llfloaterinspect.cpp
@@ -51,9 +51,9 @@ LLFloaterInspect::LLFloaterInspect(const LLSD& key)
mOwnerNameCacheConnection(),
mCreatorNameCacheConnection()
{
- mCommitCallbackRegistrar.add("Inspect.OwnerProfile", boost::bind(&LLFloaterInspect::onClickOwnerProfile, this));
- mCommitCallbackRegistrar.add("Inspect.CreatorProfile", boost::bind(&LLFloaterInspect::onClickCreatorProfile, this));
- mCommitCallbackRegistrar.add("Inspect.SelectObject", boost::bind(&LLFloaterInspect::onSelectObject, this));
+ mCommitCallbackRegistrar.add("Inspect.OwnerProfile", { boost::bind(&LLFloaterInspect::onClickOwnerProfile, this) });
+ mCommitCallbackRegistrar.add("Inspect.CreatorProfile", { boost::bind(&LLFloaterInspect::onClickCreatorProfile, this) });
+ mCommitCallbackRegistrar.add("Inspect.SelectObject", { boost::bind(&LLFloaterInspect::onSelectObject, this) });
}
bool LLFloaterInspect::postBuild()
diff --git a/indra/newview/llfloaterlagmeter.cpp b/indra/newview/llfloaterlagmeter.cpp
index 28fa8dea9a..26d7e3ead2 100644
--- a/indra/newview/llfloaterlagmeter.cpp
+++ b/indra/newview/llfloaterlagmeter.cpp
@@ -47,7 +47,7 @@ const std::string LAG_GOOD_IMAGE_NAME = "lag_status_good.tga";
LLFloaterLagMeter::LLFloaterLagMeter(const LLSD& key)
: LLFloater(key)
{
- mCommitCallbackRegistrar.add("LagMeter.ClickShrink", boost::bind(&LLFloaterLagMeter::onClickShrink, this));
+ mCommitCallbackRegistrar.add("LagMeter.ClickShrink", { boost::bind(&LLFloaterLagMeter::onClickShrink, this) });
}
bool LLFloaterLagMeter::postBuild()
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index bec76fe5e4..52a3e78d04 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -3124,6 +3124,16 @@ void LLPanelLandCovenant::refresh()
}
// static
+void LLPanelLandCovenant::updateCovenant(const LLTextBase* source)
+{
+ if (LLPanelLandCovenant* self = LLFloaterLand::getCurrentPanelLandCovenant())
+ {
+ LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("covenant_editor");
+ editor->copyContents(source);
+ }
+}
+
+// static
void LLPanelLandCovenant::updateCovenantText(const std::string &string)
{
LLPanelLandCovenant* self = LLFloaterLand::getCurrentPanelLandCovenant();
diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h
index 95f6a44a94..8af0caab33 100644
--- a/indra/newview/llfloaterland.h
+++ b/indra/newview/llfloaterland.h
@@ -50,6 +50,7 @@ class LLRadioGroup;
class LLParcelSelectionObserver;
class LLSpinCtrl;
class LLTabContainer;
+class LLTextBase;
class LLTextBox;
class LLTextEditor;
class LLTextureCtrl;
@@ -416,6 +417,7 @@ public:
virtual ~LLPanelLandCovenant();
virtual bool postBuild();
void refresh();
+ static void updateCovenant(const LLTextBase* source);
static void updateCovenantText(const std::string& string);
static void updateEstateName(const std::string& name);
static void updateLastModified(const std::string& text);
diff --git a/indra/newview/llfloaterlinkreplace.cpp b/indra/newview/llfloaterlinkreplace.cpp
index c961070787..71dcc3d114 100644
--- a/indra/newview/llfloaterlinkreplace.cpp
+++ b/indra/newview/llfloaterlinkreplace.cpp
@@ -45,7 +45,7 @@ LLFloaterLinkReplace::LLFloaterLinkReplace(const LLSD& key)
mTargetUUID(LLUUID::null),
mBatchSize(gSavedSettings.getU32("LinkReplaceBatchSize"))
{
- mEventTimer.stop();
+ stop();
}
LLFloaterLinkReplace::~LLFloaterLinkReplace()
@@ -202,7 +202,7 @@ void LLFloaterLinkReplace::onStartClickedResponse(const LLSD& notification, cons
mStartBtn->setEnabled(false);
mRefreshBtn->setEnabled(false);
- mEventTimer.start();
+ start();
tick();
}
else
@@ -298,7 +298,7 @@ void LLFloaterLinkReplace::decreaseOpenItemCount()
mStatusText->setText(getString("ReplaceFinished"));
mStartBtn->setEnabled(true);
mRefreshBtn->setEnabled(true);
- mEventTimer.stop();
+ stop();
LL_INFOS() << "Inventory link replace finished." << LL_ENDL;
}
else
@@ -320,7 +320,7 @@ bool LLFloaterLinkReplace::tick()
{
if (!mRemainingInventoryItems.size())
{
- mEventTimer.stop();
+ stop();
break;
}
diff --git a/indra/newview/llfloaterlinkreplace.h b/indra/newview/llfloaterlinkreplace.h
index 7f9f0b59e1..31df083a11 100644
--- a/indra/newview/llfloaterlinkreplace.h
+++ b/indra/newview/llfloaterlinkreplace.h
@@ -86,10 +86,10 @@ public:
LLFloaterLinkReplace(const LLSD& key);
virtual ~LLFloaterLinkReplace();
- bool postBuild();
- virtual void onOpen(const LLSD& key);
+ bool postBuild() override;
+ void onOpen(const LLSD& key) override;
- virtual bool tick();
+ bool tick() override;
private:
void checkEnableStart();
diff --git a/indra/newview/llfloaterluadebug.cpp b/indra/newview/llfloaterluadebug.cpp
new file mode 100644
index 0000000000..06877df816
--- /dev/null
+++ b/indra/newview/llfloaterluadebug.cpp
@@ -0,0 +1,168 @@
+/**
+ * @file llfloaterluadebug.cpp
+ *
+ * $LicenseInfo:firstyear=2023&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2023, 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 "llfloaterluadebug.h"
+
+#include "lllineeditor.h"
+#include "lltexteditor.h"
+#include "llviewermenufile.h" // LLFilePickerReplyThread
+
+#include "llagent.h"
+#include "llappearancemgr.h"
+#include "llfloaterreg.h"
+#include "llfloaterimnearbychat.h"
+
+#include "llluamanager.h"
+#include "llsdutil.h"
+#include "lua_function.h"
+#include "stringize.h"
+#include "tempset.h"
+
+
+LLFloaterLUADebug::LLFloaterLUADebug(const LLSD &key)
+ : LLFloater(key)
+{
+}
+
+
+bool LLFloaterLUADebug::postBuild()
+{
+ mResultOutput = getChild<LLTextEditor>("result_text");
+ mLineInput = getChild<LLLineEditor>("lua_cmd");
+ mScriptPath = getChild<LLLineEditor>("script_path");
+ mOutConnection = LLEventPumps::instance().obtain("lua output")
+ .listen("LLFloaterLUADebug",
+ [mResultOutput=mResultOutput](const LLSD& data)
+ {
+ mResultOutput->pasteTextWithLinebreaks(data.asString());
+ mResultOutput->addLineBreakChar(true);
+ return false;
+ });
+
+ getChild<LLButton>("execute_btn")->setClickedCallback(boost::bind(&LLFloaterLUADebug::onExecuteClicked, this));
+ getChild<LLButton>("browse_btn")->setClickedCallback(boost::bind(&LLFloaterLUADebug::onBtnBrowse, this));
+ getChild<LLButton>("run_btn")->setClickedCallback(boost::bind(&LLFloaterLUADebug::onBtnRun, this));
+ mLineInput->setCommitCallback(boost::bind(&LLFloaterLUADebug::onExecuteClicked, this));
+ mLineInput->setSelectAllonCommit(false);
+
+ return true;
+}
+
+LLFloaterLUADebug::~LLFloaterLUADebug()
+{}
+
+void LLFloaterLUADebug::onExecuteClicked()
+{
+ // Empirically, running Lua code that indirectly invokes the
+ // "LLNotifications" listener can result (via mysterious labyrinthine
+ // viewer UI byways) in a recursive call to this handler. We've seen Bad
+ // Things happen to the viewer with a second call to runScriptLine() with
+ // the same cmd on the same LuaState.
+ if (mExecuting)
+ {
+ LL_DEBUGS("Lua") << "recursive call to onExecuteClicked()" << LL_ENDL;
+ return;
+ }
+ TempSet executing(mExecuting, true);
+ mResultOutput->setValue("");
+
+ std::string cmd = mLineInput->getText();
+ LLLUAmanager::runScriptLine(cmd, [this](int count, const LLSD& result)
+ {
+ completion(count, result);
+ });
+}
+
+void LLFloaterLUADebug::onBtnBrowse()
+{
+ LLFilePickerReplyThread::startPicker(boost::bind(&LLFloaterLUADebug::runSelectedScript, this, _1), LLFilePicker::FFLOAD_LUA, false);
+}
+
+void LLFloaterLUADebug::onBtnRun()
+{
+ std::vector<std::string> filenames;
+ std::string filepath = mScriptPath->getText();
+ if (!filepath.empty())
+ {
+ filenames.push_back(filepath);
+ runSelectedScript(filenames);
+ }
+}
+
+void LLFloaterLUADebug::runSelectedScript(const std::vector<std::string> &filenames)
+{
+ if (mExecuting)
+ {
+ LL_DEBUGS("Lua") << "recursive call to runSelectedScript()" << LL_ENDL;
+ return;
+ }
+ TempSet executing(mExecuting, true);
+ mResultOutput->setValue("");
+
+ std::string filepath = filenames[0];
+ if (!filepath.empty())
+ {
+ mScriptPath->setText(filepath);
+ LLLUAmanager::runScriptFile(filepath, false, [this](int count, const LLSD &result)
+ {
+ completion(count, result);
+ });
+ }
+}
+
+void LLFloaterLUADebug::completion(int count, const LLSD& result)
+{
+ if (count < 0)
+ {
+ // error: show error message
+ LLStyle::Params params;
+ params.readonly_color = LLUIColorTable::instance().getColor("LtRed");
+ mResultOutput->appendText(result.asString(), false, params);
+ mResultOutput->endOfDoc();
+ return;
+ }
+ if (count == 0)
+ {
+ // no results
+ mResultOutput->pasteTextWithLinebreaks(stringize("ok ", ++mAck));
+ return;
+ }
+ if (count == 1)
+ {
+ // single result
+ mResultOutput->pasteTextWithLinebreaks(stringize(result));
+ return;
+ }
+ // multiple results
+ const char* sep = "";
+ for (const auto& item : llsd::inArray(result))
+ {
+ mResultOutput->insertText(sep);
+ mResultOutput->pasteTextWithLinebreaks(stringize(item));
+ sep = ", ";
+ }
+}
diff --git a/indra/newview/llfloaterluadebug.h b/indra/newview/llfloaterluadebug.h
new file mode 100644
index 0000000000..e27c63b74d
--- /dev/null
+++ b/indra/newview/llfloaterluadebug.h
@@ -0,0 +1,72 @@
+/**
+ * @file llfloaterluadebug.h
+ *
+ * $LicenseInfo:firstyear=2023&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2023, 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_LLFLOATERLUADEBUG_H
+#define LL_LLFLOATERLUADEBUG_H
+
+#include "llevents.h"
+#include "llfloater.h"
+#include "lua_function.h"
+
+extern "C"
+{
+#include "luau/luacode.h"
+#include "luau/lua.h"
+#include "luau/luaconf.h"
+#include "luau/lualib.h"
+}
+
+class LLLineEditor;
+class LLTextEditor;
+
+class LLFloaterLUADebug :
+ public LLFloater
+{
+ public:
+ LLFloaterLUADebug(const LLSD& key);
+ virtual ~LLFloaterLUADebug();
+
+ /*virtual*/ bool postBuild();
+
+ void onExecuteClicked();
+ void onBtnBrowse();
+ void onBtnRun();
+
+ void runSelectedScript(const std::vector<std::string> &filenames);
+
+private:
+ void completion(int count, const LLSD& result);
+
+ LLTempBoundListener mOutConnection;
+
+ LLTextEditor* mResultOutput;
+ LLLineEditor* mLineInput;
+ LLLineEditor* mScriptPath;
+ U32 mAck{ 0 };
+ bool mExecuting{ false };
+};
+
+#endif // LL_LLFLOATERLUADEBUG_H
+
diff --git a/indra/newview/llfloaterluascripts.cpp b/indra/newview/llfloaterluascripts.cpp
new file mode 100644
index 0000000000..0eba45ec29
--- /dev/null
+++ b/indra/newview/llfloaterluascripts.cpp
@@ -0,0 +1,131 @@
+/**
+ * @file llfloaterluascriptsinfo.cpp
+ *
+ * $LicenseInfo:firstyear=2024&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2024, 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 "llfloaterluascripts.h"
+#include "llevents.h"
+#include <filesystem>
+#include "llluamanager.h"
+#include "llscrolllistctrl.h"
+#include "llviewerwindow.h"
+#include "llwindow.h"
+#include "llviewermenu.h"
+
+const F32 REFRESH_INTERVAL = 1.0f;
+
+LLFloaterLUAScripts::LLFloaterLUAScripts(const LLSD &key)
+ : LLFloater(key),
+ mUpdateTimer(new LLTimer()),
+ mContextMenuHandle()
+{
+ mCommitCallbackRegistrar.add("Script.OpenFolder", {[this](LLUICtrl*, const LLSD &userdata)
+ {
+ if (mScriptList->hasSelectedItem())
+ {
+ std::string target_folder_path = std::filesystem::path((mScriptList->getFirstSelected()->getColumn(1)->getValue().asString())).parent_path().string();
+ gViewerWindow->getWindow()->openFolder(target_folder_path);
+ }
+ }, cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Script.Terminate", {[this](LLUICtrl*, const LLSD &userdata)
+ {
+ if (mScriptList->hasSelectedItem())
+ {
+ std::string coro_name = mScriptList->getSelectedValue();
+ LLCoros::instance().killreq(coro_name);
+ }
+ }, cb_info::UNTRUSTED_BLOCK });
+}
+
+
+bool LLFloaterLUAScripts::postBuild()
+{
+ mScriptList = getChild<LLScrollListCtrl>("scripts_list");
+ mScriptList->setRightMouseDownCallback([this](LLUICtrl *ctrl, S32 x, S32 y, MASK mask) { onScrollListRightClicked(ctrl, x, y);});
+
+ LLContextMenu *menu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(
+ "menu_lua_scripts.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
+ if (menu)
+ {
+ mContextMenuHandle = menu->getHandle();
+ }
+
+ return true;
+}
+
+LLFloaterLUAScripts::~LLFloaterLUAScripts()
+{
+ auto menu = mContextMenuHandle.get();
+ if (menu)
+ {
+ menu->die();
+ mContextMenuHandle.markDead();
+ }
+}
+
+void LLFloaterLUAScripts::draw()
+{
+ if (mUpdateTimer->checkExpirationAndReset(REFRESH_INTERVAL))
+ {
+ populateScriptList();
+ }
+ LLFloater::draw();
+}
+
+void LLFloaterLUAScripts::populateScriptList()
+{
+ S32 prev_pos = mScriptList->getScrollPos();
+ LLSD prev_selected = mScriptList->getSelectedValue();
+ mScriptList->clearRows();
+ mScriptList->updateColumns(true);
+ std::map<std::string, std::string> scripts = LLLUAmanager::getScriptNames();
+ for (auto &it : scripts)
+ {
+ LLSD row;
+ row["value"] = it.first;
+ row["columns"][0]["value"] = std::filesystem::path((it.second)).stem().string();
+ row["columns"][0]["column"] = "script_name";
+ row["columns"][1]["value"] = it.second;
+ row["columns"][1]["column"] = "script_path";
+ mScriptList->addElement(row);
+ }
+ mScriptList->setScrollPos(prev_pos);
+ mScriptList->setSelectedByValue(prev_selected, true);
+}
+
+void LLFloaterLUAScripts::onScrollListRightClicked(LLUICtrl *ctrl, S32 x, S32 y)
+{
+ LLScrollListItem *item = mScriptList->hitItem(x, y);
+ if (item)
+ {
+ mScriptList->selectItemAt(x, y, MASK_NONE);
+ auto menu = mContextMenuHandle.get();
+ if (menu)
+ {
+ menu->show(x, y);
+ LLMenuGL::showPopup(this, menu, x, y);
+ }
+ }
+}
diff --git a/indra/newview/llfloaterluascripts.h b/indra/newview/llfloaterluascripts.h
new file mode 100644
index 0000000000..14ca42d6fb
--- /dev/null
+++ b/indra/newview/llfloaterluascripts.h
@@ -0,0 +1,54 @@
+/**
+ * @file llfloaterluascriptsinfo.h
+ *
+ * $LicenseInfo:firstyear=2024&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2024, 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_LLFLOATERLUASCRIPTS_H
+#define LL_LLFLOATERLUASCRIPTS_H
+
+#include "llfloater.h"
+
+class LLScrollListCtrl;
+
+class LLFloaterLUAScripts :
+ public LLFloater
+{
+ public:
+ LLFloaterLUAScripts(const LLSD &key);
+ virtual ~LLFloaterLUAScripts();
+
+ bool postBuild();
+ void draw();
+
+private:
+ void populateScriptList();
+ void onScrollListRightClicked(LLUICtrl *ctrl, S32 x, S32 y);
+
+ std::unique_ptr<LLTimer> mUpdateTimer;
+ LLScrollListCtrl* mScriptList;
+
+ LLHandle<LLContextMenu> mContextMenuHandle;
+};
+
+#endif // LL_LLFLOATERLUASCRIPTS_H
+
diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp
index f20fea01c5..e91745fff0 100644
--- a/indra/newview/llfloatermarketplacelistings.cpp
+++ b/indra/newview/llfloatermarketplacelistings.cpp
@@ -58,7 +58,7 @@ LLPanelMarketplaceListings::LLPanelMarketplaceListings()
, mSortOrder(LLInventoryFilter::SO_FOLDERS_BY_NAME)
, mFilterListingFoldersOnly(false)
{
- mCommitCallbackRegistrar.add("Marketplace.ViewSort.Action", boost::bind(&LLPanelMarketplaceListings::onViewSortMenuItemClicked, this, _2));
+ mCommitCallbackRegistrar.add("Marketplace.ViewSort.Action", { boost::bind(&LLPanelMarketplaceListings::onViewSortMenuItemClicked, this, _2) });
mEnableCallbackRegistrar.add("Marketplace.ViewSort.CheckItem", boost::bind(&LLPanelMarketplaceListings::onViewSortMenuItemCheck, this, _2));
}
diff --git a/indra/newview/llfloatermemleak.cpp b/indra/newview/llfloatermemleak.cpp
index b4bb45c864..4ec8cbf71d 100644
--- a/indra/newview/llfloatermemleak.cpp
+++ b/indra/newview/llfloatermemleak.cpp
@@ -48,12 +48,12 @@ LLFloaterMemLeak::LLFloaterMemLeak(const LLSD& key)
: LLFloater(key)
{
setTitle("Memory Leaking Simulation Floater");
- mCommitCallbackRegistrar.add("MemLeak.ChangeLeakingSpeed", boost::bind(&LLFloaterMemLeak::onChangeLeakingSpeed, this));
- mCommitCallbackRegistrar.add("MemLeak.ChangeMaxMemLeaking", boost::bind(&LLFloaterMemLeak::onChangeMaxMemLeaking, this));
- mCommitCallbackRegistrar.add("MemLeak.Start", boost::bind(&LLFloaterMemLeak::onClickStart, this));
- mCommitCallbackRegistrar.add("MemLeak.Stop", boost::bind(&LLFloaterMemLeak::onClickStop, this));
- mCommitCallbackRegistrar.add("MemLeak.Release", boost::bind(&LLFloaterMemLeak::onClickRelease, this));
- mCommitCallbackRegistrar.add("MemLeak.Close", boost::bind(&LLFloaterMemLeak::onClickClose, this));
+ mCommitCallbackRegistrar.add("MemLeak.ChangeLeakingSpeed", { boost::bind(&LLFloaterMemLeak::onChangeLeakingSpeed, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("MemLeak.ChangeMaxMemLeaking", { boost::bind(&LLFloaterMemLeak::onChangeMaxMemLeaking, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("MemLeak.Start", { boost::bind(&LLFloaterMemLeak::onClickStart, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("MemLeak.Stop", { boost::bind(&LLFloaterMemLeak::onClickStop, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("MemLeak.Release", { boost::bind(&LLFloaterMemLeak::onClickRelease, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("MemLeak.Close", { boost::bind(&LLFloaterMemLeak::onClickClose, this), cb_info::UNTRUSTED_BLOCK });
}
//----------------------------------------------
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 5ca727cf66..8332a430e6 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -782,16 +782,21 @@ void LLFloaterModelPreview::draw3dPreview()
gGL.getTexUnit(0)->bind(mModelPreview);
- gGL.begin( LLRender::QUADS );
+ gGL.begin(LLRender::TRIANGLES);
{
gGL.texCoord2f(0.f, 1.f);
- gGL.vertex2i(mPreviewRect.mLeft+1, mPreviewRect.mTop-1);
+ gGL.vertex2i(mPreviewRect.mLeft + 1, mPreviewRect.mTop - 1);
gGL.texCoord2f(0.f, 0.f);
- gGL.vertex2i(mPreviewRect.mLeft+1, mPreviewRect.mBottom+1);
+ gGL.vertex2i(mPreviewRect.mLeft + 1, mPreviewRect.mBottom + 1);
gGL.texCoord2f(1.f, 0.f);
- gGL.vertex2i(mPreviewRect.mRight-1, mPreviewRect.mBottom+1);
+ gGL.vertex2i(mPreviewRect.mRight - 1, mPreviewRect.mBottom + 1);
+
+ gGL.texCoord2f(1.f, 0.f);
+ gGL.vertex2i(mPreviewRect.mRight - 1, mPreviewRect.mBottom + 1);
gGL.texCoord2f(1.f, 1.f);
- gGL.vertex2i(mPreviewRect.mRight-1, mPreviewRect.mTop-1);
+ gGL.vertex2i(mPreviewRect.mRight - 1, mPreviewRect.mTop - 1);
+ gGL.texCoord2f(0.f, 1.f);
+ gGL.vertex2i(mPreviewRect.mLeft + 1, mPreviewRect.mTop - 1);
}
gGL.end();
diff --git a/indra/newview/llfloatermyenvironment.cpp b/indra/newview/llfloatermyenvironment.cpp
index 891e16a8ef..b8aa4c6f72 100644
--- a/indra/newview/llfloatermyenvironment.cpp
+++ b/indra/newview/llfloatermyenvironment.cpp
@@ -81,10 +81,10 @@ LLFloaterMyEnvironment::LLFloaterMyEnvironment(const LLSD& key) :
mTypeFilter((0x01 << static_cast<U64>(LLSettingsType::ST_DAYCYCLE)) | (0x01 << static_cast<U64>(LLSettingsType::ST_SKY)) | (0x01 << static_cast<U64>(LLSettingsType::ST_WATER))),
mSelectedAsset()
{
- mCommitCallbackRegistrar.add(ACTION_DOCREATE, [this](LLUICtrl *, const LLSD &userdata) { onDoCreate(userdata); });
- mCommitCallbackRegistrar.add(ACTION_DOEDIT, [this](LLUICtrl *, const LLSD &userdata) { mInventoryList->openSelected(); });
- mCommitCallbackRegistrar.add(ACTION_DOAPPLY, [this](LLUICtrl *, const LLSD &userdata) { onDoApply(userdata.asString()); });
- mCommitCallbackRegistrar.add(ACTION_COPYPASTE, [this](LLUICtrl *, const LLSD &userdata) { mInventoryList->doToSelected(userdata.asString()); });
+ mCommitCallbackRegistrar.add(ACTION_DOCREATE, { [this](LLUICtrl *, const LLSD &userdata) { onDoCreate(userdata); } });
+ mCommitCallbackRegistrar.add(ACTION_DOEDIT, { [this](LLUICtrl *, const LLSD &userdata) { mInventoryList->openSelected(); } });
+ mCommitCallbackRegistrar.add(ACTION_DOAPPLY, { [this](LLUICtrl *, const LLSD &userdata) { onDoApply(userdata.asString()); } });
+ mCommitCallbackRegistrar.add(ACTION_COPYPASTE, { [this](LLUICtrl *, const LLSD &userdata) { mInventoryList->doToSelected(userdata.asString()); } });
mEnableCallbackRegistrar.add(ENABLE_ACTION, [this](LLUICtrl *, const LLSD &userdata) { return canAction(userdata.asString()); });
mEnableCallbackRegistrar.add(ENABLE_CANAPPLY, [this](LLUICtrl *, const LLSD &userdata) { return canApply(userdata.asString()); });
diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp
index a819b30e30..883b285c06 100644
--- a/indra/newview/llfloaternotificationsconsole.cpp
+++ b/indra/newview/llfloaternotificationsconsole.cpp
@@ -151,7 +151,7 @@ bool LLNotificationChannelPanel::update(const LLSD& payload)
LLFloaterNotificationConsole::LLFloaterNotificationConsole(const LLSD& key)
: LLFloater(key)
{
- mCommitCallbackRegistrar.add("ClickAdd", boost::bind(&LLFloaterNotificationConsole::onClickAdd, this));
+ mCommitCallbackRegistrar.add("ClickAdd", { boost::bind(&LLFloaterNotificationConsole::onClickAdd, this) });
}
bool LLFloaterNotificationConsole::postBuild()
diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp
index b06e35f65d..afd77ebd50 100644
--- a/indra/newview/llfloateropenobject.cpp
+++ b/indra/newview/llfloateropenobject.cpp
@@ -55,8 +55,8 @@ LLFloaterOpenObject::LLFloaterOpenObject(const LLSD& key)
mPanelInventoryObject(NULL),
mDirty(true)
{
- mCommitCallbackRegistrar.add("OpenObject.MoveToInventory", boost::bind(&LLFloaterOpenObject::onClickMoveToInventory, this));
- mCommitCallbackRegistrar.add("OpenObject.Cancel", boost::bind(&LLFloaterOpenObject::onClickCancel, this));
+ mCommitCallbackRegistrar.add("OpenObject.MoveToInventory", { boost::bind(&LLFloaterOpenObject::onClickMoveToInventory, this), cb_info::UNTRUSTED_THROTTLE });
+ mCommitCallbackRegistrar.add("OpenObject.Cancel", { boost::bind(&LLFloaterOpenObject::onClickCancel, this) });
}
LLFloaterOpenObject::~LLFloaterOpenObject()
diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp
index 315508f22b..756d22eea7 100644
--- a/indra/newview/llfloaterperformance.cpp
+++ b/indra/newview/llfloaterperformance.cpp
@@ -67,7 +67,7 @@ protected:
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
- registrar.add("Settings.SetRendering", boost::bind(&LLFloaterPerformance::onCustomAction, mFloaterPerformance, _2, mUUIDs.front()));
+ registrar.add("Settings.SetRendering", { boost::bind(&LLFloaterPerformance::onCustomAction, mFloaterPerformance, _2, mUUIDs.front()), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
enable_registrar.add("Settings.IsSelected", boost::bind(&LLFloaterPerformance::isActionChecked, mFloaterPerformance, _2, mUUIDs.front()));
LLContextMenu* menu = createFromFile("menu_avatar_rendering_settings.xml");
@@ -115,12 +115,12 @@ bool LLFloaterPerformance::postBuild()
mHUDList = mHUDsPanel->getChild<LLNameListCtrl>("hud_list");
mHUDList->setNameListType(LLNameListCtrl::SPECIAL);
mHUDList->setHoverIconName("StopReload_Off");
- mHUDList->setIconClickedCallback(boost::bind(&LLFloaterPerformance::detachItem, this, _1));
+ mHUDList->setIconClickedCallback(boost::bind(&LLFloaterPerformance::detachObject, this, _1));
mObjectList = mComplexityPanel->getChild<LLNameListCtrl>("obj_list");
mObjectList->setNameListType(LLNameListCtrl::SPECIAL);
mObjectList->setHoverIconName("StopReload_Off");
- mObjectList->setIconClickedCallback(boost::bind(&LLFloaterPerformance::detachItem, this, _1));
+ mObjectList->setIconClickedCallback(boost::bind(&LLFloaterPerformance::detachObject, this, _1));
mSettingsPanel->getChild<LLButton>("advanced_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickAdvanced, this));
mSettingsPanel->getChild<LLButton>("defaults_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickDefaults, this));
@@ -527,9 +527,13 @@ void LLFloaterPerformance::setFPSText()
mTextFPSLabel->setValue(fps_text);
}
-void LLFloaterPerformance::detachItem(const LLUUID& item_id)
+void LLFloaterPerformance::detachObject(const LLUUID& obj_id)
{
- LLAppearanceMgr::instance().removeItemFromAvatar(item_id);
+ LLViewerObject* obj = gObjectList.findObject(obj_id);
+ if (obj)
+ {
+ LLAppearanceMgr::instance().removeItemFromAvatar(obj->getAttachmentItemID());
+ }
}
void LLFloaterPerformance::onClickAdvanced()
diff --git a/indra/newview/llfloaterperformance.h b/indra/newview/llfloaterperformance.h
index a7100eb350..6cca85a009 100644
--- a/indra/newview/llfloaterperformance.h
+++ b/indra/newview/llfloaterperformance.h
@@ -48,7 +48,7 @@ public:
void hidePanels();
void showAutoadjustmentsPanel();
- void detachItem(const LLUUID& item_id);
+ void detachObject(const LLUUID& obj_id);
void onAvatarListRightClick(LLUICtrl* ctrl, S32 x, S32 y);
diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp
index 7311f0deb6..86a99aba39 100644
--- a/indra/newview/llfloaterperms.cpp
+++ b/indra/newview/llfloaterperms.cpp
@@ -107,9 +107,9 @@ static bool mCapSent = false;
LLFloaterPermsDefault::LLFloaterPermsDefault(const LLSD& seed)
: LLFloater(seed)
{
- mCommitCallbackRegistrar.add("PermsDefault.Copy", boost::bind(&LLFloaterPermsDefault::onCommitCopy, this, _2));
- mCommitCallbackRegistrar.add("PermsDefault.OK", boost::bind(&LLFloaterPermsDefault::onClickOK, this));
- mCommitCallbackRegistrar.add("PermsDefault.Cancel", boost::bind(&LLFloaterPermsDefault::onClickCancel, this));
+ mCommitCallbackRegistrar.add("PermsDefault.Copy", { boost::bind(&LLFloaterPermsDefault::onCommitCopy, this, _2), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("PermsDefault.OK", { boost::bind(&LLFloaterPermsDefault::onClickOK, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("PermsDefault.Cancel", { boost::bind(&LLFloaterPermsDefault::onClickCancel, this), cb_info::UNTRUSTED_BLOCK });
}
diff --git a/indra/newview/llfloaterpostprocess.cpp b/indra/newview/llfloaterpostprocess.cpp
deleted file mode 100644
index 616c13cdc7..0000000000
--- a/indra/newview/llfloaterpostprocess.cpp
+++ /dev/null
@@ -1,229 +0,0 @@
-/**
- * @file llfloaterpostprocess.cpp
- * @brief LLFloaterPostProcess class definition
- *
- * $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 "llfloaterpostprocess.h"
-
-#include "llsliderctrl.h"
-#include "llcheckboxctrl.h"
-#include "llnotificationsutil.h"
-#include "lluictrlfactory.h"
-#include "llviewerdisplay.h"
-#include "llpostprocess.h"
-#include "llcombobox.h"
-#include "lllineeditor.h"
-#include "llviewerwindow.h"
-
-
-LLFloaterPostProcess::LLFloaterPostProcess(const LLSD& key)
- : LLFloater(key)
-{
-}
-
-LLFloaterPostProcess::~LLFloaterPostProcess()
-{
-
-
-}
-bool LLFloaterPostProcess::postBuild()
-{
- /// Color Filter Callbacks
- childSetCommitCallback("ColorFilterToggle", &LLFloaterPostProcess::onBoolToggle, (char*)"enable_color_filter");
- //childSetCommitCallback("ColorFilterGamma", &LLFloaterPostProcess::onFloatControlMoved, &(gPostProcess->tweaks.gamma()));
- childSetCommitCallback("ColorFilterBrightness", &LLFloaterPostProcess::onFloatControlMoved, (char*)"brightness");
- childSetCommitCallback("ColorFilterSaturation", &LLFloaterPostProcess::onFloatControlMoved, (char*)"saturation");
- childSetCommitCallback("ColorFilterContrast", &LLFloaterPostProcess::onFloatControlMoved, (char*)"contrast");
-
- childSetCommitCallback("ColorFilterBaseR", &LLFloaterPostProcess::onColorControlRMoved, (char*)"contrast_base");
- childSetCommitCallback("ColorFilterBaseG", &LLFloaterPostProcess::onColorControlGMoved, (char*)"contrast_base");
- childSetCommitCallback("ColorFilterBaseB", &LLFloaterPostProcess::onColorControlBMoved, (char*)"contrast_base");
- childSetCommitCallback("ColorFilterBaseI", &LLFloaterPostProcess::onColorControlIMoved, (char*)"contrast_base");
-
- /// Night Vision Callbacks
- childSetCommitCallback("NightVisionToggle", &LLFloaterPostProcess::onBoolToggle, (char*)"enable_night_vision");
- childSetCommitCallback("NightVisionBrightMult", &LLFloaterPostProcess::onFloatControlMoved, (char*)"brightness_multiplier");
- childSetCommitCallback("NightVisionNoiseSize", &LLFloaterPostProcess::onFloatControlMoved, (char*)"noise_size");
- childSetCommitCallback("NightVisionNoiseStrength", &LLFloaterPostProcess::onFloatControlMoved, (char*)"noise_strength");
-
- /// Bloom Callbacks
- childSetCommitCallback("BloomToggle", &LLFloaterPostProcess::onBoolToggle, (char*)"enable_bloom");
- childSetCommitCallback("BloomExtract", &LLFloaterPostProcess::onFloatControlMoved, (char*)"extract_low");
- childSetCommitCallback("BloomSize", &LLFloaterPostProcess::onFloatControlMoved, (char*)"bloom_width");
- childSetCommitCallback("BloomStrength", &LLFloaterPostProcess::onFloatControlMoved, (char*)"bloom_strength");
-
- // Effect loading and saving.
- LLComboBox* comboBox = getChild<LLComboBox>("PPEffectsCombo");
- getChild<LLComboBox>("PPLoadEffect")->setCommitCallback(boost::bind(&LLFloaterPostProcess::onLoadEffect, this, comboBox));
- comboBox->setCommitCallback(boost::bind(&LLFloaterPostProcess::onChangeEffectName, this, _1));
-
- LLLineEditor* editBox = getChild<LLLineEditor>("PPEffectNameEditor");
- getChild<LLComboBox>("PPSaveEffect")->setCommitCallback(boost::bind(&LLFloaterPostProcess::onSaveEffect, this, editBox));
-
- syncMenu();
- return true;
-}
-
-// Bool Toggle
-void LLFloaterPostProcess::onBoolToggle(LLUICtrl* ctrl, void* userData)
-{
- char const * boolVariableName = (char const *)userData;
-
- // check the bool
- LLCheckBoxCtrl* cbCtrl = static_cast<LLCheckBoxCtrl*>(ctrl);
- gPostProcess->tweaks[boolVariableName] = cbCtrl->getValue();
-}
-
-// Float Moved
-void LLFloaterPostProcess::onFloatControlMoved(LLUICtrl* ctrl, void* userData)
-{
- char const * floatVariableName = (char const *)userData;
- LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl);
- gPostProcess->tweaks[floatVariableName] = sldrCtrl->getValue();
-}
-
-// Color Moved
-void LLFloaterPostProcess::onColorControlRMoved(LLUICtrl* ctrl, void* userData)
-{
- char const * floatVariableName = (char const *)userData;
- LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl);
- gPostProcess->tweaks[floatVariableName][0] = sldrCtrl->getValue();
-}
-
-// Color Moved
-void LLFloaterPostProcess::onColorControlGMoved(LLUICtrl* ctrl, void* userData)
-{
- char const * floatVariableName = (char const *)userData;
- LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl);
- gPostProcess->tweaks[floatVariableName][1] = sldrCtrl->getValue();
-}
-
-// Color Moved
-void LLFloaterPostProcess::onColorControlBMoved(LLUICtrl* ctrl, void* userData)
-{
- char const * floatVariableName = (char const *)userData;
- LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl);
- gPostProcess->tweaks[floatVariableName][2] = sldrCtrl->getValue();
-}
-
-// Color Moved
-void LLFloaterPostProcess::onColorControlIMoved(LLUICtrl* ctrl, void* userData)
-{
- char const * floatVariableName = (char const *)userData;
- LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl);
- gPostProcess->tweaks[floatVariableName][3] = sldrCtrl->getValue();
-}
-
-void LLFloaterPostProcess::onLoadEffect(LLComboBox* comboBox)
-{
- LLSD::String effectName(comboBox->getSelectedValue().asString());
-
- gPostProcess->setSelectedEffect(effectName);
-
- syncMenu();
-}
-
-void LLFloaterPostProcess::onSaveEffect(LLLineEditor* editBox)
-{
- std::string effectName(editBox->getValue().asString());
-
- if (gPostProcess->mAllEffects.has(effectName))
- {
- LLSD payload;
- payload["effect_name"] = effectName;
- LLNotificationsUtil::add("PPSaveEffectAlert", LLSD(), payload, boost::bind(&LLFloaterPostProcess::saveAlertCallback, this, _1, _2));
- }
- else
- {
- gPostProcess->saveEffect(effectName);
- syncMenu();
- }
-}
-
-void LLFloaterPostProcess::onChangeEffectName(LLUICtrl* ctrl)
-{
- // get the combo box and name
- LLLineEditor* editBox = getChild<LLLineEditor>("PPEffectNameEditor");
-
- // set the parameter's new name
- editBox->setValue(ctrl->getValue());
-}
-
-bool LLFloaterPostProcess::saveAlertCallback(const LLSD& notification, const LLSD& response)
-{
- S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
-
- // if they choose save, do it. Otherwise, don't do anything
- if (option == 0)
- {
- gPostProcess->saveEffect(notification["payload"]["effect_name"].asString());
-
- syncMenu();
- }
- return false;
-}
-
-void LLFloaterPostProcess::syncMenu()
-{
- // add the combo boxe contents
- LLComboBox* comboBox = getChild<LLComboBox>("PPEffectsCombo");
-
- comboBox->removeall();
-
- LLSD::map_const_iterator currEffect;
- for(currEffect = gPostProcess->mAllEffects.beginMap();
- currEffect != gPostProcess->mAllEffects.endMap();
- ++currEffect)
- {
- comboBox->add(currEffect->first);
- }
-
- // set the current effect as selected.
- comboBox->selectByValue(gPostProcess->getSelectedEffect());
-
- /// Sync Color Filter Menu
- getChild<LLUICtrl>("ColorFilterToggle")->setValue(gPostProcess->tweaks.useColorFilter());
- //getChild<LLUICtrl>("ColorFilterGamma")->setValue(gPostProcess->tweaks.gamma());
- getChild<LLUICtrl>("ColorFilterBrightness")->setValue(gPostProcess->tweaks.brightness());
- getChild<LLUICtrl>("ColorFilterSaturation")->setValue(gPostProcess->tweaks.saturation());
- getChild<LLUICtrl>("ColorFilterContrast")->setValue(gPostProcess->tweaks.contrast());
- getChild<LLUICtrl>("ColorFilterBaseR")->setValue(gPostProcess->tweaks.contrastBaseR());
- getChild<LLUICtrl>("ColorFilterBaseG")->setValue(gPostProcess->tweaks.contrastBaseG());
- getChild<LLUICtrl>("ColorFilterBaseB")->setValue(gPostProcess->tweaks.contrastBaseB());
- getChild<LLUICtrl>("ColorFilterBaseI")->setValue(gPostProcess->tweaks.contrastBaseIntensity());
-
- /// Sync Night Vision Menu
- getChild<LLUICtrl>("NightVisionToggle")->setValue(gPostProcess->tweaks.useNightVisionShader());
- getChild<LLUICtrl>("NightVisionBrightMult")->setValue(gPostProcess->tweaks.brightMult());
- getChild<LLUICtrl>("NightVisionNoiseSize")->setValue(gPostProcess->tweaks.noiseSize());
- getChild<LLUICtrl>("NightVisionNoiseStrength")->setValue(gPostProcess->tweaks.noiseStrength());
-
- /// Sync Bloom Menu
- getChild<LLUICtrl>("BloomToggle")->setValue(LLSD(gPostProcess->tweaks.useBloomShader()));
- getChild<LLUICtrl>("BloomExtract")->setValue(gPostProcess->tweaks.extractLow());
- getChild<LLUICtrl>("BloomSize")->setValue(gPostProcess->tweaks.bloomWidth());
- getChild<LLUICtrl>("BloomStrength")->setValue(gPostProcess->tweaks.bloomStrength());
-}
diff --git a/indra/newview/llfloaterpostprocess.h b/indra/newview/llfloaterpostprocess.h
deleted file mode 100644
index 50b48d8410..0000000000
--- a/indra/newview/llfloaterpostprocess.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * @file llfloaterpostprocess.h
- * @brief LLFloaterPostProcess class definition
- *
- * $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_LLFLOATERPOSTPROCESS_H
-#define LL_LLFLOATERPOSTPROCESS_H
-
-#include "llfloater.h"
-
-class LLButton;
-class LLComboBox;
-class LLLineEditor;
-class LLSliderCtrl;
-class LLTabContainer;
-class LLPanelPermissions;
-class LLPanelObject;
-class LLPanelVolume;
-class LLPanelContents;
-class LLPanelFace;
-
-/**
- * Menu for adjusting the post process settings of the world
- */
-class LLFloaterPostProcess : public LLFloater
-{
-public:
-
- LLFloaterPostProcess(const LLSD& key);
- virtual ~LLFloaterPostProcess();
- bool postBuild();
-
- /// post process callbacks
- static void onBoolToggle(LLUICtrl* ctrl, void* userData);
- static void onFloatControlMoved(LLUICtrl* ctrl, void* userData);
- static void onColorControlRMoved(LLUICtrl* ctrl, void* userData);
- static void onColorControlGMoved(LLUICtrl* ctrl, void* userData);
- static void onColorControlBMoved(LLUICtrl* ctrl, void* userData);
- static void onColorControlIMoved(LLUICtrl* ctrl, void* userData);
- void onLoadEffect(LLComboBox* comboBox);
- void onSaveEffect(LLLineEditor* editBox);
- void onChangeEffectName(LLUICtrl* ctrl);
-
- /// prompts a user when overwriting an effect
- bool saveAlertCallback(const LLSD& notification, const LLSD& response);
-
- /// sync up sliders
- void syncMenu();
-};
-
-#endif
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index e673752986..d60d41ae3c 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -312,43 +312,44 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
registered_dialog = true;
}
- mCommitCallbackRegistrar.add("Pref.Cancel", boost::bind(&LLFloaterPreference::onBtnCancel, this, _2));
- mCommitCallbackRegistrar.add("Pref.OK", boost::bind(&LLFloaterPreference::onBtnOK, this, _2));
-
- mCommitCallbackRegistrar.add("Pref.ClearCache", boost::bind(&LLFloaterPreference::onClickClearCache, this));
- mCommitCallbackRegistrar.add("Pref.WebClearCache", boost::bind(&LLFloaterPreference::onClickBrowserClearCache, this));
- mCommitCallbackRegistrar.add("Pref.SetCache", boost::bind(&LLFloaterPreference::onClickSetCache, this));
- mCommitCallbackRegistrar.add("Pref.ResetCache", boost::bind(&LLFloaterPreference::onClickResetCache, this));
- mCommitCallbackRegistrar.add("Pref.ClickSkin", boost::bind(&LLFloaterPreference::onClickSkin, this,_1, _2));
- mCommitCallbackRegistrar.add("Pref.SelectSkin", boost::bind(&LLFloaterPreference::onSelectSkin, this));
- mCommitCallbackRegistrar.add("Pref.SetSounds", boost::bind(&LLFloaterPreference::onClickSetSounds, this));
- 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.RenderExceptions", boost::bind(&LLFloaterPreference::onClickRenderExceptions, this));
- mCommitCallbackRegistrar.add("Pref.AutoAdjustments", boost::bind(&LLFloaterPreference::onClickAutoAdjustments, this));
- mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this));
- mCommitCallbackRegistrar.add("Pref.AvatarImpostorsEnable", boost::bind(&LLFloaterPreference::onAvatarImpostorsEnable, this));
- mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxComplexity", boost::bind(&LLFloaterPreference::updateMaxComplexity, this));
- mCommitCallbackRegistrar.add("Pref.RenderOptionUpdate", boost::bind(&LLFloaterPreference::onRenderOptionEnable, this));
- mCommitCallbackRegistrar.add("Pref.WindowedMod", boost::bind(&LLFloaterPreference::onCommitWindowedMode, this));
- mCommitCallbackRegistrar.add("Pref.UpdateSliderText", boost::bind(&LLFloaterPreference::refreshUI,this));
- mCommitCallbackRegistrar.add("Pref.QualityPerformance", boost::bind(&LLFloaterPreference::onChangeQuality, this, _2));
- mCommitCallbackRegistrar.add("Pref.applyUIColor", boost::bind(&LLFloaterPreference::applyUIColor, this ,_1, _2));
- mCommitCallbackRegistrar.add("Pref.getUIColor", boost::bind(&LLFloaterPreference::getUIColor, this ,_1, _2));
- mCommitCallbackRegistrar.add("Pref.MaturitySettings", boost::bind(&LLFloaterPreference::onChangeMaturity, this));
- mCommitCallbackRegistrar.add("Pref.BlockList", boost::bind(&LLFloaterPreference::onClickBlockList, this));
- mCommitCallbackRegistrar.add("Pref.Proxy", boost::bind(&LLFloaterPreference::onClickProxySettings, this));
- mCommitCallbackRegistrar.add("Pref.TranslationSettings", boost::bind(&LLFloaterPreference::onClickTranslationSettings, this));
- mCommitCallbackRegistrar.add("Pref.AutoReplace", boost::bind(&LLFloaterPreference::onClickAutoReplace, this));
- mCommitCallbackRegistrar.add("Pref.PermsDefault", boost::bind(&LLFloaterPreference::onClickPermsDefault, this));
- mCommitCallbackRegistrar.add("Pref.RememberedUsernames", boost::bind(&LLFloaterPreference::onClickRememberedUsernames, this));
- mCommitCallbackRegistrar.add("Pref.SpellChecker", boost::bind(&LLFloaterPreference::onClickSpellChecker, this));
- mCommitCallbackRegistrar.add("Pref.Advanced", boost::bind(&LLFloaterPreference::onClickAdvanced, this));
+ mCommitCallbackRegistrar.add("Pref.Cancel", { boost::bind(&LLFloaterPreference::onBtnCancel, this, _2), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.OK", { boost::bind(&LLFloaterPreference::onBtnOK, this, _2), cb_info::UNTRUSTED_BLOCK });
+
+ mCommitCallbackRegistrar.add("Pref.ClearCache", { boost::bind(&LLFloaterPreference::onClickClearCache, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.WebClearCache", { boost::bind(&LLFloaterPreference::onClickBrowserClearCache, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.SetCache", { boost::bind(&LLFloaterPreference::onClickSetCache, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.ResetCache", { boost::bind(&LLFloaterPreference::onClickResetCache, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.ClickSkin", { boost::bind(&LLFloaterPreference::onClickSkin, this,_1, _2), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.SelectSkin", { boost::bind(&LLFloaterPreference::onSelectSkin, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.SetSounds", { boost::bind(&LLFloaterPreference::onClickSetSounds, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.ClickEnablePopup", { boost::bind(&LLFloaterPreference::onClickEnablePopup, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.ClickDisablePopup", { boost::bind(&LLFloaterPreference::onClickDisablePopup, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.LogPath", { boost::bind(&LLFloaterPreference::onClickLogPath, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.RenderExceptions", { boost::bind(&LLFloaterPreference::onClickRenderExceptions, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.AutoAdjustments", { boost::bind(&LLFloaterPreference::onClickAutoAdjustments, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.HardwareDefaults", { boost::bind(&LLFloaterPreference::setHardwareDefaults, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.AvatarImpostorsEnable", { boost::bind(&LLFloaterPreference::onAvatarImpostorsEnable, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxNonImpostors", { boost::bind(&LLFloaterPreference::updateMaxNonImpostors, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxComplexity", { boost::bind(&LLFloaterPreference::updateMaxComplexity, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.RenderOptionUpdate", { boost::bind(&LLFloaterPreference::onRenderOptionEnable, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.WindowedMod", { boost::bind(&LLFloaterPreference::onCommitWindowedMode, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.UpdateSliderText", { boost::bind(&LLFloaterPreference::refreshUI,this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.QualityPerformance", { boost::bind(&LLFloaterPreference::onChangeQuality, this, _2), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.applyUIColor", { boost::bind(&LLFloaterPreference::applyUIColor, this ,_1, _2), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.getUIColor", { boost::bind(&LLFloaterPreference::getUIColor, this ,_1, _2), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.MaturitySettings", { boost::bind(&LLFloaterPreference::onChangeMaturity, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.BlockList", { boost::bind(&LLFloaterPreference::onClickBlockList, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.Proxy", { boost::bind(&LLFloaterPreference::onClickProxySettings, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.TranslationSettings", { boost::bind(&LLFloaterPreference::onClickTranslationSettings, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.AutoReplace", { boost::bind(&LLFloaterPreference::onClickAutoReplace, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.PermsDefault", { boost::bind(&LLFloaterPreference::onClickPermsDefault, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.RememberedUsernames", { boost::bind(&LLFloaterPreference::onClickRememberedUsernames, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.SpellChecker", { boost::bind(&LLFloaterPreference::onClickSpellChecker, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.Advanced", { boost::bind(&LLFloaterPreference::onClickAdvanced, this), cb_info::UNTRUSTED_BLOCK });
sSkin = gSavedSettings.getString("SkinCurrent");
- mCommitCallbackRegistrar.add("Pref.ClickActionChange", boost::bind(&LLFloaterPreference::onClickActionChange, this));
+ mCommitCallbackRegistrar.add("Pref.ClickActionChange", { boost::bind(&LLFloaterPreference::onClickActionChange, this), cb_info::UNTRUSTED_BLOCK });
gSavedSettings.getControl("NameTagShowUsernames")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2));
gSavedSettings.getControl("NameTagShowFriends")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2));
@@ -360,10 +361,11 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
LLAvatarPropertiesProcessor::getInstance()->addObserver( gAgent.getID(), this );
mComplexityChangedSignal = gSavedSettings.getControl("RenderAvatarMaxComplexity")->getCommitSignal()->connect(boost::bind(&LLFloaterPreference::updateComplexityText, this));
+ mImpostorsChangedSignal = gSavedSettings.getControl("RenderAvatarMaxNonImpostors")->getSignal()->connect(boost::bind(&LLFloaterPreference::updateIndirectMaxNonImpostors, this, _2));
- mCommitCallbackRegistrar.add("Pref.ClearLog", boost::bind(&LLConversationLog::onClearLog, &LLConversationLog::instance()));
- mCommitCallbackRegistrar.add("Pref.DeleteTranscripts", boost::bind(&LLFloaterPreference::onDeleteTranscripts, this));
- mCommitCallbackRegistrar.add("UpdateFilter", boost::bind(&LLFloaterPreference::onUpdateFilterTerm, this, false)); // <FS:ND/> Hook up for filtering
+ mCommitCallbackRegistrar.add("Pref.ClearLog", { boost::bind(&LLConversationLog::onClearLog, &LLConversationLog::instance()), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.DeleteTranscripts", { boost::bind(&LLFloaterPreference::onDeleteTranscripts, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("UpdateFilter", { boost::bind(&LLFloaterPreference::onUpdateFilterTerm, this, false), cb_info::UNTRUSTED_BLOCK }); // <FS:ND/> Hook up for filtering
}
void LLFloaterPreference::processProperties( void* pData, EAvatarProcessorType type )
@@ -543,6 +545,7 @@ LLFloaterPreference::~LLFloaterPreference()
{
LLConversationLog::instance().removeObserver(this);
mComplexityChangedSignal.disconnect();
+ mImpostorsChangedSignal.disconnect();
}
void LLFloaterPreference::draw()
@@ -1287,6 +1290,9 @@ void LLAvatarComplexityControls::setIndirectMaxArc()
void LLFloaterPreference::refresh()
{
LLPanel::refresh();
+ setMaxNonImpostorsText(
+ gSavedSettings.getU32("RenderAvatarMaxNonImpostors"),
+ getChild<LLTextBox>("IndirectMaxNonImpostorsText", true));
LLAvatarComplexityControls::setText(
gSavedSettings.getU32("RenderAvatarMaxComplexity"),
getChild<LLTextBox>("IndirectMaxComplexityText", true));
@@ -1561,6 +1567,44 @@ void LLAvatarComplexityControls::setRenderTimeText(F32 value, LLTextBox* text_bo
}
}
+void LLFloaterPreference::updateMaxNonImpostors()
+{
+ // Called when the IndirectMaxNonImpostors control changes
+ // Responsible for fixing the slider label (IndirectMaxNonImpostorsText) and setting RenderAvatarMaxNonImpostors
+ LLSliderCtrl* ctrl = getChild<LLSliderCtrl>("IndirectMaxNonImpostors", true);
+ U32 value = ctrl->getValue().asInteger();
+
+ if (0 == value || LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER <= value)
+ {
+ value = 0;
+ }
+ gSavedSettings.setU32("RenderAvatarMaxNonImpostors", value);
+ LLVOAvatar::updateImpostorRendering(value); // make it effective immediately
+ setMaxNonImpostorsText(value, getChild<LLTextBox>("IndirectMaxNonImpostorsText"));
+}
+
+void LLFloaterPreference::updateIndirectMaxNonImpostors(const LLSD& newvalue)
+{
+ U32 value = newvalue.asInteger();
+ if ((value != 0) && (value != gSavedSettings.getU32("IndirectMaxNonImpostors")))
+ {
+ gSavedSettings.setU32("IndirectMaxNonImpostors", value);
+ }
+ setMaxNonImpostorsText(value, getChild<LLTextBox>("IndirectMaxNonImpostorsText"));
+}
+
+void LLFloaterPreference::setMaxNonImpostorsText(U32 value, LLTextBox* text_box)
+{
+ if (0 == value)
+ {
+ text_box->setText(LLTrans::getString("no_limit"));
+ }
+ else
+ {
+ text_box->setText(llformat("%d", value));
+ }
+}
+
void LLFloaterPreference::updateMaxComplexity()
{
// Called when the IndirectMaxComplexity control changes
@@ -1951,7 +1995,7 @@ public:
:LLEventTimer(period),
mCallback(cb)
{
- mEventTimer.stop();
+ stop();
}
virtual ~Updater(){}
@@ -1959,15 +2003,15 @@ public:
void update(const LLSD& new_value)
{
mNewValue = new_value;
- mEventTimer.start();
+ start();
}
protected:
- bool tick()
+ bool tick() override
{
mCallback(mNewValue);
- mEventTimer.stop();
+ stop();
return false;
}
@@ -1983,11 +2027,11 @@ LLPanelPreference::LLPanelPreference()
: LLPanel(),
mBandWidthUpdater(NULL)
{
- 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));
+ mCommitCallbackRegistrar.add("Pref.setControlFalse", { boost::bind(&LLPanelPreference::setControlFalse,this, _2), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.updateMediaAutoPlayCheckbox", { boost::bind(&LLPanelPreference::updateMediaAutoPlayCheckbox, this, _1), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.PrefDelete", { boost::bind(&LLPanelPreference::deletePreset, this, _2), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.PrefSave", { boost::bind(&LLPanelPreference::savePreset, this, _2), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.PrefLoad", { boost::bind(&LLPanelPreference::loadPreset, this, _2), cb_info::UNTRUSTED_BLOCK });
}
//virtual
@@ -3087,9 +3131,9 @@ LLFloaterPreferenceProxy::LLFloaterPreferenceProxy(const LLSD& key)
: LLFloater(key),
mSocksSettingsDirty(false)
{
- mCommitCallbackRegistrar.add("Proxy.OK", boost::bind(&LLFloaterPreferenceProxy::onBtnOk, this));
- mCommitCallbackRegistrar.add("Proxy.Cancel", boost::bind(&LLFloaterPreferenceProxy::onBtnCancel, this));
- mCommitCallbackRegistrar.add("Proxy.Change", boost::bind(&LLFloaterPreferenceProxy::onChangeSocksSettings, this));
+ mCommitCallbackRegistrar.add("Proxy.OK", { boost::bind(&LLFloaterPreferenceProxy::onBtnOk, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Proxy.Cancel", { boost::bind(&LLFloaterPreferenceProxy::onBtnCancel, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Proxy.Change", { boost::bind(&LLFloaterPreferenceProxy::onChangeSocksSettings, this), cb_info::UNTRUSTED_BLOCK });
}
LLFloaterPreferenceProxy::~LLFloaterPreferenceProxy()
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index 51ed3d8179..40806c22fc 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -206,6 +206,9 @@ private:
void onDeleteTranscripts();
void onDeleteTranscriptsResponse(const LLSD& notification, const LLSD& response);
void updateDeleteTranscriptsButton();
+ void updateMaxNonImpostors();
+ void updateIndirectMaxNonImpostors(const LLSD& newvalue);
+ void setMaxNonImpostorsText(U32 value, LLTextBox* text_box);
void updateMaxComplexity();
void updateComplexityText();
static bool loadFromFilename(const std::string& filename, std::map<std::string, std::string> &label_map);
@@ -234,6 +237,7 @@ private:
std::unique_ptr< ll::prefs::SearchData > mSearchData;
bool mSearchDataDirty;
+ boost::signals2::connection mImpostorsChangedSignal;
boost::signals2::connection mComplexityChangedSignal;
void onUpdateFilterTerm( bool force = false );
diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp
index 1d48fe70f2..3cccecfa4a 100644
--- a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp
+++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp
@@ -45,12 +45,12 @@
LLFloaterPreferenceGraphicsAdvanced::LLFloaterPreferenceGraphicsAdvanced(const LLSD& key)
: LLFloater(key)
{
- mCommitCallbackRegistrar.add("Pref.RenderOptionUpdate", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onRenderOptionEnable, this));
- mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxNonImpostors", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateMaxNonImpostors,this));
- mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxComplexity", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity,this));
+ mCommitCallbackRegistrar.add("Pref.RenderOptionUpdate", { boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onRenderOptionEnable, this) });
+ mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxNonImpostors", { boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateMaxNonImpostors,this) });
+ mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxComplexity", { boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateMaxComplexity,this) });
- mCommitCallbackRegistrar.add("Pref.Cancel", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onBtnCancel, this, _2));
- mCommitCallbackRegistrar.add("Pref.OK", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onBtnOK, this, _2));
+ mCommitCallbackRegistrar.add("Pref.Cancel", { boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onBtnCancel, this, _2), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Pref.OK", { boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onBtnOK, this, _2), cb_info::UNTRUSTED_BLOCK });
}
LLFloaterPreferenceGraphicsAdvanced::~LLFloaterPreferenceGraphicsAdvanced()
@@ -247,8 +247,8 @@ void LLFloaterPreferenceGraphicsAdvanced::updateIndirectMaxNonImpostors(const LL
if ((value != 0) && (value != gSavedSettings.getU32("IndirectMaxNonImpostors")))
{
gSavedSettings.setU32("IndirectMaxNonImpostors", value);
- setMaxNonImpostorsText(value, getChild<LLTextBox>("IndirectMaxNonImpostorsText"));
}
+ setMaxNonImpostorsText(value, getChild<LLTextBox>("IndirectMaxNonImpostorsText"));
}
void LLFloaterPreferenceGraphicsAdvanced::setMaxNonImpostorsText(U32 value, LLTextBox* text_box)
diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.h b/indra/newview/llfloaterpreferencesgraphicsadvanced.h
index 61203be068..6f793c1379 100644
--- a/indra/newview/llfloaterpreferencesgraphicsadvanced.h
+++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.h
@@ -61,6 +61,7 @@ protected:
void onBtnOK(const LLSD& userdata);
void onBtnCancel(const LLSD& userdata);
+ boost::signals2::connection mImpostorsChangedSignal;
boost::signals2::connection mComplexityChangedSignal;
boost::signals2::connection mComplexityModeChangedSignal;
boost::signals2::connection mLODFactorChangedSignal;
diff --git a/indra/newview/llfloaterpreferenceviewadvanced.cpp b/indra/newview/llfloaterpreferenceviewadvanced.cpp
index 3481397daa..290742a4cd 100644
--- a/indra/newview/llfloaterpreferenceviewadvanced.cpp
+++ b/indra/newview/llfloaterpreferenceviewadvanced.cpp
@@ -37,7 +37,7 @@
LLFloaterPreferenceViewAdvanced::LLFloaterPreferenceViewAdvanced(const LLSD& key)
: LLFloater(key)
{
- mCommitCallbackRegistrar.add("CommitSettings", boost::bind(&LLFloaterPreferenceViewAdvanced::onCommitSettings, this));
+ mCommitCallbackRegistrar.add("CommitSettings", { boost::bind(&LLFloaterPreferenceViewAdvanced::onCommitSettings, this), cb_info::UNTRUSTED_BLOCK });
}
LLFloaterPreferenceViewAdvanced::~LLFloaterPreferenceViewAdvanced()
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 8070284e32..165fb5ef88 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -259,8 +259,8 @@ bool LLFloaterRegionInfo::postBuild()
panel = new LLPanelRegionGeneralInfo;
mInfoPanels.push_back(panel);
- panel->getCommitCallbackRegistrar().add("RegionInfo.ManageTelehub", boost::bind(&LLPanelRegionInfo::onClickManageTelehub, panel));
- panel->getCommitCallbackRegistrar().add("RegionInfo.ManageRestart", boost::bind(&LLPanelRegionInfo::onClickManageRestartSchedule, panel));
+ panel->getCommitCallbackRegistrar().add("RegionInfo.ManageTelehub", { boost::bind(&LLPanelRegionInfo::onClickManageTelehub, panel) });
+ panel->getCommitCallbackRegistrar().add("RegionInfo.ManageRestart", { boost::bind(&LLPanelRegionInfo::onClickManageRestartSchedule, panel) });
panel->buildFromFile("panel_region_general.xml");
mTab->addTabPanel(panel);
@@ -2820,6 +2820,16 @@ void LLPanelEstateCovenant::setEstateName(const std::string& name)
}
// static
+void LLPanelEstateCovenant::updateCovenant(const LLTextBase* source, const LLUUID& asset_id)
+{
+ if (LLPanelEstateCovenant* panelp = LLFloaterRegionInfo::getPanelCovenant())
+ {
+ panelp->mEditor->copyContents(source);
+ panelp->setCovenantID(asset_id);
+ }
+}
+
+// static
void LLPanelEstateCovenant::updateCovenantText(const std::string& string, const LLUUID& asset_id)
{
LLPanelEstateCovenant* panelp = LLFloaterRegionInfo::getPanelCovenant();
@@ -4330,7 +4340,6 @@ void LLPanelRegionEnvironment::onChkAllowOverride(bool value)
mAllowOverrideRestore = mAllowOverride;
mAllowOverride = value;
-
std::string notification("EstateParcelEnvironmentOverride");
if (LLPanelEstateInfo::isLindenEstate())
notification = "ChangeLindenEstate";
diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h
index b604a28fc3..65c1291728 100644
--- a/indra/newview/llfloaterregioninfo.h
+++ b/indra/newview/llfloaterregioninfo.h
@@ -382,6 +382,7 @@ public:
void* user_data, S32 status, LLExtStat ext_status);
// Accessor functions
+ static void updateCovenant(const LLTextBase* source, const LLUUID& asset_id);
static void updateCovenantText(const std::string& string, const LLUUID& asset_id);
static void updateEstateName(const std::string& name);
static void updateLastModified(const std::string& text);
diff --git a/indra/newview/llfloaterregionrestarting.h b/indra/newview/llfloaterregionrestarting.h
index ee836dd00d..016c90f944 100644
--- a/indra/newview/llfloaterregionrestarting.h
+++ b/indra/newview/llfloaterregionrestarting.h
@@ -42,10 +42,10 @@ public:
private:
LLFloaterRegionRestarting(const LLSD& key);
virtual ~LLFloaterRegionRestarting();
- virtual bool postBuild();
- virtual bool tick();
- virtual void refresh();
- virtual void draw();
+ bool postBuild() override;
+ bool tick() override;
+ void refresh() override;
+ void draw() override;
virtual void regionChange();
std::string mName;
diff --git a/indra/newview/llfloaterscriptedprefs.cpp b/indra/newview/llfloaterscriptedprefs.cpp
index fa31cd72c1..fbeb256a9c 100644
--- a/indra/newview/llfloaterscriptedprefs.cpp
+++ b/indra/newview/llfloaterscriptedprefs.cpp
@@ -36,8 +36,8 @@ LLFloaterScriptEdPrefs::LLFloaterScriptEdPrefs(const LLSD& key)
: LLFloater(key)
, mEditor(NULL)
{
- mCommitCallbackRegistrar.add("ScriptPref.applyUIColor", boost::bind(&LLFloaterScriptEdPrefs::applyUIColor, this ,_1, _2));
- mCommitCallbackRegistrar.add("ScriptPref.getUIColor", boost::bind(&LLFloaterScriptEdPrefs::getUIColor, this ,_1, _2));
+ mCommitCallbackRegistrar.add("ScriptPref.applyUIColor", { boost::bind(&LLFloaterScriptEdPrefs::applyUIColor, this ,_1, _2) });
+ mCommitCallbackRegistrar.add("ScriptPref.getUIColor", { boost::bind(&LLFloaterScriptEdPrefs::getUIColor, this ,_1, _2) });
}
bool LLFloaterScriptEdPrefs::postBuild()
diff --git a/indra/newview/llfloatersettingscolor.cpp b/indra/newview/llfloatersettingscolor.cpp
index d9c382a1dc..1ca2412907 100644
--- a/indra/newview/llfloatersettingscolor.cpp
+++ b/indra/newview/llfloatersettingscolor.cpp
@@ -43,8 +43,8 @@ LLFloaterSettingsColor::LLFloaterSettingsColor(const LLSD& key)
: LLFloater(key),
mSettingList(NULL)
{
- mCommitCallbackRegistrar.add("CommitSettings", boost::bind(&LLFloaterSettingsColor::onCommitSettings, this));
- mCommitCallbackRegistrar.add("ClickDefault", boost::bind(&LLFloaterSettingsColor::onClickDefault, this));
+ mCommitCallbackRegistrar.add("CommitSettings", { boost::bind(&LLFloaterSettingsColor::onCommitSettings, this) });
+ mCommitCallbackRegistrar.add("ClickDefault", { boost::bind(&LLFloaterSettingsColor::onClickDefault, this) });
}
LLFloaterSettingsColor::~LLFloaterSettingsColor()
diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp
index 8cc01f6dc6..0a01fff36d 100644
--- a/indra/newview/llfloatersettingsdebug.cpp
+++ b/indra/newview/llfloatersettingsdebug.cpp
@@ -34,14 +34,16 @@
#include "llcolorswatch.h"
#include "llviewercontrol.h"
#include "lltexteditor.h"
+#include "llclipboard.h"
+#include "llsdutil.h"
LLFloaterSettingsDebug::LLFloaterSettingsDebug(const LLSD& key)
: LLFloater(key),
mSettingList(NULL)
{
- mCommitCallbackRegistrar.add("CommitSettings", boost::bind(&LLFloaterSettingsDebug::onCommitSettings, this));
- mCommitCallbackRegistrar.add("ClickDefault", boost::bind(&LLFloaterSettingsDebug::onClickDefault, this));
+ mCommitCallbackRegistrar.add("CommitSettings", { boost::bind(&LLFloaterSettingsDebug::onCommitSettings, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("ClickDefault", { boost::bind(&LLFloaterSettingsDebug::onClickDefault, this), cb_info::UNTRUSTED_BLOCK });
}
LLFloaterSettingsDebug::~LLFloaterSettingsDebug()
@@ -64,6 +66,8 @@ bool LLFloaterSettingsDebug::postBuild()
mSettingNameText = getChild<LLTextBox>("setting_name_txt");
mComment = getChild<LLTextEditor>("comment_text");
+ mLLSDVal = getChild<LLTextEditor>("llsd_text");
+ mCopyBtn = getChild<LLButton>("copy_btn");
getChild<LLFilterEditor>("filter_input")->setCommitCallback(boost::bind(&LLFloaterSettingsDebug::setSearchFilter, this, _2));
@@ -71,6 +75,8 @@ bool LLFloaterSettingsDebug::postBuild()
mSettingList->setCommitOnSelectionChange(true);
mSettingList->setCommitCallback(boost::bind(&LLFloaterSettingsDebug::onSettingSelect, this));
+ mCopyBtn->setCommitCallback([this](LLUICtrl *ctrl, const LLSD &param) { onClickCopy(); });
+
updateList();
gSavedSettings.getControl("DebugSettingsHideDefault")->getCommitSignal()->connect(boost::bind(&LLFloaterSettingsDebug::updateList, this, false));
@@ -205,6 +211,7 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp)
mSettingNameText->setVisible(true);
mSettingNameText->setText(controlp->getName());
mSettingNameText->setToolTip(controlp->getName());
+ mCopyBtn->setVisible(true);
mComment->setVisible(true);
std::string old_text = mComment->getText();
@@ -465,6 +472,17 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp)
mColorSwatch->setValue(sd);
break;
}
+ case TYPE_LLSD:
+ {
+ mLLSDVal->setVisible(true);
+ std::string new_text = ll_pretty_print_sd(sd);
+ // Don't setText if not nessesary, it will reset scroll
+ if (mLLSDVal->getText() != new_text)
+ {
+ mLLSDVal->setText(new_text);
+ }
+ break;
+ }
default:
mComment->setText(std::string("unknown"));
break;
@@ -631,7 +649,14 @@ void LLFloaterSettingsDebug::hideUIControls()
mValText->setVisible(false);
mDefaultButton->setVisible(false);
mBooleanCombo->setVisible(false);
+ mLLSDVal->setVisible(false);
mSettingNameText->setVisible(false);
+ mCopyBtn->setVisible(false);
mComment->setVisible(false);
}
+void LLFloaterSettingsDebug::onClickCopy()
+{
+ std::string setting_name = mSettingNameText->getText();
+ LLClipboard::instance().copyToClipboard(utf8str_to_wstring(setting_name), 0, narrow(setting_name.size()));
+}
diff --git a/indra/newview/llfloatersettingsdebug.h b/indra/newview/llfloatersettingsdebug.h
index b813cf4a74..8849766867 100644
--- a/indra/newview/llfloatersettingsdebug.h
+++ b/indra/newview/llfloatersettingsdebug.h
@@ -49,6 +49,7 @@ public:
void onCommitSettings();
void onClickDefault();
+ void onClickCopy();
bool matchesSearchFilter(std::string setting_name);
bool isSettingHidden(LLControlVariable* control);
@@ -77,7 +78,9 @@ protected:
LLUICtrl* mBooleanCombo = nullptr;
LLUICtrl* mValText = nullptr;
LLUICtrl* mDefaultButton = nullptr;
+ LLTextEditor* mLLSDVal = nullptr;
LLTextBox* mSettingNameText = nullptr;
+ LLButton* mCopyBtn = nullptr;
LLColorSwatchCtrl* mColorSwatch = nullptr;
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 1f52f1d180..fb4537f22a 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -1297,7 +1297,8 @@ bool LLFloaterSnapshotBase::ImplBase::updatePreviewList(bool initialized)
void LLFloaterSnapshotBase::ImplBase::updateLivePreview()
{
- if (ImplBase::updatePreviewList(true) && mFloater)
+ // don't update preview for hidden floater
+ if (mFloater && mFloater->isInVisibleChain() && ImplBase::updatePreviewList(true))
{
LL_DEBUGS() << "changed" << LL_ENDL;
updateControls(mFloater);
diff --git a/indra/newview/llfloatertestinspectors.cpp b/indra/newview/llfloatertestinspectors.cpp
index 7f8d122435..5b29dec6de 100644
--- a/indra/newview/llfloatertestinspectors.cpp
+++ b/indra/newview/llfloatertestinspectors.cpp
@@ -37,9 +37,9 @@ LLFloaterTestInspectors::LLFloaterTestInspectors(const LLSD& seed)
: LLFloater(seed)
{
mCommitCallbackRegistrar.add("ShowAvatarInspector",
- boost::bind(&LLFloaterTestInspectors::showAvatarInspector, this, _1, _2));
+ { boost::bind(&LLFloaterTestInspectors::showAvatarInspector, this, _1, _2) });
mCommitCallbackRegistrar.add("ShowObjectInspector",
- boost::bind(&LLFloaterTestInspectors::showObjectInspector, this, _1, _2));
+ { boost::bind(&LLFloaterTestInspectors::showObjectInspector, this, _1, _2) });
}
LLFloaterTestInspectors::~LLFloaterTestInspectors()
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index f6d8fcab36..5fe089aec5 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -387,21 +387,21 @@ LLFloaterTools::LLFloaterTools(const LLSD& key)
mFactoryMap["Contents"] = LLCallbackMap(createPanelContents, this);//LLPanelContents
mFactoryMap["land info panel"] = LLCallbackMap(createPanelLandInfo, this);//LLPanelLandInfo
- mCommitCallbackRegistrar.add("BuildTool.setTool", boost::bind(&LLFloaterTools::setTool,this, _2));
- mCommitCallbackRegistrar.add("BuildTool.commitZoom", boost::bind(&commit_slider_zoom, _1));
- mCommitCallbackRegistrar.add("BuildTool.commitRadioFocus", boost::bind(&commit_radio_group_focus, _1));
- mCommitCallbackRegistrar.add("BuildTool.commitRadioMove", boost::bind(&commit_radio_group_move,_1));
- mCommitCallbackRegistrar.add("BuildTool.commitRadioEdit", boost::bind(&commit_radio_group_edit,_1));
-
- mCommitCallbackRegistrar.add("BuildTool.gridMode", boost::bind(&commit_grid_mode,_1));
- mCommitCallbackRegistrar.add("BuildTool.selectComponent", boost::bind(&commit_select_component, this));
- mCommitCallbackRegistrar.add("BuildTool.gridOptions", boost::bind(&LLFloaterTools::onClickGridOptions,this));
- mCommitCallbackRegistrar.add("BuildTool.applyToSelection", boost::bind(&click_apply_to_selection, this));
- mCommitCallbackRegistrar.add("BuildTool.commitRadioLand", boost::bind(&commit_radio_group_land,_1));
- mCommitCallbackRegistrar.add("BuildTool.LandBrushForce", boost::bind(&commit_slider_dozer_force,_1));
-
- mCommitCallbackRegistrar.add("BuildTool.LinkObjects", boost::bind(&LLSelectMgr::linkObjects, LLSelectMgr::getInstance()));
- mCommitCallbackRegistrar.add("BuildTool.UnlinkObjects", boost::bind(&LLSelectMgr::unlinkObjects, LLSelectMgr::getInstance()));
+ mCommitCallbackRegistrar.add("BuildTool.setTool", { boost::bind(&LLFloaterTools::setTool,this, _2) });
+ mCommitCallbackRegistrar.add("BuildTool.commitZoom", { boost::bind(&commit_slider_zoom, _1), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("BuildTool.commitRadioFocus", { boost::bind(&commit_radio_group_focus, _1), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("BuildTool.commitRadioMove", { boost::bind(&commit_radio_group_move,_1), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("BuildTool.commitRadioEdit", { boost::bind(&commit_radio_group_edit,_1), cb_info::UNTRUSTED_BLOCK });
+
+ mCommitCallbackRegistrar.add("BuildTool.gridMode", { boost::bind(&commit_grid_mode,_1), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("BuildTool.selectComponent", { boost::bind(&commit_select_component, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("BuildTool.gridOptions", { boost::bind(&LLFloaterTools::onClickGridOptions,this) });
+ mCommitCallbackRegistrar.add("BuildTool.applyToSelection", { boost::bind(&click_apply_to_selection, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("BuildTool.commitRadioLand", { boost::bind(&commit_radio_group_land,_1), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("BuildTool.LandBrushForce", { boost::bind(&commit_slider_dozer_force,_1), cb_info::UNTRUSTED_BLOCK });
+
+ mCommitCallbackRegistrar.add("BuildTool.LinkObjects", { boost::bind(&LLSelectMgr::linkObjects, LLSelectMgr::getInstance()) });
+ mCommitCallbackRegistrar.add("BuildTool.UnlinkObjects", { boost::bind(&LLSelectMgr::unlinkObjects, LLSelectMgr::getInstance()) });
mLandImpactsObserver = new LLLandImpactsObserver();
LLViewerParcelMgr::getInstance()->addObserver(mLandImpactsObserver);
diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp
index 9bc8c63fa0..e379854160 100644
--- a/indra/newview/llfloatertopobjects.cpp
+++ b/indra/newview/llfloatertopobjects.cpp
@@ -76,16 +76,16 @@ LLFloaterTopObjects::LLFloaterTopObjects(const LLSD& key)
mInitialized(false),
mtotalScore(0.f)
{
- mCommitCallbackRegistrar.add("TopObjects.ShowBeacon", boost::bind(&LLFloaterTopObjects::onClickShowBeacon, this));
- mCommitCallbackRegistrar.add("TopObjects.ReturnSelected", boost::bind(&LLFloaterTopObjects::onReturnSelected, this));
- mCommitCallbackRegistrar.add("TopObjects.ReturnAll", boost::bind(&LLFloaterTopObjects::onReturnAll, this));
- mCommitCallbackRegistrar.add("TopObjects.Refresh", boost::bind(&LLFloaterTopObjects::onRefresh, this));
- mCommitCallbackRegistrar.add("TopObjects.GetByObjectName", boost::bind(&LLFloaterTopObjects::onGetByObjectName, this));
- mCommitCallbackRegistrar.add("TopObjects.GetByOwnerName", boost::bind(&LLFloaterTopObjects::onGetByOwnerName, this));
- mCommitCallbackRegistrar.add("TopObjects.GetByParcelName", boost::bind(&LLFloaterTopObjects::onGetByParcelName, this));
- mCommitCallbackRegistrar.add("TopObjects.CommitObjectsList",boost::bind(&LLFloaterTopObjects::onCommitObjectsList, this));
-
- mCommitCallbackRegistrar.add("TopObjects.TeleportToSelected", boost::bind(&LLFloaterTopObjects::teleportToSelectedObject, this));
+ mCommitCallbackRegistrar.add("TopObjects.ShowBeacon", { boost::bind(&LLFloaterTopObjects::onClickShowBeacon, this) });
+ mCommitCallbackRegistrar.add("TopObjects.ReturnSelected", { boost::bind(&LLFloaterTopObjects::onReturnSelected, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("TopObjects.ReturnAll", { boost::bind(&LLFloaterTopObjects::onReturnAll, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("TopObjects.Refresh", { boost::bind(&LLFloaterTopObjects::onRefresh, this), cb_info::UNTRUSTED_THROTTLE });
+ mCommitCallbackRegistrar.add("TopObjects.GetByObjectName", { boost::bind(&LLFloaterTopObjects::onGetByObjectName, this), cb_info::UNTRUSTED_THROTTLE });
+ mCommitCallbackRegistrar.add("TopObjects.GetByOwnerName", { boost::bind(&LLFloaterTopObjects::onGetByOwnerName, this), cb_info::UNTRUSTED_THROTTLE });
+ mCommitCallbackRegistrar.add("TopObjects.GetByParcelName", { boost::bind(&LLFloaterTopObjects::onGetByParcelName, this), cb_info::UNTRUSTED_THROTTLE });
+ mCommitCallbackRegistrar.add("TopObjects.CommitObjectsList",{ boost::bind(&LLFloaterTopObjects::onCommitObjectsList, this), cb_info::UNTRUSTED_THROTTLE });
+
+ mCommitCallbackRegistrar.add("TopObjects.TeleportToSelected", { boost::bind(&LLFloaterTopObjects::teleportToSelectedObject, this), cb_info::UNTRUSTED_THROTTLE });
}
LLFloaterTopObjects::~LLFloaterTopObjects()
diff --git a/indra/newview/llfloatertoybox.cpp b/indra/newview/llfloatertoybox.cpp
index f6257dbd3d..f56b2aa962 100644
--- a/indra/newview/llfloatertoybox.cpp
+++ b/indra/newview/llfloatertoybox.cpp
@@ -41,8 +41,8 @@ LLFloaterToybox::LLFloaterToybox(const LLSD& key)
: LLFloater(key)
, mToolBar(NULL)
{
- mCommitCallbackRegistrar.add("Toybox.RestoreDefaults", boost::bind(&LLFloaterToybox::onBtnRestoreDefaults, this));
- mCommitCallbackRegistrar.add("Toybox.ClearAll", boost::bind(&LLFloaterToybox::onBtnClearAll, this));
+ mCommitCallbackRegistrar.add("Toybox.RestoreDefaults", { boost::bind(&LLFloaterToybox::onBtnRestoreDefaults, this) });
+ mCommitCallbackRegistrar.add("Toybox.ClearAll", { boost::bind(&LLFloaterToybox::onBtnClearAll, this) });
}
LLFloaterToybox::~LLFloaterToybox()
diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp
index 990a299c50..12576c042b 100644
--- a/indra/newview/llfloateruipreview.cpp
+++ b/indra/newview/llfloateruipreview.cpp
@@ -253,7 +253,7 @@ class LLFadeEventTimer : public LLEventTimer
{
public:
LLFadeEventTimer(F32 refresh, LLGUIPreviewLiveFile* parent);
- bool tick();
+ bool tick() override;
LLGUIPreviewLiveFile* mParent;
private:
bool mFadingOut; // fades in then out; this is toggled in between
diff --git a/indra/newview/llfloatervoiceeffect.cpp b/indra/newview/llfloatervoiceeffect.cpp
index 9f7c9aba87..45b6616d1e 100644
--- a/indra/newview/llfloatervoiceeffect.cpp
+++ b/indra/newview/llfloatervoiceeffect.cpp
@@ -36,9 +36,9 @@
LLFloaterVoiceEffect::LLFloaterVoiceEffect(const LLSD& key)
: LLFloater(key)
{
- mCommitCallbackRegistrar.add("VoiceEffect.Record", boost::bind(&LLFloaterVoiceEffect::onClickRecord, this));
- mCommitCallbackRegistrar.add("VoiceEffect.Play", boost::bind(&LLFloaterVoiceEffect::onClickPlay, this));
- mCommitCallbackRegistrar.add("VoiceEffect.Stop", boost::bind(&LLFloaterVoiceEffect::onClickStop, this));
+ mCommitCallbackRegistrar.add("VoiceEffect.Record", { boost::bind(&LLFloaterVoiceEffect::onClickRecord, this) });
+ mCommitCallbackRegistrar.add("VoiceEffect.Play", { boost::bind(&LLFloaterVoiceEffect::onClickPlay, this) });
+ mCommitCallbackRegistrar.add("VoiceEffect.Stop", { boost::bind(&LLFloaterVoiceEffect::onClickStop, this) });
// mCommitCallbackRegistrar.add("VoiceEffect.Activate", boost::bind(&LLFloaterVoiceEffect::onClickActivate, this));
}
diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index e1b6df6072..0cd20b7020 100644
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -75,13 +75,13 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& params )
mDisplayURL(""),
mDevelopMode(params.dev_mode) // if called from "Develop" Menu, set a flag and change things to be more useful for devs
{
- mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this ));
- mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this ));
- mCommitCallbackRegistrar.add( "WebContent.Reload", boost::bind( &LLFloaterWebContent::onClickReload, this ));
- mCommitCallbackRegistrar.add( "WebContent.Stop", boost::bind( &LLFloaterWebContent::onClickStop, this ));
- mCommitCallbackRegistrar.add( "WebContent.EnterAddress", boost::bind( &LLFloaterWebContent::onEnterAddress, this ));
- mCommitCallbackRegistrar.add( "WebContent.PopExternal", boost::bind(&LLFloaterWebContent::onPopExternal, this));
- mCommitCallbackRegistrar.add( "WebContent.TestURL", boost::bind(&LLFloaterWebContent::onTestURL, this, _2));
+ mCommitCallbackRegistrar.add( "WebContent.Back", { boost::bind( &LLFloaterWebContent::onClickBack, this ), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add( "WebContent.Forward", { boost::bind( &LLFloaterWebContent::onClickForward, this ), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add( "WebContent.Reload", { boost::bind( &LLFloaterWebContent::onClickReload, this ), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add( "WebContent.Stop", { boost::bind( &LLFloaterWebContent::onClickStop, this ), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add( "WebContent.EnterAddress", { boost::bind( &LLFloaterWebContent::onEnterAddress, this ), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add( "WebContent.PopExternal", { boost::bind(&LLFloaterWebContent::onPopExternal, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add( "WebContent.TestURL", { boost::bind(&LLFloaterWebContent::onTestURL, this, _2), cb_info::UNTRUSTED_BLOCK });
}
bool LLFloaterWebContent::postBuild()
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index 30ed723db6..dda7266220 100755
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -337,17 +337,17 @@ LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key)
mFactoryMap["objects_mapview"] = LLCallbackMap(createWorldMapView, nullptr);
- mCommitCallbackRegistrar.add("WMap.Coordinates", boost::bind(&LLFloaterWorldMap::onCoordinatesCommit, this));
- mCommitCallbackRegistrar.add("WMap.Location", boost::bind(&LLFloaterWorldMap::onLocationCommit, this));
- mCommitCallbackRegistrar.add("WMap.AvatarCombo", boost::bind(&LLFloaterWorldMap::onAvatarComboCommit, this));
- mCommitCallbackRegistrar.add("WMap.Landmark", boost::bind(&LLFloaterWorldMap::onLandmarkComboCommit, this));
- mCommitCallbackRegistrar.add("WMap.SearchResult", boost::bind(&LLFloaterWorldMap::onCommitSearchResult, this));
- mCommitCallbackRegistrar.add("WMap.GoHome", boost::bind(&LLFloaterWorldMap::onGoHome, this));
- mCommitCallbackRegistrar.add("WMap.Teleport", boost::bind(&LLFloaterWorldMap::onClickTeleportBtn, this));
- mCommitCallbackRegistrar.add("WMap.ShowTarget", boost::bind(&LLFloaterWorldMap::onShowTargetBtn, this));
- mCommitCallbackRegistrar.add("WMap.ShowAgent", boost::bind(&LLFloaterWorldMap::onShowAgentBtn, this));
- mCommitCallbackRegistrar.add("WMap.Clear", boost::bind(&LLFloaterWorldMap::onClearBtn, this));
- mCommitCallbackRegistrar.add("WMap.CopySLURL", boost::bind(&LLFloaterWorldMap::onCopySLURL, this));
+ mCommitCallbackRegistrar.add("WMap.Coordinates", { boost::bind(&LLFloaterWorldMap::onCoordinatesCommit, this) });
+ mCommitCallbackRegistrar.add("WMap.Location", { boost::bind(&LLFloaterWorldMap::onLocationCommit, this) });
+ mCommitCallbackRegistrar.add("WMap.AvatarCombo", { boost::bind(&LLFloaterWorldMap::onAvatarComboCommit, this) });
+ mCommitCallbackRegistrar.add("WMap.Landmark", { boost::bind(&LLFloaterWorldMap::onLandmarkComboCommit, this) });
+ mCommitCallbackRegistrar.add("WMap.SearchResult", { boost::bind(&LLFloaterWorldMap::onCommitSearchResult, this) });
+ mCommitCallbackRegistrar.add("WMap.GoHome", { boost::bind(&LLFloaterWorldMap::onGoHome, this) });
+ mCommitCallbackRegistrar.add("WMap.Teleport", { boost::bind(&LLFloaterWorldMap::onClickTeleportBtn, this) });
+ mCommitCallbackRegistrar.add("WMap.ShowTarget", { boost::bind(&LLFloaterWorldMap::onShowTargetBtn, this) });
+ mCommitCallbackRegistrar.add("WMap.ShowAgent", { boost::bind(&LLFloaterWorldMap::onShowAgentBtn, this) });
+ mCommitCallbackRegistrar.add("WMap.Clear", { boost::bind(&LLFloaterWorldMap::onClearBtn, this) });
+ mCommitCallbackRegistrar.add("WMap.CopySLURL", { boost::bind(&LLFloaterWorldMap::onCopySLURL, this) });
gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLFloaterWorldMap::onChangeMaturity, this));
}
diff --git a/indra/newview/llflyoutcombobtn.cpp b/indra/newview/llflyoutcombobtn.cpp
index 728f60e1c0..97cd637da1 100644
--- a/indra/newview/llflyoutcombobtn.cpp
+++ b/indra/newview/llflyoutcombobtn.cpp
@@ -41,7 +41,7 @@ LLFlyoutComboBtnCtrl::LLFlyoutComboBtnCtrl(LLPanel* parent,
{
// register action mapping before creating menu
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar save_registar;
- save_registar.add("FlyoutCombo.Button.Action", [this](LLUICtrl *ctrl, const LLSD &data) { onFlyoutItemSelected(ctrl, data); });
+ save_registar.add("FlyoutCombo.Button.Action", { [this](LLUICtrl *ctrl, const LLSD &data) { onFlyoutItemSelected(ctrl, data); } });
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enabled_rgistar;
enabled_rgistar.add("FlyoutCombo.Button.Check", [this](LLUICtrl *ctrl, const LLSD &data) { return onFlyoutItemCheck(ctrl, data); });
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index 0248f5710f..112008172e 100644
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -68,7 +68,7 @@
#include <vector>
// Height of the yellow selection highlight posts for land
-const F32 PARCEL_POST_HEIGHT = 0.666f;
+constexpr F32 PARCEL_POST_HEIGHT = 0.666f;
// Returns true if you got at least one object
void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
@@ -178,27 +178,27 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
{
std::vector<LLDrawable*> potentials;
- for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
- iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
+ for (LLViewerRegion* region : LLWorld::getInstance()->getRegionList())
{
- LLViewerRegion* region = *iter;
for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++)
{
- LLSpatialPartition* part = region->getSpatialPartition(i);
- if (part)
+ if (LLSpatialPartition* part = region->getSpatialPartition(i))
{
part->cull(*LLViewerCamera::getInstance(), &potentials, true);
}
}
}
- for (std::vector<LLDrawable*>::iterator iter = potentials.begin();
- iter != potentials.end(); iter++)
+ for (LLDrawable* drawable : potentials)
{
- LLDrawable* drawable = *iter;
+ if (!drawable)
+ {
+ continue;
+ }
+
LLViewerObject* vobjp = drawable->getVObj();
- if (!drawable || !vobjp ||
+ if (!vobjp ||
vobjp->getPCode() != LL_PCODE_VOLUME ||
vobjp->isAttachment() ||
(deselect && !vobjp->isSelected()))
@@ -244,7 +244,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
gViewerWindow->setup3DRender();
}
-const F32 WIND_RELATIVE_ALTITUDE = 25.f;
+constexpr F32 WIND_RELATIVE_ALTITUDE = 25.f;
void LLWind::renderVectors()
{
@@ -266,14 +266,14 @@ void LLWind::renderVectors()
x = mVelX[i + j*mSize] * WIND_SCALE_HACK;
y = mVelY[i + j*mSize] * WIND_SCALE_HACK;
gGL.pushMatrix();
- gGL.translatef((F32)i * region_width_meters/mSize, (F32)j * region_width_meters/mSize, 0.0);
- gGL.color3f(0,1,0);
+ gGL.translatef((F32)i * region_width_meters/mSize, (F32)j * region_width_meters/mSize, 0.f);
+ gGL.color3f(0.f, 1.f, 0.f);
gGL.begin(LLRender::POINTS);
- gGL.vertex3f(0,0,0);
+ gGL.vertex3f(0.f, 0.f, 0.f);
gGL.end();
- gGL.color3f(1,0,0);
+ gGL.color3f(1.f, 0.f, 0.f);
gGL.begin(LLRender::LINES);
- gGL.vertex3f(x * 0.1f, y * 0.1f ,0.f);
+ gGL.vertex3f(x * 0.1f, y * 0.1f, 0.f);
gGL.vertex3f(x, y, 0.f);
gGL.end();
gGL.popMatrix();
@@ -287,7 +287,7 @@ void LLWind::renderVectors()
// Used by lltoolselectland
void LLViewerParcelMgr::renderRect(const LLVector3d &west_south_bottom_global,
- const LLVector3d &east_north_top_global )
+ const LLVector3d &east_north_top_global)
{
LLGLSUIDefault gls_ui;
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
@@ -338,118 +338,23 @@ void LLViewerParcelMgr::renderRect(const LLVector3d &west_south_bottom_global,
gGL.end();
gGL.color4f(1.f, 1.f, 0.f, 0.2f);
- gGL.begin(LLRender::QUADS);
-
- gGL.vertex3f(west, north, nw_bottom);
- gGL.vertex3f(west, north, nw_top);
- gGL.vertex3f(east, north, ne_top);
- gGL.vertex3f(east, north, ne_bottom);
-
- gGL.vertex3f(east, north, ne_bottom);
- gGL.vertex3f(east, north, ne_top);
- gGL.vertex3f(east, south, se_top);
- gGL.vertex3f(east, south, se_bottom);
-
- gGL.vertex3f(east, south, se_bottom);
- gGL.vertex3f(east, south, se_top);
- gGL.vertex3f(west, south, sw_top);
- gGL.vertex3f(west, south, sw_bottom);
-
- gGL.vertex3f(west, south, sw_bottom);
- gGL.vertex3f(west, south, sw_top);
- gGL.vertex3f(west, north, nw_top);
- gGL.vertex3f(west, north, nw_bottom);
-
- gGL.end();
-
- LLUI::setLineWidth(1.f);
-}
-
-/*
-void LLViewerParcelMgr::renderParcel(LLParcel* parcel )
-{
- S32 i;
- S32 count = parcel->getBoxCount();
- for (i = 0; i < count; i++)
+ gGL.begin(LLRender::TRIANGLE_STRIP);
{
- const LLParcelBox& box = parcel->getBox(i);
-
- F32 west = box.mMin.mV[VX];
- F32 south = box.mMin.mV[VY];
-
- F32 east = box.mMax.mV[VX];
- F32 north = box.mMax.mV[VY];
-
- // HACK: At edge of last region of world, we need to make sure the region
- // resolves correctly so we can get a height value.
- const F32 FUDGE = 0.01f;
-
- F32 sw_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( west, south, 0.f ) );
- F32 se_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( east-FUDGE, south, 0.f ) );
- F32 ne_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( east-FUDGE, north-FUDGE, 0.f ) );
- F32 nw_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( west, north-FUDGE, 0.f ) );
-
- // little hack to make nearby lines not Z-fight
- east -= 0.1f;
- north -= 0.1f;
-
- F32 sw_top = sw_bottom + POST_HEIGHT;
- F32 se_top = se_bottom + POST_HEIGHT;
- F32 ne_top = ne_bottom + POST_HEIGHT;
- F32 nw_top = nw_bottom + POST_HEIGHT;
-
- gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- LLGLDepthTest gls_depth(GL_TRUE);
-
- LLUI::setLineWidth(2.f);
- gGL.color4f(0.f, 1.f, 1.f, 1.f);
-
- // Cheat and give this the same pick-name as land
- gGL.begin(LLRender::LINES);
-
- gGL.vertex3f(west, north, nw_bottom);
- gGL.vertex3f(west, north, nw_top);
-
- gGL.vertex3f(east, north, ne_bottom);
- gGL.vertex3f(east, north, ne_top);
-
- gGL.vertex3f(east, south, se_bottom);
- gGL.vertex3f(east, south, se_top);
-
- gGL.vertex3f(west, south, sw_bottom);
- gGL.vertex3f(west, south, sw_top);
-
- gGL.end();
-
- gGL.color4f(0.f, 1.f, 1.f, 0.2f);
- gGL.begin(LLRender::QUADS);
-
gGL.vertex3f(west, north, nw_bottom);
gGL.vertex3f(west, north, nw_top);
- gGL.vertex3f(east, north, ne_top);
- gGL.vertex3f(east, north, ne_bottom);
-
gGL.vertex3f(east, north, ne_bottom);
gGL.vertex3f(east, north, ne_top);
- gGL.vertex3f(east, south, se_top);
- gGL.vertex3f(east, south, se_bottom);
-
gGL.vertex3f(east, south, se_bottom);
gGL.vertex3f(east, south, se_top);
gGL.vertex3f(west, south, sw_top);
gGL.vertex3f(west, south, sw_bottom);
-
- gGL.vertex3f(west, south, sw_bottom);
- gGL.vertex3f(west, south, sw_top);
gGL.vertex3f(west, north, nw_top);
gGL.vertex3f(west, north, nw_bottom);
-
- gGL.end();
-
- LLUI::setLineWidth(1.f);
}
+ gGL.end();
+
+ LLUI::setLineWidth(1.f);
}
-*/
// north = a wall going north/south. Need that info to set up texture
@@ -493,6 +398,10 @@ void LLViewerParcelMgr::renderOneSegment(F32 x1, F32 y1, F32 x2, F32 y2, F32 hei
gGL.vertex3f(x2, y2, z2);
+ gGL.vertex3f(x1, y1, z);
+
+ gGL.vertex3f(x2, y2, z2);
+
z = z2+height;
gGL.vertex3f(x2, y2, z);
}
@@ -523,18 +432,24 @@ void LLViewerParcelMgr::renderOneSegment(F32 x1, F32 y1, F32 x2, F32 y2, F32 hei
}
- gGL.texCoord2f(tex_coord1*0.5f+0.5f, z1*0.5f);
+ gGL.texCoord2f(tex_coord1 * 0.5f + 0.5f, z1 * 0.5f);
gGL.vertex3f(x1, y1, z1);
- gGL.texCoord2f(tex_coord2*0.5f+0.5f, z2*0.5f);
+ gGL.texCoord2f(tex_coord2 * 0.5f + 0.5f, z2 * 0.5f);
gGL.vertex3f(x2, y2, z2);
// top edge stairsteps
- z = llmax(z2+height, z1+height);
- gGL.texCoord2f(tex_coord2*0.5f+0.5f, z*0.5f);
+ z = llmax(z2 + height, z1 + height);
+ gGL.texCoord2f(tex_coord2 * 0.5f + 0.5f, z * 0.5f);
+ gGL.vertex3f(x2, y2, z);
+
+ gGL.texCoord2f(tex_coord1 * 0.5f + 0.5f, z1 * 0.5f);
+ gGL.vertex3f(x1, y1, z1);
+
+ gGL.texCoord2f(tex_coord2 * 0.5f + 0.5f, z * 0.5f);
gGL.vertex3f(x2, y2, z);
- gGL.texCoord2f(tex_coord1*0.5f+0.5f, z*0.5f);
+ gGL.texCoord2f(tex_coord1 * 0.5f + 0.5f, z * 0.5f);
gGL.vertex3f(x1, y1, z);
}
}
@@ -575,7 +490,7 @@ void LLViewerParcelMgr::renderHighlightSegments(const U8* segments, LLViewerRegi
if (!has_segments)
{
has_segments = true;
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLES);
}
renderOneSegment(x1, y1, x2, y2, PARCEL_POST_HEIGHT, SOUTH_MASK, regionp);
}
@@ -591,7 +506,7 @@ void LLViewerParcelMgr::renderHighlightSegments(const U8* segments, LLViewerRegi
if (!has_segments)
{
has_segments = true;
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLES);
}
renderOneSegment(x1, y1, x2, y2, PARCEL_POST_HEIGHT, WEST_MASK, regionp);
}
@@ -647,7 +562,7 @@ void LLViewerParcelMgr::renderCollisionSegments(U8* segments, bool use_pass, LLV
gGL.getTexUnit(0)->bind(mBlockedImage);
}
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLES);
for (y = 0; y < STRIDE; y++)
{
@@ -923,7 +838,7 @@ struct ShaderProfileHelper
}
~ShaderProfileHelper()
{
- LLGLSLShader::finishProfile(false);
+ LLGLSLShader::finishProfile();
}
};
diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp
index ba9c9fa13f..1128939e29 100644
--- a/indra/newview/llgroupactions.cpp
+++ b/indra/newview/llgroupactions.cpp
@@ -37,6 +37,7 @@
#include "llfloatersidepanelcontainer.h"
#include "llgroupmgr.h"
#include "llfloaterimcontainer.h"
+#include "llfloaterimsession.h"
#include "llimview.h" // for gIMMgr
#include "llnotificationsutil.h"
#include "llstartup.h"
@@ -46,7 +47,7 @@
//
// Globals
//
-static GroupChatListener sGroupChatListener;
+static LLGroupChatListener sGroupChatListener;
class LLGroupHandler : public LLCommandHandler
{
@@ -519,7 +520,10 @@ void LLGroupActions::endIM(const LLUUID& group_id)
LLUUID session_id = gIMMgr->computeSessionID(IM_SESSION_GROUP_START, group_id);
if (session_id != LLUUID::null)
{
- gIMMgr->leaveSession(session_id);
+ if (LLFloaterIMSession *conversationFloater = LLFloaterIMSession::findInstance(session_id))
+ {
+ LLFloater::onClickClose(conversationFloater);
+ }
}
}
diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp
index 7659e5f082..14ac14cd85 100644
--- a/indra/newview/llgrouplist.cpp
+++ b/indra/newview/llgrouplist.cpp
@@ -141,7 +141,7 @@ void LLGroupList::enableForAgent(bool show_icons)
gAgent.addListener(this, "new group");
// Set up context menu.
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ ScopedRegistrarHelper registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
registrar.add("People.Groups.Action", boost::bind(&LLGroupList::onContextMenuItemClick, this, _2));
diff --git a/indra/newview/llhttpretrypolicy.cpp b/indra/newview/llhttpretrypolicy.cpp
index 3e55030610..c5692554c6 100644
--- a/indra/newview/llhttpretrypolicy.cpp
+++ b/indra/newview/llhttpretrypolicy.cpp
@@ -91,14 +91,14 @@ void LLAdaptiveRetryPolicy::onSuccess()
void LLAdaptiveRetryPolicy::onFailure(S32 status, const LLSD& headers)
{
- F32 retry_header_time;
+ F32 retry_header_time{};
bool has_retry_header_time = getRetryAfter(headers,retry_header_time);
onFailureCommon(status, has_retry_header_time, retry_header_time);
}
void LLAdaptiveRetryPolicy::onFailure(const LLCore::HttpResponse *response)
{
- F32 retry_header_time;
+ F32 retry_header_time{};
const LLCore::HttpHeaders::ptr_t headers = response->getHeaders();
bool has_retry_header_time = getRetryAfter(headers,retry_header_time);
onFailureCommon(response->getStatus().getType(), has_retry_header_time, retry_header_time);
@@ -184,4 +184,3 @@ bool LLAdaptiveRetryPolicy::getSecondsUntilRetryAfter(const std::string& retry_a
return true;
}
-
diff --git a/indra/newview/llhudeffectblob.cpp b/indra/newview/llhudeffectblob.cpp
index b476226d05..bdb21fd96e 100644
--- a/indra/newview/llhudeffectblob.cpp
+++ b/indra/newview/llhudeffectblob.cpp
@@ -78,16 +78,23 @@ void LLHUDEffectBlob::render()
LLVector3 u_scale = pixel_right * (F32)mPixelSize;
LLVector3 v_scale = pixel_up * (F32)mPixelSize;
- { gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLES);
+ {
gGL.texCoord2f(0.f, 1.f);
gGL.vertex3fv((v_scale - u_scale).mV);
gGL.texCoord2f(0.f, 0.f);
gGL.vertex3fv((-v_scale - u_scale).mV);
gGL.texCoord2f(1.f, 0.f);
gGL.vertex3fv((-v_scale + u_scale).mV);
+
+ gGL.texCoord2f(0.f, 1.f);
+ gGL.vertex3fv((v_scale - u_scale).mV);
+ gGL.texCoord2f(1.f, 0.f);
+ gGL.vertex3fv((-v_scale + u_scale).mV);
gGL.texCoord2f(1.f, 1.f);
gGL.vertex3fv((v_scale + u_scale).mV);
- } gGL.end();
+ }
+ gGL.end();
} gGL.popMatrix();
}
diff --git a/indra/newview/llhudicon.cpp b/indra/newview/llhudicon.cpp
index 8fa4118a40..1a4af470bd 100644
--- a/indra/newview/llhudicon.cpp
+++ b/indra/newview/llhudicon.cpp
@@ -152,7 +152,7 @@ void LLHUDIcon::render()
gGL.getTexUnit(0)->bind(mImagep);
}
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLES);
{
gGL.texCoord2f(0.f, 1.f);
gGL.vertex3fv(upper_left.mV);
@@ -160,6 +160,11 @@ void LLHUDIcon::render()
gGL.vertex3fv(lower_left.mV);
gGL.texCoord2f(1.f, 0.f);
gGL.vertex3fv(lower_right.mV);
+
+ gGL.texCoord2f(0.f, 1.f);
+ gGL.vertex3fv(upper_left.mV);
+ gGL.texCoord2f(1.f, 0.f);
+ gGL.vertex3fv(lower_right.mV);
gGL.texCoord2f(1.f, 1.f);
gGL.vertex3fv(upper_right.mV);
}
diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp
index 19ae35813c..66130a2744 100644
--- a/indra/newview/llhudnametag.cpp
+++ b/indra/newview/llhudnametag.cpp
@@ -275,7 +275,8 @@ void LLHUDNameTag::renderText()
LLVector3 x_pixel_vec;
LLVector3 y_pixel_vec;
- LLViewerCamera::getInstance()->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec);
+ LLViewerCamera* camera = LLViewerCamera::getInstance();
+ camera->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec);
LLVector3 width_vec = mWidth * x_pixel_vec;
LLVector3 height_vec = mHeight * y_pixel_vec;
@@ -283,7 +284,7 @@ void LLHUDNameTag::renderText()
mRadius = (width_vec + height_vec).magVec() * 0.5f;
LLCoordGL screen_pos;
- LLViewerCamera::getInstance()->projectPosAgentToScreen(mPositionAgent, screen_pos, false);
+ camera->projectPosAgentToScreen(mPositionAgent, screen_pos, false);
LLVector2 screen_offset = updateScreenPos(mPositionOffset);
@@ -310,7 +311,7 @@ void LLHUDNameTag::renderText()
const S32 label_height = ll_round((mFontp->getLineHeight() * (F32)mLabelSegments.size() + (VERTICAL_PADDING / 3.f)));
label_top_rect.mBottom = label_top_rect.mTop - label_height;
LLColor4 label_top_color = text_color;
- label_top_color.mV[VALPHA] = gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor;
+ label_top_color.mV[VALPHA] = bubble_opacity() * alpha_factor;
mRoundedRectTopImgp->draw3D(render_position, x_pixel_vec, y_pixel_vec, label_top_rect, label_top_color);
}
@@ -645,12 +646,13 @@ LLVector2 LLHUDNameTag::updateScreenPos(LLVector2 &offset)
LLVector2 screen_pos_vec;
LLVector3 x_pixel_vec;
LLVector3 y_pixel_vec;
- LLViewerCamera::getInstance()->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec);
+ LLViewerCamera* camera = LLViewerCamera::getInstance();
+ camera->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec);
LLVector3 world_pos = mPositionAgent + (offset.mV[VX] * x_pixel_vec) + (offset.mV[VY] * y_pixel_vec);
- if (!LLViewerCamera::getInstance()->projectPosAgentToScreen(world_pos, screen_pos, false) && mVisibleOffScreen)
+ if (!camera->projectPosAgentToScreen(world_pos, screen_pos, false) && mVisibleOffScreen)
{
// bubble off-screen, so find a spot for it along screen edge
- LLViewerCamera::getInstance()->projectPosAgentToScreenEdge(world_pos, screen_pos);
+ camera->projectPosAgentToScreenEdge(world_pos, screen_pos);
}
screen_pos_vec.setVec((F32)screen_pos.mX, (F32)screen_pos.mY);
diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp
index 4180e49e94..aa440c6cf5 100644
--- a/indra/newview/llhudrender.cpp
+++ b/indra/newview/llhudrender.cpp
@@ -63,6 +63,7 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent,
const LLColor4& color,
const bool orthographic)
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
LLViewerCamera* camera = LLViewerCamera::getInstance();
// Do cheap plane culling
LLVector3 dir_vec = pos_agent - camera->getOrigin();
diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp
index c1e68e0288..590cd09a31 100644
--- a/indra/newview/llimprocessing.cpp
+++ b/indra/newview/llimprocessing.cpp
@@ -488,7 +488,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
case IM_NOTHING_SPECIAL: // p2p IM
// Don't show dialog, just do IM
if (!gAgent.isGodlike()
- && gAgent.getRegion()->isPrelude()
+ && gAgent.inPrelude()
&& to_id.isNull())
{
// do nothing -- don't distract newbies in
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 06cf9919b6..1402cc8c37 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -3551,6 +3551,7 @@ void LLIMMgr::inviteToSession(
&& voice_invite && "VoiceInviteQuestionDefault" == question_type)
{
LL_INFOS("IMVIEW") << "Rejecting voice call from initiating muted resident " << caller_name << LL_ENDL;
+ payload["voice_channel_info"] = voice_channel_info;
LLIncomingCallDialog::processCallResponse(1, payload);
return;
}
@@ -3599,6 +3600,7 @@ void LLIMMgr::inviteToSession(
send_do_not_disturb_message(gMessageSystem, caller_id, session_id);
}
// silently decline the call
+ payload["voice_channel_info"] = voice_channel_info;
LLIncomingCallDialog::processCallResponse(1, payload);
return;
}
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index 99b19c9fa9..233fb075e8 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -51,7 +51,7 @@ class LLSessionTimeoutTimer : public LLEventTimer
public:
LLSessionTimeoutTimer(const LLUUID& session_id, F32 period) : LLEventTimer(period), mSessionId(session_id) {}
virtual ~LLSessionTimeoutTimer() {};
- /* virtual */ bool tick();
+ bool tick() override;
private:
LLUUID mSessionId;
diff --git a/indra/newview/llinspectgroup.cpp b/indra/newview/llinspectgroup.cpp
index db48061c56..c39380105b 100644
--- a/indra/newview/llinspectgroup.cpp
+++ b/indra/newview/llinspectgroup.cpp
@@ -97,11 +97,11 @@ LLInspectGroup::LLInspectGroup(const LLSD& sd)
mGroupID() // set in onOpen()
{
mCommitCallbackRegistrar.add("InspectGroup.ViewProfile",
- boost::bind(&LLInspectGroup::onClickViewProfile, this));
+ { boost::bind(&LLInspectGroup::onClickViewProfile, this), cb_info::UNTRUSTED_THROTTLE });
mCommitCallbackRegistrar.add("InspectGroup.Join",
- boost::bind(&LLInspectGroup::onClickJoin, this));
+ { boost::bind(&LLInspectGroup::onClickJoin, this), cb_info::UNTRUSTED_THROTTLE });
mCommitCallbackRegistrar.add("InspectGroup.Leave",
- boost::bind(&LLInspectGroup::onClickLeave, this));
+ { boost::bind(&LLInspectGroup::onClickLeave, this), cb_info::UNTRUSTED_BLOCK });
// can't make the properties request until the widgets are constructed
// as it might return immediately, so do it in postBuild.
diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp
index eb2cdb8632..874ad41551 100644
--- a/indra/newview/llinspectobject.cpp
+++ b/indra/newview/llinspectobject.cpp
@@ -129,14 +129,14 @@ LLInspectObject::LLInspectObject(const LLSD& sd)
{
// can't make the properties request until the widgets are constructed
// as it might return immediately, so do it in postBuild.
- mCommitCallbackRegistrar.add("InspectObject.Buy", boost::bind(&LLInspectObject::onClickBuy, this));
- mCommitCallbackRegistrar.add("InspectObject.Pay", boost::bind(&LLInspectObject::onClickPay, this));
- mCommitCallbackRegistrar.add("InspectObject.TakeFreeCopy", boost::bind(&LLInspectObject::onClickTakeFreeCopy, this));
- mCommitCallbackRegistrar.add("InspectObject.Touch", boost::bind(&LLInspectObject::onClickTouch, this));
- mCommitCallbackRegistrar.add("InspectObject.Sit", boost::bind(&LLInspectObject::onClickSit, this));
- mCommitCallbackRegistrar.add("InspectObject.Open", boost::bind(&LLInspectObject::onClickOpen, this));
- mCommitCallbackRegistrar.add("InspectObject.MoreInfo", boost::bind(&LLInspectObject::onClickMoreInfo, this));
- mCommitCallbackRegistrar.add("InspectObject.ZoomIn", boost::bind(&LLInspectObject::onClickZoomIn, this));
+ mCommitCallbackRegistrar.add("InspectObject.Buy", {boost::bind(&LLInspectObject::onClickBuy, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("InspectObject.Pay", {boost::bind(&LLInspectObject::onClickPay, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("InspectObject.TakeFreeCopy", {boost::bind(&LLInspectObject::onClickTakeFreeCopy, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("InspectObject.Touch", {boost::bind(&LLInspectObject::onClickTouch, this), cb_info::UNTRUSTED_BLOCK});
+ mCommitCallbackRegistrar.add("InspectObject.Sit", {boost::bind(&LLInspectObject::onClickSit, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("InspectObject.Open", {boost::bind(&LLInspectObject::onClickOpen, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("InspectObject.MoreInfo", {boost::bind(&LLInspectObject::onClickMoreInfo, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("InspectObject.ZoomIn", {boost::bind(&LLInspectObject::onClickZoomIn, this), cb_info::UNTRUSTED_BLOCK});
}
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 2e8b1b94fe..896c7d8d70 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -844,7 +844,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
disabled_items.push_back(std::string("Copy"));
}
- if (isAgentInventory() && !single_folder_root)
+ if (isAgentInventory() && !single_folder_root && !isMarketplaceListingsFolder())
{
items.push_back(std::string("New folder from selected"));
items.push_back(std::string("Subfolder Separator"));
@@ -5321,7 +5321,7 @@ void LLFolderBridge::dropToMyOutfits(LLInventoryCategory* inv_cat, LLPointer<LLI
// Note: creation will take time, so passing folder id to callback is slightly unreliable,
// but so is collecting and passing descendants' ids
- inventory_func_type func = boost::bind(&LLFolderBridge::outfitFolderCreatedCallback, this, inv_cat->getUUID(), _1, cb);
+ inventory_func_type func = boost::bind(outfitFolderCreatedCallback, inv_cat->getUUID(), _1, cb, mInventoryPanel);
gInventory.createNewCategory(dest_id,
LLFolderType::FT_OUTFIT,
inv_cat->getName(),
@@ -5329,11 +5329,25 @@ void LLFolderBridge::dropToMyOutfits(LLInventoryCategory* inv_cat, LLPointer<LLI
inv_cat->getThumbnailUUID());
}
-void LLFolderBridge::outfitFolderCreatedCallback(LLUUID cat_source_id, LLUUID cat_dest_id, LLPointer<LLInventoryCallback> cb)
+void LLFolderBridge::outfitFolderCreatedCallback(LLUUID cat_source_id,
+ LLUUID cat_dest_id,
+ LLPointer<LLInventoryCallback> cb,
+ LLHandle<LLInventoryPanel> inventory_panel)
{
LLInventoryModel::cat_array_t* categories;
LLInventoryModel::item_array_t* items;
- getInventoryModel()->getDirectDescendentsOf(cat_source_id, categories, items);
+
+ LLInventoryPanel* panel = inventory_panel.get();
+ if (!panel)
+ {
+ return;
+ }
+ LLInventoryModel* model = panel->getModel();
+ if (!model)
+ {
+ return;
+ }
+ model->getDirectDescendentsOf(cat_source_id, categories, items);
LLInventoryObject::const_object_list_t link_array;
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 746b79ce87..3e7f74384b 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -378,7 +378,10 @@ public:
static void staticFolderOptionsMenu();
protected:
- void outfitFolderCreatedCallback(LLUUID cat_source_id, LLUUID cat_dest_id, LLPointer<LLInventoryCallback> cb);
+ static void outfitFolderCreatedCallback(LLUUID cat_source_id,
+ LLUUID cat_dest_id,
+ LLPointer<LLInventoryCallback> cb,
+ LLHandle<LLInventoryPanel> inventory_panel);
void callback_pasteFromClipboard(const LLSD& notification, const LLSD& response);
void perform_pasteFromClipboard();
void gatherMessage(std::string& message, S32 depth, LLError::ELevel log_level);
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 5c0905af3c..01f2c6c525 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -959,7 +959,7 @@ void LLInventoryFilter::setFilterSubString(const std::string& string)
boost::char_separator<char> sep("+");
tokenizer tokens(filter_sub_string_new, sep);
- for (auto token_iter : tokens)
+ for (const auto& token_iter : tokens)
{
mFilterTokens.push_back(token_iter);
}
@@ -1025,7 +1025,7 @@ void LLInventoryFilter::setFilterSubString(const std::string& string)
}
// Cancel out UUID once the search string is modified
- if (mFilterOps.mFilterTypes == FILTERTYPE_UUID)
+ if (mFilterOps.mFilterTypes & FILTERTYPE_UUID)
{
mFilterOps.mFilterTypes &= ~FILTERTYPE_UUID;
mFilterOps.mFilterUUID = LLUUID::null;
@@ -1707,7 +1707,7 @@ std::string LLInventoryFilter::getEmptyLookupMessage(bool is_empty_folder) const
}
}
-bool LLInventoryFilter::areDateLimitsSet()
+bool LLInventoryFilter::areDateLimitsSet() const
{
return mFilterOps.mMinDate != time_min()
|| mFilterOps.mMaxDate != time_max()
diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h
index 7e64a03e73..612a161ba2 100644
--- a/indra/newview/llinventoryfilter.h
+++ b/indra/newview/llinventoryfilter.h
@@ -341,7 +341,7 @@ public:
bool checkAgainstFilterThumbnails(const LLUUID& object_id) const;
private:
- bool areDateLimitsSet();
+ bool areDateLimitsSet() const;
bool checkAgainstFilterSubString(const std::string& desc) const;
bool checkAgainstFilterType(const class LLFolderViewModelItemInventory* listener) const;
bool checkAgainstFilterType(const LLInventoryItem* item) const;
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index dadd0590a9..fdf77ab8df 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -2758,6 +2758,19 @@ bool LLNameCategoryCollector::operator()(
return false;
}
+bool LLNameItemCollector::operator()(
+ LLInventoryCategory* cat, LLInventoryItem* item)
+{
+ if(item)
+ {
+ if (!LLStringUtil::compareInsensitive(mName, item->getName()))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
bool LLFindCOFValidItems::operator()(LLInventoryCategory* cat,
LLInventoryItem* item)
{
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index a25c0d5ad6..cd6f319f66 100644
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -189,6 +189,8 @@ public:
virtual ~LLInventoryCollectFunctor(){};
virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) = 0;
+ virtual bool exceedsLimit() { return false; }
+
static bool itemTransferCommonlyAllowed(const LLInventoryItem* item);
};
@@ -392,6 +394,22 @@ protected:
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// Class LLNameItemCollector
+//
+// Collects items based on case-insensitive match of prefix
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+class LLNameItemCollector : public LLInventoryCollectFunctor
+{
+public:
+ LLNameItemCollector(const std::string& name) : mName(name) {}
+ virtual ~LLNameItemCollector() {}
+ virtual bool operator()(LLInventoryCategory* cat,
+ LLInventoryItem* item);
+protected:
+ std::string mName;
+};
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLFindCOFValidItems
//
// Collects items that can be legitimately linked to in the COF.
diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp
index dbf4821ca1..c84b9abba0 100644
--- a/indra/newview/llinventorygallerymenu.cpp
+++ b/indra/newview/llinventorygallerymenu.cpp
@@ -87,13 +87,15 @@ void modify_outfit(bool append, const LLUUID& cat_id, LLInventoryModel* model)
LLContextMenu* LLInventoryGalleryContextMenu::createMenu()
{
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ LLUICtrl::ScopedRegistrarHelper registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
- registrar.add("Inventory.DoToSelected", boost::bind(&LLInventoryGalleryContextMenu::doToSelected, this, _2));
- registrar.add("Inventory.FileUploadLocation", boost::bind(&LLInventoryGalleryContextMenu::fileUploadLocation, this, _2));
- registrar.add("Inventory.EmptyTrash", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyTrash", LLFolderType::FT_TRASH));
- registrar.add("Inventory.EmptyLostAndFound", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyLostAndFound", LLFolderType::FT_LOST_AND_FOUND));
+ registrar.add("Inventory.DoToSelected", boost::bind(&LLInventoryGalleryContextMenu::doToSelected, this, _2), LLUICtrl::cb_info::UNTRUSTED_BLOCK);
+ registrar.add("Inventory.FileUploadLocation", boost::bind(&LLInventoryGalleryContextMenu::fileUploadLocation, this, _2), LLUICtrl::cb_info::UNTRUSTED_BLOCK);
+ registrar.add("Inventory.EmptyTrash",
+ boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyTrash", LLFolderType::FT_TRASH), LLUICtrl::cb_info::UNTRUSTED_BLOCK);
+ registrar.add("Inventory.EmptyLostAndFound",
+ boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyLostAndFound", LLFolderType::FT_LOST_AND_FOUND), LLUICtrl::cb_info::UNTRUSTED_BLOCK);
registrar.add("Inventory.DoCreate", [this](LLUICtrl*, const LLSD& data)
{
if (mRootFolder)
@@ -104,10 +106,11 @@ LLContextMenu* LLInventoryGalleryContextMenu::createMenu()
{
mGallery->doCreate(mUUIDs.front(), data);
}
- });
+ },
+ LLUICtrl::cb_info::UNTRUSTED_BLOCK);
std::set<LLUUID> uuids(mUUIDs.begin(), mUUIDs.end());
- registrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, uuids, gFloaterView->getParentFloater(mGallery)));
+ registrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, uuids, gFloaterView->getParentFloater(mGallery)), LLUICtrl::cb_info::UNTRUSTED_BLOCK);
enable_registrar.add("Inventory.CanSetUploadLocation", boost::bind(&LLInventoryGalleryContextMenu::canSetUploadLocation, this, _2));
diff --git a/indra/newview/llinventorylistener.cpp b/indra/newview/llinventorylistener.cpp
new file mode 100644
index 0000000000..79726c3e0b
--- /dev/null
+++ b/indra/newview/llinventorylistener.cpp
@@ -0,0 +1,392 @@
+/**
+ * @file llinventorylistener.cpp
+ *
+ * $LicenseInfo:firstyear=2024&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2024, 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 "llinventorylistener.h"
+
+#include "llappearancemgr.h"
+#include "llinventoryfunctions.h"
+#include "lltransutil.h"
+#include "llwearableitemslist.h"
+#include "resultset.h"
+#include "stringize.h"
+#include <algorithm> // std::min()
+
+constexpr S32 MAX_ITEM_LIMIT = 100;
+
+LLInventoryListener::LLInventoryListener()
+ : LLEventAPI("LLInventory",
+ "API for interactions with viewer Inventory items")
+{
+ add("getItemsInfo",
+ "Return information about items or folders defined in [\"item_ids\"]:\n"
+ "reply will contain [\"items\"] and [\"categories\"] result set keys",
+ &LLInventoryListener::getItemsInfo,
+ llsd::map("item_ids", LLSD(), "reply", LLSD()));
+
+ add("getFolderTypeNames",
+ "Return the table of folder type names, contained in [\"names\"]\n",
+ &LLInventoryListener::getFolderTypeNames,
+ llsd::map("reply", LLSD()));
+
+ add("getAssetTypeNames",
+ "Return the table of asset type names, contained in [\"names\"]\n",
+ &LLInventoryListener::getAssetTypeNames,
+ llsd::map("reply", LLSD()));
+
+ add("getBasicFolderID",
+ "Return the UUID of the folder by specified folder type name, for example:\n"
+ "\"Textures\", \"My outfits\", \"Sounds\" and other basic folders which have associated type",
+ &LLInventoryListener::getBasicFolderID,
+ llsd::map("ft_name", LLSD(), "reply", LLSD()));
+
+ add("getDirectDescendants",
+ "Return result set keys [\"categories\"] and [\"items\"] for the direct\n"
+ "descendants of the [\"folder_id\"]",
+ &LLInventoryListener::getDirectDescendants,
+ llsd::map("folder_id", LLSD(), "reply", LLSD()));
+
+ add("collectDescendantsIf",
+ "Return result set keys [\"categories\"] and [\"items\"] for the descendants\n"
+ "of the [\"folder_id\"], if it passes specified filters:\n"
+ "[\"name\"] is a substring of object's name,\n"
+ "[\"desc\"] is a substring of object's description,\n"
+ "asset [\"type\"] corresponds to the string name of the object's asset type\n"
+ "[\"limit\"] sets item count limit in result set (default unlimited)\n"
+ "[\"filter_links\"]: EXCLUDE_LINKS - don't show links, ONLY_LINKS - only show links, INCLUDE_LINKS - show links too (default)",
+ &LLInventoryListener::collectDescendantsIf,
+ llsd::map("folder_id", LLSD(), "reply", LLSD()));
+
+/*==========================================================================*|
+ add("getSingle",
+ "Return LLSD [\"single\"] for a single folder or item from the specified\n"
+ "[\"result\"] key at the specified 0-relative [\"index\"].",
+ &LLInventoryListener::getSingle,
+ llsd::map("result", LLSD::Integer(), "index", LLSD::Integer(),
+ "reply", LLSD::String()));
+|*==========================================================================*/
+
+ add("getSlice",
+ stringize(
+ "Return an LLSD array [\"slice\"] from the specified [\"result\"] key\n"
+ "starting at 0-relative [\"index\"] with (up to) [\"count\"] entries.\n"
+ "count is limited to ", MAX_ITEM_LIMIT, " (default and max)."),
+ &LLInventoryListener::getSlice,
+ llsd::map("result", LLSD::Integer(), "index", LLSD::Integer(),
+ "reply", LLSD::String()));
+
+ add("closeResult",
+ "Release resources associated with specified [\"result\"] key,\n"
+ "or keys if [\"result\"] is an array.",
+ &LLInventoryListener::closeResult,
+ llsd::map("result", LLSD()));
+}
+
+// This struct captures (possibly large) category results from
+// getDirectDescendants() and collectDescendantsIf().
+struct CatResultSet: public LL::ResultSet
+{
+ CatResultSet(): LL::ResultSet("categories") {}
+ LLInventoryModel::cat_array_t mCategories;
+
+ int getLength() const override { return narrow(mCategories.size()); }
+ LLSD getSingle(int index) const override
+ {
+ auto cat = mCategories[index];
+ return llsd::map("name", cat->getName(),
+ "parent_id", cat->getParentUUID(),
+ "type", LLFolderType::lookup(cat->getPreferredType()));
+ }
+};
+
+// This struct captures (possibly large) item results from
+// getDirectDescendants() and collectDescendantsIf().
+struct ItemResultSet: public LL::ResultSet
+{
+ ItemResultSet(): LL::ResultSet("items") {}
+ LLInventoryModel::item_array_t mItems;
+
+ int getLength() const override { return narrow(mItems.size()); }
+ LLSD getSingle(int index) const override
+ {
+ auto item = mItems[index];
+ return llsd::map("name", item->getName(),
+ "parent_id", item->getParentUUID(),
+ "desc", item->getDescription(),
+ "inv_type", LLInventoryType::lookup(item->getInventoryType()),
+ "asset_type", LLAssetType::lookup(item->getType()),
+ "creation_date", LLSD::Integer(item->getCreationDate()),
+ "asset_id", item->getAssetUUID(),
+ "is_link", item->getIsLinkType(),
+ "linked_id", item->getLinkedUUID());
+ }
+};
+
+void LLInventoryListener::getItemsInfo(LLSD const &data)
+{
+ Response response(LLSD(), data);
+
+ auto catresult = new CatResultSet;
+ auto itemresult = new ItemResultSet;
+
+ uuid_vec_t ids = LLSDParam<uuid_vec_t>(data["item_ids"]);
+ for (auto &it : ids)
+ {
+ LLViewerInventoryItem* item = gInventory.getItem(it);
+ if (item)
+ {
+ itemresult->mItems.push_back(item);
+ }
+ else
+ {
+ LLViewerInventoryCategory *cat = gInventory.getCategory(it);
+ if (cat)
+ {
+ catresult->mCategories.push_back(cat);
+ }
+ }
+ }
+ // Each of categories and items is a { result set key, total length } pair.
+ response["categories"] = catresult->getKeyLength();
+ response["items"] = itemresult->getKeyLength();
+}
+
+void LLInventoryListener::getFolderTypeNames(LLSD const &data)
+{
+ Response response(llsd::map("names", LLFolderType::getTypeNames()), data);
+}
+
+void LLInventoryListener::getAssetTypeNames(LLSD const &data)
+{
+ Response response(llsd::map("names", LLAssetType::getTypeNames()), data);
+}
+
+void LLInventoryListener::getBasicFolderID(LLSD const &data)
+{
+ Response response(llsd::map("id", gInventory.findCategoryUUIDForType(LLFolderType::lookup(data["ft_name"].asString()))), data);
+}
+
+
+void LLInventoryListener::getDirectDescendants(LLSD const &data)
+{
+ Response response(LLSD(), data);
+ LLInventoryModel::cat_array_t* cats;
+ LLInventoryModel::item_array_t* items;
+ gInventory.getDirectDescendentsOf(data["folder_id"], cats, items);
+
+ auto catresult = new CatResultSet;
+ auto itemresult = new ItemResultSet;
+
+ catresult->mCategories = *cats;
+ itemresult->mItems = *items;
+
+ response["categories"] = catresult->getKeyLength();
+ response["items"] = itemresult->getKeyLength();
+}
+
+struct LLFilteredCollector : public LLInventoryCollectFunctor
+{
+ enum EFilterLink
+ {
+ INCLUDE_LINKS, // show links too
+ EXCLUDE_LINKS, // don't show links
+ ONLY_LINKS // only show links
+ };
+
+ LLFilteredCollector(LLSD const &data);
+ virtual ~LLFilteredCollector() {}
+ virtual bool operator()(LLInventoryCategory *cat, LLInventoryItem *item) override;
+ virtual bool exceedsLimit() override
+ {
+ // mItemLimit == 0 means unlimited
+ return (mItemLimit && mItemLimit <= mItemCount);
+ }
+
+ protected:
+ bool checkagainstType(LLInventoryCategory *cat, LLInventoryItem *item);
+ bool checkagainstNameDesc(LLInventoryCategory *cat, LLInventoryItem *item);
+ bool checkagainstLinks(LLInventoryCategory *cat, LLInventoryItem *item);
+
+ LLAssetType::EType mType;
+ std::string mName;
+ std::string mDesc;
+ EFilterLink mLinkFilter;
+
+ S32 mItemLimit;
+ S32 mItemCount;
+};
+
+void LLInventoryListener::collectDescendantsIf(LLSD const &data)
+{
+ Response response(LLSD(), data);
+ LLUUID folder_id(data["folder_id"].asUUID());
+ LLViewerInventoryCategory *cat = gInventory.getCategory(folder_id);
+ if (!cat)
+ {
+ return response.error(stringize("Folder ", std::quoted(data["folder_id"].asString()), " was not found"));
+ }
+ auto catresult = new CatResultSet;
+ auto itemresult = new ItemResultSet;
+
+ LLFilteredCollector collector = LLFilteredCollector(data);
+
+ // Populate results directly into the catresult and itemresult arrays.
+ // TODO: sprinkle count-based coroutine yields into the real
+ // collectDescendentsIf() method so it doesn't steal too many cycles.
+ gInventory.collectDescendentsIf(
+ folder_id,
+ catresult->mCategories,
+ itemresult->mItems,
+ LLInventoryModel::EXCLUDE_TRASH,
+ collector);
+
+ response["categories"] = catresult->getKeyLength();
+ response["items"] = itemresult->getKeyLength();
+}
+
+/*==========================================================================*|
+void LLInventoryListener::getSingle(LLSD const& data)
+{
+ auto result = LL::ResultSet::getInstance(data["result"]);
+ sendReply(llsd::map("single", result->getSingle(data["index"])), data);
+}
+|*==========================================================================*/
+
+void LLInventoryListener::getSlice(LLSD const& data)
+{
+ auto result = LL::ResultSet::getInstance(data["result"]);
+ int count = data.has("count")? data["count"].asInteger() : MAX_ITEM_LIMIT;
+ LL_DEBUGS("Lua") << *result << ".getSlice(" << data["index"].asInteger()
+ << ", " << count << ')' << LL_ENDL;
+ auto pair{ result->getSliceStart(data["index"], std::min(count, MAX_ITEM_LIMIT)) };
+ sendReply(llsd::map("slice", pair.first, "start", pair.second), data);
+}
+
+void LLInventoryListener::closeResult(LLSD const& data)
+{
+ LLSD results = data["result"];
+ if (results.isInteger())
+ {
+ results = llsd::array(results);
+ }
+ for (const auto& result : llsd::inArray(results))
+ {
+ auto ptr = LL::ResultSet::getInstance(result);
+ if (ptr)
+ {
+ delete ptr.get();
+ }
+ }
+}
+
+LLFilteredCollector::LLFilteredCollector(LLSD const &data) :
+ mType(LLAssetType::EType::AT_UNKNOWN),
+ mLinkFilter(INCLUDE_LINKS),
+ mItemLimit(0),
+ mItemCount(0)
+{
+
+ mName = data["name"].asString();
+ mDesc = data["desc"].asString();
+
+ if (data.has("type"))
+ {
+ mType = LLAssetType::lookup(data["type"]);
+ }
+ if (data.has("filter_links"))
+ {
+ if (data["filter_links"] == "EXCLUDE_LINKS")
+ {
+ mLinkFilter = EXCLUDE_LINKS;
+ }
+ else if (data["filter_links"] == "ONLY_LINKS")
+ {
+ mLinkFilter = ONLY_LINKS;
+ }
+ }
+ if (data["limit"].isInteger())
+ {
+ mItemLimit = std::max(data["limit"].asInteger(), 1);
+ }
+}
+
+bool LLFilteredCollector::operator()(LLInventoryCategory *cat, LLInventoryItem *item)
+{
+ bool passed = checkagainstType(cat, item);
+ passed = passed && checkagainstNameDesc(cat, item);
+ passed = passed && checkagainstLinks(cat, item);
+
+ if (passed)
+ {
+ ++mItemCount;
+ }
+ return passed;
+}
+
+bool LLFilteredCollector::checkagainstNameDesc(LLInventoryCategory *cat, LLInventoryItem *item)
+{
+ std::string name, desc;
+ bool passed(true);
+ if (cat)
+ {
+ if (!mDesc.empty()) return false;
+ name = cat->getName();
+ }
+ if (item)
+ {
+ name = item->getName();
+ passed = (mDesc.empty() || (item->getDescription().find(mDesc) != std::string::npos));
+ }
+
+ return passed && (mName.empty() || name.find(mName) != std::string::npos);
+}
+
+bool LLFilteredCollector::checkagainstType(LLInventoryCategory *cat, LLInventoryItem *item)
+{
+ if (mType == LLAssetType::AT_UNKNOWN)
+ {
+ return true;
+ }
+ if (cat && (mType == LLAssetType::AT_CATEGORY))
+ {
+ return true;
+ }
+ if (item && item->getType() == mType)
+ {
+ return true;
+ }
+ return false;
+}
+
+bool LLFilteredCollector::checkagainstLinks(LLInventoryCategory *cat, LLInventoryItem *item)
+{
+ bool is_link = cat ? cat->getIsLinkType() : item->getIsLinkType();
+ if (is_link && (mLinkFilter == EXCLUDE_LINKS))
+ return false;
+ if (!is_link && (mLinkFilter == ONLY_LINKS))
+ return false;
+ return true;
+}
diff --git a/indra/newview/llinventorylistener.h b/indra/newview/llinventorylistener.h
new file mode 100644
index 0000000000..a05385f2c8
--- /dev/null
+++ b/indra/newview/llinventorylistener.h
@@ -0,0 +1,53 @@
+/**
+ * @file llinventorylistener.h
+ *
+ * $LicenseInfo:firstyear=2024&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2024, 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_LLINVENTORYLISTENER_H
+#define LL_LLINVENTORYLISTENER_H
+
+#include "lleventapi.h"
+#include "llinventoryfunctions.h"
+
+class LLInventoryListener : public LLEventAPI
+{
+public:
+ LLInventoryListener();
+
+private:
+ void getItemsInfo(LLSD const &data);
+ void getFolderTypeNames(LLSD const &data);
+ void getAssetTypeNames(LLSD const &data);
+ void getBasicFolderID(LLSD const &data);
+ void getDirectDescendants(LLSD const &data);
+ void collectDescendantsIf(LLSD const &data);
+/*==========================================================================*|
+ void getSingle(LLSD const& data);
+|*==========================================================================*/
+ void getSlice(LLSD const& data);
+ void closeResult(LLSD const& data);
+};
+
+#endif // LL_LLINVENTORYLISTENER_H
+
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index d57cb13362..2449a226c3 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -1282,6 +1282,10 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id,
{
for (auto& cat : *cat_array)
{
+ if (add.exceedsLimit())
+ {
+ break;
+ }
if(add(cat,NULL))
{
cats.push_back(cat);
@@ -1297,6 +1301,10 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id,
{
for (auto& item : *item_array)
{
+ if (add.exceedsLimit())
+ {
+ break;
+ }
if(add(NULL, item))
{
items.push_back(item);
@@ -2037,8 +2045,8 @@ void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links, boo
{
LL_WARNS(LOG_INV) << "Deleting cat " << id << " while it still has child cats" << LL_ENDL;
}
- delete cat_list;
mParentChildCategoryTree.erase(id);
+ delete cat_list;
}
addChangedMask(LLInventoryObserver::REMOVE, id);
@@ -4824,6 +4832,17 @@ std::string LLInventoryModel::getFullPath(const LLInventoryObject *obj) const
return result;
}
+/*
+const LLInventoryObject* LLInventoryModel::findByFullPath(const std::string& path)
+{
+ vector<std::string> path_elts;
+ boost::algorithm::split(path_elts, path, boost::is_any_of("/"));
+ for(path_elts, auto e)
+ {
+ }
+}
+*/
+
///----------------------------------------------------------------------------
/// Local function definitions
///----------------------------------------------------------------------------
@@ -5035,4 +5054,3 @@ void LLInventoryModel::FetchItemHttpHandler::processFailure(const char * const r
<< LLCoreHttpUtil::responseToString(response) << "]" << LL_ENDL;
gInventory.notifyObservers();
}
-
diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp
index d8e6bf380e..2cf1554957 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.cpp
+++ b/indra/newview/llinventorymodelbackgroundfetch.cpp
@@ -30,6 +30,7 @@
#include "llaisapi.h"
#include "llagent.h"
#include "llappviewer.h"
+#include "llappearancemgr.h"
#include "llcallbacklist.h"
#include "llinventorymodel.h"
#include "llinventorypanel.h"
@@ -470,6 +471,22 @@ void LLInventoryModelBackgroundFetch::fetchCOF(nullary_func_t callback)
callback();
LLUUID cat_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);
LLInventoryModelBackgroundFetch::getInstance()->onAISFolderCalback(cat_id, id, FT_DEFAULT);
+
+ if (id.notNull())
+ {
+ // COF might have fetched base outfit folder through a link, but it hasn't
+ // fetched base outfit's content, which doesn't nessesary match COF,
+ // so make sure it's up to date
+ LLUUID baseoutfit_id = LLAppearanceMgr::getInstance()->getBaseOutfitUUID();
+ if (baseoutfit_id.notNull())
+ {
+ LLViewerInventoryCategory* cat = gInventory.getCategory(baseoutfit_id);
+ if (!cat || cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN)
+ {
+ LLInventoryModelBackgroundFetch::getInstance()->fetchFolderAndLinks(baseoutfit_id, no_op);
+ }
+ }
+ }
});
// start idle loop to track completion
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index e4d1010231..b8833dcd05 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -177,15 +177,15 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
}
// context menu callbacks
- mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLInventoryPanel::doToSelected, this, _2));
- mCommitCallbackRegistrar.add("Inventory.EmptyTrash", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyTrash", LLFolderType::FT_TRASH));
- mCommitCallbackRegistrar.add("Inventory.EmptyLostAndFound", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyLostAndFound", LLFolderType::FT_LOST_AND_FOUND));
- mCommitCallbackRegistrar.add("Inventory.DoCreate", boost::bind(&LLInventoryPanel::doCreate, this, _2));
- mCommitCallbackRegistrar.add("Inventory.AttachObject", boost::bind(&LLInventoryPanel::attachObject, this, _2));
- mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&LLInventoryPanel::beginIMSession, this));
- mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, this));
- mCommitCallbackRegistrar.add("Inventory.FileUploadLocation", boost::bind(&LLInventoryPanel::fileUploadLocation, this, _2));
- mCommitCallbackRegistrar.add("Inventory.OpenNewFolderWindow", boost::bind(&LLInventoryPanel::openSingleViewInventory, this, LLUUID()));
+ mCommitCallbackRegistrar.add("Inventory.DoToSelected", { boost::bind(&LLInventoryPanel::doToSelected, this, _2), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.EmptyTrash", { boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyTrash", LLFolderType::FT_TRASH), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.EmptyLostAndFound", { boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyLostAndFound", LLFolderType::FT_LOST_AND_FOUND), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.DoCreate", { boost::bind(&LLInventoryPanel::doCreate, this, _2), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.AttachObject", { boost::bind(&LLInventoryPanel::attachObject, this, _2), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.BeginIMSession", { boost::bind(&LLInventoryPanel::beginIMSession, this), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.Share", { boost::bind(&LLAvatarActions::shareWithAvatars, this), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.FileUploadLocation", { boost::bind(&LLInventoryPanel::fileUploadLocation, this, _2), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.OpenNewFolderWindow", { boost::bind(&LLInventoryPanel::openSingleViewInventory, this, LLUUID()), LLUICtrl::cb_info::UNTRUSTED_THROTTLE });
}
LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id )
@@ -580,8 +580,8 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
if (model_item && view_item && viewmodel_item)
{
const LLUUID& idp = viewmodel_item->getUUID();
- view_item->destroyView();
removeItemID(idp);
+ view_item->destroyView();
}
LLInventoryObject const* objectp = mInventory->getObject(item_id);
@@ -2214,9 +2214,9 @@ LLInventorySingleFolderPanel::LLInventorySingleFolderPanel(const Params& params)
getFilter().setEmptyLookupMessage("InventorySingleFolderNoMatches");
getFilter().setDefaultEmptyLookupMessage("InventorySingleFolderEmpty");
- mCommitCallbackRegistrar.replace("Inventory.DoToSelected", boost::bind(&LLInventorySingleFolderPanel::doToSelected, this, _2));
- mCommitCallbackRegistrar.replace("Inventory.DoCreate", boost::bind(&LLInventorySingleFolderPanel::doCreate, this, _2));
- mCommitCallbackRegistrar.replace("Inventory.Share", boost::bind(&LLInventorySingleFolderPanel::doShare, this));
+ mCommitCallbackRegistrar.replace("Inventory.DoToSelected", { boost::bind(&LLInventorySingleFolderPanel::doToSelected, this, _2), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.replace("Inventory.DoCreate", { boost::bind(&LLInventorySingleFolderPanel::doCreate, this, _2), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.replace("Inventory.Share", { boost::bind(&LLInventorySingleFolderPanel::doShare, this), cb_info::UNTRUSTED_BLOCK });
}
LLInventorySingleFolderPanel::~LLInventorySingleFolderPanel()
diff --git a/indra/newview/lljoystickbutton.cpp b/indra/newview/lljoystickbutton.cpp
index 4eaf69c39d..10a1cd6b71 100644
--- a/indra/newview/lljoystickbutton.cpp
+++ b/indra/newview/lljoystickbutton.cpp
@@ -637,18 +637,24 @@ void LLJoystickCameraRotate::drawRotatedImage( LLPointer<LLUIImage> image, S32 r
gGL.color4fv(UI_VERTEX_COLOR.mV);
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLES);
{
- gGL.texCoord2fv( uv[ (rotations + 0) % 4]);
- gGL.vertex2i(width, height );
+ gGL.texCoord2fv(uv[(rotations + 0) % 4]);
+ gGL.vertex2i(width, height);
+
+ gGL.texCoord2fv(uv[(rotations + 1) % 4]);
+ gGL.vertex2i(0, height);
- gGL.texCoord2fv( uv[ (rotations + 1) % 4]);
- gGL.vertex2i(0, height );
+ gGL.texCoord2fv(uv[(rotations + 2) % 4]);
+ gGL.vertex2i(0, 0);
+
+ gGL.texCoord2fv(uv[(rotations + 0) % 4]);
+ gGL.vertex2i(width, height);
- gGL.texCoord2fv( uv[ (rotations + 2) % 4]);
+ gGL.texCoord2fv(uv[(rotations + 2) % 4]);
gGL.vertex2i(0, 0);
- gGL.texCoord2fv( uv[ (rotations + 3) % 4]);
+ gGL.texCoord2fv(uv[(rotations + 3) % 4]);
gGL.vertex2i(width, 0);
}
gGL.end();
@@ -909,7 +915,7 @@ void LLJoystickQuaternion::drawRotatedImage(LLPointer<LLUIImage> image, S32 rota
gGL.color4fv(UI_VERTEX_COLOR.mV);
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLES);
{
gGL.texCoord2fv(uv[(rotations + 0) % 4]);
gGL.vertex2i(width, height);
@@ -920,6 +926,12 @@ void LLJoystickQuaternion::drawRotatedImage(LLPointer<LLUIImage> image, S32 rota
gGL.texCoord2fv(uv[(rotations + 2) % 4]);
gGL.vertex2i(0, 0);
+ gGL.texCoord2fv(uv[(rotations + 0) % 4]);
+ gGL.vertex2i(width, height);
+
+ gGL.texCoord2fv(uv[(rotations + 1) % 4]);
+ gGL.vertex2i(0, height);
+
gGL.texCoord2fv(uv[(rotations + 3) % 4]);
gGL.vertex2i(width, 0);
}
diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp
index 31c9eb8966..81b2d23cf7 100644
--- a/indra/newview/lllocalbitmaps.cpp
+++ b/indra/newview/lllocalbitmaps.cpp
@@ -996,17 +996,12 @@ LLLocalBitmapTimer::~LLLocalBitmapTimer()
void LLLocalBitmapTimer::startTimer()
{
- mEventTimer.start();
+ start();
}
void LLLocalBitmapTimer::stopTimer()
{
- mEventTimer.stop();
-}
-
-bool LLLocalBitmapTimer::isRunning()
-{
- return mEventTimer.getStarted();
+ stop();
}
bool LLLocalBitmapTimer::tick()
diff --git a/indra/newview/lllocalbitmaps.h b/indra/newview/lllocalbitmaps.h
index e169f96e70..4bad9ff9a5 100644
--- a/indra/newview/lllocalbitmaps.h
+++ b/indra/newview/lllocalbitmaps.h
@@ -120,8 +120,7 @@ class LLLocalBitmapTimer : public LLEventTimer
public:
void startTimer();
void stopTimer();
- bool isRunning();
- bool tick();
+ bool tick() override;
};
diff --git a/indra/newview/lllocalgltfmaterials.cpp b/indra/newview/lllocalgltfmaterials.cpp
index fab18f2d26..3af1433a40 100644
--- a/indra/newview/lllocalgltfmaterials.cpp
+++ b/indra/newview/lllocalgltfmaterials.cpp
@@ -294,17 +294,12 @@ LLLocalGLTFMaterialTimer::~LLLocalGLTFMaterialTimer()
void LLLocalGLTFMaterialTimer::startTimer()
{
- mEventTimer.start();
+ start();
}
void LLLocalGLTFMaterialTimer::stopTimer()
{
- mEventTimer.stop();
-}
-
-bool LLLocalGLTFMaterialTimer::isRunning()
-{
- return mEventTimer.getStarted();
+ stop();
}
bool LLLocalGLTFMaterialTimer::tick()
diff --git a/indra/newview/lllocalgltfmaterials.h b/indra/newview/lllocalgltfmaterials.h
index b806b54508..9c2d1bb287 100644
--- a/indra/newview/lllocalgltfmaterials.h
+++ b/indra/newview/lllocalgltfmaterials.h
@@ -89,8 +89,7 @@ public:
public:
void startTimer();
void stopTimer();
- bool isRunning();
- bool tick();
+ bool tick() override;
};
class LLLocalGLTFMaterialMgr : public LLSingleton<LLLocalGLTFMaterialMgr>
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp
index 54dd5792a0..2c91fe06e9 100644
--- a/indra/newview/lllocationinputctrl.cpp
+++ b/indra/newview/lllocationinputctrl.cpp
@@ -377,7 +377,7 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
addChild(mParcelIcon[SEE_AVATARS_ICON]);
// Register callbacks and load the location field context menu (NB: the order matters).
- LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Navbar.Action", boost::bind(&LLLocationInputCtrl::onLocationContextMenuItemClicked, this, _2));
+ LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Navbar.Action", { boost::bind(&LLLocationInputCtrl::onLocationContextMenuItemClicked, this, _2) });
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Navbar.EnableMenuItem", boost::bind(&LLLocationInputCtrl::onLocationContextMenuItemEnabled, this, _2));
setPrearrangeCallback(boost::bind(&LLLocationInputCtrl::onLocationPrearrange, this, _2));
diff --git a/indra/newview/llluamanager.cpp b/indra/newview/llluamanager.cpp
new file mode 100644
index 0000000000..7fe5c1ece0
--- /dev/null
+++ b/indra/newview/llluamanager.cpp
@@ -0,0 +1,483 @@
+/**
+ * @file llluamanager.cpp
+ * @brief classes and functions for interfacing with LUA.
+ *
+ * $LicenseInfo:firstyear=2023&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2023, 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 "llluamanager.h"
+
+#include "fsyspath.h"
+#include "llcoros.h"
+#include "llerror.h"
+#include "lleventcoro.h"
+#include "llsdutil.h"
+#include "llviewercontrol.h"
+#include "lua_function.h"
+#include "lualistener.h"
+#include "stringize.h"
+
+#include <boost/algorithm/string/replace.hpp>
+
+#include "luau/luacode.h"
+#include "luau/lua.h"
+#include "luau/luaconf.h"
+#include "luau/lualib.h"
+
+#include <sstream>
+#include <string_view>
+#include <vector>
+
+S32 LLLUAmanager::sAutorunScriptCount = 0;
+S32 LLLUAmanager::sScriptCount = 0;
+std::map<std::string, std::string> LLLUAmanager::sScriptNames;
+
+lua_function(sleep, "sleep(seconds): pause the running coroutine")
+{
+ lua_checkdelta(L, -1);
+ lua_Number seconds = lua_tonumber(L, -1);
+ lua_pop(L, 1);
+ llcoro::suspendUntilTimeout(narrow(seconds));
+ LuaState::getParent(L).set_interrupts_counter(0);
+ return 0;
+};
+
+// This function consumes ALL Lua stack arguments and returns concatenated
+// message string
+std::string lua_print_msg(lua_State* L, std::string_view level)
+{
+ // On top of existing Lua arguments, we're going to push tostring() and
+ // duplicate each existing stack entry so we can stringize each one.
+ lluau_checkstack(L, 2);
+ luaL_where(L, 1);
+ // start with the 'where' info at the top of the stack
+ std::ostringstream out;
+ out << lua_tostring(L, -1);
+ lua_pop(L, 1);
+ const char* sep = ""; // 'where' info ends with ": "
+ // now iterate over arbitrary args, calling Lua tostring() on each and
+ // concatenating with separators
+ for (int p = 1, top = lua_gettop(L); p <= top; ++p)
+ {
+ out << sep;
+ sep = " ";
+ // push Lua tostring() function -- note, semantically different from
+ // lua_tostring()!
+ lua_getglobal(L, "tostring");
+ // Now the stack is arguments 1 .. N, plus tostring().
+ // Push a copy of the argument at index p.
+ lua_pushvalue(L, p);
+ // pop tostring() and arg-p, pushing tostring(arg-p)
+ // (ignore potential error code from lua_pcall() because, if there was
+ // an error, we expect the stack top to be an error message -- which
+ // we'll print)
+ lua_pcall(L, 1, 1, 0);
+ out << lua_tostring(L, -1);
+ lua_pop(L, 1);
+ }
+ // pop everything
+ lua_settop(L, 0);
+ // capture message string
+ std::string msg{ out.str() };
+ // put message out there for any interested party (*koff* LLFloaterLUADebug *koff*)
+ LLEventPumps::instance().obtain("lua output").post(stringize(level, ": ", msg));
+
+ llcoro::suspend();
+ return msg;
+}
+
+lua_function(print_debug, "print_debug(args...): DEBUG level logging")
+{
+ LL_DEBUGS("Lua") << lua_print_msg(L, "DEBUG") << LL_ENDL;
+ return 0;
+}
+
+// also used for print(); see LuaState constructor
+lua_function(print_info, "print_info(args...): INFO level logging")
+{
+ LL_INFOS("Lua") << lua_print_msg(L, "INFO") << LL_ENDL;
+ return 0;
+}
+
+lua_function(print_warning, "print_warning(args...): WARNING level logging")
+{
+ LL_WARNS("Lua") << lua_print_msg(L, "WARN") << LL_ENDL;
+ return 0;
+}
+
+lua_function(post_on, "post_on(pumpname, data): post specified data to specified LLEventPump")
+{
+ lua_checkdelta(L, -2);
+ std::string pumpname{ lua_tostdstring(L, 1) };
+ LLSD data{ lua_tollsd(L, 2) };
+ lua_pop(L, 2);
+ LL_DEBUGS("Lua") << "post_on('" << pumpname << "', " << data << ")" << LL_ENDL;
+ LLEventPumps::instance().obtain(pumpname).post(data);
+ return 0;
+}
+
+lua_function(get_event_pumps,
+ "get_event_pumps():\n"
+ "Returns replypump, commandpump: names of LLEventPumps specific to this chunk.\n"
+ "Events posted to replypump are queued for get_event_next().\n"
+ "post_on(commandpump, ...) to engage LLEventAPI operations (see helpleap()).")
+{
+ lua_checkdelta(L, 2);
+ lluau_checkstack(L, 2);
+ auto& listener{ LuaState::obtainListener(L) };
+ // return the reply pump name and the command pump name on caller's lua_State
+ lua_pushstdstring(L, listener.getReplyName());
+ lua_pushstdstring(L, listener.getCommandName());
+ return 2;
+}
+
+lua_function(get_event_next,
+ "get_event_next():\n"
+ "Returns the next (pumpname, data) pair from the replypump whose name\n"
+ "is returned by get_event_pumps(). Blocks the calling chunk until an\n"
+ "event becomes available.")
+{
+ lua_checkdelta(L, 2);
+ lluau_checkstack(L, 2);
+ auto& listener{ LuaState::obtainListener(L) };
+ const auto& [pump, data]{ listener.getNext() };
+ lua_pushstdstring(L, pump);
+ lua_pushllsd(L, data);
+ LuaState::getParent(L).set_interrupts_counter(0);
+ return 2;
+}
+
+LLCoros::Future<LLLUAmanager::script_result>
+LLLUAmanager::startScriptFile(const std::string& filename)
+{
+ // Despite returning from startScriptFile(), we need this Promise to
+ // remain alive until the callback has fired.
+ auto promise{ std::make_shared<LLCoros::Promise<script_result>>() };
+ runScriptFile(filename, false,
+ [promise](int count, LLSD result)
+ { promise->set_value({ count, result }); });
+ return LLCoros::getFuture(*promise);
+}
+
+LLLUAmanager::script_result LLLUAmanager::waitScriptFile(const std::string& filename)
+{
+ return startScriptFile(filename).get();
+}
+
+void LLLUAmanager::runScriptFile(const std::string &filename, bool autorun,
+ script_result_fn result_cb)
+{
+ // A script_result_fn will be called when LuaState::expr() completes.
+ LLCoros::instance().launch(filename, [filename, autorun, result_cb]()
+ {
+ ScriptObserver observer(LLCoros::getName(), filename);
+ LLSD paths(gSavedSettings.getLLSD("LuaCommandPath"));
+ LL_DEBUGS("Lua") << "LuaCommandPath = " << paths << LL_ENDL;
+ // allow LuaCommandPath to be specified relative to install dir
+ ScriptCommand command(filename, paths, gDirUtilp->getAppRODataDir());
+ auto error = command.error();
+ if (! error.empty())
+ {
+ if (result_cb)
+ {
+ result_cb(-1, error);
+ }
+ return;
+ }
+
+ llifstream in_file;
+ in_file.open(command.script);
+ // At this point, since ScriptCommand did not report an error, we
+ // should be able to assume that 'script' exists. If we can't open it,
+ // something else is wrong?!
+ llassert(in_file.is_open());
+ if (autorun)
+ {
+ sAutorunScriptCount++;
+ }
+ sScriptCount++;
+
+ LuaState L;
+ std::string text{std::istreambuf_iterator<char>(in_file), {}};
+ auto [count, result] = L.expr(command.script, text, command.args);
+ if (result_cb)
+ {
+ result_cb(count, result);
+ }
+ });
+}
+
+LLCoros::Future<LLLUAmanager::script_result>
+LLLUAmanager::startScriptLine(const std::string& chunk)
+{
+ // Despite returning from startScriptLine(), we need this Promise to
+ // remain alive until the callback has fired.
+ auto promise{ std::make_shared<LLCoros::Promise<script_result>>() };
+ runScriptLine(chunk,
+ [promise](int count, LLSD result)
+ { promise->set_value({ count, result }); });
+ return LLCoros::getFuture(*promise);
+}
+
+LLLUAmanager::script_result LLLUAmanager::waitScriptLine(const std::string& chunk)
+{
+ return startScriptLine(chunk).get();
+}
+
+void LLLUAmanager::runScriptLine(const std::string& chunk, script_result_fn result_cb)
+{
+ // find a suitable abbreviation for the chunk string
+ std::string shortchunk{ chunk };
+ const size_t shortlen = 40;
+ std::string::size_type eol = shortchunk.find_first_of("\r\n");
+ if (eol != std::string::npos)
+ shortchunk = shortchunk.substr(0, eol);
+ if (shortchunk.length() > shortlen)
+ shortchunk = stringize(shortchunk.substr(0, shortlen), "...");
+
+ std::string desc{ "lua: " + shortchunk };
+ LLCoros::instance().launch(desc, [desc, chunk, result_cb]()
+ {
+ LuaState L;
+ auto [count, result] = L.expr(desc, chunk);
+ if (result_cb)
+ {
+ result_cb(count, result);
+ }
+ });
+}
+
+std::string read_file(const std::string &name)
+{
+ llifstream in_file;
+ in_file.open(name.c_str());
+
+ if (in_file.is_open())
+ {
+ return std::string{std::istreambuf_iterator<char>(in_file), {}};
+ }
+
+ return {};
+}
+
+lua_function(require, "require(module_name) : load module_name.lua from known places")
+{
+ lua_checkdelta(L);
+ std::string name = lua_tostdstring(L, 1);
+ lua_pop(L, 1);
+
+ // resolveRequire() does not return in case of error.
+ LLRequireResolver::resolveRequire(L, name);
+
+ // resolveRequire() returned the newly-loaded module on the stack top.
+ // Return it.
+ return 1;
+}
+
+// push loaded module or throw Lua error
+void LLRequireResolver::resolveRequire(lua_State *L, std::string path)
+{
+ LLRequireResolver resolver(L, std::move(path));
+ // findModule() pushes the loaded module or throws a Lua error.
+ resolver.findModule();
+}
+
+LLRequireResolver::LLRequireResolver(lua_State *L, const std::string& path) :
+ mPathToResolve(fsyspath(path).lexically_normal()),
+ L(L)
+{
+ mSourceDir = lluau::source_path(L).parent_path();
+
+ if (mPathToResolve.is_absolute())
+ luaL_argerrorL(L, 1, "cannot require a full path");
+}
+
+// push the loaded module or throw a Lua error
+void LLRequireResolver::findModule()
+{
+ // If mPathToResolve is absolute, this replaces mSourceDir.
+ auto absolutePath = (mSourceDir / mPathToResolve).u8string();
+
+ // Push _MODULES table on stack for checking and saving to the cache
+ luaL_findtable(L, LUA_REGISTRYINDEX, "_MODULES", 1);
+ // Remove that stack entry no matter how we exit
+ LuaRemover rm_MODULES(L, -1);
+
+ // Check if the module is already in _MODULES table, read from file
+ // otherwise.
+ // findModuleImpl() pushes module if found, nothing if not, may throw Lua
+ // error.
+ if (findModuleImpl(absolutePath))
+ return;
+
+ // not already cached - prep error message just in case
+ auto fail{
+ [L=L, path=mPathToResolve.u8string()]()
+ { luaL_error(L, "could not find require('%s')", path.data()); }};
+
+ if (mPathToResolve.is_absolute())
+ {
+ // no point searching known directories for an absolute path
+ fail();
+ }
+
+ LLSD lib_paths(gSavedSettings.getLLSD("LuaRequirePath"));
+ LL_DEBUGS("Lua") << "LuaRequirePath = " << lib_paths << LL_ENDL;
+ for (const auto& path : llsd::inArray(lib_paths))
+ {
+ // if path is already absolute, operator/() preserves it
+ auto abspath(fsyspath(gDirUtilp->getAppRODataDir()) / path.asString());
+ std::string absolutePathOpt = (abspath / mPathToResolve).u8string();
+
+ if (absolutePathOpt.empty())
+ luaL_error(L, "error requiring module '%s'", mPathToResolve.u8string().data());
+
+ if (findModuleImpl(absolutePathOpt))
+ return;
+ }
+
+ // not found
+ fail();
+}
+
+// expects _MODULES table on stack top (and leaves it there)
+// - if found, pushes loaded module and returns true
+// - not found, pushes nothing and returns false
+// - may throw Lua error
+bool LLRequireResolver::findModuleImpl(const std::string& absolutePath)
+{
+ std::string possibleSuffixedPaths[] = {absolutePath + ".luau", absolutePath + ".lua"};
+
+ for (const auto& suffixedPath : possibleSuffixedPaths)
+ {
+ // Check _MODULES cache for module
+ lua_getfield(L, -1, suffixedPath.data());
+ if (!lua_isnil(L, -1))
+ {
+ return true;
+ }
+ lua_pop(L, 1);
+
+ // Try to read the matching file
+ std::string source = read_file(suffixedPath);
+ if (!source.empty())
+ {
+ // Try to run the loaded source. This will leave either a string
+ // error message or the module contents on the stack top.
+ runModule(suffixedPath, source);
+
+ // If the stack top is an error message string, raise it.
+ if (lua_isstring(L, -1))
+ lua_error(L);
+
+ // duplicate the new module: _MODULES newmodule newmodule
+ lua_pushvalue(L, -1);
+ // store _MODULES[found path] = newmodule
+ lua_setfield(L, -3, suffixedPath.data());
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// push string error message or new module
+void LLRequireResolver::runModule(const std::string& desc, const std::string& code)
+{
+ // Here we just loaded a new module 'code', need to run it and get its result.
+ lua_State *ML = lua_mainthread(L);
+
+ {
+ // If loadstring() returns (! LUA_OK) then there's an error message on
+ // the stack. If it returns LUA_OK then the newly-loaded module code
+ // is on the stack.
+ LL_DEBUGS("Lua") << "Loading module " << desc << LL_ENDL;
+ if (lluau::loadstring(ML, desc, code) != LUA_OK)
+ {
+ // error message on stack top
+ LL_DEBUGS("Lua") << "Error loading module " << desc << ": "
+ << lua_tostring(ML, -1) << LL_ENDL;
+ lua_pushliteral(ML, "loadstring: ");
+ // stack contains error, "loadstring: "
+ // swap: insert stack top at position -2
+ lua_insert(ML, -2);
+ // stack contains "loadstring: ", error
+ lua_concat(ML, 2);
+ // stack contains "loadstring: " + error
+ }
+ else // module code on stack top
+ {
+ // push debug module
+ lua_getglobal(ML, "debug");
+ // push debug.traceback
+ lua_getfield(ML, -1, "traceback");
+ // stack contains module code, debug, debug.traceback
+ // ditch debug
+ lua_replace(ML, -2);
+ // stack contains module code, debug.traceback
+ // swap: insert stack top at position -2
+ lua_insert(ML, -2);
+ // stack contains debug.traceback, module code
+ LL_DEBUGS("Lua") << "Loaded module " << desc << ", running" << LL_ENDL;
+ // no arguments, one return value
+ // pass debug.traceback as the error function
+ int status = lua_pcall(ML, 0, 1, -2);
+ // lua_pcall() has popped the module code and replaced it with its
+ // return value. Regardless of status or the type of the stack
+ // top, get rid of debug.traceback on the stack.
+ lua_remove(ML, -2);
+
+ if (status == LUA_OK)
+ {
+ auto top{ lua_gettop(ML) };
+ std::string type{ (top == 0)? "nothing"
+ : lua_typename(ML, lua_type(ML, -1)) };
+ LL_DEBUGS("Lua") << "Module " << desc << " returned " << type << LL_ENDL;
+ if ((top == 0) || ! (lua_istable(ML, -1) || lua_isfunction(ML, -1)))
+ {
+ lua_pushfstring(ML, "module %s must return a table or function, not %s",
+ desc.data(), type.data());
+ }
+ }
+ else if (status == LUA_YIELD)
+ {
+ LL_DEBUGS("Lua") << "Module " << desc << " yielded" << LL_ENDL;
+ lua_pushfstring(ML, "module %s can not yield", desc.data());
+ }
+ else
+ {
+ llassert(lua_isstring(ML, -1));
+ LL_DEBUGS("Lua") << "Module " << desc << " error: "
+ << lua_tostring(ML, -1) << LL_ENDL;
+ }
+ }
+ }
+ // There's now a return value (string error message or module) on top of ML.
+ // Move return value to L's stack.
+ if (ML != L)
+ {
+ lua_xmove(ML, L, 1);
+ }
+}
diff --git a/indra/newview/llluamanager.h b/indra/newview/llluamanager.h
new file mode 100644
index 0000000000..b98b5d4ef6
--- /dev/null
+++ b/indra/newview/llluamanager.h
@@ -0,0 +1,133 @@
+/**
+ * @file llluamanager.h
+ * @brief classes and functions for interfacing with LUA.
+ *
+ * $LicenseInfo:firstyear=2023&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2023, 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_LLLUAMANAGER_H
+#define LL_LLLUAMANAGER_H
+
+#include "fsyspath.h"
+#include "llcoros.h"
+#include "llsd.h"
+#include <functional>
+#include <string>
+#include <utility> // std::pair
+
+#include "luau/lua.h"
+#include "luau/lualib.h"
+
+class LuaState;
+
+class LLLUAmanager
+{
+ friend class ScriptObserver;
+
+public:
+ // Pass a callback with this signature to obtain the result, if any, of
+ // running a script or source string.
+ // count < 0 means error, and result.asString() is the error message.
+ // count == 0 with result.isUndefined() means the script returned no results.
+ // count == 1 means the script returned one result.
+ // count > 1 with result.isArray() means the script returned multiple
+ // results, represented as the entries of the result array.
+ typedef std::function<void(int count, const LLSD& result)> script_result_fn;
+ // same semantics as script_result_fn parameters
+ typedef std::pair<int, LLSD> script_result;
+
+ // Run the script specified by the command line passed as @a filename.
+ // This can be followed by some number of command-line arguments, which
+ // a Lua script can view using either '...' or predefined global 'arg'.
+ // The script pathname or its arguments can be quoted using 'single
+ // quotes' or "double quotes", or special characters can be \escaped.
+ // runScriptFile() recognizes the case in which the whole 'filename'
+ // string is a path containing spaces; if so no arguments are permitted.
+ // In either form, if the script pathname isn't absolute, it is sought on
+ // LuaCommandPath.
+ // If autorun is true, statistics will count this as an autorun script.
+ static void runScriptFile(const std::string &filename, bool autorun = false,
+ script_result_fn result_cb = {});
+ // Start running a Lua script file, returning an LLCoros::Future whose
+ // get() method will pause the calling coroutine until it can deliver the
+ // (count, result) pair described above. Between startScriptFile() and
+ // Future::get(), the caller and the Lua script coroutine will run
+ // concurrently.
+ // @a filename is as described for runScriptFile().
+ static LLCoros::Future<script_result> startScriptFile(const std::string& filename);
+ // Run a Lua script file, and pause the calling coroutine until it completes.
+ // The return value is the (count, result) pair described above.
+ // @a filename is as described for runScriptFile().
+ static script_result waitScriptFile(const std::string& filename);
+
+ static void runScriptLine(const std::string &chunk, script_result_fn result_cb = {});
+ // Start running a Lua chunk, returning an LLCoros::Future whose
+ // get() method will pause the calling coroutine until it can deliver the
+ // (count, result) pair described above. Between startScriptLine() and
+ // Future::get(), the caller and the Lua script coroutine will run
+ // concurrently.
+ static LLCoros::Future<script_result> startScriptLine(const std::string& chunk);
+ // Run a Lua chunk, and pause the calling coroutine until it completes.
+ // The return value is the (count, result) pair described above.
+ static script_result waitScriptLine(const std::string& chunk);
+
+ static const std::map<std::string, std::string> getScriptNames() { return sScriptNames; }
+
+ static S32 sAutorunScriptCount;
+ static S32 sScriptCount;
+
+ private:
+ static std::map<std::string, std::string> sScriptNames;
+};
+
+class LLRequireResolver
+{
+ public:
+ static void resolveRequire(lua_State *L, std::string path);
+
+ private:
+ fsyspath mPathToResolve;
+ fsyspath mSourceDir;
+
+ LLRequireResolver(lua_State *L, const std::string& path);
+
+ void findModule();
+ lua_State *L;
+
+ bool findModuleImpl(const std::string& absolutePath);
+ void runModule(const std::string& desc, const std::string& code);
+};
+
+// RAII class to guarantee that a script entry is erased even when coro is terminated
+class ScriptObserver
+{
+ public:
+ ScriptObserver(const std::string &coro_name, const std::string &filename) : mCoroName(coro_name)
+ {
+ LLLUAmanager::sScriptNames[mCoroName] = filename;
+ }
+ ~ScriptObserver() { LLLUAmanager::sScriptNames.erase(mCoroName); }
+
+ private:
+ std::string mCoroName;
+};
+#endif
diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp
index 9a0b1bfcd6..8bcfaa36e8 100644
--- a/indra/newview/llmanip.cpp
+++ b/indra/newview/llmanip.cpp
@@ -574,9 +574,6 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string
gGL.scalef(inv_zoom_amt, inv_zoom_amt, inv_zoom_amt);
}
- LLColor4 shadow_color = LLColor4::black;
- shadow_color.mV[VALPHA] = color.mV[VALPHA] * 0.5f;
-
if (fractional_portion != 0)
{
fraction_string = llformat("%c%02d%s", LLResMgr::getInstance()->getDecimalPoint(), fractional_portion, suffix.c_str());
diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp
index 19868f3c3e..9966a8eedb 100644
--- a/indra/newview/llmanipscale.cpp
+++ b/indra/newview/llmanipscale.cpp
@@ -618,43 +618,22 @@ void LLManipScale::renderFaces( const LLBBox& bbox )
{
gGL.color4fv( default_normal_color.mV );
LLGLDepthTest gls_depth(GL_FALSE);
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLE_STRIP);
{
- // Face 0
- gGL.vertex3f(min.mV[VX], max.mV[VY], max.mV[VZ]);
- gGL.vertex3f(min.mV[VX], min.mV[VY], max.mV[VZ]);
- gGL.vertex3f(max.mV[VX], min.mV[VY], max.mV[VZ]);
- gGL.vertex3f(max.mV[VX], max.mV[VY], max.mV[VZ]);
-
- // Face 1
- gGL.vertex3f(max.mV[VX], min.mV[VY], max.mV[VZ]);
+ gGL.vertex3f(min.mV[VX], max.mV[VY], min.mV[VZ]);
+ gGL.vertex3f(max.mV[VX], max.mV[VY], min.mV[VZ]);
+ gGL.vertex3f(min.mV[VX], min.mV[VY], min.mV[VZ]);
gGL.vertex3f(max.mV[VX], min.mV[VY], min.mV[VZ]);
+ gGL.vertex3f(max.mV[VX], min.mV[VY], max.mV[VZ]);
gGL.vertex3f(max.mV[VX], max.mV[VY], min.mV[VZ]);
gGL.vertex3f(max.mV[VX], max.mV[VY], max.mV[VZ]);
-
- // Face 2
gGL.vertex3f(min.mV[VX], max.mV[VY], min.mV[VZ]);
gGL.vertex3f(min.mV[VX], max.mV[VY], max.mV[VZ]);
- gGL.vertex3f(max.mV[VX], max.mV[VY], max.mV[VZ]);
- gGL.vertex3f(max.mV[VX], max.mV[VY], min.mV[VZ]);
-
- // Face 3
- gGL.vertex3f(min.mV[VX], max.mV[VY], max.mV[VZ]);
- gGL.vertex3f(min.mV[VX], max.mV[VY], min.mV[VZ]);
gGL.vertex3f(min.mV[VX], min.mV[VY], min.mV[VZ]);
gGL.vertex3f(min.mV[VX], min.mV[VY], max.mV[VZ]);
-
- // Face 4
- gGL.vertex3f(min.mV[VX], min.mV[VY], max.mV[VZ]);
- gGL.vertex3f(min.mV[VX], min.mV[VY], min.mV[VZ]);
- gGL.vertex3f(max.mV[VX], min.mV[VY], min.mV[VZ]);
gGL.vertex3f(max.mV[VX], min.mV[VY], max.mV[VZ]);
-
- // Face 5
- gGL.vertex3f(min.mV[VX], min.mV[VY], min.mV[VZ]);
- gGL.vertex3f(min.mV[VX], max.mV[VY], min.mV[VZ]);
- gGL.vertex3f(max.mV[VX], max.mV[VY], min.mV[VZ]);
- gGL.vertex3f(max.mV[VX], min.mV[VY], min.mV[VZ]);
+ gGL.vertex3f(min.mV[VX], max.mV[VY], max.mV[VZ]);
+ gGL.vertex3f(max.mV[VX], max.mV[VY], max.mV[VZ]);
}
gGL.end();
}
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index b39a976ebd..49260d5c50 100644
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -345,8 +345,8 @@ bool LLMediaCtrl::handleRightMouseDown( S32 x, S32 y, MASK mask )
auto menu = mContextMenuHandle.get();
if (!menu)
{
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registar;
- registar.add("Open.WebInspector", boost::bind(&LLMediaCtrl::onOpenWebInspector, this));
+ LLUICtrl::ScopedRegistrarHelper registrar;
+ registrar.add("Open.WebInspector", boost::bind(&LLMediaCtrl::onOpenWebInspector, this));
// stinson 05/05/2014 : use this as the parent of the context menu if the static menu
// container has yet to be created
@@ -843,7 +843,7 @@ void LLMediaCtrl::draw()
calcOffsetsAndSize(&x_offset, &y_offset, &width, &height);
// draw the browser
- gGL.begin( LLRender::QUADS );
+ gGL.begin(LLRender::TRIANGLES);
if (! media_plugin->getTextureCoordsOpenGL())
{
// render using web browser reported width and height, instead of trying to invert GL scale
@@ -856,6 +856,12 @@ void LLMediaCtrl::draw()
gGL.texCoord2f( 0.f, max_v );
gGL.vertex2i( x_offset, y_offset );
+ gGL.texCoord2f(max_u, 0.f);
+ gGL.vertex2i(x_offset + width, y_offset + height);
+
+ gGL.texCoord2f(0.f, max_v);
+ gGL.vertex2i(x_offset, y_offset);
+
gGL.texCoord2f( max_u, max_v );
gGL.vertex2i( x_offset + width, y_offset );
}
@@ -871,6 +877,12 @@ void LLMediaCtrl::draw()
gGL.texCoord2f( 0.f, 0.f );
gGL.vertex2i( x_offset, y_offset );
+ gGL.texCoord2f(max_u, max_v);
+ gGL.vertex2i(x_offset + width, y_offset + height);
+
+ gGL.texCoord2f(0.f, 0.f);
+ gGL.vertex2i(x_offset, y_offset);
+
gGL.texCoord2f( max_u, 0.f );
gGL.vertex2i( x_offset + width, y_offset );
}
diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h
index ca035e79e0..a5e6e43e3f 100644
--- a/indra/newview/llmediadataclient.h
+++ b/indra/newview/llmediadataclient.h
@@ -219,7 +219,7 @@ protected:
{
public:
RetryTimer(F32 time, Request::ptr_t);
- virtual bool tick();
+ bool tick() override;
private:
// back-pointer
Request::ptr_t mRequest;
@@ -286,7 +286,7 @@ private:
{
public:
QueueTimer(F32 time, LLMediaDataClient *mdc);
- virtual bool tick();
+ bool tick() override;
private:
// back-pointer
LLPointer<LLMediaDataClient> mMDC;
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 532a87bbd1..a8585c7f23 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -3692,20 +3692,63 @@ S32 LLMeshRepository::update()
return static_cast<S32>(size);
}
-void LLMeshRepository::unregisterMesh(LLVOVolume* vobj)
+void LLMeshRepository::unregisterMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_params, S32 detail)
{
- for (auto& lod : mLoadingMeshes)
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
+
+ llassert((mesh_params.getSculptType() & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH);
+ llassert(mesh_params.getSculptID().notNull());
+ auto& lod = mLoadingMeshes[detail];
+ auto param_iter = lod.find(mesh_params.getSculptID());
+ if (param_iter != lod.end())
{
- for (auto& param : lod)
+ vector_replace_with_last(param_iter->second, vobj);
+ llassert(!vector_replace_with_last(param_iter->second, vobj));
+ if (param_iter->second.empty())
{
- vector_replace_with_last(param.second, vobj);
+ lod.erase(param_iter);
}
}
+}
- for (auto& skin_pair : mLoadingSkins)
+void LLMeshRepository::unregisterSkinInfo(const LLUUID& mesh_id, LLVOVolume* vobj)
+{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
+
+ llassert(mesh_id.notNull());
+ auto skin_pair_iter = mLoadingSkins.find(mesh_id);
+ if (skin_pair_iter != mLoadingSkins.end())
+ {
+ vector_replace_with_last(skin_pair_iter->second, vobj);
+ llassert(!vector_replace_with_last(skin_pair_iter->second, vobj));
+ if (skin_pair_iter->second.empty())
+ {
+ mLoadingSkins.erase(skin_pair_iter);
+ }
+ }
+}
+
+// Lots of dead objects make expensive calls to
+// LLMeshRepository::unregisterMesh which may delay shutdown. Avoid this by
+// preemptively unregistering all meshes.
+// We can also do this safely if all objects are confirmed dead for some other
+// reason.
+void LLMeshRepository::unregisterAllMeshes()
+{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
+
+ // The size of mLoadingMeshes and mLoadingSkins may be large and thus
+ // expensive to iterate over in LLVOVolume::~LLVOVolume.
+ // This is unnecessary during shutdown, so we ignore the referenced objects in the
+ // least expensive way which is still safe: by clearing these containers.
+ // Clear now and not in LLMeshRepository::shutdown because
+ // LLMeshRepository::notifyLoadedMeshes could (depending on invocation
+ // order) reference a pointer to an object after it has been deleted.
+ for (auto& lod : mLoadingMeshes)
{
- vector_replace_with_last(skin_pair.second, vobj);
+ lod.clear();
}
+ mLoadingSkins.clear();
}
S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_params, S32 detail, S32 last_lod)
@@ -3900,6 +3943,7 @@ void LLMeshRepository::notifyLoadedMeshes()
for (auto iter = mSkinMap.begin(), ender = mSkinMap.end(); iter != ender;)
{
auto copy_iter = iter++;
+ LLUUID id = copy_iter->first;
//skinbytes += U64Bytes(sizeof(LLMeshSkinInfo));
//skinbytes += U64Bytes(copy_iter->second->mJointNames.size() * sizeof(std::string));
@@ -3913,7 +3957,6 @@ void LLMeshRepository::notifyLoadedMeshes()
}
// erase from background thread
- LLUUID id = iter->first;
mThread->mWorkQueue.post([=]()
{
mThread->mSkinMap.erase(id);
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index b5c2424578..d864a07615 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -641,10 +641,12 @@ public:
LLMeshRepository();
void init();
+ void unregisterAllMeshes();
void shutdown();
S32 update();
- void unregisterMesh(LLVOVolume* volume);
+ void unregisterMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_params, S32 detail);
+ void unregisterSkinInfo(const LLUUID& mesh_id, LLVOVolume* vobj);
//mesh management functions
S32 loadMesh(LLVOVolume* volume, const LLVolumeParams& mesh_params, S32 detail = 0, S32 last_lod = -1);
diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp
index ef09cfa55b..1e8b7d39cc 100644
--- a/indra/newview/llmodelpreview.cpp
+++ b/indra/newview/llmodelpreview.cpp
@@ -134,25 +134,17 @@ std::string getLodSuffix(S32 lod)
void FindModel(LLModelLoader::scene& scene, const std::string& name_to_match, LLModel*& baseModelOut, LLMatrix4& matOut)
{
- LLModelLoader::scene::iterator base_iter = scene.begin();
- bool found = false;
- while (!found && (base_iter != scene.end()))
+ for (auto scene_iter = scene.begin(); scene_iter != scene.end(); scene_iter++)
{
- matOut = base_iter->first;
-
- LLModelLoader::model_instance_list::iterator base_instance_iter = base_iter->second.begin();
- while (!found && (base_instance_iter != base_iter->second.end()))
+ for (auto model_iter = scene_iter->second.begin(); model_iter != scene_iter->second.end(); model_iter++)
{
- LLModelInstance& base_instance = *base_instance_iter++;
- LLModel* base_model = base_instance.mModel;
-
- if (base_model && (base_model->mLabel == name_to_match))
+ if (model_iter->mModel && (model_iter->mModel->mLabel == name_to_match))
{
- baseModelOut = base_model;
+ baseModelOut = model_iter->mModel;
+ matOut = scene_iter->first;
return;
}
}
- base_iter++;
}
}
@@ -212,9 +204,12 @@ LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp)
LLModelPreview::~LLModelPreview()
{
+ LLMutexLock lock(this);
+
if (mModelLoader)
{
mModelLoader->shutdown();
+ mModelLoader = NULL;
}
if (mPreviewAvatar)
@@ -262,7 +257,7 @@ void LLModelPreview::updateDimentionsAndOffsets()
accounted.insert(instance.mModel);
// update instance skin info for each lods pelvisZoffset
- for (int j = 0; j<LLModel::NUM_LODS; ++j)
+ for (int j = 0; j < LLModel::NUM_LODS; ++j)
{
if (instance.mLOD[j])
{
@@ -303,7 +298,7 @@ void LLModelPreview::rebuildUploadData()
bool legacyMatching = gSavedSettings.getBOOL("ImporterLegacyMatching");
U32 load_state = 0;
- for (LLModelLoader::scene::iterator iter = mBaseScene.begin(); iter != mBaseScene.end(); ++iter)
+ for (auto iter = mBaseScene.begin(); iter != mBaseScene.end(); ++iter)
{ //for each transform in scene
LLMatrix4 mat = iter->first;
@@ -322,9 +317,9 @@ void LLModelPreview::rebuildUploadData()
mat *= scale_mat;
- for (LLModelLoader::model_instance_list::iterator model_iter = iter->second.begin(); model_iter != iter->second.end();)
+ for (auto model_iter = iter->second.begin(); model_iter != iter->second.end(); ++model_iter)
{ // for each instance with said transform applied
- LLModelInstance instance = *model_iter++;
+ LLModelInstance instance = *model_iter;
LLModel* base_model = instance.mModel;
@@ -910,7 +905,7 @@ void LLModelPreview::clearIncompatible(S32 lod)
{
mBaseModel = mModel[lod];
mBaseScene = mScene[lod];
- mVertexBuffer[5].clear();
+ mVertexBuffer[LLModel::NUM_LODS].clear();
replaced_base_model = true;
}
}
@@ -1132,7 +1127,7 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod)
mBaseModel = mModel[loaded_lod];
mBaseScene = mScene[loaded_lod];
- mVertexBuffer[5].clear();
+ mVertexBuffer[LLModel::NUM_LODS].clear();
}
else
{
@@ -1248,7 +1243,7 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod)
{
if (!mBaseModel.empty())
{
- const std::string& model_name = mBaseModel[0]->getName();
+ std::string model_name = mBaseModel.front()->getName();
LLLineEditor* description_form = mFMP->getChild<LLLineEditor>("description_form");
if (description_form->getText().empty())
{
@@ -1269,6 +1264,8 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod)
void LLModelPreview::resetPreviewTarget()
{
+ LLMutexLock lock(this);
+
if (mModelLoader)
{
mPreviewTarget = (mModelLoader->mExtents[0] + mModelLoader->mExtents[1]) * 0.5f;
@@ -1314,7 +1311,7 @@ void LLModelPreview::generateNormals()
(*it)->generateNormals(angle_cutoff);
}
- mVertexBuffer[5].clear();
+ mVertexBuffer[LLModel::NUM_LODS].clear();
}
bool perform_copy = mModelFacesCopy[which_lod].empty();
@@ -2156,7 +2153,7 @@ void LLModelPreview::updateStatusMessages()
S32 total_verts[LLModel::NUM_LODS];
S32 total_submeshes[LLModel::NUM_LODS];
- for (U32 i = 0; i < LLModel::NUM_LODS - 1; i++)
+ for (U32 i = 0; i < LLModel::NUM_LODS; i++)
{
total_tris[i] = 0;
total_verts[i] = 0;
@@ -2460,12 +2457,16 @@ void LLModelPreview::updateStatusMessages()
}
}
- if (mModelNoErrors && mModelLoader)
+ if (mModelNoErrors)
{
- if (!mModelLoader->areTexturesReady() && mFMP->childGetValue("upload_textures").asBoolean())
+ LLMutexLock lock(this);
+ if (mModelLoader)
{
- // Some textures are still loading, prevent upload until they are done
- mModelNoErrors = false;
+ if (!mModelLoader->areTexturesReady() && mFMP->childGetValue("upload_textures").asBoolean())
+ {
+ // Some textures are still loading, prevent upload until they are done
+ mModelNoErrors = false;
+ }
}
}
@@ -2794,10 +2795,10 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights)
{
LLModelLoader::model_list* model = NULL;
- if (lod < 0 || lod > 4)
+ if (lod < 0 || lod >= LLModel::NUM_LODS)
{
model = &mBaseModel;
- lod = 5;
+ lod = LLModel::NUM_LODS;
}
else
{
@@ -3034,8 +3035,9 @@ void LLModelPreview::loadedCallback(
S32 lod,
void* opaque)
{
- LLModelPreview* pPreview = static_cast< LLModelPreview* >(opaque);
- if (pPreview && !LLModelPreview::sIgnoreLoadedCallback)
+ LLModelPreview* pPreview = static_cast<LLModelPreview*>(opaque);
+ LLMutexLock lock(pPreview);
+ if (pPreview && pPreview->mModelLoader && !LLModelPreview::sIgnoreLoadedCallback)
{
// Load loader's warnings into floater's log tab
const LLSD out = pPreview->mModelLoader->logOut();
@@ -3056,7 +3058,9 @@ void LLModelPreview::loadedCallback(
}
const LLVOAvatar* avatarp = pPreview->getPreviewAvatar();
- if (avatarp) { // set up ground plane for possible rendering
+ if (avatarp && avatarp->mRoot && avatarp->mDrawable)
+ {
+ // set up ground plane for possible rendering
const LLVector3 root_pos = avatarp->mRoot->getPosition();
const LLVector4a* ext = avatarp->mDrawable->getSpatialExtents();
const LLVector4a min = ext[0], max = ext[1];
@@ -3200,12 +3204,12 @@ bool LLModelPreview::render()
LLMutexLock lock(this);
mNeedsUpdate = false;
- bool edges = mViewOption["show_edges"];
- bool joint_overrides = mViewOption["show_joint_overrides"];
- bool joint_positions = mViewOption["show_joint_positions"];
- bool skin_weight = mViewOption["show_skin_weight"];
- bool textures = mViewOption["show_textures"];
- bool physics = mViewOption["show_physics"];
+ bool show_edges = mViewOption["show_edges"];
+ bool show_joint_overrides = mViewOption["show_joint_overrides"];
+ bool show_joint_positions = mViewOption["show_joint_positions"];
+ bool show_skin_weight = mViewOption["show_skin_weight"];
+ bool show_textures = mViewOption["show_textures"];
+ bool show_physics = mViewOption["show_physics"];
S32 width = getWidth();
S32 height = getHeight();
@@ -3282,15 +3286,15 @@ bool LLModelPreview::render()
fmp->childSetValue("upload_skin", true);
mFirstSkinUpdate = false;
upload_skin = true;
- skin_weight = true;
+ show_skin_weight = true;
mViewOption["show_skin_weight"] = true;
}
fmp->enableViewOption("show_skin_weight");
- fmp->setViewOptionEnabled("show_joint_overrides", skin_weight);
- fmp->setViewOptionEnabled("show_joint_positions", skin_weight);
+ fmp->setViewOptionEnabled("show_joint_overrides", show_skin_weight);
+ fmp->setViewOptionEnabled("show_joint_positions", show_skin_weight);
mFMP->childEnable("upload_skin");
- mFMP->childSetValue("show_skin_weight", skin_weight);
+ mFMP->childSetValue("show_skin_weight", show_skin_weight);
}
else if ((flags & LEGACY_RIG_FLAG_TOO_MANY_JOINTS) > 0)
@@ -3313,11 +3317,12 @@ bool LLModelPreview::render()
fmp->disableViewOption("show_joint_overrides");
fmp->disableViewOption("show_joint_positions");
- skin_weight = false;
+ show_skin_weight = false;
mFMP->childSetValue("show_skin_weight", false);
- fmp->setViewOptionEnabled("show_skin_weight", skin_weight);
+ fmp->setViewOptionEnabled("show_skin_weight", show_skin_weight);
}
}
+ //if (this) return TRUE;
if (upload_skin && !has_skin_weights)
{ //can't upload skin weights if model has no skin weights
@@ -3380,7 +3385,7 @@ bool LLModelPreview::render()
F32 z_near = 0.001f;
F32 z_far = mCameraDistance*10.0f + mPreviewScale.magVec() + mCameraOffset.magVec();
- if (skin_weight)
+ if (show_skin_weight)
{
target_pos = getPreviewAvatar()->getPositionAgent() + offset;
z_near = 0.01f;
@@ -3390,7 +3395,7 @@ bool LLModelPreview::render()
refresh();
}
- gObjectPreviewProgram.bind(skin_weight);
+ gObjectPreviewProgram.bind(show_skin_weight);
gGL.loadIdentity();
gPipeline.enableLightsPreview();
@@ -3399,7 +3404,7 @@ bool LLModelPreview::render()
LLQuaternion(mCameraYaw, LLVector3::z_axis);
LLQuaternion av_rot = camera_rot;
- F32 camera_distance = skin_weight ? SKIN_WEIGHT_CAMERA_DISTANCE : mCameraDistance;
+ F32 camera_distance = show_skin_weight ? SKIN_WEIGHT_CAMERA_DISTANCE : mCameraDistance;
LLViewerCamera::getInstance()->setOriginAndLookAt(
target_pos + ((LLVector3(camera_distance, 0.f, 0.f) + offset) * av_rot), // camera
LLVector3::z_axis, // up
@@ -3415,9 +3420,9 @@ bool LLModelPreview::render()
gGL.pushMatrix();
gGL.color4fv(PREVIEW_EDGE_COL.mV);
- if (!mBaseModel.empty() && mVertexBuffer[5].empty())
+ if (!mBaseModel.empty() && mVertexBuffer[LLModel::NUM_LODS].empty())
{
- genBuffers(-1, skin_weight);
+ genBuffers(-1, show_skin_weight);
//genBuffers(3);
}
@@ -3432,7 +3437,7 @@ bool LLModelPreview::render()
if (!vb_vec.empty())
{
const LLVertexBuffer* buff = vb_vec[0];
- regen = buff->hasDataType(LLVertexBuffer::TYPE_WEIGHT4) != skin_weight;
+ regen = buff->hasDataType(LLVertexBuffer::TYPE_WEIGHT4) != show_skin_weight;
}
else
{
@@ -3443,15 +3448,15 @@ bool LLModelPreview::render()
if (regen)
{
- genBuffers(mPreviewLOD, skin_weight);
+ genBuffers(mPreviewLOD, show_skin_weight);
}
- if (physics && mVertexBuffer[LLModel::LOD_PHYSICS].empty())
+ if (show_physics && mVertexBuffer[LLModel::LOD_PHYSICS].empty())
{
genBuffers(LLModel::LOD_PHYSICS, false);
}
- if (!skin_weight)
+ if (!show_skin_weight)
{
for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
{
@@ -3473,11 +3478,7 @@ bool LLModelPreview::render()
auto num_models = mVertexBuffer[mPreviewLOD][model].size();
for (size_t i = 0; i < num_models; ++i)
{
- LLVertexBuffer* buffer = mVertexBuffer[mPreviewLOD][model][i];
-
- buffer->setBuffer();
-
- if (textures)
+ if (show_textures)
{
auto materialCnt = instance.mModel->mMaterialList.size();
if (i < materialCnt)
@@ -3501,10 +3502,16 @@ bool LLModelPreview::render()
gGL.diffuseColor4fv(PREVIEW_BASE_COL.mV);
}
+ // Zero this variable for an obligatory buffer initialization
+ // See https://github.com/secondlife/viewer/issues/912
+ LLVertexBuffer::sGLRenderBuffer = 0;
+ LLVertexBuffer* buffer = mVertexBuffer[mPreviewLOD][model][i];
+ buffer->setBuffer();
buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts() - 1, buffer->getNumIndices(), 0);
+
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.diffuseColor4fv(PREVIEW_EDGE_COL.mV);
- if (edges)
+ if (show_edges)
{
glLineWidth(PREVIEW_EDGE_WIDTH);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
@@ -3517,7 +3524,7 @@ bool LLModelPreview::render()
gGL.popMatrix();
}
- if (physics)
+ if (show_physics)
{
glClear(GL_DEPTH_BUFFER_BIT);
@@ -3621,11 +3628,13 @@ bool LLModelPreview::render()
if (pass > 0){
for (size_t i = 0; i < num_models; ++i)
{
- LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][i];
-
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.diffuseColor4fv(PREVIEW_PSYH_FILL_COL.mV);
+ // Zero this variable for an obligatory buffer initialization
+ // See https://github.com/secondlife/viewer/issues/912
+ LLVertexBuffer::sGLRenderBuffer = 0;
+ LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][i];
buffer->setBuffer();
buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts() - 1, buffer->getNumIndices(), 0);
@@ -3685,10 +3694,11 @@ bool LLModelPreview::render()
auto num_models = mVertexBuffer[LLModel::LOD_PHYSICS][model].size();
for (size_t v = 0; v < num_models; ++v)
{
+ // Zero this variable for an obligatory buffer initialization
+ // See https://github.com/secondlife/viewer/issues/912
+ LLVertexBuffer::sGLRenderBuffer = 0;
LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][v];
-
buffer->setBuffer();
-
LLStrider<LLVector3> pos_strider;
buffer->getVertexStrider(pos_strider, 0);
LLVector4a* pos = (LLVector4a*)pos_strider.get();
@@ -3752,7 +3762,7 @@ bool LLModelPreview::render()
U32 joint_count = LLSkinningUtil::getMeshJointCount(skin);
auto bind_count = skin->mAlternateBindMatrix.size();
- if (joint_overrides
+ if (show_joint_overrides
&& bind_count > 0
&& joint_count == bind_count)
{
@@ -3797,14 +3807,12 @@ bool LLModelPreview::render()
for (U32 i = 0, e = static_cast<U32>(mVertexBuffer[mPreviewLOD][model].size()); i < e; ++i)
{
- LLVertexBuffer* buffer = mVertexBuffer[mPreviewLOD][model][i];
-
model->mSkinInfo.updateHash();
LLRenderPass::uploadMatrixPalette(mPreviewAvatar, &model->mSkinInfo);
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- if (textures)
+ if (show_textures)
{
auto materialCnt = instance.mModel->mMaterialList.size();
if (i < materialCnt)
@@ -3828,10 +3836,14 @@ bool LLModelPreview::render()
gGL.diffuseColor4fv(PREVIEW_BASE_COL.mV);
}
+ // Zero this variable for an obligatory buffer initialization
+ // See https://github.com/secondlife/viewer/issues/912
+ LLVertexBuffer::sGLRenderBuffer = 0;
+ LLVertexBuffer* buffer = mVertexBuffer[mPreviewLOD][model][i];
buffer->setBuffer();
buffer->draw(LLRender::TRIANGLES, buffer->getNumIndices(), 0);
- if (edges)
+ if (show_edges)
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.diffuseColor4fv(PREVIEW_EDGE_COL.mV);
@@ -3846,7 +3858,7 @@ bool LLModelPreview::render()
}
}
- if (joint_positions)
+ if (show_joint_positions)
{
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
if (shader)
diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index 3f370b1ab5..483ddcdd63 100644
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -128,7 +128,7 @@ LLNetMap::~LLNetMap()
bool LLNetMap::postBuild()
{
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar commitRegistrar;
+ LLUICtrl::ScopedRegistrarHelper commitRegistrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enableRegistrar;
enableRegistrar.add("Minimap.Zoom.Check", boost::bind(&LLNetMap::isZoomChecked, this, _2));
@@ -298,15 +298,22 @@ void LLNetMap::draw()
// Draw using texture.
gGL.getTexUnit(0)->bind(regionp->getLand().getSTexture());
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLES);
+ {
gGL.texCoord2f(0.f, 1.f);
gGL.vertex2f(left, top);
gGL.texCoord2f(0.f, 0.f);
gGL.vertex2f(left, bottom);
gGL.texCoord2f(1.f, 0.f);
gGL.vertex2f(right, bottom);
+
+ gGL.texCoord2f(0.f, 1.f);
+ gGL.vertex2f(left, top);
+ gGL.texCoord2f(1.f, 0.f);
+ gGL.vertex2f(right, bottom);
gGL.texCoord2f(1.f, 1.f);
gGL.vertex2f(right, top);
+ }
gGL.end();
gGL.flush();
@@ -347,15 +354,22 @@ void LLNetMap::draw()
F32 image_half_width = 0.5f*mObjectMapPixels;
F32 image_half_height = 0.5f*mObjectMapPixels;
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLES);
+ {
gGL.texCoord2f(0.f, 1.f);
gGL.vertex2f(map_center_agent.mV[VX] - image_half_width, image_half_height + map_center_agent.mV[VY]);
gGL.texCoord2f(0.f, 0.f);
gGL.vertex2f(map_center_agent.mV[VX] - image_half_width, map_center_agent.mV[VY] - image_half_height);
gGL.texCoord2f(1.f, 0.f);
gGL.vertex2f(image_half_width + map_center_agent.mV[VX], map_center_agent.mV[VY] - image_half_height);
+
+ gGL.texCoord2f(0.f, 1.f);
+ gGL.vertex2f(map_center_agent.mV[VX] - image_half_width, image_half_height + map_center_agent.mV[VY]);
+ gGL.texCoord2f(1.f, 0.f);
+ gGL.vertex2f(image_half_width + map_center_agent.mV[VX], map_center_agent.mV[VY] - image_half_height);
gGL.texCoord2f(1.f, 1.f);
gGL.vertex2f(image_half_width + map_center_agent.mV[VX], image_half_height + map_center_agent.mV[VY]);
+ }
gGL.end();
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp
index 72fb9464d8..dba294cef4 100644
--- a/indra/newview/lloutfitgallery.cpp
+++ b/indra/newview/lloutfitgallery.cpp
@@ -1157,7 +1157,7 @@ void LLOutfitGalleryItem::setDefaultImage()
LLContextMenu* LLOutfitGalleryContextMenu::createMenu()
{
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ LLUICtrl::ScopedRegistrarHelper registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
LLUUID selected_id = mUUIDs.front();
@@ -1169,8 +1169,8 @@ LLContextMenu* LLOutfitGalleryContextMenu::createMenu()
boost::bind(&LLAppearanceMgr::takeOffOutfit, &LLAppearanceMgr::instance(), selected_id));
registrar.add("Outfit.Edit", boost::bind(editOutfit));
registrar.add("Outfit.Rename", boost::bind(renameOutfit, selected_id));
- registrar.add("Outfit.Delete", boost::bind(LLOutfitGallery::onRemoveOutfit, selected_id));
- registrar.add("Outfit.Create", boost::bind(&LLOutfitGalleryContextMenu::onCreate, this, _2));
+ registrar.add("Outfit.Delete", boost::bind(LLOutfitGallery::onRemoveOutfit, selected_id), LLUICtrl::cb_info::UNTRUSTED_BLOCK);
+ registrar.add("Outfit.Create", boost::bind(&LLOutfitGalleryContextMenu::onCreate, this, _2), LLUICtrl::cb_info::UNTRUSTED_BLOCK);
registrar.add("Outfit.Thumbnail", boost::bind(&LLOutfitGalleryContextMenu::onThumbnail, this, selected_id));
registrar.add("Outfit.Save", boost::bind(&LLOutfitGalleryContextMenu::onSave, this, selected_id));
enable_registrar.add("Outfit.OnEnable", boost::bind(&LLOutfitGalleryContextMenu::onEnable, this, _2));
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp
index 0f5f7aebf8..0233a22c2a 100644
--- a/indra/newview/lloutfitslist.cpp
+++ b/indra/newview/lloutfitslist.cpp
@@ -924,8 +924,8 @@ void LLOutfitListBase::onIdleRefreshList()
if (cat)
{
std::string name = cat->getName();
- updateChangedCategoryName(cat, name);
- }
+ updateChangedCategoryName(cat, name);
+ }
curent_time = LLTimer::getTotalSeconds();
if (curent_time >= end_time)
@@ -1053,7 +1053,7 @@ void LLOutfitListBase::deselectOutfit(const LLUUID& category_id)
LLContextMenu* LLOutfitContextMenu::createMenu()
{
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ LLUICtrl::ScopedRegistrarHelper registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
LLUUID selected_id = mUUIDs.front();
@@ -1064,8 +1064,8 @@ LLContextMenu* LLOutfitContextMenu::createMenu()
registrar.add("Outfit.TakeOff",
boost::bind(&LLAppearanceMgr::takeOffOutfit, &LLAppearanceMgr::instance(), selected_id));
registrar.add("Outfit.Edit", boost::bind(editOutfit));
- registrar.add("Outfit.Rename", boost::bind(renameOutfit, selected_id));
- registrar.add("Outfit.Delete", boost::bind(&LLOutfitListBase::removeSelected, mOutfitList));
+ registrar.add("Outfit.Rename", boost::bind(renameOutfit, selected_id), LLUICtrl::cb_info::UNTRUSTED_BLOCK);
+ registrar.add("Outfit.Delete", boost::bind(&LLOutfitListBase::removeSelected, mOutfitList), LLUICtrl::cb_info::UNTRUSTED_BLOCK);
registrar.add("Outfit.Thumbnail", boost::bind(&LLOutfitContextMenu::onThumbnail, this, selected_id));
registrar.add("Outfit.Save", boost::bind(&LLOutfitContextMenu::onSave, this, selected_id));
@@ -1163,7 +1163,7 @@ LLOutfitListGearMenuBase::LLOutfitListGearMenuBase(LLOutfitListBase* olist)
{
llassert_always(mOutfitList);
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ LLUICtrl::ScopedRegistrarHelper registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
registrar.add("Gear.Wear", boost::bind(&LLOutfitListGearMenuBase::onWear, this));
diff --git a/indra/newview/llpanelblockedlist.cpp b/indra/newview/llpanelblockedlist.cpp
index 7d55ba3265..01d4f426de 100644
--- a/indra/newview/llpanelblockedlist.cpp
+++ b/indra/newview/llpanelblockedlist.cpp
@@ -62,7 +62,7 @@ const std::string BLOCKED_PARAM_NAME = "blocked_to_select";
LLPanelBlockedList::LLPanelBlockedList()
: LLPanel()
{
- mCommitCallbackRegistrar.add("Block.Action", boost::bind(&LLPanelBlockedList::onCustomAction, this, _2));
+ mCommitCallbackRegistrar.add("Block.Action", { boost::bind(&LLPanelBlockedList::onCustomAction, this, _2), cb_info::UNTRUSTED_BLOCK });
mEnableCallbackRegistrar.add("Block.Check", boost::bind(&LLPanelBlockedList::isActionChecked, this, _2));
}
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp
index 282b6d4a0a..a90c17f56e 100644
--- a/indra/newview/llpaneleditwearable.cpp
+++ b/indra/newview/llpaneleditwearable.cpp
@@ -642,8 +642,8 @@ LLPanelEditWearable::LLPanelEditWearable()
, mWearablePtr(NULL)
, mWearableItem(NULL)
{
- mCommitCallbackRegistrar.add("ColorSwatch.Commit", boost::bind(&LLPanelEditWearable::onColorSwatchCommit, this, _1));
- mCommitCallbackRegistrar.add("TexturePicker.Commit", boost::bind(&LLPanelEditWearable::onTexturePickerCommit, this, _1));
+ mCommitCallbackRegistrar.add("ColorSwatch.Commit", { boost::bind(&LLPanelEditWearable::onColorSwatchCommit, this, _1) });
+ mCommitCallbackRegistrar.add("TexturePicker.Commit", { boost::bind(&LLPanelEditWearable::onTexturePickerCommit, this, _1) });
}
//virtual
diff --git a/indra/newview/llpanelemojicomplete.cpp b/indra/newview/llpanelemojicomplete.cpp
index cb89a5910e..0d6ca1cb94 100644
--- a/indra/newview/llpanelemojicomplete.cpp
+++ b/indra/newview/llpanelemojicomplete.cpp
@@ -68,6 +68,9 @@ LLPanelEmojiComplete::LLPanelEmojiComplete(const LLPanelEmojiComplete::Params& p
{
LLScrollbar::Params sbparams;
sbparams.orientation(LLScrollbar::VERTICAL);
+ sbparams.doc_size((S32)mTotalEmojis);
+ sbparams.doc_pos(0);
+ sbparams.page_size((S32)mVisibleEmojis);
sbparams.change_callback([this](S32 index, LLScrollbar*) { onScrollbarChange(index); });
mScrollbar = LLUICtrlFactory::create<LLScrollbar>(sbparams);
addChild(mScrollbar);
@@ -280,8 +283,7 @@ void LLPanelEmojiComplete::onCommit()
{
if (mCurSelected < mTotalEmojis)
{
- LLSD value(wstring_to_utf8str(LLWString(1, mEmojis[mCurSelected].Character)));
- setValue(value);
+ setValue(ll_convert_to<std::string>(mEmojis[mCurSelected].Character));
LLUICtrl::onCommit();
}
}
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 544b6fbc9c..7a63c6e10d 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -470,7 +470,7 @@ LLPanelFace::LLPanelFace()
mNeedMediaTitle(true)
{
USE_TEXTURE = LLTrans::getString("use_texture");
- mCommitCallbackRegistrar.add("PanelFace.menuDoToSelected", boost::bind(&LLPanelFace::menuDoToSelected, this, _2));
+ mCommitCallbackRegistrar.add("PanelFace.menuDoToSelected", { boost::bind(&LLPanelFace::menuDoToSelected, this, _2) });
mEnableCallbackRegistrar.add("PanelFace.menuEnable", boost::bind(&LLPanelFace::menuEnableItem, this, _2));
}
@@ -5199,4 +5199,3 @@ void LLPanelFace::LLSelectedTE::getMaxDiffuseRepeats(F32& repeats, bool& identic
} max_diff_repeats_func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &max_diff_repeats_func, repeats );
}
-
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h
index dfd3201533..4d2ce208b4 100644
--- a/indra/newview/llpanelface.h
+++ b/indra/newview/llpanelface.h
@@ -479,7 +479,7 @@ private:
ReturnType (LLMaterial::* const MaterialGetFunc)() const >
static void getTEMaterialValue(DataType& data_to_return, bool& identical,DataType default_value, bool has_tolerance = false, DataType tolerance = DataType())
{
- DataType data_value;
+ DataType data_value{};
struct GetTEMaterialVal : public LLSelectedTEGetFunctor<DataType>
{
GetTEMaterialVal(DataType default_value) : _default(default_value) {}
@@ -512,7 +512,7 @@ private:
ReturnType (LLTextureEntry::* const TEGetFunc)() const >
static void getTEValue(DataType& data_to_return, bool& identical, DataType default_value, bool has_tolerance = false, DataType tolerance = DataType())
{
- DataType data_value;
+ DataType data_value {};
struct GetTEVal : public LLSelectedTEGetFunctor<DataType>
{
GetTEVal(DataType default_value) : _default(default_value) {}
@@ -707,4 +707,3 @@ public:
};
#endif
-
diff --git a/indra/newview/llpanelgroupbulk.cpp b/indra/newview/llpanelgroupbulk.cpp
index 433db74cda..8032e207cd 100644
--- a/indra/newview/llpanelgroupbulk.cpp
+++ b/indra/newview/llpanelgroupbulk.cpp
@@ -56,6 +56,7 @@ LLPanelGroupBulkImpl::LLPanelGroupBulkImpl(const LLUUID& group_id) :
mGroupID(group_id),
mBulkAgentList(NULL),
mOKButton(NULL),
+ mAddButton(nullptr),
mRemoveButton(NULL),
mGroupName(NULL),
mLoadingText(),
@@ -79,29 +80,18 @@ LLPanelGroupBulkImpl::~LLPanelGroupBulkImpl()
}
}
-// static
-void LLPanelGroupBulkImpl::callbackClickAdd(void* userdata)
+void LLPanelGroupBulkImpl::callbackClickAdd(LLPanelGroupBulk* panelp)
{
- if (LLPanelGroupBulk* panelp = (LLPanelGroupBulk*)userdata)
- {
- // Right now this is hard coded with some knowledge that it is part
- // of a floater since the avatar picker needs to be added as a dependent
- // floater to the parent floater.
- // Soon the avatar picker will be embedded into this panel
- // instead of being it's own separate floater. But that is next week.
- // This will do for now. -jwolk May 10, 2006
- LLView* button = panelp->findChild<LLButton>("add_button");
- LLFloater* root_floater = gFloaterView->getParentFloater(panelp);
- LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(
- [&](const uuid_vec_t& agent_ids, const std::vector<LLAvatarName>&)
- {
- panelp->mImplementation->addUsers(agent_ids);
- }, true, false, false, root_floater->getName(), button);
- if (picker)
+ LLFloater* root_floater = gFloaterView->getParentFloater(panelp);
+ LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(
+ [this](const uuid_vec_t& agent_ids, const std::vector<LLAvatarName>&)
{
- root_floater->addDependentFloater(picker);
- LLGroupMgr::getInstance()->sendCapGroupMembersRequest(panelp->mImplementation->mGroupID);
- }
+ addUsers(agent_ids);
+ }, true, false, false, root_floater->getName(), mAddButton);
+ if (picker)
+ {
+ root_floater->addDependentFloater(picker);
+ LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID);
}
}
diff --git a/indra/newview/llpanelgroupbulkban.cpp b/indra/newview/llpanelgroupbulkban.cpp
index 3c764887a6..1d3edad0f3 100644
--- a/indra/newview/llpanelgroupbulkban.cpp
+++ b/indra/newview/llpanelgroupbulkban.cpp
@@ -68,35 +68,26 @@ bool LLPanelGroupBulkBan::postBuild()
mImplementation->mBulkAgentList->setCommitCallback(LLPanelGroupBulkImpl::callbackSelect, mImplementation);
}
- LLButton* button = getChild<LLButton>("add_button", recurse);
- if ( button )
+ mImplementation->mAddButton = getChild<LLButton>("add_button", recurse);
+ // default to opening avatarpicker automatically
+ mImplementation->mAddButton->setClickedCallback(
+ [this](LLUICtrl* ctrl, const LLSD& param)
{
- // default to opening avatarpicker automatically
- // (*impl::callbackClickAdd)((void*)this);
- button->setClickedCallback(LLPanelGroupBulkImpl::callbackClickAdd, this);
- }
+ mImplementation->callbackClickAdd(this);
+ });
mImplementation->mRemoveButton =
getChild<LLButton>("remove_button", recurse);
- if ( mImplementation->mRemoveButton )
- {
- mImplementation->mRemoveButton->setClickedCallback(LLPanelGroupBulkImpl::callbackClickRemove, mImplementation);
- mImplementation->mRemoveButton->setEnabled(false);
- }
+ mImplementation->mRemoveButton->setClickedCallback(LLPanelGroupBulkImpl::callbackClickRemove, mImplementation);
+ mImplementation->mRemoveButton->setEnabled(false);
mImplementation->mOKButton =
getChild<LLButton>("ban_button", recurse);
- if ( mImplementation->mOKButton )
- {
- mImplementation->mOKButton->setClickedCallback(LLPanelGroupBulkBan::callbackClickSubmit, this);
- mImplementation->mOKButton->setEnabled(false);
- }
+ mImplementation->mOKButton->setClickedCallback(LLPanelGroupBulkBan::callbackClickSubmit, this);
+ mImplementation->mOKButton->setEnabled(false);
- button = getChild<LLButton>("cancel_button", recurse);
- if ( button )
- {
- button->setClickedCallback(LLPanelGroupBulkImpl::callbackClickCancel, mImplementation);
- }
+ LLButton* button = getChild<LLButton>("cancel_button", recurse);
+ button->setClickedCallback(LLPanelGroupBulkImpl::callbackClickCancel, mImplementation);
mImplementation->mTooManySelected = getString("ban_selection_too_large");
mImplementation->mBanNotPermitted = getString("ban_not_permitted");
diff --git a/indra/newview/llpanelgroupbulkimpl.h b/indra/newview/llpanelgroupbulkimpl.h
index 5a479f8117..5515bd6d9a 100644
--- a/indra/newview/llpanelgroupbulkimpl.h
+++ b/indra/newview/llpanelgroupbulkimpl.h
@@ -44,7 +44,7 @@ public:
LLPanelGroupBulkImpl(const LLUUID& group_id);
~LLPanelGroupBulkImpl();
- static void callbackClickAdd(void* userdata);
+ void callbackClickAdd(LLPanelGroupBulk* panelp);
static void callbackClickRemove(void* userdata);
static void callbackClickCancel(void* userdata);
@@ -70,6 +70,7 @@ public:
LLNameListCtrl* mBulkAgentList;
LLButton* mOKButton;
+ LLButton* mAddButton;
LLButton* mRemoveButton;
LLTextBox* mGroupName;
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index fb7ccbfe4c..5a0cd1a823 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -458,10 +458,10 @@ void LLLandmarksPanel::initLandmarksPanel(LLPlacesInventoryPanel* inventory_list
// List Commands Handlers
void LLLandmarksPanel::initListCommandsHandlers()
{
- mCommitCallbackRegistrar.add("Places.LandmarksGear.Add.Action", boost::bind(&LLLandmarksPanel::onAddAction, this, _2));
- mCommitCallbackRegistrar.add("Places.LandmarksGear.CopyPaste.Action", boost::bind(&LLLandmarksPanel::onClipboardAction, this, _2));
- mCommitCallbackRegistrar.add("Places.LandmarksGear.Custom.Action", boost::bind(&LLLandmarksPanel::onCustomAction, this, _2));
- mCommitCallbackRegistrar.add("Places.LandmarksGear.Folding.Action", boost::bind(&LLLandmarksPanel::onFoldingAction, this, _2));
+ mCommitCallbackRegistrar.add("Places.LandmarksGear.Add.Action", { boost::bind(&LLLandmarksPanel::onAddAction, this, _2) });
+ mCommitCallbackRegistrar.add("Places.LandmarksGear.CopyPaste.Action", { boost::bind(&LLLandmarksPanel::onClipboardAction, this, _2) });
+ mCommitCallbackRegistrar.add("Places.LandmarksGear.Custom.Action", { boost::bind(&LLLandmarksPanel::onCustomAction, this, _2) });
+ mCommitCallbackRegistrar.add("Places.LandmarksGear.Folding.Action", { boost::bind(&LLLandmarksPanel::onFoldingAction, this, _2)} );
mEnableCallbackRegistrar.add("Places.LandmarksGear.Check", boost::bind(&LLLandmarksPanel::isActionChecked, this, _2));
mEnableCallbackRegistrar.add("Places.LandmarksGear.Enable", boost::bind(&LLLandmarksPanel::isActionEnabled, this, _2));
mGearLandmarkMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_places_gear_landmark.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index ed80c8b732..cae11a942c 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -81,15 +81,16 @@ bool LLPanelLogin::sCredentialSet = false;
LLPointer<LLCredential> load_user_credentials(std::string &user_key)
{
- if (gSecAPIHandler->hasCredentialMap("login_list", LLGridManager::getInstance()->getGrid()))
+ std::string grid{ LLGridManager::instance().getGrid() };
+ if (gSecAPIHandler->hasCredentialMap("login_list", grid))
{
// user_key should be of "name Resident" format
- return gSecAPIHandler->loadFromCredentialMap("login_list", LLGridManager::getInstance()->getGrid(), user_key);
+ return gSecAPIHandler->loadFromCredentialMap("login_list", grid, user_key);
}
else
{
// legacy (or legacy^2, since it also tries to load from settings)
- return gSecAPIHandler->loadCredential(LLGridManager::getInstance()->getGrid());
+ return gSecAPIHandler->loadCredential(grid);
}
}
@@ -223,7 +224,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
sendChildToBack(getChildView("forgot_password_text"));
sendChildToBack(getChildView("sign_up_text"));
- std::string current_grid = LLGridManager::getInstance()->getGrid();
+ LLGridManager& gridmgr{ LLGridManager::instance() };
+ std::string current_grid = gridmgr.getGrid();
if (!mFirstLoginThisInstall)
{
LLComboBox* favorites_combo = getChild<LLComboBox>("start_location_combo");
@@ -237,7 +239,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
// Load all of the grids, sorted, and then add a bar and the current grid at the top
server_choice_combo->removeall();
- std::map<std::string, std::string> known_grids = LLGridManager::getInstance()->getKnownGrids();
+ std::map<std::string, std::string> known_grids = gridmgr.getKnownGrids();
for (std::map<std::string, std::string>::iterator grid_choice = known_grids.begin();
grid_choice != known_grids.end();
grid_choice++)
@@ -251,7 +253,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
server_choice_combo->sortByName();
LL_DEBUGS("AppInit") << "adding current " << current_grid << LL_ENDL;
- server_choice_combo->add(LLGridManager::getInstance()->getGridLabel(),
+ server_choice_combo->add(gridmgr.getGridLabel(),
current_grid,
ADD_TOP);
server_choice_combo->selectFirstItem();
@@ -760,6 +762,7 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl)
LL_DEBUGS("AppInit")<<new_start_slurl.asString()<<LL_ENDL;
LLComboBox* location_combo = sInstance->getChild<LLComboBox>("start_location_combo");
+ LLGridManager& gridmgr{ LLGridManager::instance() };
/*
* Determine whether or not the new_start_slurl modifies the grid.
*
@@ -774,17 +777,17 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl)
{
case LLSLURL::LOCATION:
{
- std::string slurl_grid = LLGridManager::getInstance()->getGrid(new_start_slurl.getGrid());
+ std::string slurl_grid = gridmgr.getGrid(new_start_slurl.getGrid());
if ( ! slurl_grid.empty() ) // is that a valid grid?
{
- if ( slurl_grid != LLGridManager::getInstance()->getGrid() ) // new grid?
+ if ( slurl_grid != gridmgr.getGrid() ) // new grid?
{
// the slurl changes the grid, so update everything to match
- LLGridManager::getInstance()->setGridChoice(slurl_grid);
+ gridmgr.setGridChoice(slurl_grid);
// update the grid selector to match the slurl
LLComboBox* server_combo = sInstance->getChild<LLComboBox>("server_combo");
- std::string server_label(LLGridManager::getInstance()->getGridLabel(slurl_grid));
+ std::string server_label(gridmgr.getGridLabel(slurl_grid));
server_combo->setSimple(server_label);
updateServer(); // to change the links and splash screen
@@ -831,8 +834,7 @@ void LLPanelLogin::autologinToLocation(const LLSLURL& slurl)
if ( LLPanelLogin::sInstance != NULL )
{
- void* unused_parameter = 0;
- LLPanelLogin::sInstance->onClickConnect(unused_parameter);
+ LLPanelLogin::sInstance->onClickConnect(false);
}
}
@@ -872,7 +874,8 @@ void LLPanelLogin::loadLoginPage()
{
if (!sInstance) return;
- LLURI login_page = LLURI(LLGridManager::getInstance()->getLoginPage());
+ LLGridManager& gridmgr{ LLGridManager::instance() };
+ LLURI login_page = LLURI(gridmgr.getLoginPage());
LLSD params(login_page.queryMap());
LL_DEBUGS("AppInit") << "login_page: " << login_page << LL_ENDL;
@@ -899,7 +902,7 @@ void LLPanelLogin::loadLoginPage()
params["channel"] = LLVersionInfo::instance().getChannel();
// Grid
- params["grid"] = LLGridManager::getInstance()->getGridId();
+ params["grid"] = gridmgr.getGridId();
// add OS info
params["os"] = LLOSInfo::instance().getOSStringSimple();
@@ -916,7 +919,7 @@ void LLPanelLogin::loadLoginPage()
login_page.path(),
params));
- gViewerWindow->setMenuBackgroundColor(false, !LLGridManager::getInstance()->isInProductionGrid());
+ gViewerWindow->setMenuBackgroundColor(false, !gridmgr.isInProductionGrid());
LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
if (web_browser->getCurrentNavUrl() != login_uri.asString())
@@ -949,9 +952,10 @@ void LLPanelLogin::onClickConnect(bool commit_fields)
// the grid definitions may come from a user-supplied grids.xml, so they may not be good
LL_DEBUGS("AppInit")<<"grid "<<combo_val.asString()<<LL_ENDL;
+ LLGridManager& gridmgr{ LLGridManager::instance() };
try
{
- LLGridManager::getInstance()->setGridChoice(combo_val.asString());
+ gridmgr.setGridChoice(combo_val.asString());
}
catch (LLInvalidGridName ex)
{
@@ -984,7 +988,7 @@ void LLPanelLogin::onClickConnect(bool commit_fields)
std::string identifier_type;
cred->identifierType(identifier_type);
LLSD allowed_credential_types;
- LLGridManager::getInstance()->getLoginIdentifierTypes(allowed_credential_types);
+ gridmgr.getLoginIdentifierTypes(allowed_credential_types);
// check the typed in credential type against the credential types expected by the server.
for(LLSD::array_iterator i = allowed_credential_types.beginArray();
@@ -1133,6 +1137,7 @@ void LLPanelLogin::updateServer()
{
if (sInstance)
{
+ LLGridManager& gridmgr{ LLGridManager::instance() };
try
{
// if they've selected another grid, we should load the credentials
@@ -1152,7 +1157,7 @@ void LLPanelLogin::updateServer()
// populate dropbox and setFields
// Note: following call is related to initializeLoginInfo()
- LLPointer<LLCredential> credential = gSecAPIHandler->loadCredential(LLGridManager::getInstance()->getGrid());
+ LLPointer<LLCredential> credential = gSecAPIHandler->loadCredential(gridmgr.getGrid());
sInstance->populateUserList(credential);
// restore creds
@@ -1165,12 +1170,12 @@ void LLPanelLogin::updateServer()
{
// populate dropbox and setFields
// Note: following call is related to initializeLoginInfo()
- LLPointer<LLCredential> credential = gSecAPIHandler->loadCredential(LLGridManager::getInstance()->getGrid());
+ LLPointer<LLCredential> credential = gSecAPIHandler->loadCredential(gridmgr.getGrid());
sInstance->populateUserList(credential);
}
// update the login panel links
- bool system_grid = LLGridManager::getInstance()->isSystemGrid();
+ bool system_grid = gridmgr.isSystemGrid();
// Want to vanish not only create_new_account_btn, but also the
// title text over it, so turn on/off the whole layout_panel element.
@@ -1219,11 +1224,12 @@ void LLPanelLogin::populateUserList(LLPointer<LLCredential> credential)
getChild<LLUICtrl>("password_edit")->setValue(std::string());
mUsernameLength = 0;
mPasswordLength = 0;
+ std::string grid{ LLGridManager::instance().getGrid() };
- if (gSecAPIHandler->hasCredentialMap("login_list", LLGridManager::getInstance()->getGrid()))
+ if (gSecAPIHandler->hasCredentialMap("login_list", grid))
{
LLSecAPIHandler::credential_map_t credencials;
- gSecAPIHandler->loadCredentialMap("login_list", LLGridManager::getInstance()->getGrid(), credencials);
+ gSecAPIHandler->loadCredentialMap("login_list", grid, credencials);
LLSecAPIHandler::credential_map_t::iterator cr_iter = credencials.begin();
LLSecAPIHandler::credential_map_t::iterator cr_end = credencials.end();
@@ -1278,7 +1284,8 @@ void LLPanelLogin::onSelectServer()
LLComboBox* server_combo = getChild<LLComboBox>("server_combo");
LLSD server_combo_val = server_combo->getSelectedValue();
LL_INFOS("AppInit") << "grid "<<server_combo_val.asString()<< LL_ENDL;
- LLGridManager::getInstance()->setGridChoice(server_combo_val.asString());
+ auto& gridmgr{ LLGridManager::instance() };
+ gridmgr.setGridChoice(server_combo_val.asString());
addFavoritesToStartLocation();
/*
@@ -1308,7 +1315,7 @@ void LLPanelLogin::onSelectServer()
LLSLURL slurl(location); // generata a slurl from the location combo contents
if (location.empty()
|| (slurl.getType() == LLSLURL::LOCATION
- && slurl.getGrid() != LLGridManager::getInstance()->getGrid())
+ && slurl.getGrid() != gridmgr.getGrid())
)
{
// the grid specified by the location is not this one, so clear the combo
@@ -1338,7 +1345,7 @@ bool LLPanelLogin::getShowFavorites()
}
// static
-std::string LLPanelLogin::getUserName(LLPointer<LLCredential> &cred)
+std::string LLPanelLogin::getUserName(const LLPointer<LLCredential> &cred)
{
if (cred.isNull())
{
diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h
index a1bf25fb05..ce708e7a0e 100644
--- a/indra/newview/llpanellogin.h
+++ b/indra/newview/llpanellogin.h
@@ -85,7 +85,7 @@ public:
static bool getShowFavorites();
// extract name from cred in a format apropriate for username field
- static std::string getUserName(LLPointer<LLCredential> &cred);
+ static std::string getUserName(const LLPointer<LLCredential> &cred);
private:
friend class LLPanelLoginListener;
diff --git a/indra/newview/llpanelloginlistener.cpp b/indra/newview/llpanelloginlistener.cpp
index fb6f034b7f..aeaf2d1d00 100644
--- a/indra/newview/llpanelloginlistener.cpp
+++ b/indra/newview/llpanelloginlistener.cpp
@@ -32,9 +32,19 @@
#include "llpanelloginlistener.h"
// STL headers
// std headers
+#include <iomanip>
+#include <memory>
// external library headers
// other Linden headers
+#include "llcombobox.h"
#include "llpanellogin.h"
+#include "llsdutil.h"
+#include "llsecapi.h"
+#include "llslurl.h"
+#include "llstartup.h"
+#include "lluictrl.h"
+#include "llviewernetwork.h"
+#include "stringize.h"
LLPanelLoginListener::LLPanelLoginListener(LLPanelLogin* instance):
LLEventAPI("LLPanelLogin", "Access to LLPanelLogin methods"),
@@ -43,9 +53,195 @@ LLPanelLoginListener::LLPanelLoginListener(LLPanelLogin* instance):
add("onClickConnect",
"Pretend user clicked the \"Log In\" button",
&LLPanelLoginListener::onClickConnect);
+ add("login",
+ "Login to Second Life with saved credentials.\n"
+ "Pass [\"username\"] to select credentials previously saved with that username.\n"
+ "Pass [\"slurl\"] to specify target location.\n"
+ "Pass [\"grid\"] to select one of the valid grids in grids.xml.",
+ &LLPanelLoginListener::login,
+ llsd::map("reply", LLSD::String()));
+ add("savedLogins",
+ "Return \"logins\" as a list of {} saved login names.\n"
+ "Pass [\"grid\"] to select one of the valid grids in grids.xml.",
+ &LLPanelLoginListener::savedLogins,
+ llsd::map("reply", LLSD::String()));
}
void LLPanelLoginListener::onClickConnect(const LLSD&) const
{
mPanel->onClickConnect(false);
}
+
+namespace
+{
+
+ std::string gridkey(const std::string& grid)
+ {
+ if (grid.find('.') != std::string::npos)
+ {
+ return grid;
+ }
+ else
+ {
+ return stringize("util.", grid, ".lindenlab.com");
+ }
+ }
+
+} // anonymous namespace
+
+void LLPanelLoginListener::login(const LLSD& args) const
+{
+ // Although we require a "reply" key, don't instantiate a Response object:
+ // if things go well, response to our invoker will come later, once the
+ // viewer gets the response from the login server.
+ std::string username(args["username"]), slurlstr(args["slurl"]), grid(args["grid"]);
+ LL_DEBUGS("AppInit") << "Login with saved credentials";
+ if (! username.empty())
+ {
+ LL_CONT << " for user " << std::quoted(username);
+ }
+ if (! slurlstr.empty())
+ {
+ LL_CONT << " to location " << std::quoted(slurlstr);
+ }
+ if (! grid.empty())
+ {
+ LL_CONT << " on grid " << std::quoted(grid);
+ }
+ LL_CONT << LL_ENDL;
+
+ // change grid first, allowing slurl to override
+ auto& gridmgr{ LLGridManager::instance() };
+ if (! grid.empty())
+ {
+ grid = gridkey(grid);
+ // setGridChoice() can throw LLInvalidGridName -- but if so, let it
+ // propagate, trusting that LLEventAPI will catch it and send an
+ // appropriate reply.
+ auto server_combo = mPanel->getChild<LLComboBox>("server_combo");
+ server_combo->setSimple(gridmgr.getGridLabel(grid));
+ LLPanelLogin::updateServer();
+ }
+ if (! slurlstr.empty())
+ {
+ LLSLURL slurl(slurlstr);
+ if (! slurl.isSpatial())
+ {
+ // don't bother with LLTHROW() because we expect LLEventAPI to
+ // catch and report back to invoker
+ throw DispatchError(stringize("Invalid start SLURL ", std::quoted(slurlstr)));
+ }
+ // Bypass LLStartUp::setStartSLURL() because, after validating as
+ // above, it bounces right back to LLPanelLogin::onUpdateStartSLURL().
+ // It also sets the "NextLoginLocation" user setting, but as with grid,
+ // we don't yet know whether that's desirable for scripted login.
+ LLPanelLogin::onUpdateStartSLURL(slurl);
+ }
+ if (! username.empty())
+ {
+ // Transform (e.g.) "Nat Linden" to the internal form expected by
+ // loadFromCredentialMap(), e.g. "nat_linden"
+ LLStringUtil::toLower(username);
+ LLStringUtil::replaceChar(username, ' ', '_');
+ LLStringUtil::replaceChar(username, '.', '_');
+
+ // call gridmgr.getGrid() because our caller didn't necessarily pass
+ // ["grid"] -- or it might have been overridden by the SLURL
+ auto cred = gSecAPIHandler->loadFromCredentialMap("login_list",
+ gridmgr.getGrid(),
+ username);
+ LLPanelLogin::setFields(cred);
+ }
+
+ if (mPanel->getChild<LLUICtrl>("username_combo")->getValue().asString().empty() ||
+ mPanel->getChild<LLUICtrl>("password_edit") ->getValue().asString().empty())
+ {
+ // as above, let LLEventAPI report back to invoker
+ throw DispatchError(stringize("Unrecognized username ", std::quoted(username)));
+ }
+
+ // Here we're about to trigger actual login, which is all we can do in
+ // this method. All subsequent responses must come via the "login"
+ // LLEventPump.
+ LLEventPumps::instance().obtain("login").listen(
+ "Lua login",
+ [args]
+ (const LLBoundListener& conn, const LLSD& update)
+ {
+ LLSD response{ llsd::map("ok", false) };
+ if (update["change"] == "connect")
+ {
+ // success!
+ response["ok"] = true;
+ }
+ else if (update["change"] == "disconnect")
+ {
+ // Does this ever actually happen?
+ // LLLoginInstance::handleDisconnect() says it's a placeholder.
+ response["error"] = "login disconnect";
+ }
+ else if (update["change"] == "fail.login")
+ {
+ // why?
+ // LLLoginInstance::handleLoginFailure() has special code to
+ // handle "tos", "update" and "mfa_challenge". Do not respond
+ // automatically because these things are SUPPOSED to engage
+ // the user.
+ // Copy specific response fields because there's an enormous
+ // chunk of stuff that comes back on success.
+ LLSD data{ update["data"] };
+ const char* fields[] = {
+ "reason",
+ "error_code"
+ };
+ for (auto field : fields)
+ {
+ response[field] = data[field];
+ }
+ response["error"] = update["message"];
+ }
+ else
+ {
+ // Ignore all other "change" values: LLLogin sends multiple update
+ // events. Only a few of them (above) indicate completion.
+ return;
+ }
+ // For all the completion cases, disconnect from the "login"
+ // LLEventPump.
+ conn.disconnect();
+ // and at last, send response to the original invoker
+ sendReply(response, args);
+ });
+
+ // Turn the Login crank.
+ mPanel->onClickConnect(false);
+}
+
+LLSD LLPanelLoginListener::savedLogins(const LLSD& args) const
+{
+ LL_INFOS() << "called with " << args << LL_ENDL;
+ std::string grid = (args.has("grid")? gridkey(args["grid"].asString())
+ : LLGridManager::instance().getGrid());
+ if (! gSecAPIHandler->hasCredentialMap("login_list", grid))
+ {
+ LL_INFOS() << "no creds for " << grid << LL_ENDL;
+ return llsd::map("error",
+ stringize("No saved logins for grid ", std::quoted(grid)));
+ }
+ LLSecAPIHandler::credential_map_t creds;
+ gSecAPIHandler->loadCredentialMap("login_list", grid, creds);
+ auto result = llsd::map(
+ "logins",
+ llsd::toArray(
+ creds,
+ [](const auto& pair)
+ {
+ return llsd::map(
+ "name",
+ LLPanelLogin::getUserName(pair.second),
+ "key",
+ pair.first);
+ }));
+ LL_INFOS() << "returning creds " << result << LL_ENDL;
+ return result;
+}
diff --git a/indra/newview/llpanelloginlistener.h b/indra/newview/llpanelloginlistener.h
index b552ccd5b0..f2f4d70ff9 100644
--- a/indra/newview/llpanelloginlistener.h
+++ b/indra/newview/llpanelloginlistener.h
@@ -40,6 +40,8 @@ public:
private:
void onClickConnect(const LLSD&) const;
+ void login(const LLSD&) const;
+ LLSD savedLogins(const LLSD&) const;
LLPanelLogin* mPanel;
};
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 377af4384a..48f32a05ba 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -78,9 +78,9 @@ static LLPanelInjector<LLPanelMainInventory> t_inventory("panel_main_inventory")
class LLFloaterInventoryFinder : public LLFloater
{
public:
- LLFloaterInventoryFinder( LLPanelMainInventory* inventory_view);
- virtual void draw();
- /*virtual*/ bool postBuild();
+ LLFloaterInventoryFinder(LLPanelMainInventory* inventory_view);
+ void draw();
+ bool postBuild();
void changeFilter(LLInventoryFilter* filter);
void updateElementsFromFilter();
bool getCheckShowEmpty();
@@ -90,17 +90,35 @@ public:
void onCreatorSelfFilterCommit();
void onCreatorOtherFilterCommit();
- static void onTimeAgo(LLUICtrl*, void *);
- static void onCloseBtn(void* user_data);
- static void selectAllTypes(void* user_data);
- static void selectNoTypes(void* user_data);
+ void onTimeAgo();
+ void onCloseBtn();
+ void selectAllTypes();
+ void selectNoTypes();
private:
- LLPanelMainInventory* mPanelMainInventory;
- LLSpinCtrl* mSpinSinceDays;
- LLSpinCtrl* mSpinSinceHours;
- LLCheckBoxCtrl* mCreatorSelf;
- LLCheckBoxCtrl* mCreatorOthers;
- LLInventoryFilter* mFilter;
+ LLPanelMainInventory* mPanelMainInventory{ nullptr };
+ LLSpinCtrl* mSpinSinceDays{ nullptr };
+ LLSpinCtrl* mSpinSinceHours{ nullptr };
+ LLCheckBoxCtrl* mCreatorSelf{ nullptr };
+ LLCheckBoxCtrl* mCreatorOthers{ nullptr };
+ LLInventoryFilter* mFilter{ nullptr };
+
+ LLCheckBoxCtrl* mCheckAnimation{ nullptr };
+ LLCheckBoxCtrl* mCheckCallingCard{ nullptr };
+ LLCheckBoxCtrl* mCheckClothing{ nullptr };
+ LLCheckBoxCtrl* mCheckGesture{ nullptr };
+ LLCheckBoxCtrl* mCheckLandmark{ nullptr };
+ LLCheckBoxCtrl* mCheckMaterial{ nullptr };
+ LLCheckBoxCtrl* mCheckNotecard{ nullptr };
+ LLCheckBoxCtrl* mCheckObject{ nullptr };
+ LLCheckBoxCtrl* mCheckScript{ nullptr };
+ LLCheckBoxCtrl* mCheckSounds{ nullptr };
+ LLCheckBoxCtrl* mCheckTexture{ nullptr };
+ LLCheckBoxCtrl* mCheckSnapshot{ nullptr };
+ LLCheckBoxCtrl* mCheckSettings{ nullptr };
+ LLCheckBoxCtrl* mCheckShowEmpty{ nullptr };
+ LLCheckBoxCtrl* mCheckSinceLogoff{ nullptr };
+
+ LLRadioGroup* mRadioDateSearchDirection{ nullptr };
};
///----------------------------------------------------------------------------
@@ -125,14 +143,16 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p)
mGalleryRootUpdatedConnection()
{
// Menu Callbacks (non contex menus)
- mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLPanelMainInventory::doToSelected, this, _2));
- mCommitCallbackRegistrar.add("Inventory.CloseAllFolders", boost::bind(&LLPanelMainInventory::closeAllFolders, this));
- mCommitCallbackRegistrar.add("Inventory.EmptyTrash", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyTrash", LLFolderType::FT_TRASH));
- mCommitCallbackRegistrar.add("Inventory.EmptyLostAndFound", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyLostAndFound", LLFolderType::FT_LOST_AND_FOUND));
- mCommitCallbackRegistrar.add("Inventory.DoCreate", boost::bind(&LLPanelMainInventory::doCreate, this, _2));
- mCommitCallbackRegistrar.add("Inventory.ShowFilters", boost::bind(&LLPanelMainInventory::toggleFindOptions, this));
- mCommitCallbackRegistrar.add("Inventory.ResetFilters", boost::bind(&LLPanelMainInventory::resetFilters, this));
- mCommitCallbackRegistrar.add("Inventory.SetSortBy", boost::bind(&LLPanelMainInventory::setSortBy, this, _2));
+ mCommitCallbackRegistrar.add("Inventory.DoToSelected", { boost::bind(&LLPanelMainInventory::doToSelected, this, _2), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.CloseAllFolders", { boost::bind(&LLPanelMainInventory::closeAllFolders, this) });
+ mCommitCallbackRegistrar.add("Inventory.EmptyTrash", { boost::bind(&LLInventoryModel::emptyFolderType, &gInventory,
+ "ConfirmEmptyTrash", LLFolderType::FT_TRASH), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.EmptyLostAndFound", { boost::bind(&LLInventoryModel::emptyFolderType, &gInventory,
+ "ConfirmEmptyLostAndFound", LLFolderType::FT_LOST_AND_FOUND), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.DoCreate", { boost::bind(&LLPanelMainInventory::doCreate, this, _2) });
+ mCommitCallbackRegistrar.add("Inventory.ShowFilters", { boost::bind(&LLPanelMainInventory::toggleFindOptions, this) });
+ mCommitCallbackRegistrar.add("Inventory.ResetFilters", { boost::bind(&LLPanelMainInventory::resetFilters, this) });
+ mCommitCallbackRegistrar.add("Inventory.SetSortBy", { boost::bind(&LLPanelMainInventory::setSortBy, this, _2) });
mEnableCallbackRegistrar.add("Inventory.EnvironmentEnabled", [](LLUICtrl *, const LLSD &) { return LLPanelMainInventory::hasSettingsInventory(); });
mEnableCallbackRegistrar.add("Inventory.MaterialsEnabled", [](LLUICtrl *, const LLSD &) { return LLPanelMainInventory::hasMaterialsInventory(); });
@@ -734,7 +754,6 @@ bool LLPanelMainInventory::filtersVisible(void* user_data)
void LLPanelMainInventory::onClearSearch()
{
bool initially_active = false;
- LLFloater *finder = getFinder();
if (mActivePanel && (getActivePanel() != mWornItemsPanel))
{
initially_active = mActivePanel->getFilter().isNotDefault();
@@ -743,9 +762,9 @@ void LLPanelMainInventory::onClearSearch()
mActivePanel->setFilterLinks(LLInventoryFilter::FILTERLINK_INCLUDE_LINKS);
}
- if (finder)
+ if (LLFloaterInventoryFinder* finder = getFinder())
{
- LLFloaterInventoryFinder::selectAllTypes(finder);
+ finder->selectAllTypes();
}
// re-open folders that were initially open in case filter was active
@@ -1145,36 +1164,53 @@ bool LLFloaterInventoryFinder::postBuild()
const LLRect& viewrect = mPanelMainInventory->getRect();
setRect(LLRect(viewrect.mLeft - getRect().getWidth(), viewrect.mTop, viewrect.mLeft, viewrect.mTop - getRect().getHeight()));
- childSetAction("All", selectAllTypes, this);
- childSetAction("None", selectNoTypes, this);
+ childSetAction("All", [this](LLUICtrl*, const LLSD&) { selectAllTypes(); });
+ childSetAction("None", [this](LLUICtrl*, const LLSD&) { selectNoTypes(); });
mSpinSinceHours = getChild<LLSpinCtrl>("spin_hours_ago");
- childSetCommitCallback("spin_hours_ago", onTimeAgo, this);
+ mSpinSinceHours->setCommitCallback([this](LLUICtrl*, const LLSD&) { onTimeAgo(); });
mSpinSinceDays = getChild<LLSpinCtrl>("spin_days_ago");
- childSetCommitCallback("spin_days_ago", onTimeAgo, this);
+ mSpinSinceDays->setCommitCallback([this](LLUICtrl*, const LLSD&) { onTimeAgo(); });
mCreatorSelf = getChild<LLCheckBoxCtrl>("check_created_by_me");
mCreatorOthers = getChild<LLCheckBoxCtrl>("check_created_by_others");
mCreatorSelf->setCommitCallback(boost::bind(&LLFloaterInventoryFinder::onCreatorSelfFilterCommit, this));
mCreatorOthers->setCommitCallback(boost::bind(&LLFloaterInventoryFinder::onCreatorOtherFilterCommit, this));
- childSetAction("Close", onCloseBtn, this);
+ mCheckAnimation = getChild<LLCheckBoxCtrl>("check_animation");
+ mCheckCallingCard = getChild<LLCheckBoxCtrl>("check_calling_card");
+ mCheckClothing = getChild<LLCheckBoxCtrl>("check_clothing");
+ mCheckGesture = getChild<LLCheckBoxCtrl>("check_gesture");
+ mCheckLandmark = getChild<LLCheckBoxCtrl>("check_landmark");
+ mCheckMaterial = getChild<LLCheckBoxCtrl>("check_material");
+ mCheckNotecard = getChild<LLCheckBoxCtrl>("check_notecard");
+ mCheckObject = getChild<LLCheckBoxCtrl>("check_object");
+ mCheckScript = getChild<LLCheckBoxCtrl>("check_script");
+ mCheckSounds = getChild<LLCheckBoxCtrl>("check_sound");
+ mCheckTexture = getChild<LLCheckBoxCtrl>("check_texture");
+ mCheckSnapshot = getChild<LLCheckBoxCtrl>("check_snapshot");
+ mCheckSettings = getChild<LLCheckBoxCtrl>("check_settings");
+ mCheckShowEmpty = getChild<LLCheckBoxCtrl>("check_show_empty");
+ mCheckSinceLogoff = getChild<LLCheckBoxCtrl>("check_since_logoff");
+
+ mRadioDateSearchDirection = getChild<LLRadioGroup>("date_search_direction");
+
+ childSetAction("Close", [this](LLUICtrl*, const LLSD&) { onCloseBtn(); });
updateElementsFromFilter();
+
return true;
}
-void LLFloaterInventoryFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data)
-{
- LLFloaterInventoryFinder *self = (LLFloaterInventoryFinder *)user_data;
- if (!self) return;
- if ( self->mSpinSinceDays->get() || self->mSpinSinceHours->get() )
+void LLFloaterInventoryFinder::onTimeAgo()
+{
+ if (mSpinSinceDays->get() || mSpinSinceHours->get())
{
- self->getChild<LLUICtrl>("check_since_logoff")->setValue(false);
+ mCheckSinceLogoff->setValue(false);
- U32 days = (U32)self->mSpinSinceDays->get();
- U32 hours = (U32)self->mSpinSinceHours->get();
+ U32 days = (U32)mSpinSinceDays->get();
+ U32 hours = (U32)mSpinSinceHours->get();
if (hours >= 24)
{
// Try to handle both cases of spinner clicking and text input in a sensible fashion as best as possible.
@@ -1190,11 +1226,11 @@ void LLFloaterInventoryFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data)
days = hours / 24;
}
hours = (U32)hours % 24;
- self->mSpinSinceHours->setFocus(false);
- self->mSpinSinceDays->setFocus(false);
- self->mSpinSinceDays->set((F32)days);
- self->mSpinSinceHours->set((F32)hours);
- self->mSpinSinceHours->setFocus(true);
+ mSpinSinceHours->setFocus(false);
+ mSpinSinceDays->setFocus(false);
+ mSpinSinceDays->set((F32)days);
+ mSpinSinceHours->set((F32)hours);
+ mSpinSinceHours->setFocus(true);
}
}
}
@@ -1223,29 +1259,28 @@ void LLFloaterInventoryFinder::updateElementsFromFilter()
// update the ui elements
setTitle(mFilter->getName());
- getChild<LLUICtrl>("check_animation")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_ANIMATION));
-
- getChild<LLUICtrl>("check_calling_card")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_CALLINGCARD));
- getChild<LLUICtrl>("check_clothing")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_WEARABLE));
- getChild<LLUICtrl>("check_gesture")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_GESTURE));
- getChild<LLUICtrl>("check_landmark")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_LANDMARK));
- getChild<LLUICtrl>("check_material")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_MATERIAL));
- getChild<LLUICtrl>("check_notecard")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_NOTECARD));
- getChild<LLUICtrl>("check_object")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_OBJECT));
- getChild<LLUICtrl>("check_script")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_LSL));
- getChild<LLUICtrl>("check_sound")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_SOUND));
- getChild<LLUICtrl>("check_texture")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_TEXTURE));
- getChild<LLUICtrl>("check_snapshot")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_SNAPSHOT));
- getChild<LLUICtrl>("check_settings")->setValue((S32)(filter_types & 0x1 << LLInventoryType::IT_SETTINGS));
- getChild<LLUICtrl>("check_show_empty")->setValue(show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS);
-
- getChild<LLUICtrl>("check_created_by_me")->setValue(show_created_by_me);
- getChild<LLUICtrl>("check_created_by_others")->setValue(show_created_by_others);
-
- getChild<LLUICtrl>("check_since_logoff")->setValue(mFilter->isSinceLogoff());
+ mCheckAnimation->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_ANIMATION));
+ mCheckCallingCard->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_CALLINGCARD));
+ mCheckClothing->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_WEARABLE));
+ mCheckGesture->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_GESTURE));
+ mCheckLandmark->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_LANDMARK));
+ mCheckMaterial->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_MATERIAL));
+ mCheckNotecard->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_NOTECARD));
+ mCheckObject->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_OBJECT));
+ mCheckScript->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_LSL));
+ mCheckSounds->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_SOUND));
+ mCheckTexture->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_TEXTURE));
+ mCheckSnapshot->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_SNAPSHOT));
+ mCheckSettings->setValue((S32)(filter_types & 0x1 << LLInventoryType::IT_SETTINGS));
+ mCheckShowEmpty->setValue(show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS);
+
+ mCreatorSelf->setValue(show_created_by_me);
+ mCreatorOthers->setValue(show_created_by_others);
+
+ mCheckSinceLogoff->setValue(mFilter->isSinceLogoff());
mSpinSinceHours->set((F32)(hours % 24));
mSpinSinceDays->set((F32)(hours / 24));
- getChild<LLRadioGroup>("date_search_direction")->setSelectedIndex(date_search_direction);
+ mRadioDateSearchDirection->setSelectedIndex(date_search_direction);
}
void LLFloaterInventoryFinder::draw()
@@ -1253,80 +1288,80 @@ void LLFloaterInventoryFinder::draw()
U64 filter = 0xffffffffffffffffULL;
bool filtered_by_all_types = true;
- if (!getChild<LLUICtrl>("check_animation")->getValue())
+ if (!mCheckAnimation->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_ANIMATION);
filtered_by_all_types = false;
}
- if (!getChild<LLUICtrl>("check_calling_card")->getValue())
+ if (!mCheckCallingCard->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_CALLINGCARD);
filtered_by_all_types = false;
}
- if (!getChild<LLUICtrl>("check_clothing")->getValue())
+ if (!mCheckClothing->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_WEARABLE);
filtered_by_all_types = false;
}
- if (!getChild<LLUICtrl>("check_gesture")->getValue())
+ if (!mCheckGesture->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_GESTURE);
filtered_by_all_types = false;
}
- if (!getChild<LLUICtrl>("check_landmark")->getValue())
+ if (!mCheckLandmark->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_LANDMARK);
filtered_by_all_types = false;
}
- if (!getChild<LLUICtrl>("check_material")->getValue())
+ if (!mCheckMaterial->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_MATERIAL);
filtered_by_all_types = false;
}
- if (!getChild<LLUICtrl>("check_notecard")->getValue())
+ if (!mCheckNotecard->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_NOTECARD);
filtered_by_all_types = false;
}
- if (!getChild<LLUICtrl>("check_object")->getValue())
+ if (!mCheckObject->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_OBJECT);
filter &= ~(0x1 << LLInventoryType::IT_ATTACHMENT);
filtered_by_all_types = false;
}
- if (!getChild<LLUICtrl>("check_script")->getValue())
+ if (!mCheckScript->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_LSL);
filtered_by_all_types = false;
}
- if (!getChild<LLUICtrl>("check_sound")->getValue())
+ if (!mCheckSounds->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_SOUND);
filtered_by_all_types = false;
}
- if (!getChild<LLUICtrl>("check_texture")->getValue())
+ if (!mCheckTexture->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_TEXTURE);
filtered_by_all_types = false;
}
- if (!getChild<LLUICtrl>("check_snapshot")->getValue())
+ if (!mCheckSnapshot->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_SNAPSHOT);
filtered_by_all_types = false;
}
- if (!getChild<LLUICtrl>("check_settings")->getValue())
+ if (!mCheckSettings->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_SETTINGS);
filtered_by_all_types = false;
@@ -1444,65 +1479,56 @@ void LLFloaterInventoryFinder::onCreatorOtherFilterCommit()
bool LLFloaterInventoryFinder::getCheckShowEmpty()
{
- return getChild<LLUICtrl>("check_show_empty")->getValue();
+ return mCheckShowEmpty->getValue();
}
bool LLFloaterInventoryFinder::getCheckSinceLogoff()
{
- return getChild<LLUICtrl>("check_since_logoff")->getValue();
+ return mCheckSinceLogoff->getValue();
}
U32 LLFloaterInventoryFinder::getDateSearchDirection()
{
- return getChild<LLRadioGroup>("date_search_direction")->getSelectedIndex();
+ return mRadioDateSearchDirection->getSelectedIndex();
}
-void LLFloaterInventoryFinder::onCloseBtn(void* user_data)
+void LLFloaterInventoryFinder::onCloseBtn()
{
- LLFloaterInventoryFinder* finderp = (LLFloaterInventoryFinder*)user_data;
- finderp->closeFloater();
+ closeFloater();
}
-// static
-void LLFloaterInventoryFinder::selectAllTypes(void* user_data)
-{
- LLFloaterInventoryFinder* self = (LLFloaterInventoryFinder*)user_data;
- if(!self) return;
-
- self->getChild<LLUICtrl>("check_animation")->setValue(true);
- self->getChild<LLUICtrl>("check_calling_card")->setValue(true);
- self->getChild<LLUICtrl>("check_clothing")->setValue(true);
- self->getChild<LLUICtrl>("check_gesture")->setValue(true);
- self->getChild<LLUICtrl>("check_landmark")->setValue(true);
- self->getChild<LLUICtrl>("check_material")->setValue(true);
- self->getChild<LLUICtrl>("check_notecard")->setValue(true);
- self->getChild<LLUICtrl>("check_object")->setValue(true);
- self->getChild<LLUICtrl>("check_script")->setValue(true);
- self->getChild<LLUICtrl>("check_sound")->setValue(true);
- self->getChild<LLUICtrl>("check_texture")->setValue(true);
- self->getChild<LLUICtrl>("check_snapshot")->setValue(true);
- self->getChild<LLUICtrl>("check_settings")->setValue(true);
+void LLFloaterInventoryFinder::selectAllTypes()
+{
+ mCheckAnimation->setValue(true);
+ mCheckCallingCard->setValue(true);
+ mCheckClothing->setValue(true);
+ mCheckGesture->setValue(true);
+ mCheckLandmark->setValue(true);
+ mCheckMaterial->setValue(true);
+ mCheckNotecard->setValue(true);
+ mCheckObject->setValue(true);
+ mCheckScript->setValue(true);
+ mCheckSounds->setValue(true);
+ mCheckTexture->setValue(true);
+ mCheckSnapshot->setValue(true);
+ mCheckSettings->setValue(true);
}
-//static
-void LLFloaterInventoryFinder::selectNoTypes(void* user_data)
-{
- LLFloaterInventoryFinder* self = (LLFloaterInventoryFinder*)user_data;
- if(!self) return;
-
- self->getChild<LLUICtrl>("check_animation")->setValue(false);
- self->getChild<LLUICtrl>("check_calling_card")->setValue(false);
- self->getChild<LLUICtrl>("check_clothing")->setValue(false);
- self->getChild<LLUICtrl>("check_gesture")->setValue(false);
- self->getChild<LLUICtrl>("check_landmark")->setValue(false);
- self->getChild<LLUICtrl>("check_material")->setValue(false);
- self->getChild<LLUICtrl>("check_notecard")->setValue(false);
- self->getChild<LLUICtrl>("check_object")->setValue(false);
- self->getChild<LLUICtrl>("check_script")->setValue(false);
- self->getChild<LLUICtrl>("check_sound")->setValue(false);
- self->getChild<LLUICtrl>("check_texture")->setValue(false);
- self->getChild<LLUICtrl>("check_snapshot")->setValue(false);
- self->getChild<LLUICtrl>("check_settings")->setValue(false);
+void LLFloaterInventoryFinder::selectNoTypes()
+{
+ mCheckAnimation->setValue(false);
+ mCheckCallingCard->setValue(false);
+ mCheckClothing->setValue(false);
+ mCheckGesture->setValue(false);
+ mCheckLandmark->setValue(false);
+ mCheckMaterial->setValue(false);
+ mCheckNotecard->setValue(false);
+ mCheckObject->setValue(false);
+ mCheckScript->setValue(false);
+ mCheckSounds->setValue(false);
+ mCheckTexture->setValue(false);
+ mCheckSnapshot->setValue(false);
+ mCheckSettings->setValue(false);
}
//////////////////////////////////////////////////////////////////////////////////
@@ -1516,7 +1542,7 @@ void LLPanelMainInventory::initListCommandsHandlers()
mBackBtn->setCommitCallback(boost::bind(&LLPanelMainInventory::onBackFolderClicked, this));
mForwardBtn->setCommitCallback(boost::bind(&LLPanelMainInventory::onForwardFolderClicked, this));
- mCommitCallbackRegistrar.add("Inventory.GearDefault.Custom.Action", boost::bind(&LLPanelMainInventory::onCustomAction, this, _2));
+ mCommitCallbackRegistrar.add("Inventory.GearDefault.Custom.Action", { boost::bind(&LLPanelMainInventory::onCustomAction, this, _2), cb_info::UNTRUSTED_BLOCK });
mEnableCallbackRegistrar.add("Inventory.GearDefault.Check", boost::bind(&LLPanelMainInventory::isActionChecked, this, _2));
mEnableCallbackRegistrar.add("Inventory.GearDefault.Enable", boost::bind(&LLPanelMainInventory::isActionEnabled, this, _2));
mEnableCallbackRegistrar.add("Inventory.GearDefault.Visible", boost::bind(&LLPanelMainInventory::isActionVisible, this, _2));
diff --git a/indra/newview/llpanelmediasettingssecurity.cpp b/indra/newview/llpanelmediasettingssecurity.cpp
index 6e4e9f426d..7041f7945d 100644
--- a/indra/newview/llpanelmediasettingssecurity.cpp
+++ b/indra/newview/llpanelmediasettingssecurity.cpp
@@ -49,8 +49,8 @@
LLPanelMediaSettingsSecurity::LLPanelMediaSettingsSecurity() :
mParent( NULL )
{
- mCommitCallbackRegistrar.add("Media.whitelistAdd", boost::bind(&LLPanelMediaSettingsSecurity::onBtnAdd, this));
- mCommitCallbackRegistrar.add("Media.whitelistDelete", boost::bind(&LLPanelMediaSettingsSecurity::onBtnDel, this));
+ mCommitCallbackRegistrar.add("Media.whitelistAdd", { boost::bind(&LLPanelMediaSettingsSecurity::onBtnAdd, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Media.whitelistDelete", { boost::bind(&LLPanelMediaSettingsSecurity::onBtnDel, this), cb_info::UNTRUSTED_BLOCK });
// build dialog from XML
buildFromFile( "panel_media_settings_security.xml");
diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp
index 2dd4866da3..86a88d6793 100644
--- a/indra/newview/llpanelnearbymedia.cpp
+++ b/indra/newview/llpanelnearbymedia.cpp
@@ -89,24 +89,24 @@ LLPanelNearByMedia::LLPanelNearByMedia()
gSavedSettings.getControl("ParcelMediaAutoPlayEnable")->getSignal()->connect(boost::bind(&LLPanelNearByMedia::handleMediaAutoPlayChanged, this, _2));
- mCommitCallbackRegistrar.add("MediaListCtrl.EnableAll", boost::bind(&LLPanelNearByMedia::onClickEnableAll, this));
- mCommitCallbackRegistrar.add("MediaListCtrl.DisableAll", boost::bind(&LLPanelNearByMedia::onClickDisableAll, this));
- mCommitCallbackRegistrar.add("MediaListCtrl.GoMediaPrefs", boost::bind(&LLPanelNearByMedia::onAdvancedButtonClick, this));
- mCommitCallbackRegistrar.add("MediaListCtrl.MoreLess", boost::bind(&LLPanelNearByMedia::onMoreLess, this));
- mCommitCallbackRegistrar.add("SelectedMediaCtrl.Stop", boost::bind(&LLPanelNearByMedia::onClickSelectedMediaStop, this));
- mCommitCallbackRegistrar.add("SelectedMediaCtrl.Play", boost::bind(&LLPanelNearByMedia::onClickSelectedMediaPlay, this));
- mCommitCallbackRegistrar.add("SelectedMediaCtrl.Pause", boost::bind(&LLPanelNearByMedia::onClickSelectedMediaPause, this));
- mCommitCallbackRegistrar.add("SelectedMediaCtrl.Mute", boost::bind(&LLPanelNearByMedia::onClickSelectedMediaMute, this));
- mCommitCallbackRegistrar.add("SelectedMediaCtrl.Volume", boost::bind(&LLPanelNearByMedia::onCommitSelectedMediaVolume, this));
- mCommitCallbackRegistrar.add("SelectedMediaCtrl.Zoom", boost::bind(&LLPanelNearByMedia::onClickSelectedMediaZoom, this));
- mCommitCallbackRegistrar.add("SelectedMediaCtrl.Unzoom", boost::bind(&LLPanelNearByMedia::onClickSelectedMediaUnzoom, this));
+ mCommitCallbackRegistrar.add("MediaListCtrl.EnableAll", { boost::bind(&LLPanelNearByMedia::onClickEnableAll, this) });
+ mCommitCallbackRegistrar.add("MediaListCtrl.DisableAll", { boost::bind(&LLPanelNearByMedia::onClickDisableAll, this) });
+ mCommitCallbackRegistrar.add("MediaListCtrl.GoMediaPrefs", { boost::bind(&LLPanelNearByMedia::onAdvancedButtonClick, this) });
+ mCommitCallbackRegistrar.add("MediaListCtrl.MoreLess", { boost::bind(&LLPanelNearByMedia::onMoreLess, this) });
+ mCommitCallbackRegistrar.add("SelectedMediaCtrl.Stop", { boost::bind(&LLPanelNearByMedia::onClickSelectedMediaStop, this) });
+ mCommitCallbackRegistrar.add("SelectedMediaCtrl.Play", { boost::bind(&LLPanelNearByMedia::onClickSelectedMediaPlay, this) });
+ mCommitCallbackRegistrar.add("SelectedMediaCtrl.Pause", { boost::bind(&LLPanelNearByMedia::onClickSelectedMediaPause, this) });
+ mCommitCallbackRegistrar.add("SelectedMediaCtrl.Mute", { boost::bind(&LLPanelNearByMedia::onClickSelectedMediaMute, this) });
+ mCommitCallbackRegistrar.add("SelectedMediaCtrl.Volume", { boost::bind(&LLPanelNearByMedia::onCommitSelectedMediaVolume, this) });
+ mCommitCallbackRegistrar.add("SelectedMediaCtrl.Zoom", { boost::bind(&LLPanelNearByMedia::onClickSelectedMediaZoom, this) });
+ mCommitCallbackRegistrar.add("SelectedMediaCtrl.Unzoom", { boost::bind(&LLPanelNearByMedia::onClickSelectedMediaUnzoom, this) });
// Context menu handler.
mCommitCallbackRegistrar.add("SelectedMediaCtrl.Action",
- [this](LLUICtrl* ctrl, const LLSD& data)
+ {[this](LLUICtrl* ctrl, const LLSD& data)
{
onMenuAction(data);
- });
+ }});
mEnableCallbackRegistrar.add("SelectedMediaCtrl.Visible",
[this](LLUICtrl* ctrl, const LLSD& data)
{
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index 0a3a2e753a..76eb2fd017 100644
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -296,7 +296,7 @@ LLPanelObject::LLPanelObject()
mHasClipboardRot(false),
mSizeChanged(false)
{
- mCommitCallbackRegistrar.add("PanelObject.menuDoToSelected", boost::bind(&LLPanelObject::menuDoToSelected, this, _2));
+ mCommitCallbackRegistrar.add("PanelObject.menuDoToSelected", { boost::bind(&LLPanelObject::menuDoToSelected, this, _2) });
mEnableCallbackRegistrar.add("PanelObject.menuEnable", boost::bind(&LLPanelObject::menuEnableItem, this, _2));
}
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index ef7986603b..dcd7fdf30d 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -1332,14 +1332,16 @@ LLPanelObjectInventory::LLPanelObjectInventory(const LLPanelObjectInventory::Par
mShowRootFolder(p.show_root_folder)
{
// Setup context menu callbacks
- mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLPanelObjectInventory::doToSelected, this, _2));
- mCommitCallbackRegistrar.add("Inventory.EmptyTrash", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyTrash", LLFolderType::FT_TRASH));
- mCommitCallbackRegistrar.add("Inventory.EmptyLostAndFound", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyLostAndFound", LLFolderType::FT_LOST_AND_FOUND));
- mCommitCallbackRegistrar.add("Inventory.DoCreate", boost::bind(&do_nothing));
- mCommitCallbackRegistrar.add("Inventory.AttachObject", boost::bind(&do_nothing));
- mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&do_nothing));
- mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, this));
- mCommitCallbackRegistrar.add("Inventory.FileUploadLocation", boost::bind(&do_nothing));
+ mCommitCallbackRegistrar.add("Inventory.DoToSelected", { boost::bind(&LLPanelObjectInventory::doToSelected, this, _2), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.EmptyTrash",
+ { boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyTrash", LLFolderType::FT_TRASH), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.EmptyLostAndFound",
+ { boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyLostAndFound", LLFolderType::FT_LOST_AND_FOUND), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.DoCreate", { boost::bind(&do_nothing) });
+ mCommitCallbackRegistrar.add("Inventory.AttachObject", { boost::bind(&do_nothing) });
+ mCommitCallbackRegistrar.add("Inventory.BeginIMSession", { boost::bind(&do_nothing) });
+ mCommitCallbackRegistrar.add("Inventory.Share", { boost::bind(&LLAvatarActions::shareWithAvatars, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.FileUploadLocation", { boost::bind(&do_nothing) });
}
// Destroys the object
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index 4cd4afaa5a..60017db51d 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -157,7 +157,7 @@ public:
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
- registrar.add("Wearable.Create", boost::bind(onCreate, _2));
+ registrar.add("Wearable.Create", { boost::bind(onCreate, _2), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
llassert(LLMenuGL::sMenuContainer != NULL);
LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>(
@@ -226,7 +226,7 @@ public:
LLHandle<LLView> flat_list_handle = flat_list->getHandle();
LLHandle<LLPanel> inventory_panel_handle = inventory_panel->getHandle();
- registrar.add("AddWearable.Gear.Sort", boost::bind(onSort, flat_list_handle, inventory_panel_handle, _2));
+ registrar.add("AddWearable.Gear.Sort", { boost::bind(onSort, flat_list_handle, inventory_panel_handle, _2) });
enable_registrar.add("AddWearable.Gear.Check", boost::bind(onCheck, flat_list_handle, inventory_panel_handle, _2));
enable_registrar.add("AddWearable.Gear.Visible", boost::bind(onVisible, inventory_panel_handle, _2));
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 25672db318..ca1a4e258d 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -308,10 +308,10 @@ public:
: LLEventTimer(period),
LLPanelPeople::Updater(cb)
{
- mEventTimer.stop();
+ stop();
}
- virtual bool tick() // from LLEventTimer
+ bool tick() override // from LLEventTimer
{
return false;
}
@@ -348,13 +348,13 @@ public:
LLAvatarTracker::instance().removeObserver(this);
}
- /*virtual*/ void changed(U32 mask)
+ void changed(U32 mask) override
{
if (mIsActive)
{
// events can arrive quickly in bulk - we need not process EVERY one of them -
// so we wait a short while to let others pile-in, and process them in aggregate.
- mEventTimer.start();
+ start();
}
// save-up all the mask-bits which have come-in
@@ -362,7 +362,7 @@ public:
}
- /*virtual*/ bool tick()
+ bool tick() override
{
if (!mIsActive) return false;
@@ -372,14 +372,13 @@ public:
}
// Stop updates.
- mEventTimer.stop();
+ stop();
mMask = 0;
return false;
}
- // virtual
- void setActive(bool active)
+ void setActive(bool active) override
{
mIsActive = active;
if (active)
@@ -488,22 +487,22 @@ public:
setActive(false);
}
- /*virtual*/ void setActive(bool val)
+ void setActive(bool val) override
{
if (val)
{
// update immediately and start regular updates
update();
- mEventTimer.start();
+ start();
}
else
{
// stop regular updates
- mEventTimer.stop();
+ stop();
}
}
- /*virtual*/ bool tick()
+ bool tick() override
{
update();
return false;
@@ -543,18 +542,18 @@ LLPanelPeople::LLPanelPeople()
mRecentListUpdater = new LLRecentListUpdater(boost::bind(&LLPanelPeople::updateRecentList, this));
mButtonsUpdater = new LLButtonsUpdater(boost::bind(&LLPanelPeople::updateButtons, this));
- mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this));
- mCommitCallbackRegistrar.add("People.AddFriendWizard", boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked, this));
- mCommitCallbackRegistrar.add("People.DelFriend", boost::bind(&LLPanelPeople::onDeleteFriendButtonClicked, this));
- mCommitCallbackRegistrar.add("People.Group.Minus", boost::bind(&LLPanelPeople::onGroupMinusButtonClicked, this));
- mCommitCallbackRegistrar.add("People.Chat", boost::bind(&LLPanelPeople::onChatButtonClicked, this));
- mCommitCallbackRegistrar.add("People.Gear", boost::bind(&LLPanelPeople::onGearButtonClicked, this, _1));
-
- mCommitCallbackRegistrar.add("People.Group.Plus.Action", boost::bind(&LLPanelPeople::onGroupPlusMenuItemClicked, this, _2));
- mCommitCallbackRegistrar.add("People.Friends.ViewSort.Action", boost::bind(&LLPanelPeople::onFriendsViewSortMenuItemClicked, this, _2));
- mCommitCallbackRegistrar.add("People.Nearby.ViewSort.Action", boost::bind(&LLPanelPeople::onNearbyViewSortMenuItemClicked, this, _2));
- mCommitCallbackRegistrar.add("People.Groups.ViewSort.Action", boost::bind(&LLPanelPeople::onGroupsViewSortMenuItemClicked, this, _2));
- mCommitCallbackRegistrar.add("People.Recent.ViewSort.Action", boost::bind(&LLPanelPeople::onRecentViewSortMenuItemClicked, this, _2));
+ mCommitCallbackRegistrar.add("People.AddFriend", { boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this) });
+ mCommitCallbackRegistrar.add("People.AddFriendWizard", { boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked, this) });
+ mCommitCallbackRegistrar.add("People.DelFriend", { boost::bind(&LLPanelPeople::onDeleteFriendButtonClicked, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("People.Group.Minus", { boost::bind(&LLPanelPeople::onGroupMinusButtonClicked, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("People.Chat", { boost::bind(&LLPanelPeople::onChatButtonClicked, this) });
+ mCommitCallbackRegistrar.add("People.Gear", { boost::bind(&LLPanelPeople::onGearButtonClicked, this, _1) });
+
+ mCommitCallbackRegistrar.add("People.Group.Plus.Action", { boost::bind(&LLPanelPeople::onGroupPlusMenuItemClicked, this, _2), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("People.Friends.ViewSort.Action", { boost::bind(&LLPanelPeople::onFriendsViewSortMenuItemClicked, this, _2) });
+ mCommitCallbackRegistrar.add("People.Nearby.ViewSort.Action", { boost::bind(&LLPanelPeople::onNearbyViewSortMenuItemClicked, this, _2) });
+ mCommitCallbackRegistrar.add("People.Groups.ViewSort.Action", { boost::bind(&LLPanelPeople::onGroupsViewSortMenuItemClicked, this, _2) });
+ mCommitCallbackRegistrar.add("People.Recent.ViewSort.Action", { boost::bind(&LLPanelPeople::onRecentViewSortMenuItemClicked, this, _2) });
mEnableCallbackRegistrar.add("People.Friends.ViewSort.CheckItem", boost::bind(&LLPanelPeople::onFriendsViewSortMenuItemCheck, this, _2));
mEnableCallbackRegistrar.add("People.Recent.ViewSort.CheckItem", boost::bind(&LLPanelPeople::onRecentViewSortMenuItemCheck, this, _2));
diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp
index f8a73ddb46..283be752ed 100644
--- a/indra/newview/llpanelpeoplemenus.cpp
+++ b/indra/newview/llpanelpeoplemenus.cpp
@@ -58,7 +58,7 @@ NearbyPeopleContextMenu gNearbyPeopleContextMenu;
LLContextMenu* PeopleContextMenu::createMenu()
{
// set up the callbacks for all of the avatar menu items
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ LLUICtrl::ScopedRegistrarHelper registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
LLContextMenu* menu;
@@ -68,21 +68,21 @@ LLContextMenu* PeopleContextMenu::createMenu()
const LLUUID& id = mUUIDs.front();
registrar.add("Avatar.Profile", boost::bind(&LLAvatarActions::showProfile, id));
- registrar.add("Avatar.AddFriend", boost::bind(&LLAvatarActions::requestFriendshipDialog, id));
- registrar.add("Avatar.RemoveFriend", boost::bind(&LLAvatarActions::removeFriendDialog, id));
+ registrar.add("Avatar.AddFriend", boost::bind(&LLAvatarActions::requestFriendshipDialog, id), LLUICtrl::cb_info::UNTRUSTED_THROTTLE);
+ registrar.add("Avatar.RemoveFriend", boost::bind(&LLAvatarActions::removeFriendDialog, id), LLUICtrl::cb_info::UNTRUSTED_BLOCK);
registrar.add("Avatar.IM", boost::bind(&LLAvatarActions::startIM, id));
- registrar.add("Avatar.Call", boost::bind(&LLAvatarActions::startCall, id));
- registrar.add("Avatar.OfferTeleport", boost::bind(&PeopleContextMenu::offerTeleport, this));
+ registrar.add("Avatar.Call", boost::bind(&LLAvatarActions::startCall, id), LLUICtrl::cb_info::UNTRUSTED_BLOCK);
+ registrar.add("Avatar.OfferTeleport", boost::bind(&PeopleContextMenu::offerTeleport, this), LLUICtrl::cb_info::UNTRUSTED_BLOCK);
registrar.add("Avatar.ZoomIn", boost::bind(&handle_zoom_to_object, id));
registrar.add("Avatar.ShowOnMap", boost::bind(&LLAvatarActions::showOnMap, id));
- registrar.add("Avatar.Share", boost::bind(&LLAvatarActions::share, id));
- registrar.add("Avatar.Pay", boost::bind(&LLAvatarActions::pay, id));
+ registrar.add("Avatar.Share", boost::bind(&LLAvatarActions::share, id), LLUICtrl::cb_info::UNTRUSTED_BLOCK);
+ registrar.add("Avatar.Pay", boost::bind(&LLAvatarActions::pay, id), LLUICtrl::cb_info::UNTRUSTED_BLOCK);
registrar.add("Avatar.BlockUnblock", boost::bind(&LLAvatarActions::toggleBlock, id));
- registrar.add("Avatar.InviteToGroup", boost::bind(&LLAvatarActions::inviteToGroup, id));
+ registrar.add("Avatar.InviteToGroup", boost::bind(&LLAvatarActions::inviteToGroup, id), LLUICtrl::cb_info::UNTRUSTED_BLOCK);
registrar.add("Avatar.TeleportRequest", boost::bind(&PeopleContextMenu::requestTeleport, this));
- registrar.add("Avatar.Calllog", boost::bind(&LLAvatarActions::viewChatHistory, id));
- registrar.add("Avatar.Freeze", boost::bind(&LLAvatarActions::freezeAvatar, id));
- registrar.add("Avatar.Eject", boost::bind(&PeopleContextMenu::eject, this));
+ registrar.add("Avatar.Calllog", boost::bind(&LLAvatarActions::viewChatHistory, id), LLUICtrl::cb_info::UNTRUSTED_THROTTLE);
+ registrar.add("Avatar.Freeze", boost::bind(&LLAvatarActions::freezeAvatar, id), LLUICtrl::cb_info::UNTRUSTED_THROTTLE);
+ registrar.add("Avatar.Eject", boost::bind(&PeopleContextMenu::eject, this), LLUICtrl::cb_info::UNTRUSTED_THROTTLE);
enable_registrar.add("Avatar.EnableItem", boost::bind(&PeopleContextMenu::enableContextMenuItem, this, _2));
diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp
index 18588514f8..87f05f2028 100644
--- a/indra/newview/llpanelplaceprofile.cpp
+++ b/indra/newview/llpanelplaceprofile.cpp
@@ -629,6 +629,11 @@ void LLPanelPlaceProfile::updateCovenantText(const std::string &text)
mCovenantText->setText(text);
}
+void LLPanelPlaceProfile::updateCovenant(const LLTextBase* source)
+{
+ mCovenantText->copyContents(source);
+}
+
void LLPanelPlaceProfile::onForSaleBannerClick()
{
LLViewerParcelMgr* mgr = LLViewerParcelMgr::getInstance();
diff --git a/indra/newview/llpanelplaceprofile.h b/indra/newview/llpanelplaceprofile.h
index 45a20fb86a..f562be0f5d 100644
--- a/indra/newview/llpanelplaceprofile.h
+++ b/indra/newview/llpanelplaceprofile.h
@@ -31,6 +31,7 @@
class LLAccordionCtrl;
class LLIconCtrl;
+class LLTextBase;
class LLTextEditor;
class LLPanelPlaceProfile : public LLPanelPlaceInfo
@@ -60,6 +61,7 @@ public:
void updateEstateName(const std::string& name);
void updateEstateOwnerName(const std::string& name);
void updateCovenantText(const std::string &text);
+ void updateCovenant(const LLTextBase* source);
private:
void onForSaleBannerClick();
diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp
index 7deb1d9fd4..5fb20d4b69 100644
--- a/indra/newview/llpanelplaces.cpp
+++ b/indra/newview/llpanelplaces.cpp
@@ -315,7 +315,7 @@ bool LLPanelPlaces::postBuild()
, _7 // EAcceptance* accept
));
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ ScopedRegistrarHelper registrar;
registrar.add("Places.OverflowMenu.Action", boost::bind(&LLPanelPlaces::onOverflowMenuItemClicked, this, _2));
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
enable_registrar.add("Places.OverflowMenu.Enable", boost::bind(&LLPanelPlaces::onOverflowMenuItemEnable, this, _2));
diff --git a/indra/newview/llpanelpresetscamerapulldown.cpp b/indra/newview/llpanelpresetscamerapulldown.cpp
index 5b0aa28223..d1497719e0 100644
--- a/indra/newview/llpanelpresetscamerapulldown.cpp
+++ b/indra/newview/llpanelpresetscamerapulldown.cpp
@@ -48,8 +48,8 @@
// Default constructor
LLPanelPresetsCameraPulldown::LLPanelPresetsCameraPulldown()
{
- mCommitCallbackRegistrar.add("Presets.toggleCameraFloater", boost::bind(&LLPanelPresetsCameraPulldown::onViewButtonClick, this, _2));
- mCommitCallbackRegistrar.add("PresetsCamera.RowClick", boost::bind(&LLPanelPresetsCameraPulldown::onRowClick, this, _2));
+ mCommitCallbackRegistrar.add("Presets.toggleCameraFloater", { boost::bind(&LLPanelPresetsCameraPulldown::onViewButtonClick, this, _2) });
+ mCommitCallbackRegistrar.add("PresetsCamera.RowClick", { boost::bind(&LLPanelPresetsCameraPulldown::onRowClick, this, _2) });
buildFromFile( "panel_presets_camera_pulldown.xml");
}
diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp
index 3b0f1273df..3d564ef540 100644
--- a/indra/newview/llpanelpresetspulldown.cpp
+++ b/indra/newview/llpanelpresetspulldown.cpp
@@ -50,9 +50,9 @@ LLPanelPresetsPulldown::LLPanelPresetsPulldown()
{
mHoverTimer.stop();
- mCommitCallbackRegistrar.add("Presets.GoGraphicsPrefs", boost::bind(&LLPanelPresetsPulldown::onGraphicsButtonClick, this, _2));
- mCommitCallbackRegistrar.add("Presets.GoAutofpsPrefs", boost::bind(&LLPanelPresetsPulldown::onAutofpsButtonClick, this, _2));
- mCommitCallbackRegistrar.add("Presets.RowClick", boost::bind(&LLPanelPresetsPulldown::onRowClick, this, _2));
+ mCommitCallbackRegistrar.add("Presets.GoGraphicsPrefs", { boost::bind(&LLPanelPresetsPulldown::onGraphicsButtonClick, this, _2) });
+ mCommitCallbackRegistrar.add("Presets.GoAutofpsPrefs", { boost::bind(&LLPanelPresetsPulldown::onAutofpsButtonClick, this, _2) });
+ mCommitCallbackRegistrar.add("Presets.RowClick", { boost::bind(&LLPanelPresetsPulldown::onRowClick, this, _2) });
buildFromFile( "panel_presets_pulldown.xml");
}
diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp
index 4db0a5b59d..1af585708e 100644
--- a/indra/newview/llpanelprimmediacontrols.cpp
+++ b/indra/newview/llpanelprimmediacontrols.cpp
@@ -101,28 +101,28 @@ LLPanelPrimMediaControls::LLPanelPrimMediaControls() :
mSecureURL(false),
mMediaPlaySliderCtrlMouseDownValue(0.0)
{
- mCommitCallbackRegistrar.add("MediaCtrl.Close", boost::bind(&LLPanelPrimMediaControls::onClickClose, this));
- mCommitCallbackRegistrar.add("MediaCtrl.Back", boost::bind(&LLPanelPrimMediaControls::onClickBack, this));
- mCommitCallbackRegistrar.add("MediaCtrl.Forward", boost::bind(&LLPanelPrimMediaControls::onClickForward, this));
- mCommitCallbackRegistrar.add("MediaCtrl.Home", boost::bind(&LLPanelPrimMediaControls::onClickHome, this));
- mCommitCallbackRegistrar.add("MediaCtrl.Stop", boost::bind(&LLPanelPrimMediaControls::onClickStop, this));
- mCommitCallbackRegistrar.add("MediaCtrl.MediaStop", boost::bind(&LLPanelPrimMediaControls::onClickMediaStop, this));
- mCommitCallbackRegistrar.add("MediaCtrl.Reload", boost::bind(&LLPanelPrimMediaControls::onClickReload, this));
- mCommitCallbackRegistrar.add("MediaCtrl.Play", boost::bind(&LLPanelPrimMediaControls::onClickPlay, this));
- mCommitCallbackRegistrar.add("MediaCtrl.Pause", boost::bind(&LLPanelPrimMediaControls::onClickPause, this));
- mCommitCallbackRegistrar.add("MediaCtrl.Open", boost::bind(&LLPanelPrimMediaControls::onClickOpen, this));
- mCommitCallbackRegistrar.add("MediaCtrl.Zoom", boost::bind(&LLPanelPrimMediaControls::onClickZoom, this));
- mCommitCallbackRegistrar.add("MediaCtrl.CommitURL", boost::bind(&LLPanelPrimMediaControls::onCommitURL, this));
- mCommitCallbackRegistrar.add("MediaCtrl.MouseDown", boost::bind(&LLPanelPrimMediaControls::onMediaPlaySliderCtrlMouseDown, this));
- mCommitCallbackRegistrar.add("MediaCtrl.MouseUp", boost::bind(&LLPanelPrimMediaControls::onMediaPlaySliderCtrlMouseUp, this));
- mCommitCallbackRegistrar.add("MediaCtrl.CommitVolumeUp", boost::bind(&LLPanelPrimMediaControls::onCommitVolumeUp, this));
- mCommitCallbackRegistrar.add("MediaCtrl.CommitVolumeDown", boost::bind(&LLPanelPrimMediaControls::onCommitVolumeDown, this));
- mCommitCallbackRegistrar.add("MediaCtrl.Volume", boost::bind(&LLPanelPrimMediaControls::onCommitVolumeSlider, this));
- mCommitCallbackRegistrar.add("MediaCtrl.ToggleMute", boost::bind(&LLPanelPrimMediaControls::onToggleMute, this));
- mCommitCallbackRegistrar.add("MediaCtrl.ShowVolumeSlider", boost::bind(&LLPanelPrimMediaControls::showVolumeSlider, this));
- mCommitCallbackRegistrar.add("MediaCtrl.HideVolumeSlider", boost::bind(&LLPanelPrimMediaControls::hideVolumeSlider, this));
- mCommitCallbackRegistrar.add("MediaCtrl.SkipBack", boost::bind(&LLPanelPrimMediaControls::onClickSkipBack, this));
- mCommitCallbackRegistrar.add("MediaCtrl.SkipForward", boost::bind(&LLPanelPrimMediaControls::onClickSkipForward, this));
+ mCommitCallbackRegistrar.add("MediaCtrl.Close", { boost::bind(&LLPanelPrimMediaControls::onClickClose, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.Back", { boost::bind(&LLPanelPrimMediaControls::onClickBack, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.Forward", { boost::bind(&LLPanelPrimMediaControls::onClickForward, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.Home", { boost::bind(&LLPanelPrimMediaControls::onClickHome, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.Stop", { boost::bind(&LLPanelPrimMediaControls::onClickStop, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.MediaStop", { boost::bind(&LLPanelPrimMediaControls::onClickMediaStop, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.Reload", { boost::bind(&LLPanelPrimMediaControls::onClickReload, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.Play", { boost::bind(&LLPanelPrimMediaControls::onClickPlay, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.Pause", { boost::bind(&LLPanelPrimMediaControls::onClickPause, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.Open", { boost::bind(&LLPanelPrimMediaControls::onClickOpen, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.Zoom", { boost::bind(&LLPanelPrimMediaControls::onClickZoom, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.CommitURL", { boost::bind(&LLPanelPrimMediaControls::onCommitURL, this), LLUICtrl::cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("MediaCtrl.MouseDown", { boost::bind(&LLPanelPrimMediaControls::onMediaPlaySliderCtrlMouseDown, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.MouseUp", { boost::bind(&LLPanelPrimMediaControls::onMediaPlaySliderCtrlMouseUp, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.CommitVolumeUp", { boost::bind(&LLPanelPrimMediaControls::onCommitVolumeUp, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.CommitVolumeDown", { boost::bind(&LLPanelPrimMediaControls::onCommitVolumeDown, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.Volume", { boost::bind(&LLPanelPrimMediaControls::onCommitVolumeSlider, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.ToggleMute", { boost::bind(&LLPanelPrimMediaControls::onToggleMute, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.ShowVolumeSlider", { boost::bind(&LLPanelPrimMediaControls::showVolumeSlider, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.HideVolumeSlider", { boost::bind(&LLPanelPrimMediaControls::hideVolumeSlider, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.SkipBack", { boost::bind(&LLPanelPrimMediaControls::onClickSkipBack, this) });
+ mCommitCallbackRegistrar.add("MediaCtrl.SkipForward", { boost::bind(&LLPanelPrimMediaControls::onClickSkipForward, this) });
buildFromFile( "panel_prim_media_controls.xml");
mInactivityTimer.reset();
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index 08605f7cf4..2086706bf8 100644
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -772,7 +772,7 @@ void LLPanelProfileSecondLife::onOpen(const LLSD& key)
}
// Init menu, menu needs to be created in scope of a registar to work correctly.
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar commit;
+ ScopedRegistrarHelper commit;
commit.add("Profile.Commit", [this](LLUICtrl*, const LLSD& userdata) { onCommitMenu(userdata); });
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable;
diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp
index 08f3d3af5a..11a10ebd2c 100644
--- a/indra/newview/llpanelprofilepicks.cpp
+++ b/indra/newview/llpanelprofilepicks.cpp
@@ -246,6 +246,8 @@ void LLPanelProfilePicks::onClickNewBtn()
select_tab(true).
label(pick_panel->getPickName()));
updateButtons();
+
+ pick_panel->addLocationChangedCallbacks();
}
void LLPanelProfilePicks::onClickDelete()
@@ -571,10 +573,12 @@ void LLPanelProfilePick::setAvatarId(const LLUUID& avatar_id)
{
mPickName->setEnabled(true);
mPickDescription->setEnabled(true);
+ mSetCurrentLocationButton->setVisible(true);
}
else
{
mSnapshotCtrl->setEnabled(false);
+ mSetCurrentLocationButton->setVisible(false);
}
}
@@ -585,6 +589,7 @@ bool LLPanelProfilePick::postBuild()
mSaveButton = getChild<LLButton>("save_changes_btn");
mCreateButton = getChild<LLButton>("create_changes_btn");
mCancelButton = getChild<LLButton>("cancel_changes_btn");
+ mSetCurrentLocationButton = getChild<LLButton>("set_to_curr_location_btn");
mSnapshotCtrl = getChild<LLTextureCtrl>("pick_snapshot");
mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelProfilePick::onSnapshotChanged, this));
@@ -597,6 +602,7 @@ bool LLPanelProfilePick::postBuild()
mSaveButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickSave, this));
mCreateButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickSave, this));
mCancelButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickCancel, this));
+ mSetCurrentLocationButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickSetLocation, this));
mPickName->setKeystrokeCallback(boost::bind(&LLPanelProfilePick::onPickChanged, this, _1), NULL);
mPickName->setEnabled(false);
@@ -759,6 +765,32 @@ bool LLPanelProfilePick::isDirty() const
return false;
}
+void LLPanelProfilePick::onClickSetLocation()
+{
+ // Save location for later use.
+ setPosGlobal(gAgent.getPositionGlobal());
+
+ std::string parcel_name, region_name;
+
+ LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
+ if (parcel)
+ {
+ mParcelId = parcel->getID();
+ parcel_name = parcel->getName();
+ }
+
+ LLViewerRegion* region = gAgent.getRegion();
+ if (region)
+ {
+ region_name = region->getName();
+ }
+
+ setPickLocation(createLocationText(getLocationNotice(), parcel_name, region_name, getPosGlobal()));
+
+ mLocationChanged = true;
+ enableSaveButton(true);
+}
+
void LLPanelProfilePick::onClickSave()
{
if (mRegionCallbackConnection.connected())
@@ -769,6 +801,10 @@ void LLPanelProfilePick::onClickSave()
{
mParcelCallbackConnection.disconnect();
}
+ if (mLocationChanged)
+ {
+ onClickSetLocation();
+ }
sendUpdate();
mLocationChanged = false;
@@ -816,6 +852,12 @@ void LLPanelProfilePick::processParcelInfo(const LLParcelData& parcel_data)
}
}
+void LLPanelProfilePick::addLocationChangedCallbacks()
+{
+ mRegionCallbackConnection = gAgent.addRegionChangedCallback([this]() { onClickSetLocation(); });
+ mParcelCallbackConnection = gAgent.addParcelChangedCallback([this]() { onClickSetLocation(); });
+}
+
void LLPanelProfilePick::sendUpdate()
{
LLPickData pick_data;
diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h
index e3f50f5576..5e5d4ff81e 100644
--- a/indra/newview/llpanelprofilepicks.h
+++ b/indra/newview/llpanelprofilepicks.h
@@ -138,6 +138,8 @@ public:
void setParcelID(const LLUUID& parcel_id) override { mParcelId = parcel_id; }
void setErrorStatus(S32 status, const std::string& reason) override {};
+ void addLocationChangedCallbacks();
+
protected:
/**
@@ -200,6 +202,11 @@ public:
void resetDirty() override;
/**
+ * Callback for "Set Location" button click
+ */
+ void onClickSetLocation();
+
+ /**
* Callback for "Save" and "Create" button click
*/
void onClickSave();
@@ -221,6 +228,7 @@ protected:
LLTextureCtrl* mSnapshotCtrl;
LLLineEditor* mPickName;
LLTextEditor* mPickDescription;
+ LLButton* mSetCurrentLocationButton;
LLButton* mSaveButton;
LLButton* mCreateButton;
LLButton* mCancelButton;
@@ -236,7 +244,7 @@ protected:
bool mLocationChanged;
bool mNewPick;
- bool mIsEditing;
+ bool mIsEditing;
void onDescriptionFocusReceived();
};
diff --git a/indra/newview/llpanelsnapshot.cpp b/indra/newview/llpanelsnapshot.cpp
index 32c9f6f402..56c0294dbe 100644
--- a/indra/newview/llpanelsnapshot.cpp
+++ b/indra/newview/llpanelsnapshot.cpp
@@ -37,6 +37,7 @@
// newview
#include "llsidetraypanelcontainer.h"
+#include "llsnapshotlivepreview.h"
#include "llviewercontrol.h" // gSavedSettings
#include "llagentbenefits.h"
@@ -99,6 +100,17 @@ void LLPanelSnapshot::onOpen(const LLSD& key)
{
getParentByType<LLFloater>()->notify(LLSD().with("image-format-change", true));
}
+
+ // If resolution is set to "Current Window", force a snapshot update
+ // each time a snapshot panel is opened to determine the correct
+ // image size (and upload fee) depending on the snapshot type.
+ if (mSnapshotFloater && getChild<LLUICtrl>(getImageSizeComboName())->getValue().asString() == "[i0,i0]")
+ {
+ if (LLSnapshotLivePreview* preview = mSnapshotFloater->getPreviewView())
+ {
+ preview->mForceUpdateSnapshot = true;
+ }
+ }
}
LLSnapshotModel::ESnapshotFormat LLPanelSnapshot::getImageFormat() const
diff --git a/indra/newview/llpanelsnapshotinventory.cpp b/indra/newview/llpanelsnapshotinventory.cpp
index 96b17acc40..dda14c1e32 100644
--- a/indra/newview/llpanelsnapshotinventory.cpp
+++ b/indra/newview/llpanelsnapshotinventory.cpp
@@ -42,85 +42,43 @@
/**
* The panel provides UI for saving snapshot as an inventory texture.
*/
-class LLPanelSnapshotInventoryBase
- : public LLPanelSnapshot
-{
- LOG_CLASS(LLPanelSnapshotInventoryBase);
-
-public:
- LLPanelSnapshotInventoryBase();
-
- /*virtual*/ bool postBuild();
-protected:
- void onSend();
- /*virtual*/ LLSnapshotModel::ESnapshotType getSnapshotType();
-};
-
class LLPanelSnapshotInventory
- : public LLPanelSnapshotInventoryBase
+ : public LLPanelSnapshot
{
LOG_CLASS(LLPanelSnapshotInventory);
public:
LLPanelSnapshotInventory();
- /*virtual*/ bool postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
+ bool postBuild() override;
+ void onOpen(const LLSD& key) override;
void onResolutionCommit(LLUICtrl* ctrl);
private:
- /*virtual*/ std::string getWidthSpinnerName() const { return "inventory_snapshot_width"; }
- /*virtual*/ std::string getHeightSpinnerName() const { return "inventory_snapshot_height"; }
- /*virtual*/ std::string getAspectRatioCBName() const { return "inventory_keep_aspect_check"; }
- /*virtual*/ std::string getImageSizeComboName() const { return "texture_size_combo"; }
- /*virtual*/ std::string getImageSizePanelName() const { return LLStringUtil::null; }
- /*virtual*/ void updateControls(const LLSD& info);
-
-};
-
-class LLPanelOutfitSnapshotInventory
- : public LLPanelSnapshotInventoryBase
-{
- LOG_CLASS(LLPanelOutfitSnapshotInventory);
-
-public:
- LLPanelOutfitSnapshotInventory();
- /*virtual*/ bool postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
+ std::string getWidthSpinnerName() const override { return "inventory_snapshot_width"; }
+ std::string getHeightSpinnerName() const override { return "inventory_snapshot_height"; }
+ std::string getAspectRatioCBName() const override { return "inventory_keep_aspect_check"; }
+ std::string getImageSizeComboName() const override { return "texture_size_combo"; }
+ std::string getImageSizePanelName() const override { return LLStringUtil::null; }
+ LLSnapshotModel::ESnapshotType getSnapshotType() override;
+ void updateControls(const LLSD& info) override;
-private:
- /*virtual*/ std::string getWidthSpinnerName() const { return ""; }
- /*virtual*/ std::string getHeightSpinnerName() const { return ""; }
- /*virtual*/ std::string getAspectRatioCBName() const { return ""; }
- /*virtual*/ std::string getImageSizeComboName() const { return "texture_size_combo"; }
- /*virtual*/ std::string getImageSizePanelName() const { return LLStringUtil::null; }
- /*virtual*/ void updateControls(const LLSD& info);
-
- /*virtual*/ void cancel();
+ void onSend();
+ void updateUploadCost();
+ S32 calculateUploadCost();
};
static LLPanelInjector<LLPanelSnapshotInventory> panel_class1("llpanelsnapshotinventory");
-static LLPanelInjector<LLPanelOutfitSnapshotInventory> panel_class2("llpaneloutfitsnapshotinventory");
-
-LLPanelSnapshotInventoryBase::LLPanelSnapshotInventoryBase()
-{
-}
-
-bool LLPanelSnapshotInventoryBase::postBuild()
-{
- return LLPanelSnapshot::postBuild();
-}
-
-LLSnapshotModel::ESnapshotType LLPanelSnapshotInventoryBase::getSnapshotType()
+LLSnapshotModel::ESnapshotType LLPanelSnapshotInventory::getSnapshotType()
{
return LLSnapshotModel::SNAPSHOT_TEXTURE;
}
LLPanelSnapshotInventory::LLPanelSnapshotInventory()
{
- mCommitCallbackRegistrar.add("Inventory.Save", boost::bind(&LLPanelSnapshotInventory::onSend, this));
- mCommitCallbackRegistrar.add("Inventory.Cancel", boost::bind(&LLPanelSnapshotInventory::cancel, this));
+ mCommitCallbackRegistrar.add("Inventory.Save", { boost::bind(&LLPanelSnapshotInventory::onSend, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("Inventory.Cancel", { boost::bind(&LLPanelSnapshotInventory::cancel, this), cb_info::UNTRUSTED_BLOCK });
}
// virtual
@@ -130,12 +88,14 @@ bool LLPanelSnapshotInventory::postBuild()
getChild<LLSpinCtrl>(getHeightSpinnerName())->setAllowEdit(false);
getChild<LLUICtrl>(getImageSizeComboName())->setCommitCallback(boost::bind(&LLPanelSnapshotInventory::onResolutionCommit, this, _1));
- return LLPanelSnapshotInventoryBase::postBuild();
+ return LLPanelSnapshot::postBuild();
}
// virtual
void LLPanelSnapshotInventory::onOpen(const LLSD& key)
{
+ updateUploadCost();
+
LLPanelSnapshot::onOpen(key);
}
@@ -144,6 +104,8 @@ void LLPanelSnapshotInventory::updateControls(const LLSD& info)
{
const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true;
getChild<LLUICtrl>("save_btn")->setEnabled(have_snapshot);
+
+ updateUploadCost();
}
void LLPanelSnapshotInventory::onResolutionCommit(LLUICtrl* ctrl)
@@ -153,21 +115,9 @@ void LLPanelSnapshotInventory::onResolutionCommit(LLUICtrl* ctrl)
getChild<LLSpinCtrl>(getHeightSpinnerName())->setVisible(!current_window_selected);
}
-void LLPanelSnapshotInventoryBase::onSend()
+void LLPanelSnapshotInventory::onSend()
{
- S32 w = 0;
- S32 h = 0;
-
- if( mSnapshotFloater )
- {
- LLSnapshotLivePreview* preview = mSnapshotFloater->getPreviewView();
- if( preview )
- {
- preview->getSize(w, h);
- }
- }
-
- S32 expected_upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost(w, h);
+ S32 expected_upload_cost = calculateUploadCost();
if (can_afford_transaction(expected_upload_cost))
{
if (mSnapshotFloater)
@@ -188,36 +138,24 @@ void LLPanelSnapshotInventoryBase::onSend()
}
}
-LLPanelOutfitSnapshotInventory::LLPanelOutfitSnapshotInventory()
+void LLPanelSnapshotInventory::updateUploadCost()
{
- mCommitCallbackRegistrar.add("Inventory.SaveOutfitPhoto", boost::bind(&LLPanelOutfitSnapshotInventory::onSend, this));
- mCommitCallbackRegistrar.add("Inventory.SaveOutfitCancel", boost::bind(&LLPanelOutfitSnapshotInventory::cancel, this));
+ getChild<LLUICtrl>("hint_lbl")->setTextArg("[UPLOAD_COST]", llformat("%d", calculateUploadCost()));
}
-// virtual
-bool LLPanelOutfitSnapshotInventory::postBuild()
+S32 LLPanelSnapshotInventory::calculateUploadCost()
{
- return LLPanelSnapshotInventoryBase::postBuild();
-}
-
-// virtual
-void LLPanelOutfitSnapshotInventory::onOpen(const LLSD& key)
-{
- getChild<LLUICtrl>("hint_lbl")->setTextArg("[UPLOAD_COST]", llformat("%d", LLAgentBenefitsMgr::current().getTextureUploadCost()));
- LLPanelSnapshot::onOpen(key);
-}
-
-// virtual
-void LLPanelOutfitSnapshotInventory::updateControls(const LLSD& info)
-{
- const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true;
- getChild<LLUICtrl>("save_btn")->setEnabled(have_snapshot);
-}
+ S32 w = 0;
+ S32 h = 0;
-void LLPanelOutfitSnapshotInventory::cancel()
-{
if (mSnapshotFloater)
{
- mSnapshotFloater->closeFloater();
+ if (LLSnapshotLivePreview* preview = mSnapshotFloater->getPreviewView())
+ {
+ w = preview->getEncodedImageWidth();
+ h = preview->getEncodedImageHeight();
+ }
}
+
+ return LLAgentBenefitsMgr::current().getTextureUploadCost(w, h);
}
diff --git a/indra/newview/llpanelsnapshotlocal.cpp b/indra/newview/llpanelsnapshotlocal.cpp
index 366030c0fa..d1807ca3f8 100644
--- a/indra/newview/llpanelsnapshotlocal.cpp
+++ b/indra/newview/llpanelsnapshotlocal.cpp
@@ -47,18 +47,18 @@ class LLPanelSnapshotLocal
public:
LLPanelSnapshotLocal();
- /*virtual*/ bool postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
+ bool postBuild() override;
+ void onOpen(const LLSD& key) override;
private:
- /*virtual*/ std::string getWidthSpinnerName() const { return "local_snapshot_width"; }
- /*virtual*/ std::string getHeightSpinnerName() const { return "local_snapshot_height"; }
- /*virtual*/ std::string getAspectRatioCBName() const { return "local_keep_aspect_check"; }
- /*virtual*/ std::string getImageSizeComboName() const { return "local_size_combo"; }
- /*virtual*/ std::string getImageSizePanelName() const { return "local_image_size_lp"; }
- /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat() const;
- /*virtual*/ LLSnapshotModel::ESnapshotType getSnapshotType();
- /*virtual*/ void updateControls(const LLSD& info);
+ std::string getWidthSpinnerName() const override { return "local_snapshot_width"; }
+ std::string getHeightSpinnerName() const override { return "local_snapshot_height"; }
+ std::string getAspectRatioCBName() const override { return "local_keep_aspect_check"; }
+ std::string getImageSizeComboName() const override { return "local_size_combo"; }
+ std::string getImageSizePanelName() const override { return "local_image_size_lp"; }
+ LLSnapshotModel::ESnapshotFormat getImageFormat() const override;
+ LLSnapshotModel::ESnapshotType getSnapshotType() override;
+ void updateControls(const LLSD& info) override;
S32 mLocalFormat;
@@ -75,7 +75,7 @@ static LLPanelInjector<LLPanelSnapshotLocal> panel_class("llpanelsnapshotlocal")
LLPanelSnapshotLocal::LLPanelSnapshotLocal()
{
mLocalFormat = gSavedSettings.getS32("SnapshotFormat");
- mCommitCallbackRegistrar.add("Local.Cancel", boost::bind(&LLPanelSnapshotLocal::cancel, this));
+ mCommitCallbackRegistrar.add("Local.Cancel", { boost::bind(&LLPanelSnapshotLocal::cancel, this) });
}
// virtual
diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp
index 962d3bba16..eadf8df188 100644
--- a/indra/newview/llpanelsnapshotoptions.cpp
+++ b/indra/newview/llpanelsnapshotoptions.cpp
@@ -30,12 +30,8 @@
#include "llsidetraypanelcontainer.h"
#include "llfloatersnapshot.h" // FIXME: create a snapshot model
-#include "llsnapshotlivepreview.h"
#include "llfloaterreg.h"
-#include "llagentbenefits.h"
-
-
/**
* Provides several ways to save a snapshot.
*/
@@ -46,12 +42,9 @@ class LLPanelSnapshotOptions
public:
LLPanelSnapshotOptions();
- ~LLPanelSnapshotOptions();
- /*virtual*/ bool postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
+ bool postBuild() override;
private:
- void updateUploadCost();
void openPanel(const std::string& panel_name);
void onSaveToProfile();
void onSaveToEmail();
@@ -65,14 +58,10 @@ static LLPanelInjector<LLPanelSnapshotOptions> panel_class("llpanelsnapshotoptio
LLPanelSnapshotOptions::LLPanelSnapshotOptions()
{
- mCommitCallbackRegistrar.add("Snapshot.SaveToProfile", boost::bind(&LLPanelSnapshotOptions::onSaveToProfile, this));
- mCommitCallbackRegistrar.add("Snapshot.SaveToEmail", boost::bind(&LLPanelSnapshotOptions::onSaveToEmail, this));
- mCommitCallbackRegistrar.add("Snapshot.SaveToInventory", boost::bind(&LLPanelSnapshotOptions::onSaveToInventory, this));
- mCommitCallbackRegistrar.add("Snapshot.SaveToComputer", boost::bind(&LLPanelSnapshotOptions::onSaveToComputer, this));
-}
-
-LLPanelSnapshotOptions::~LLPanelSnapshotOptions()
-{
+ mCommitCallbackRegistrar.add("Snapshot.SaveToProfile", { boost::bind(&LLPanelSnapshotOptions::onSaveToProfile, this) });
+ mCommitCallbackRegistrar.add("Snapshot.SaveToEmail", { boost::bind(&LLPanelSnapshotOptions::onSaveToEmail, this) });
+ mCommitCallbackRegistrar.add("Snapshot.SaveToInventory", { boost::bind(&LLPanelSnapshotOptions::onSaveToInventory, this) });
+ mCommitCallbackRegistrar.add("Snapshot.SaveToComputer", { boost::bind(&LLPanelSnapshotOptions::onSaveToComputer, this) });
}
// virtual
@@ -82,30 +71,6 @@ bool LLPanelSnapshotOptions::postBuild()
return LLPanel::postBuild();
}
-// virtual
-void LLPanelSnapshotOptions::onOpen(const LLSD& key)
-{
- updateUploadCost();
-}
-
-void LLPanelSnapshotOptions::updateUploadCost()
-{
- S32 w = 0;
- S32 h = 0;
-
- if( mSnapshotFloater )
- {
- LLSnapshotLivePreview* preview = mSnapshotFloater->getPreviewView();
- if( preview )
- {
- preview->getSize(w, h);
- }
- }
-
- S32 upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost(w, h);
- getChild<LLUICtrl>("save_to_inventory_btn")->setLabelArg("[AMOUNT]", llformat("%d", upload_cost));
-}
-
void LLPanelSnapshotOptions::openPanel(const std::string& panel_name)
{
LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent());
diff --git a/indra/newview/llpanelsnapshotpostcard.cpp b/indra/newview/llpanelsnapshotpostcard.cpp
index 23e8789e3f..3a17a1d58c 100644
--- a/indra/newview/llpanelsnapshotpostcard.cpp
+++ b/indra/newview/llpanelsnapshotpostcard.cpp
@@ -56,18 +56,18 @@ class LLPanelSnapshotPostcard
public:
LLPanelSnapshotPostcard();
- /*virtual*/ bool postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
+ bool postBuild() override;
+ void onOpen(const LLSD& key) override;
private:
- /*virtual*/ std::string getWidthSpinnerName() const { return "postcard_snapshot_width"; }
- /*virtual*/ std::string getHeightSpinnerName() const { return "postcard_snapshot_height"; }
- /*virtual*/ std::string getAspectRatioCBName() const { return "postcard_keep_aspect_check"; }
- /*virtual*/ std::string getImageSizeComboName() const { return "postcard_size_combo"; }
- /*virtual*/ std::string getImageSizePanelName() const { return "postcard_image_size_lp"; }
- /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat() const { return LLSnapshotModel::SNAPSHOT_FORMAT_JPEG; }
- /*virtual*/ LLSnapshotModel::ESnapshotType getSnapshotType();
- /*virtual*/ void updateControls(const LLSD& info);
+ std::string getWidthSpinnerName() const override { return "postcard_snapshot_width"; }
+ std::string getHeightSpinnerName() const override { return "postcard_snapshot_height"; }
+ std::string getAspectRatioCBName() const override { return "postcard_keep_aspect_check"; }
+ std::string getImageSizeComboName() const override { return "postcard_size_combo"; }
+ std::string getImageSizePanelName() const override { return "postcard_image_size_lp"; }
+ LLSnapshotModel::ESnapshotFormat getImageFormat() const override { return LLSnapshotModel::SNAPSHOT_FORMAT_JPEG; }
+ LLSnapshotModel::ESnapshotType getSnapshotType() override;
+ void updateControls(const LLSD& info) override;
bool missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response);
static void sendPostcardFinished(LLSD result);
@@ -86,8 +86,8 @@ static LLPanelInjector<LLPanelSnapshotPostcard> panel_class("llpanelsnapshotpost
LLPanelSnapshotPostcard::LLPanelSnapshotPostcard()
: mHasFirstMsgFocus(false)
{
- mCommitCallbackRegistrar.add("Postcard.Send", boost::bind(&LLPanelSnapshotPostcard::onSend, this));
- mCommitCallbackRegistrar.add("Postcard.Cancel", boost::bind(&LLPanelSnapshotPostcard::cancel, this));
+ mCommitCallbackRegistrar.add("Postcard.Send", { boost::bind(&LLPanelSnapshotPostcard::onSend, this), cb_info::UNTRUSTED_THROTTLE });
+ mCommitCallbackRegistrar.add("Postcard.Cancel", { boost::bind(&LLPanelSnapshotPostcard::cancel, this), cb_info::UNTRUSTED_THROTTLE });
}
diff --git a/indra/newview/llpanelsnapshotprofile.cpp b/indra/newview/llpanelsnapshotprofile.cpp
index aa257dea9e..960b507099 100644
--- a/indra/newview/llpanelsnapshotprofile.cpp
+++ b/indra/newview/llpanelsnapshotprofile.cpp
@@ -49,17 +49,17 @@ class LLPanelSnapshotProfile
public:
LLPanelSnapshotProfile();
- /*virtual*/ bool postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
+ bool postBuild() override;
+ void onOpen(const LLSD& key) override;
private:
- /*virtual*/ std::string getWidthSpinnerName() const { return "profile_snapshot_width"; }
- /*virtual*/ std::string getHeightSpinnerName() const { return "profile_snapshot_height"; }
- /*virtual*/ std::string getAspectRatioCBName() const { return "profile_keep_aspect_check"; }
- /*virtual*/ std::string getImageSizeComboName() const { return "profile_size_combo"; }
- /*virtual*/ std::string getImageSizePanelName() const { return "profile_image_size_lp"; }
- /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat() const { return LLSnapshotModel::SNAPSHOT_FORMAT_PNG; }
- /*virtual*/ void updateControls(const LLSD& info);
+ std::string getWidthSpinnerName() const override { return "profile_snapshot_width"; }
+ std::string getHeightSpinnerName() const override { return "profile_snapshot_height"; }
+ std::string getAspectRatioCBName() const override { return "profile_keep_aspect_check"; }
+ std::string getImageSizeComboName() const override { return "profile_size_combo"; }
+ std::string getImageSizePanelName() const override { return "profile_image_size_lp"; }
+ LLSnapshotModel::ESnapshotFormat getImageFormat() const override { return LLSnapshotModel::SNAPSHOT_FORMAT_PNG; }
+ void updateControls(const LLSD& info) override;
void onSend();
};
@@ -68,8 +68,8 @@ static LLPanelInjector<LLPanelSnapshotProfile> panel_class("llpanelsnapshotprofi
LLPanelSnapshotProfile::LLPanelSnapshotProfile()
{
- mCommitCallbackRegistrar.add("PostToProfile.Send", boost::bind(&LLPanelSnapshotProfile::onSend, this));
- mCommitCallbackRegistrar.add("PostToProfile.Cancel", boost::bind(&LLPanelSnapshotProfile::cancel, this));
+ mCommitCallbackRegistrar.add("PostToProfile.Send", { boost::bind(&LLPanelSnapshotProfile::onSend, this), cb_info::UNTRUSTED_BLOCK });
+ mCommitCallbackRegistrar.add("PostToProfile.Cancel", { boost::bind(&LLPanelSnapshotProfile::cancel, this), cb_info::UNTRUSTED_BLOCK });
}
// virtual
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index 902412d359..ebfdafdfe2 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -402,7 +402,7 @@ LLTeleportHistoryPanel::~LLTeleportHistoryPanel()
bool LLTeleportHistoryPanel::postBuild()
{
- mCommitCallbackRegistrar.add("TeleportHistory.GearMenu.Action", boost::bind(&LLTeleportHistoryPanel::onGearMenuAction, this, _2));
+ mCommitCallbackRegistrar.add("TeleportHistory.GearMenu.Action", { boost::bind(&LLTeleportHistoryPanel::onGearMenuAction, this, _2), cb_info::UNTRUSTED_THROTTLE });
mEnableCallbackRegistrar.add("TeleportHistory.GearMenu.Enable", boost::bind(&LLTeleportHistoryPanel::isActionEnabled, this, _2));
// init menus before list, since menus are passed to list
@@ -939,10 +939,9 @@ void LLTeleportHistoryPanel::onAccordionTabRightClick(LLView *view, S32 x, S32 y
// set up the callbacks for all of the avatar menu items
// (N.B. callbacks don't take const refs as mID is local scope)
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
-
- registrar.add("TeleportHistory.TabOpen", boost::bind(&LLTeleportHistoryPanel::onAccordionTabOpen, this, tab));
- registrar.add("TeleportHistory.TabClose", boost::bind(&LLTeleportHistoryPanel::onAccordionTabClose, this, tab));
+ ScopedRegistrarHelper registrar;
+ registrar.add("TeleportHistory.TabOpen", boost::bind(&LLTeleportHistoryPanel::onAccordionTabOpen, this, tab));
+ registrar.add("TeleportHistory.TabClose", boost::bind(&LLTeleportHistoryPanel::onAccordionTabClose, this, tab));
// create the context menu from the XUI
llassert(LLMenuGL::sMenuContainer != NULL);
diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp
index e7ac11d570..d8a9de596d 100644
--- a/indra/newview/llpaneltopinfobar.cpp
+++ b/indra/newview/llpaneltopinfobar.cpp
@@ -133,7 +133,7 @@ bool LLPanelTopInfoBar::handleRightMouseDown(S32 x, S32 y, MASK mask)
if(!LLUICtrl::CommitCallbackRegistry::getValue("TopInfoBar.Action"))
{
LLUICtrl::CommitCallbackRegistry::currentRegistrar()
- .add("TopInfoBar.Action", boost::bind(&LLPanelTopInfoBar::onContextMenuItemClicked, this, _2));
+ .add("TopInfoBar.Action", { boost::bind(&LLPanelTopInfoBar::onContextMenuItemClicked, this, _2) });
}
show_topinfobar_context_menu(this, x, y);
return true;
diff --git a/indra/newview/llpanelvoiceeffect.cpp b/indra/newview/llpanelvoiceeffect.cpp
index a0129b2cb1..47f898e3ed 100644
--- a/indra/newview/llpanelvoiceeffect.cpp
+++ b/indra/newview/llpanelvoiceeffect.cpp
@@ -42,7 +42,7 @@ static LLPanelInjector<LLPanelVoiceEffect> t_panel_voice_effect("panel_voice_eff
LLPanelVoiceEffect::LLPanelVoiceEffect()
: mVoiceEffectCombo(NULL)
{
- mCommitCallbackRegistrar.add("Voice.CommitVoiceEffect", boost::bind(&LLPanelVoiceEffect::onCommitVoiceEffect, this));
+ mCommitCallbackRegistrar.add("Voice.CommitVoiceEffect", { boost::bind(&LLPanelVoiceEffect::onCommitVoiceEffect, this), cb_info::UNTRUSTED_BLOCK });
}
LLPanelVoiceEffect::~LLPanelVoiceEffect()
diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp
index 951dc45a78..adbf2ebf6e 100644
--- a/indra/newview/llpanelvolume.cpp
+++ b/indra/newview/llpanelvolume.cpp
@@ -223,7 +223,7 @@ LLPanelVolume::LLPanelVolume()
{
setMouseOpaque(false);
- mCommitCallbackRegistrar.add("PanelVolume.menuDoToSelected", boost::bind(&LLPanelVolume::menuDoToSelected, this, _2));
+ mCommitCallbackRegistrar.add("PanelVolume.menuDoToSelected", { boost::bind(&LLPanelVolume::menuDoToSelected, this, _2) });
mEnableCallbackRegistrar.add("PanelVolume.menuEnable", boost::bind(&LLPanelVolume::menuEnableItem, this, _2));
}
diff --git a/indra/newview/llpanelvolumepulldown.cpp b/indra/newview/llpanelvolumepulldown.cpp
index 046bcd7f59..05b21d4d48 100644
--- a/indra/newview/llpanelvolumepulldown.cpp
+++ b/indra/newview/llpanelvolumepulldown.cpp
@@ -48,10 +48,10 @@
// Default constructor
LLPanelVolumePulldown::LLPanelVolumePulldown()
{
- mCommitCallbackRegistrar.add("Vol.setControlFalse", boost::bind(&LLPanelVolumePulldown::setControlFalse, this, _2));
- mCommitCallbackRegistrar.add("Vol.SetSounds", boost::bind(&LLPanelVolumePulldown::onClickSetSounds, this));
- mCommitCallbackRegistrar.add("Vol.updateCheckbox", boost::bind(&LLPanelVolumePulldown::updateCheckbox, this, _1, _2));
- mCommitCallbackRegistrar.add("Vol.GoAudioPrefs", boost::bind(&LLPanelVolumePulldown::onAdvancedButtonClick, this, _2));
+ mCommitCallbackRegistrar.add("Vol.setControlFalse", { boost::bind(&LLPanelVolumePulldown::setControlFalse, this, _2) });
+ mCommitCallbackRegistrar.add("Vol.SetSounds", { boost::bind(&LLPanelVolumePulldown::onClickSetSounds, this) });
+ mCommitCallbackRegistrar.add("Vol.updateCheckbox", { boost::bind(&LLPanelVolumePulldown::updateCheckbox, this, _1, _2) });
+ mCommitCallbackRegistrar.add("Vol.GoAudioPrefs", { boost::bind(&LLPanelVolumePulldown::onAdvancedButtonClick, this, _2) });
buildFromFile( "panel_volume_pulldown.xml");
}
diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp
index c1534c9abd..1056f73d58 100644
--- a/indra/newview/llpanelwearing.cpp
+++ b/indra/newview/llpanelwearing.cpp
@@ -62,7 +62,7 @@ public:
LLWearingGearMenu(LLPanelWearing* panel_wearing)
: mMenu(NULL), mPanelWearing(panel_wearing)
{
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ LLUICtrl::ScopedRegistrarHelper registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
registrar.add("Gear.TouchAttach", boost::bind(&LLWearingGearMenu::handleMultiple, this, handle_attachment_touch));
@@ -103,7 +103,7 @@ class LLWearingContextMenu : public LLListContextMenu
protected:
/* virtual */ LLContextMenu* createMenu()
{
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ LLUICtrl::ScopedRegistrarHelper registrar;
registrar.add("Wearing.TouchAttach", boost::bind(handleMultiple, handle_attachment_touch, mUUIDs));
registrar.add("Wearing.EditItem", boost::bind(handleMultiple, handle_item_edit, mUUIDs));
@@ -180,7 +180,7 @@ public:
protected:
/* virtual */ LLContextMenu* createMenu()
{
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ LLUICtrl::ScopedRegistrarHelper registrar;
registrar.add("Wearing.EditItem", boost::bind(&LLPanelWearing::onEditAttachment, mPanelWearing));
registrar.add("Wearing.Detach", boost::bind(&LLPanelWearing::onRemoveAttachment, mPanelWearing));
diff --git a/indra/newview/llphysicsshapebuilderutil.cpp b/indra/newview/llphysicsshapebuilderutil.cpp
index 37534feadc..eb0df1194e 100644
--- a/indra/newview/llphysicsshapebuilderutil.cpp
+++ b/indra/newview/llphysicsshapebuilderutil.cpp
@@ -28,6 +28,26 @@
#include "llphysicsshapebuilderutil.h"
+#include "llmeshrepository.h"
+
+bool LLPhysicsVolumeParams::hasDecomposition() const
+ {
+ if (!isMeshSculpt())
+ {
+ return false;
+ }
+
+ LLUUID mesh_id = getSculptID();
+ if (mesh_id.isNull())
+ {
+ return false;
+ }
+
+ LLModel::Decomposition* decomp = gMeshRepo.getDecomposition(mesh_id);
+
+ return decomp != NULL;
+}
+
/* static */
void LLPhysicsShapeBuilderUtil::determinePhysicsShape( const LLPhysicsVolumeParams& volume_params, const LLVector3& scale, PhysicsShapeSpecification& specOut)
{
@@ -200,19 +220,32 @@ void LLPhysicsShapeBuilderUtil::determinePhysicsShape( const LLPhysicsVolumePara
{
specOut.mType = PhysicsShapeSpecification::PRIM_CONVEX;
}
- else if (volume_params.isMeshSculpt() &&
- // Check overall dimensions, not individual triangles.
- (scale.mV[0] < SHAPE_BUILDER_USER_MESH_CONVEXIFICATION_SIZE ||
- scale.mV[1] < SHAPE_BUILDER_USER_MESH_CONVEXIFICATION_SIZE ||
- scale.mV[2] < SHAPE_BUILDER_USER_MESH_CONVEXIFICATION_SIZE
- ) )
+ else if (volume_params.isMeshSculpt())
{
- // Server distinguishes between user-specified or default convex mesh, vs server's thin-triangle override, but we don't.
- specOut.mType = PhysicsShapeSpecification::PRIM_CONVEX;
+ // Check overall dimensions, not individual triangles.
+ if (scale.mV[0] < SHAPE_BUILDER_USER_MESH_CONVEXIFICATION_SIZE
+ || scale.mV[1] < SHAPE_BUILDER_USER_MESH_CONVEXIFICATION_SIZE
+ || scale.mV[2] < SHAPE_BUILDER_USER_MESH_CONVEXIFICATION_SIZE
+ )
+ {
+ if (volume_params.hasDecomposition())
+ {
+ specOut.mType = PhysicsShapeSpecification::USER_MESH;
+ }
+ else
+ {
+ // Server distinguishes between user-specified or default convex mesh, vs server's thin-triangle override, but we don't.
+ specOut.mType = PhysicsShapeSpecification::PRIM_CONVEX;
+ }
+ }
+ else
+ {
+ specOut.mType = PhysicsShapeSpecification::USER_MESH;
+ }
}
- else if ( volume_params.isSculpt() ) // Is a sculpt of any kind (mesh or legacy)
+ else if ( volume_params.isSculpt() )
{
- specOut.mType = volume_params.isMeshSculpt() ? PhysicsShapeSpecification::USER_MESH : PhysicsShapeSpecification::SCULPT;
+ specOut.mType = PhysicsShapeSpecification::SCULPT;
}
else // Resort to mesh
{
diff --git a/indra/newview/llphysicsshapebuilderutil.h b/indra/newview/llphysicsshapebuilderutil.h
index 33c2d0a8b6..01c173523b 100644
--- a/indra/newview/llphysicsshapebuilderutil.h
+++ b/indra/newview/llphysicsshapebuilderutil.h
@@ -79,6 +79,8 @@ public:
bool shouldForceConvex() const { return mForceConvex; }
+ bool hasDecomposition() const;
+
private:
bool mForceConvex;
};
diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp
index 7d11c09738..01a3902516 100644
--- a/indra/newview/llpreviewanim.cpp
+++ b/indra/newview/llpreviewanim.cpp
@@ -46,7 +46,7 @@ const S32 ADVANCED_VPAD = 3;
LLPreviewAnim::LLPreviewAnim(const LLSD& key)
: LLPreview( key )
{
- mCommitCallbackRegistrar.add("PreviewAnim.Play", boost::bind(&LLPreviewAnim::play, this, _2));
+ mCommitCallbackRegistrar.add("PreviewAnim.Play", { boost::bind(&LLPreviewAnim::play, this, _2) });
}
// virtual
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 02a4c7fb26..fa99432603 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -503,7 +503,7 @@ bool LLScriptEdCore::postBuild()
LLSyntaxIdLSL::getInstance()->initialize();
processKeywords();
- mCommitCallbackRegistrar.add("FontSize.Set", boost::bind(&LLScriptEdCore::onChangeFontSize, this, _2));
+ mCommitCallbackRegistrar.add("FontSize.Set", { boost::bind(&LLScriptEdCore::onChangeFontSize, this, _2) });
mEnableCallbackRegistrar.add("FontSize.Check", boost::bind(&LLScriptEdCore::isFontSizeChecked, this, _2));
LLToggleableMenu *context_menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>(
diff --git a/indra/newview/llsaveoutfitcombobtn.cpp b/indra/newview/llsaveoutfitcombobtn.cpp
index 6418c310c1..bc1bdfdcda 100644
--- a/indra/newview/llsaveoutfitcombobtn.cpp
+++ b/indra/newview/llsaveoutfitcombobtn.cpp
@@ -39,7 +39,7 @@ LLSaveOutfitComboBtn::LLSaveOutfitComboBtn(LLPanel* parent, bool saveAsDefaultAc
mParent(parent), mSaveAsDefaultAction(saveAsDefaultAction)
{
// register action mapping before creating menu
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar save_registar;
+ LLUICtrl::ScopedRegistrarHelper save_registar;
save_registar.add("Outfit.Save.Action", boost::bind(
&LLSaveOutfitComboBtn::saveOutfit, this, false));
save_registar.add("Outfit.SaveAs.Action", boost::bind(
diff --git a/indra/newview/llsecapi.h b/indra/newview/llsecapi.h
index 14dda20225..73920d35ad 100644
--- a/indra/newview/llsecapi.h
+++ b/indra/newview/llsecapi.h
@@ -312,7 +312,7 @@ public:
mIdentifier = identifier;
mAuthenticator = authenticator;
}
- virtual LLSD getIdentifier() { return mIdentifier; }
+ virtual LLSD getIdentifier() const { return mIdentifier; }
virtual void identifierType(std::string& idType);
virtual LLSD getAuthenticator() { return mAuthenticator; }
virtual void authenticatorType(std::string& authType);
diff --git a/indra/newview/llsetkeybinddialog.cpp b/indra/newview/llsetkeybinddialog.cpp
index 5dbd579b45..021a9feb73 100644
--- a/indra/newview/llsetkeybinddialog.cpp
+++ b/indra/newview/llsetkeybinddialog.cpp
@@ -46,14 +46,12 @@ public:
:LLEventTimer(period),
mMask(mask),
mCallback(cb)
- {
- mEventTimer.start();
- }
+ {}
virtual ~Updater(){}
protected:
- bool tick()
+ bool tick() override
{
mCallback(mMask);
// Deletes itseft after execution
diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp
index 0b73aa493c..ea95d71b27 100644
--- a/indra/newview/llsnapshotlivepreview.cpp
+++ b/indra/newview/llsnapshotlivepreview.cpp
@@ -295,13 +295,20 @@ void LLSnapshotLivePreview::draw()
gGL.pushMatrix();
{
gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom + TOP_PANEL_HEIGHT, 0.f);
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLES);
{
gGL.texCoord2f(uv_width, uv_height);
- gGL.vertex2i(rect.getWidth(), rect.getHeight() );
+ gGL.vertex2i(rect.getWidth(), rect.getHeight());
gGL.texCoord2f(0.f, uv_height);
- gGL.vertex2i(0, rect.getHeight() );
+ gGL.vertex2i(0, rect.getHeight());
+
+ gGL.texCoord2f(0.f, 0.f);
+ gGL.vertex2i(0, 0);
+
+
+ gGL.texCoord2f(uv_width, uv_height);
+ gGL.vertex2i(rect.getWidth(), rect.getHeight());
gGL.texCoord2f(0.f, 0.f);
gGL.vertex2i(0, 0);
@@ -357,13 +364,18 @@ void LLSnapshotLivePreview::draw()
S32 y2 = gViewerWindow->getWindowHeightScaled() + TOP_PANEL_HEIGHT;
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLES);
{
gGL.color4f(1.f, 1.f, 1.f, 0.f);
gGL.vertex2i(x1, y1);
gGL.vertex2i(x1 + gViewerWindow->getWindowWidthScaled(), y2);
gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY);
gGL.vertex2i(x2 + gViewerWindow->getWindowWidthScaled(), y2);
+
+ gGL.color4f(1.f, 1.f, 1.f, 0.f);
+ gGL.vertex2i(x1, y1);
+ gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY);
+ gGL.vertex2i(x2 + gViewerWindow->getWindowWidthScaled(), y2);
gGL.vertex2i(x2, y1);
gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY);
@@ -371,6 +383,11 @@ void LLSnapshotLivePreview::draw()
gGL.vertex2i(x2 + gViewerWindow->getWindowWidthScaled(), y2);
gGL.color4f(1.f, 1.f, 1.f, 0.f);
gGL.vertex2i(x3 + gViewerWindow->getWindowWidthScaled(), y2);
+
+ gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY);
+ gGL.vertex2i(x2, y1);
+ gGL.color4f(1.f, 1.f, 1.f, 0.f);
+ gGL.vertex2i(x3 + gViewerWindow->getWindowWidthScaled(), y2);
gGL.vertex2i(x3, y1);
}
gGL.end();
@@ -406,13 +423,19 @@ void LLSnapshotLivePreview::draw()
LLRect& rect = mImageRect[old_image_index];
gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom - ll_round(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f);
gGL.rotatef(-45.f * fall_interp, 0.f, 0.f, 1.f);
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLES);
{
gGL.texCoord2f(uv_width, uv_height);
- gGL.vertex2i(rect.getWidth(), rect.getHeight() );
+ gGL.vertex2i(rect.getWidth(), rect.getHeight());
gGL.texCoord2f(0.f, uv_height);
- gGL.vertex2i(0, rect.getHeight() );
+ gGL.vertex2i(0, rect.getHeight());
+
+ gGL.texCoord2f(0.f, 0.f);
+ gGL.vertex2i(0, 0);
+
+ gGL.texCoord2f(uv_width, uv_height);
+ gGL.vertex2i(rect.getWidth(), rect.getHeight());
gGL.texCoord2f(0.f, 0.f);
gGL.vertex2i(0, 0);
@@ -667,18 +690,25 @@ bool LLSnapshotLivePreview::onIdle( void* snapshot_preview )
return false;
}
+ static LLCachedControl<bool> auto_snapshot(gSavedSettings, "AutoSnapshot", false);
+ static LLCachedControl<bool> freeze_time(gSavedSettings, "FreezeTime", false);
+ static LLCachedControl<bool> use_freeze_frame(gSavedSettings, "UseFreezeFrame", false);
+ static LLCachedControl<bool> render_ui(gSavedSettings, "RenderUIInSnapshot", false);
+ static LLCachedControl<bool> render_hud(gSavedSettings, "RenderHUDInSnapshot", false);
+ static LLCachedControl<bool> render_no_post(gSavedSettings, "RenderSnapshotNoPost", false);
+
// If we're in freeze-frame and/or auto update mode and camera has moved, update snapshot.
LLVector3 new_camera_pos = LLViewerCamera::getInstance()->getOrigin();
LLQuaternion new_camera_rot = LLViewerCamera::getInstance()->getQuaternion();
if (previewp->mForceUpdateSnapshot ||
- (((gSavedSettings.getBOOL("AutoSnapshot") && LLView::isAvailable(previewp->mViewContainer)) ||
- (gSavedSettings.getBOOL("FreezeTime") && previewp->mAllowFullScreenPreview)) &&
+ (((auto_snapshot && LLView::isAvailable(previewp->mViewContainer)) ||
+ (freeze_time && previewp->mAllowFullScreenPreview)) &&
(new_camera_pos != previewp->mCameraPos || dot(new_camera_rot, previewp->mCameraRot) < 0.995f)))
{
previewp->mCameraPos = new_camera_pos;
previewp->mCameraRot = new_camera_rot;
// request a new snapshot whenever the camera moves, with a time delay
- bool new_snapshot = gSavedSettings.getBOOL("AutoSnapshot") || previewp->mForceUpdateSnapshot;
+ bool new_snapshot = auto_snapshot || previewp->mForceUpdateSnapshot;
LL_DEBUGS("Snapshot") << "camera moved, updating thumbnail" << LL_ENDL;
previewp->updateSnapshot(
new_snapshot, // whether a new snapshot is needed or merely invalidate the existing one
@@ -716,10 +746,10 @@ bool LLSnapshotLivePreview::onIdle( void* snapshot_preview )
previewp->getHeight(),
previewp->mKeepAspectRatio,//gSavedSettings.getBOOL("KeepAspectForSnapshot"),
previewp->getSnapshotType() == LLSnapshotModel::SNAPSHOT_TEXTURE,
- previewp->mAllowRenderUI && gSavedSettings.getBOOL("RenderUIInSnapshot"),
- gSavedSettings.getBOOL("RenderHUDInSnapshot"),
+ previewp->mAllowRenderUI && render_ui,
+ render_hud,
false,
- gSavedSettings.getBOOL("RenderSnapshotNoPost"),
+ render_no_post,
previewp->mSnapshotBufferType,
previewp->getMaxImageSize()))
{
@@ -731,7 +761,7 @@ bool LLSnapshotLivePreview::onIdle( void* snapshot_preview )
previewp->estimateDataSize();
// Full size preview is set: get the decoded image result and save it for animation
- if (gSavedSettings.getBOOL("UseFreezeFrame") && previewp->mAllowFullScreenPreview)
+ if (use_freeze_frame && previewp->mAllowFullScreenPreview)
{
previewp->prepareFreezeFrame();
}
@@ -744,7 +774,7 @@ bool LLSnapshotLivePreview::onIdle( void* snapshot_preview )
previewp->generateThumbnailImage(true) ;
}
previewp->getWindow()->decBusyCount();
- previewp->setVisible(gSavedSettings.getBOOL("UseFreezeFrame") && previewp->mAllowFullScreenPreview); // only show fullscreen preview when in freeze frame mode
+ previewp->setVisible(use_freeze_frame && previewp->mAllowFullScreenPreview); // only show fullscreen preview when in freeze frame mode
previewp->mSnapshotActive = false;
LL_DEBUGS("Snapshot") << "done creating snapshot" << LL_ENDL;
}
@@ -864,7 +894,9 @@ LLPointer<LLImageRaw> LLSnapshotLivePreview::getEncodedImage()
else
{
// Update mFormattedImage if necessary
- getFormattedImage();
+ lock.unlock();
+ getFormattedImage(); // will apply filters to mPreviewImage with a lock
+ lock.lock();
if (getSnapshotFormat() == LLSnapshotModel::SNAPSHOT_FORMAT_BMP)
{
// BMP hack : copy instead of decode otherwise decode will crash.
diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h
index ad2461f60f..077a949c05 100644
--- a/indra/newview/llspeakers.h
+++ b/indra/newview/llspeakers.h
@@ -37,7 +37,7 @@ class LLSpeakerMgr;
class LLAvatarName;
// data for a given participant in a voice channel
-class LLSpeaker : public LLRefCount, public LLOldEvents::LLObservable, public LLHandleProvider<LLSpeaker>, public boost::signals2::trackable
+class LLSpeaker : public LLRefCount, public LLOldEvents::LLObservable, public LLHandleProvider<LLSpeaker>
{
public:
typedef enum e_speaker_type
@@ -159,7 +159,7 @@ public:
*
* If action callback is not specified returns true. Instance will be deleted by LLEventTimer::updateClass().
*/
- virtual bool tick();
+ bool tick() override;
/**
* Clears the callback.
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 3b027df460..dd8c6d989e 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -181,7 +181,6 @@
#include "llnamelistctrl.h"
#include "llnamebox.h"
#include "llnameeditor.h"
-#include "llpostprocess.h"
#include "llagentlanguage.h"
#include "llwearable.h"
#include "llinventorybridge.h"
@@ -404,10 +403,10 @@ bool idle_startup()
static bool first_call = true;
if (first_call)
{
+ first_call = false;
// Other phases get handled when startup state changes,
// need to capture the initial state as well.
LLStartUp::getPhases().startPhase(LLStartUp::getStartupStateString());
- first_call = false;
}
gViewerWindow->showCursor();
@@ -1295,10 +1294,6 @@ bool idle_startup()
LLDrawable::initClass();
display_startup();
- // init the shader managers
- LLPostProcess::initClass();
- display_startup();
-
LLAvatarAppearance::initClass("avatar_lad.xml","avatar_skeleton.xml");
display_startup();
diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp
index 84503e66a5..43b7294b9a 100644
--- a/indra/newview/lltoast.cpp
+++ b/indra/newview/lltoast.cpp
@@ -43,34 +43,21 @@ LLToastLifeTimer::LLToastLifeTimer(LLToast* toast, F32 period)
{
}
-/*virtual*/
bool LLToastLifeTimer::tick()
{
- if (mEventTimer.hasExpired())
- {
- mToast->expire();
- }
+ mToast->expire();
return false;
}
-void LLToastLifeTimer::stop()
-{
- mEventTimer.stop();
-}
-
-void LLToastLifeTimer::start()
-{
- mEventTimer.start();
-}
-
void LLToastLifeTimer::restart()
{
- mEventTimer.reset();
+ // start() discards any previously-running mTimer
+ start();
}
bool LLToastLifeTimer::getStarted()
{
- return mEventTimer.getStarted();
+ return isRunning();
}
void LLToastLifeTimer::setPeriod(F32 period)
@@ -78,13 +65,6 @@ void LLToastLifeTimer::setPeriod(F32 period)
mPeriod = period;
}
-F32 LLToastLifeTimer::getRemainingTimeF32()
-{
- F32 et = mEventTimer.getElapsedTimeF32();
- if (!getStarted() || et > mPeriod) return 0.0f;
- return mPeriod - et;
-}
-
//--------------------------------------------------------------------------
LLToast::Params::Params()
: can_fade("can_fade", true),
@@ -337,7 +317,7 @@ void LLToast::setFading(bool transparent)
F32 LLToast::getTimeLeftToLive()
{
- F32 time_to_live = mTimer->getRemainingTimeF32();
+ F32 time_to_live = mTimer->getRemaining();
if (!mIsFading)
{
diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h
index cf116bfadf..dd2ced7352 100644
--- a/indra/newview/lltoast.h
+++ b/indra/newview/lltoast.h
@@ -53,15 +53,11 @@ public:
LLToastLifeTimer(LLToast* toast, F32 period);
/*virtual*/
- bool tick();
- void stop();
- void start();
+ bool tick() override;
void restart();
bool getStarted();
void setPeriod(F32 period);
- F32 getRemainingTimeF32();
- LLTimer& getEventTimer() { return mEventTimer;}
private :
LLToast* mToast;
};
diff --git a/indra/newview/lltoastalertpanel.h b/indra/newview/lltoastalertpanel.h
index 167a7b2363..c2cdd775f1 100644
--- a/indra/newview/lltoastalertpanel.h
+++ b/indra/newview/lltoastalertpanel.h
@@ -82,14 +82,10 @@ private:
struct ButtonData
{
- ButtonData()
- : mWidth(0)
- {}
-
- LLButton* mButton;
+ LLButton* mButton = nullptr;
std::string mURL;
- U32 mURLExternal;
- S32 mWidth;
+ U32 mURLExternal = 0;
+ S32 mWidth = 0;
};
std::vector<ButtonData> mButtonData;
diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp
index 42ee30409d..df79af4926 100644
--- a/indra/newview/lltoastimpanel.cpp
+++ b/indra/newview/lltoastimpanel.cpp
@@ -87,7 +87,10 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notif
{
LLAvatarName avatar_name;
LLAvatarNameCache::get(p.avatar_id, &avatar_name);
- p.message = "[From " + avatar_name.getDisplayName() + "]\n" + p.message;
+ // move Lua prefix from the message field to the [From] field
+ auto [message, is_lua] = LLStringUtil::withoutPrefix(p.message, LUA_PREFIX);
+ std::string prefix = is_lua ? "LUA - " : "";
+ p.message = "[From " + prefix + avatar_name.getDisplayName() + "]\n" + message;
}
style_params.font.style = "NORMAL";
mMessage->setText(p.message, style_params);
diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp
index 07963a7bed..2ffb571201 100644
--- a/indra/newview/lltoolmgr.cpp
+++ b/indra/newview/lltoolmgr.cpp
@@ -84,9 +84,9 @@ LLToolMgr::LLToolMgr()
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Active", boost::bind(&LLToolMgr::inEdit, this));
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&LLToolMgr::canEdit, this));
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.EnabledOrActive", boost::bind(&LLToolMgr::buildEnabledOrActive, this));
- LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this, _2));
+ LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", { boost::bind(&LLToolMgr::toggleBuildMode, this, _2) });
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Marketplace.Enabled", boost::bind(&LLToolMgr::canAccessMarketplace, this));
- LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Marketplace.Toggle", boost::bind(&LLToolMgr::toggleMarketplace, this, _2));
+ LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Marketplace.Toggle", { boost::bind(&LLToolMgr::toggleMarketplace, this, _2) });
gToolNull = new LLTool(LLStringUtil::null); // Does nothing
setCurrentTool(gToolNull);
diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp
index 24cfca5eee..8ce9a8b632 100644
--- a/indra/newview/lltoolmorph.cpp
+++ b/indra/newview/lltoolmorph.cpp
@@ -285,7 +285,7 @@ void LLVisualParamHint::draw(F32 alpha)
gGL.color4f(1.f, 1.f, 1.f, alpha);
LLGLSUIDefault gls_ui;
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLES);
{
gGL.texCoord2i(0, 1);
gGL.vertex2i(0, mFullHeight);
@@ -293,6 +293,11 @@ void LLVisualParamHint::draw(F32 alpha)
gGL.vertex2i(0, 0);
gGL.texCoord2i(1, 0);
gGL.vertex2i(mFullWidth, 0);
+
+ gGL.texCoord2i(0, 1);
+ gGL.vertex2i(0, mFullHeight);
+ gGL.texCoord2i(1, 0);
+ gGL.vertex2i(mFullWidth, 0);
gGL.texCoord2i(1, 1);
gGL.vertex2i(mFullWidth, mFullHeight);
}
diff --git a/indra/newview/lltoolplacer.cpp b/indra/newview/lltoolplacer.cpp
index b15bb5efd5..2ac5d6b6b1 100644
--- a/indra/newview/lltoolplacer.cpp
+++ b/indra/newview/lltoolplacer.cpp
@@ -164,13 +164,17 @@ bool LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics )
bool b_hit_land = false;
S32 hit_face = -1;
LLViewerObject* hit_obj = NULL;
- U8 state = 0;
bool success = raycastForNewObjPos( x, y, &hit_obj, &hit_face, &b_hit_land, &ray_start_region, &ray_end_region, &regionp );
if( !success )
{
return false;
}
+ return rezNewObject(pcode,hit_obj, hit_face, b_hit_land, ray_start_region, ray_end_region, regionp, use_physics);
+}
+bool LLToolPlacer::rezNewObject(LLPCode pcode, LLViewerObject * hit_obj, S32 hit_face, bool b_hit_land, LLVector3 ray_start_region,
+ LLVector3 ray_end_region, LLViewerRegion* regionp, U8 use_physics)
+{
if( hit_obj && (hit_obj->isAvatar() || hit_obj->isAttachment()) )
{
// Can't create objects on avatars or attachments
@@ -195,6 +199,8 @@ bool LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics )
bool create_selected = false;
LLVolumeParams volume_params;
+ U8 state = 0;
+
switch (pcode)
{
case LL_PCODE_LEGACY_GRASS:
diff --git a/indra/newview/lltoolplacer.h b/indra/newview/lltoolplacer.h
index f9501f83b2..92446c319b 100644
--- a/indra/newview/lltoolplacer.h
+++ b/indra/newview/lltoolplacer.h
@@ -50,6 +50,10 @@ public:
static void setObjectType( LLPCode type ) { sObjectType = type; }
static LLPCode getObjectType() { return sObjectType; }
+// static bool addObject(LLPCode pcode, S32 x, S32 y, U8 use_physics);
+ static bool rezNewObject(LLPCode pcode, LLViewerObject* hit_obj, S32 hit_face, bool b_hit_land, LLVector3 ray_start_region,
+ LLVector3 ray_end_region, LLViewerRegion *regionp, U8 use_physics);
+
protected:
static LLPCode sObjectType;
diff --git a/indra/newview/lltoolselect.cpp b/indra/newview/lltoolselect.cpp
index 5ccda7d4eb..3bd459f5b0 100644
--- a/indra/newview/lltoolselect.cpp
+++ b/indra/newview/lltoolselect.cpp
@@ -55,17 +55,17 @@ LLToolSelect::LLToolSelect( LLToolComposite* composite )
: LLTool( std::string("Select"), composite ),
mIgnoreGroup( false )
{
- }
+}
// True if you selected an object.
bool LLToolSelect::handleMouseDown(S32 x, S32 y, MASK mask)
{
// do immediate pick query
bool pick_rigged = false; //gSavedSettings.getBOOL("AnimatedObjectsAllowLeftClick");
- bool pick_transparent = gSavedSettings.getBOOL("SelectInvisibleObjects");
- bool pick_reflection_probe = gSavedSettings.getBOOL("SelectReflectionProbes");
+ static LLCachedControl<bool> select_invisible_objects(gSavedSettings, "SelectInvisibleObjects");
+ static LLCachedControl<bool> select_reflection_probes(gSavedSettings, "SelectReflectionProbes");
- mPick = gViewerWindow->pickImmediate(x, y, pick_transparent, pick_rigged, false, true, pick_reflection_probe);
+ mPick = gViewerWindow->pickImmediate(x, y, select_invisible_objects, pick_rigged, false, true, select_reflection_probes);
// Pass mousedown to agent
LLTool::handleMouseDown(x, y, mask);
@@ -73,7 +73,6 @@ bool LLToolSelect::handleMouseDown(S32 x, S32 y, MASK mask)
return mPick.getObject().notNull();
}
-
// static
LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pick, bool ignore_group, bool temp_select, bool select_root)
{
diff --git a/indra/newview/lluilistener.cpp b/indra/newview/lluilistener.cpp
index beae71e7bf..44eb8461f1 100644
--- a/indra/newview/lluilistener.cpp
+++ b/indra/newview/lluilistener.cpp
@@ -34,55 +34,195 @@
// std headers
// external library headers
// other Linden headers
+#include "llmenugl.h"
+#include "lltoolbarview.h"
#include "llui.h" // getRootView(), resolvePath()
#include "lluictrl.h"
#include "llerror.h"
+#include "llviewermenufile.h" // close_all_windows()
+extern LLMenuBarGL* gMenuBarView;
+
+#define THROTTLE_PERIOD 1.5 // required seconds between throttled functions
+#define MIN_THROTTLE 0.5
LLUIListener::LLUIListener():
LLEventAPI("UI",
- "LLUICtrl::CommitCallbackRegistry listener.\n"
- "Capable of invoking any function (with parameter) you can specify in XUI.")
+ "Operations to manipulate the viewer's user interface.")
{
add("call",
"Invoke the operation named by [\"function\"], passing [\"parameter\"],\n"
"as if from a user gesture on a menu -- or a button click.",
&LLUIListener::call,
- LLSD().with("function", LLSD()));
+ llsd::map("function", LLSD(), "reply", LLSD()));
+
+ add("callables",
+ "Return a list [\"callables\"] of dicts {name, access} of functions registered to\n"
+ "invoke with \"call\".\n"
+ "access has values \"allow\", \"block\" or \"throttle\".",
+ &LLUIListener::callables,
+ llsd::map("reply", LLSD::String()));
add("getValue",
"For the UI control identified by the path in [\"path\"], return the control's\n"
"current value as [\"value\"] reply.",
&LLUIListener::getValue,
- LLSDMap("path", LLSD())("reply", LLSD()));
+ llsd::map("path", LLSD(), "reply", LLSD()));
+
+ add("getTopMenus",
+ "List names of Top menus suitable for passing as \"parent_menu\"",
+ &LLUIListener::getTopMenus,
+ llsd::map("reply", LLSD::String()));
+
+ LLSD required_args = llsd::map("name", LLSD(), "label", LLSD(), "reply", LLSD());
+ add("addMenu",
+ "Add new drop-down menu [\"name\"] with displayed [\"label\"] to the Top menu.",
+ &LLUIListener::addMenu,
+ required_args);
+
+ required_args.insert("parent_menu", LLSD());
+ add("addMenuBranch",
+ "Add new menu branch [\"name\"] with displayed [\"label\"]\n"
+ "to the [\"parent_menu\"] within the Top menu.",
+ &LLUIListener::addMenuBranch,
+ required_args);
+
+ add("addMenuItem",
+ "Add new menu item [\"name\"] with displayed [\"label\"]\n"
+ "and call-on-click UI function [\"func\"] with optional [\"param\"]\n"
+ "to the [\"parent_menu\"] within the Top menu.\n"
+ "If [\"pos\"] is present, insert at specified 0-relative position.",
+ &LLUIListener::addMenuItem,
+ required_args.with("func", LLSD()));
+
+ add("addMenuSeparator",
+ "Add menu separator to the [\"parent_menu\"] within the Top menu.\n"
+ "If [\"pos\"] is present, insert at specified 0-relative position.",
+ &LLUIListener::addMenuSeparator,
+ llsd::map("parent_menu", LLSD(), "reply", LLSD()));
+
+ add("setMenuVisible",
+ "Set menu [\"name\"] visibility to [\"visible\"]",
+ &LLUIListener::setMenuVisible,
+ llsd::map("name", LLSD(), "visible", LLSD(), "reply", LLSD()));
+
+ add("defaultToolbars",
+ "Restore default toolbar buttons",
+ &LLUIListener::restoreDefaultToolbars);
+
+ add("clearAllToolbars",
+ "Clear all buttons off the toolbars",
+ &LLUIListener::clearAllToolbars);
+
+ add("addToolbarBtn",
+ "Add [\"btn_name\"] toolbar button to the [\"toolbar\"]:\n"
+ "\"left\", \"right\", \"bottom\" (default is \"bottom\")\n"
+ "Position of the command in the original list can be specified as [\"rank\"],\n"
+ "where 0 means the first item",
+ &LLUIListener::addToolbarBtn,
+ llsd::map("btn_name", LLSD(), "reply", LLSD()));
+
+ add("removeToolbarBtn",
+ "Remove [\"btn_name\"] toolbar button off the toolbar,\n"
+ "return [\"rank\"] (old position) of the command in the original list,\n"
+ "rank 0 is the first position,\n"
+ "rank -1 means that [\"btn_name\"] was not found",
+ &LLUIListener::removeToolbarBtn,
+ llsd::map("btn_name", LLSD(), "reply", LLSD()));
+
+ add("getToolbarBtnNames",
+ "Return the table of Toolbar buttons names",
+ &LLUIListener::getToolbarBtnNames,
+ llsd::map("reply", LLSD()));
+
+ add("closeAllFloaters",
+ "Close all the floaters",
+ &LLUIListener::closeAllFloaters);
}
-void LLUIListener::call(const LLSD& event) const
+typedef LLUICtrl::CommitCallbackInfo cb_info;
+void LLUIListener::call(const LLSD& event)
{
- LLUICtrl::commit_callback_t* func =
- LLUICtrl::CommitCallbackRegistry::getValue(event["function"]);
- if (! func)
+ Response response(LLSD(), event);
+ cb_info *info = LLUICtrl::CommitCallbackRegistry::getValue(event["function"]);
+ if (!info || !info->callback_func)
+ {
+ return response.error(stringize("Function ", std::quoted(event["function"].asString()), " was not found"));
+ }
+ if (info->handle_untrusted == cb_info::UNTRUSTED_BLOCK)
+ {
+ return response.error(stringize("Function ", std::quoted(event["function"].asString()), " may not be called from the script"));
+ }
+
+ //Separate UNTRUSTED_THROTTLE and UNTRUSTED_ALLOW functions to have different timeout
+ F64 *throttlep, period;
+ if (info->handle_untrusted == cb_info::UNTRUSTED_THROTTLE)
{
- // This API is intended for use by a script. It's a fire-and-forget
- // API: we provide no reply. Therefore, a typo in the script will
- // provide no feedback whatsoever to that script. To rub the coder's
- // nose in such an error, crump rather than quietly ignoring it.
- LL_ERRS("LLUIListener") << "function '" << event["function"] << "' not found" << LL_ENDL;
+ throttlep = &mLastUntrustedThrottle;
+ period = THROTTLE_PERIOD;
}
else
{
- // Interestingly, view_listener_t::addMenu() (addCommit(),
- // addEnable()) constructs a commit_callback_t callable that accepts
- // two parameters but discards the first. Only the second is passed to
- // handleEvent(). Therefore we feel completely safe passing NULL for
- // the first parameter.
- (*func)(NULL, event["parameter"]);
+ throttlep = &mLastMinThrottle;
+ period = MIN_THROTTLE;
+ }
+
+ F64 cur_time = LLTimer::getElapsedSeconds();
+ F64 time_delta = *throttlep + period;
+ if (cur_time < time_delta)
+ {
+ LL_WARNS("LLUIListener") << "Throttled function " << std::quoted(event["function"].asString()) << LL_ENDL;
+ return;
}
+ *throttlep = cur_time;
+
+ // Interestingly, view_listener_t::addMenu() (addCommit(),
+ // addEnable()) constructs a commit_callback_t callable that accepts
+ // two parameters but discards the first. Only the second is passed to
+ // handleEvent(). Therefore we feel completely safe passing NULL for
+ // the first parameter.
+ (info->callback_func)(NULL, event["parameter"]);
}
-void LLUIListener::getValue(const LLSD&event) const
+void LLUIListener::callables(const LLSD& event) const
{
- LLSD reply = LLSD::emptyMap();
+ Response response(LLSD(), event);
+
+ using Registry = LLUICtrl::CommitCallbackRegistry;
+ using Method = Registry::Registrar& (*)();
+ static Method registrars[] =
+ {
+ &Registry::defaultRegistrar,
+ &Registry::currentRegistrar,
+ };
+ LLSD list;
+ for (auto method : registrars)
+ {
+ auto& registrar{ (*method)() };
+ for (auto it = registrar.beginItems(), end = registrar.endItems(); it != end; ++it)
+ {
+ LLSD entry{ llsd::map("name", it->first) };
+ switch (it->second.handle_untrusted)
+ {
+ case cb_info::UNTRUSTED_ALLOW:
+ entry["access"] = "allow";
+ break;
+ case cb_info::UNTRUSTED_BLOCK:
+ entry["access"] = "block";
+ break;
+ case cb_info::UNTRUSTED_THROTTLE:
+ entry["access"] = "throttle";
+ break;
+ }
+ list.append(entry);
+ }
+ }
+ response["callables"] = list;
+}
+
+void LLUIListener::getValue(const LLSD& event) const
+{
+ Response response(LLSD(), event);
const LLView* root = LLUI::getInstance()->getRootView();
const LLView* view = LLUI::getInstance()->resolvePath(root, event["path"].asString());
@@ -90,12 +230,192 @@ void LLUIListener::getValue(const LLSD&event) const
if (ctrl)
{
- reply["value"] = ctrl->getValue();
+ response["value"] = ctrl->getValue();
}
else
{
- // *TODO: ??? return something indicating failure to resolve
+ response.error(stringize("UI control ", std::quoted(event["path"].asString()), " was not found"));
+ }
+}
+
+void LLUIListener::getTopMenus(const LLSD& event) const
+{
+ Response response(LLSD(), event);
+ response["menus"] = llsd::toArray(
+ *gMenuBarView->getChildList(),
+ [](auto childp) {return childp->getName(); });
+}
+
+LLMenuGL::Params get_params(const LLSD&event)
+{
+ LLMenuGL::Params item_params;
+ item_params.name = event["name"];
+ item_params.label = event["label"];
+ item_params.can_tear_off = true;
+ return item_params;
+}
+
+LLMenuGL* get_parent_menu(LLEventAPI::Response& response, const LLSD&event)
+{
+ auto parent_menu_name{ event["parent_menu"].asString() };
+ LLMenuGL* parent_menu = gMenuBarView->findChildMenuByName(parent_menu_name, true);
+ if(!parent_menu)
+ {
+ response.error(stringize("Parent menu ", std::quoted(parent_menu_name), " was not found"));
+ }
+ return parent_menu;
+}
+
+// Return event["pos"].asInteger() if passed, but clamp (0 <= pos <= size).
+// Reserve -1 return to mean event has no "pos" key.
+S32 get_pos(const LLSD& event, U32 size)
+{
+ return event["pos"].isInteger()? llclamp(event["pos"].asInteger(), 0, size) : -1;
+}
+
+void LLUIListener::addMenu(const LLSD&event) const
+{
+ Response response(LLSD(), event);
+ LLMenuGL::Params item_params = get_params(event);
+ if(!gMenuBarView->appendMenu(LLUICtrlFactory::create<LLMenuGL>(item_params)))
+ {
+ response.error(stringize("Menu ", std::quoted(event["name"].asString()), " was not added"));
+ }
+}
+
+void LLUIListener::addMenuBranch(const LLSD&event) const
+{
+ Response response(LLSD(), event);
+ if(LLMenuGL* parent_menu = get_parent_menu(response, event))
+ {
+ LLMenuGL::Params item_params = get_params(event);
+ if(!parent_menu->appendMenu(LLUICtrlFactory::create<LLMenuGL>(item_params)))
+ {
+ response.error(stringize("Menu branch ", std::quoted(event["name"].asString()), " was not added"));
+ }
+ }
+}
+
+void LLUIListener::addMenuItem(const LLSD&event) const
+{
+ Response response(LLSD(), event);
+ LLMenuItemCallGL::Params item_params;
+ item_params.name = event["name"];
+ item_params.label = event["label"];
+ LLUICtrl::CommitCallbackParam item_func;
+ item_func.function_name = event["func"];
+ if (event.has("param"))
+ {
+ item_func.parameter = event["param"];
}
+ item_params.on_click = item_func;
+ if(LLMenuGL* parent_menu = get_parent_menu(response, event))
+ {
+ auto item = LLUICtrlFactory::create<LLMenuItemCallGL>(item_params);
+ // Clamp pos to getItemCount(), meaning append. If pos exceeds that,
+ // insert() will silently ignore the request.
+ auto pos = get_pos(event, parent_menu->getItemCount());
+ if (pos >= 0)
+ {
+ // insert() returns void: we just have to assume it worked.
+ parent_menu->insert(pos, item);
+ }
+ else if (! parent_menu->append(item))
+ {
+ response.error(stringize("Menu item ", std::quoted(event["name"].asString()),
+ " was not added"));
+ }
+ }
+}
+
+void LLUIListener::addMenuSeparator(const LLSD&event) const
+{
+ Response response(LLSD(), event);
+ if(LLMenuGL* parent_menu = get_parent_menu(response, event))
+ {
+ // Clamp pos to getItemCount(), meaning append. If pos exceeds that,
+ // insert() will silently ignore the request.
+ auto pos = get_pos(event, parent_menu->getItemCount());
+ if (pos >= 0)
+ {
+ // Even though addSeparator() does not accept a position,
+ // LLMenuItemSeparatorGL isa LLMenuItemGL, so we can use insert().
+ LLMenuItemSeparatorGL::Params p;
+ LLMenuItemGL* separator = LLUICtrlFactory::create<LLMenuItemSeparatorGL>(p);
+ // insert() returns void: we just have to assume it worked.
+ parent_menu->insert(pos, separator);
+ }
+ else if (! parent_menu->addSeparator())
+ {
+ response.error("Separator was not added");
+ }
+ }
+}
- sendReply(reply, event);
+void LLUIListener::setMenuVisible(const LLSD &event) const
+{
+ Response response(LLSD(), event);
+ std::string menu_name(event["name"]);
+ if (!gMenuBarView->getItem(menu_name))
+ {
+ return response.error(stringize("Menu ", std::quoted(menu_name), " was not found"));
+ }
+ gMenuBarView->setItemVisible(menu_name, event["visible"].asBoolean());
+}
+
+void LLUIListener::restoreDefaultToolbars(const LLSD &event) const
+{
+ LLToolBarView::loadDefaultToolbars();
+}
+
+void LLUIListener::clearAllToolbars(const LLSD &event) const
+{
+ LLToolBarView::clearAllToolbars();
+}
+
+void LLUIListener::addToolbarBtn(const LLSD &event) const
+{
+ Response response(LLSD(), event);
+
+ typedef LLToolBarEnums::EToolBarLocation ToolBarLocation;
+ ToolBarLocation toolbar = ToolBarLocation::TOOLBAR_BOTTOM;
+ if (event.has("toolbar"))
+ {
+ if (event["toolbar"] == "left")
+ {
+ toolbar = ToolBarLocation::TOOLBAR_LEFT;
+ }
+ else if (event["toolbar"] == "right")
+ {
+ toolbar = ToolBarLocation::TOOLBAR_RIGHT;
+ }
+ else if (event["toolbar"] != "bottom")
+ {
+ return response.error(stringize("Toolbar name ", std::quoted(event["toolbar"].asString()), " is not correct. Toolbar names are: left, right, bottom"));
+ }
+ }
+ S32 rank = event.has("rank") ? event["rank"].asInteger() : LLToolBar::RANK_NONE;
+ if(!gToolBarView->addCommand(event["btn_name"].asString(), toolbar, rank))
+ {
+ response.error(stringize("Toolbar button ", std::quoted(event["btn_name"].asString()), " was not found"));
+ }
+}
+
+void LLUIListener::removeToolbarBtn(const LLSD &event) const
+{
+ Response response(LLSD(), event);
+
+ S32 old_rank = LLToolBar::RANK_NONE;
+ gToolBarView->removeCommand(event["btn_name"].asString(), old_rank);
+ response["rank"] = old_rank;
+}
+
+void LLUIListener::getToolbarBtnNames(const LLSD &event) const
+{
+ Response response(llsd::map("cmd_names", LLCommandManager::instance().getCommandNames()), event);
+}
+
+void LLUIListener::closeAllFloaters(const LLSD &event) const
+{
+ close_all_windows();
}
diff --git a/indra/newview/lluilistener.h b/indra/newview/lluilistener.h
index 70455c2c68..8fc8e6ebb4 100644
--- a/indra/newview/lluilistener.h
+++ b/indra/newview/lluilistener.h
@@ -40,8 +40,27 @@ public:
LLUIListener();
private:
- void call(const LLSD& event) const;
- void getValue(const LLSD&event) const;
+ void call(const LLSD& event);
+ void callables(const LLSD& event) const;
+ void getValue(const LLSD& event) const;
+ void getTopMenus(const LLSD& event) const;
+
+ void addMenu(const LLSD&event) const;
+ void addMenuBranch(const LLSD&event) const;
+ void addMenuItem(const LLSD&event) const;
+ void addMenuSeparator(const LLSD&event) const;
+ void setMenuVisible(const LLSD &event) const;
+
+ void restoreDefaultToolbars(const LLSD &event) const;
+ void clearAllToolbars(const LLSD &event) const;
+ void addToolbarBtn(const LLSD &event) const;
+ void removeToolbarBtn(const LLSD &event) const;
+ void getToolbarBtnNames(const LLSD &event) const;
+
+ void closeAllFloaters(const LLSD &event) const;
+
+ F64 mLastUntrustedThrottle {0};
+ F64 mLastMinThrottle {0};
};
#endif /* ! defined(LL_LLUILISTENER_H) */
diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp
index 39a9f0f8bc..166542324d 100644
--- a/indra/newview/llurldispatcher.cpp
+++ b/indra/newview/llurldispatcher.cpp
@@ -289,6 +289,8 @@ public:
LLEventAPI::add("teleport",
"Teleport to specified [\"regionname\"] at\n"
"specified region-relative [\"x\"], [\"y\"], [\"z\"].\n"
+ "If [\"regionname\"] is \"home\", ignore [\"x\"], [\"y\"], [\"z\"]\n"
+ "and teleport home.\n"
"If [\"regionname\"] omitted, teleport to GLOBAL\n"
"coordinates [\"x\"], [\"y\"], [\"z\"].",
&LLTeleportHandler::from_event);
@@ -328,7 +330,12 @@ public:
void from_event(const LLSD& params) const
{
Response response(LLSD(), params);
- if (params.has("regionname"))
+ if (params["regionname"].asString() == "home")
+ {
+ gAgent.teleportHome();
+ response["message"] = "Teleporting home";
+ }
+ else if (params.has("regionname"))
{
// region specified, coordinates (if any) are region-local
LLVector3 local_pos(
diff --git a/indra/newview/llviewerchat.cpp b/indra/newview/llviewerchat.cpp
index 8b01c4ef88..5daccb6784 100644
--- a/indra/newview/llviewerchat.cpp
+++ b/indra/newview/llviewerchat.cpp
@@ -30,6 +30,7 @@
// newview includes
#include "llagent.h" // gAgent
#include "llslurl.h"
+#include "lltrans.h"
#include "lluicolor.h"
#include "lluicolortable.h"
#include "llviewercontrol.h" // gSavedSettings
@@ -220,8 +221,7 @@ S32 LLViewerChat::getChatFontSize()
//static
void LLViewerChat::formatChatMsg(const LLChat& chat, std::string& formated_msg)
{
- std::string tmpmsg = chat.mText;
-
+ std::string tmpmsg = without_LUA_PREFIX(chat.mText, chat.mIsScript);
if(chat.mChatStyle == CHAT_STYLE_IRC)
{
formated_msg = chat.mFromName + tmpmsg.substr(3);
@@ -231,6 +231,11 @@ void LLViewerChat::formatChatMsg(const LLChat& chat, std::string& formated_msg)
formated_msg = tmpmsg;
}
+ if (chat.mIsScript)
+ {
+ formated_msg = LLTrans::getString("ScriptStr") + formated_msg;
+ }
+
}
//static
diff --git a/indra/newview/llviewercontrollistener.cpp b/indra/newview/llviewercontrollistener.cpp
index 6f77e21fcc..4e39b03903 100644
--- a/indra/newview/llviewercontrollistener.cpp
+++ b/indra/newview/llviewercontrollistener.cpp
@@ -141,7 +141,8 @@ void LLViewerControlListener::set(LLSD const & request)
if (request.has("value"))
{
- info.control->setValue(request["value"]);
+ LL_WARNS("LLViewerControlListener") << "Changing debug setting " << std::quoted(info.key) << " to " << request["value"] << LL_ENDL;
+ info.control->setValue(request["value"], false);
}
else
{
@@ -158,7 +159,9 @@ void LLViewerControlListener::toggle(LLSD const & request)
if (info.control->isType(TYPE_BOOLEAN))
{
- info.control->set(! info.control->get().asBoolean());
+ bool value = !info.control->get().asBoolean();
+ LL_WARNS("LLViewerControlListener") << "Toggling debug setting " << std::quoted(info.key) << " to " << value << LL_ENDL;
+ info.control->set(value, false);
}
else
{
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 301ea5c5f6..1f4502323c 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -28,58 +28,69 @@
#include "llviewerdisplay.h"
-#include "llgl.h"
-#include "llrender.h"
-#include "llglheaders.h"
-#include "llgltfmateriallist.h"
+#include "fsyspath.h"
+#include "hexdump.h"
#include "llagent.h"
#include "llagentcamera.h"
-#include "llviewercontrol.h"
+#include "llappviewer.h"
#include "llcoord.h"
#include "llcriticaldamp.h"
+#include "llcubemap.h"
#include "lldir.h"
-#include "lldynamictexture.h"
#include "lldrawpoolalpha.h"
+#include "lldrawpoolbump.h"
+#include "lldrawpoolwater.h"
+#include "lldynamictexture.h"
+#include "llenvironment.h"
+#include "llfasttimer.h"
#include "llfeaturemanager.h"
-//#include "llfirstuse.h"
+#include "llfloatertools.h"
+#include "llfocusmgr.h"
+#include "llgl.h"
+#include "llglheaders.h"
+#include "llgltfmateriallist.h"
#include "llhudmanager.h"
#include "llimagepng.h"
+#include "llmachineid.h"
#include "llmemory.h"
+#include "llparcel.h"
+#include "llperfstats.h"
+#include "llrender.h"
+#include "llscenemonitor.h"
+#include "llsdjson.h"
#include "llselectmgr.h"
#include "llsky.h"
+#include "llspatialpartition.h"
+#include "llstartup.h"
#include "llstartup.h"
+#include "lltooldraganddrop.h"
#include "lltoolfocus.h"
#include "lltoolmgr.h"
-#include "lltooldraganddrop.h"
#include "lltoolpie.h"
#include "lltracker.h"
#include "lltrans.h"
#include "llui.h"
+#include "lluuid.h"
+#include "llversioninfo.h"
#include "llviewercamera.h"
+#include "llviewercontrol.h"
+#include "llviewernetwork.h"
#include "llviewerobjectlist.h"
#include "llviewerparcelmgr.h"
+#include "llviewerregion.h"
+#include "llviewershadermgr.h"
+#include "llviewertexturelist.h"
#include "llviewerwindow.h"
#include "llvoavatarself.h"
#include "llvograss.h"
#include "llworld.h"
#include "pipeline.h"
-#include "llspatialpartition.h"
-#include "llappviewer.h"
-#include "llstartup.h"
-#include "llviewershadermgr.h"
-#include "llfasttimer.h"
-#include "llfloatertools.h"
-#include "llviewertexturelist.h"
-#include "llfocusmgr.h"
-#include "llcubemap.h"
-#include "llviewerregion.h"
-#include "lldrawpoolwater.h"
-#include "lldrawpoolbump.h"
-#include "llpostprocess.h"
-#include "llscenemonitor.h"
-#include "llenvironment.h"
-#include "llperfstats.h"
+#include <boost/json.hpp>
+
+#include <filesystem>
+#include <iomanip>
+#include <sstream>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
@@ -88,13 +99,13 @@
extern LLPointer<LLViewerTexture> gStartTexture;
extern bool gShiftFrame;
-LLPointer<LLViewerTexture> gDisconnectedImagep = NULL;
+LLPointer<LLViewerTexture> gDisconnectedImagep = nullptr;
// used to toggle renderer back on after teleport
bool gTeleportDisplay = false;
LLFrameTimer gTeleportDisplayTimer;
LLFrameTimer gTeleportArrivalTimer;
-const F32 RESTORE_GL_TIME = 5.f; // Wait this long while reloading textures before we raise the curtain
+constexpr F32 RESTORE_GL_TIME = 5.f; // Wait this long while reloading textures before we raise the curtain
bool gForceRenderLandFence = false;
bool gDisplaySwapBuffers = false;
@@ -108,9 +119,9 @@ bool gSnapshotNoPost = false;
bool gShaderProfileFrame = false;
// This is how long the sim will try to teleport you before giving up.
-const F32 TELEPORT_EXPIRY = 15.0f;
+constexpr F32 TELEPORT_EXPIRY = 15.0f;
// Additional time (in seconds) to wait per attachment
-const F32 TELEPORT_EXPIRY_PER_ATTACHMENT = 3.f;
+constexpr F32 TELEPORT_EXPIRY_PER_ATTACHMENT = 3.f;
U32 gRecentFrameCount = 0; // number of 'recent' frames
LLFrameTimer gRecentFPSTime;
@@ -118,8 +129,6 @@ LLFrameTimer gRecentMemoryTime;
LLFrameTimer gAssetStorageLogTime;
// Rendering stuff
-void pre_show_depth_buffer();
-void post_show_depth_buffer();
void render_ui(F32 zoom_factor = 1.f, int subfield = 0);
void swap();
void render_hud_attachments();
@@ -127,6 +136,9 @@ void render_ui_3d();
void render_ui_2d();
void render_disconnected_background();
+void getProfileStatsContext(boost::json::object& stats);
+std::string getProfileStatsFilename();
+
void display_startup()
{
if ( !gViewerWindow
@@ -197,7 +209,8 @@ void display_update_camera()
F32 final_far = gAgentCamera.mDrawDistance;
if (gCubeSnapshot)
{
- final_far = gSavedSettings.getF32("RenderReflectionProbeDrawDistance");
+ static LLCachedControl<F32> reflection_probe_draw_distance(gSavedSettings, "RenderReflectionProbeDrawDistance", 64.f);
+ final_far = reflection_probe_draw_distance();
}
else if (CAMERA_MODE_CUSTOMIZE_AVATAR == gAgentCamera.getCameraMode())
@@ -218,7 +231,7 @@ void display_update_camera()
void display_stats()
{
LL_PROFILE_ZONE_SCOPED;
- const F32 FPS_LOG_FREQUENCY = 10.f;
+ constexpr F32 FPS_LOG_FREQUENCY = 10.f;
if (gRecentFPSTime.getElapsedTimeF32() >= FPS_LOG_FREQUENCY)
{
LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("DS - FPS");
@@ -227,7 +240,7 @@ void display_stats()
gRecentFrameCount = 0;
gRecentFPSTime.reset();
}
- F32 mem_log_freq = gSavedSettings.getF32("MemoryLogFrequency");
+ static LLCachedControl<F32> mem_log_freq(gSavedSettings, "MemoryLogFrequency", 600.f);
if (mem_log_freq > 0.f && gRecentMemoryTime.getElapsedTimeF32() >= mem_log_freq)
{
LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("DS - Memory");
@@ -237,7 +250,7 @@ void display_stats()
LLMemory::logMemoryInfo(true) ;
gRecentMemoryTime.reset();
}
- const F32 ASSET_STORAGE_LOG_FREQUENCY = 60.f;
+ constexpr F32 ASSET_STORAGE_LOG_FREQUENCY = 60.f;
if (gAssetStorageLogTime.getElapsedTimeF32() >= ASSET_STORAGE_LOG_FREQUENCY)
{
LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("DS - Asset Storage");
@@ -524,8 +537,10 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot)
LLImageGL::updateStats(gFrameTimeSeconds);
- LLVOAvatar::sRenderName = gSavedSettings.getS32("AvatarNameTagMode");
- LLVOAvatar::sRenderGroupTitles = (gSavedSettings.getBOOL("NameTagShowGroupTitles") && gSavedSettings.getS32("AvatarNameTagMode"));
+ static LLCachedControl<S32> avatar_name_tag_mode(gSavedSettings, "AvatarNameTagMode", 1);
+ static LLCachedControl<bool> name_tag_show_group_titles(gSavedSettings, "NameTagShowGroupTitles", true);
+ LLVOAvatar::sRenderName = avatar_name_tag_mode;
+ LLVOAvatar::sRenderGroupTitles = name_tag_show_group_titles && avatar_name_tag_mode > 0;
gPipeline.mBackfaceCull = true;
gFrameCount++;
@@ -748,7 +763,7 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot)
}
gGL.setColorMask(true, true);
- glClearColor(0,0,0,0);
+ glClearColor(0.f, 0.f, 0.f, 0.f);
LLGLState::checkStates();
@@ -918,7 +933,7 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot)
gPipeline.mRT->deferredScreen.bindTarget();
if (gUseWireframe)
{
- F32 g = 0.5f;
+ constexpr F32 g = 0.5f;
glClearColor(g, g, g, 1.f);
}
else
@@ -932,8 +947,8 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot)
gPipeline.mRT->screen.bindTarget();
if (LLPipeline::sUnderWaterRender && !gPipeline.canUseWindLightShaders())
{
- const LLColor4 &col = LLEnvironment::instance().getCurrentWater()->getWaterFogColor();
- glClearColor(col.mV[0], col.mV[1], col.mV[2], 0.f);
+ const LLColor4& col = LLEnvironment::instance().getCurrentWater()->getWaterFogColor();
+ glClearColor(col.mV[VRED], col.mV[VGREEN], col.mV[VBLUE], 0.f);
}
gPipeline.mRT->screen.clear();
}
@@ -948,11 +963,12 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot)
LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("display - 5")
LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
- if (gSavedSettings.getBOOL("RenderDepthPrePass"))
+ static LLCachedControl<bool> render_depth_pre_pass(gSavedSettings, "RenderDepthPrePass", false);
+ if (render_depth_pre_pass)
{
gGL.setColorMask(false, false);
- static const U32 types[] = {
+ constexpr U32 types[] = {
LLRenderPass::PASS_SIMPLE,
LLRenderPass::PASS_FULLBRIGHT,
LLRenderPass::PASS_SHINY
@@ -1027,8 +1043,87 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot)
if (gShaderProfileFrame)
{
gShaderProfileFrame = false;
- LLGLSLShader::finishProfile();
+ boost::json::value stats{ boost::json::object_kind };
+ getProfileStatsContext(stats.as_object());
+ LLGLSLShader::finishProfile(stats);
+
+ auto report_name = getProfileStatsFilename();
+ std::ofstream outf(report_name);
+ if (! outf)
+ {
+ LL_WARNS() << "Couldn't write to " << std::quoted(report_name) << LL_ENDL;
+ }
+ else
+ {
+ outf << stats;
+ LL_INFOS() << "(also dumped to " << std::quoted(report_name) << ")" << LL_ENDL;
+ }
+ }
+}
+
+void getProfileStatsContext(boost::json::object& stats)
+{
+ // populate the context with info from LLFloaterAbout
+ auto contextit = stats.emplace("context",
+ LlsdToJson(LLAppViewer::instance()->getViewerInfo())).first;
+ auto& context = contextit->value().as_object();
+
+ // then add a few more things
+ unsigned char unique_id[MAC_ADDRESS_BYTES]{};
+ LLMachineID::getUniqueID(unique_id, sizeof(unique_id));
+ context.emplace("machine", stringize(LL::hexdump(unique_id, sizeof(unique_id))));
+ context.emplace("grid", LLGridManager::instance().getGrid());
+ LLViewerRegion* region = gAgent.getRegion();
+ if (region)
+ {
+ context.emplace("regionid", stringize(region->getRegionID()));
+ }
+ LLParcel* parcel = LLViewerParcelMgr::instance().getAgentParcel();
+ if (parcel)
+ {
+ context.emplace("parcel", parcel->getName());
+ context.emplace("parcelid", parcel->getLocalID());
}
+ context.emplace("time", LLDate::now().toHTTPDateString("%Y-%m-%dT%H:%M:%S"));
+}
+
+std::string getProfileStatsFilename()
+{
+ std::ostringstream basebuff;
+ // viewer build
+ basebuff << "profile.v" << LLVersionInfo::instance().getBuild();
+ // machine ID: zero-initialize unique_id in case LLMachineID fails
+ unsigned char unique_id[MAC_ADDRESS_BYTES]{};
+ LLMachineID::getUniqueID(unique_id, sizeof(unique_id));
+ basebuff << ".m" << LL::hexdump(unique_id, sizeof(unique_id));
+ // region ID
+ LLViewerRegion *region = gAgent.getRegion();
+ basebuff << ".r" << (region? region->getRegionID() : LLUUID());
+ // local parcel ID
+ LLParcel* parcel = LLViewerParcelMgr::instance().getAgentParcel();
+ basebuff << ".p" << (parcel? parcel->getLocalID() : 0);
+ // date/time -- omit seconds for now
+ auto now = LLDate::now();
+ basebuff << ".t" << LLDate::now().toHTTPDateString("%Y-%m-%dT%H-%M-");
+ // put this candidate file in our logs directory
+ auto base = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, basebuff.str());
+ S32 sec;
+ now.split(nullptr, nullptr, nullptr, nullptr, nullptr, &sec);
+ // Loop over finished filename, incrementing sec until we find one that
+ // doesn't yet exist. Should rarely loop (only if successive calls within
+ // same second), may produce (e.g.) sec==61, but avoids collisions and
+ // preserves chronological filename sort order.
+ std::string name;
+ std::error_code ec;
+ do
+ {
+ // base + missing 2-digit seconds, append ".json"
+ // post-increment sec in case we have to try again
+ name = stringize(base, std::setw(2), std::setfill('0'), sec++, ".json");
+ } while (std::filesystem::exists(fsyspath(name), ec));
+ // Ignoring ec means we might potentially return a name that does already
+ // exist -- but if we can't check its existence, what more can we do?
+ return name;
}
// WIP simplified copy of display() that does minimal work
@@ -1087,7 +1182,7 @@ void display_cube_face()
gGL.setColorMask(true, true);
- glClearColor(0, 0, 0, 0);
+ glClearColor(0.f, 0.f, 0.f, 0.f);
gPipeline.generateSunShadow(*LLViewerCamera::getInstance());
glClear(GL_DEPTH_BUFFER_BIT); // | GL_STENCIL_BUFFER_BIT);
@@ -1123,7 +1218,7 @@ void display_cube_face()
}
else
{
- glClearColor(1, 0, 1, 1);
+ glClearColor(1.f, 0.f, 1.f, 1.f);
}
gPipeline.mRT->deferredScreen.clear();
@@ -1164,11 +1259,12 @@ void render_hud_attachments()
{
LLPipeline::sRenderingHUDs = true;
LLCamera hud_cam = *LLViewerCamera::getInstance();
- hud_cam.setOrigin(-1.f,0,0);
- hud_cam.setAxes(LLVector3(1,0,0), LLVector3(0,1,0), LLVector3(0,0,1));
+ hud_cam.setOrigin(-1.f, 0.f, 0.f);
+ hud_cam.setAxes(LLVector3(1.f, 0.f, 0.f), LLVector3(0.f, 1.f, 0.f), LLVector3(0.f, 0.f, 1.f));
LLViewerCamera::updateFrustumPlanes(hud_cam, true);
- bool render_particles = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES) && gSavedSettings.getBOOL("RenderHUDParticles");
+ static LLCachedControl<bool> render_hud_particles(gSavedSettings, "RenderHUDParticles", false);
+ bool render_particles = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES) && render_hud_particles;
//only render hud objects
gPipeline.pushRenderTypeMask();
@@ -1528,10 +1624,11 @@ void render_ui_3d()
stop_glerror();
gUIProgram.bind();
- gGL.color4f(1, 1, 1, 1);
+ gGL.color4f(1.f, 1.f, 1.f, 1.f);
// Coordinate axes
- if (gSavedSettings.getBOOL("ShowAxes"))
+ static LLCachedControl<bool> show_axes(gSavedSettings, "ShowAxes");
+ if (show_axes())
{
draw_axes();
}
@@ -1591,7 +1688,7 @@ void render_ui_2d()
gGL.pushMatrix();
S32 half_width = (gViewerWindow->getWorldViewWidthScaled() / 2);
S32 half_height = (gViewerWindow->getWorldViewHeightScaled() / 2);
- gGL.scalef(LLUI::getScaleFactor().mV[0], LLUI::getScaleFactor().mV[1], 1.f);
+ gGL.scalef(LLUI::getScaleFactor().mV[VX], LLUI::getScaleFactor().mV[VY], 1.f);
gGL.translatef((F32)half_width, (F32)half_height, 0.f);
F32 zoom = gAgentCamera.mHUDCurZoom;
gGL.scalef(zoom,zoom,1.f);
@@ -1613,7 +1710,7 @@ void render_ui_2d()
gPipeline.mUIScreen.bindTarget();
gGL.setColorMask(true, true);
{
- static const S32 pad = 8;
+ constexpr S32 pad = 8;
LLView::sDirtyRect.mLeft -= pad;
LLView::sDirtyRect.mRight += pad;
@@ -1666,8 +1763,6 @@ void render_ui_2d()
gViewerWindow->draw();
}
-
-
// reset current origin for font rendering, in case of tiling render
LLFontGL::sCurOrigin.set(0, 0);
}
@@ -1676,7 +1771,7 @@ void render_disconnected_background()
{
gUIProgram.bind();
- gGL.color4f(1,1,1,1);
+ gGL.color4f(1.f, 1.f, 1.f, 1.f);
if (!gDisconnectedImagep && gDisconnected)
{
LL_INFOS() << "Loading last bitmap..." << LL_ENDL;
@@ -1716,7 +1811,7 @@ void render_disconnected_background()
raw->expandToPowerOfTwo();
- gDisconnectedImagep = LLViewerTextureManager::getLocalTexture(raw.get(), false );
+ gDisconnectedImagep = LLViewerTextureManager::getLocalTexture(raw.get(), false);
gStartTexture = gDisconnectedImagep;
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
}
@@ -1751,6 +1846,5 @@ void render_disconnected_background()
void display_cleanup()
{
- gDisconnectedImagep = NULL;
+ gDisconnectedImagep = nullptr;
}
-
diff --git a/indra/newview/llviewerdisplay.h b/indra/newview/llviewerdisplay.h
index 673f51600d..2ec02f09fd 100644
--- a/indra/newview/llviewerdisplay.h
+++ b/indra/newview/llviewerdisplay.h
@@ -27,8 +27,6 @@
#ifndef LL_LLVIEWERDISPLAY_H
#define LL_LLVIEWERDISPLAY_H
-class LLPostProcess;
-
void display_startup();
void display_cleanup();
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 3f2d01ee33..b2a7d875ab 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -96,6 +96,8 @@
#include "llfloaterlandholdings.h"
#include "llfloaterlinkreplace.h"
#include "llfloaterloadprefpreset.h"
+#include "llfloaterluadebug.h"
+#include "llfloaterluascripts.h"
#include "llfloatermap.h"
#include "llfloatermarketplacelistings.h"
#include "llfloatermediasettings.h"
@@ -116,7 +118,6 @@
#include "llfloaterpay.h"
#include "llfloaterperformance.h"
#include "llfloaterperms.h"
-#include "llfloaterpostprocess.h"
#include "llfloaterpreference.h"
#include "llfloaterpreferencesgraphicsadvanced.h"
#include "llfloaterpreferenceviewadvanced.h"
@@ -362,7 +363,6 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("emoji_picker", "floater_emoji_picker.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEmojiPicker>);
LLFloaterReg::add("emoji_complete", "floater_emoji_complete.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEmojiComplete>);
- LLFloaterReg::add("env_post_process", "floater_post_process.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPostProcess>);
LLFloaterReg::add("env_fixed_environmentent_water", "floater_fixedenvironment.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterFixedEnvironmentWater>);
LLFloaterReg::add("env_fixed_environmentent_sky", "floater_fixedenvironment.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterFixedEnvironmentSky>);
@@ -413,6 +413,9 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("linkreplace", "floater_linkreplace.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLinkReplace>);
LLFloaterReg::add("load_pref_preset", "floater_load_pref_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLoadPrefPreset>);
+ LLFloaterReg::add("lua_debug", "floater_lua_debug.xml", (LLFloaterBuildFunc) &LLFloaterReg::build<LLFloaterLUADebug>);
+ LLFloaterReg::add("lua_scripts", "floater_lua_scripts.xml", (LLFloaterBuildFunc) &LLFloaterReg::build<LLFloaterLUAScripts>);
+
LLFloaterReg::add("mem_leaking", "floater_mem_leaking.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMemLeak>);
LLFloaterReg::add("media_settings", "floater_media_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMediaSettings>);
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index e2022cae37..4c9910fd0a 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -71,6 +71,9 @@
#include "llclipboard.h"
#include "llhttpretrypolicy.h"
#include "llsettingsvo.h"
+#include "llinventorylistener.h"
+
+LLInventoryListener sInventoryListener;
// do-nothing ops for use in callbacks.
void no_op_inventory_func(const LLUUID&) {}
diff --git a/indra/newview/llviewerjointattachment.cpp b/indra/newview/llviewerjointattachment.cpp
index e733dafcae..511fac9788 100644
--- a/indra/newview/llviewerjointattachment.cpp
+++ b/indra/newview/llviewerjointattachment.cpp
@@ -86,13 +86,17 @@ U32 LLViewerJointAttachment::drawShape( F32 pixelArea, bool first_pass, bool is_
LLGLDisable cull_face(GL_CULL_FACE);
gGL.color4f(1.f, 1.f, 1.f, 1.f);
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLES);
{
gGL.vertex3f(-0.1f, 0.1f, 0.f);
gGL.vertex3f(-0.1f, -0.1f, 0.f);
gGL.vertex3f(0.1f, -0.1f, 0.f);
+
+ gGL.vertex3f(-0.1f, 0.1f, 0.f);
+ gGL.vertex3f(0.1f, -0.1f, 0.f);
gGL.vertex3f(0.1f, 0.1f, 0.f);
- }gGL.end();
+ }
+ gGL.end();
}
return 0;
}
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index f0567b18c4..da7ad71336 100644
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -407,10 +407,16 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, bool damp_w
F32* vw = (F32*) vertex_weightsp.get();
F32* cw = (F32*) clothing_weightsp.get();
- S32 tc_size = (num_verts*2*sizeof(F32)+0xF) & ~0xF;
- LLVector4a::memcpyNonAliased16(tc, (F32*) mMesh->getTexCoords(), tc_size);
- S32 vw_size = (num_verts*sizeof(F32)+0xF) & ~0xF;
- LLVector4a::memcpyNonAliased16(vw, (F32*) mMesh->getWeights(), vw_size);
+ //S32 tc_size = (num_verts*2*sizeof(F32)+0xF) & ~0xF;
+ //LLVector4a::memcpyNonAliased16(tc, (F32*) mMesh->getTexCoords(), tc_size);
+ //S32 vw_size = (num_verts*sizeof(F32)+0xF) & ~0xF;
+ //LLVector4a::memcpyNonAliased16(vw, (F32*) mMesh->getWeights(), vw_size);
+
+ // Both allocated in LLPolyMeshSharedData::allocateVertexData(unsigned int)
+
+ memcpy(tc, mMesh->getTexCoords(), num_verts*2*sizeof(F32) );
+ memcpy(vw, mMesh->getWeights(), num_verts*sizeof(F32) );
+
LLVector4a::memcpyNonAliased16(cw, (F32*) mMesh->getClothingWeights(), num_verts*4*sizeof(F32));
}
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 9739cac311..92db598410 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -688,10 +688,10 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
static LLCachedControl<bool> inworld_media_enabled(gSavedSettings, "AudioStreamingMedia", true);
static LLCachedControl<bool> inworld_audio_enabled(gSavedSettings, "AudioStreamingMusic", true);
- U32 max_instances = gSavedSettings.getU32("PluginInstancesTotal");
- U32 max_normal = gSavedSettings.getU32("PluginInstancesNormal");
- U32 max_low = gSavedSettings.getU32("PluginInstancesLow");
- F32 max_cpu = gSavedSettings.getF32("PluginInstancesCPULimit");
+ static LLCachedControl<U32> max_instances(gSavedSettings, "PluginInstancesTotal", 8);
+ static LLCachedControl<U32> max_normal(gSavedSettings, "PluginInstancesNormal", 2);
+ static LLCachedControl<U32> max_low(gSavedSettings, "PluginInstancesLow", 4);
+ static LLCachedControl<F32> max_cpu(gSavedSettings, "PluginInstancesCPULimit", 0.9);
// Setting max_cpu to 0.0 disables CPU usage checking.
bool check_cpu_usage = (max_cpu != 0.0f);
@@ -829,7 +829,8 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
}
else
{
- if(gAudiop && LLViewerMedia::hasParcelAudio() && restore_parcel_audio && gSavedSettings.getBOOL("MediaTentativeAutoPlay"))
+ static LLCachedControl<bool> auto_play(gSavedSettings, "MediaTentativeAutoPlay", true);
+ if(gAudiop && LLViewerMedia::hasParcelAudio() && restore_parcel_audio && auto_play())
{
LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLViewerMedia::getParcelAudioURL());
restore_parcel_audio = false;
@@ -880,7 +881,8 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
}
}
- if(gSavedSettings.getBOOL("MediaPerformanceManagerDebug"))
+ static LLCachedControl<bool> perf_debug(gSavedSettings, "MediaPerformanceManagerDebug", false);
+ if(perf_debug())
{
// Give impls the same ordering as the priority list
// they're already in the right order for this.
@@ -1728,8 +1730,6 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
std::string user_data_path_cache = gDirUtilp->getCacheDir(false);
user_data_path_cache += gDirUtilp->getDirDelimiter();
- std::string user_data_path_cef_log = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "cef_log.txt");
-
// See if the plugin executable exists
llstat s;
if(LLFile::stat(launcher_name, &s))
@@ -1738,14 +1738,13 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
}
else if(LLFile::stat(plugin_name, &s))
{
-#if !LL_LINUX
LL_WARNS_ONCE("Media") << "Couldn't find plugin at " << plugin_name << LL_ENDL;
-#endif
}
else
{
media_source = new LLPluginClassMedia(owner);
media_source->setSize(default_width, default_height);
+ std::string user_data_path_cef_log = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "cef.log");
media_source->setUserDataPath(user_data_path_cache, gDirUtilp->getUserName(), user_data_path_cef_log);
media_source->setLanguageCode(LLUI::getLanguage());
media_source->setZoomFactor(zoom_factor);
@@ -1771,6 +1770,11 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
bool media_plugin_debugging_enabled = gSavedSettings.getBOOL("MediaPluginDebugging");
media_source->enableMediaPluginDebugging( media_plugin_debugging_enabled || clean_browser);
+#if LL_LINUX
+ bool media_plugin_pipewire_volume_catcher = gSavedSettings.getBOOL("MediaPluginPipeWireVolumeCatcher");
+ media_source->enablePipeWireVolumeCatcher( media_plugin_pipewire_volume_catcher );
+#endif
+
// need to set agent string here before instance created
media_source->setBrowserUserAgent(LLViewerMedia::getInstance()->getCurrentUserAgent());
@@ -1792,9 +1796,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
}
}
}
-#if !LL_LINUX
LL_WARNS_ONCE("Plugin") << "plugin initialization failed for mime type: " << media_type << LL_ENDL;
-#endif
if(gAgent.isInitialized())
{
@@ -2766,7 +2768,8 @@ bool LLViewerMediaImpl::handleUnicodeCharHere(llwchar uni_char)
{
LLSD native_key_data = gViewerWindow->getWindow()->getNativeKeyData();
- mMediaSource->textInput(wstring_to_utf8str(LLWString(1, uni_char)), gKeyboard->currentMask(false), native_key_data);
+ mMediaSource->textInput(ll_convert_to<std::string>(uni_char),
+ gKeyboard->currentMask(false), native_key_data);
}
}
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index bbf2dfad13..ed0d7953f7 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -78,6 +78,7 @@
#include "llfloatertools.h"
#include "llfloaterworldmap.h"
#include "llfloaterbuildoptions.h"
+#include "fsyspath.h"
#include "llavataractions.h"
#include "lllandmarkactions.h"
#include "llgroupmgr.h"
@@ -90,6 +91,7 @@
#include "llinventorybridge.h"
#include "llinventorydefines.h"
#include "llinventoryfunctions.h"
+#include "llluamanager.h"
#include "llpanellogin.h"
#include "llpanelblockedlist.h"
#include "llpanelmaininventory.h"
@@ -171,6 +173,8 @@ extern bool gShaderProfileFrame;
// Globals
//
+LLUIListener sUIListener;
+
LLMenuBarGL *gMenuBarView = NULL;
LLViewerMenuHolderGL *gMenuHolder = NULL;
LLMenuGL *gPopupMenuView = NULL;
@@ -343,8 +347,6 @@ private:
static LLMenuParcelObserver* gMenuParcelObserver = NULL;
-static LLUIListener sUIListener;
-
LLMenuParcelObserver::LLMenuParcelObserver()
{
mLandBuyHandle = gMenuLand->getChild<LLMenuItemCallGL>("Land Buy")->getHandle();
@@ -9167,80 +9169,89 @@ class LLToolsSelectTool : public view_listener_t
};
/// WINDLIGHT callbacks
-class LLWorldEnvSettings : public view_listener_t
+void defocusEnvFloaters()
{
- void defocusEnvFloaters()
+ // currently there is only one instance of each floater
+ std::vector<std::string> env_floaters_names = {"env_edit_extdaycycle", "env_fixed_environmentent_water",
+ "env_fixed_environmentent_sky"};
+ for (std::vector<std::string>::const_iterator it = env_floaters_names.begin(); it != env_floaters_names.end(); ++it)
{
- //currently there is only one instance of each floater
- std::vector<std::string> env_floaters_names = { "env_edit_extdaycycle", "env_fixed_environmentent_water", "env_fixed_environmentent_sky" };
- for (std::vector<std::string>::const_iterator it = env_floaters_names.begin(); it != env_floaters_names.end(); ++it)
+ LLFloater *env_floater = LLFloaterReg::findTypedInstance<LLFloater>(*it);
+ if (env_floater)
{
- LLFloater* env_floater = LLFloaterReg::findTypedInstance<LLFloater>(*it);
- if (env_floater)
- {
- env_floater->setFocus(false);
- }
+ env_floater->setFocus(false);
}
}
+}
- bool handleEvent(const LLSD& userdata)
+bool handle_env_setting_event(std::string event_name)
+{
+ if (event_name == "sunrise")
{
- std::string event_name = userdata.asString();
-
- if (event_name == "sunrise")
- {
- LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNRISE, LLEnvironment::TRANSITION_INSTANT);
- LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT);
- defocusEnvFloaters();
- }
- else if (event_name == "noon")
- {
- LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDDAY, LLEnvironment::TRANSITION_INSTANT);
- LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT);
- defocusEnvFloaters();
- }
- else if (event_name == "legacy noon")
- {
- LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_LEGACY_MIDDAY, LLEnvironment::TRANSITION_INSTANT);
- LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT);
- defocusEnvFloaters();
- }
- else if (event_name == "sunset")
- {
- LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNSET, LLEnvironment::TRANSITION_INSTANT);
- LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT);
- defocusEnvFloaters();
- }
- else if (event_name == "midnight")
- {
- LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDNIGHT, LLEnvironment::TRANSITION_INSTANT);
- LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT);
- defocusEnvFloaters();
- }
- else if (event_name == "region")
- {
- // reset probe data when reverting back to region sky setting
- gPipeline.mReflectionMapManager.reset();
+ LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNRISE,
+ LLEnvironment::TRANSITION_INSTANT);
+ LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT);
+ defocusEnvFloaters();
+ }
+ else if (event_name == "noon")
+ {
+ LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDDAY,
+ LLEnvironment::TRANSITION_INSTANT);
+ LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT);
+ defocusEnvFloaters();
+ }
+ else if (event_name == "legacy noon")
+ {
+ LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_LEGACY_MIDDAY, LLEnvironment::TRANSITION_INSTANT);
+ LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT);
+ defocusEnvFloaters();
+ }
+ else if (event_name == "sunset")
+ {
+ LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_SUNSET,
+ LLEnvironment::TRANSITION_INSTANT);
+ LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT);
+ defocusEnvFloaters();
+ }
+ else if (event_name == "midnight")
+ {
+ LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::KNOWN_SKY_MIDNIGHT,
+ LLEnvironment::TRANSITION_INSTANT);
+ LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT);
+ defocusEnvFloaters();
+ }
+ else if (event_name == "region")
+ {
+ // reset probe data when reverting back to region sky setting
+ gPipeline.mReflectionMapManager.reset();
- LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_LOCAL);
- LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT);
- defocusEnvFloaters();
- }
- else if (event_name == "pause_clouds")
- {
- if (LLEnvironment::instance().isCloudScrollPaused())
- LLEnvironment::instance().resumeCloudScroll();
+ LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_LOCAL);
+ LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::TRANSITION_INSTANT);
+ defocusEnvFloaters();
+ }
+ else if (event_name == "pause_clouds")
+ {
+ if (LLEnvironment::instance().isCloudScrollPaused())
+ LLEnvironment::instance().resumeCloudScroll();
else
- LLEnvironment::instance().pauseCloudScroll();
- }
- else if (event_name == "adjust_tool")
- {
- LLFloaterReg::showInstance("env_adjust_snapshot");
- }
- else if (event_name == "my_environs")
- {
- LLFloaterReg::showInstance("my_environments");
- }
+ LLEnvironment::instance().pauseCloudScroll();
+ }
+ else if (event_name == "adjust_tool")
+ {
+ LLFloaterReg::showInstance("env_adjust_snapshot");
+ }
+ else if (event_name == "my_environs")
+ {
+ LLFloaterReg::showInstance("my_environments");
+ }
+ return true;
+}
+
+class LLWorldEnvSettings : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ handle_env_setting_event(userdata.asString());
return true;
}
@@ -9348,17 +9359,6 @@ class LLWorldEnableEnvPreset : public view_listener_t
}
};
-
-/// Post-Process callbacks
-class LLWorldPostProcess : public view_listener_t
-{
- bool handleEvent(const LLSD& userdata)
- {
- LLFloaterReg::showInstance("env_post_process");
- return true;
- }
-};
-
class LLWorldCheckBanLines : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
@@ -9466,6 +9466,18 @@ void LLUploadCostCalculator::calculateCost(const std::string& asset_type_str)
mCostStr = std::to_string(upload_cost);
}
+void lua_run_script(const LLSD& userdata)
+{
+ std::string script_path = userdata.asString();
+ if (script_path.empty())
+ {
+ LL_WARNS() << "Script name is not specified" << LL_ENDL;
+ return;
+ }
+
+ LLLUAmanager::runScriptFile(script_path);
+}
+
void show_navbar_context_menu(LLView* ctrl, S32 x, S32 y)
{
static LLMenuGL* show_navbar_context_menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_hide_navbar.xml",
@@ -9526,16 +9538,18 @@ void initialize_edit_menu()
}
+typedef LLUICtrl::CommitCallbackInfo cb_info;
+
void initialize_spellcheck_menu()
{
- LLUICtrl::CommitCallbackRegistry::Registrar& commit = LLUICtrl::CommitCallbackRegistry::currentRegistrar();
+ LLUICtrl::CommitRegistrarHelper registrar(LLUICtrl::CommitCallbackRegistry::defaultRegistrar());
LLUICtrl::EnableCallbackRegistry::Registrar& enable = LLUICtrl::EnableCallbackRegistry::currentRegistrar();
- commit.add("SpellCheck.ReplaceWithSuggestion", boost::bind(&handle_spellcheck_replace_with_suggestion, _1, _2));
+ registrar.add("SpellCheck.ReplaceWithSuggestion", boost::bind(&handle_spellcheck_replace_with_suggestion, _1, _2), cb_info::UNTRUSTED_BLOCK);
enable.add("SpellCheck.VisibleSuggestion", boost::bind(&visible_spellcheck_suggestion, _1, _2));
- commit.add("SpellCheck.AddToDictionary", boost::bind(&handle_spellcheck_add_to_dictionary, _1));
+ registrar.add("SpellCheck.AddToDictionary", boost::bind(&handle_spellcheck_add_to_dictionary, _1), cb_info::UNTRUSTED_BLOCK);
enable.add("SpellCheck.EnableAddToDictionary", boost::bind(&enable_spellcheck_add_to_dictionary, _1));
- commit.add("SpellCheck.AddToIgnore", boost::bind(&handle_spellcheck_add_to_ignore, _1));
+ registrar.add("SpellCheck.AddToIgnore", boost::bind(&handle_spellcheck_add_to_ignore, _1), cb_info::UNTRUSTED_BLOCK);
enable.add("SpellCheck.EnableAddToIgnore", boost::bind(&enable_spellcheck_add_to_ignore, _1));
}
@@ -9559,8 +9573,8 @@ void initialize_menus()
bool mMult;
};
+ LLUICtrl::CommitRegistrarHelper registrar(LLUICtrl::CommitCallbackRegistry::currentRegistrar());
LLUICtrl::EnableCallbackRegistry::Registrar& enable = LLUICtrl::EnableCallbackRegistry::currentRegistrar();
- LLUICtrl::CommitCallbackRegistry::Registrar& commit = LLUICtrl::CommitCallbackRegistry::currentRegistrar();
// Generic enable and visible
// Don't prepend MenuName.Foo because these can be used in any menu.
@@ -9575,15 +9589,15 @@ void initialize_menus()
enable.add("Conversation.IsConversationLoggingAllowed", boost::bind(&LLFloaterIMContainer::isConversationLoggingAllowed));
// Agent
- commit.add("Agent.toggleFlying", boost::bind(&LLAgent::toggleFlying));
+ registrar.add("Agent.toggleFlying", boost::bind(&LLAgent::toggleFlying));
enable.add("Agent.enableFlyLand", boost::bind(&enable_fly_land));
- commit.add("Agent.PressMicrophone", boost::bind(&LLAgent::pressMicrophone, _2));
- commit.add("Agent.ReleaseMicrophone", boost::bind(&LLAgent::releaseMicrophone, _2));
- commit.add("Agent.ToggleMicrophone", boost::bind(&LLAgent::toggleMicrophone, _2));
+ registrar.add("Agent.PressMicrophone", boost::bind(&LLAgent::pressMicrophone, _2), cb_info::UNTRUSTED_BLOCK);
+ registrar.add("Agent.ReleaseMicrophone", boost::bind(&LLAgent::releaseMicrophone, _2), cb_info::UNTRUSTED_BLOCK);
+ registrar.add("Agent.ToggleMicrophone", boost::bind(&LLAgent::toggleMicrophone, _2), cb_info::UNTRUSTED_BLOCK);
enable.add("Agent.IsMicrophoneOn", boost::bind(&LLAgent::isMicrophoneOn, _2));
enable.add("Agent.IsActionAllowed", boost::bind(&LLAgent::isActionAllowed, _2));
- commit.add("Agent.ToggleHearMediaSoundFromAvatar", boost::bind(&LLAgent::toggleHearMediaSoundFromAvatar));
- commit.add("Agent.ToggleHearVoiceFromAvatar", boost::bind(&LLAgent::toggleHearVoiceFromAvatar));
+ registrar.add("Agent.ToggleHearMediaSoundFromAvatar", boost::bind(&LLAgent::toggleHearMediaSoundFromAvatar), cb_info::UNTRUSTED_BLOCK);
+ registrar.add("Agent.ToggleHearVoiceFromAvatar", boost::bind(&LLAgent::toggleHearVoiceFromAvatar), cb_info::UNTRUSTED_BLOCK);
// File menu
init_menu_file();
@@ -9593,12 +9607,12 @@ void initialize_menus()
view_listener_t::addMenu(new LLEnableEditShape(), "Edit.EnableEditShape");
view_listener_t::addMenu(new LLEnableHoverHeight(), "Edit.EnableHoverHeight");
view_listener_t::addMenu(new LLEnableEditPhysics(), "Edit.EnableEditPhysics");
- commit.add("CustomizeAvatar", boost::bind(&handle_customize_avatar));
- commit.add("NowWearing", boost::bind(&handle_now_wearing));
- commit.add("EditOutfit", boost::bind(&handle_edit_outfit));
- commit.add("EditShape", boost::bind(&handle_edit_shape));
- commit.add("HoverHeight", boost::bind(&handle_hover_height));
- commit.add("EditPhysics", boost::bind(&handle_edit_physics));
+ registrar.add("CustomizeAvatar", boost::bind(&handle_customize_avatar));
+ registrar.add("NowWearing", boost::bind(&handle_now_wearing));
+ registrar.add("EditOutfit", boost::bind(&handle_edit_outfit));
+ registrar.add("EditShape", boost::bind(&handle_edit_shape));
+ registrar.add("HoverHeight", boost::bind(&handle_hover_height));
+ registrar.add("EditPhysics", boost::bind(&handle_edit_physics));
// View menu
view_listener_t::addMenu(new LLViewMouselook(), "View.Mouselook");
@@ -9651,7 +9665,6 @@ void initialize_menus()
view_listener_t::addMenu(new LLWorldEnableEnvSettings(), "World.EnableEnvSettings");
view_listener_t::addMenu(new LLWorldEnvPreset(), "World.EnvPreset");
view_listener_t::addMenu(new LLWorldEnableEnvPreset(), "World.EnableEnvPreset");
- view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess");
view_listener_t::addMenu(new LLWorldCheckBanLines() , "World.CheckBanLines");
view_listener_t::addMenu(new LLWorldShowBanLines() , "World.ShowBanLines");
@@ -9668,14 +9681,14 @@ void initialize_menus()
view_listener_t::addMenu(new LLToolsSnapObjectXY(), "Tools.SnapObjectXY");
view_listener_t::addMenu(new LLToolsUseSelectionForGrid(), "Tools.UseSelectionForGrid");
view_listener_t::addMenu(new LLToolsSelectNextPartFace(), "Tools.SelectNextPart");
- commit.add("Tools.Link", boost::bind(&handle_link_objects));
- commit.add("Tools.Unlink", boost::bind(&LLSelectMgr::unlinkObjects, LLSelectMgr::getInstance()));
+ registrar.add("Tools.Link", boost::bind(&handle_link_objects));
+ registrar.add("Tools.Unlink", boost::bind(&LLSelectMgr::unlinkObjects, LLSelectMgr::getInstance()));
view_listener_t::addMenu(new LLToolsStopAllAnimations(), "Tools.StopAllAnimations");
view_listener_t::addMenu(new LLToolsReleaseKeys(), "Tools.ReleaseKeys");
view_listener_t::addMenu(new LLToolsEnableReleaseKeys(), "Tools.EnableReleaseKeys");
- commit.add("Tools.LookAtSelection", boost::bind(&handle_look_at_selection, _2));
- commit.add("Tools.BuyOrTake", boost::bind(&handle_buy_or_take));
- commit.add("Tools.TakeCopy", boost::bind(&handle_take_copy));
+ registrar.add("Tools.LookAtSelection", boost::bind(&handle_look_at_selection, _2));
+ registrar.add("Tools.BuyOrTake", boost::bind(&handle_buy_or_take), cb_info::UNTRUSTED_THROTTLE);
+ registrar.add("Tools.TakeCopy", boost::bind(&handle_take_copy), cb_info::UNTRUSTED_THROTTLE);
view_listener_t::addMenu(new LLToolsSaveToObjectInventory(), "Tools.SaveToObjectInventory");
view_listener_t::addMenu(new LLToolsSelectedScriptAction(), "Tools.SelectedScriptAction");
@@ -9726,7 +9739,7 @@ void initialize_menus()
view_listener_t::addMenu(new LLAdvancedToggleInfoDisplay(), "Advanced.ToggleInfoDisplay");
view_listener_t::addMenu(new LLAdvancedCheckInfoDisplay(), "Advanced.CheckInfoDisplay");
view_listener_t::addMenu(new LLAdvancedSelectedTextureInfo(), "Advanced.SelectedTextureInfo");
- commit.add("Advanced.SelectedMaterialInfo", boost::bind(&handle_selected_material_info));
+ registrar.add("Advanced.SelectedMaterialInfo", boost::bind(&handle_selected_material_info));
view_listener_t::addMenu(new LLAdvancedToggleWireframe(), "Advanced.ToggleWireframe");
view_listener_t::addMenu(new LLAdvancedCheckWireframe(), "Advanced.CheckWireframe");
// Develop > Render
@@ -9739,13 +9752,14 @@ void initialize_menus()
view_listener_t::addMenu(new LLAdvancedClickRenderShadowOption(), "Advanced.ClickRenderShadowOption");
view_listener_t::addMenu(new LLAdvancedClickRenderProfile(), "Advanced.ClickRenderProfile");
view_listener_t::addMenu(new LLAdvancedClickRenderBenchmark(), "Advanced.ClickRenderBenchmark");
- view_listener_t::addMenu(new LLAdvancedClickHDRIPreview(), "Advanced.ClickHDRIPreview");
- view_listener_t::addMenu(new LLAdvancedClickGLTFOpen(), "Advanced.ClickGLTFOpen");
- view_listener_t::addMenu(new LLAdvancedClickGLTFSaveAs(), "Advanced.ClickGLTFSaveAs");
- view_listener_t::addMenu(new LLAdvancedClickGLTFUpload(), "Advanced.ClickGLTFUpload");
- view_listener_t::addMenu(new LLAdvancedClickGLTFEdit(), "Advanced.ClickGLTFEdit");
- view_listener_t::addMenu(new LLAdvancedClickResizeWindow(), "Advanced.ClickResizeWindow");
- view_listener_t::addMenu(new LLAdvancedPurgeShaderCache(), "Advanced.ClearShaderCache");
+ view_listener_t::addMenu(new LLAdvancedClickHDRIPreview(), "Advanced.ClickHDRIPreview", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedClickGLTFOpen(), "Advanced.ClickGLTFOpen", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedClickGLTFSaveAs(), "Advanced.ClickGLTFSaveAs", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedClickGLTFUpload(), "Advanced.ClickGLTFUpload", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedClickGLTFEdit(), "Advanced.ClickGLTFEdit", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedClickResizeWindow(), "Advanced.ClickResizeWindow", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedPurgeShaderCache(), "Advanced.ClearShaderCache", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedRebuildTerrain(), "Advanced.RebuildTerrain", cb_info::UNTRUSTED_BLOCK);
#ifdef TOGGLE_HACKED_GODLIKE_VIEWER
view_listener_t::addMenu(new LLAdvancedHandleToggleHackedGodmode(), "Advanced.HandleToggleHackedGodmode");
@@ -9768,15 +9782,15 @@ void initialize_menus()
view_listener_t::addMenu(new LLAdvancedTerrainDeleteLocalPaintMap(), "Advanced.TerrainDeleteLocalPaintMap");
// Advanced > UI
- commit.add("Advanced.WebBrowserTest", boost::bind(&handle_web_browser_test, _2)); // sigh! this one opens the MEDIA browser
- commit.add("Advanced.WebContentTest", boost::bind(&handle_web_content_test, _2)); // this one opens the Web Content floater
- commit.add("Advanced.ShowURL", boost::bind(&handle_show_url, _2));
- commit.add("Advanced.ReportBug", boost::bind(&handle_report_bug, _2));
+ registrar.add("Advanced.WebBrowserTest", boost::bind(&handle_web_browser_test, _2)); // sigh! this one opens the MEDIA browser
+ registrar.add("Advanced.WebContentTest", boost::bind(&handle_web_content_test, _2)); // this one opens the Web Content floater
+ registrar.add("Advanced.ShowURL", boost::bind(&handle_show_url, _2));
+ registrar.add("Advanced.ReportBug", boost::bind(&handle_report_bug, _2));
view_listener_t::addMenu(new LLAdvancedBuyCurrencyTest(), "Advanced.BuyCurrencyTest");
view_listener_t::addMenu(new LLAdvancedDumpSelectMgr(), "Advanced.DumpSelectMgr");
view_listener_t::addMenu(new LLAdvancedDumpInventory(), "Advanced.DumpInventory");
- commit.add("Advanced.DumpTimers", boost::bind(&handle_dump_timers) );
- commit.add("Advanced.DumpFocusHolder", boost::bind(&handle_dump_focus) );
+ registrar.add("Advanced.DumpTimers", boost::bind(&handle_dump_timers), cb_info::UNTRUSTED_THROTTLE);
+ registrar.add("Advanced.DumpFocusHolder", boost::bind(&handle_dump_focus));
view_listener_t::addMenu(new LLAdvancedPrintSelectedObjectInfo(), "Advanced.PrintSelectedObjectInfo");
view_listener_t::addMenu(new LLAdvancedPrintAgentInfo(), "Advanced.PrintAgentInfo");
view_listener_t::addMenu(new LLAdvancedToggleDebugClicks(), "Advanced.ToggleDebugClicks");
@@ -9797,11 +9811,11 @@ void initialize_menus()
view_listener_t::addMenu(new LLAdvancedCheckDebugWindowProc(), "Advanced.CheckDebugWindowProc");
// Advanced > XUI
- commit.add("Advanced.ReloadColorSettings", boost::bind(&LLUIColorTable::loadFromSettings, LLUIColorTable::getInstance()));
+ registrar.add("Advanced.ReloadColorSettings", boost::bind(&LLUIColorTable::loadFromSettings, LLUIColorTable::getInstance()));
view_listener_t::addMenu(new LLAdvancedToggleXUINames(), "Advanced.ToggleXUINames");
view_listener_t::addMenu(new LLAdvancedCheckXUINames(), "Advanced.CheckXUINames");
view_listener_t::addMenu(new LLAdvancedSendTestIms(), "Advanced.SendTestIMs");
- commit.add("Advanced.FlushNameCaches", boost::bind(&handle_flush_name_caches));
+ registrar.add("Advanced.FlushNameCaches", boost::bind(&handle_flush_name_caches), cb_info::UNTRUSTED_BLOCK);
// Advanced > Character > Grab Baked Texture
view_listener_t::addMenu(new LLAdvancedGrabBakedTexture(), "Advanced.GrabBakedTexture");
@@ -9812,8 +9826,8 @@ void initialize_menus()
view_listener_t::addMenu(new LLAdvancedEnableAppearanceToXML(), "Advanced.EnableAppearanceToXML");
view_listener_t::addMenu(new LLAdvancedToggleCharacterGeometry(), "Advanced.ToggleCharacterGeometry");
- view_listener_t::addMenu(new LLAdvancedTestMale(), "Advanced.TestMale");
- view_listener_t::addMenu(new LLAdvancedTestFemale(), "Advanced.TestFemale");
+ view_listener_t::addMenu(new LLAdvancedTestMale(), "Advanced.TestMale", cb_info::UNTRUSTED_THROTTLE);
+ view_listener_t::addMenu(new LLAdvancedTestFemale(), "Advanced.TestFemale", cb_info::UNTRUSTED_THROTTLE);
// Advanced > Character > Animation Speed
view_listener_t::addMenu(new LLAdvancedAnimTenFaster(), "Advanced.AnimTenFaster");
@@ -9845,7 +9859,7 @@ void initialize_menus()
view_listener_t::addMenu(new LLAdvancedDropPacket(), "Advanced.DropPacket");
// Advanced > Cache
- view_listener_t::addMenu(new LLAdvancedPurgeDiskCache(), "Advanced.PurgeDiskCache");
+ view_listener_t::addMenu(new LLAdvancedPurgeDiskCache(), "Advanced.PurgeDiskCache", cb_info::UNTRUSTED_BLOCK);
// Advanced > Recorder
view_listener_t::addMenu(new LLAdvancedAgentPilot(), "Advanced.AgentPilot");
@@ -9854,25 +9868,25 @@ void initialize_menus()
view_listener_t::addMenu(new LLAdvancedViewerEventRecorder(), "Advanced.EventRecorder");
// Advanced > Debugging
- view_listener_t::addMenu(new LLAdvancedForceErrorBreakpoint(), "Advanced.ForceErrorBreakpoint");
- view_listener_t::addMenu(new LLAdvancedForceErrorLlerror(), "Advanced.ForceErrorLlerror");
- view_listener_t::addMenu(new LLAdvancedForceErrorLlerrorMsg(), "Advanced.ForceErrorLlerrorMsg");
- view_listener_t::addMenu(new LLAdvancedForceErrorBadMemoryAccess(), "Advanced.ForceErrorBadMemoryAccess");
- view_listener_t::addMenu(new LLAdvancedForceErrorBadMemoryAccessCoro(), "Advanced.ForceErrorBadMemoryAccessCoro");
- view_listener_t::addMenu(new LLAdvancedForceErrorInfiniteLoop(), "Advanced.ForceErrorInfiniteLoop");
- view_listener_t::addMenu(new LLAdvancedForceErrorSoftwareException(), "Advanced.ForceErrorSoftwareException");
- view_listener_t::addMenu(new LLAdvancedForceOSException(), "Advanced.ForceErrorOSException");
- view_listener_t::addMenu(new LLAdvancedForceErrorSoftwareExceptionCoro(), "Advanced.ForceErrorSoftwareExceptionCoro");
- view_listener_t::addMenu(new LLAdvancedForceErrorDriverCrash(), "Advanced.ForceErrorDriverCrash");
- view_listener_t::addMenu(new LLAdvancedForceErrorCoroutineCrash(), "Advanced.ForceErrorCoroutineCrash");
- view_listener_t::addMenu(new LLAdvancedForceErrorThreadCrash(), "Advanced.ForceErrorThreadCrash");
- view_listener_t::addMenu(new LLAdvancedForceErrorDisconnectViewer(), "Advanced.ForceErrorDisconnectViewer");
+ view_listener_t::addMenu(new LLAdvancedForceErrorBreakpoint(), "Advanced.ForceErrorBreakpoint", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedForceErrorLlerror(), "Advanced.ForceErrorLlerror", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedForceErrorLlerrorMsg(), "Advanced.ForceErrorLlerrorMsg", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedForceErrorBadMemoryAccess(), "Advanced.ForceErrorBadMemoryAccess", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedForceErrorBadMemoryAccessCoro(), "Advanced.ForceErrorBadMemoryAccessCoro", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedForceErrorInfiniteLoop(), "Advanced.ForceErrorInfiniteLoop", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedForceErrorSoftwareException(), "Advanced.ForceErrorSoftwareException", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedForceOSException(), "Advanced.ForceErrorOSException", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedForceErrorSoftwareExceptionCoro(), "Advanced.ForceErrorSoftwareExceptionCoro", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedForceErrorDriverCrash(), "Advanced.ForceErrorDriverCrash", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedForceErrorCoroutineCrash(), "Advanced.ForceErrorCoroutineCrash", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedForceErrorThreadCrash(), "Advanced.ForceErrorThreadCrash", cb_info::UNTRUSTED_BLOCK);
+ view_listener_t::addMenu(new LLAdvancedForceErrorDisconnectViewer(), "Advanced.ForceErrorDisconnectViewer", cb_info::UNTRUSTED_BLOCK);
// Advanced (toplevel)
view_listener_t::addMenu(new LLAdvancedToggleShowObjectUpdates(), "Advanced.ToggleShowObjectUpdates");
view_listener_t::addMenu(new LLAdvancedCheckShowObjectUpdates(), "Advanced.CheckShowObjectUpdates");
view_listener_t::addMenu(new LLAdvancedCompressImage(), "Advanced.CompressImage");
- view_listener_t::addMenu(new LLAdvancedCompressFileTest(), "Advanced.CompressFileTest");
+ view_listener_t::addMenu(new LLAdvancedCompressFileTest(), "Advanced.CompressFileTest", cb_info::UNTRUSTED_BLOCK);
view_listener_t::addMenu(new LLAdvancedShowDebugSettings(), "Advanced.ShowDebugSettings");
view_listener_t::addMenu(new LLAdvancedEnableViewAdminOptions(), "Advanced.EnableViewAdminOptions");
view_listener_t::addMenu(new LLAdvancedToggleViewAdminOptions(), "Advanced.ToggleViewAdminOptions");
@@ -9887,11 +9901,11 @@ void initialize_menus()
view_listener_t::addMenu(new LLDevelopSetLoggingLevel(), "Develop.SetLoggingLevel");
//Develop (clear cache immediately)
- commit.add("Develop.ClearCache", boost::bind(&handle_cache_clear_immediately) );
+ registrar.add("Develop.ClearCache", boost::bind(&handle_cache_clear_immediately), cb_info::UNTRUSTED_BLOCK);
// Develop (Fonts debugging)
- commit.add("Develop.Fonts.Dump", boost::bind(&LLFontGL::dumpFonts));
- commit.add("Develop.Fonts.DumpTextures", boost::bind(&LLFontGL::dumpFontTextures));
+ registrar.add("Develop.Fonts.Dump", boost::bind(&LLFontGL::dumpFonts), cb_info::UNTRUSTED_THROTTLE);
+ registrar.add("Develop.Fonts.DumpTextures", boost::bind(&LLFontGL::dumpFontTextures), cb_info::UNTRUSTED_THROTTLE);
// Admin >Object
view_listener_t::addMenu(new LLAdminForceTakeCopy(), "Admin.ForceTakeCopy");
@@ -9928,20 +9942,20 @@ void initialize_menus()
view_listener_t::addMenu(new LLObjectMute(), "Avatar.Mute");
view_listener_t::addMenu(new LLAvatarAddFriend(), "Avatar.AddFriend");
view_listener_t::addMenu(new LLAvatarAddContact(), "Avatar.AddContact");
- commit.add("Avatar.Freeze", boost::bind(&handle_avatar_freeze, LLSD()));
+ registrar.add("Avatar.Freeze", boost::bind(&handle_avatar_freeze, LLSD()));
view_listener_t::addMenu(new LLAvatarDebug(), "Avatar.Debug");
view_listener_t::addMenu(new LLAvatarVisibleDebug(), "Avatar.VisibleDebug");
view_listener_t::addMenu(new LLAvatarInviteToGroup(), "Avatar.InviteToGroup");
- commit.add("Avatar.Eject", boost::bind(&handle_avatar_eject, LLSD()));
- commit.add("Avatar.ShowInspector", boost::bind(&handle_avatar_show_inspector));
+ registrar.add("Avatar.Eject", boost::bind(&handle_avatar_eject, LLSD()));
+ registrar.add("Avatar.ShowInspector", boost::bind(&handle_avatar_show_inspector));
view_listener_t::addMenu(new LLAvatarSendIM(), "Avatar.SendIM");
- view_listener_t::addMenu(new LLAvatarCall(), "Avatar.Call");
+ view_listener_t::addMenu(new LLAvatarCall(), "Avatar.Call", cb_info::UNTRUSTED_BLOCK);
enable.add("Avatar.EnableCall", boost::bind(&LLAvatarActions::canCall));
- view_listener_t::addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse");
+ view_listener_t::addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse", cb_info::UNTRUSTED_THROTTLE);
view_listener_t::addMenu(new LLAvatarToggleMyProfile(), "Avatar.ToggleMyProfile");
view_listener_t::addMenu(new LLAvatarTogglePicks(), "Avatar.TogglePicks");
view_listener_t::addMenu(new LLAvatarToggleSearch(), "Avatar.ToggleSearch");
- view_listener_t::addMenu(new LLAvatarResetSkeleton(), "Avatar.ResetSkeleton");
+ view_listener_t::addMenu(new LLAvatarResetSkeleton(), "Avatar.ResetSkeleton", cb_info::UNTRUSTED_THROTTLE);
view_listener_t::addMenu(new LLAvatarEnableResetSkeleton(), "Avatar.EnableResetSkeleton");
view_listener_t::addMenu(new LLAvatarResetSkeletonAndAnimations(), "Avatar.ResetSkeletonAndAnimations");
view_listener_t::addMenu(new LLAvatarResetSelfSkeleton(), "Avatar.ResetSelfSkeleton");
@@ -9949,22 +9963,22 @@ void initialize_menus()
enable.add("Avatar.IsMyProfileOpen", boost::bind(&my_profile_visible));
enable.add("Avatar.IsPicksTabOpen", boost::bind(&picks_tab_visible));
- commit.add("Avatar.OpenMarketplace", boost::bind(&LLWeb::loadURLExternal, gSavedSettings.getString("MarketplaceURL")));
+ registrar.add("Avatar.OpenMarketplace", boost::bind(&LLWeb::loadURLExternal, gSavedSettings.getString("MarketplaceURL")));
view_listener_t::addMenu(new LLAvatarEnableAddFriend(), "Avatar.EnableAddFriend");
enable.add("Avatar.EnableFreezeEject", boost::bind(&enable_freeze_eject, _2));
// Object pie menu
view_listener_t::addMenu(new LLObjectBuild(), "Object.Build");
- commit.add("Object.Touch", boost::bind(&handle_object_touch));
- commit.add("Object.ShowOriginal", boost::bind(&handle_object_show_original));
- commit.add("Object.SitOrStand", boost::bind(&handle_object_sit_or_stand));
- commit.add("Object.Delete", boost::bind(&handle_object_delete));
+ registrar.add("Object.Touch", boost::bind(&handle_object_touch));
+ registrar.add("Object.ShowOriginal", boost::bind(&handle_object_show_original));
+ registrar.add("Object.SitOrStand", boost::bind(&handle_object_sit_or_stand));
+ registrar.add("Object.Delete", boost::bind(&handle_object_delete));
view_listener_t::addMenu(new LLObjectAttachToAvatar(true), "Object.AttachToAvatar");
view_listener_t::addMenu(new LLObjectAttachToAvatar(false), "Object.AttachAddToAvatar");
view_listener_t::addMenu(new LLObjectReturn(), "Object.Return");
- commit.add("Object.Duplicate", boost::bind(&LLSelectMgr::duplicate, LLSelectMgr::getInstance()));
- view_listener_t::addMenu(new LLObjectReportAbuse(), "Object.ReportAbuse");
+ registrar.add("Object.Duplicate", boost::bind(&LLSelectMgr::duplicate, LLSelectMgr::getInstance()));
+ view_listener_t::addMenu(new LLObjectReportAbuse(), "Object.ReportAbuse", cb_info::UNTRUSTED_THROTTLE);
view_listener_t::addMenu(new LLObjectMute(), "Object.Mute");
enable.add("Object.VisibleTake", boost::bind(&visible_take_object));
@@ -9973,15 +9987,15 @@ void initialize_menus()
enable.add("Object.EnableTakeMultiple", boost::bind(&enable_take_objects));
enable.add("Object.VisibleBuy", boost::bind(&visible_buy_object));
- commit.add("Object.Buy", boost::bind(&handle_buy));
- commit.add("Object.Edit", boost::bind(&handle_object_edit));
- commit.add("Object.EditGLTFMaterial", boost::bind(&handle_object_edit_gltf_material));
- commit.add("Object.Inspect", boost::bind(&handle_object_inspect));
- commit.add("Object.Open", boost::bind(&handle_object_open));
- commit.add("Object.Take", boost::bind(&handle_take, false));
- commit.add("Object.TakeSeparate", boost::bind(&handle_take, true));
- commit.add("Object.TakeSeparateCopy", boost::bind(&handle_take_separate_copy));
- commit.add("Object.ShowInspector", boost::bind(&handle_object_show_inspector));
+ registrar.add("Object.Buy", boost::bind(&handle_buy), cb_info::UNTRUSTED_THROTTLE);
+ registrar.add("Object.Edit", boost::bind(&handle_object_edit));
+ registrar.add("Object.EditGLTFMaterial", boost::bind(&handle_object_edit_gltf_material));
+ registrar.add("Object.Inspect", boost::bind(&handle_object_inspect));
+ registrar.add("Object.Open", boost::bind(&handle_object_open));
+ registrar.add("Object.Take", boost::bind(&handle_take, false));
+ registrar.add("Object.TakeSeparate", boost::bind(&handle_take, true));
+ registrar.add("Object.TakeSeparateCopy", boost::bind(&handle_take_separate_copy));
+ registrar.add("Object.ShowInspector", boost::bind(&handle_object_show_inspector));
enable.add("Object.EnableInspect", boost::bind(&enable_object_inspect));
enable.add("Object.EnableEditGLTFMaterial", boost::bind(&enable_object_edit_gltf_material));
enable.add("Object.EnableOpen", boost::bind(&enable_object_open));
@@ -10000,7 +10014,7 @@ void initialize_menus()
enable.add("Object.EnableMute", boost::bind(&enable_object_mute));
enable.add("Object.EnableUnmute", boost::bind(&enable_object_unmute));
enable.add("Object.EnableBuy", boost::bind(&enable_buy_object));
- commit.add("Object.ZoomIn", boost::bind(&handle_look_at_selection, "zoom"));
+ registrar.add("Object.ZoomIn", boost::bind(&handle_look_at_selection, "zoom"));
// Attachment pie menu
enable.add("Attachment.Label", boost::bind(&onEnableAttachmentLabel, _1, _2));
@@ -10022,14 +10036,14 @@ void initialize_menus()
view_listener_t::addMenu(new LLMuteParticle(), "Particle.Mute");
view_listener_t::addMenu(new LLLandEnableBuyPass(), "Land.EnableBuyPass");
- commit.add("Land.Buy", boost::bind(&handle_buy_land));
+ registrar.add("Land.Buy", boost::bind(&handle_buy_land), cb_info::UNTRUSTED_THROTTLE);
// Generic actions
- commit.add("ReportAbuse", boost::bind(&handle_report_abuse));
- commit.add("BuyCurrency", boost::bind(&handle_buy_currency));
+ registrar.add("ReportAbuse", boost::bind(&handle_report_abuse), cb_info::UNTRUSTED_THROTTLE);
+ registrar.add("BuyCurrency", boost::bind(&handle_buy_currency), cb_info::UNTRUSTED_THROTTLE);
view_listener_t::addMenu(new LLShowHelp(), "ShowHelp");
view_listener_t::addMenu(new LLToggleHelp(), "ToggleHelp");
- view_listener_t::addMenu(new LLToggleSpeak(), "ToggleSpeak");
+ view_listener_t::addMenu(new LLToggleSpeak(), "ToggleSpeak", cb_info::UNTRUSTED_BLOCK);
view_listener_t::addMenu(new LLPromptShowURL(), "PromptShowURL");
view_listener_t::addMenu(new LLShowAgentProfile(), "ShowAgentProfile");
view_listener_t::addMenu(new LLShowAgentProfilePicks(), "ShowAgentProfilePicks");
@@ -10038,18 +10052,18 @@ void initialize_menus()
view_listener_t::addMenu(new LLToggleShaderControl(), "ToggleShaderControl");
view_listener_t::addMenu(new LLCheckControl(), "CheckControl");
view_listener_t::addMenu(new LLGoToObject(), "GoToObject");
- commit.add("PayObject", boost::bind(&handle_give_money_dialog));
+ registrar.add("PayObject", boost::bind(&handle_give_money_dialog));
- commit.add("Inventory.NewWindow", boost::bind(&LLPanelMainInventory::newWindow));
+ registrar.add("Inventory.NewWindow", boost::bind(&LLPanelMainInventory::newWindow), cb_info::UNTRUSTED_THROTTLE);
enable.add("EnablePayObject", boost::bind(&enable_pay_object));
enable.add("EnablePayAvatar", boost::bind(&enable_pay_avatar));
enable.add("EnableEdit", boost::bind(&enable_object_edit));
enable.add("EnableMuteParticle", boost::bind(&enable_mute_particle));
- commit.add("Pathfinding.Linksets.Select", boost::bind(&LLFloaterPathfindingLinksets::openLinksetsWithSelectedObjects));
+ registrar.add("Pathfinding.Linksets.Select", boost::bind(&LLFloaterPathfindingLinksets::openLinksetsWithSelectedObjects));
enable.add("EnableSelectInPathfindingLinksets", boost::bind(&enable_object_select_in_pathfinding_linksets));
enable.add("VisibleSelectInPathfindingLinksets", boost::bind(&visible_object_select_in_pathfinding_linksets));
- commit.add("Pathfinding.Characters.Select", boost::bind(&LLFloaterPathfindingCharacters::openCharactersWithSelectedObjects));
+ registrar.add("Pathfinding.Characters.Select", boost::bind(&LLFloaterPathfindingCharacters::openCharactersWithSelectedObjects));
enable.add("EnableSelectInPathfindingCharacters", boost::bind(&enable_object_select_in_pathfinding_characters));
enable.add("Advanced.EnableErrorOSException", boost::bind(&enable_os_exception));
enable.add("EnableGLTF", boost::bind(&enable_gltf));
@@ -10065,4 +10079,6 @@ void initialize_menus()
view_listener_t::addMenu(new LLEditableSelected(), "EditableSelected");
view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono");
view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints");
+
+ registrar.add("Lua.RunScript", boost::bind(&lua_run_script, _2), cb_info::UNTRUSTED_BLOCK);
}
diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h
index 68c3dbc126..5e4b24c7e8 100644
--- a/indra/newview/llviewermenu.h
+++ b/indra/newview/llviewermenu.h
@@ -109,6 +109,7 @@ void handle_give_money_dialog();
bool enable_pay_object();
bool enable_buy_object();
bool handle_go_to();
+bool handle_env_setting_event(std::string event_name);
// Convert strings to internal types
U32 render_type_from_string(std::string_view render_type);
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index ce66dbc03f..2a871a24af 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -906,16 +906,22 @@ class LLFileEnableCloseAllWindows : public view_listener_t
}
};
+void close_all_windows()
+{
+ bool app_quitting = false;
+ gFloaterView->closeAllChildren(app_quitting);
+ LLFloaterSnapshot *floater_snapshot = LLFloaterSnapshot::findInstance();
+ if (floater_snapshot)
+ floater_snapshot->closeFloater(app_quitting);
+ if (gMenuHolder)
+ gMenuHolder->hideMenus();
+}
+
class LLFileCloseAllWindows : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- bool app_quitting = false;
- gFloaterView->closeAllChildren(app_quitting);
- LLFloaterSnapshot* floater_snapshot = LLFloaterSnapshot::findInstance();
- if (floater_snapshot)
- floater_snapshot->closeFloater(app_quitting);
- if (gMenuHolder) gMenuHolder->hideMenus();
+ close_all_windows();
return true;
}
};
diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h
index d99f9dc4c6..6b628f07de 100644
--- a/indra/newview/llviewermenufile.h
+++ b/indra/newview/llviewermenufile.h
@@ -74,6 +74,8 @@ bool get_bulk_upload_expected_cost(
void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k);
+void close_all_windows();
+
//consider moving all file pickers below to more suitable place
class LLFilePickerThread : public LLThread
{ //multi-threaded file picker (runs system specific file picker in background and calls "notify" from main thread)
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index dc2258644f..a81ce58323 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2425,8 +2425,11 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
bool ircstyle = false;
+ auto [message, is_script] = LLStringUtil::withoutPrefix(mesg, LUA_PREFIX);
+ chat.mIsScript = is_script;
+
// Look for IRC-style emotes here so chatbubbles work
- std::string prefix = mesg.substr(0, 4);
+ std::string prefix = message.substr(0, 4);
if (prefix == "/me " || prefix == "/me'")
{
ircstyle = true;
@@ -2468,10 +2471,19 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
else
{
chat.mText = "";
+ auto [msg_without_prefix, is_lua] = LLStringUtil::withoutPrefix(mesg, LUA_PREFIX);
+ std::string prefix;
+ if (is_lua)
+ {
+ prefix = LUA_PREFIX;
+ }
switch(chat.mChatType)
{
case CHAT_TYPE_WHISPER:
- chat.mText = LLTrans::getString("whisper") + " ";
+ prefix += LLTrans::getString("whisper") + " ";
+ break;
+ case CHAT_TYPE_SHOUT:
+ prefix += LLTrans::getString("shout") + " ";
break;
case CHAT_TYPE_OWNER:
if (RlvActions::isRlvEnabled())
@@ -2495,9 +2507,6 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
case CHAT_TYPE_NORMAL:
case CHAT_TYPE_DIRECT:
break;
- case CHAT_TYPE_SHOUT:
- chat.mText = LLTrans::getString("shout") + " ";
- break;
case CHAT_TYPE_START:
case CHAT_TYPE_STOP:
LL_WARNS("Messaging") << "Got chat type start/stop in main chat processing." << LL_ENDL;
@@ -2507,7 +2516,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
break;
}
- chat.mText += mesg;
+ chat.mText = prefix + msg_without_prefix;
}
// We have a real utterance now, so can stop showing "..." and proceed.
@@ -2588,6 +2597,11 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
msg_notify["from_id"] = chat.mFromID;
msg_notify["source_type"] = chat.mSourceType;
on_new_message(msg_notify);
+
+
+ msg_notify["chat_type"] = chat.mChatType;
+ msg_notify["message"] = mesg;
+ LLEventPumps::instance().obtain("LLNearbyChat").post(msg_notify);
}
}
@@ -2733,7 +2747,7 @@ public:
virtual ~LLPostTeleportNotifiers();
//function to be called at the supplied frequency
- virtual bool tick();
+ bool tick() override;
};
LLPostTeleportNotifiers::LLPostTeleportNotifiers() : LLEventTimer( 2.0 )
@@ -6759,7 +6773,8 @@ void onCovenantLoadComplete(const LLUUID& asset_uuid,
{
LL_DEBUGS("Messaging") << "onCovenantLoadComplete()" << LL_ENDL;
std::string covenant_text;
- if(0 == status)
+ std::unique_ptr<LLViewerTextEditor> editorp;
+ if (0 == status)
{
LLFileSystem file(asset_uuid, type, LLFileSystem::READ);
@@ -6780,13 +6795,13 @@ void onCovenantLoadComplete(const LLUUID& asset_uuid,
{
LL_WARNS("Messaging") << "Problem importing estate covenant." << LL_ENDL;
covenant_text = "Problem importing estate covenant.";
+ delete editor;
}
else
{
// Version 0 (just text, doesn't include version number)
- covenant_text = editor->getText();
+ editorp.reset(editor); // Use covenant from editorp;
}
- delete editor;
}
else
{
@@ -6812,17 +6827,32 @@ void onCovenantLoadComplete(const LLUUID& asset_uuid,
LL_WARNS("Messaging") << "Problem loading notecard: " << status << LL_ENDL;
}
- LLPanelEstateCovenant::updateCovenantText(covenant_text, asset_uuid);
- LLPanelLandCovenant::updateCovenantText(covenant_text);
- LLFloaterBuyLand::updateCovenantText(covenant_text, asset_uuid);
- LLPanelPlaceProfile* panel = LLFloaterSidePanelContainer::getPanel<LLPanelPlaceProfile>("places", "panel_place_profile");
- if (panel)
+ if (editorp)
{
- panel->updateCovenantText(covenant_text);
+ LLPanelEstateCovenant::updateCovenant(editorp.get(), asset_uuid);
+ LLPanelLandCovenant::updateCovenant(editorp.get());
+ LLFloaterBuyLand::updateCovenant(editorp.get(), asset_uuid);
+ }
+ else
+ {
+ LLPanelEstateCovenant::updateCovenantText(covenant_text, asset_uuid);
+ LLPanelLandCovenant::updateCovenantText(covenant_text);
+ LLFloaterBuyLand::updateCovenantText(covenant_text, asset_uuid);
}
-}
+ if (LLPanelPlaceProfile* panel = LLFloaterSidePanelContainer::getPanel<LLPanelPlaceProfile>("places", "panel_place_profile"))
+ {
+ if (editorp)
+ {
+ panel->updateCovenant(editorp.get());
+ }
+ else
+ {
+ panel->updateCovenantText(covenant_text);
+ }
+ }
+}
void process_feature_disabled_message(LLMessageSystem* msg, void**)
{
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 86440fca48..7741f1fbe7 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -2325,6 +2325,12 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
// Set the rotation of the object followed by adjusting for the accumulated angular velocity (llSetTargetOmega)
setRotation(new_rot * mAngularVelocityRot);
+ if ((mFlags & FLAGS_SERVER_AUTOPILOT) && asAvatar() && asAvatar()->isSelf())
+ {
+ gAgent.resetAxes();
+ gAgent.rotate(new_rot);
+ gAgentCamera.resetView();
+ }
setChanged(ROTATED | SILHOUETTE);
}
@@ -2917,24 +2923,33 @@ void LLViewerObject::fetchInventoryFromServer()
delete mInventory;
mInventory = NULL;
- // Results in processTaskInv
- LLMessageSystem* msg = gMessageSystem;
- msg->newMessageFast(_PREHASH_RequestTaskInventory);
- msg->nextBlockFast(_PREHASH_AgentData);
- msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
- msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
- msg->nextBlockFast(_PREHASH_InventoryData);
- msg->addU32Fast(_PREHASH_LocalID, mLocalID);
- msg->sendReliable(mRegionp->getHost());
-
// This will get reset by doInventoryCallback or processTaskInv
mInvRequestState = INVENTORY_REQUEST_PENDING;
+
+ if (mRegionp && !mRegionp->getCapability("RequestTaskInventory").empty())
+ {
+ LLCoros::instance().launch("LLViewerObject::fetchInventoryFromCapCoro()",
+ boost::bind(&LLViewerObject::fetchInventoryFromCapCoro, mID));
+ }
+ else
+ {
+ LL_WARNS() << "Using old task inventory path!" << LL_ENDL;
+ // Results in processTaskInv
+ LLMessageSystem *msg = gMessageSystem;
+ msg->newMessageFast(_PREHASH_RequestTaskInventory);
+ msg->nextBlockFast(_PREHASH_AgentData);
+ msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+ msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
+ msg->nextBlockFast(_PREHASH_InventoryData);
+ msg->addU32Fast(_PREHASH_LocalID, mLocalID);
+ msg->sendReliable(mRegionp->getHost());
+ }
}
}
void LLViewerObject::fetchInventoryDelayed(const F64 &time_seconds)
{
- // unless already waiting, drop previous request and shedule an update
+ // unless already waiting, drop previous request and schedule an update
if (mInvRequestState != INVENTORY_REQUEST_WAIT)
{
if (mInvRequestXFerId != 0)
@@ -2965,6 +2980,80 @@ void LLViewerObject::fetchInventoryDelayedCoro(const LLUUID task_inv, const F64
}
}
+//static
+void LLViewerObject::fetchInventoryFromCapCoro(const LLUUID task_inv)
+{
+ LLViewerObject *obj = gObjectList.findObject(task_inv);
+ if (obj)
+ {
+ LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
+ LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
+ httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("TaskInventoryRequest", httpPolicy));
+ LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
+ std::string url = obj->mRegionp->getCapability("RequestTaskInventory") + "?task_id=" + obj->mID.asString();
+ // If we already have a copy of the inventory then add it so the server won't re-send something we already have.
+ // We expect this case to crop up in the case of failed inventory mutations, but it might happen otherwise as well.
+ if (obj->mInventorySerialNum && obj->mInventory)
+ url += "&inventory_serial=" + std::to_string(obj->mInventorySerialNum);
+
+ obj->mInvRequestState = INVENTORY_XFER;
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
+
+ LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
+ LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
+
+ // Object may have gone away while we were suspended, double-check that it still exists
+ obj = gObjectList.findObject(task_inv);
+ if (!obj)
+ {
+ LL_WARNS() << "Object " << task_inv << " went away while fetching inventory, dropping result" << LL_ENDL;
+ return;
+ }
+
+ bool potentially_stale = false;
+ if (status)
+ {
+ // Dealing with inventory serials is kind of funky. They're monotonically increasing and 16 bits,
+ // so we expect them to overflow, but we can use inv serial < expected serial as a signal that we may
+ // have mutated the task inventory since we kicked off the request, and those mutations may have not
+ // been taken into account yet. Of course, those mutations may have actually failed which would result
+ // in the inv serial never increasing.
+ //
+ // When we detect this case, set the expected inv serial to the inventory serial we actually received
+ // and kick off a re-request after a slight delay.
+ S16 serial = (S16)result["inventory_serial"].asInteger();
+ potentially_stale = serial < obj->mExpectedInventorySerialNum;
+ LL_INFOS() << "Inventory loaded for " << task_inv << LL_ENDL;
+ obj->mInventorySerialNum = serial;
+ obj->mExpectedInventorySerialNum = serial;
+ obj->loadTaskInvLLSD(result);
+ }
+ else if (status.getType() == 304)
+ {
+ LL_INFOS() << "Inventory wasn't changed on server!" << LL_ENDL;
+ obj->mInvRequestState = INVENTORY_REQUEST_STOPPED;
+ // Even though it wasn't necessary to send a response, we still may have mutated
+ // the inventory since we kicked off the request, check for that case.
+ potentially_stale = obj->mInventorySerialNum < obj->mExpectedInventorySerialNum;
+ // Set this to what we already have so that we don't re-request a second time.
+ obj->mExpectedInventorySerialNum = obj->mInventorySerialNum;
+ }
+ else
+ {
+ // Not sure that there's anything sensible we can do to recover here, retrying in a loop would be bad.
+ LL_WARNS() << "Error status while requesting task inventory: " << status.toString() << LL_ENDL;
+ obj->mInvRequestState = INVENTORY_REQUEST_STOPPED;
+ }
+
+ if (potentially_stale)
+ {
+ // Stale? I guess we can use what we got for now, but we'll have to re-request
+ LL_WARNS() << "Stale inv_serial? Re-requesting." << LL_ENDL;
+ obj->fetchInventoryDelayed(INVENTORY_UPDATE_WAIT_TIME_OUTDATED);
+ }
+ }
+}
+
LLControlAvatar *LLViewerObject::getControlAvatar()
{
return getRootEdit()->mControlAvatar.get();
@@ -3140,6 +3229,20 @@ void LLViewerObject::processTaskInv(LLMessageSystem* msg, void** user_data)
S16 serial = 0;
msg->getS16Fast(_PREHASH_InventoryData, _PREHASH_Serial, serial);
+ if (object->mRegionp && !object->mRegionp->getCapability("RequestTaskInventory").empty())
+ {
+ // It seems that simulator may ask us to re-download the task inventory if an update to the inventory
+ // happened out-of-band while we had the object selected (like if a script is saved.)
+ //
+ // If we're meant to use the HTTP capability, ignore the contents of the UDP message and fetch the
+ // inventory via the CAP so that we don't flow down the UDP inventory request path unconditionally here.
+ // We shouldn't need to wait, as any updates should already be ready to fetch by this point.
+ LL_INFOS() << "Handling unsolicited ReplyTaskInventory for " << task_id << LL_ENDL;
+ object->mExpectedInventorySerialNum = serial;
+ object->fetchInventoryFromServer();
+ return;
+ }
+
if (serial == object->mInventorySerialNum
&& serial < object->mExpectedInventorySerialNum)
{
@@ -3347,6 +3450,47 @@ bool LLViewerObject::loadTaskInvFile(const std::string& filename)
return true;
}
+void LLViewerObject::loadTaskInvLLSD(const LLSD& inv_result)
+{
+ if (inv_result.has("contents"))
+ {
+ if(mInventory)
+ {
+ mInventory->clear(); // will deref and delete it
+ }
+ else
+ {
+ mInventory = new LLInventoryObject::object_list_t;
+ }
+
+ // Synthesize the "Contents" category, the viewer expects it, but it isn't sent.
+ LLPointer<LLInventoryObject> inv = new LLInventoryObject(mID, LLUUID::null, LLAssetType::AT_CATEGORY, "Contents");
+ mInventory->push_front(inv);
+
+ const LLSD& inventory = inv_result["contents"];
+ for (const auto& inv_entry : llsd::inArray(inventory))
+ {
+ if (inv_entry.has("item_id"))
+ {
+ LLPointer<LLViewerInventoryItem> inv = new LLViewerInventoryItem;
+ inv->unpackMessage(inv_entry);
+ mInventory->push_front(inv);
+ }
+ else
+ {
+ LL_WARNS_ONCE() << "Unknown inventory entry while reading from inventory file. Entry: '"
+ << inv_entry << "'" << LL_ENDL;
+ }
+ }
+ }
+ else
+ {
+ LL_WARNS() << "unable to load task inventory: " << inv_result << LL_ENDL;
+ return;
+ }
+ doInventoryCallback();
+}
+
void LLViewerObject::doInventoryCallback()
{
for (callback_list_t::iterator iter = mInventoryCallbacks.begin();
@@ -5097,8 +5241,7 @@ void LLViewerObject::updateTEMaterialTextures(U8 te)
LLUUID mat_id = getRenderMaterialID(te);
if (mat == nullptr && mat_id.notNull())
{
- mat = (LLFetchedGLTFMaterial*) gGLTFMaterialList.getMaterial(mat_id);
- llassert(mat == nullptr || dynamic_cast<LLFetchedGLTFMaterial*>(gGLTFMaterialList.getMaterial(mat_id)) != nullptr);
+ mat = gGLTFMaterialList.getMaterial(mat_id);
if (mat->isFetching())
{ // material is not loaded yet, rebuild draw info when the object finishes loading
mat->onMaterialComplete([id=getID()]
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index b6846c6716..09f813accc 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -688,6 +688,7 @@ private:
// forms task inventory request after some time passed, marks request as pending
void fetchInventoryDelayed(const F64 &time_seconds);
static void fetchInventoryDelayedCoro(const LLUUID task_inv, const F64 time_seconds);
+ static void fetchInventoryFromCapCoro(const LLUUID task_inv);
public:
//
@@ -822,6 +823,7 @@ protected:
static void processTaskInvFile(void** user_data, S32 error_code, LLExtStat ext_status);
bool loadTaskInvFile(const std::string& filename);
+ void loadTaskInvLLSD(const LLSD &inv_result);
void doInventoryCallback();
bool isOnMap();
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 9e1d86faac..6167129077 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -65,6 +65,7 @@
#include "lltoolmgr.h"
#include "lltoolpie.h"
#include "llkeyboard.h"
+#include "llmeshrepository.h"
#include "u64.h"
#include "llviewertexturelist.h"
#include "lldatapacker.h"
@@ -1419,6 +1420,10 @@ void LLViewerObjectList::cleanDeadObjects(bool use_timer)
// No dead objects, don't need to scan object list.
return;
}
+ if ((LLApp::isExiting()) || (mNumDeadObjects == (S32)mObjects.size()))
+ {
+ gMeshRepo.unregisterAllMeshes();
+ }
LL_PROFILE_ZONE_SCOPED;
diff --git a/indra/newview/llviewerparcelmediaautoplay.h b/indra/newview/llviewerparcelmediaautoplay.h
index 96b569f126..9759cf6a17 100644
--- a/indra/newview/llviewerparcelmediaautoplay.h
+++ b/indra/newview/llviewerparcelmediaautoplay.h
@@ -35,7 +35,7 @@ class LLViewerParcelMediaAutoPlay : LLEventTimer, public LLSingleton<LLViewerPar
{
LLSINGLETON(LLViewerParcelMediaAutoPlay);
public:
- virtual bool tick() override;
+ bool tick() override;
static void playStarted();
private:
diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp
index 2e9b5de72b..019e870829 100755
--- a/indra/newview/llviewerparceloverlay.cpp
+++ b/indra/newview/llviewerparceloverlay.cpp
@@ -33,6 +33,7 @@
#include "llfloaterreg.h"
#include "llgl.h"
#include "llrender.h"
+#include "lluicolor.h"
#include "v4color.h"
#include "v2math.h"
@@ -50,8 +51,8 @@
#include "pipeline.h"
-static const U8 OVERLAY_IMG_COMPONENTS = 4;
-static const F32 LINE_WIDTH = 0.0625f;
+static constexpr U8 OVERLAY_IMG_COMPONENTS = 4;
+static constexpr F32 LINE_WIDTH = 0.0625f;
bool LLViewerParcelOverlay::sColorSetInitialized = false;
LLUIColor LLViewerParcelOverlay::sAvailColor;
@@ -62,9 +63,9 @@ LLUIColor LLViewerParcelOverlay::sForSaleColor;
LLUIColor LLViewerParcelOverlay::sAuctionColor;
LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_width_meters)
-: mRegion( region ),
- mParcelGridsPerEdge( S32( region_width_meters / PARCEL_GRID_STEP_METERS ) ),
- mDirty( false ),
+: mRegion(region),
+ mParcelGridsPerEdge(S32(region_width_meters / PARCEL_GRID_STEP_METERS)),
+ mDirty(false),
mTimeSinceLastUpdate(),
mOverlayTextureIdx(-1)
{
@@ -91,7 +92,7 @@ LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_
// Initialize the GL texture with empty data.
//
// Create the base texture.
- U8 *raw = mImageRaw->getData();
+ U8* raw = mImageRaw->getData();
const S32 COUNT = mParcelGridsPerEdge * mParcelGridsPerEdge * OVERLAY_IMG_COMPONENTS;
for (S32 i = 0; i < COUNT; i++)
{
@@ -158,10 +159,10 @@ bool LLViewerParcelOverlay::encroachesOwned(const std::vector<LLBBox>& boxes) co
LLVector3 min = boxes[i].getMinAgent();
LLVector3 max = boxes[i].getMaxAgent();
- S32 left = S32(llclamp((min.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
- S32 right = S32(llclamp((max.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
- S32 top = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
- S32 bottom = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
+ S32 left = S32(llclamp((min.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
+ S32 right = S32(llclamp((max.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
+ S32 top = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
+ S32 bottom = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
for (S32 row = top; row <= bottom; row++)
{
@@ -186,10 +187,10 @@ bool LLViewerParcelOverlay::encroachesOnUnowned(const std::vector<LLBBox>& boxes
LLVector3 min = boxes[i].getMinAgent();
LLVector3 max = boxes[i].getMaxAgent();
- S32 left = S32(llclamp((min.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
- S32 right = S32(llclamp((max.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
- S32 top = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
- S32 bottom = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
+ S32 left = S32(llclamp((min.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
+ S32 right = S32(llclamp((max.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
+ S32 top = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
+ S32 bottom = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
for (S32 row = top; row <= bottom; row++)
{
@@ -223,10 +224,10 @@ bool LLViewerParcelOverlay::encroachesOnNearbyParcel(const std::vector<LLBBox>&
return true;
}
- S32 left = S32(llclamp((min.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
- S32 right = S32(llclamp((max.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
- S32 bottom = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
- S32 top = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1));
+ S32 left = S32(llclamp((min.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
+ S32 right = S32(llclamp((max.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
+ S32 bottom = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
+ S32 top = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1.f));
const S32 GRIDS_PER_EDGE = mParcelGridsPerEdge;
@@ -348,11 +349,11 @@ void LLViewerParcelOverlay::updateOverlayTexture()
const LLColor4U auction = sAuctionColor.get();
// Create the base texture.
- U8 *raw = mImageRaw->getData();
+ U8* raw = mImageRaw->getData();
const S32 COUNT = mParcelGridsPerEdge * mParcelGridsPerEdge;
S32 max = mOverlayTextureIdx + mParcelGridsPerEdge;
if (max > COUNT) max = COUNT;
- S32 pixel_index = mOverlayTextureIdx*OVERLAY_IMG_COMPONENTS;
+ S32 pixel_index = mOverlayTextureIdx * OVERLAY_IMG_COMPONENTS;
S32 i;
for (i = mOverlayTextureIdx; i < max; i++)
{
@@ -361,7 +362,7 @@ void LLViewerParcelOverlay::updateOverlayTexture()
U8 r,g,b,a;
// Color stored in low three bits
- switch( ownership & 0x7 )
+ switch (ownership & 0x7)
{
case PARCEL_PUBLIC:
r = avail.mV[VRED];
@@ -407,10 +408,10 @@ void LLViewerParcelOverlay::updateOverlayTexture()
break;
}
- raw[pixel_index + 0] = (U8)r;
- raw[pixel_index + 1] = (U8)g;
- raw[pixel_index + 2] = (U8)b;
- raw[pixel_index + 3] = (U8)a;
+ raw[pixel_index + VRED] = (U8)r;
+ raw[pixel_index + VGREEN] = (U8)g;
+ raw[pixel_index + VBLUE] = (U8)b;
+ raw[pixel_index + VALPHA] = (U8)a;
pixel_index += OVERLAY_IMG_COMPONENTS;
}
@@ -431,11 +432,10 @@ void LLViewerParcelOverlay::updateOverlayTexture()
}
}
-
-void LLViewerParcelOverlay::uncompressLandOverlay(S32 chunk, U8 *packed_overlay)
+void LLViewerParcelOverlay::uncompressLandOverlay(S32 chunk, U8* packed_overlay)
{
// Unpack the message data into the ownership array
- S32 size = mParcelGridsPerEdge * mParcelGridsPerEdge;
+ S32 size = mParcelGridsPerEdge * mParcelGridsPerEdge;
S32 chunk_size = size / PARCEL_OVERLAY_CHUNKS;
memcpy(mOwnership + chunk*chunk_size, packed_overlay, chunk_size); /*Flawfinder: ignore*/
@@ -460,16 +460,16 @@ void LLViewerParcelOverlay::updatePropertyLines()
mEdges.clear();
- const F32 GRID_STEP = PARCEL_GRID_STEP_METERS;
+ constexpr F32 GRID_STEP = PARCEL_GRID_STEP_METERS;
const S32 GRIDS_PER_EDGE = mParcelGridsPerEdge;
for (S32 row = 0; row < GRIDS_PER_EDGE; row++)
{
for (S32 col = 0; col < GRIDS_PER_EDGE; col++)
{
- U8 overlay = mOwnership[row*GRIDS_PER_EDGE+col];
+ U8 overlay = mOwnership[row * GRIDS_PER_EDGE + col];
S32 colorIndex = overlay & PARCEL_COLOR_MASK;
- switch(colorIndex)
+ switch (colorIndex)
{
case PARCEL_SELF:
case PARCEL_GROUP:
@@ -483,11 +483,11 @@ void LLViewerParcelOverlay::updatePropertyLines()
const LLColor4U& color = colors[colorIndex];
- F32 left = col*GRID_STEP;
- F32 right = left+GRID_STEP;
+ F32 left = col * GRID_STEP;
+ F32 right = left + GRID_STEP;
- F32 bottom = row*GRID_STEP;
- F32 top = bottom+GRID_STEP;
+ F32 bottom = row * GRID_STEP;
+ F32 top = bottom + GRID_STEP;
// West edge
if (overlay & PARCEL_WEST_LINE)
@@ -528,99 +528,123 @@ void LLViewerParcelOverlay::addPropertyLine(F32 start_x, F32 start_y, F32 dx, F3
Edge& edge = mEdges.back();
edge.color = color;
+ // Detailized rendering vertices:
+ // A B C D E F G
+ // *-*------*--------*--------*------*-* : 'outside' vertices are placed right on the border
+ // *------*--------*--------*------* : 'inside' vertices are shifted on LINE_WIDTH inside
+
+ // Simplified rendering vertices:
+ // A G
+ // *-----------------------------------*
+ // *-----------------------------------*
+
F32 outside_x = start_x;
F32 outside_y = start_y;
- F32 outside_z = 0.f;
- F32 inside_x = start_x + tick_dx;
- F32 inside_y = start_y + tick_dy;
- F32 inside_z = 0.f;
+ F32 outside_z = land.resolveHeightRegion(outside_x, outside_y);
+ F32 inside_x = start_x + tick_dx;
+ F32 inside_y = start_y + tick_dy;
+ F32 inside_z = land.resolveHeightRegion(inside_x, inside_y);
+
+ auto move = [&](F32 distance)
+ {
+ outside_x += dx * distance;
+ outside_y += dy * distance;
+ outside_z = land.resolveHeightRegion(outside_x, outside_y);
+ inside_x += dx * distance;
+ inside_y += dy * distance;
+ inside_z = land.resolveHeightRegion(inside_x, inside_y);
+ };
- auto split = [&](const LLVector3& start, F32 x, F32 y, F32 z, F32 part)
+ auto split = [&](U32 lod, const LLVector4a& start, F32 x, F32 y, F32 z, F32 part)
{
- F32 new_x = start.mV[0] + (x - start.mV[0]) * part;
- F32 new_y = start.mV[1] + (y - start.mV[1]) * part;
- F32 new_z = start.mV[2] + (z - start.mV[2]) * part;
- edge.vertices.emplace_back(new_x, new_y, new_z);
+ F32 new_x = start[VX] + (x - start[VX]) * part;
+ F32 new_y = start[VY] + (y - start[VY]) * part;
+ F32 new_z = start[VZ] + (z - start[VZ]) * part;
+ edge.pushVertex(lod, new_x, new_y, new_z, water_z);
};
- auto checkForSplit = [&]()
+ auto checkForSplit = [&](U32 lod)
{
- const LLVector3& last_outside = edge.vertices.back();
- F32 z0 = last_outside.mV[2];
+ const std::vector<LLVector4a>& vertices = edge.verticesUnderWater[lod];
+ const LLVector4a& last_outside = vertices.back();
+ F32 z0 = last_outside[VZ];
F32 z1 = outside_z;
if ((z0 >= water_z && z1 >= water_z) || (z0 < water_z && z1 < water_z))
return;
F32 part = (water_z - z0) / (z1 - z0);
- const LLVector3& last_inside = edge.vertices[edge.vertices.size() - 2];
- split(last_inside, inside_x, inside_y, inside_z, part);
- split(last_outside, outside_x, outside_y, outside_z, part);
+ const LLVector4a& last_inside = vertices[vertices.size() - 2];
+ split(lod, last_inside, inside_x, inside_y, inside_z, part);
+ split(lod, last_outside, outside_x, outside_y, outside_z, part);
};
- // First part, only one vertex
- outside_z = land.resolveHeightRegion( outside_x, outside_y );
-
- edge.vertices.emplace_back(outside_x, outside_y, outside_z);
-
- inside_x += dx * LINE_WIDTH;
- inside_y += dy * LINE_WIDTH;
-
- outside_x += dx * LINE_WIDTH;
- outside_y += dy * LINE_WIDTH;
-
- // Then the "actual edge"
- inside_z = land.resolveHeightRegion( inside_x, inside_y );
- outside_z = land.resolveHeightRegion( outside_x, outside_y );
+ auto pushTwoVertices = [&](U32 lod)
+ {
+ LLVector3 out(outside_x, outside_y, outside_z);
+ LLVector3 in(inside_x, inside_y, inside_z);
+ if (fabs(inside_z - outside_z) < LINE_WIDTH / 5)
+ {
+ edge.pushVertex(lod, inside_x, inside_y, inside_z, water_z);
+ }
+ else
+ {
+ // Make the line thinner if heights differ too much
+ LLVector3 dist(in - out);
+ F32 coef = dist.length() / LINE_WIDTH;
+ LLVector3 new_in(out + dist / coef);
+ edge.pushVertex(lod, new_in[VX], new_in[VY], new_in[VZ], water_z);
+ }
+ edge.pushVertex(lod, outside_x, outside_y, outside_z, water_z);
+ };
- edge.vertices.emplace_back(inside_x, inside_y, inside_z);
- edge.vertices.emplace_back(outside_x, outside_y, outside_z);
+ // Point A simplified (first two vertices)
+ pushTwoVertices(1);
- inside_x += dx * (dx - LINE_WIDTH);
- inside_y += dy * (dy - LINE_WIDTH);
+ // Point A detailized (only one vertex)
+ edge.pushVertex(0, outside_x, outside_y, outside_z, water_z);
- outside_x += dx * (dx - LINE_WIDTH);
- outside_y += dy * (dy - LINE_WIDTH);
+ // Point B (two vertices)
+ move(LINE_WIDTH);
+ pushTwoVertices(0);
- // Middle part, full width
- const S32 GRID_STEP = S32( PARCEL_GRID_STEP_METERS );
- for (S32 i = 1; i < GRID_STEP; i++)
+ // Points C, D, E
+ F32 distance = 1.f - LINE_WIDTH;
+ constexpr U32 GRID_STEP = (U32)PARCEL_GRID_STEP_METERS;
+ for (U32 i = 1; i < GRID_STEP; ++i)
{
- inside_z = land.resolveHeightRegion( inside_x, inside_y );
- outside_z = land.resolveHeightRegion( outside_x, outside_y );
-
- checkForSplit();
-
- edge.vertices.emplace_back(inside_x, inside_y, inside_z);
- edge.vertices.emplace_back(outside_x, outside_y, outside_z);
-
- inside_x += dx;
- inside_y += dy;
-
- outside_x += dx;
- outside_y += dy;
+ move(distance);
+ checkForSplit(0);
+ pushTwoVertices(0);
+ distance = 1.f;
}
- // Extra buffer for edge
- inside_x -= dx * LINE_WIDTH;
- inside_y -= dy * LINE_WIDTH;
-
- outside_x -= dx * LINE_WIDTH;
- outside_y -= dy * LINE_WIDTH;
-
- inside_z = land.resolveHeightRegion( inside_x, inside_y );
- outside_z = land.resolveHeightRegion( outside_x, outside_y );
+ // Point F (two vertices)
+ move(1.f - LINE_WIDTH);
+ checkForSplit(0);
+ pushTwoVertices(0);
- checkForSplit();
+ // Point G simplified (last two vertices)
+ move(LINE_WIDTH);
+ checkForSplit(1);
+ pushTwoVertices(1);
- edge.vertices.emplace_back(inside_x, inside_y, inside_z);
- edge.vertices.emplace_back(outside_x, outside_y, outside_z);
-
- outside_x += dx * LINE_WIDTH;
- outside_y += dy * LINE_WIDTH;
+ // Point G detailized (only one vertex)
+ edge.pushVertex(0, outside_x, outside_y, outside_z, water_z);
+}
- // Last edge is not drawn to the edge
- outside_z = land.resolveHeightRegion( outside_x, outside_y );
+void LLViewerParcelOverlay::Edge::pushVertex(U32 lod, F32 x, F32 y, F32 z, F32 water_z)
+{
+ verticesUnderWater[lod].emplace_back(x, y, z);
+ gGL.transform(verticesUnderWater[lod].back());
- edge.vertices.emplace_back(outside_x, outside_y, outside_z);
+ if (z >= water_z)
+ {
+ verticesAboveWater[lod].push_back(verticesUnderWater[lod].back());
+ }
+ else
+ {
+ verticesAboveWater[lod].emplace_back(x, y, water_z);
+ gGL.transform(verticesAboveWater[lod].back());
+ }
}
void LLViewerParcelOverlay::setDirty()
@@ -700,6 +724,8 @@ void LLViewerParcelOverlay::renderPropertyLines()
// Stomp the camera into two dimensions
LLVector3 camera_region = mRegion->getPosRegionFromGlobal( gAgentCamera.getCameraPositionGlobal() );
+ bool draw_underwater = camera_region.mV[VZ] < water_z ||
+ !gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_WATER);
// Set up a cull plane 2 * PARCEL_GRID_STEP_METERS behind
// the camera. The cull plane normal is the camera's at axis.
@@ -707,15 +733,23 @@ void LLViewerParcelOverlay::renderPropertyLines()
cull_plane_point *= -2.f * PARCEL_GRID_STEP_METERS;
cull_plane_point += camera_region;
- bool render_hidden = LLSelectMgr::sRenderHiddenSelections && LLFloaterReg::instanceVisible("build");
+ bool render_hidden = !draw_underwater &&
+ LLSelectMgr::sRenderHiddenSelections &&
+ LLFloaterReg::instanceVisible("build");
- const F32 PROPERTY_LINE_CLIP_DIST_SQUARED = 256.f * 256.f;
+ constexpr F32 PROPERTY_LINE_CLIP_DIST_SQUARED = 256.f * 256.f;
+ constexpr F32 PROPERTY_LINE_LOD0_DIST_SQUARED = PROPERTY_LINE_CLIP_DIST_SQUARED / 25.f;
for (const Edge& edge : mEdges)
{
- LLVector3 center = edge.vertices[edge.vertices.size() >> 1];
-
- if (dist_vec_squared2D(center, camera_region) > PROPERTY_LINE_CLIP_DIST_SQUARED)
+ const std::vector<LLVector4a>& vertices0 = edge.verticesAboveWater[0];
+ const F32* first = vertices0.front().getF32ptr();
+ const F32* last = vertices0.back().getF32ptr();
+ LLVector3 center((first[VX] + last[VX]) / 2, (first[VY] + last[VY]) / 2, (first[VZ] + last[VZ]) / 2);
+ gGL.untransform(center);
+
+ F32 dist_squared = dist_vec_squared(center, camera_region);
+ if (dist_squared > PROPERTY_LINE_CLIP_DIST_SQUARED)
{
continue;
}
@@ -729,43 +763,33 @@ void LLViewerParcelOverlay::renderPropertyLines()
continue;
}
+ U32 lod = dist_squared < PROPERTY_LINE_LOD0_DIST_SQUARED ? 0 : 1;
+
gGL.begin(LLRender::TRIANGLE_STRIP);
gGL.color4ubv(edge.color.mV);
- for (const LLVector3& vertex : edge.vertices)
+ if (draw_underwater)
{
- if (render_hidden || camera_z < water_z || vertex.mV[2] >= water_z)
- {
- gGL.vertex3fv(vertex.mV);
- }
- else
- {
- LLVector3 visible = vertex;
- visible.mV[2] = water_z;
- gGL.vertex3fv(visible.mV);
- }
+ gGL.vertexBatchPreTransformed(edge.verticesUnderWater[lod]);
}
-
- gGL.end();
-
- if (render_hidden)
+ else
{
- LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_GREATER);
+ gGL.vertexBatchPreTransformed(edge.verticesAboveWater[lod]);
- gGL.begin(LLRender::TRIANGLE_STRIP);
+ if (render_hidden)
+ {
+ LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_GREATER);
- LLColor4U color = edge.color;
- color.mV[3] /= 4;
- gGL.color4ubv(color.mV);
+ LLColor4U color = edge.color;
+ color.mV[VALPHA] /= 4;
+ gGL.color4ubv(color.mV);
- for (const LLVector3& vertex : edge.vertices)
- {
- gGL.vertex3fv(vertex.mV);
+ gGL.vertexBatchPreTransformed(edge.verticesUnderWater[lod]);
}
-
- gGL.end();
}
+
+ gGL.end();
}
gGL.popMatrix();
@@ -790,7 +814,7 @@ void grid_2d_part_lines(const F32 left, const F32 top, const F32 right, const F3
gGL.end();
}
-void LLViewerParcelOverlay::renderPropertyLinesOnMinimap(F32 scale_pixels_per_meter, const F32 *parcel_outline_color)
+void LLViewerParcelOverlay::renderPropertyLinesOnMinimap(F32 scale_pixels_per_meter, const F32* parcel_outline_color)
{
static LLCachedControl<bool> show(gSavedSettings, "MiniMapShowPropertyLines");
@@ -801,8 +825,8 @@ void LLViewerParcelOverlay::renderPropertyLinesOnMinimap(F32 scale_pixels_per_me
LLVector3 origin_agent = mRegion->getOriginAgent();
LLVector3 rel_region_pos = origin_agent - gAgentCamera.getCameraPositionAgent();
- F32 region_left = rel_region_pos.mV[0] * scale_pixels_per_meter;
- F32 region_bottom = rel_region_pos.mV[1] * scale_pixels_per_meter;
+ F32 region_left = rel_region_pos.mV[VX] * scale_pixels_per_meter;
+ F32 region_bottom = rel_region_pos.mV[VY] * scale_pixels_per_meter;
F32 map_parcel_width = PARCEL_GRID_STEP_METERS * scale_pixels_per_meter;
const S32 GRIDS_PER_EDGE = mParcelGridsPerEdge;
diff --git a/indra/newview/llviewerparceloverlay.h b/indra/newview/llviewerparceloverlay.h
index 03ae464cb8..7271c85701 100644
--- a/indra/newview/llviewerparceloverlay.h
+++ b/indra/newview/llviewerparceloverlay.h
@@ -34,12 +34,11 @@
#include "llframetimer.h"
#include "lluuid.h"
#include "llviewertexture.h"
-#include "llgl.h"
-#include "lluicolor.h"
class LLViewerRegion;
class LLVector3;
class LLColor4U;
+class LLUIColor;
class LLVector2;
class LLViewerParcelOverlay : public LLGLUpdate
@@ -65,19 +64,18 @@ public:
bool isSoundLocal(const LLVector3& pos) const;
- bool isBuildCameraAllowed(const LLVector3& pos) const;
F32 getOwnedRatio() const;
// Returns the number of vertices drawn
void renderPropertyLines();
void renderPropertyLinesOnMinimap(F32 scale_pixels_per_meter, const F32* parcel_outline_color);
- U8 ownership( const LLVector3& pos) const;
- U8 parcelLineFlags( const LLVector3& pos) const;
+ U8 ownership(const LLVector3& pos) const;
+ U8 parcelLineFlags(const LLVector3& pos) const;
U8 parcelLineFlags(S32 row, S32 col) const;
// MANIPULATE
- void uncompressLandOverlay(S32 chunk, U8 *compressed_overlay);
+ void uncompressLandOverlay(S32 chunk, U8* compressed_overlay);
// Indicate property lines and overlay texture need to be rebuilt.
void setDirty();
@@ -88,8 +86,7 @@ public:
private:
// This is in parcel rows and columns, not grid rows and columns
// Stored in bottom three bits.
- U8 ownership(S32 row, S32 col) const
- { return parcelFlags(row, col, (U8)0x7); }
+ U8 ownership(S32 row, S32 col) const { return parcelFlags(row, col, (U8)0x7); }
U8 parcelFlags(S32 row, S32 col, U8 flags) const;
@@ -119,7 +116,10 @@ private:
struct Edge
{
- std::vector<LLVector3> vertices;
+ void pushVertex(U32 lod, F32 x, F32 y, F32 z, F32 water_z);
+ // LOD: 0 - detailized, 1 - simplified
+ std::vector<LLVector4a> verticesAboveWater[2];
+ std::vector<LLVector4a> verticesUnderWater[2];
LLColor4U color;
};
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index d59dfb88a8..03d5563c65 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -3236,6 +3236,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("FetchInventory2");
capabilityNames.append("FetchInventoryDescendents2");
capabilityNames.append("IncrementCOFVersion");
+ capabilityNames.append("RequestTaskInventory");
AISAPI::getCapNames(capabilityNames);
capabilityNames.append("InterestList");
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index 73aabf49d1..ff86684499 100644
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -66,6 +66,7 @@
#include "llinventorymodel.h"
#include "lluiusage.h"
#include "lltranslate.h"
+#include "llluamanager.h"
// "Minimal Vulkan" to get max API Version
@@ -620,6 +621,10 @@ void send_viewer_stats(bool include_preferences)
system["shader_level"] = shader_level;
+ LLSD &scripts = body["scripts"];
+ scripts["lua_scripts"] = LLLUAmanager::sScriptCount;
+ scripts["lua_auto_scripts"] = LLLUAmanager::sAutorunScriptCount;
+
LLSD &download = body["downloads"];
download["world_kbytes"] = F64Kilobytes(gTotalWorldData).value();
@@ -774,6 +779,8 @@ void send_viewer_stats(bool include_preferences)
LL_INFOS("LogViewerStatsPacket") << "Sending viewer statistics: " << body << LL_ENDL;
+
+ // <ND> Do those lines even do anything sane in regard of debug logging?
LL_DEBUGS("LogViewerStatsPacket");
std::string filename("viewer_stats_packet.xml");
llofstream of(filename.c_str());
diff --git a/indra/newview/llviewerstatsrecorder.cpp b/indra/newview/llviewerstatsrecorder.cpp
index 58065ecce5..3e0e3b28f2 100644
--- a/indra/newview/llviewerstatsrecorder.cpp
+++ b/indra/newview/llviewerstatsrecorder.cpp
@@ -309,5 +309,3 @@ F32 LLViewerStatsRecorder::getTimeSinceStart()
{
return (F32) (LLFrameTimer::getTotalSeconds() - mFileOpenTime);
}
-
-
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp
index 5793a28b80..210cd62d6f 100644
--- a/indra/newview/llviewertexteditor.cpp
+++ b/indra/newview/llviewertexteditor.cpp
@@ -179,6 +179,16 @@ public:
mToolTip = inv_item->getName() + '\n' + inv_item->getDescription();
}
+ /*virtual*/ LLTextSegmentPtr clone(LLTextBase& target) const
+ {
+ LLTextEditor* editor = dynamic_cast<LLTextEditor*>(&target);
+ llassert(editor);
+ if (!editor)
+ return nullptr;
+
+ return new LLEmbeddedItemSegment(mStart, mImage, mItem, *editor);
+ }
+
/*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const
{
if (num_chars == 0)
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 08e9151940..7b89ae4e44 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -964,7 +964,7 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
// this is an alternative to decaying mMaxVirtualSize over time
// that keeps textures from continously downrezzing and uprezzing in the background
- if (LLViewerTexture::sDesiredDiscardBias > 1.5f ||
+ if (LLViewerTexture::sDesiredDiscardBias > 1.5f ||
(!on_screen && LLViewerTexture::sDesiredDiscardBias > 1.f))
{
imagep->mMaxVirtualSize = 0.f;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 0e7d82fd90..c747319940 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -195,7 +195,6 @@
#include "llviewerjoystick.h"
#include "llviewermenufile.h" // LLFilePickerReplyThread
#include "llviewernetwork.h"
-#include "llpostprocess.h"
#include "llfloaterimnearbychat.h"
#include "llagentui.h"
#include "llwearablelist.h"
@@ -3776,19 +3775,21 @@ void LLViewerWindow::updateUI()
void LLViewerWindow::updateLayout()
{
- LLTool* tool = LLToolMgr::getInstance()->getCurrentTool();
+ LLToolMgr* tool_mgr = LLToolMgr::getInstance();
+ LLTool* tool = tool_mgr->getCurrentTool();
+ LLCachedControl<bool> freeze_time(gSavedSettings, "FreezeTime");
if (gFloaterTools != NULL
&& tool != NULL
&& tool != gToolNull
&& tool != LLToolCompInspect::getInstance()
&& tool != LLToolDragAndDrop::getInstance()
- && !gSavedSettings.getBOOL("FreezeTime"))
+ && !freeze_time())
{
// Suppress the toolbox view if our source tool was the pie tool,
// and we've overridden to something else.
bool suppress_toolbox =
- (LLToolMgr::getInstance()->getBaseTool() == LLToolPie::getInstance()) &&
- (LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance());
+ (tool_mgr->getBaseTool() == LLToolPie::getInstance()) &&
+ (tool_mgr->getCurrentTool() != LLToolPie::getInstance());
LLMouseHandler *captor = gFocusMgr.getMouseCapture();
// With the null, inspect, or drag and drop tool, don't muck
@@ -3798,7 +3799,7 @@ void LLViewerWindow::updateLayout()
|| (tool != LLToolPie::getInstance() // not default tool
&& tool != LLToolCompGun::getInstance() // not coming out of mouselook
&& !suppress_toolbox // not override in third person
- && LLToolMgr::getInstance()->getCurrentToolset()->isShowFloaterTools()
+ && tool_mgr->getCurrentToolset()->isShowFloaterTools()
&& (!captor || dynamic_cast<LLView*>(captor) != NULL))) // not dragging
{
// Force floater tools to be visible (unless minimized)
@@ -4255,15 +4256,15 @@ void LLViewerWindow::pickAsync( S32 x,
bool pick_unselectable,
bool pick_reflection_probes)
{
+ static LLCachedControl<bool> select_invisible_objects(gSavedSettings, "SelectInvisibleObjects");
// "Show Debug Alpha" means no object actually transparent
bool in_build_mode = LLFloaterReg::instanceVisible("build");
- if (LLDrawPoolAlpha::sShowDebugAlpha
- || (in_build_mode && gSavedSettings.getBOOL("SelectInvisibleObjects")))
+ if (LLDrawPoolAlpha::sShowDebugAlpha || (in_build_mode && select_invisible_objects))
{
pick_transparent = true;
}
- LLPickInfo pick_info(LLCoordGL(x, y_from_bot), mask, pick_transparent, pick_rigged, false, pick_reflection_probes, pick_unselectable, true, callback);
+ LLPickInfo pick_info(LLCoordGL(x, y_from_bot), mask, pick_transparent, pick_rigged, false, pick_reflection_probes, true, pick_unselectable, callback);
schedulePick(pick_info);
}
@@ -4287,7 +4288,6 @@ void LLViewerWindow::schedulePick(LLPickInfo& pick_info)
mWindow->delayInputProcessing();
}
-
void LLViewerWindow::performPick()
{
if (!mPicks.empty())
@@ -4321,8 +4321,9 @@ void LLViewerWindow::returnEmptyPicks()
// Performs the GL object/land pick.
LLPickInfo LLViewerWindow::pickImmediate(S32 x, S32 y_from_bot, bool pick_transparent, bool pick_rigged, bool pick_particle, bool pick_unselectable, bool pick_reflection_probe)
{
+ static LLCachedControl<bool> select_invisible_objects(gSavedSettings, "SelectInvisibleObjects");
bool in_build_mode = LLFloaterReg::instanceVisible("build");
- if ((in_build_mode && gSavedSettings.getBOOL("SelectInvisibleObjects")) || LLDrawPoolAlpha::sShowDebugAlpha)
+ if ((in_build_mode && select_invisible_objects) || LLDrawPoolAlpha::sShowDebugAlpha)
{
// build mode allows interaction with all transparent objects
// "Show Debug Alpha" means no object actually transparent
@@ -4330,7 +4331,7 @@ LLPickInfo LLViewerWindow::pickImmediate(S32 x, S32 y_from_bot, bool pick_transp
}
// shortcut queueing in mPicks and just update mLastPick in place
- MASK key_mask = gKeyboard->currentMask(true);
+ MASK key_mask = gKeyboard->currentMask(true);
mLastPick = LLPickInfo(LLCoordGL(x, y_from_bot), key_mask, pick_transparent, pick_rigged, pick_particle, pick_reflection_probe, true, false, NULL);
mLastPick.fetchResults();
@@ -4851,7 +4852,7 @@ bool LLViewerWindow::saveSnapshot(const std::string& filepath, S32 image_width,
LL_INFOS() << "Saving snapshot to: " << filepath << LL_ENDL;
LLPointer<LLImageRaw> raw = new LLImageRaw;
- bool success = rawSnapshot(raw, image_width, image_height, true, false, show_ui, show_hud, do_rebuild);
+ bool success = rawSnapshot(raw, image_width, image_height, true, false, show_ui, show_hud, do_rebuild, 0, type);
if (success)
{
@@ -5760,11 +5761,6 @@ void LLViewerWindow::stopGL()
gBox.cleanupGL();
- if(gPostProcess)
- {
- gPostProcess->invalidate();
- }
-
gTextureList.destroyGL();
stop_glerror();
@@ -6050,14 +6046,14 @@ LLPickInfo::LLPickInfo(const LLCoordGL& mouse_pos,
bool pick_rigged,
bool pick_particle,
bool pick_reflection_probe,
- bool pick_uv_coords,
+ bool pick_surface_info,
bool pick_unselectable,
void (*pick_callback)(const LLPickInfo& pick_info))
: mMousePt(mouse_pos),
mKeyMask(keyboard_mask),
mPickCallback(pick_callback),
mPickType(PICK_INVALID),
- mWantSurfaceInfo(pick_uv_coords),
+ mWantSurfaceInfo(pick_surface_info),
mObjectFace(-1),
mUVCoords(-1.f, -1.f),
mSTCoords(-1.f, -1.f),
diff --git a/indra/newview/llviewerwindowlistener.cpp b/indra/newview/llviewerwindowlistener.cpp
index da7e18af5c..52f413792a 100644
--- a/indra/newview/llviewerwindowlistener.cpp
+++ b/indra/newview/llviewerwindowlistener.cpp
@@ -43,22 +43,13 @@ LLViewerWindowListener::LLViewerWindowListener(LLViewerWindow* llviewerwindow):
mViewerWindow(llviewerwindow)
{
// add() every method we want to be able to invoke via this event API.
- LLSD saveSnapshotArgs;
- saveSnapshotArgs["filename"] = LLSD::String();
- saveSnapshotArgs["reply"] = LLSD::String();
- // The following are optional, so don't build them into required prototype.
-// saveSnapshotArgs["width"] = LLSD::Integer();
-// saveSnapshotArgs["height"] = LLSD::Integer();
-// saveSnapshotArgs["showui"] = LLSD::Boolean();
-// saveSnapshotArgs["showhud"] = LLSD::Boolean();
-// saveSnapshotArgs["rebuild"] = LLSD::Boolean();
-// saveSnapshotArgs["type"] = LLSD::String();
add("saveSnapshot",
- "Save screenshot: [\"filename\"], [\"width\"], [\"height\"], [\"showui\"], [\"showhud\"], [\"rebuild\"], [\"type\"]\n"
+ "Save screenshot: [\"filename\"] (extension may be specified: bmp, jpeg, png)\n"
+ "[\"width\"], [\"height\"], [\"showui\"], [\"showhud\"], [\"rebuild\"], [\"type\"]\n"
"type: \"COLOR\", \"DEPTH\"\n"
- "Post on [\"reply\"] an event containing [\"ok\"]",
+ "Post on [\"reply\"] an event containing [\"result\"]",
&LLViewerWindowListener::saveSnapshot,
- saveSnapshotArgs);
+ llsd::map("filename", LLSD::String(), "reply", LLSD()));
add("requestReshape",
"Resize the window: [\"w\"], [\"h\"]",
&LLViewerWindowListener::requestReshape);
@@ -66,12 +57,15 @@ LLViewerWindowListener::LLViewerWindowListener(LLViewerWindow* llviewerwindow):
void LLViewerWindowListener::saveSnapshot(const LLSD& event) const
{
+ Response response(LLSD(), event);
+
typedef std::map<LLSD::String, LLSnapshotModel::ESnapshotLayerType> TypeMap;
TypeMap types;
#define tp(name) types[#name] = LLSnapshotModel::SNAPSHOT_TYPE_##name
tp(COLOR);
tp(DEPTH);
-#undef tp
+#undef tp
+
// Our add() call should ensure that the incoming LLSD does in fact
// contain our required arguments. Deal with the optional ones.
S32 width (mViewerWindow->getWindowWidthRaw());
@@ -94,14 +88,36 @@ void LLViewerWindowListener::saveSnapshot(const LLSD& event) const
TypeMap::const_iterator found = types.find(event["type"]);
if (found == types.end())
{
- LL_ERRS("LLViewerWindowListener") << "LLViewerWindowListener::saveSnapshot(): "
- << "unrecognized type " << event["type"] << LL_ENDL;
- return;
+ return response.error(stringize("Unrecognized type ", std::quoted(event["type"].asString()), " [\"COLOR\"] or [\"DEPTH\"] is expected."));
}
type = found->second;
}
- bool ok = mViewerWindow->saveSnapshot(event["filename"], width, height, showui, showhud, rebuild, type);
- sendReply(LLSDMap("ok", ok), event);
+
+ std::string filename(event["filename"]);
+ if (filename.empty())
+ {
+ return response.error(stringize("File path is empty."));
+ }
+
+ LLSnapshotModel::ESnapshotFormat format(LLSnapshotModel::SNAPSHOT_FORMAT_BMP);
+ std::string ext = gDirUtilp->getExtension(filename);
+ if (ext.empty())
+ {
+ filename.append(".bmp");
+ }
+ else if (ext == "png")
+ {
+ format = LLSnapshotModel::SNAPSHOT_FORMAT_PNG;
+ }
+ else if (ext == "jpeg" || ext == "jpg")
+ {
+ format = LLSnapshotModel::SNAPSHOT_FORMAT_JPEG;
+ }
+ else if (ext != "bmp")
+ {
+ return response.error(stringize("Unrecognized format. [\"png\"], [\"jpeg\"] or [\"bmp\"] is expected."));
+ }
+ response["result"] = mViewerWindow->saveSnapshot(filename, width, height, showui, showhud, rebuild, type, format);
}
void LLViewerWindowListener::requestReshape(LLSD const & event_data) const
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index ef0bb3b926..8178dade8b 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -113,6 +113,7 @@
#include "llskinningutil.h"
#include "llperfstats.h"
+#include "lleventapi.h"
#include <boost/lexical_cast.hpp>
@@ -2406,8 +2407,6 @@ void LLVOAvatar::updateMeshData()
{
if (mDrawable.notNull())
{
- stop_glerror();
-
S32 f_num = 0 ;
const U32 VERTEX_NUMBER_THRESHOLD = 128 ;//small number of this means each part of an avatar has its own vertex buffer.
const auto num_parts = mMeshLOD.size();
@@ -2534,7 +2533,6 @@ void LLVOAvatar::updateMeshData()
}
}
- stop_glerror();
buff->unmapBuffer();
if(!f_num)
@@ -5427,14 +5425,6 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel)
gGL.setSceneBlendType(LLRender::BT_ADD);
gGL.getTexUnit(diffuse_channel)->unbind(LLTexUnit::TT_TEXTURE);
- // gGL.begin(LLRender::QUADS);
- // gGL.vertex3fv((pos+left-up).mV);
- // gGL.vertex3fv((pos-left-up).mV);
- // gGL.vertex3fv((pos-left+up).mV);
- // gGL.vertex3fv((pos+left+up).mV);
- // gGL.end();
-
-
gGL.begin(LLRender::LINES);
gGL.color4f(1.f,1.f,1.f,1.f);
F32 thickness = llmax(F32(5.0f-5.0f*(gFrameTimeSeconds-mLastImpostorUpdateFrameTime)),1.0f);
@@ -5455,15 +5445,22 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel)
gGL.color4ubv(color.mV);
gGL.getTexUnit(diffuse_channel)->bind(&mImpostor);
- gGL.begin(LLRender::QUADS);
- gGL.texCoord2f(0,0);
- gGL.vertex3fv((pos+left-up).mV);
- gGL.texCoord2f(1,0);
- gGL.vertex3fv((pos-left-up).mV);
- gGL.texCoord2f(1,1);
- gGL.vertex3fv((pos-left+up).mV);
- gGL.texCoord2f(0,1);
- gGL.vertex3fv((pos+left+up).mV);
+ gGL.begin(LLRender::TRIANGLES);
+ {
+ gGL.texCoord2f(0.f, 0.f);
+ gGL.vertex3fv((pos + left - up).mV);
+ gGL.texCoord2f(1.f, 0.f);
+ gGL.vertex3fv((pos - left - up).mV);
+ gGL.texCoord2f(1.f, 1.f);
+ gGL.vertex3fv((pos - left + up).mV);
+
+ gGL.texCoord2f(0.f, 0.f);
+ gGL.vertex3fv((pos + left - up).mV);
+ gGL.texCoord2f(1.f, 1.f);
+ gGL.vertex3fv((pos - left + up).mV);
+ gGL.texCoord2f(0.f, 1.f);
+ gGL.vertex3fv((pos + left + up).mV);
+ }
gGL.end();
gGL.flush();
}
@@ -10754,9 +10751,8 @@ void LLVOAvatar::updateRiggingInfo()
getAssociatedVolumes(volumes);
{
- LL_PROFILE_ZONE_NAMED_CATEGORY_AVATAR("update rig info - get key")
- HBXXH128 hash;
-
+ LL_PROFILE_ZONE_NAMED_CATEGORY_AVATAR("update rig info - get key");
+ size_t hash = 0;
// Get current rigging info key
for (LLVOVolume* vol : volumes)
{
@@ -10765,22 +10761,20 @@ void LLVOAvatar::updateRiggingInfo()
const LLUUID& mesh_id = vol->getVolume()->getParams().getSculptID();
S32 max_lod = llmax(vol->getLOD(), vol->mLastRiggingInfoLOD);
- hash.update(mesh_id.mData, sizeof(mesh_id.mData));
- hash.update(&max_lod, sizeof(max_lod));
+ boost::hash_combine(hash, mesh_id);
+ boost::hash_combine(hash, max_lod);
}
}
- LLUUID curr_rigging_info_key = hash.digest();
-
// Check for key change, which indicates some change in volume composition or LOD.
- if (curr_rigging_info_key == mLastRiggingInfoKey)
+ if (hash == mLastRiggingInfoKey)
{
return;
}
// Something changed. Update.
- mLastRiggingInfoKey = curr_rigging_info_key;
+ mLastRiggingInfoKey = hash;
}
mJointRiggingInfoTab.clear();
@@ -11824,3 +11818,33 @@ bool LLVOAvatar::isBuddy() const
return is_friend;
}
+class LLVOAvatarListener : public LLEventAPI
+{
+ public:
+ LLVOAvatarListener() : LLEventAPI("LLVOAvatar", "LLVOAvatar listener to retrieve avatar info")
+ {
+ add("getSpeed",
+ "Return the avatar movement speed in the XY plane",
+ &LLVOAvatarListener::getSpeed,
+ LLSD().with("reply", LLSD()));
+ add("isInAir",
+ "Return the info whether avatar is in the air, and if so the time in the air",
+ &LLVOAvatarListener::isInAir,
+ LLSD().with("reply", LLSD()));
+ }
+
+ private:
+ void getSpeed(const LLSD &request) const
+ {
+ LLVector3 avatar_velocity = gAgentAvatarp->getCharacterVelocity() * gAgentAvatarp->getTimeDilation();
+ avatar_velocity.mV[VZ] = 0.f;
+ Response response(llsd::map("value", avatar_velocity.magVec()), request);
+ }
+ void isInAir(const LLSD &request) const
+ {
+ Response response(llsd::map("value", gAgentAvatarp->mInAir,
+ "duration", gAgentAvatarp->mInAir ? gAgentAvatarp->mTimeInAir.getElapsedTimeF32() : 0), request);
+ }
+};
+
+static LLVOAvatarListener VOAvatarListener;
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index ff1cbc34fc..dd1725c322 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -226,7 +226,7 @@ public:
// virtual
void updateRiggingInfo();
// This encodes mesh id and LOD, so we can see whether display is up-to-date.
- LLUUID mLastRiggingInfoKey;
+ size_t mLastRiggingInfoKey;
std::set<LLUUID> mActiveOverrideMeshes;
virtual void onActiveOverrideMeshesChanged();
diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp
index 67adcbb244..fdd39a0e30 100644
--- a/indra/newview/llvograss.cpp
+++ b/indra/newview/llvograss.cpp
@@ -729,7 +729,6 @@ void LLGrassPartition::getGeometry(LLSpatialGroup* group)
}
}
- buffer->unmapBuffer();
mFaceList.clear();
}
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 1e934ade59..4659fa5f71 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -1014,6 +1014,7 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
std::string old_log = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SLVoice.old");
if (gDirUtilp->fileExists(new_log))
{
+ LLFile::remove(old_log, ENOENT);
LLFile::rename(new_log, old_log);
}
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index 3d684e5a1b..7161f5af5e 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -87,6 +87,8 @@ namespace {
const F32 SPEAKING_AUDIO_LEVEL = 0.30;
+ const uint32_t PEER_GAIN_CONVERSION_FACTOR = 220;
+
static const std::string REPORTED_VOICE_SERVER_TYPE = "Secondlife WebRTC Gateway";
// Don't send positional updates more frequently than this:
@@ -2170,7 +2172,7 @@ LLVoiceWebRTCConnection::LLVoiceWebRTCConnection(const LLUUID &regionID, const s
// retries wait a short period...randomize it so
// all clients don't try to reconnect at once.
- mRetryWaitSecs = (F32)((F32) rand() / (RAND_MAX)) + 0.5f;
+ mRetryWaitSecs = static_cast<F32>(rand()) / static_cast<F32>(RAND_MAX) + 0.5f;
mWebRTCPeerConnectionInterface = llwebrtc::newPeerConnection();
mWebRTCPeerConnectionInterface->setSignalingObserver(this);
@@ -2443,7 +2445,7 @@ void LLVoiceWebRTCConnection::setSpeakerVolume(F32 volume)
void LLVoiceWebRTCConnection::setUserVolume(const LLUUID& id, F32 volume)
{
- boost::json::object root = {{"ug", {id.asString(), (uint32_t) (volume * 200)}}};
+ boost::json::object root = { { "ug", { { id.asString(), (uint32_t)(volume * PEER_GAIN_CONVERSION_FACTOR) } } } };
std::string json_data = boost::json::serialize(root);
if (mWebRTCDataInterface)
{
@@ -2453,7 +2455,7 @@ void LLVoiceWebRTCConnection::setUserVolume(const LLUUID& id, F32 volume)
void LLVoiceWebRTCConnection::setUserMute(const LLUUID& id, bool mute)
{
- boost::json::object root = {{"m", {id.asString(), mute}}};
+ boost::json::object root = { { "m", { { id.asString(), mute } } } };
std::string json_data = boost::json::serialize(root);
if (mWebRTCDataInterface)
{
@@ -2766,7 +2768,7 @@ bool LLVoiceWebRTCConnection::connectionStateMachine()
case VOICE_STATE_SESSION_UP:
{
mRetryWaitPeriod = 0;
- mRetryWaitSecs = (F32)((F32)rand() / (RAND_MAX)) + 0.5f;
+ mRetryWaitSecs = (F32)((F32)rand() / (F32)RAND_MAX) + 0.5f;
// we'll stay here as long as the session remains up.
if (mShutDown)
@@ -2800,7 +2802,7 @@ bool LLVoiceWebRTCConnection::connectionStateMachine()
{
// back off the retry period, and do it by a small random
// bit so all clients don't reconnect at once.
- mRetryWaitSecs += (F32)((F32) rand() / (RAND_MAX)) + 0.5f;
+ mRetryWaitSecs += static_cast<F32>(rand()) / static_cast<F32>(RAND_MAX) + 0.5f;
mRetryWaitPeriod = 0;
}
}
diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp
index 8f792c1042..ec32a79829 100644
--- a/indra/newview/llvopartgroup.cpp
+++ b/indra/newview/llvopartgroup.cpp
@@ -54,63 +54,6 @@ void LLVOPartGroup::initClass()
void LLVOPartGroup::restoreGL()
{
- //TODO: optimize out binormal mask here. Specular and normal coords as well.
-#if 0
- sVB = new LLVertexBuffer(VERTEX_DATA_MASK | LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_TEXCOORD1 | LLVertexBuffer::MAP_TEXCOORD2);
- U32 count = LL_MAX_PARTICLE_COUNT;
- if (!sVB->allocateBuffer(count*4, count*6))
- {
- LL_WARNS() << "Failed to allocate Vertex Buffer to "
- << count*4 << " vertices and "
- << count * 6 << " indices" << LL_ENDL;
- // we are likelly to crash at following getTexCoord0Strider(), so unref and return
- sVB = NULL;
- return;
- }
-
- //indices and texcoords are always the same, set once
- LLStrider<U16> indicesp;
-
- LLStrider<LLVector4a> verticesp;
-
- sVB->getIndexStrider(indicesp);
- sVB->getVertexStrider(verticesp);
-
- LLVector4a v;
- v.set(0,0,0,0);
-
-
- U16 vert_offset = 0;
-
- for (U32 i = 0; i < LL_MAX_PARTICLE_COUNT; i++)
- {
- *indicesp++ = vert_offset + 0;
- *indicesp++ = vert_offset + 1;
- *indicesp++ = vert_offset + 2;
-
- *indicesp++ = vert_offset + 1;
- *indicesp++ = vert_offset + 3;
- *indicesp++ = vert_offset + 2;
-
- *verticesp++ = v;
-
- vert_offset += 4;
- }
-
- LLStrider<LLVector2> texcoordsp;
- sVB->getTexCoord0Strider(texcoordsp);
-
- for (U32 i = 0; i < LL_MAX_PARTICLE_COUNT; i++)
- {
- *texcoordsp++ = LLVector2(0.f, 1.f);
- *texcoordsp++ = LLVector2(0.f, 0.f);
- *texcoordsp++ = LLVector2(1.f, 1.f);
- *texcoordsp++ = LLVector2(1.f, 0.f);
- }
-
- sVB->unmapBuffer();
-#endif
-
}
//static
@@ -955,7 +898,6 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group)
}
}
- buffer->unmapBuffer();
mFaceList.clear();
}
diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp
index fdccf34e6a..294d36b0a9 100644
--- a/indra/newview/llvosurfacepatch.cpp
+++ b/indra/newview/llvosurfacepatch.cpp
@@ -1078,7 +1078,6 @@ void LLTerrainPartition::getGeometry(LLSpatialGroup* group)
gen_terrain_tangents(index_offset, indices_index, vertices, normals, tangents, indices, region_width);
}
- buffer->unmapBuffer();
mFaceList.clear();
}
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 2859f8b1c2..31f1bbcc21 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -250,10 +250,12 @@ LLVOVolume::~LLVOVolume()
delete mVolumeImpl;
mVolumeImpl = NULL;
- gMeshRepo.unregisterMesh(this);
+ unregisterOldMeshAndSkin();
if(!mMediaImplList.empty())
{
+ LL_PROFILE_ZONE_NAMED_CATEGORY_MEDIA("delete volume media list");
+
for(U32 i = 0 ; i < mMediaImplList.size() ; i++)
{
if(mMediaImplList[i].notNull())
@@ -998,6 +1000,28 @@ LLDrawable *LLVOVolume::createDrawable(LLPipeline *pipeline)
return mDrawable;
}
+// Inverse of gMeshRepo.loadMesh and gMeshRepo.getSkinInfo, combined into one function
+// Assume a Collada mesh never changes after being set.
+void LLVOVolume::unregisterOldMeshAndSkin()
+{
+ if (mVolumep)
+ {
+ const LLVolumeParams& params = mVolumep->getParams();
+ if ((params.getSculptType() & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH)
+ {
+ // object is being deleted, so it will no longer need to request
+ // meshes.
+ for (S32 lod = 0; lod != LLVolumeLODGroup::NUM_LODS; ++lod)
+ {
+ gMeshRepo.unregisterMesh(this, params, lod);
+ }
+ // This volume may or may not have a skin
+ gMeshRepo.unregisterSkinInfo(params.getSculptID(), this);
+ }
+ }
+}
+
+
bool LLVOVolume::setVolume(const LLVolumeParams &params_in, const S32 detail, bool unique_volume)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
@@ -5779,8 +5803,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
{
type = LLDrawPool::POOL_GLTF_PBR;
}
- else
- if (type != LLDrawPool::POOL_ALPHA && force_simple)
+ else if (type != LLDrawPool::POOL_ALPHA && force_simple)
{
type = LLDrawPool::POOL_SIMPLE;
}
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index 97a5131260..10dbf1349f 100644
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -227,6 +227,7 @@ public:
void setTexture(const S32 face);
S32 getIndexInTex(U32 ch) const {return mIndexInTex[ch];}
+ void unregisterOldMeshAndSkin();
/*virtual*/ bool setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false) override;
void updateSculptTexture();
void setIndexInTex(U32 ch, S32 index) { mIndexInTex[ch] = index ;}
diff --git a/indra/newview/llwatchdog.cpp b/indra/newview/llwatchdog.cpp
index 0a1d346266..bf171fe954 100644
--- a/indra/newview/llwatchdog.cpp
+++ b/indra/newview/llwatchdog.cpp
@@ -29,7 +29,7 @@
#include "llwatchdog.h"
#include "llthread.h"
-const U32 WATCHDOG_SLEEP_TIME_USEC = 1000000;
+constexpr U32 WATCHDOG_SLEEP_TIME_USEC = 1000000U;
// This class runs the watchdog timing thread.
class LLWatchdogTimerThread : public LLThread
@@ -51,7 +51,7 @@ public:
mSleepMsecs = 1;
}
- /* virtual */ void run()
+ void run() override
{
while(!mStopping)
{
@@ -83,7 +83,7 @@ void LLWatchdogEntry::start()
void LLWatchdogEntry::stop()
{
// this can happen very late in the shutdown sequence
- if (! LLWatchdog::wasDeleted())
+ if (!LLWatchdog::wasDeleted())
{
LLWatchdog::getInstance()->remove(this);
}
@@ -117,7 +117,7 @@ void LLWatchdogTimeout::setTimeout(F32 d)
mTimeout = d;
}
-void LLWatchdogTimeout::start(const std::string& state)
+void LLWatchdogTimeout::start(std::string_view state)
{
if (mTimeout == 0)
{
@@ -139,9 +139,9 @@ void LLWatchdogTimeout::stop()
mTimer.stop();
}
-void LLWatchdogTimeout::ping(const std::string& state)
+void LLWatchdogTimeout::ping(std::string_view state)
{
- if(!state.empty())
+ if (!state.empty())
{
mPingState = state;
}
@@ -151,7 +151,7 @@ void LLWatchdogTimeout::ping(const std::string& state)
// LLWatchdog
LLWatchdog::LLWatchdog()
:mSuspectsAccessMutex()
- ,mTimer(NULL)
+ ,mTimer(nullptr)
,mLastClockCount(0)
{
}
@@ -176,7 +176,7 @@ void LLWatchdog::remove(LLWatchdogEntry* e)
void LLWatchdog::init()
{
- if(!mSuspectsAccessMutex && !mTimer)
+ if (!mSuspectsAccessMutex && !mTimer)
{
mSuspectsAccessMutex = new LLMutex();
mTimer = new LLWatchdogTimerThread();
@@ -191,17 +191,17 @@ void LLWatchdog::init()
void LLWatchdog::cleanup()
{
- if(mTimer)
+ if (mTimer)
{
mTimer->stop();
delete mTimer;
- mTimer = NULL;
+ mTimer = nullptr;
}
- if(mSuspectsAccessMutex)
+ if (mSuspectsAccessMutex)
{
delete mSuspectsAccessMutex;
- mSuspectsAccessMutex = NULL;
+ mSuspectsAccessMutex = nullptr;
}
mLastClockCount = 0;
@@ -214,12 +214,12 @@ void LLWatchdog::run()
// Check the time since the last call to run...
// If the time elapsed is two times greater than the regualr sleep time
// reset the active timeouts.
- const U32 TIME_ELAPSED_MULTIPLIER = 2;
+ constexpr U32 TIME_ELAPSED_MULTIPLIER = 2;
U64 current_time = LLTimer::getTotalTime();
U64 current_run_delta = current_time - mLastClockCount;
mLastClockCount = current_time;
- if(current_run_delta > (WATCHDOG_SLEEP_TIME_USEC * TIME_ELAPSED_MULTIPLIER))
+ if (current_run_delta > (WATCHDOG_SLEEP_TIME_USEC * TIME_ELAPSED_MULTIPLIER))
{
LL_INFOS() << "Watchdog thread delayed: resetting entries." << LL_ENDL;
for (const auto& suspect : mSuspects)
@@ -233,7 +233,7 @@ void LLWatchdog::run()
std::find_if(mSuspects.begin(),
mSuspects.end(),
[](const LLWatchdogEntry* suspect){ return ! suspect->isAlive(); });
- if(result != mSuspects.end())
+ if (result != mSuspects.end())
{
// error!!!
if(mTimer)
@@ -251,7 +251,7 @@ void LLWatchdog::run()
void LLWatchdog::lockThread()
{
- if(mSuspectsAccessMutex != NULL)
+ if (mSuspectsAccessMutex)
{
mSuspectsAccessMutex->lock();
}
@@ -259,7 +259,7 @@ void LLWatchdog::lockThread()
void LLWatchdog::unlockThread()
{
- if(mSuspectsAccessMutex != NULL)
+ if (mSuspectsAccessMutex)
{
mSuspectsAccessMutex->unlock();
}
diff --git a/indra/newview/llwatchdog.h b/indra/newview/llwatchdog.h
index fe8932e298..1931c582b0 100644
--- a/indra/newview/llwatchdog.h
+++ b/indra/newview/llwatchdog.h
@@ -56,14 +56,14 @@ public:
LLWatchdogTimeout();
virtual ~LLWatchdogTimeout();
- /* virtual */ bool isAlive() const;
- /* virtual */ void reset();
- /* virtual */ void start() { start(""); }
- /* virtual */ void stop();
+ bool isAlive() const override;
+ void reset() override;
+ void start() override { start(""); }
+ void stop() override;
- void start(const std::string& state);
+ void start(std::string_view state);
void setTimeout(F32 d);
- void ping(const std::string& state);
+ void ping(std::string_view state);
const std::string& getState() {return mPingState; }
private:
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index 8ce1a745c3..217d46d1d2 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -33,7 +33,6 @@
#include "llagentwearables.h"
#include "llappearancemgr.h"
-#include "llinventoryfunctions.h"
#include "llinventoryicon.h"
#include "llgesturemgr.h"
#include "lltransutil.h"
@@ -41,14 +40,6 @@
#include "llviewermenu.h"
#include "llvoavatarself.h"
-class LLFindOutfitItems : public LLInventoryCollectFunctor
-{
-public:
- LLFindOutfitItems() {}
- virtual ~LLFindOutfitItems() {}
- virtual bool operator()(LLInventoryCategory* cat,
- LLInventoryItem* item);
-};
bool LLFindOutfitItems::operator()(LLInventoryCategory* cat,
LLInventoryItem* item)
@@ -894,7 +885,7 @@ void LLWearableItemsList::ContextMenu::show(LLView* spawning_view, LLWearableTyp
}
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
- registrar.add("Wearable.CreateNew", boost::bind(createNewWearableByType, w_type));
+ registrar.add("Wearable.CreateNew", { boost::bind(createNewWearableByType, w_type), cb_info::UNTRUSTED_THROTTLE });
menup = createFromFile("menu_wearable_list_item.xml");
if (!menup)
{
@@ -920,7 +911,7 @@ void LLWearableItemsList::ContextMenu::show(LLView* spawning_view, LLWearableTyp
// virtual
LLContextMenu* LLWearableItemsList::ContextMenu::createMenu()
{
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ LLUICtrl::ScopedRegistrarHelper registrar;
const uuid_vec_t& ids = mUUIDs; // selected items IDs
LLUUID selected_id = ids.front(); // ID of the first selected item
diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h
index 3fe1059176..1a22d6b366 100644
--- a/indra/newview/llwearableitemslist.h
+++ b/indra/newview/llwearableitemslist.h
@@ -32,6 +32,7 @@
#include "llsingleton.h"
// newview
+#include "llinventoryfunctions.h"
#include "llinventoryitemslist.h"
#include "llinventorylistitem.h"
#include "lllistcontextmenu.h"
@@ -507,4 +508,11 @@ protected:
LLWearableType::EType mMenuWearableType;
};
+struct LLFindOutfitItems : public LLInventoryCollectFunctor
+{
+ LLFindOutfitItems() {}
+ virtual ~LLFindOutfitItems() {}
+ virtual bool operator()(LLInventoryCategory *cat, LLInventoryItem *item);
+};
+
#endif //LL_LLWEARABLEITEMSLIST_H
diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp
index ebcdd537a5..601abdf5cf 100644
--- a/indra/newview/llwindowlistener.cpp
+++ b/indra/newview/llwindowlistener.cpp
@@ -54,7 +54,7 @@ LLWindowListener::LLWindowListener(LLViewerWindow *window, const KeyboardGetter&
"Given [\"keysym\"], [\"keycode\"] or [\"char\"], inject the specified ";
std::string keyExplain =
"(integer keycode values, or keysym string from any addKeyName() call in\n"
- "http://bitbucket.org/lindenlab/viewer-release/src/tip/indra/llwindow/llkeyboard.cpp )\n";
+ "https://github.com/secondlife/viewer/blob/main/indra/llwindow/llkeyboard.cpp#L68-L124)\n";
std::string mask =
"Specify optional [\"mask\"] as an array containing any of \"CTL\", \"ALT\",\n"
"\"SHIFT\" or \"MAC_CONTROL\"; the corresponding modifier bits will be combined\n"
diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp
index ca854ac7f7..6b2bd3e6fb 100755
--- a/indra/newview/llworldmapview.cpp
+++ b/indra/newview/llworldmapview.cpp
@@ -462,11 +462,16 @@ void LLWorldMapView::draw()
gGL.color4f(0.2f, 0.0f, 0.0f, 0.4f);
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLES);
+ {
gGL.vertex2f(left, top);
gGL.vertex2f(left, bottom);
gGL.vertex2f(right, bottom);
+
+ gGL.vertex2f(left, top);
+ gGL.vertex2f(right, bottom);
gGL.vertex2f(right, top);
+ }
gGL.end();
}
else if (show_for_sale && (level <= DRAW_LANDFORSALE_THRESHOLD))
@@ -483,15 +488,22 @@ void LLWorldMapView::draw()
{
gGL.getTexUnit(0)->bind(overlayimage);
gGL.color4f(1.f, 1.f, 1.f, 1.f);
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLES);
+ {
gGL.texCoord2f(0.f, 1.f);
gGL.vertex3f(left, top, -0.5f);
gGL.texCoord2f(0.f, 0.f);
gGL.vertex3f(left, bottom, -0.5f);
gGL.texCoord2f(1.f, 0.f);
gGL.vertex3f(right, bottom, -0.5f);
+
+ gGL.texCoord2f(0.f, 1.f);
+ gGL.vertex3f(left, top, -0.5f);
+ gGL.texCoord2f(1.f, 0.f);
+ gGL.vertex3f(right, bottom, -0.5f);
gGL.texCoord2f(1.f, 1.f);
gGL.vertex3f(right, top, -0.5f);
+ }
gGL.end();
}
}
@@ -737,15 +749,22 @@ bool LLWorldMapView::drawMipmapLevel(S32 width, S32 height, S32 level, bool load
gGL.color4f(1.f, 1.0f, 1.0f, 1.0f);
- gGL.begin(LLRender::QUADS);
+ gGL.begin(LLRender::TRIANGLES);
+ {
gGL.texCoord2f(0.f, 1.f);
gGL.vertex3f(left, top, 0.f);
gGL.texCoord2f(0.f, 0.f);
gGL.vertex3f(left, bottom, 0.f);
gGL.texCoord2f(1.f, 0.f);
gGL.vertex3f(right, bottom, 0.f);
+
+ gGL.texCoord2f(0.f, 1.f);
+ gGL.vertex3f(left, top, 0.f);
+ gGL.texCoord2f(1.f, 0.f);
+ gGL.vertex3f(right, bottom, 0.f);
gGL.texCoord2f(1.f, 1.f);
gGL.vertex3f(right, top, 0.f);
+ }
gGL.end();
#if DEBUG_DRAW_TILE
drawTileOutline(level, top, left, bottom, right);
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 13dfd48643..eb353beb11 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -125,7 +125,7 @@
#define A_GCC 1
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-variable"
-#if LL_LINUX
+#if LL_LINUX && defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic ignored "-Wrestrict"
#endif
#endif
@@ -576,6 +576,7 @@ void LLPipeline::init()
connectRefreshCachedSettingsSafe("RenderScreenSpaceReflectionAdaptiveStepMultiplier");
connectRefreshCachedSettingsSafe("RenderScreenSpaceReflectionGlossySamples");
connectRefreshCachedSettingsSafe("RenderBufferVisualization");
+ connectRefreshCachedSettingsSafe("RenderBufferClearOnInvalidate");
connectRefreshCachedSettingsSafe("RenderMirrors");
connectRefreshCachedSettingsSafe("RenderHeroProbeUpdateRate");
connectRefreshCachedSettingsSafe("RenderHeroProbeConservativeUpdateMultiplier");
@@ -1084,6 +1085,7 @@ void LLPipeline::refreshCachedSettings()
RenderScreenSpaceReflectionAdaptiveStepMultiplier = gSavedSettings.getF32("RenderScreenSpaceReflectionAdaptiveStepMultiplier");
RenderScreenSpaceReflectionGlossySamples = gSavedSettings.getS32("RenderScreenSpaceReflectionGlossySamples");
RenderBufferVisualization = gSavedSettings.getS32("RenderBufferVisualization");
+ LLRenderTarget::sClearOnInvalidate = gSavedSettings.getBOOL("RenderBufferClearOnInvalidate");
RenderMirrors = gSavedSettings.getBOOL("RenderMirrors");
RenderHeroProbeUpdateRate = gSavedSettings.getS32("RenderHeroProbeUpdateRate");
RenderHeroProbeConservativeUpdateMultiplier = gSavedSettings.getS32("RenderHeroProbeConservativeUpdateMultiplier");
@@ -3731,6 +3733,7 @@ void LLPipeline::postSort(LLCamera &camera)
}
}
+ LLVertexBuffer::flushBuffers();
// LLSpatialGroup::sNoDelete = false;
LL_PUSH_CALLSTACKS();
}
@@ -7069,7 +7072,7 @@ void LLPipeline::tonemap(LLRenderTarget* src, LLRenderTarget* dst)
LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();
- bool no_post = gSnapshotNoPost || (buildNoPost && gFloaterTools->isAvailable());
+ bool no_post = gSnapshotNoPost || psky->getReflectionProbeAmbiance(should_auto_adjust) == 0.f || (buildNoPost && gFloaterTools->isAvailable());
LLGLSLShader& shader = no_post ? gNoPostTonemapProgram : gDeferredPostTonemapProgram;
shader.bind();
@@ -7146,7 +7149,7 @@ void LLPipeline::copyScreenSpaceReflections(LLRenderTarget* src, LLRenderTarget*
LLRenderTarget& depth_src = mRT->deferredScreen;
dst->bindTarget();
- dst->clear();
+ dst->invalidate();
gCopyDepthProgram.bind();
S32 diff_map = gCopyDepthProgram.getTextureChannel(LLShaderMgr::DIFFUSE_MAP);
@@ -7333,7 +7336,7 @@ void LLPipeline::applyFXAA(LLRenderTarget* src, LLRenderTarget* dst)
// bake out texture2D with RGBL for FXAA shader
mFXAAMap.bindTarget();
- mFXAAMap.clear(GL_COLOR_BUFFER_BIT);
+ mFXAAMap.invalidate(GL_COLOR_BUFFER_BIT);
shader = &gGlowCombineFXAAProgram;
shader->bind();
@@ -7432,6 +7435,7 @@ void LLPipeline::generateSMAABuffers(LLRenderTarget* src)
LLGLSLShader& edge_shader = gSMAAEdgeDetectProgram[fsaa_quality];
dest.bindTarget();
+ // SMAA utilizes discard, so the background color matters
dest.clear(GL_COLOR_BUFFER_BIT);
edge_shader.bind();
@@ -7475,7 +7479,7 @@ void LLPipeline::generateSMAABuffers(LLRenderTarget* src)
LLGLSLShader& blend_weights_shader = gSMAABlendWeightsProgram[fsaa_quality];
dest.bindTarget();
- dest.clear(GL_COLOR_BUFFER_BIT);
+ dest.invalidate(GL_COLOR_BUFFER_BIT);
blend_weights_shader.bind();
blend_weights_shader.uniform4fv(sSmaaRTMetrics, 1, rt_metrics);
@@ -7551,7 +7555,7 @@ void LLPipeline::applySMAA(LLRenderTarget* src, LLRenderTarget* dst)
LLGLSLShader& blend_shader = gSMAANeighborhoodBlendProgram[fsaa_quality];
bound_target->bindTarget();
- bound_target->clear(GL_COLOR_BUFFER_BIT);
+ bound_target->invalidate(GL_COLOR_BUFFER_BIT);
blend_shader.bind();
blend_shader.uniform4fv(sSmaaRTMetrics, 1, rt_metrics);
@@ -8329,9 +8333,7 @@ void LLPipeline::renderDeferredLighting()
LLGLSLShader& sun_shader = gCubeSnapshot ? gDeferredSunProbeProgram : gDeferredSunProgram;
bindDeferredShader(sun_shader, deferred_light_target);
mScreenTriangleVB->setBuffer();
- glClearColor(1, 1, 1, 1);
- deferred_light_target->clear(GL_COLOR_BUFFER_BIT);
- glClearColor(0, 0, 0, 0);
+ deferred_light_target->invalidate(GL_COLOR_BUFFER_BIT);
sun_shader.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES,
(GLfloat)deferred_light_target->getWidth(),
@@ -8355,9 +8357,7 @@ void LLPipeline::renderDeferredLighting()
LL_PROFILE_GPU_ZONE("soften shadow");
// blur lightmap
screen_target->bindTarget();
- glClearColor(1, 1, 1, 1);
- screen_target->clear(GL_COLOR_BUFFER_BIT);
- glClearColor(0, 0, 0, 0);
+ screen_target->invalidate(GL_COLOR_BUFFER_BIT);
bindDeferredShader(gDeferredBlurLightProgram);
@@ -8409,11 +8409,8 @@ void LLPipeline::renderDeferredLighting()
deferred_light_target->flush();
unbindDeferredShader(gDeferredBlurLightProgram);
}
-
screen_target->bindTarget();
- // clear color buffer here - zeroing alpha (glow) is important or it will accumulate against sky
- glClearColor(0, 0, 0, 0);
- screen_target->clear(GL_COLOR_BUFFER_BIT);
+ screen_target->invalidate(GL_COLOR_BUFFER_BIT);
if (RenderDeferredAtmospheric)
{ // apply sunlight contribution
@@ -10896,11 +10893,16 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar, bool preview_avatar, bool
gGL.diffuseColor4fv(LLColor4::pink.mV );
}
- gGL.begin(LLRender::QUADS);
- gGL.vertex3f(-1, -1, clip_plane);
- gGL.vertex3f(1, -1, clip_plane);
- gGL.vertex3f(1, 1, clip_plane);
- gGL.vertex3f(-1, 1, clip_plane);
+ gGL.begin(LLRender::TRIANGLES);
+ {
+ gGL.vertex3f(-1.f, -1.f, clip_plane);
+ gGL.vertex3f(1.f, -1.f, clip_plane);
+ gGL.vertex3f(1.f, 1.f, clip_plane);
+
+ gGL.vertex3f(-1.f, -1.f, clip_plane);
+ gGL.vertex3f(1.f, 1.f, clip_plane);
+ gGL.vertex3f(-1.f, 1.f, clip_plane);
+ }
gGL.end();
gGL.flush();
diff --git a/indra/newview/scripts/lua/frame_profile.lua b/indra/newview/scripts/lua/frame_profile.lua
new file mode 100644
index 0000000000..3c6353ff68
--- /dev/null
+++ b/indra/newview/scripts/lua/frame_profile.lua
@@ -0,0 +1,24 @@
+-- Trigger Develop -> Render Tests -> Frame Profile
+
+LLAgent = require 'LLAgent'
+startup = require 'startup'
+Timer = (require 'timers').Timer
+UI = require 'UI'
+
+startup.wait('STATE_STARTED')
+
+-- teleport to http://maps.secondlife.com/secondlife/Bug%20Island/220/224/27
+print(LLAgent.teleport{regionname='Bug Island', x=220, y=224, z=27})
+Timer(10, 'wait')
+LLAgent.setCamera{camera_pos={220, 224, 26}, camera_locked=true,
+ focus_pos ={228, 232, 26}, focus_locked=true}
+Timer(1, 'wait')
+-- This freezes the viewer for perceptible realtime
+UI.popup:tip('starting Render Tests -> Frame Profile')
+UI.call("Advanced.ClickRenderProfile")
+Timer(1, 'wait')
+LLAgent.removeCamParams()
+LLAgent.setFollowCamActive(false)
+
+-- Home, James!
+print(LLAgent.teleport('home'))
diff --git a/indra/newview/scripts/lua/frame_profile_quit.lua b/indra/newview/scripts/lua/frame_profile_quit.lua
new file mode 100644
index 0000000000..ad136c86d2
--- /dev/null
+++ b/indra/newview/scripts/lua/frame_profile_quit.lua
@@ -0,0 +1,34 @@
+-- Trigger Develop -> Render Tests -> Frame Profile and quit
+
+assert(arg.n == 3, 'Usage: frame_profile_quit.lua x y z (for camera focus)')
+-- Try coercing string arguments to numbers, using Lua's implicit conversion.
+-- If the args passed as x, y, z won't convert nicely to numbers, better find
+-- out now.
+focus = {arg[1]+0, arg[2]+0, arg[3]+0}
+
+LLAgent = require 'LLAgent'
+logout = require 'logout'
+startup = require 'startup'
+Timer = (require 'timers').Timer
+UI = require 'UI'
+
+startup.wait('STATE_STARTED')
+
+-- Figure out where we are
+camera = LLAgent.getRegionPosition()
+-- assume z is the agent's feet, add 2 meters
+camera[2] += 2
+
+Timer(10, 'wait')
+LLAgent.setCamera{camera_pos=camera, camera_locked=true,
+ focus_pos=focus, focus_locked=true}
+Timer(1, 'wait')
+-- This freezes the viewer for perceptible realtime
+UI.popup:tip('starting Render Tests -> Frame Profile')
+UI.call("Advanced.ClickRenderProfile")
+Timer(1, 'wait')
+LLAgent.removeCamParams()
+LLAgent.setFollowCamActive(false)
+
+-- done
+logout()
diff --git a/indra/newview/scripts/lua/luafloater_camera_control.xml b/indra/newview/scripts/lua/luafloater_camera_control.xml
new file mode 100644
index 0000000000..0601a363e5
--- /dev/null
+++ b/indra/newview/scripts/lua/luafloater_camera_control.xml
@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ legacy_header_height="18"
+ height="350"
+ layout="topleft"
+ name="camera_demo"
+ title="Follow camera control"
+ width="360">
+ <text
+ type="string"
+ follows="left|top"
+ height="10"
+ width="100"
+ layout="topleft"
+ top="30"
+ left="10"
+ name="camera_lbl">
+ Camera position:
+ </text>
+ <text
+ type="string"
+ follows="left|top"
+ height="10"
+ width="10"
+ layout="topleft"
+ top_pad="12"
+ left="10"
+ value="X"
+ name="cam_x_lbl"/>
+ <line_editor
+ border_style="line"
+ border_thickness="1"
+ follows="left|bottom"
+ font="SansSerif"
+ height="20"
+ layout="topleft"
+ max_length_bytes="50"
+ name="cam_x"
+ top_delta="-2"
+ left_pad="5"
+ width="65" />
+ <button
+ follows="left|bottom"
+ height="20"
+ image_overlay="Icon_Copy"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ layout="topleft"
+ tool_tip="Use Agent position"
+ name="agent_cam_btn"
+ left_pad="10"
+ width="20" >
+ </button>
+ <text
+ type="string"
+ follows="left|top"
+ height="10"
+ width="10"
+ layout="topleft"
+ top_pad="7"
+ left="10"
+ value="Y"
+ name="cam_y_lbl"/>
+ <line_editor
+ border_style="line"
+ border_thickness="1"
+ follows="left|bottom"
+ font="SansSerif"
+ height="20"
+ layout="topleft"
+ max_length_bytes="50"
+ name="cam_y"
+ top_delta="-2"
+ left_pad="5"
+ width="65" />
+ <text
+ type="string"
+ follows="left|top"
+ height="10"
+ width="10"
+ layout="topleft"
+ top_pad="7"
+ left="10"
+ value="Z"
+ name="cam_z_lbl"/>
+ <line_editor
+ border_style="line"
+ border_thickness="1"
+ follows="left|bottom"
+ font="SansSerif"
+ height="20"
+ layout="topleft"
+ max_length_bytes="50"
+ name="cam_z"
+ top_delta="-2"
+ left_pad="5"
+ width="65" />
+ <text
+ type="string"
+ follows="left|top"
+ height="10"
+ width="100"
+ layout="topleft"
+ top="30"
+ left="145"
+ name="focus_lbl">
+ Focus position:
+ </text>
+ <text
+ type="string"
+ follows="left|top"
+ height="10"
+ width="10"
+ layout="topleft"
+ top_pad="12"
+ left="145"
+ value="X"
+ name="cam_x_lbl"/>
+ <line_editor
+ border_style="line"
+ border_thickness="1"
+ follows="left|bottom"
+ font="SansSerif"
+ height="20"
+ layout="topleft"
+ max_length_bytes="50"
+ name="focus_x"
+ top_delta="-2"
+ left_pad="5"
+ width="60" />
+ <button
+ follows="left|bottom"
+ height="20"
+ image_overlay="Icon_Copy"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ layout="topleft"
+ tool_tip="Use Agent position"
+ name="agent_focus_btn"
+ left_pad="10"
+ width="20" >
+ </button>
+ <text
+ type="string"
+ follows="left|top"
+ height="10"
+ width="10"
+ layout="topleft"
+ top_pad="7"
+ left="145"
+ value="Y"
+ name="cam_y_lbl"/>
+ <line_editor
+ border_style="line"
+ border_thickness="1"
+ follows="left|bottom"
+ font="SansSerif"
+ height="20"
+ layout="topleft"
+ max_length_bytes="50"
+ name="focus_y"
+ top_delta="-2"
+ left_pad="5"
+ width="60" />
+ <text
+ type="string"
+ follows="left|top"
+ height="10"
+ width="10"
+ layout="topleft"
+ top_pad="7"
+ left="145"
+ value="Z"
+ name="cam_z_lbl"/>
+ <line_editor
+ border_style="line"
+ border_thickness="1"
+ follows="left|bottom"
+ font="SansSerif"
+ height="20"
+ layout="topleft"
+ max_length_bytes="50"
+ name="focus_z"
+ top_delta="-2"
+ left_pad="5"
+ width="60" />
+ <text
+ type="string"
+ follows="left|top"
+ height="10"
+ width="100"
+ layout="topleft"
+ top="30"
+ left="270"
+ name="focus_lbl">
+ Lock:
+ </text>
+ <check_box
+ width="80"
+ height="21"
+ layout="topleft"
+ follows="top|left"
+ top_pad="12"
+ label="Camera"
+ name="lock_camera_ctrl"/>
+ <check_box
+ width="80"
+ height="21"
+ layout="topleft"
+ follows="top|left"
+ top_pad="2"
+ label="Focus"
+ name="lock_focus_ctrl"/>
+ <button
+ follows="left|bottom"
+ height="25"
+ label="Update params"
+ layout="topleft"
+ name="update_btn"
+ left="10"
+ top="140"
+ width="120" >
+ </button>
+ <button
+ follows="left|bottom"
+ height="25"
+ label="Reset"
+ layout="topleft"
+ name="reset_btn"
+ left_pad="15"
+ width="90" >
+ </button>
+ <text_editor
+ follows="top|left"
+ font="SansSerif"
+ height="160"
+ left="5"
+ enabled="false"
+ name="events_editor"
+ top_pad="15"
+ word_wrap="true"
+ max_length="65536"
+ width="350"/>
+</floater>
diff --git a/indra/newview/scripts/lua/luafloater_demo.xml b/indra/newview/scripts/lua/luafloater_demo.xml
new file mode 100644
index 0000000000..b2273d7718
--- /dev/null
+++ b/indra/newview/scripts/lua/luafloater_demo.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ legacy_header_height="18"
+ height="300"
+ layout="topleft"
+ name="lua_demo"
+ title="LUA"
+ width="320">
+ <check_box
+ height="16"
+ label="Disable button"
+ layout="topleft"
+ top_pad="35"
+ left="5"
+ name="disable_ctrl"
+ width="146" />
+ <line_editor
+ border_style="line"
+ border_thickness="1"
+ follows="left|bottom"
+ font="SansSerif"
+ height="20"
+ layout="topleft"
+ max_length_bytes="50"
+ name="openfloater_cmd"
+ top_delta="25"
+ width="100" />
+ <button
+ follows="left|bottom"
+ height="23"
+ label="Open floater"
+ layout="topleft"
+ name="open_btn"
+ top_delta="25"
+ width="100" >
+ </button>
+ <text
+ type="string"
+ follows="left|top"
+ height="10"
+ layout="topleft"
+ top="30"
+ left_delta="170"
+ name="title_lbl">
+ Select title
+ </text>
+ <combo_box
+ follows="top|left"
+ height="23"
+ name="title_cmb"
+ top_pad="5"
+ width="100">
+ <combo_box.item
+ label="LUA"
+ value="LUA" />
+ <combo_box.item
+ label="LUA floater"
+ value="LUA floater" />
+ <combo_box.item
+ label="LUA-U title"
+ value="LUA-U title" />
+ </combo_box>
+ <text
+ type="string"
+ follows="left|bottom"
+ height="10"
+ layout="topleft"
+ top_delta="50"
+ name="show_time_lbl">
+ Double click me
+ </text>
+ <text
+ type="string"
+ follows="left|top"
+ height="10"
+ layout="topleft"
+ top_pad="15"
+ font="SansSerif"
+ text_color="white"
+ left_delta="15"
+ name="time_lbl"/>
+ <text_editor
+ follows="top|left"
+ font="SansSerif"
+ height="140"
+ left="5"
+ enabled="false"
+ name="events_editor"
+ top_pad="15"
+ word_wrap="true"
+ max_length="65536"
+ width="310"/>
+</floater>
diff --git a/indra/newview/scripts/lua/luafloater_gesture_list.xml b/indra/newview/scripts/lua/luafloater_gesture_list.xml
new file mode 100644
index 0000000000..a38a04eed0
--- /dev/null
+++ b/indra/newview/scripts/lua/luafloater_gesture_list.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ legacy_header_height="18"
+ height="150"
+ layout="topleft"
+ name="lua_gestures"
+ title="Gestures"
+ width="320">
+ <scroll_list
+ draw_heading="false"
+ left="5"
+ width="310"
+ height="115"
+ top_pad ="25"
+ follows="all"
+ name="gesture_list">
+ <scroll_list.columns
+ name="gesture_name"
+ label="Name"/>
+ </scroll_list>
+</floater>
diff --git a/indra/newview/scripts/lua/luafloater_outfits_list.xml b/indra/newview/scripts/lua/luafloater_outfits_list.xml
new file mode 100644
index 0000000000..8cab864308
--- /dev/null
+++ b/indra/newview/scripts/lua/luafloater_outfits_list.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ legacy_header_height="18"
+ height="205"
+ layout="topleft"
+ name="lua_outfits"
+ title="Outfits"
+ width="325">
+ <scroll_list
+ draw_heading="false"
+ left="5"
+ width="315"
+ height="150"
+ top_pad ="25"
+ follows="all"
+ name="outfits_list">
+ <scroll_list.columns
+ name="outfit_name"
+ label="Name"/>
+ </scroll_list>
+ <button
+ follows="left|bottom"
+ height="23"
+ label="Replace COF"
+ layout="topleft"
+ name="replace_btn"
+ enabled="false"
+ top_pad="5"
+ width="95" >
+ </button>
+ <button
+ follows="left|bottom"
+ height="23"
+ label="Add to COF"
+ left_pad="7"
+ layout="topleft"
+ name="add_btn"
+ enabled="false"
+ width="95" >
+ </button>
+ <button
+ follows="left|bottom"
+ height="23"
+ label="Show wearables"
+ left_pad="7"
+ layout="topleft"
+ name="select_btn"
+ enabled="false"
+ width="111" >
+ </button>
+</floater>
diff --git a/indra/newview/scripts/lua/luafloater_speedometer.xml b/indra/newview/scripts/lua/luafloater_speedometer.xml
new file mode 100644
index 0000000000..54b99c7d48
--- /dev/null
+++ b/indra/newview/scripts/lua/luafloater_speedometer.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ legacy_header_height="18"
+ height="60"
+ layout="topleft"
+ name="lua_speedometer"
+ title="Speedometer"
+ can_minimize="false"
+ width="170">
+ <text
+ type="string"
+ follows="left|top"
+ font="SansSerifBold"
+ font.size="Huge"
+ text_color="White"
+ layout="topleft"
+ top="25"
+ left_delta="30"
+ width="70"
+ height="30"
+ name="speed_lbl"/>
+ <text
+ type="string"
+ follows="left|top"
+ width="55"
+ height="30"
+ font="SansSerifBold"
+ font.size="Huge"
+ text_color="White"
+ layout="topleft"
+ left_pad="2"
+ name="mps_lbl">
+ m/s
+ </text>
+</floater>
diff --git a/indra/newview/scripts/lua/qtest.lua b/indra/newview/scripts/lua/qtest.lua
new file mode 100644
index 0000000000..9526f58b04
--- /dev/null
+++ b/indra/newview/scripts/lua/qtest.lua
@@ -0,0 +1,146 @@
+-- Exercise the Queue, WaitQueue, ErrorQueue family
+
+Queue = require('Queue')
+WaitQueue = require('WaitQueue')
+ErrorQueue = require('ErrorQueue')
+util = require('util')
+
+inspect = require('inspect')
+
+-- resume() wrapper to propagate errors
+function resume(co, ...)
+ -- if there's an idiom other than table.pack() to assign an arbitrary
+ -- number of return values, I don't yet know it
+ local ok_result = table.pack(coroutine.resume(co, ...))
+ if not ok_result[1] then
+ -- if [1] is false, then [2] is the error message
+ error(ok_result[2])
+ end
+ -- ok is true, whew, just return the rest of the values
+ return table.unpack(ok_result, 2)
+end
+
+-- ------------------ Queue variables are instance-specific ------------------
+q1 = Queue()
+q2 = Queue()
+
+q1:Enqueue(17)
+
+assert(not q1:IsEmpty())
+assert(q2:IsEmpty())
+assert(q1:Dequeue() == 17)
+assert(q1:Dequeue() == nil)
+assert(q2:Dequeue() == nil)
+
+-- ----------------------------- test WaitQueue ------------------------------
+q1 = WaitQueue()
+q2 = WaitQueue()
+result = {}
+values = { 1, 1, 2, 3, 5, 8, 13, 21 }
+
+for i, value in pairs(values) do
+ q1:Enqueue(value)
+end
+-- close() while not empty tests that queue drains before reporting done
+q1:close()
+
+-- ensure that WaitQueue instance variables are in fact independent
+assert(q2:IsEmpty())
+
+-- consumer() coroutine to pull from the passed q until closed
+function consumer(desc, q)
+ print(string.format('consumer(%s) start', desc))
+ local value = q:Dequeue()
+ while value ~= nil do
+ print(string.format('consumer(%s) got %q', desc, value))
+ table.insert(result, value)
+ value = q:Dequeue()
+ end
+ print(string.format('consumer(%s) done', desc))
+end
+
+-- run two consumers
+coa = coroutine.create(consumer)
+cob = coroutine.create(consumer)
+-- Since consumer() doesn't yield while it can still retrieve values,
+-- consumer(a) will dequeue all values from q1 and return when done.
+resume(coa, 'a', q1)
+-- consumer(b) will wake up to find the queue empty and closed.
+resume(cob, 'b', q1)
+coroutine.close(coa)
+coroutine.close(cob)
+
+print('values:', inspect(values))
+print('result:', inspect(result))
+
+assert(util.equal(values, result))
+
+-- try incrementally enqueueing values
+q3 = WaitQueue()
+result = {}
+values = { 'This', 'is', 'a', 'test', 'script' }
+
+coros = {}
+for _, name in {'a', 'b'} do
+ local coro = coroutine.create(consumer)
+ table.insert(coros, coro)
+ -- Resuming both coroutines should leave them both waiting for a queue item.
+ resume(coro, name, q3)
+end
+
+for _, s in pairs(values) do
+ print(string.format('Enqueue(%q)', s))
+ q3:Enqueue(s)
+end
+q3:close()
+
+function joinall(coros)
+ local running
+ local errors = 0
+ repeat
+ running = false
+ for i, coro in pairs(coros) do
+ if coroutine.status(coro) == 'suspended' then
+ running = true
+ -- directly call coroutine.resume() instead of our resume()
+ -- wrapper because we explicitly check for errors here
+ local ok, message = coroutine.resume(coro)
+ if not ok then
+ print('*** ' .. message)
+ errors += 1
+ end
+ if coroutine.status(coro) == 'dead' then
+ coros[i] = nil
+ end
+ end
+ end
+ until not running
+ return errors
+end
+
+joinall(coros)
+
+print(string.format('%q', table.concat(result, ' ')))
+assert(util.equal(values, result))
+
+-- ----------------------------- test ErrorQueue -----------------------------
+q4 = ErrorQueue()
+result = {}
+values = { 'This', 'is', 'a', 'test', 'script' }
+
+coros = {}
+for _, name in {'a', 'b'} do
+ local coro = coroutine.create(consumer)
+ table.insert(coros, coro)
+ -- Resuming both coroutines should leave them both waiting for a queue item.
+ resume(coro, name, q4)
+end
+
+for i = 1, 4 do
+ print(string.format('Enqueue(%q)', values[i]))
+ q4:Enqueue(values[i])
+end
+q4:Error('something went wrong')
+
+assert(joinall(coros) == 2)
+
diff --git a/indra/newview/scripts/lua/require/ErrorQueue.lua b/indra/newview/scripts/lua/require/ErrorQueue.lua
new file mode 100644
index 0000000000..e6e9a5ef48
--- /dev/null
+++ b/indra/newview/scripts/lua/require/ErrorQueue.lua
@@ -0,0 +1,37 @@
+-- ErrorQueue isa WaitQueue with the added feature that a producer can push an
+-- error through the queue. Once that error is dequeued, every consumer will
+-- raise that error.
+
+local WaitQueue = require('WaitQueue')
+local function dbg(...) end
+-- local dbg = require('printf')
+local util = require('util')
+
+local ErrorQueue = WaitQueue()
+
+util.classctor(ErrorQueue)
+
+function ErrorQueue:Error(message)
+ -- Setting Error() is a marker, like closing the queue. Once we reach the
+ -- error, every subsequent Dequeue() call will raise the same error.
+ dbg('Setting self._closed to %q', message)
+ self._closed = message
+ self:_wake_waiters()
+end
+
+function ErrorQueue:Dequeue()
+ local value = WaitQueue.Dequeue(self)
+ dbg('ErrorQueue:Dequeue: base Dequeue() got %s', value)
+ if value ~= nil then
+ -- queue not yet closed, show caller
+ return value
+ end
+ if self._closed == true then
+ -- WaitQueue:close() sets true: queue has only been closed, tell caller
+ return nil
+ end
+ -- self._closed is a message set by Error()
+ error(self._closed)
+end
+
+return ErrorQueue
diff --git a/indra/newview/scripts/lua/require/LLAgent.lua b/indra/newview/scripts/lua/require/LLAgent.lua
new file mode 100644
index 0000000000..4a1132fe7e
--- /dev/null
+++ b/indra/newview/scripts/lua/require/LLAgent.lua
@@ -0,0 +1,143 @@
+local leap = require 'leap'
+local mapargs = require 'mapargs'
+
+local LLAgent = {}
+
+function LLAgent.getRegionPosition()
+ return leap.request('LLAgent', {op = 'getPosition'}).region
+end
+
+function LLAgent.getGlobalPosition()
+ return leap.request('LLAgent', {op = 'getPosition'}).global
+end
+
+-- Return array information about the agent's groups
+-- id: group id\n"
+-- name: group name\n"
+-- insignia: group insignia texture id
+-- notices: bool indicating if this user accepts notices from this group
+-- display: bool indicating if this group is listed in the user's profile
+-- contrib: user's land contribution to this group
+function LLAgent.getGroups()
+ return leap.request('LLAgent', {op = 'getGroups'}).groups
+end
+
+-- Use LL.leaphelp('LLAgent') and see 'setCameraParams' to get more info about params
+-- -- TYPE -- DEFAULT -- RANGE
+-- LLAgent.setCamera{ [, camera_pos] -- vector3
+-- [, focus_pos] -- vector3
+-- [, focus_offset] -- vector3 -- {1,0,0} -- {-10,-10,-10} to {10,10,10}
+-- [, distance] -- float (meters) -- 3 -- 0.5 to 50
+-- [, focus_threshold] -- float (meters) -- 1 -- 0 to 4
+-- [, camera_threshold] -- float (meters) -- 1 -- 0 to 4
+-- [, focus_lag] -- float (seconds) -- 0.1 -- 0 to 3
+-- [, camera_lag] -- float (seconds) -- 0.1 -- 0 to 3
+-- [, camera_pitch] -- float (degrees) -- 0 -- -45 to 80
+-- [, behindness_angle] -- float (degrees) -- 10 -- 0 to 180
+-- [, behindness_lag] -- float (seconds) -- 0 -- 0 to 3
+-- [, camera_locked] -- bool -- false
+-- [, focus_locked]} -- bool -- false
+function LLAgent.setCamera(...)
+ local args = mapargs('camera_pos,focus_pos,focus_offset,focus_lag,camera_lag,' ..
+ 'distance,focus_threshold,camera_threshold,camera_pitch,' ..
+ 'camera_locked,focus_locked,behindness_angle,behindness_lag', ...)
+ args.op = 'setCameraParams'
+ leap.send('LLAgent', args)
+end
+
+function LLAgent.setFollowCamActive(active)
+ leap.send('LLAgent', {op = 'setFollowCamActive', active = active})
+end
+
+function LLAgent.removeCamParams()
+ leap.send('LLAgent', {op = 'removeCameraParams'})
+end
+
+-- Play specified animation by "item_id" locally
+-- if "inworld" is specified as true, animation will be played inworld instead
+function LLAgent.playAnimation(...)
+ local args = mapargs('item_id,inworld', ...)
+ args.op = 'playAnimation'
+ return leap.request('LLAgent', args)
+end
+
+function LLAgent.stopAnimation(item_id)
+ return leap.request('LLAgent', {op = 'stopAnimation', item_id=item_id})
+end
+
+-- Get animation info by "item_id"
+-- reply contains "duration", "is_loop", "num_joints", "asset_id", "priority"
+function LLAgent.getAnimationInfo(item_id)
+ return leap.request('LLAgent', {op = 'getAnimationInfo', item_id=item_id}).anim_info
+end
+
+-- Teleport to specified "regionname" at specified region-relative "x", "y", "z".
+-- If "regionname" is "home", ignore "x", "y", "z" and teleport home.
+-- If "regionname" omitted, teleport to GLOBAL coordinates "x", "y", "z".
+function LLAgent.teleport(...)
+ local args = mapargs('regionname,x,y,z', ...)
+ args.op = 'teleport'
+ return leap.request('LLTeleportHandler', args).message
+end
+
+-- Call with no arguments to sit on the ground.
+-- Otherwise specify "obj_uuid" to sit on,
+-- or region "position" {x, y, z} where to find closest object to sit on.
+-- For example: LLAgent.requestSit{position=LLAgent.getRegionPosition()}
+-- Your avatar should be close enough to the object you want to sit on
+function LLAgent.requestSit(...)
+ local args = mapargs('obj_uuid,position', ...)
+ args.op = 'requestSit'
+ return leap.request('LLAgent', args)
+end
+
+function LLAgent.requestStand()
+ leap.send('LLAgent', {op = 'requestStand'})
+end
+
+-- ***************************************************************************
+-- Autopilot
+-- ***************************************************************************
+LLAgent.autoPilotPump = "LLAutopilot"
+
+-- Start the autopilot to move to "target_global" location using specified parameters
+-- LLAgent.startAutoPilot{ target_global array of target global {x, y, z} position
+-- [, allow_flying] allow flying during autopilot [default: true]
+-- [, stop_distance] target maximum distance from target [default: autopilot guess]
+-- [, behavior_name] name of the autopilot behavior [default: (script name)]
+-- [, target_rotation] array of [x, y, z, w] quaternion values [default: no target]
+-- [, rotation_threshold] target maximum angle from target facing rotation [default: 0.03 radians]
+-- an event with "success" flag is sent to "LLAutopilot" event pump, when auto pilot is terminated
+function LLAgent.startAutoPilot(...)
+ local args = mapargs('target_global,allow_flying,stop_distance,behavior_name,target_rotation,rotation_threshold', ...)
+ args.op = 'startAutoPilot'
+ leap.send('LLAgent', args)
+end
+
+-- Update target location for currently running autopilot
+function LLAgent.setAutoPilotTarget(target_global)
+ leap.send('LLAgent', {op = 'setAutoPilotTarget', target_global=target_global})
+end
+
+-- Start the autopilot to move to the specified target location
+-- either "leader_id" (uuid of target) or "avatar_name" (avatar full name: use just first name for 'Resident') should be specified
+-- "allow_flying" [default: true], "stop_distance" [default: autopilot guess]
+function LLAgent.startFollowPilot(...)
+ local args = mapargs('leader_id,avatar_name,allow_flying,stop_distance', ...)
+ args.op = 'startFollowPilot'
+ return leap.request('LLAgent', args)
+end
+
+-- Stop the autopilot system: "user_cancel" indicates whether or not to act as though user canceled autopilot [default: false]
+function LLAgent.stopAutoPilot(...)
+ local args = mapargs('user_cancel', ...)
+ args.op = 'stopAutoPilot'
+ leap.send('LLAgent', args)
+end
+
+-- Get information about current state of the autopilot
+function LLAgent.getAutoPilot()
+ return leap.request('LLAgent', {op = 'getAutoPilot'})
+end
+
+return LLAgent
diff --git a/indra/newview/scripts/lua/require/LLAppearance.lua b/indra/newview/scripts/lua/require/LLAppearance.lua
new file mode 100644
index 0000000000..f533d22daf
--- /dev/null
+++ b/indra/newview/scripts/lua/require/LLAppearance.lua
@@ -0,0 +1,31 @@
+local leap = require 'leap'
+
+local LLAppearance = {}
+
+function LLAppearance.wearOutfit(folder, action)
+ action = action or 'add'
+ leap.request('LLAppearance', {op='wearOutfit', append = (action == 'add'), folder_id=folder})
+end
+
+function LLAppearance.wearOutfitByName(folder, action)
+ action = action or 'add'
+ leap.request('LLAppearance', {op='wearOutfit', append = (action == 'add'), folder_name=folder})
+end
+
+function LLAppearance.wearItems(items_id, replace)
+ leap.send('LLAppearance', {op='wearItems', replace = replace, items_id=items_id})
+end
+
+function LLAppearance.detachItems(items_id)
+ leap.send('LLAppearance', {op='detachItems', items_id=items_id})
+end
+
+function LLAppearance.getOutfitsList()
+ return leap.request('LLAppearance', {op='getOutfitsList'})['outfits']
+end
+
+function LLAppearance.getOutfitItems(id)
+ return leap.request('LLAppearance', {op='getOutfitItems', outfit_id = id})['items']
+end
+
+return LLAppearance
diff --git a/indra/newview/scripts/lua/require/LLChat.lua b/indra/newview/scripts/lua/require/LLChat.lua
new file mode 100644
index 0000000000..3ac3bab746
--- /dev/null
+++ b/indra/newview/scripts/lua/require/LLChat.lua
@@ -0,0 +1,39 @@
+local leap = require 'leap'
+
+local LLChat = {}
+
+-- ***************************************************************************
+-- Nearby chat
+-- ***************************************************************************
+LLChat.nearbyChatPump = "LLNearbyChat"
+
+-- 0 is public nearby channel, other channels are used to communicate with LSL scripts
+function LLChat.sendNearby(msg, channel)
+ leap.send('LLChatBar', {op='sendChat', message=msg, channel=channel})
+end
+
+function LLChat.sendWhisper(msg)
+ leap.send('LLChatBar', {op='sendChat', type='whisper', message=msg})
+end
+
+function LLChat.sendShout(msg)
+ leap.send('LLChatBar', {op='sendChat', type='shout', message=msg})
+end
+
+-- ***************************************************************************
+-- Group chat
+-- ***************************************************************************
+
+function LLChat.startGroupChat(group_id)
+ return leap.request('GroupChat', {op='startGroupChat', group_id=group_id})
+end
+
+function LLChat.leaveGroupChat(group_id)
+ leap.send('GroupChat', {op='leaveGroupChat', group_id=group_id})
+end
+
+function LLChat.sendGroupIM(msg, group_id)
+ leap.send('GroupChat', {op='sendGroupIM', message=msg, group_id=group_id})
+end
+
+return LLChat
diff --git a/indra/newview/scripts/lua/require/LLDebugSettings.lua b/indra/newview/scripts/lua/require/LLDebugSettings.lua
new file mode 100644
index 0000000000..cff1a63c21
--- /dev/null
+++ b/indra/newview/scripts/lua/require/LLDebugSettings.lua
@@ -0,0 +1,17 @@
+local leap = require 'leap'
+
+local LLDebugSettings = {}
+
+function LLDebugSettings.set(name, value)
+ leap.request('LLViewerControl', {op='set', group='Global', key=name, value=value})
+end
+
+function LLDebugSettings.toggle(name)
+ leap.request('LLViewerControl', {op='toggle', group='Global', key=name})
+end
+
+function LLDebugSettings.get(name)
+ return leap.request('LLViewerControl', {op='get', group='Global', key=name})['value']
+end
+
+return LLDebugSettings
diff --git a/indra/newview/scripts/lua/require/LLFloaterAbout.lua b/indra/newview/scripts/lua/require/LLFloaterAbout.lua
new file mode 100644
index 0000000000..a6e42d364f
--- /dev/null
+++ b/indra/newview/scripts/lua/require/LLFloaterAbout.lua
@@ -0,0 +1,11 @@
+-- Engage the LLFloaterAbout LLEventAPI
+
+local leap = require 'leap'
+
+local LLFloaterAbout = {}
+
+function LLFloaterAbout.getInfo()
+ return leap.request('LLFloaterAbout', {op='getInfo'})
+end
+
+return LLFloaterAbout
diff --git a/indra/newview/scripts/lua/require/LLGesture.lua b/indra/newview/scripts/lua/require/LLGesture.lua
new file mode 100644
index 0000000000..343b611e2c
--- /dev/null
+++ b/indra/newview/scripts/lua/require/LLGesture.lua
@@ -0,0 +1,23 @@
+-- Engage the LLGesture LLEventAPI
+
+local leap = require 'leap'
+
+local LLGesture = {}
+
+function LLGesture.getActiveGestures()
+ return leap.request('LLGesture', {op='getActiveGestures'})['gestures']
+end
+
+function LLGesture.isGesturePlaying(id)
+ return leap.request('LLGesture', {op='isGesturePlaying', id=id})['playing']
+end
+
+function LLGesture.startGesture(id)
+ leap.send('LLGesture', {op='startGesture', id=id})
+end
+
+function LLGesture.stopGesture(id)
+ leap.send('LLGesture', {op='stopGesture', id=id})
+end
+
+return LLGesture
diff --git a/indra/newview/scripts/lua/require/LLInventory.lua b/indra/newview/scripts/lua/require/LLInventory.lua
new file mode 100644
index 0000000000..2c80a8602b
--- /dev/null
+++ b/indra/newview/scripts/lua/require/LLInventory.lua
@@ -0,0 +1,67 @@
+local leap = require 'leap'
+local mapargs = require 'mapargs'
+local result_view = require 'result_view'
+
+local function result(keys)
+ -- capture result_view() instances for both categories and items
+ local result_table = {
+ categories=result_view(keys.categories),
+ items=result_view(keys.items),
+ -- call result_table:close() to release result sets before garbage
+ -- collection or script completion
+ close = function(self)
+ result_view.close(keys.categories[1], keys.items[1])
+ end
+ }
+ -- When the result_table is destroyed, close its result_views.
+ return LL.setdtor('LLInventory result', result_table, result_table.close)
+end
+
+local LLInventory = {}
+
+-- Get the items/folders info by provided IDs,
+-- reply will contain "items" and "categories" tables accordingly
+function LLInventory.getItemsInfo(item_ids)
+ return result(leap.request('LLInventory', {op = 'getItemsInfo', item_ids=item_ids}))
+end
+
+-- Get the table of folder type names, which can be later used to get the ID of the basic folders
+function LLInventory.getFolderTypeNames()
+ return leap.request('LLInventory', {op = 'getFolderTypeNames'}).names
+end
+
+-- Get the UUID of the basic folder("Textures", "My outfits", "Sounds" etc.) by specified folder type name
+function LLInventory.getBasicFolderID(ft_name)
+ return leap.request('LLInventory', {op = 'getBasicFolderID', ft_name=ft_name}).id
+end
+
+-- Get the table of asset type names, which can be later used to get the specific items via LLInventory.collectDescendantsIf(...)
+function LLInventory.getAssetTypeNames()
+ return leap.request('LLInventory', {op = 'getAssetTypeNames'}).names
+end
+
+-- Get the direct descendants of the 'folder_id' provided,
+-- reply will contain "items" and "categories" tables accordingly
+function LLInventory.getDirectDescendants(folder_id)
+ return result(leap.request('LLInventory', {op = 'getDirectDescendants', folder_id=folder_id}))
+end
+-- backwards compatibility
+LLInventory.getDirectDescendents = LLInventory.getDirectDescendants
+
+-- Get the descendants of the 'folder_id' provided, which pass specified filters
+-- reply will contain "items" and "categories" tables accordingly
+-- LLInventory.collectDescendantsIf{ folder_id -- parent folder ID
+-- [, name] -- name (substring)
+-- [, desc] -- description (substring)
+-- [, type] -- asset type
+-- [, limit] -- item count limit in reply, maximum and default is 100
+-- [, filter_links]} -- EXCLUDE_LINKS - don't show links, ONLY_LINKS - only show links, INCLUDE_LINKS - show links too (default)
+function LLInventory.collectDescendantsIf(...)
+ local args = mapargs('folder_id,name,desc,type,filter_links,limit', ...)
+ args.op = 'collectDescendantsIf'
+ return result(leap.request('LLInventory', args))
+end
+-- backwards compatibility
+LLInventory.collectDescendentsIf = LLInventory.collectDescendantsIf
+
+return LLInventory
diff --git a/indra/newview/scripts/lua/require/LLListener.lua b/indra/newview/scripts/lua/require/LLListener.lua
new file mode 100644
index 0000000000..b05f966097
--- /dev/null
+++ b/indra/newview/scripts/lua/require/LLListener.lua
@@ -0,0 +1,50 @@
+local fiber = require 'fiber'
+local inspect = require 'inspect'
+local leap = require 'leap'
+local util = require 'util'
+
+local LLListener = {}
+local waitfor = {}
+local listener_name = {}
+
+function LLListener:new(pump_name)
+ local obj = setmetatable({}, self)
+ self.__index = self
+ obj.name = 'Listener:' .. pump_name
+ obj._pump = pump_name
+
+ return obj
+end
+
+util.classctor(LLListener)
+
+function LLListener:handleMessages(event_data)
+ print(inspect(event_data))
+ return true
+end
+
+function LLListener:start()
+ _pump = self._pump
+ waitfor = leap.WaitFor(-1, self.name)
+ function waitfor:filter(pump, data)
+ if _pump == pump then
+ return data
+ end
+ end
+
+ fiber.launch(self.name, function()
+ event = waitfor:wait()
+ while event and self:handleMessages(event) do
+ event = waitfor:wait()
+ end
+ end)
+
+ listener_name = leap.request(leap.cmdpump(), {op='listen', source=_pump, listener="LLListener", tweak=true}).listener
+end
+
+function LLListener:stop()
+ leap.send(leap.cmdpump(), {op='stoplistening', source=self._pump, listener=listener_name})
+ waitfor:close()
+end
+
+return LLListener
diff --git a/indra/newview/scripts/lua/require/Queue.lua b/indra/newview/scripts/lua/require/Queue.lua
new file mode 100644
index 0000000000..5bc72e4057
--- /dev/null
+++ b/indra/newview/scripts/lua/require/Queue.lua
@@ -0,0 +1,51 @@
+-- from https://create.roblox.com/docs/luau/queues#implementing-queues,
+-- amended per https://www.lua.org/pil/16.1.html
+
+-- While coding some scripting in Lua
+-- I found that I needed a queua
+-- I thought of linked list
+-- But had to resist
+-- For fear it might be too obscua.
+
+local util = require 'util'
+
+local Queue = {}
+
+function Queue:new()
+ local obj = setmetatable({}, self)
+ self.__index = self
+
+ obj._first = 0
+ obj._last = -1
+ obj._queue = {}
+
+ return obj
+end
+
+util.classctor(Queue)
+
+-- Check if the queue is empty
+function Queue:IsEmpty()
+ return self._first > self._last
+end
+
+-- Add a value to the queue
+function Queue:Enqueue(value)
+ local last = self._last + 1
+ self._last = last
+ self._queue[last] = value
+end
+
+-- Remove a value from the queue
+function Queue:Dequeue()
+ if self:IsEmpty() then
+ return nil
+ end
+ local first = self._first
+ local value = self._queue[first]
+ self._queue[first] = nil
+ self._first = first + 1
+ return value
+end
+
+return Queue
diff --git a/indra/newview/scripts/lua/require/Region.lua b/indra/newview/scripts/lua/require/Region.lua
new file mode 100644
index 0000000000..e4eefece33
--- /dev/null
+++ b/indra/newview/scripts/lua/require/Region.lua
@@ -0,0 +1,17 @@
+LLFloaterAbout = require 'LLFloaterAbout'
+
+local Region = {}
+
+function Region.getInfo()
+ info = LLFloaterAbout.getInfo()
+ return {
+ HOSTNAME=info.HOSTNAME,
+ POSITION=info.POSITION,
+ POSITION_LOCAL=info.POSITION_LOCAL,
+ REGION=info.REGION,
+ SERVER_VERSION=info.SERVER_VERSION,
+ SLURL=info.SLURL,
+ }
+end
+
+return Region
diff --git a/indra/newview/scripts/lua/require/UI.lua b/indra/newview/scripts/lua/require/UI.lua
new file mode 100644
index 0000000000..cf2695917e
--- /dev/null
+++ b/indra/newview/scripts/lua/require/UI.lua
@@ -0,0 +1,243 @@
+-- Engage the viewer's UI
+
+local leap = require 'leap'
+local mapargs = require 'mapargs'
+local result_view = require 'result_view'
+local Timer = (require 'timers').Timer
+local util = require 'util'
+
+-- Allow lazily accessing UI submodules on demand, e.g. a reference to
+-- UI.Floater lazily loads the UI/Floater module.
+local UI = util.submoduledir({}, 'UI')
+
+-- ***************************************************************************
+-- registered menu actions
+-- ***************************************************************************
+function UI.call(func, parameter)
+ -- 'call' is fire-and-forget
+ leap.request('UI', {op='call', ['function']=func, parameter=parameter})
+end
+
+function UI.callables()
+ return leap.request('UI', {op='callables'}).callables
+end
+
+function UI.getValue(path)
+ return leap.request('UI', {op='getValue', path=path})['value']
+end
+
+-- ***************************************************************************
+-- UI views
+-- ***************************************************************************
+-- Either:
+-- wreq{op='Something', a=1, b=2, ...}
+-- or:
+-- (args should be local, as this wreq() call modifies it)
+-- local args = {a=1, b=2, ...}
+-- wreq('Something', args)
+local function wreq(op_or_data, data_if_op)
+ if data_if_op ~= nil then
+ -- this is the wreq(op, data) form
+ data_if_op.op = op_or_data
+ op_or_data = data_if_op
+ end
+ return leap.request('LLWindow', op_or_data)
+end
+
+-- omit 'parent' to list all view paths
+function UI.listviews(parent)
+ return wreq{op='getPaths', under=parent}
+end
+
+function UI.viewinfo(path)
+ return wreq{op='getInfo', path=path}
+end
+
+-- ***************************************************************************
+-- mouse actions
+-- ***************************************************************************
+-- pass a table:
+-- UI.click{path=path
+-- [, button='LEFT' | 'CENTER' | 'RIGHT']
+-- [, x=x, y=y]
+-- [, hold=duration]}
+function UI.click(...)
+ local args = mapargs('path,button,x,y,hold', ...)
+ args.button = args.button or 'LEFT'
+ local hold = args.hold or 1.0
+ wreq('mouseMove', args)
+ wreq('mouseDown', args)
+ Timer(hold, 'wait')
+ wreq('mouseUp', args)
+end
+
+-- pass a table as for UI.click()
+function UI.doubleclick(...)
+ local args = mapargs('path,button,x,y', ...)
+ args.button = args.button or 'LEFT'
+ wreq('mouseDown', args)
+ wreq('mouseUp', args)
+ wreq('mouseDown', args)
+ wreq('mouseUp', args)
+end
+
+-- UI.drag{path=, xoff=, yoff=}
+function UI.drag(...)
+ local args = mapargs('path,xoff,yoff', ...)
+ -- query the specified path
+ local rect = UI.viewinfo(args.path).rect
+ local centerx = math.floor(rect.left + (rect.right - rect.left)/2)
+ local centery = math.floor(rect.bottom + (rect.top - rect.bottom)/2)
+ wreq{op='mouseMove', path=args.path, x=centerx, y=centery}
+ wreq{op='mouseDown', path=args.path, button='LEFT'}
+ wreq{op='mouseMove', path=args.path, x=centerx + args.xoff, y=centery + args.yoff}
+ wreq{op='mouseUp', path=args.path, button='LEFT'}
+end
+
+-- ***************************************************************************
+-- keyboard actions
+-- ***************************************************************************
+-- pass a table:
+-- UI.keypress{
+-- [path=path] -- if omitted, default input field
+-- [, char='x'] -- requires one of char, keycode, keysym
+-- [, keycode=120]
+-- keysym per https://github.com/secondlife/viewer/blob/main/indra/llwindow/llkeyboard.cpp#L68-L124
+-- [, keysym='Enter']
+-- [, mask={'SHIFT', 'CTL', 'ALT', 'MAC_CONTROL'}] -- some subset of these
+-- }
+function UI.keypress(...)
+ local args = mapargs('path,char,keycode,keysym,mask', ...)
+ if args.char == '\n' then
+ args.char = nil
+ args.keysym = 'Enter'
+ end
+ return wreq('keyDown', args)
+end
+
+-- UI.type{text=, path=}
+function UI.type(...)
+ local args = mapargs('text,path', ...)
+ if #args.text > 0 then
+ -- The caller's path may be specified in a way that requires recursively
+ -- searching parts of the LLView tree. No point in doing that more than
+ -- once. Capture the actual path found by that first call and use that for
+ -- subsequent calls.
+ local path = UI.keypress{path=args.path, char=string.sub(args.text, 1, 1)}.path
+ for i = 2, #args.text do
+ UI.keypress{path=path, char=string.sub(args.text, i, i)}
+ end
+ end
+end
+
+-- ***************************************************************************
+-- Snapshot
+-- ***************************************************************************
+-- UI.snapshot{filename=filename -- extension may be specified: bmp, jpeg, png
+-- [, type='COLOR' | 'DEPTH']
+-- [, width=width][, height=height] -- uses current window size if not specified
+-- [, showui=true][, showhud=true]
+-- [, rebuild=false]}
+function UI.snapshot(...)
+ local args = mapargs('filename,width,height,showui,showhud,rebuild,type', ...)
+ args.op = 'saveSnapshot'
+ return leap.request('LLViewerWindow', args).result
+end
+
+-- ***************************************************************************
+-- Top menu
+-- ***************************************************************************
+
+function UI.getTopMenus()
+ return leap.request('UI', {op='getTopMenus'}).menus
+end
+
+function UI.addMenu(...)
+ local args = mapargs('name,label', ...)
+ args.op = 'addMenu'
+ return leap.request('UI', args)
+end
+
+function UI.setMenuVisible(name, visible)
+ return leap.request('UI', {op='setMenuVisible', name=name, visible=visible})
+end
+
+function UI.addMenuBranch(...)
+ local args = mapargs('name,label,parent_menu', ...)
+ args.op = 'addMenuBranch'
+ return leap.request('UI', args)
+end
+
+-- see UI.callables() for valid values of 'func'
+function UI.addMenuItem(...)
+ local args = mapargs('name,label,parent_menu,func,param,pos', ...)
+ args.op = 'addMenuItem'
+ return leap.request('UI', args)
+end
+
+function UI.addMenuSeparator(...)
+ local args = mapargs('parent_menu,pos', ...)
+ args.op = 'addMenuSeparator'
+ return leap.request('UI', args)
+end
+
+-- ***************************************************************************
+-- Toolbar buttons
+-- ***************************************************************************
+-- Clears all buttons off the toolbars
+function UI.clearAllToolbars()
+ leap.send('UI', {op='clearAllToolbars'})
+end
+
+function UI.defaultToolbars()
+ leap.send('UI', {op='defaultToolbars'})
+end
+
+-- UI.addToolbarBtn{btn_name=btn_name
+-- [, toolbar= bottom] -- left, right, bottom -- default is bottom
+-- [, rank=1]} -- position on the toolbar, starts at 0 (0 - first position, 1 - second position etc.)
+function UI.addToolbarBtn(...)
+ local args = mapargs('btn_name,toolbar,rank', ...)
+ args.op = 'addToolbarBtn'
+ return leap.request('UI', args)
+end
+
+-- Returns the rank(position) of the command in the original list
+function UI.removeToolbarBtn(btn_name)
+ return leap.request('UI', {op = 'removeToolbarBtn', btn_name=btn_name}).rank
+end
+
+function UI.getToolbarBtnNames()
+ return leap.request('UI', {op = 'getToolbarBtnNames'}).cmd_names
+end
+
+-- ***************************************************************************
+-- Floaters
+-- ***************************************************************************
+function UI.showFloater(floater_name)
+ leap.send("LLFloaterReg", {op = "showInstance", name = floater_name})
+end
+
+function UI.hideFloater(floater_name)
+ leap.send("LLFloaterReg", {op = "hideInstance", name = floater_name})
+end
+
+function UI.toggleFloater(floater_name)
+ leap.send("LLFloaterReg", {op = "toggleInstance", name = floater_name})
+end
+
+function UI.isFloaterVisible(floater_name)
+ return leap.request("LLFloaterReg", {op = "instanceVisible", name = floater_name}).visible
+end
+
+function UI.closeAllFloaters()
+ return leap.send("UI", {op = "closeAllFloaters"})
+end
+
+function UI.getFloaterNames()
+ local key_length = leap.request("LLFloaterReg", {op = "getFloaterNames"}).floaters
+ local view = result_view(key_length)
+ return LL.setdtor('registered floater names', view, view.close)
+end
+
+return UI
diff --git a/indra/newview/scripts/lua/require/UI/Floater.lua b/indra/newview/scripts/lua/require/UI/Floater.lua
new file mode 100644
index 0000000000..d057a74386
--- /dev/null
+++ b/indra/newview/scripts/lua/require/UI/Floater.lua
@@ -0,0 +1,146 @@
+-- Floater base class
+
+local leap = require 'leap'
+local fiber = require 'fiber'
+local util = require 'util'
+
+-- list of all the events that a LLLuaFloater might send
+local event_list = leap.request("LLFloaterReg", {op="getFloaterEvents"}).events
+local event_set = {}
+for _, event in pairs(event_list) do
+ event_set[event] = true
+end
+
+local function _event(event_name)
+ if not event_set[event_name] then
+ error("Incorrect event name: " .. event_name, 3)
+ end
+ return event_name
+end
+
+-- ---------------------------------------------------------------------------
+local Floater = {}
+
+-- Pass:
+-- relative file path to floater's XUI definition file
+-- optional: sign up for additional events for defined control
+-- {<control_name>={action1, action2, ...}}
+function Floater:new(path, extra)
+ local obj = setmetatable({}, self)
+ self.__index = self
+
+ local path_parts = string.split(path, '/')
+ obj.name = 'Floater ' .. path_parts[#path_parts]
+
+ obj._command = {op="showLuaFloater", xml_path=LL.abspath(path)}
+ if extra then
+ -- validate each of the actions for each specified control
+ for control, actions in pairs(extra) do
+ for _, action in pairs(actions) do
+ _event(action)
+ end
+ end
+ obj._command.extra_events = extra
+ end
+
+ return obj
+end
+
+util.classctor(Floater)
+
+function Floater:show()
+ -- leap.eventstream() returns the first response, and launches a
+ -- background fiber to call the passed callback with all subsequent
+ -- responses.
+ local event = leap.eventstream(
+ 'LLFloaterReg',
+ self._command,
+ -- handleEvents() returns false when done.
+ -- eventstream() expects a true return when done.
+ function(event) return not self:handleEvents(event) end)
+ self._pump = event.command_name
+ -- we might need the returned reqid to cancel the eventstream() fiber
+ self.reqid = event.reqid
+
+ -- The response to 'showLuaFloater' *is* the 'post_build' event. Check if
+ -- subclass has a post_build() method. Honor the convention that if
+ -- handleEvents() returns false, we're done.
+ if not self:handleEvents(event) then
+ return
+ end
+end
+
+function Floater:post(action)
+ leap.send(self._pump, action)
+end
+
+function Floater:request(action)
+ return leap.request(self._pump, action)
+end
+
+-- local inspect = require 'inspect'
+
+function Floater:handleEvents(event_data)
+ local event = event_data.event
+ if event_set[event] == nil then
+ LL.print_warning(string.format('%s received unknown event %q', self.name, event))
+ end
+
+ -- Before checking for a general (e.g.) commit() method, first look for
+ -- commit_ctrl_name(): in other words, concatenate the event name with the
+ -- ctrl_name, with an underscore between. If there exists such a specific
+ -- method, call that.
+ local handler, ret
+ if event_data.ctrl_name then
+ local specific = event .. '_' .. event_data.ctrl_name
+ handler = self[specific]
+ if handler then
+ ret = handler(self, event_data)
+ -- Avoid 'return ret or true' because we explicitly want to allow
+ -- the handler to return false.
+ if ret ~= nil then
+ return ret
+ else
+ return true
+ end
+ end
+ end
+
+ -- No specific "event_on_ctrl()" method found; try just "event()"
+ handler = self[event]
+ if handler then
+ ret = handler(self, event_data)
+ if ret ~= nil then
+ return ret
+ end
+-- else
+-- print(string.format('%s ignoring event %s', self.name, inspect(event_data)))
+ end
+
+ -- We check for event() method before recognizing floater_close in case
+ -- the consumer needs to react specially to closing the floater. Now that
+ -- we've checked, recognize it ourselves. Returning false terminates the
+ -- anonymous fiber function launched by leap.eventstream().
+ if event == _event('floater_close') then
+ LL.print_warning(self.name .. ' closed')
+ return false
+ end
+ return true
+end
+
+-- onCtrl() permits a different dispatch style in which the general event()
+-- method explicitly calls (e.g.)
+-- self:onCtrl(event_data, {
+-- ctrl_name=function()
+-- self:post(...)
+-- end,
+-- ...
+-- })
+function Floater:onCtrl(event_data, ctrl_map)
+ local handler = ctrl_map[event_data.ctrl_name]
+ if handler then
+ handler()
+ end
+end
+
+return Floater
diff --git a/indra/newview/scripts/lua/require/UI/popup.lua b/indra/newview/scripts/lua/require/UI/popup.lua
new file mode 100644
index 0000000000..8ccf3b87f3
--- /dev/null
+++ b/indra/newview/scripts/lua/require/UI/popup.lua
@@ -0,0 +1,82 @@
+local leap = require 'leap'
+local mapargs = require 'mapargs'
+local util = require 'util'
+
+-- notification is any name defined in notifications.xml as
+-- <notification name=>
+-- vars is a table providing values for [VAR] substitution keys in the
+-- notification body
+-- payload prepopulates the response table
+-- wait=false means fire and forget, returning nil
+-- wait=true waits for user response:
+-- * If the viewer returns a table containing exactly one key=true pair,
+-- popup() returns just that key. If the key is a string containing an
+-- underscore, e.g. 'OK_okcancelbuttons', it's truncated at the first
+-- underscore, e.g. 'OK'.
+-- * Otherwise the viewer's response is returned unchanged. To suppress the
+-- above transformations, pass a non-empty payload table; this will cause
+-- the viewer to return a table with at least two keys.
+local popup = util.setmetamethods{
+ -- this gets called when a consumer calls popup(notification, vars, payload)
+ __call = function(self, ...)
+ local args = mapargs('notification,vars,payload,wait', ...)
+ -- we use convenience argument names different from 'LLNotifications'
+ -- listener
+ newargs = {op='requestAdd',
+ name=args.notification,
+ substitutions=args.vars,
+ payload=args.payload}
+ -- Specifically test (wait == false), NOT (not wait), because we treat
+ -- nil (omitted, default true) differently than false (explicitly
+ -- DON'T wait).
+ if args.wait == false then
+ leap.send('LLNotifications', newargs)
+ else
+ local response = leap.request('LLNotifications', newargs).response
+ -- response is typically a table. It might have multiple keys,
+ -- e.g. if caller passed non-empty payload. In that case, just
+ -- return the whole thing.
+ if type(response) ~= 'table' then
+ return response
+ end
+ -- get first key=value pair, if any
+ local key, value = next(response)
+ if (not key) or next(response, key) then
+ -- key == nil means response is empty
+ -- next(response, non-nil first key) ~= nil means at least two keys
+ return response
+ end
+ -- Here response is a table containing exactly one key. The
+ -- notifications system typically returns a table of the form
+ -- {OK_okcancelbuttons=true}, which is tricky to test for because it
+ -- varies with each set of buttons.
+ if value == true then
+ -- change {key=true} to plain key
+ response = key
+ if type(response) == 'string' then
+ -- change 'OK_okcancelbuttons' to plain 'OK'
+ response = string.split(response, '_')[1]
+ end
+ end
+ return response
+ end
+ end
+}
+
+function popup:alert(message, payload)
+ return self('GenericAlert', {MESSAGE=message, payload=payload})
+end
+
+function popup:alertOK(message, payload)
+ return self('GenericAlertOK', {MESSAGE=message, payload=payload})
+end
+
+function popup:alertYesCancel(message, payload)
+ return self('GenericAlertYesCancel', {MESSAGE=message, payload=payload})
+end
+
+function popup:tip(message, payload)
+ self{'SystemMessageTip', {MESSAGE=message, payload=payload}, wait=false}
+end
+
+return popup
diff --git a/indra/newview/scripts/lua/require/WaitQueue.lua b/indra/newview/scripts/lua/require/WaitQueue.lua
new file mode 100644
index 0000000000..7e10d03295
--- /dev/null
+++ b/indra/newview/scripts/lua/require/WaitQueue.lua
@@ -0,0 +1,88 @@
+-- WaitQueue isa Queue with the added feature that when the queue is empty,
+-- the Dequeue() operation blocks the calling coroutine until some other
+-- coroutine Enqueue()s a new value.
+
+local fiber = require('fiber')
+local Queue = require('Queue')
+local util = require('util')
+
+local function dbg(...) end
+-- local dbg = require('printf')
+
+local WaitQueue = Queue()
+
+function WaitQueue:new()
+ local obj = Queue()
+ setmetatable(obj, self)
+ self.__index = self
+
+ obj._waiters = {}
+ obj._closed = false
+ return obj
+end
+
+util.classctor(WaitQueue)
+
+function WaitQueue:Enqueue(value)
+ if self._closed then
+ error("can't Enqueue() on closed Queue")
+ end
+ -- can't simply call Queue:Enqueue(value)! That calls the method on the
+ -- Queue class definition, instead of calling Queue:Enqueue() on self.
+ -- Hand-expand the Queue:Enqueue() syntactic sugar.
+ Queue.Enqueue(self, value)
+ self:_wake_waiters()
+end
+
+function WaitQueue:_wake_waiters()
+ -- WaitQueue is designed to support multi-producer, multi-consumer use
+ -- cases. With multiple consumers, if more than one is trying to
+ -- Dequeue() from an empty WaitQueue, we'll have multiple waiters.
+ -- Unlike OS threads, with cooperative concurrency it doesn't make sense
+ -- to "notify all": we need wake only one of the waiting Dequeue()
+ -- callers.
+ if ((not self:IsEmpty()) or self._closed) and next(self._waiters) then
+ -- Pop the oldest waiting coroutine instead of the most recent, for
+ -- more-or-less round robin fairness. But skip any coroutines that
+ -- have gone dead in the meantime.
+ local waiter = table.remove(self._waiters, 1)
+ while waiter and fiber.status(waiter) == "dead" do
+ waiter = table.remove(self._waiters, 1)
+ end
+ -- do we still have at least one waiting coroutine?
+ if waiter then
+ -- don't pass the head item: let the resumed coroutine retrieve it
+ fiber.wake(waiter)
+ end
+ end
+end
+
+function WaitQueue:Dequeue()
+ while self:IsEmpty() do
+ -- Don't check for closed until the queue is empty: producer can close
+ -- the queue while there are still items left, and we want the
+ -- consumer(s) to retrieve those last few items.
+ if self._closed then
+ dbg('WaitQueue:Dequeue(): closed')
+ return nil
+ end
+ dbg('WaitQueue:Dequeue(): waiting')
+ -- add the running coroutine to the list of waiters
+ dbg('WaitQueue:Dequeue() running %s', tostring(coroutine.running() or 'main'))
+ table.insert(self._waiters, fiber.running())
+ -- then let somebody else run
+ fiber.wait()
+ end
+ -- here we're sure this queue isn't empty
+ dbg('WaitQueue:Dequeue() calling Queue.Dequeue()')
+ return Queue.Dequeue(self)
+end
+
+function WaitQueue:close()
+ self._closed = true
+ -- close() is like Enqueueing an end marker. If there are waiting
+ -- consumers, give them a chance to see we're closed.
+ self:_wake_waiters()
+end
+
+return WaitQueue
diff --git a/indra/newview/scripts/lua/require/coro.lua b/indra/newview/scripts/lua/require/coro.lua
new file mode 100644
index 0000000000..616a797e95
--- /dev/null
+++ b/indra/newview/scripts/lua/require/coro.lua
@@ -0,0 +1,67 @@
+-- Manage Lua coroutines
+
+local coro = {}
+
+coro._coros = {}
+
+-- Launch a Lua coroutine: create and resume.
+-- Returns: new coroutine, values yielded or returned from initial resume()
+-- If initial resume() encountered an error, propagates the error.
+function coro.launch(func, ...)
+ local co = coroutine.create(func)
+ table.insert(coro._coros, co)
+ return co, coro.resume(co, ...)
+end
+
+-- resume() wrapper to propagate errors
+function coro.resume(co, ...)
+ -- if there's an idiom other than table.pack() to assign an arbitrary
+ -- number of return values, I don't yet know it
+ local ok_result = table.pack(coroutine.resume(co, ...))
+ if not ok_result[1] then
+ -- if [1] is false, then [2] is the error message
+ error(ok_result[2])
+ end
+ -- ok is true, whew, just return the rest of the values
+ return table.unpack(ok_result, 2)
+end
+
+-- yield to other coroutines even if you don't know whether you're in a
+-- created coroutine or the main coroutine
+function coro.yield(...)
+ if coroutine.running() then
+ -- this is a real coroutine, yield normally
+ return coroutine.yield(...)
+ else
+ -- This is the main coroutine: coroutine.yield() doesn't work.
+ -- But we can take a spin through previously-launched coroutines.
+ -- Walk a copy of coro._coros in case any of these coroutines launches
+ -- another: next() forbids creating new entries during traversal.
+ for co in coro._live_coros_iter, table.clone(coro._coros) do
+ coro.resume(co)
+ end
+ end
+end
+
+-- Walk coro._coros table, returning running or suspended coroutines.
+-- Once a coroutine becomes dead, remove it from _coros and don't return it.
+function coro._live_coros()
+ return coro._live_coros_iter, coro._coros
+end
+
+-- iterator function for _live_coros()
+function coro._live_coros_iter(t, idx)
+ local k, co = next(t, idx)
+ while k and coroutine.status(co) == 'dead' do
+-- t[k] = nil
+ -- See coro.yield(): sometimes we traverse a copy of _coros, but if we
+ -- discover a dead coroutine in that copy, delete it from _coros
+ -- anyway. Deleting it from a temporary copy does nothing.
+ coro._coros[k] = nil
+ coroutine.close(co)
+ k, co = next(t, k)
+ end
+ return co
+end
+
+return coro
diff --git a/indra/newview/scripts/lua/require/fiber.lua b/indra/newview/scripts/lua/require/fiber.lua
new file mode 100644
index 0000000000..b3c684dd67
--- /dev/null
+++ b/indra/newview/scripts/lua/require/fiber.lua
@@ -0,0 +1,346 @@
+-- Organize Lua coroutines into fibers.
+
+-- In this usage, the difference between coroutines and fibers is that fibers
+-- have a scheduler. Yielding a fiber means allowing other fibers, plural, to
+-- run: it's more than just returning control to the specific Lua thread that
+-- resumed the running coroutine.
+
+-- fiber.launch() creates a new fiber ready to run.
+-- fiber.status() reports (augmented) status of the passed fiber: instead of
+-- 'suspended', it returns either 'ready' or 'waiting'
+-- fiber.yield() allows other fibers to run, but leaves the calling fiber
+-- ready to run.
+-- fiber.wait() marks the running fiber not ready, and resumes other fibers.
+-- fiber.wake() marks the designated suspended fiber ready to run, but does
+-- not yet resume it.
+-- fiber.run() runs all current fibers until all have terminated (successfully
+-- or with an error).
+
+local printf = require 'printf'
+local function dbg(...) end
+-- local dbg = printf
+local coro = require 'coro'
+
+local fiber = {}
+
+-- The tables in which we track fibers must have weak keys so dead fibers
+-- can be garbage-collected.
+local weak_values = {__mode='v'}
+local weak_keys = {__mode='k'}
+
+-- Track each current fiber as being either ready to run or not ready
+-- (waiting). wait() moves the running fiber from ready to waiting; wake()
+-- moves the designated fiber from waiting back to ready.
+-- The ready table is used as a list so yield() can go round robin.
+local ready = setmetatable({'main'}, weak_keys)
+-- The waiting table is used as a set because order doesn't matter.
+local waiting = setmetatable({}, weak_keys)
+
+-- Every fiber has a name, for diagnostic purposes. Names must be unique.
+-- A colliding name will be suffixed with an integer.
+-- Predefine 'main' with our marker so nobody else claims that name.
+local names = setmetatable({main='main'}, weak_keys)
+local byname = setmetatable({main='main'}, weak_values)
+-- each colliding name has its own distinct suffix counter
+local suffix = {}
+
+-- Specify a nullary idle() callback to be called whenever there are no ready
+-- fibers but there are waiting fibers. The idle() callback is responsible for
+-- changing zero or more waiting fibers to ready fibers by calling
+-- fiber.wake(), although a given call may leave them all still waiting.
+-- When there are no ready fibers, it's a good idea for the idle() function to
+-- return control to a higher-level execution agent. Simply returning without
+-- changing any fiber's status will spin the CPU.
+-- The idle() callback can return non-nil to exit fiber.run() with that value.
+function fiber._idle()
+ error('fiber.yield(): you must first call set_idle(nullary idle() function)')
+end
+
+function fiber.set_idle(func)
+ fiber._idle = func
+end
+
+-- Launch a new Lua fiber, ready to run.
+function fiber.launch(name, func, ...)
+ local args = table.pack(...)
+ local co = coroutine.create(function() func(table.unpack(args)) end)
+ -- a new fiber is ready to run
+ table.insert(ready, co)
+ local namekey = name
+ while byname[namekey] do
+ if not suffix[name] then
+ suffix[name] = 1
+ end
+ suffix[name] += 1
+ namekey = name .. tostring(suffix[name])
+ end
+ -- found a namekey not yet in byname: set it
+ byname[namekey] = co
+ -- and remember it as this fiber's name
+ names[co] = namekey
+-- dbg('launch(%s)', namekey)
+-- dbg('byname[%s] = %s', namekey, tostring(byname[namekey]))
+-- dbg('names[%s] = %s', tostring(co), names[co])
+-- dbg('ready[-1] = %s', tostring(ready[#ready]))
+end
+
+-- for debugging
+function format_all()
+ output = {}
+ table.insert(output, 'Ready fibers:' .. if next(ready) then '' else ' none')
+ for _, co in pairs(ready) do
+ table.insert(output, string.format(' %s: %s', fiber.get_name(co), fiber.status(co)))
+ end
+ table.insert(output, 'Waiting fibers:' .. if next(waiting) then '' else ' none')
+ for co in pairs(waiting) do
+ table.insert(output, string.format(' %s: %s', fiber.get_name(co), fiber.status(co)))
+ end
+ return table.concat(output, '\n')
+end
+
+function fiber.print_all()
+ print(format_all())
+end
+
+-- return either the running coroutine or, if called from the main thread,
+-- 'main'
+function fiber.running()
+ return coroutine.running() or 'main'
+end
+
+-- Query a fiber's name (nil for the running fiber)
+function fiber.get_name(co)
+ return names[co or fiber.running()] or 'unknown'
+end
+
+-- Query status of the passed fiber
+function fiber.status(co)
+ local running = coroutine.running()
+ if (not co) or co == running then
+ -- silly to ask the status of the running fiber: it's 'running'
+ return 'running'
+ end
+ if co ~= 'main' then
+ -- for any coroutine but main, consult coroutine.status()
+ local status = coroutine.status(co)
+ if status ~= 'suspended' then
+ return status
+ end
+ -- here co is suspended, answer needs further refinement
+ else
+ -- co == 'main'
+ if not running then
+ -- asking about 'main' from the main fiber
+ return 'running'
+ end
+ -- asking about 'main' from some other fiber, so presumably main is suspended
+ end
+ -- here we know co is suspended -- but is it ready to run?
+ if waiting[co] then
+ return 'waiting'
+ end
+ -- not waiting should imply ready: sanity check
+ if table.find(ready, co) then
+ return 'ready'
+ end
+ -- Calls within yield() between popping the next ready fiber and
+ -- re-appending it to the list are in this state. Once we're done
+ -- debugging yield(), we could reinstate either of the below.
+-- error(string.format('fiber.status(%s) is stumped', fiber.get_name(co)))
+-- print(string.format('*** fiber.status(%s) is stumped', fiber.get_name(co)))
+ return '(unknown)'
+end
+
+-- change the running fiber's status to waiting
+local function set_waiting()
+ -- if called from the main fiber, inject a 'main' marker into the list
+ co = fiber.running()
+ -- delete from ready list
+ local i = table.find(ready, co)
+ if i then
+ table.remove(ready, i)
+ end
+ -- add to waiting list
+ waiting[co] = true
+end
+
+-- Suspend the current fiber until some other fiber calls fiber.wake() on it
+function fiber.wait()
+ dbg('Fiber %q waiting', fiber.get_name())
+ set_waiting()
+ -- now yield to other fibers
+ fiber.yield()
+end
+
+-- Mark a suspended fiber as being ready to run
+function fiber.wake(co)
+ if not waiting[co] then
+ error(string.format('fiber.wake(%s) but status=%s, ready=%s, waiting=%s',
+ names[co], fiber.status(co), ready[co], waiting[co]))
+ end
+ -- delete from waiting list
+ waiting[co] = nil
+ -- add to end of ready list
+ table.insert(ready, co)
+ dbg('Fiber %q ready', fiber.get_name(co))
+ -- but don't yet resume it: that happens next time we reach yield()
+end
+
+-- pop and return the next not-dead fiber in the ready list, or nil if none remain
+local function live_ready_iter()
+ -- don't write:
+ -- for co in table.remove, ready, 1
+ -- because it would keep passing a new second parameter!
+ for co in function() return table.remove(ready, 1) end do
+ dbg('%s live_ready_iter() sees %s, status %s',
+ fiber.get_name(), fiber.get_name(co), fiber.status(co))
+ -- keep removing the head entry until we find one that's not dead,
+ -- discarding any dead coroutines along the way
+ if co == 'main' or coroutine.status(co) ~= 'dead' then
+ dbg('%s live_ready_iter() returning %s',
+ fiber.get_name(), fiber.get_name(co))
+ return co
+ end
+ end
+ dbg('%s live_ready_iter() returning nil', fiber.get_name())
+ return nil
+end
+
+-- prune the set of waiting fibers
+local function prune_waiting()
+ for waiter in pairs(waiting) do
+ if waiter ~= 'main' and coroutine.status(waiter) == 'dead' then
+ waiting[waiter] = nil
+ end
+ end
+end
+
+-- Run other ready fibers, leaving this one ready, returning after a cycle.
+-- Returns:
+-- * true, nil if there remain other live fibers, whether ready or waiting,
+-- but it's our turn to run
+-- * false, nil if this is the only remaining fiber
+-- * nil, x if configured idle() callback returns non-nil x
+local function scheduler()
+ dbg('scheduler():\n%s', format_all())
+ -- scheduler() is asymmetric because Lua distinguishes the main thread
+ -- from other coroutines. The main thread can't yield; it can only resume
+ -- other coroutines. So although an arbitrary coroutine could resume still
+ -- other arbitrary coroutines, it could NOT resume the main thread because
+ -- the main thread can't yield. Therefore, scheduler() delegates its real
+ -- processing to the main thread. If called from a coroutine, pass control
+ -- back to the main thread.
+ if coroutine.running() then
+ -- this is a real coroutine, yield normally to main thread
+ coroutine.yield()
+ -- main certainly still exists
+ return true
+ end
+
+ -- This is the main fiber: coroutine.yield() doesn't work.
+ -- Instead, resume each of the ready fibers.
+ -- Prune the set of waiting fibers after every time fiber business logic
+ -- runs (i.e. other fibers might have terminated or hit error), such as
+ -- here on entry.
+ prune_waiting()
+ local others, idle_stop
+ repeat
+ for co in live_ready_iter do
+ -- seize the opportunity to make sure the viewer isn't shutting down
+ LL.check_stop()
+ -- before we re-append co, is it the only remaining entry?
+ others = next(ready)
+ -- co is live, re-append it to the ready list
+ table.insert(ready, co)
+ if co == 'main' then
+ -- Since we know the caller is the main fiber, it's our turn.
+ -- Tell caller if there are other ready or waiting fibers.
+ return others or next(waiting)
+ end
+ -- not main, but some other ready coroutine:
+ -- use coro.resume() so we'll propagate any error encountered
+ coro.resume(co)
+ prune_waiting()
+ end
+ -- Here there are no ready fibers. Are there any waiting fibers?
+ if not next(waiting) then
+ return false
+ end
+ -- there are waiting fibers: call consumer's configured idle() function
+ idle_stop = fiber._idle()
+ if idle_stop ~= nil then
+ return nil, idle_stop
+ end
+ prune_waiting()
+ -- loop "forever", that is, until:
+ -- * main is ready, or
+ -- * there are neither ready fibers nor waiting fibers, or
+ -- * fiber._idle() returned non-nil
+ until false
+end
+
+-- Let other fibers run. This is useful in either of two cases:
+-- * fiber.wait() calls this to run other fibers while this one is waiting.
+-- fiber.yield() (and therefore fiber.wait()) works from the main thread as
+-- well as from explicitly-launched fibers, without the caller having to
+-- care.
+-- * A long-running fiber that doesn't often call fiber.wait() should sprinkle
+-- in fiber.yield() calls to interleave processing on other fibers.
+function fiber.yield()
+ -- The difference between this and fiber.run() is that fiber.yield()
+ -- assumes its caller has work to do. yield() returns to its caller as
+ -- soon as scheduler() pops this fiber from the ready list. fiber.run()
+ -- continues looping until all other fibers have terminated, or the
+ -- set_idle() callback tells it to stop.
+ local others, idle_done = scheduler()
+ -- scheduler() returns either if we're ready, or if idle_done ~= nil.
+ if idle_done ~= nil then
+ -- Returning normally from yield() means the caller can carry on with
+ -- its pending work. But in this case scheduler() returned because the
+ -- configured set_idle() function interrupted it -- not because we're
+ -- actually ready. Don't return normally.
+ error('fiber.set_idle() interrupted yield() with: ' .. tostring(idle_done))
+ end
+ -- We're ready! Just return to caller. In this situation we don't care
+ -- whether there are other ready fibers.
+ dbg('fiber.yield() returning to %s (%sothers are ready)',
+ fiber.get_name(), ((not others) and "no " or ""))
+end
+
+-- Run fibers until all but main have terminated: return nil.
+-- Or until configured idle() callback returns x ~= nil: return x.
+function fiber.run()
+ -- A fiber calling run() is not also doing other useful work. Remove the
+ -- calling fiber from the ready list. Otherwise yield() would keep seeing
+ -- that our caller is ready and return to us, instead of realizing that
+ -- all coroutines are waiting and call idle(). But don't say we're
+ -- waiting, either, because then when all other fibers have terminated
+ -- we'd call idle() forever waiting for something to make us ready again.
+ local i = table.find(ready, fiber.running())
+ if i then
+ table.remove(ready, i)
+ end
+ local others, idle_done
+ repeat
+ dbg('%s calling fiber.run() calling scheduler()', fiber.get_name())
+ others, idle_done = scheduler()
+ dbg("%s fiber.run()'s scheduler() returned %s, %s", fiber.get_name(),
+ tostring(others), tostring(idle_done))
+ until (not others)
+ dbg('%s fiber.run() done', fiber.get_name())
+ -- For whatever it's worth, put our own fiber back in the ready list.
+ table.insert(ready, fiber.running())
+ -- Once there are no more waiting fibers, and the only ready fiber is
+ -- us, return to caller. All previously-launched fibers are done. Possibly
+ -- the chunk is done, or the chunk may decide to launch a new batch of
+ -- fibers.
+ return idle_done
+end
+
+-- Make sure we finish up with a call to run(). That allows a consuming script
+-- to kick off some number of fibers, do some work on the main thread and then
+-- fall off the end of the script without explicitly calling fiber.run().
+-- run() ensures the rest of the fibers run to completion (or error).
+LL.atexit(fiber.run)
+
+return fiber
diff --git a/indra/newview/scripts/lua/require/inspect.lua b/indra/newview/scripts/lua/require/inspect.lua
new file mode 100644
index 0000000000..9900a0b81b
--- /dev/null
+++ b/indra/newview/scripts/lua/require/inspect.lua
@@ -0,0 +1,371 @@
+local _tl_compat; if (tonumber((_VERSION or ''):match('[%d.]*$')) or 0) < 5.3 then local p, m = pcall(require, 'compat53.module'); if p then _tl_compat = m end end; local math = _tl_compat and _tl_compat.math or math; local string = _tl_compat and _tl_compat.string or string; local table = _tl_compat and _tl_compat.table or table
+local inspect = {Options = {}, }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+inspect._VERSION = 'inspect.lua 3.1.0'
+inspect._URL = 'http://github.com/kikito/inspect.lua'
+inspect._DESCRIPTION = 'human-readable representations of tables'
+inspect._LICENSE = [[
+ MIT LICENSE
+
+ Copyright (c) 2022 Enrique García Cota
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+]]
+inspect.KEY = setmetatable({}, { __tostring = function() return 'inspect.KEY' end })
+inspect.METATABLE = setmetatable({}, { __tostring = function() return 'inspect.METATABLE' end })
+
+local tostring = tostring
+local rep = string.rep
+local match = string.match
+local char = string.char
+local gsub = string.gsub
+local fmt = string.format
+
+local _rawget
+if rawget then
+ _rawget = rawget
+else
+ _rawget = function(t, k) return t[k] end
+end
+
+local function rawpairs(t)
+ return next, t, nil
+end
+
+
+
+local function smartQuote(str)
+ if match(str, '"') and not match(str, "'") then
+ return "'" .. str .. "'"
+ end
+ return '"' .. gsub(str, '"', '\\"') .. '"'
+end
+
+
+local shortControlCharEscapes = {
+ ["\a"] = "\\a", ["\b"] = "\\b", ["\f"] = "\\f", ["\n"] = "\\n",
+ ["\r"] = "\\r", ["\t"] = "\\t", ["\v"] = "\\v", ["\127"] = "\\127",
+}
+local longControlCharEscapes = { ["\127"] = "\127" }
+for i = 0, 31 do
+ local ch = char(i)
+ if not shortControlCharEscapes[ch] then
+ shortControlCharEscapes[ch] = "\\" .. i
+ longControlCharEscapes[ch] = fmt("\\%03d", i)
+ end
+end
+
+local function escape(str)
+ return (gsub(gsub(gsub(str, "\\", "\\\\"),
+ "(%c)%f[0-9]", longControlCharEscapes),
+ "%c", shortControlCharEscapes))
+end
+
+local luaKeywords = {
+ ['and'] = true,
+ ['break'] = true,
+ ['do'] = true,
+ ['else'] = true,
+ ['elseif'] = true,
+ ['end'] = true,
+ ['false'] = true,
+ ['for'] = true,
+ ['function'] = true,
+ ['goto'] = true,
+ ['if'] = true,
+ ['in'] = true,
+ ['local'] = true,
+ ['nil'] = true,
+ ['not'] = true,
+ ['or'] = true,
+ ['repeat'] = true,
+ ['return'] = true,
+ ['then'] = true,
+ ['true'] = true,
+ ['until'] = true,
+ ['while'] = true,
+}
+
+local function isIdentifier(str)
+ return type(str) == "string" and
+ not not str:match("^[_%a][_%a%d]*$") and
+ not luaKeywords[str]
+end
+
+local flr = math.floor
+local function isSequenceKey(k, sequenceLength)
+ return type(k) == "number" and
+ flr(k) == k and
+ 1 <= (k) and
+ k <= sequenceLength
+end
+
+local defaultTypeOrders = {
+ ['number'] = 1, ['boolean'] = 2, ['string'] = 3, ['table'] = 4,
+ ['function'] = 5, ['userdata'] = 6, ['thread'] = 7,
+}
+
+local function sortKeys(a, b)
+ local ta, tb = type(a), type(b)
+
+
+ if ta == tb and (ta == 'string' or ta == 'number') then
+ return (a) < (b)
+ end
+
+ local dta = defaultTypeOrders[ta] or 100
+ local dtb = defaultTypeOrders[tb] or 100
+
+
+ return dta == dtb and ta < tb or dta < dtb
+end
+
+local function getKeys(t)
+
+ local seqLen = 1
+ while _rawget(t, seqLen) ~= nil do
+ seqLen = seqLen + 1
+ end
+ seqLen = seqLen - 1
+
+ local keys, keysLen = {}, 0
+ for k in rawpairs(t) do
+ if not isSequenceKey(k, seqLen) then
+ keysLen = keysLen + 1
+ keys[keysLen] = k
+ end
+ end
+ table.sort(keys, sortKeys)
+ return keys, keysLen, seqLen
+end
+
+local function countCycles(x, cycles)
+ if type(x) == "table" then
+ if cycles[x] then
+ cycles[x] = cycles[x] + 1
+ else
+ cycles[x] = 1
+ for k, v in rawpairs(x) do
+ countCycles(k, cycles)
+ countCycles(v, cycles)
+ end
+ countCycles(getmetatable(x), cycles)
+ end
+ end
+end
+
+local function makePath(path, a, b)
+ local newPath = {}
+ local len = #path
+ for i = 1, len do newPath[i] = path[i] end
+
+ newPath[len + 1] = a
+ newPath[len + 2] = b
+
+ return newPath
+end
+
+
+local function processRecursive(process,
+ item,
+ path,
+ visited)
+ if item == nil then return nil end
+ if visited[item] then return visited[item] end
+
+ local processed = process(item, path)
+ if type(processed) == "table" then
+ local processedCopy = {}
+ visited[item] = processedCopy
+ local processedKey
+
+ for k, v in rawpairs(processed) do
+ processedKey = processRecursive(process, k, makePath(path, k, inspect.KEY), visited)
+ if processedKey ~= nil then
+ processedCopy[processedKey] = processRecursive(process, v, makePath(path, processedKey), visited)
+ end
+ end
+
+ local mt = processRecursive(process, getmetatable(processed), makePath(path, inspect.METATABLE), visited)
+ if type(mt) ~= 'table' then mt = nil end
+ setmetatable(processedCopy, mt)
+ processed = processedCopy
+ end
+ return processed
+end
+
+local function puts(buf, str)
+ buf.n = buf.n + 1
+ buf[buf.n] = str
+end
+
+
+
+local Inspector = {}
+
+
+
+
+
+
+
+
+
+
+local Inspector_mt = { __index = Inspector }
+
+local function tabify(inspector)
+ puts(inspector.buf, inspector.newline .. rep(inspector.indent, inspector.level))
+end
+
+function Inspector:getId(v)
+ local id = self.ids[v]
+ local ids = self.ids
+ if not id then
+ local tv = type(v)
+ id = (ids[tv] or 0) + 1
+ ids[v], ids[tv] = id, id
+ end
+ return tostring(id)
+end
+
+function Inspector:putValue(v)
+ local buf = self.buf
+ local tv = type(v)
+ if tv == 'string' then
+ puts(buf, smartQuote(escape(v)))
+ elseif tv == 'number' or tv == 'boolean' or tv == 'nil' or
+ tv == 'cdata' or tv == 'ctype' then
+ puts(buf, tostring(v))
+ elseif tv == 'table' and not self.ids[v] then
+ local t = v
+
+ if t == inspect.KEY or t == inspect.METATABLE then
+ puts(buf, tostring(t))
+ elseif self.level >= self.depth then
+ puts(buf, '{...}')
+ else
+ if self.cycles[t] > 1 then puts(buf, fmt('<%d>', self:getId(t))) end
+
+ local keys, keysLen, seqLen = getKeys(t)
+
+ puts(buf, '{')
+ self.level = self.level + 1
+
+ for i = 1, seqLen + keysLen do
+ if i > 1 then puts(buf, ',') end
+ if i <= seqLen then
+ puts(buf, ' ')
+ self:putValue(t[i])
+ else
+ local k = keys[i - seqLen]
+ tabify(self)
+ if isIdentifier(k) then
+ puts(buf, k)
+ else
+ puts(buf, "[")
+ self:putValue(k)
+ puts(buf, "]")
+ end
+ puts(buf, ' = ')
+ self:putValue(t[k])
+ end
+ end
+
+ local mt = getmetatable(t)
+ if type(mt) == 'table' then
+ if seqLen + keysLen > 0 then puts(buf, ',') end
+ tabify(self)
+ puts(buf, '<metatable> = ')
+ self:putValue(mt)
+ end
+
+ self.level = self.level - 1
+
+ if keysLen > 0 or type(mt) == 'table' then
+ tabify(self)
+ elseif seqLen > 0 then
+ puts(buf, ' ')
+ end
+
+ puts(buf, '}')
+ end
+
+ else
+ puts(buf, fmt('<%s %d>', tv, self:getId(v)))
+ end
+end
+
+
+
+
+function inspect.inspect(root, options)
+ options = options or {}
+
+ local depth = options.depth or (math.huge)
+ local newline = options.newline or '\n'
+ local indent = options.indent or ' '
+ local process = options.process
+
+ if process then
+ root = processRecursive(process, root, {}, {})
+ end
+
+ local cycles = {}
+ countCycles(root, cycles)
+
+ local inspector = setmetatable({
+ buf = { n = 0 },
+ ids = {},
+ cycles = cycles,
+ depth = depth,
+ level = 0,
+ newline = newline,
+ indent = indent,
+ }, Inspector_mt)
+
+ inspector:putValue(root)
+
+ return table.concat(inspector.buf)
+end
+
+setmetatable(inspect, {
+ __call = function(_, root, options)
+ return inspect.inspect(root, options)
+ end,
+})
+
+return inspect
diff --git a/indra/newview/scripts/lua/require/leap.lua b/indra/newview/scripts/lua/require/leap.lua
new file mode 100644
index 0000000000..82f91ce9e9
--- /dev/null
+++ b/indra/newview/scripts/lua/require/leap.lua
@@ -0,0 +1,550 @@
+-- Lua implementation of LEAP (LLSD Event API Plugin) protocol
+--
+-- This module supports Lua scripts run by the Second Life viewer.
+--
+-- LEAP protocol passes LLSD objects, converted to/from Lua tables, in both
+-- directions. A typical LLSD object is a map containing keys 'pump' and
+-- 'data'.
+--
+-- The viewer's Lua post_to(pump, data) function posts 'data' to the
+-- LLEventPump 'pump'. This is typically used to engage an LLEventAPI method.
+--
+-- Similarly, the viewer gives each Lua script its own LLEventPump with a
+-- unique name. That name is returned by get_event_pumps(). Every event
+-- received on that LLEventPump is queued for retrieval by get_event_next(),
+-- which returns (pump, data): the name of the LLEventPump on which the event
+-- was received and the received event data. When the queue is empty,
+-- get_event_next() blocks the calling Lua script until the next event is
+-- received.
+--
+-- Usage:
+-- 1. Launch some number of Lua coroutines. The code in each coroutine may
+-- call leap.send(), leap.request() or leap.generate(). leap.send() returns
+-- immediately ("fire and forget"). leap.request() blocks the calling
+-- coroutine until it receives and returns the viewer's response to its
+-- request. leap.generate() expects an arbitrary number of responses to the
+-- original request.
+-- 2. To handle events from the viewer other than direct responses to
+-- requests, instantiate a leap.WaitFor object with a filter(pump, data)
+-- override method that returns non-nil for desired events. A coroutine may
+-- call wait() on any such WaitFor.
+-- 3. Once the coroutines have been launched, call leap.process() on the main
+-- coroutine. process() retrieves incoming events from the viewer and
+-- dispatches them to waiting request() or generate() calls, or to
+-- appropriate WaitFor instances. process() returns when either
+-- get_event_next() raises an error or the viewer posts nil to the script's
+-- reply pump to indicate it's done.
+-- 4. Alternatively, a running coroutine may call leap.done() to break out of
+-- leap.process(). process() won't notice until the next event from the
+-- viewer, though.
+
+local fiber = require('fiber')
+local ErrorQueue = require('ErrorQueue')
+local inspect = require('inspect')
+local function dbg(...) end
+-- local dbg = require('printf')
+local util = require('util')
+
+local leap = {}
+
+-- reply: string name of reply LLEventPump. Any events the viewer posts to
+-- this pump will be queued for get_event_next(). We usually specify it as the
+-- reply pump for requests to internal viewer services.
+-- command: string name of command LLEventPump. post_to(command, ...)
+-- engages LLLeapListener operations such as listening on a specified other
+-- LLEventPump, etc.
+local reply, command = LL.get_event_pumps()
+-- Dict of features added to the LEAP protocol since baseline implementation.
+-- Before engaging a new feature that might break an older viewer, we can
+-- check for the presence of that feature key. This table is solely about the
+-- LEAP protocol itself, the way we communicate with the viewer. To discover
+-- whether a given listener exists, or supports a particular operation, use
+-- command's "getAPI" operation.
+-- For Lua, command's "getFeatures" operation suffices?
+-- leap._features = {}
+
+-- Each outstanding request() or generate() call has a corresponding
+-- WaitForReqid object (later in this module) to handle the
+-- response(s). If an incoming event contains an echoed ["reqid"] key,
+-- we can look up the appropriate WaitForReqid object more efficiently
+-- in a dict than by tossing such objects into the usual waitfors list.
+-- Note: the ["reqid"] must be unique, otherwise we could end up
+-- replacing an earlier WaitForReqid object in pending with a
+-- later one. That means that no incoming event will ever be given to
+-- the old WaitForReqid object. Any coroutine waiting on the discarded
+-- WaitForReqid object would therefore wait forever.
+-- pending is NOT a weak table because the caller of request() or generate()
+-- never sees the WaitForReqid object. pending holds the only reference, so
+-- it should NOT be garbage-collected.
+local pending = {}
+-- Our consumer will instantiate some number of WaitFor subclass objects.
+-- As these are traversed in descending priority order, we must keep
+-- them in a list.
+-- Anyone who instantiates a WaitFor subclass object should retain a reference
+-- to it. Once the consuming script drops the reference, allow Lua to
+-- garbage-collect the WaitFor despite its entry in waitfors.
+local weak_values = {__mode='v'}
+local waitfors = setmetatable({}, weak_values)
+-- It has been suggested that we should use UUIDs as ["reqid"] values,
+-- since UUIDs are guaranteed unique. However, as the "namespace" for
+-- ["reqid"] values is our very own reply pump, we can get away with
+-- an integer.
+leap._reqid = 0
+-- break leap.process() loop
+leap._done = false
+
+-- get the name of the reply pump
+function leap.replypump()
+ return reply
+end
+
+-- get the name of the command pump
+function leap.cmdpump()
+ return command
+end
+
+-- Fire and forget. Send the specified request LLSD, expecting no reply.
+-- In fact, should the request produce an eventual reply, it will be
+-- treated as an unsolicited event.
+--
+-- See also request(), generate().
+function leap.send(pump, data, reqid)
+ local data = data
+ if type(data) == 'table' then
+ data = table.clone(data)
+ data['reply'] = reply
+ if reqid ~= nil then
+ data['reqid'] = reqid
+ end
+ end
+ dbg('leap.send(%s, %s) calling post_on()', pump, data)
+ LL.post_on(pump, data)
+end
+
+-- common setup code shared by request() and generate()
+local function requestSetup(pump, data)
+ -- invent a new, unique reqid
+ leap._reqid += 1
+ local reqid = leap._reqid
+ -- Instantiate a new WaitForReqid object. The priority is irrelevant
+ -- because, unlike the WaitFor base class, WaitForReqid does not
+ -- self-register on our waitfors list. Instead, capture the new
+ -- WaitForReqid object in pending so dispatch() can find it.
+ local waitfor = leap.WaitForReqid(reqid)
+ pending[reqid] = waitfor
+ -- Pass reqid to send() to stamp it into (a copy of) the request data.
+ dbg('requestSetup(%s, %s) storing %s', pump, data, waitfor.name)
+ leap.send(pump, data, reqid)
+ return reqid, waitfor
+end
+
+-- Send the specified request LLSD, expecting exactly one reply. Block
+-- the calling coroutine until we receive that reply.
+--
+-- Every request() (or generate()) LLSD block we send will get stamped
+-- with a distinct ["reqid"] value. The requested event API must echo the
+-- same ["reqid"] field in each reply associated with that request. This way
+-- we can correctly dispatch interleaved replies from different requests.
+--
+-- If the desired event API doesn't support the ["reqid"] echo convention,
+-- you should use send() instead -- since request() or generate() would
+-- wait forever for a reply stamped with that ["reqid"] -- and intercept
+-- any replies using WaitFor.
+--
+-- Unless the request data already contains a ["reply"] key, we insert
+-- reply=self.replypump to try to ensure that the expected reply will be
+-- returned over the socket.
+--
+-- See also send(), generate().
+function leap.request(pump, data)
+ local reqid, waitfor = requestSetup(pump, data)
+ dbg('leap.request(%s, %s) about to wait on %s', pump, data, tostring(waitfor))
+ local ok, response = pcall(waitfor.wait, waitfor)
+ dbg('leap.request(%s, %s) got %s: %s', pump, data, ok, response)
+ -- kill off temporary WaitForReqid object, even if error
+ pending[reqid] = nil
+ if not ok then
+ error(response)
+ elseif response.error then
+ error(response.error)
+ else
+ return response
+ end
+end
+
+-- Send the specified request LLSD, expecting an arbitrary number of replies.
+-- Each one is returned on request.
+--
+-- Usage:
+-- sequence = leap.generate(pump, data)
+-- repeat
+-- response = sequence.next()
+-- until last(response)
+-- (last() means whatever test the caller wants to perform on response)
+-- sequence.done()
+--
+-- See request() remarks about ["reqid"].
+--
+-- Note: this seems like a prime use case for Lua coroutines. But in a script
+-- using fibers.lua, a "wild" coroutine confuses the fiber scheduler. If
+-- generate() were itself a coroutine, it would call WaitForReqid:wait(),
+-- which would yield -- thereby resuming generate() WITHOUT waiting.
+function leap.generate(pump, data, checklast)
+ -- Invent a new, unique reqid. Arrange to handle incoming events
+ -- bearing that reqid. Stamp the outbound request with that reqid, and
+ -- send it.
+ local reqid, waitfor = requestSetup(pump, data)
+ return {
+ next = function()
+ dbg('leap.generate(%s).next() about to wait on %s', reqid, tostring(waitfor))
+ local ok, response = pcall(waitfor.wait, waitfor)
+ dbg('leap.generate(%s).next() got %s: %s', reqid, ok, response)
+ if not ok then
+ error(response)
+ elseif response.error then
+ error(response.error)
+ else
+ return response
+ end
+ end,
+ done = function()
+ -- cleanup consists of removing our WaitForReqid from pending
+ pending[reqid] = nil
+ end
+ }
+end
+
+-- Send the specified request LLSD, expecting an immediate reply followed by
+-- an arbitrary number of subsequent replies with the same reqid. Block the
+-- calling coroutine until the first (immediate) reply, but launch a separate
+-- fiber on which to call the passed callback with later replies.
+--
+-- Once the callback returns true, the background fiber terminates.
+function leap.eventstream(pump, data, callback)
+ local reqid, waitfor = requestSetup(pump, data)
+ local response = waitfor:wait()
+ if response.error then
+ -- clean up our WaitForReqid
+ waitfor:close()
+ error(response.error)
+ end
+ -- No error, so far so good:
+ -- call the callback with the first response just in case
+ dbg('leap.eventstream(%s): first callback', reqid)
+ local ok, done = pcall(callback, response)
+ dbg('leap.eventstream(%s) got %s, %s', reqid, ok, done)
+ if not ok then
+ -- clean up our WaitForReqid
+ waitfor:close()
+ error(done)
+ end
+ if done then
+ return response
+ end
+ -- callback didn't throw an error, and didn't say stop,
+ -- so set up to handle subsequent events
+ -- TODO: distinguish "daemon" fibers that can be terminated even if waiting
+ fiber.launch(
+ pump,
+ function ()
+ local ok, done
+ local nth = 1
+ repeat
+ event = waitfor:wait()
+ if not event then
+ -- wait() returns nil once the queue is closed (e.g. cancelreq())
+ ok, done = true, true
+ else
+ nth += 1
+ dbg('leap.eventstream(%s): callback %d', reqid, nth)
+ ok, done = pcall(callback, event)
+ dbg('leap.eventstream(%s) got %s, %s', reqid, ok, done)
+ end
+ -- not ok means callback threw an error (caught as 'done')
+ -- done means callback succeeded but wants to stop
+ until (not ok) or done
+ -- once we break this loop, clean up our WaitForReqid
+ waitfor:close()
+ if not ok then
+ -- can't reflect the error back to our caller
+ LL.print_warning(fiber.get_name() .. ': ' .. done)
+ end
+ end)
+ return response
+end
+
+-- we might want to clean up after leap.eventstream() even if the callback has
+-- not yet returned true
+function leap.cancelreq(reqid)
+ dbg('cancelreq(%s)', reqid)
+ local waitfor = pending[reqid]
+ if waitfor ~= nil then
+ -- close() removes the pending entry and also closes the queue,
+ -- breaking the background fiber's wait loop.
+ dbg('cancelreq(%s) canceling %s', reqid, waitfor.name)
+ waitfor:close()
+ end
+end
+
+local function cleanup(message)
+ -- We're done: clean up all pending coroutines.
+ -- Iterate over copies of the pending and waitfors tables, since the
+ -- close() operation modifies the real tables.
+ for i, waitfor in pairs(table.clone(pending)) do
+ waitfor:close()
+ end
+ for i, waitfor in pairs(table.clone(waitfors)) do
+ waitfor:close()
+ end
+end
+
+-- Handle an incoming (pump, data) event with no recognizable ['reqid']
+local function unsolicited(pump, data)
+ -- we maintain waitfors in descending priority order, so the first waitfor
+ -- to claim this event is the one with the highest priority
+ for i, waitfor in pairs(waitfors) do
+ dbg('unsolicited() checking %s', waitfor.name)
+ if waitfor:handle(pump, data) then
+ return
+ end
+ end
+ LL.print_debug(string.format('unsolicited(%s, %s) discarding unclaimed event',
+ pump, inspect(data)))
+end
+
+-- Route incoming (pump, data) event to the appropriate waiting coroutine.
+local function dispatch(pump, data)
+ local reqid = data['reqid']
+ -- if the response has no 'reqid', it's not from request() or generate()
+ if reqid == nil then
+-- dbg('dispatch() found no reqid; calling unsolicited(%s, %s)', pump, data)
+ return unsolicited(pump, data)
+ end
+ -- have reqid; do we have a WaitForReqid?
+ local waitfor = pending[reqid]
+ if waitfor == nil then
+-- dbg('dispatch() found no WaitForReqid(%s); calling unsolicited(%s, %s)', reqid, pump, data)
+ return unsolicited(pump, data)
+ end
+ -- found the right WaitForReqid object, let it handle the event
+-- dbg('dispatch() calling %s.handle(%s, %s)', waitfor.name, pump, data)
+ waitfor:handle(pump, data)
+end
+
+-- We configure fiber.set_idle() function. fiber.yield() calls the configured
+-- idle callback whenever there are waiting fibers but no ready fibers. In
+-- our case, that means it's time to fetch another incoming viewer event.
+fiber.set_idle(function ()
+ -- If someone has called leap.done(), then tell fiber.yield() to break loop.
+ if leap._done then
+ cleanup('done')
+ return 'done'
+ end
+ dbg('leap.idle() calling get_event_next()')
+ local ok, pump, data = pcall(LL.get_event_next)
+ dbg('leap.idle() got %s: %s, %s', ok, pump, data)
+ -- ok false means get_event_next() raised a Lua error, pump is message
+ if not ok then
+ cleanup(pump)
+ error(pump)
+ end
+ -- data nil means get_event_next() returned (pump, LLSD()) to indicate done
+ if not data then
+ cleanup('end')
+ return 'end'
+ end
+ -- got a real pump, data pair
+ dispatch(pump, data)
+ -- return to fiber.yield(): any incoming message might result in one or
+ -- more fibers becoming ready
+end)
+
+function leap.done()
+ leap._done = true
+end
+
+-- called by WaitFor.enable()
+local function registerWaitFor(waitfor)
+ table.insert(waitfors, waitfor)
+ -- keep waitfors sorted in descending order of specified priority
+ table.sort(waitfors,
+ function (lhs, rhs) return lhs.priority > rhs.priority end)
+end
+
+-- called by WaitFor.disable()
+local function unregisterWaitFor(waitfor)
+ local i = table.find(waitfors, waitfor)
+ if i ~= nil then
+ waitfors[i] = nil
+ end
+end
+
+-- ******************************************************************************
+-- WaitFor and friends
+-- ******************************************************************************
+
+-- An unsolicited event is handled by the highest-priority WaitFor subclass
+-- object willing to accept it. If no such object is found, the unsolicited
+-- event is discarded.
+--
+-- * First, instantiate a WaitFor subclass object to register its interest in
+-- some incoming event(s). WaitFor instances are self-registering; merely
+-- instantiating the object suffices.
+-- * Any coroutine may call a given WaitFor object's wait() method. This blocks
+-- the calling coroutine until a suitable event arrives.
+-- * WaitFor's constructor accepts a float priority. Every incoming event
+-- (other than those claimed by request() or generate()) is passed to each
+-- extant WaitFor.filter() method in descending priority order. The first
+-- such filter() to return nontrivial data claims that event.
+-- * At that point, the blocked wait() call on that WaitFor object returns the
+-- item returned by filter().
+-- * WaitFor contains a queue. Multiple arriving events claimed by that WaitFor
+-- object's filter() method are added to the queue. Naturally, until the
+-- queue is empty, calling wait() immediately returns the front entry.
+--
+-- It's reasonable to instantiate a WaitFor subclass whose filter() method
+-- unconditionally returns the incoming event, and whose priority places it
+-- last in the list. This object will enqueue every unsolicited event left
+-- unclaimed by other WaitFor subclass objects.
+--
+-- It's not strictly necessary to associate a WaitFor object with exactly one
+-- coroutine. You might have multiple "worker" coroutines drawing from the same
+-- WaitFor object, useful if the work being done per event might itself involve
+-- "blocking" operations. Or a given coroutine might sample a number of WaitFor
+-- objects in round-robin fashion... etc. etc. Nonetheless, it's
+-- straightforward to designate one coroutine for each WaitFor object.
+
+-- --------------------------------- WaitFor ---------------------------------
+leap.WaitFor = { _id=0 }
+
+function leap.WaitFor.tostring(self)
+ -- Lua (sub)classes have no name; can't prefix with that
+ return self.name
+end
+
+function leap.WaitFor:new(priority, name)
+ local obj = setmetatable({__tostring=leap.WaitFor.tostring}, self)
+ self.__index = self
+
+ obj.priority = priority
+ if name then
+ obj.name = name
+ else
+ self._id += 1
+ obj.name = 'WaitFor' .. self._id
+ end
+ obj._queue = ErrorQueue()
+ obj._registered = false
+ -- if no priority, then don't enable() - remember 0 is truthy
+ if priority then
+ obj:enable()
+ end
+
+ return obj
+end
+
+util.classctor(leap.WaitFor)
+
+-- Re-enable a disable()d WaitFor object. New WaitFor objects are
+-- enable()d by default.
+function leap.WaitFor:enable()
+ if not self._registered then
+ registerWaitFor(self)
+ self._registered = true
+ end
+end
+
+-- Disable an enable()d WaitFor object.
+function leap.WaitFor:disable()
+ if self._registered then
+ unregisterWaitFor(self)
+ self._registered = false
+ end
+end
+
+-- Block the calling coroutine until a suitable unsolicited event (one
+-- for which filter() returns the event) arrives.
+function leap.WaitFor:wait()
+ dbg('%s about to wait', self.name)
+ local item = self._queue:Dequeue()
+ dbg('%s got %s', self.name, item)
+ return item
+end
+
+-- Override filter() to examine the incoming event in whatever way
+-- makes sense.
+--
+-- Return nil to ignore this event.
+--
+-- To claim the event, return the item you want placed in the queue.
+-- Typically you'd write:
+-- return data
+-- or perhaps
+-- return {pump=pump, data=data}
+-- or some variation.
+function leap.WaitFor:filter(pump, data)
+ error('You must override the WaitFor.filter() method')
+end
+
+-- called by unsolicited() for each WaitFor in waitfors
+function leap.WaitFor:handle(pump, data)
+ local item = self:filter(pump, data)
+ dbg('%s.filter() returned %s', self.name, item)
+ -- if this item doesn't pass the filter, we're not interested
+ if not item then
+ return false
+ end
+ -- okay, filter() claims this event
+ self:process(item)
+ return true
+end
+
+-- called by WaitFor:handle() for an accepted event
+function leap.WaitFor:process(item)
+ self._queue:Enqueue(item)
+end
+
+-- called by cleanup() at end
+function leap.WaitFor:close()
+ self:disable()
+ self._queue:close()
+end
+
+-- called by leap.process() when get_event_next() raises an error
+function leap.WaitFor:exception(message)
+ LL.print_warning(self.name .. ' error: ' .. message)
+ self._queue:Error(message)
+end
+
+-- ------------------------------ WaitForReqid -------------------------------
+leap.WaitForReqid = leap.WaitFor()
+
+function leap.WaitForReqid:new(reqid)
+ -- priority is meaningless, since this object won't be added to the
+ -- priority-sorted waitfors list. Use the reqid as the debugging name
+ -- string.
+ local obj = leap.WaitFor(nil, 'WaitForReqid(' .. reqid .. ')')
+ setmetatable(obj, self)
+ self.__index = self
+
+ obj.reqid = reqid
+
+ return obj
+end
+
+util.classctor(leap.WaitForReqid)
+
+function leap.WaitForReqid:filter(pump, data)
+ -- Because we expect to directly look up the WaitForReqid object of
+ -- interest based on the incoming ["reqid"] value, it's not necessary
+ -- to test the event again. Accept every such event.
+ return data
+end
+
+function leap.WaitForReqid:close()
+ -- remove this entry from pending table
+ pending[self.reqid] = nil
+ self._queue:close()
+end
+
+return leap
diff --git a/indra/newview/scripts/lua/require/login.lua b/indra/newview/scripts/lua/require/login.lua
new file mode 100644
index 0000000000..37c9093a21
--- /dev/null
+++ b/indra/newview/scripts/lua/require/login.lua
@@ -0,0 +1,42 @@
+local leap = require 'leap'
+local startup = require 'startup'
+local mapargs = require 'mapargs'
+
+local login = {}
+
+local function ensure_login_state(op)
+ -- no point trying to login until the viewer is ready
+ startup.wait('STATE_LOGIN_WAIT')
+ -- Once we've actually started login, LLPanelLogin is destroyed, and so is
+ -- its "LLPanelLogin" listener. At that point,
+ -- leap.request("LLPanelLogin", ...) will hang indefinitely because no one
+ -- is listening on that LLEventPump any more. Intercept that case and
+ -- produce a sensible error.
+ local state = startup.state()
+ if startup.before('STATE_LOGIN_WAIT', state) then
+ error(`Can't engage login operation {op} once we've reached state {state}`, 2)
+ end
+end
+
+local function fullgrid(grid)
+ if string.find(grid, '.', 1, true) then
+ return grid
+ else
+ return `util.{grid}.secondlife.com`
+ end
+end
+
+function login.login(...)
+ ensure_login_state('login')
+ local args = mapargs('username,grid,slurl', ...)
+ args.op = 'login'
+ args.grid = fullgrid(args.grid)
+ return leap.request('LLPanelLogin', args)
+end
+
+function login.savedLogins(grid)
+ ensure_login_state('savedLogins')
+ return leap.request('LLPanelLogin', {op='savedLogins', grid=fullgrid(grid)})['logins']
+end
+
+return login
diff --git a/indra/newview/scripts/lua/require/logout.lua b/indra/newview/scripts/lua/require/logout.lua
new file mode 100644
index 0000000000..63dcd7f01f
--- /dev/null
+++ b/indra/newview/scripts/lua/require/logout.lua
@@ -0,0 +1,7 @@
+local leap = require 'leap'
+
+local function logout()
+ leap.send('LLAppViewer', {op='userQuit'});
+end
+
+return logout
diff --git a/indra/newview/scripts/lua/require/mapargs.lua b/indra/newview/scripts/lua/require/mapargs.lua
new file mode 100644
index 0000000000..45f5a9c556
--- /dev/null
+++ b/indra/newview/scripts/lua/require/mapargs.lua
@@ -0,0 +1,73 @@
+-- Allow a calling function to be passed a mix of positional arguments with
+-- keyword arguments. Reference them as fields of a table.
+-- Don't use this for a function that can accept a single table argument.
+-- mapargs() assumes that a single table argument means its caller was called
+-- with f{table constructor} syntax, and maps that table to the specified names.
+-- Usage:
+-- function f(...)
+-- local a = mapargs({'a1', 'a2', 'a3'}, ...)
+-- ... a.a1 ... etc.
+-- end
+-- f(10, 20, 30) -- a.a1 == 10, a.a2 == 20, a.a3 == 30
+-- f{10, 20, 30} -- a.a1 == 10, a.a2 == 20, a.a3 == 30
+-- f{a3=300, a1=100} -- a.a1 == 100, a.a2 == nil, a.a3 == 300
+-- f{1, a3=3} -- a.a1 == 1, a.a2 == nil, a.a3 == 3
+-- f{a3=3, 1} -- a.a1 == 1, a.a2 == nil, a.a3 == 3
+local function mapargs(names, ...)
+ local args = table.pack(...)
+ local posargs = {}
+ local keyargs = {}
+ -- For a mixed table, no Lua operation will reliably tell you how many
+ -- array items it contains, if there are any holes. Track that by hand.
+ -- We must be able to handle f(1, nil, 3) calls.
+ local maxpos = 0
+
+ -- For convenience, allow passing 'names' as a string 'n0,n1,...'
+ if type(names) == 'string' then
+ names = string.split(names, ',')
+ end
+
+ if not (args.n == 1 and type(args[1]) == 'table') then
+ -- If caller passes more than one argument, or if the first argument
+ -- is not a table, then it's classic positional function-call syntax:
+ -- f(first, second, etc.). In that case we need not bother teasing
+ -- apart positional from keyword arguments.
+ posargs = args
+ maxpos = args.n
+ else
+ -- Single table argument implies f{mixed} syntax.
+ -- Tease apart positional arguments from keyword arguments.
+ for k, v in pairs(args[1]) do
+ if type(k) == 'number' then
+ posargs[k] = v
+ maxpos = math.max(maxpos, k)
+ else
+ if table.find(names, k) == nil then
+ error('unknown keyword argument ' .. tostring(k))
+ end
+ keyargs[k] = v
+ end
+ end
+ end
+
+ -- keyargs already has keyword arguments in place, just fill in positionals
+ args = keyargs
+ -- Don't exceed the number of parameter names. Loop explicitly over every
+ -- index value instead of using ipairs() so we can support holes (nils) in
+ -- posargs.
+ for i = 1, math.min(#names, maxpos) do
+ if posargs[i] ~= nil then
+ -- As in Python, make it illegal to pass an argument both positionally
+ -- and by keyword. This implementation permits func(17, first=nil), a
+ -- corner case about which I don't particularly care.
+ if args[names[i]] ~= nil then
+ error(string.format('parameter %s passed both positionally and by keyword',
+ tostring(names[i])))
+ end
+ args[names[i]] = posargs[i]
+ end
+ end
+ return args
+end
+
+return mapargs
diff --git a/indra/newview/scripts/lua/require/printf.lua b/indra/newview/scripts/lua/require/printf.lua
new file mode 100644
index 0000000000..e84b2024df
--- /dev/null
+++ b/indra/newview/scripts/lua/require/printf.lua
@@ -0,0 +1,19 @@
+-- printf(...) is short for print(string.format(...))
+
+local inspect = require 'inspect'
+
+local function printf(format, ...)
+ -- string.format() only handles numbers and strings.
+ -- Convert anything else to string using the inspect module.
+ local args = {}
+ for _, arg in pairs(table.pack(...)) do
+ if type(arg) == 'number' or type(arg) == 'string' then
+ table.insert(args, arg)
+ else
+ table.insert(args, inspect(arg))
+ end
+ end
+ print(string.format(format, table.unpack(args)))
+end
+
+return printf
diff --git a/indra/newview/scripts/lua/require/result_view.lua b/indra/newview/scripts/lua/require/result_view.lua
new file mode 100644
index 0000000000..5301d7838c
--- /dev/null
+++ b/indra/newview/scripts/lua/require/result_view.lua
@@ -0,0 +1,98 @@
+local leap = require 'leap'
+
+-- metatable for every result_view() table
+local mt = {
+ __len = function(self)
+ return self.length
+ end,
+ __index = function(self, i)
+ -- right away, convert to 0-relative indexing
+ i -= 1
+ -- can we find this index within the current slice?
+ local reli = i - self.start
+ if 0 <= reli and reli < #self.slice then
+ -- Lua 1-relative indexing
+ return self.slice[reli + 1]
+ end
+ -- is this index outside the overall result set?
+ if not (0 <= i and i < self.length) then
+ return nil
+ end
+ -- fetch a new slice starting at i, using provided fetch()
+ local start
+ self.slice, start = self.fetch(self.key, i)
+ -- It's possible that caller-provided fetch() function forgot
+ -- to return the adjusted start index of the new slice. In
+ -- Lua, 0 tests as true, so if fetch() returned (slice, 0),
+ -- we'll duly reset self.start to 0. Otherwise, assume the
+ -- requested index was not adjusted: that the returned slice
+ -- really does start at i.
+ self.start = start or i
+ -- Hopefully this slice contains the desired i.
+ -- Back to 1-relative indexing.
+ return self.slice[i - self.start + 1]
+ end,
+ -- We purposely avoid putting any array entries (int keys) into
+ -- our table so that access to any int key will always call our
+ -- __index() metamethod. Moreover, we want any table iteration to
+ -- call __index(table, i) however many times; we do NOT want it to
+ -- retrieve key, length, start, slice.
+ -- So turn 'for k, v in result' into 'for k, v in ipairs(result)'.
+ __iter = ipairs,
+ -- This result set provides read-only access.
+ -- We do not support pushing updates to individual items back to
+ -- C++; for the intended use cases, that makes no sense.
+ __newindex = function(self, i, value)
+ error("result_view is a read-only data structure", 2)
+ end
+}
+
+-- result_view(key_length, fetch) returns a table which stores only a slice
+-- of a result set plus some control values, yet presents read-only virtual
+-- access to the entire result set.
+-- key_length: {result set key, total result set length}
+-- fetch: function(key, start) that returns (slice, adjusted start)
+local result_view = setmetatable(
+ {
+ -- generic fetch() function
+ fetch = function(key, start)
+ local fetched = leap.request(
+ 'LLInventory',
+ {op='getSlice', result=key, index=start})
+ return fetched.slice, fetched.start
+ end,
+ -- generic close() function accepting variadic result-set keys
+ close = function(...)
+ local keys = table.pack(...)
+ -- table.pack() produces a table with an array entry for every
+ -- parameter, PLUS an 'n' key with the count. Unfortunately that
+ -- 'n' key bollixes our conversion to LLSD, which requires either
+ -- all int keys (for an array) or all string keys (for a map).
+ keys.n = nil
+ leap.send('LLInventory', {op='closeResult', result=keys})
+ end
+ },
+ {
+ -- result_view(key_length, fetch) calls this
+ __call = function(class, key_length, fetch)
+ return setmetatable(
+ {
+ key=key_length[1],
+ length=key_length[2],
+ -- C++ result sets use 0-based indexing, so internally we do too
+ start=0,
+ -- start with a dummy array with length 0
+ slice={},
+ -- if caller didn't pass fetch() function, use generic
+ fetch=fetch or class.fetch,
+ -- returned view:close() will close result set with passed key
+ close=function(self) class.close(key_length[1]) end
+ },
+ -- use our special metatable
+ mt
+ )
+ end
+ }
+)
+
+return result_view
diff --git a/indra/newview/scripts/lua/require/startup.lua b/indra/newview/scripts/lua/require/startup.lua
new file mode 100644
index 0000000000..c3040f94b8
--- /dev/null
+++ b/indra/newview/scripts/lua/require/startup.lua
@@ -0,0 +1,100 @@
+-- query, wait for or mandate a particular viewer startup state
+
+-- During startup, the viewer steps through a sequence of numbered (and named)
+-- states. This can be used to detect when, for instance, the login screen is
+-- displayed, or when the viewer has finished logging in and is fully
+-- in-world.
+
+local fiber = require 'fiber'
+local leap = require 'leap'
+local inspect = require 'inspect'
+local function dbg(...) end
+-- local dbg = require 'printf'
+
+-- ---------------------------------------------------------------------------
+local startup = {}
+
+-- Get the list of startup states from the viewer.
+local bynum = leap.request('LLStartUp', {op='getStateTable'})['table']
+
+local byname = setmetatable(
+ {},
+ -- set metatable to throw an error if you look up invalid state name
+ {__index=function(t, k)
+ local v = rawget(t, k)
+ if v then
+ return v
+ end
+ error(string.format('startup module passed invalid state %q', k), 2)
+ end})
+
+-- derive byname as a lookup table to find the 0-based index for a given name
+for i, name in pairs(bynum) do
+ -- the viewer's states are 0-based, not 1-based like Lua indexes
+ byname[name] = i - 1
+end
+-- dbg('startup states: %s', inspect(byname))
+
+-- specialize a WaitFor to track the viewer's startup state
+local startup_pump = 'StartupState'
+local waitfor = leap.WaitFor(0, startup_pump)
+function waitfor:filter(pump, data)
+ if pump == self.name then
+ return data
+ end
+end
+
+function waitfor:process(data)
+ -- keep updating startup._state for interested parties
+ startup._state = data.str
+ dbg('startup updating state to %q', data.str)
+ -- now pass data along to base-class method to queue
+ leap.WaitFor.process(self, data)
+end
+
+-- listen for StartupState events
+leap.request(leap.cmdpump(),
+ {op='listen', source=startup_pump, listener='startup.lua', tweak=true})
+-- poke LLStartUp to make sure we get an event
+leap.send('LLStartUp', {op='postStartupState'})
+
+-- ---------------------------------------------------------------------------
+-- wait for response from postStartupState
+while not startup._state do
+ dbg('startup.state() waiting for first StartupState event')
+ waitfor:wait()
+end
+
+-- return a list of all known startup states
+function startup.list()
+ return bynum
+end
+
+-- report whether state with string name 'left' is before string name 'right'
+function startup.before(left, right)
+ return byname[left] < byname[right]
+end
+
+-- report the viewer's current startup state
+function startup.state()
+ return startup._state
+end
+
+-- error if script is called before specified state string name
+function startup.ensure(state)
+ if startup.before(startup.state(), state) then
+ -- tell error() to pretend this error was thrown by our caller
+ error('must not be called before startup state ' .. state, 2)
+ end
+end
+
+-- block calling fiber until viewer has reached state with specified string name
+function startup.wait(state)
+ dbg('startup.wait(%q)', state)
+ while startup.before(startup.state(), state) do
+ local item = waitfor:wait()
+ dbg('startup.wait(%q) sees %s', state, item)
+ end
+end
+
+return startup
diff --git a/indra/newview/scripts/lua/require/timers.lua b/indra/newview/scripts/lua/require/timers.lua
new file mode 100644
index 0000000000..ab1615ffbf
--- /dev/null
+++ b/indra/newview/scripts/lua/require/timers.lua
@@ -0,0 +1,122 @@
+-- Access to the viewer's time-delay facilities
+
+local leap = require 'leap'
+local util = require 'util'
+
+local timers = {}
+
+local function dbg(...) end
+-- local dbg = require 'printf'
+
+timers.Timer = {}
+
+-- delay: time in seconds until callback
+-- callback: 'wait', or function to call when timer fires (self:tick if nil)
+-- iterate: if non-nil, call callback repeatedly until it returns non-nil
+-- (ignored if 'wait')
+function timers.Timer:new(delay, callback, iterate)
+ local obj = setmetatable({}, self)
+ self.__index = self
+
+ if callback == 'wait' then
+ dbg('scheduleAfter(%d):', delay)
+ sequence = leap.generate('Timers', {op='scheduleAfter', after=delay})
+ -- ignore the immediate return
+ dbg('scheduleAfter(%d) -> %s', delay,
+ sequence.next())
+ -- this call is where we wait for real
+ dbg('next():')
+ dbg('next() -> %s',
+ sequence.next())
+ sequence.done()
+ return
+ end
+
+ callback = callback or function() obj:tick() end
+
+ local calls = 0
+ if iterate then
+ -- With iterative timers, beware of running a timer callback which
+ -- performs async actions lasting longer than the timer interval. The
+ -- lengthy callback suspends, allowing leap to retrieve the next
+ -- event, which is a timer tick. leap calls a new instance of the
+ -- callback, even though the previous callback call is still
+ -- suspended... etc. 'in_callback' defends against that recursive
+ -- case. Rather than re-enter the suspended callback, drop the
+ -- too-soon timer event. (We could count the too-soon timer events and
+ -- iterate calling the callback, but it's a bathtub problem: the
+ -- callback could end up getting farther and farther behind.)
+ local in_callback = false
+ obj.id = leap.eventstream(
+ 'Timers',
+ {op='scheduleEvery', every=delay},
+ function (event)
+ local reqid = event.reqid
+ calls += 1
+ if calls == 1 then
+ dbg('timer(%s) first callback', reqid)
+ -- discard the first (immediate) response: don't call callback
+ return nil
+ else
+ if in_callback then
+ dbg('dropping timer(%s) callback %d', reqid, calls)
+ else
+ dbg('timer(%s) callback %d', reqid, calls)
+ in_callback = true
+ local ret = callback(event)
+ in_callback = false
+ return ret
+ end
+ end
+ end
+ ).reqid
+ else -- (not iterate)
+ obj.id = leap.eventstream(
+ 'Timers',
+ {op='scheduleAfter', after=delay},
+ function (event)
+ calls += 1
+ -- Arrange to return nil the first time, true the second. This
+ -- callback is called immediately with the response to
+ -- 'scheduleAfter', and if we immediately returned true, we'd
+ -- be done, and the subsequent timer event would be discarded.
+ if calls == 1 then
+ -- Caller doesn't expect an immediate callback.
+ return nil
+ else
+ callback(event)
+ -- Since caller doesn't want to iterate, the value
+ -- returned by the callback is irrelevant: just stop after
+ -- this one and only call.
+ return true
+ end
+ end
+ ).reqid
+ end
+
+ return obj
+end
+
+util.classctor(timers.Timer)
+
+function timers.Timer:tick()
+ error('Pass a callback to Timer:new(), or override Timer:tick()')
+end
+
+function timers.Timer:cancel()
+ local ok = leap.request('Timers', {op='cancel', id=self.id}).ok
+ leap.cancelreq(self.id)
+ return ok
+end
+
+function timers.Timer:isRunning()
+ return leap.request('Timers', {op='isRunning', id=self.id}).running
+end
+
+-- returns (true, seconds left) for a live timer, else (false, 0)
+function timers.Timer:timeUntilCall()
+ local result = leap.request('Timers', {op='timeUntilCall', id=self.id})
+ return result.ok, result.remaining
+end
+
+return timers
diff --git a/indra/newview/scripts/lua/require/util.lua b/indra/newview/scripts/lua/require/util.lua
new file mode 100644
index 0000000000..40737a159a
--- /dev/null
+++ b/indra/newview/scripts/lua/require/util.lua
@@ -0,0 +1,114 @@
+-- utility functions, in alpha order
+
+local util = {}
+
+-- Allow MyClass(ctor args...) equivalent to MyClass:new(ctor args...)
+-- Usage:
+-- local MyClass = {}
+-- function MyClass:new(...)
+-- ...
+-- end
+-- ...
+-- util.classctor(MyClass)
+-- or if your constructor is named something other than MyClass:new(), e.g.
+-- MyClass:construct():
+-- util.classctor(MyClass, MyClass.construct)
+-- return MyClass
+function util.classctor(class, ctor)
+ -- set class's __call metamethod to the specified constructor function
+ -- (class.new if not specified)
+ util.setmetamethods{class, __call=(ctor or class.new)}
+end
+
+-- check if array-like table contains certain value
+function util.contains(t, v)
+ return table.find(t, v) ~= nil
+end
+
+-- reliable count of the number of entries in table t
+-- (since #t is unreliable)
+function util.count(t)
+ local count = 0
+ for _ in pairs(t) do
+ count += 1
+ end
+ return count
+end
+
+-- cheap test whether table t is empty
+function util.empty(t)
+ return not next(t)
+end
+
+-- recursive table equality
+function util.equal(t1, t2)
+ if not (type(t1) == 'table' and type(t2) == 'table') then
+ return t1 == t2
+ end
+ -- both t1 and t2 are tables: get modifiable copy of t2
+ local temp = table.clone(t2)
+ for k, v in pairs(t1) do
+ -- if any key in t1 doesn't have same value in t2, not equal
+ if not util.equal(v, temp[k]) then
+ return false
+ end
+ -- temp[k] == t1[k], delete temp[k]
+ temp[k] = nil
+ end
+ -- All keys in t1 have equal values in t2; t2 == t1 if there are no extra keys in t2
+ return util.empty(temp)
+end
+
+-- Find or create the metatable for a specified table (a new empty table if
+-- omitted), and to that metatable assign the specified keys.
+-- Setting multiple keys at once is more efficient than a function to set only
+-- one at a time, e.g. setametamethod().
+-- t = util.setmetamethods{__index=readfunc, __len=lenfunc}
+-- returns a new table with specified metamethods __index, __len
+-- util.setmetamethods{t, __call=action}
+-- finds or creates the metatable for existing table t and sets __call
+-- util.setmetamethods{table=t, __call=action}
+-- same as util.setmetamethods{t, __call=action}
+function util.setmetamethods(specs)
+ -- first determine the target table
+ assert(not (specs.table and specs[1]),
+ "Pass setmetamethods table either as positional or table=, not both")
+ local t = specs.table or specs[1] or {}
+ -- remove both ways of specifying table, leaving only the metamethods
+ specs.table = nil
+ specs[1] = nil
+ local mt = getmetatable(t)
+ if not mt then
+ -- t doesn't already have a metatable: just set specs
+ setmetatable(t, specs)
+ else
+ -- t already has a metatable: copy specs into it
+ local key, value
+ for key, value in pairs(specs) do
+ mt[key] = value
+ end
+ end
+ -- having set or enriched t's metatable, return t
+ return t
+end
+
+-- On the passed module (i.e. table), set an __index metamethod such that
+-- referencing module.submodule lazily requires(path/submodule).
+-- The loaded submodule is cached in the module table so it need not be passed
+-- to require() again.
+-- 'path', like any require() string, can be relative to LuaRequirePath.
+-- Returns the enriched module, permitting e.g.
+-- mymod = util.submoduledir({}, 'mymod')
+function util.submoduledir(module, path)
+ return util.setmetamethods{
+ module,
+ __index=function(t, key)
+ local mod = require(`{path}/{key}`)
+ -- cache the submodule
+ t[key] = mod
+ return mod
+ end
+ }
+end
+
+return util
diff --git a/indra/newview/scripts/lua/test_LLAppearance.lua b/indra/newview/scripts/lua/test_LLAppearance.lua
new file mode 100644
index 0000000000..a97ec4e0ca
--- /dev/null
+++ b/indra/newview/scripts/lua/test_LLAppearance.lua
@@ -0,0 +1,114 @@
+local LLAppearance = require 'LLAppearance'
+local startup = require 'startup'
+local inspect = require 'inspect'
+local UI = require 'UI'
+
+local SHOW_OUTFITS = true
+local SELECTED_OUTFIT_ID = {}
+local DATA_MAP = {}
+
+local wearables_lbl = 'Show wearables'
+local outfits_lbl = 'Show outfits'
+local replace_cof_lbl = 'Replace COF'
+local add_cof_lbl = 'Add to COF'
+local outfits_title = 'Outfits'
+local wear_lbl = 'Wear item'
+local detach_lbl = 'Detach item'
+
+local flt = UI.Floater(
+ "luafloater_outfits_list.xml",
+ {outfits_list = {"double_click"}})
+
+function get_selected_id()
+ return flt:request({action="get_selected_id", ctrl_name='outfits_list'}).value
+end
+
+function populate_list()
+ if SHOW_OUTFITS then
+ DATA_MAP = LLAppearance.getOutfitsList()
+ else
+ DATA_MAP = LLAppearance.getOutfitItems(SELECTED_OUTFIT_ID)
+ end
+
+ local action_data = {}
+ action_data.action = "add_list_element"
+ action_data.ctrl_name = "outfits_list"
+ local outfits = {}
+ for uuid, info in pairs(DATA_MAP) do
+ name = {}
+ if SHOW_OUTFITS then
+ name = info
+ else
+ name = info.name
+ end
+ table.insert(outfits, {value = uuid, columns={column = "outfit_name", value = name}})
+ end
+ action_data.value = outfits
+ flt:post(action_data)
+end
+
+function set_label(btn_name, value)
+ flt:post({action="set_label", ctrl_name=btn_name, value=value})
+end
+
+function set_enabled(btn_name, value)
+ flt:post({action="set_enabled", ctrl_name=btn_name, value=value})
+end
+
+function update_labels()
+ if SHOW_OUTFITS then
+ set_label('select_btn', wearables_lbl)
+ set_label('replace_btn', replace_cof_lbl)
+ set_label('add_btn', add_cof_lbl)
+
+ set_enabled('select_btn', false)
+ flt:post({action="set_title", value=outfits_title})
+ else
+ set_label('select_btn', outfits_lbl)
+ set_label('replace_btn', wear_lbl)
+ set_label('add_btn', detach_lbl)
+
+ set_enabled('select_btn', true)
+ flt:post({action="set_title", value=DATA_MAP[SELECTED_OUTFIT_ID]})
+ end
+
+ set_enabled('replace_btn', false)
+ set_enabled('add_btn', false)
+end
+
+function flt:post_build(event_data)
+ populate_list()
+end
+
+function flt:commit_replace_btn(event_data)
+ if SHOW_OUTFITS then
+ LLAppearance.wearOutfit(get_selected_id(), 'replace')
+ else
+ LLAppearance.wearItems(get_selected_id(), false)
+ end
+end
+
+function flt:commit_add_btn(event_data)
+ if SHOW_OUTFITS then
+ LLAppearance.wearOutfit(get_selected_id(), 'add')
+ else
+ LLAppearance.detachItems(get_selected_id())
+ end
+end
+
+function flt:commit_select_btn(event_data)
+ SHOW_OUTFITS = not SHOW_OUTFITS
+ SELECTED_OUTFIT_ID = get_selected_id()
+ update_labels()
+ self:post({action="clear_list", ctrl_name='outfits_list'})
+ populate_list()
+end
+
+function flt:commit_outfits_list(event_data)
+ set_enabled('replace_btn', true)
+ set_enabled('add_btn', true)
+ set_enabled('select_btn', true)
+end
+
+startup.wait('STATE_STARTED')
+flt:show()
diff --git a/indra/newview/scripts/lua/test_LLChat.lua b/indra/newview/scripts/lua/test_LLChat.lua
new file mode 100644
index 0000000000..3abaf28e42
--- /dev/null
+++ b/indra/newview/scripts/lua/test_LLChat.lua
@@ -0,0 +1,18 @@
+LLChat = require 'LLChat'
+
+function generateRandomWord(length)
+ local alphabet = "abcdefghijklmnopqrstuvwxyz"
+ local wordTable = {}
+ for i = 1, length do
+ local randomIndex = math.random(1, #alphabet)
+ table.insert(wordTable, alphabet:sub(randomIndex, randomIndex))
+ end
+ return table.concat(wordTable)
+end
+
+local msg = {'AI says:'}
+math.randomseed(os.time())
+for i = 1, math.random(1, 10) do
+ table.insert(msg, generateRandomWord(math.random(1, 8)))
+end
+LLChat.sendNearby(table.concat(msg, ' '))
diff --git a/indra/newview/scripts/lua/test_LLChatListener.lua b/indra/newview/scripts/lua/test_LLChatListener.lua
new file mode 100644
index 0000000000..0f269b54e6
--- /dev/null
+++ b/indra/newview/scripts/lua/test_LLChatListener.lua
@@ -0,0 +1,39 @@
+local LLListener = require 'LLListener'
+local LLChat = require 'LLChat'
+local UI = require 'UI'
+
+-- Chat listener script allows to use the following commands in Nearby chat:
+-- open inventory -- open defined floater by name
+-- close inventory -- close defined floater by name
+-- closeall -- close all floaters
+-- stop -- close the script
+-- any other messages will be echoed.
+function openOrEcho(message)
+ local open_floater_name = string.match(message, "^open%s+(%w+)")
+ local close_floater_name = string.match(message, "^close%s+(%w+)")
+ if open_floater_name then
+ UI.showFloater(open_floater_name)
+ elseif close_floater_name then
+ UI.hideFloater(close_floater_name)
+ elseif message == 'closeall' then
+ UI.closeAllFloaters()
+ else
+ LLChat.sendNearby('Echo: ' .. message)
+ end
+end
+
+local listener = LLListener(LLChat.nearbyChatPump)
+
+function listener:handleMessages(event_data)
+ if string.find(event_data.message, '[LUA]') then
+ return true
+ elseif event_data.message == 'stop' then
+ LLChat.sendNearby('Closing echo script.')
+ return false
+ else
+ openOrEcho(event_data.message)
+ end
+ return true
+end
+
+listener:start()
diff --git a/indra/newview/scripts/lua/test_LLFloaterAbout.lua b/indra/newview/scripts/lua/test_LLFloaterAbout.lua
new file mode 100644
index 0000000000..6bbf61982d
--- /dev/null
+++ b/indra/newview/scripts/lua/test_LLFloaterAbout.lua
@@ -0,0 +1,6 @@
+-- test LLFloaterAbout
+
+LLFloaterAbout = require('LLFloaterAbout')
+inspect = require('inspect')
+
+print(inspect(LLFloaterAbout.getInfo()))
diff --git a/indra/newview/scripts/lua/test_LLGesture.lua b/indra/newview/scripts/lua/test_LLGesture.lua
new file mode 100644
index 0000000000..1cce674565
--- /dev/null
+++ b/indra/newview/scripts/lua/test_LLGesture.lua
@@ -0,0 +1,26 @@
+-- exercise LLGesture API
+
+LLGesture = require 'LLGesture'
+inspect = require 'inspect'
+
+
+-- getActiveGestures() returns {<UUID>: {name, playing, trigger}}
+gestures_uuid = LLGesture.getActiveGestures()
+-- convert to {<name>: <uuid>}
+gestures = {}
+for uuid, info in pairs(gestures_uuid) do
+ gestures[info.name] = uuid
+end
+-- now run through the list
+for name, uuid in pairs(gestures) do
+ if name == 'afk' then
+ -- afk has a long timeout, and isn't interesting to look at
+ continue
+ end
+ print(name)
+ LLGesture.startGesture(uuid)
+ repeat
+ LL.sleep(1)
+ until not LLGesture.isGesturePlaying(uuid)
+end
+print('Done.')
diff --git a/indra/newview/scripts/lua/test_LLInventory.lua b/indra/newview/scripts/lua/test_LLInventory.lua
new file mode 100644
index 0000000000..de57484bcd
--- /dev/null
+++ b/indra/newview/scripts/lua/test_LLInventory.lua
@@ -0,0 +1,24 @@
+inspect = require 'inspect'
+LLInventory = require 'LLInventory'
+
+-- Get 'My Landmarks' folder id (you can see all folder types via LLInventory.getFolderTypeNames())
+my_landmarks_id = LLInventory.getBasicFolderID('landmark')
+-- Get 3 landmarks from the 'My Landmarks' folder (you can see all folder types via LLInventory.getAssetTypeNames())
+landmarks = LLInventory.collectDescendentsIf{folder_id=my_landmarks_id, type="landmark", limit=3}
+for _, landmark in pairs(landmarks.items) do
+ print(landmark.name)
+end
+
+-- Get 'Calling Cards' folder id
+calling_cards_id = LLInventory.getBasicFolderID('callcard')
+-- Get all items located directly in 'Calling Cards' folder
+calling_cards = LLInventory.getDirectDescendents(calling_cards_id).items
+
+-- Print a random calling card name from 'Calling Cards' folder
+-- (because getDirectDescendents().items is a Lua result set, selecting
+-- a random entry only fetches one slice containing that entry)
+math.randomseed(os.time())
+for i = 1, 5 do
+ pick = math.random(#calling_cards)
+ print(`Random calling card (#{pick} of {#calling_cards}): {calling_cards[pick].name}`)
+end
diff --git a/indra/newview/scripts/lua/test_animation.lua b/indra/newview/scripts/lua/test_animation.lua
new file mode 100644
index 0000000000..37e7254a6c
--- /dev/null
+++ b/indra/newview/scripts/lua/test_animation.lua
@@ -0,0 +1,32 @@
+LLInventory = require 'LLInventory'
+LLAgent = require 'LLAgent'
+
+-- Get 'Animations' folder id (you can see all folder types via LLInventory.getFolderTypeNames())
+animations_id = LLInventory.getBasicFolderID('animatn')
+-- Get animations from the 'Animation' folder (you can see all folder types via LLInventory.getAssetTypeNames())
+anims = LLInventory.collectDescendentsIf{folder_id=animations_id, type="animatn"}.items
+
+local anim_ids = {}
+for key in pairs(anims) do
+ table.insert(anim_ids, key)
+end
+
+if #anim_ids == 0 then
+ print("No animations found")
+else
+ -- Start playing a random animation
+ math.randomseed(os.time())
+ local random_id = anim_ids[math.random(#anim_ids)]
+ local anim_info = LLAgent.getAnimationInfo(random_id)
+
+ print("Starting animation locally: " .. anims[random_id].name)
+ print("Loop: " .. anim_info.is_loop .. " Joints: " .. anim_info.num_joints .. " Duration " .. tonumber(string.format("%.2f", anim_info.duration)))
+ LLAgent.playAnimation{item_id=random_id}
+
+ -- Stop animation after 3 sec if it's looped or longer than 3 sec
+ if anim_info.is_loop == 1 or anim_info.duration > 3 then
+ LL.sleep(3)
+ print("Stop animation.")
+ LLAgent.stopAnimation(random_id)
+ end
+end
diff --git a/indra/newview/scripts/lua/test_atexit.lua b/indra/newview/scripts/lua/test_atexit.lua
new file mode 100644
index 0000000000..6fbc0f3eb1
--- /dev/null
+++ b/indra/newview/scripts/lua/test_atexit.lua
@@ -0,0 +1,3 @@
+LL.atexit(function() print('Third') end)
+LL.atexit(function() print('Second') end)
+LL.atexit(function() print('First') end)
diff --git a/indra/newview/scripts/lua/test_autopilot.lua b/indra/newview/scripts/lua/test_autopilot.lua
new file mode 100644
index 0000000000..09c85c140a
--- /dev/null
+++ b/indra/newview/scripts/lua/test_autopilot.lua
@@ -0,0 +1,22 @@
+local LLAgent = require 'LLAgent'
+local LLListener = require 'LLListener'
+
+local pos = LLAgent.getGlobalPosition()
+pos[1]+=10 -- delta x
+pos[2]+=5 -- delta y
+LLAgent.requestStand()
+LLAgent.startAutoPilot{target_global=pos,allow_flying=false,stop_distance=1}
+
+local listener = LLListener(LLAgent.autoPilotPump)
+
+function listener:handleMessages(event_data)
+ if event_data.success then
+ print('Destination is reached')
+ LLAgent.requestSit()
+ else
+ print('Failed to reach destination')
+ end
+ return false
+end
+
+listener:start()
diff --git a/indra/newview/scripts/lua/test_callables.lua b/indra/newview/scripts/lua/test_callables.lua
new file mode 100644
index 0000000000..1bee062db8
--- /dev/null
+++ b/indra/newview/scripts/lua/test_callables.lua
@@ -0,0 +1,6 @@
+startup=require 'startup'
+UI=require 'UI'
+startup.wait('STATE_LOGIN_WAIT')
+for _, cbl in pairs(UI.callables()) do
+ print(`{cbl.name} ({cbl.access})`)
+end
diff --git a/indra/newview/scripts/lua/test_camera_control.lua b/indra/newview/scripts/lua/test_camera_control.lua
new file mode 100644
index 0000000000..7ac0986ee6
--- /dev/null
+++ b/indra/newview/scripts/lua/test_camera_control.lua
@@ -0,0 +1,49 @@
+local LLAgent = require 'LLAgent'
+local startup = require 'startup'
+local UI = require 'UI'
+
+local flt = UI.Floater('luafloater_camera_control.xml')
+
+function getValue(ctrl_name)
+ return flt:request({action="get_value", ctrl_name=ctrl_name}).value
+end
+
+function setValue(ctrl_name, value)
+ flt:post({action="set_value", ctrl_name=ctrl_name, value=value})
+end
+
+function flt:commit_update_btn(event_data)
+ lock_focus = getValue('lock_focus_ctrl')
+ lock_camera = getValue('lock_camera_ctrl')
+ local camera_pos = {getValue('cam_x'), getValue('cam_y'), getValue('cam_z')}
+ local focus_pos = {getValue('focus_x'), getValue('focus_y'), getValue('focus_z')}
+
+ LLAgent.setCamera{camera_pos=camera_pos, focus_pos=focus_pos,
+ focus_locked=lock_focus, camera_locked=lock_camera}
+
+ self:post({action="add_text", ctrl_name="events_editor",
+ value = {'Updating FollowCam params', 'camera_pos:', camera_pos, 'focus_pos:', focus_pos,
+ 'lock_focus:', lock_focus, 'lock_camera:', lock_camera}})
+end
+
+function flt:commit_agent_cam_btn(event_data)
+ agent_pos = LLAgent.getRegionPosition()
+ setValue('cam_x', math.floor(agent_pos[1]))
+ setValue('cam_y', math.floor(agent_pos[2]))
+ setValue('cam_z', math.floor(agent_pos[3]))
+end
+
+function flt:commit_agent_focus_btn(event_data)
+ agent_pos = LLAgent.getRegionPosition()
+ setValue('focus_x', math.floor(agent_pos[1]))
+ setValue('focus_y', math.floor(agent_pos[2]))
+ setValue('focus_z', math.floor(agent_pos[3]))
+end
+
+function flt:commit_reset_btn(event_data)
+ LLAgent.removeCamParams()
+ LLAgent.setFollowCamActive(false)
+end
+
+startup.wait('STATE_STARTED')
+flt:show()
diff --git a/indra/newview/scripts/lua/test_flycam.lua b/indra/newview/scripts/lua/test_flycam.lua
new file mode 100644
index 0000000000..05c3c37b93
--- /dev/null
+++ b/indra/newview/scripts/lua/test_flycam.lua
@@ -0,0 +1,38 @@
+-- Make camera fly around the subject avatar for a few seconds.
+
+local LLAgent = require 'LLAgent'
+local startup = require 'startup'
+local timers = require 'timers'
+
+local height = 2.0 -- meters
+local radius = 4.0 -- meters
+local speed = 1.0 -- meters/second along circle
+local start = os.clock()
+local stop = os.clock() + 30 -- seconds
+
+local function cameraPos(t)
+ local agent = LLAgent.getRegionPosition()
+ local radians = speed * t
+ return {
+ agent[1] + radius * math.cos(radians),
+ agent[2] + radius * math.sin(radians),
+ agent[3] + height
+ }
+end
+
+local function moveCamera()
+ if os.clock() < stop then
+ -- usual case
+ LLAgent.setCamera{ camera_pos=cameraPos(os.clock() - start), camera_locked=true }
+ return nil
+ else
+ -- last time
+ LLAgent.removeCamParams()
+ LLAgent.setFollowCamActive(false)
+ return true
+ end
+end
+
+startup.wait('STATE_STARTED')
+-- call moveCamera() repeatedly until it returns true
+local timer = timers.Timer(0.1, moveCamera, true)
diff --git a/indra/newview/scripts/lua/test_group_chat.lua b/indra/newview/scripts/lua/test_group_chat.lua
new file mode 100644
index 0000000000..373411c26c
--- /dev/null
+++ b/indra/newview/scripts/lua/test_group_chat.lua
@@ -0,0 +1,14 @@
+LLChat = require 'LLChat'
+LLAgent = require 'LLAgent'
+UI = require 'UI'
+
+local GROUPS = LLAgent.getGroups()
+
+-- Choose one of the groups randomly and send group message
+math.randomseed(os.time())
+group_info = GROUPS[math.random(#GROUPS)]
+LLChat.startGroupChat(group_info.id)
+response = UI.popup:alertYesCancel('Started group chat with ' .. group_info.name .. ' group. Send greetings?')
+if response == 'OK' then
+ LLChat.sendGroupIM('Greetings', group_info.id)
+end
diff --git a/indra/newview/scripts/lua/test_inv_resultset.lua b/indra/newview/scripts/lua/test_inv_resultset.lua
new file mode 100644
index 0000000000..c31cfe3c67
--- /dev/null
+++ b/indra/newview/scripts/lua/test_inv_resultset.lua
@@ -0,0 +1,18 @@
+local LLInventory = require 'LLInventory'
+local inspect = require 'inspect'
+
+print('basic folders:')
+print(inspect(LLInventory.getFolderTypeNames()))
+
+local folder = LLInventory.getBasicFolderID('my_otfts')
+print(`folder = {folder}`)
+local result = LLInventory.getDirectDescendants(folder)
+print(`type(result) = {type(result)}`)
+print(#result.categories, 'categories:')
+for i, cat in pairs(result.categories) do
+ print(`{i}: {cat.name}`)
+end
+print(#result.items, 'items')
+for i, item in pairs(result.items) do
+ print(`{i}: {item.name}`)
+end
diff --git a/indra/newview/scripts/lua/test_login.lua b/indra/newview/scripts/lua/test_login.lua
new file mode 100644
index 0000000000..54d3635a41
--- /dev/null
+++ b/indra/newview/scripts/lua/test_login.lua
@@ -0,0 +1,10 @@
+inspect = require 'inspect'
+login = require 'login'
+
+local grid = 'agni'
+print(inspect(login.savedLogins(grid)))
+
+print(inspect(login.login{
+ username='Your Username',
+ grid=grid
+ }))
diff --git a/indra/newview/scripts/lua/test_logout.lua b/indra/newview/scripts/lua/test_logout.lua
new file mode 100644
index 0000000000..b1ac59e38c
--- /dev/null
+++ b/indra/newview/scripts/lua/test_logout.lua
@@ -0,0 +1,3 @@
+logout = require 'logout'
+
+logout()
diff --git a/indra/newview/scripts/lua/test_luafloater_demo.lua b/indra/newview/scripts/lua/test_luafloater_demo.lua
new file mode 100644
index 0000000000..2158134511
--- /dev/null
+++ b/indra/newview/scripts/lua/test_luafloater_demo.lua
@@ -0,0 +1,39 @@
+local leap = require 'leap'
+local startup = require 'startup'
+local UI = require 'UI'
+
+local flt = UI.Floater(
+ 'luafloater_demo.xml',
+ {show_time_lbl = {"right_mouse_down", "double_click"}})
+
+-- override base-class handleEvents() to report the event data in the floater's display field
+function flt:handleEvents(event_data)
+ self:post({action="add_text", ctrl_name="events_editor", value = event_data})
+ -- forward the call to base-class handleEvents()
+ return UI.Floater.handleEvents(self, event_data)
+end
+
+function flt:commit_disable_ctrl(event_data)
+ self:post({action="set_enabled", ctrl_name="open_btn", value = (1 - event_data.value)})
+end
+
+function flt:commit_title_cmb(event_data)
+ self:post({action="set_title", value=event_data.value})
+end
+
+function flt:commit_open_btn(event_data)
+ floater_name = self:request({action="get_value", ctrl_name='openfloater_cmd'}).value
+ leap.send("LLFloaterReg", {name = floater_name, op = "showInstance"})
+end
+
+local function getCurrentTime()
+ local currentTime = os.date("*t")
+ return string.format("%02d:%02d:%02d", currentTime.hour, currentTime.min, currentTime.sec)
+end
+
+function flt:double_click_show_time_lbl(event_data)
+ self:post({action="set_value", ctrl_name="time_lbl", value=getCurrentTime()})
+end
+
+startup.wait('STATE_LOGIN_WAIT')
+flt:show()
diff --git a/indra/newview/scripts/lua/test_luafloater_gesture_list.lua b/indra/newview/scripts/lua/test_luafloater_gesture_list.lua
new file mode 100644
index 0000000000..5f929c0d0c
--- /dev/null
+++ b/indra/newview/scripts/lua/test_luafloater_gesture_list.lua
@@ -0,0 +1,27 @@
+local LLGesture = require 'LLGesture'
+local startup = require 'startup'
+local UI = require 'UI'
+
+local flt = UI.Floater(
+ "luafloater_gesture_list.xml",
+ {gesture_list = {"double_click"}})
+
+function flt:post_build(event_data)
+ local gestures_uuid = LLGesture.getActiveGestures()
+ local action_data = {}
+ action_data.action = "add_list_element"
+ action_data.ctrl_name = "gesture_list"
+ local gestures = {}
+ for uuid, info in pairs(gestures_uuid) do
+ table.insert(gestures, {value = uuid, columns={column = "gesture_name", value = info.name}})
+ end
+ action_data.value = gestures
+ self:post(action_data)
+end
+
+function flt:double_click_gesture_list(event_data)
+ LLGesture.startGesture(event_data.value)
+end
+
+startup.wait('STATE_STARTED')
+flt:show()
diff --git a/indra/newview/scripts/lua/test_luafloater_speedometer.lua b/indra/newview/scripts/lua/test_luafloater_speedometer.lua
new file mode 100644
index 0000000000..2cdd41fd7e
--- /dev/null
+++ b/indra/newview/scripts/lua/test_luafloater_speedometer.lua
@@ -0,0 +1,31 @@
+local leap = require 'leap'
+local startup = require 'startup'
+local Timer = (require 'timers').Timer
+local UI = require 'UI'
+local popup = UI.popup
+local max_speed = 0
+local flt = UI.Floater("luafloater_speedometer.xml")
+startup.wait('STATE_STARTED')
+
+local timer
+
+function flt:floater_close(event_data)
+ if timer then
+ timer:cancel()
+ end
+ popup:tip(string.format("Registered max speed: %.2f m/s", max_speed))
+end
+
+local function idle(event_data)
+ local speed = leap.request('LLVOAvatar', {op='getSpeed'})['value']
+ flt:post({action="set_value", ctrl_name="speed_lbl", value = string.format("%.2f", speed)})
+ max_speed=math.max(max_speed, speed)
+end
+
+msg = 'Are you sure you want to run this "speedometer" script?'
+response = popup:alertYesCancel(msg)
+
+if response == 'OK' then
+ flt:show()
+ timer = Timer(1, idle, true) -- iterate
+end
diff --git a/indra/newview/scripts/lua/test_mapargs.lua b/indra/newview/scripts/lua/test_mapargs.lua
new file mode 100644
index 0000000000..999a57acb4
--- /dev/null
+++ b/indra/newview/scripts/lua/test_mapargs.lua
@@ -0,0 +1,68 @@
+local mapargs = require 'mapargs'
+local inspect = require 'inspect'
+
+function tabfunc(...)
+ local a = mapargs({'a1', 'a2', 'a3'}, ...)
+ print(inspect(a))
+end
+
+print('----------')
+print('f(10, 20, 30)')
+tabfunc(10, 20, 30)
+print('f(10, nil, 30)')
+tabfunc(10, nil, 30)
+print('f{10, 20, 30}')
+tabfunc{10, 20, 30}
+print('f{10, nil, 30}')
+tabfunc{10, nil, 30}
+print('f{a3=300, a1=100}')
+tabfunc{a3=300, a1=100}
+print('f{1, a3=3}')
+tabfunc{1, a3=3}
+print('f{a3=3, 1}')
+tabfunc{a3=3, 1}
+print('----------')
+
+if false then
+ -- the code below was used to explore ideas that became mapargs()
+ mixed = { '[1]', nil, '[3]', abc='[abc]', '[3]', def='[def]' }
+ local function showtable(desc, t)
+ print(string.format('%s (len %s)\n%s', desc, #t, inspect(t)))
+ end
+ showtable('mixed', mixed)
+
+ print('ipairs(mixed)')
+ for k, v in ipairs(mixed) do
+ print(string.format('[%s] = %s', k, tostring(v)))
+ end
+
+ print('table.pack(mixed)')
+ print(inspect(table.pack(mixed)))
+
+ local function nilarg(desc, a, b, c)
+ print(desc)
+ print('a = ' .. tostring(a))
+ print('b = ' .. tostring(b))
+ print('c = ' .. tostring(c))
+ end
+
+ nilarg('nilarg(1)', 1)
+ nilarg('nilarg(1, nil, 3)', 1, nil, 3)
+
+ local function nilargs(desc, ...)
+ args = table.pack(...)
+ showtable(desc, args)
+ end
+
+ nilargs('nilargs{a=1, b=2, c=3}', {a=1, b=2, c=3})
+ nilargs('nilargs(1, 2, 3)', 1, 2, 3)
+ nilargs('nilargs(1, nil, 3)', 1, nil, 3)
+ nilargs('nilargs{1, 2, 3}', {1, 2, 3})
+ nilargs('nilargs{1, nil, 3}', {1, nil, 3})
+
+ print('table.unpack({1, nil, 3})')
+ a, b, c = table.unpack({1, nil, 3})
+ print('a = ' .. tostring(a))
+ print('b = ' .. tostring(b))
+ print('c = ' .. tostring(c))
+end
diff --git a/indra/newview/scripts/lua/test_popup.lua b/indra/newview/scripts/lua/test_popup.lua
new file mode 100644
index 0000000000..7a11895669
--- /dev/null
+++ b/indra/newview/scripts/lua/test_popup.lua
@@ -0,0 +1,10 @@
+UI = require 'UI'
+popup = UI.popup
+startup = require 'startup'
+
+startup.wait('STATE_STARTED')
+
+response = popup:alert('This just has a Close button')
+response = popup:alertOK(string.format('You said "%s", is that OK?', response))
+response = popup:alertYesCancel(string.format('You said "%s"', response))
+popup:tip(string.format('You said "%s"', response))
diff --git a/indra/newview/scripts/lua/test_result_view.lua b/indra/newview/scripts/lua/test_result_view.lua
new file mode 100644
index 0000000000..304633a472
--- /dev/null
+++ b/indra/newview/scripts/lua/test_result_view.lua
@@ -0,0 +1,55 @@
+-- Verify the functionality of result_view.
+result_view = require 'result_view'
+
+print('alphabet')
+alphabet = "abcdefghijklmnopqrstuvwxyz"
+assert(#alphabet == 26)
+alphabits = string.split(alphabet, '')
+
+print('function slice()')
+function slice(t, index, count)
+ return table.move(t, index, index + count - 1, 1, {})
+end
+
+print('verify slice()')
+-- verify that slice() does what we expect
+assert(table.concat(slice(alphabits, 4, 3)) == "def")
+assert(table.concat(slice(alphabits, 14, 3)) == "nop")
+assert(table.concat(slice(alphabits, 25, 3)) == "yz")
+
+print('function fetch()')
+function fetch(key, index)
+ -- fetch function is defined to be 0-relative: fix for Lua data
+ -- constrain view of alphabits to slices of at most 3 elements
+ return slice(alphabits, index+1, 3), index
+end
+
+print('result_view()')
+-- for test purposes, key is irrelevant, so just 'key'
+view = result_view({'key', #alphabits}, fetch)
+
+print('function check_iter()')
+function check_iter(...)
+ result = {}
+ for k, v in ... do
+ table.insert(result, v)
+ end
+ assert(table.concat(result) == alphabet)
+end
+
+print('check_iter(pairs(view))')
+check_iter(pairs(view))
+print('check_iter(ipairs(view))')
+check_iter(ipairs(view))
+print('check_iter(view)')
+check_iter(view)
+
+print('raw index access')
+assert(view[5] == 'e')
+assert(view[10] == 'j')
+assert(view[15] == 'o')
+assert(view[20] == 't')
+assert(view[25] == 'y')
+
+print('Success!')
+
diff --git a/indra/newview/scripts/lua/test_setdtor.lua b/indra/newview/scripts/lua/test_setdtor.lua
new file mode 100644
index 0000000000..ec5cd47e93
--- /dev/null
+++ b/indra/newview/scripts/lua/test_setdtor.lua
@@ -0,0 +1,91 @@
+inspect = require 'inspect'
+
+print('initial setdtor')
+bye = LL.setdtor('initial setdtor', 'Goodbye world!', print)
+
+print('arithmetic')
+n = LL.setdtor('arithmetic', 11, print)
+print("n =", n)
+print("n._target =", n._target)
+print(pcall(function() n._target = 12 end))
+print("getmetatable(n) =", inspect(getmetatable(n)))
+print("-n =", -n)
+for i = 10, 12 do
+ -- Comparison metamethods are only called if both operands have the same
+ -- metamethod.
+ tempi = LL.setdtor('tempi', i, function(n) print('temp', i) end)
+ print(`n < {i}`, n < tempi)
+ print(`n <= {i}`, n <= tempi)
+ print(`n == {i}`, n == tempi)
+ print(`n ~= {i}`, n ~= tempi)
+ print(`n >= {i}`, n >= tempi)
+ print(`n > {i}`, n > tempi)
+end
+i = 2
+print(`n + {i} =`, n + i)
+print(`{i} + n =`, i + n)
+print(`n - {i} =`, n - i)
+print(`{i} - n =`, i - n)
+print(`n * {i} =`, n * i)
+print(`{i} * n =`, i * n)
+print(`n / {i} =`, n / i)
+print(`{i} / n =`, i / n)
+print(`n // {i} =`, n // i)
+print(`{i} // n =`, i // n)
+print(`n % {i} =`, n % i)
+print(`{i} % n =`, i % n)
+print(`n ^ {i} =`, n ^ i)
+print(`{i} ^ n =`, i ^ n)
+
+print('string')
+s = LL.setdtor('string', 'hello', print)
+print('s =', s)
+print('#s =', #s)
+print('s .. " world" =', s .. " world")
+print('"world " .. s =', "world " .. s)
+
+print('table')
+t = LL.setdtor('table', {'[1]', '[2]', abc='.abc', def='.def'},
+ function(t) print(inspect(t)) end)
+print('t =', inspect(t))
+print('t._target =', inspect(t._target))
+print('#t =', #t)
+print('next(t) =', next(t))
+print('next(t, 1) =', next(t, 1))
+print('t[2] =', t[2])
+print('t.def =', t.def)
+t[1] = 'new [1]'
+print('t[1] =', t[1])
+print('for k, v in pairs(t) do')
+for k, v in pairs(t) do
+ print(`{k}: {v}`)
+end
+print('for k, v in ipairs(t) do')
+for k, v in ipairs(t) do
+ print(`{k}: {v}`)
+end
+print('for k, v in t do')
+for k, v in t do
+ print(`{k}: {v}`)
+end
+-- and now for something completely different
+setmetatable(
+ t._target,
+ {
+ __iter = function(arg)
+ return next, {'alternate', '__iter'}
+ end
+ }
+)
+print('for k, v in t with __iter() metamethod do')
+for k, v in t do
+ print(`{k}: {v}`)
+end
+
+print('function')
+f = LL.setdtor('function', function(a, b) return (a .. b) end, print)
+print('f =', f)
+print('f._target =', f._target)
+print('f("Hello", " world") =', f("Hello", " world"))
+
+print('cleanup')
diff --git a/indra/newview/scripts/lua/test_snapshot.lua b/indra/newview/scripts/lua/test_snapshot.lua
new file mode 100644
index 0000000000..d7c878833b
--- /dev/null
+++ b/indra/newview/scripts/lua/test_snapshot.lua
@@ -0,0 +1,15 @@
+local UI = require 'UI'
+
+PATH = 'E:\\'
+-- 'png', 'jpeg' or 'bmp'
+EXT = '.png'
+
+NAME_SIMPLE = 'Snapshot_simple' .. '_' .. os.date("%Y-%m-%d_%H-%M-%S")
+UI.snapshot(PATH .. NAME_SIMPLE .. EXT)
+
+NAME_ARGS = 'Snapshot_args' .. '_' .. os.date("%Y-%m-%d_%H-%M-%S")
+
+-- 'COLOR' or 'DEPTH'
+TYPE = 'COLOR'
+UI.snapshot{PATH .. NAME_ARGS .. EXT, width = 700, height = 400,
+ type = TYPE, showui = false, showhud = false}
diff --git a/indra/newview/scripts/lua/test_timers.lua b/indra/newview/scripts/lua/test_timers.lua
new file mode 100644
index 0000000000..be5001aa16
--- /dev/null
+++ b/indra/newview/scripts/lua/test_timers.lua
@@ -0,0 +1,63 @@
+local timers = require 'timers'
+
+-- This t0 is constructed for 10 seconds, but its purpose is to exercise the
+-- query and cancel methods. It would print "t0 fired at..." if it fired, but
+-- it doesn't, so you don't see that message. Instead you see that isRunning()
+-- is true, that timeUntilCall() is (true, close to 10), that cancel() returns
+-- true. After that, isRunning() is false, timeUntilCall() returns (false, 0),
+-- and a second cancel() returns false.
+print('t0(10)')
+start = os.clock()
+t0 = timers.Timer(10, function() print('t0 fired at', os.clock() - start) end)
+print('t0:isRunning(): ', t0:isRunning())
+print('t0:timeUntilCall(): ', t0:timeUntilCall())
+print('t0:cancel(): ', t0:cancel())
+print('t0:isRunning(): ', t0:isRunning())
+print('t0:timeUntilCall(): ', t0:timeUntilCall())
+print('t0:cancel(): ', t0:cancel())
+
+-- t1 is supposed to fire after 5 seconds, but it doesn't wait, so you see the
+-- t2 messages immediately after.
+print('t1(5)')
+start = os.clock()
+t1 = timers.Timer(5, function() print('t1 fired at', os.clock() - start) end)
+
+-- t2 illustrates that instead of passing a callback to new(), you can
+-- override the timer instance's tick() method. But t2 doesn't wait either, so
+-- you see the Timer(5) message immediately.
+print('t2(2)')
+start = os.clock()
+t2 = timers.Timer(2)
+function t2:tick()
+ print('t2 fired at', os.clock() - start)
+end
+
+-- This anonymous timer blocks the calling fiber for 5 seconds. Other fibers
+-- are free to run during that time, so you see the t2 callback message and
+-- then the t1 callback message before the Timer(5) completion message.
+print('Timer(5) waiting')
+start = os.clock()
+timers.Timer(5, 'wait')
+print(string.format('Timer(5) waited %f seconds', os.clock() - start))
+
+-- This test demonstrates a repeating timer. It also shows that you can (but
+-- need not) use a coroutine as the timer's callback function: unlike Python,
+-- Lua doesn't disinguish between yield() and return. A coroutine wrapped with
+-- coroutine.wrap() looks to Lua just like any other function that you can
+-- call repeatedly and get a result each time. We use that to count the
+-- callback calls and stop after a certain number. Of course that could also
+-- be arranged in a plain function by incrementing a script-scope counter, but
+-- it's worth knowing that a coroutine timer callback can be used to manage
+-- more complex control flows.
+start = os.clock()
+timers.Timer(
+ 2,
+ coroutine.wrap(function()
+ for i = 1,5 do
+ print('repeat(2) timer fired at ', os.clock() - start)
+ coroutine.yield(nil) -- keep running
+ end
+ print('repeat(2) timer fired last at ', os.clock() - start)
+ return true -- stop
+ end),
+ true) -- iterate
diff --git a/indra/newview/scripts/lua/test_toolbars.lua b/indra/newview/scripts/lua/test_toolbars.lua
new file mode 100644
index 0000000000..7683fca8a3
--- /dev/null
+++ b/indra/newview/scripts/lua/test_toolbars.lua
@@ -0,0 +1,26 @@
+UI = require 'UI'
+
+local BUTTONS = UI.getToolbarBtnNames()
+local TOOLBARS = {'left','right','bottom'}
+
+-- Clear the toolbars and then add the toolbar buttons to the random toolbar
+response = UI.popup:alertYesCancel('Toolbars will be randomly reshuffled. Proceed?')
+if response == 'OK' then
+ UI.clearAllToolbars()
+ math.randomseed(os.time())
+
+ -- add the buttons to the random toolbar
+ for i = 1, #BUTTONS do
+ UI.addToolbarBtn(BUTTONS[i], TOOLBARS[math.random(3)])
+ end
+
+ -- remove some of the added buttons from the toolbars
+ for i = 1, #BUTTONS do
+ if math.random(100) < 30 then
+ UI.removeToolbarBtn(BUTTONS[i])
+ end
+ end
+ popup:tip('Toolbars were reshuffled')
+else
+ popup:tip('Canceled')
+end
diff --git a/indra/newview/scripts/lua/test_top_menu.lua b/indra/newview/scripts/lua/test_top_menu.lua
new file mode 100644
index 0000000000..f877cda5eb
--- /dev/null
+++ b/indra/newview/scripts/lua/test_top_menu.lua
@@ -0,0 +1,52 @@
+UI = require 'UI'
+
+--Add new drop-down 'LUA Menu' to the Top menu.
+local MENU_NAME = "lua_menu"
+UI.addMenu{name=MENU_NAME,label="LUA Menu"}
+
+--Add two new menu items to the 'LUA Menu': 'Debug console' and 'Scripts'
+UI.addMenuItem{name="lua_debug",label="Debug console",
+ param="lua_debug",
+ func="Floater.ToggleOrBringToFront",
+ parent_menu=MENU_NAME}
+
+UI.addMenuItem{name="lua_scripts",label="Scripts",
+ param="lua_scripts",
+ func="Floater.ToggleOrBringToFront",
+ parent_menu=MENU_NAME}
+
+--Add menu separator to the 'LUA Menu' under added menu items
+UI.addMenuSeparator{parent_menu=MENU_NAME}
+
+--Add 'Demo scripts...' branch to the 'LUA Menu'
+local DEMO_BRANCH = "demo_scripts"
+UI.addMenuBranch{name=DEMO_BRANCH,label="Demo scripts...",parent_menu=MENU_NAME}
+
+--Add menu items to the 'Demo scripts...' branch, which will invoke specified script on click
+UI.addMenuItem{name="speedometer",label="Speedometer",
+ param="test_luafloater_speedometer.lua",
+ func="Lua.RunScript",
+ parent_menu=DEMO_BRANCH}
+
+UI.addMenuItem{name="gesture_list",label="Gesture list",
+ param="test_luafloater_gesture_list.lua",
+ func="Lua.RunScript",
+ parent_menu=DEMO_BRANCH}
+
+--Add one more menu separator
+UI.addMenuSeparator{parent_menu=MENU_NAME}
+
+--Add 'About...' branch to the 'LUA Menu'
+local ABOUT_BRANCH = "about_branch"
+UI.addMenuBranch{name=ABOUT_BRANCH,label="About...",parent_menu=MENU_NAME}
+
+--Add two new menu items to the 'About...' branch
+UI.addMenuItem{name="lua_info",label="Lua...",
+ param="https://www.lua.org/about.html",
+ func="Advanced.ShowURL",
+ parent_menu=ABOUT_BRANCH}
+
+UI.addMenuItem{name="lua_info",label="Luau...",
+ param="https://luau-lang.org/",
+ func="Advanced.ShowURL",
+ parent_menu=ABOUT_BRANCH}
diff --git a/indra/newview/scripts/lua/testmod.lua b/indra/newview/scripts/lua/testmod.lua
new file mode 100644
index 0000000000..60f7f80db1
--- /dev/null
+++ b/indra/newview/scripts/lua/testmod.lua
@@ -0,0 +1,2 @@
+print('loaded scripts/lua/testmod.lua')
+return function () return 'hello from scripts/lua/testmod.lua' end
diff --git a/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml
index 602424821f..09447cbbaf 100644
--- a/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml
@@ -7,7 +7,7 @@
<combo_box.item label="Klein (128x128)" name="Small(128x128)"/>
<combo_box.item label="Mittel (256x256)" name="Medium(256x256)"/>
<combo_box.item label="Groß (512x512)" name="Large(512x512)"/>
- <combo_box.item label="Aktuelles Fenster (512x512)" name="CurrentWindow"/>
+ <combo_box.item label="Aktuelles Fenster" name="CurrentWindow"/>
<combo_box.item label="Benutzerdefiniert" name="Custom"/>
</combo_box>
<spinner label="Breite x Höhe" name="inventory_snapshot_width"/>
diff --git a/indra/newview/skins/default/xui/de/panel_snapshot_options.xml b/indra/newview/skins/default/xui/de/panel_snapshot_options.xml
index dab20d63eb..2a51f10894 100644
--- a/indra/newview/skins/default/xui/de/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/de/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="Auf Datenträger speichern" name="save_to_computer_btn"/>
- <button label="In Inventar speichern ([AMOUNT] L$)" name="save_to_inventory_btn"/>
+ <button label="In Inventar speichern" name="save_to_inventory_btn"/>
<button label="Im Profil-Feed teilen" name="save_to_profile_btn"/>
<button label="Auf Facebook teilen" name="send_to_facebook_btn"/>
<button label="Auf Twitter teilen" name="send_to_twitter_btn"/>
diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml
index a9e7626dc5..486d604e9f 100644
--- a/indra/newview/skins/default/xui/de/strings.xml
+++ b/indra/newview/skins/default/xui/de/strings.xml
@@ -31,7 +31,6 @@ Sichtweite: [DRAW_DISTANCE] m
Bandbreite: [NET_BANDWITH] kbit/s
LOD-Faktor: [LOD_FACTOR]
Darstellungsqualität: [RENDER_QUALITY]
-Erweitertes Beleuchtungsmodell: [GPU_SHADERS]
Texturspeicher: [TEXTURE_MEMORY] MB</string>
<string name="AboutOSXHiDPI">HiDPI-Anzeigemodus: [HIDPI]</string>
<string name="AboutLibs">J2C-Decoderversion: [J2C_VERSION]
diff --git a/indra/newview/skins/default/xui/en/floater_emoji_picker.xml b/indra/newview/skins/default/xui/en/floater_emoji_picker.xml
index e4b8f13df7..f642ca93b7 100644
--- a/indra/newview/skins/default/xui/en/floater_emoji_picker.xml
+++ b/indra/newview/skins/default/xui/en/floater_emoji_picker.xml
@@ -13,7 +13,6 @@
chrome="true"
height="350"
width="304">
- <floater.string name="title_for_recently_used" value="Recently used"/>
<floater.string name="title_for_frequently_used" value="Frequently used"/>
<floater.string name="text_no_emoji_for_filter" value="No emoji found for '[FILTER]'"/>
<scroll_container
diff --git a/indra/newview/skins/default/xui/en/floater_fast_timers.xml b/indra/newview/skins/default/xui/en/floater_fast_timers.xml
index 00411ba20b..ae907bcb5f 100644
--- a/indra/newview/skins/default/xui/en/floater_fast_timers.xml
+++ b/indra/newview/skins/default/xui/en/floater_fast_timers.xml
@@ -75,7 +75,7 @@
step_size="16"
doc_pos="0"
doc_size="3000"
- page_size="0"
+ page_size="50"
/>
</layout_panel>
<layout_panel name="timers_panel"
diff --git a/indra/newview/skins/default/xui/en/floater_gltf_asset_editor.xml b/indra/newview/skins/default/xui/en/floater_gltf_asset_editor.xml
index b17d0aa5b6..025d537804 100644
--- a/indra/newview/skins/default/xui/en/floater_gltf_asset_editor.xml
+++ b/indra/newview/skins/default/xui/en/floater_gltf_asset_editor.xml
@@ -11,10 +11,10 @@
name="gltf asset editor"
title="[OBJECT_NAME]">
<floater.string name="floater_title" value="GLTF Scene Editor"/>
- <floater.string name="scene_tittle" value="Scene"/>
- <floater.string name="node_tittle" value="Node"/>
- <floater.string name="mesh_tittle" value="Mesh"/>
- <floater.string name="skin_tittle" value="Skin"/>
+ <floater.string name="scene_title" value="Scene"/>
+ <floater.string name="node_title" value="Node"/>
+ <floater.string name="mesh_title" value="Mesh"/>
+ <floater.string name="skin_title" value="Skin"/>
<layout_stack
name="main_layout"
diff --git a/indra/newview/skins/default/xui/en/floater_lua_debug.xml b/indra/newview/skins/default/xui/en/floater_lua_debug.xml
new file mode 100644
index 0000000000..15027f1647
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_lua_debug.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ can_minimize="false"
+ can_resize="true"
+ can_close="true"
+ bevel_style="in"
+ height="220"
+ layout="topleft"
+ name="LUA debug"
+ save_rect="true"
+ title="LUA DEBUG"
+ single_instance="true"
+ width="535">
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ font="SansSerif"
+ height="30"
+ layout="topleft"
+ left="10"
+ left_delta="10"
+ name="editor_path_label"
+ top="10"
+ width="100">
+ LUA string:
+ </text>
+ <line_editor
+ border_style="line"
+ border_thickness="1"
+ follows="left|top|right"
+ font="SansSerif"
+ height="20"
+ layout="topleft"
+ left="10"
+ max_length_bytes="300"
+ name="lua_cmd"
+ select_on_focus="true"
+ top_delta="30"
+ width="435" />
+ <button
+ follows="right|top"
+ height="25"
+ label="Execute"
+ layout="topleft"
+ left_pad="5"
+ name="execute_btn"
+ top_delta="-2"
+ width="75" />
+
+ <text_editor
+ enabled="false"
+ left="10"
+ height="95"
+ layout="topleft"
+ name="result_text"
+ follows="all"
+ max_length="65536"
+ width="515"
+ top_delta="40"
+ word_wrap="true" />
+ <text
+ type="string"
+ length="1"
+ follows="left|bottom"
+ font="SansSerif"
+ height="30"
+ layout="topleft"
+ left="10"
+ name="path_label"
+ top_pad="15"
+ width="100">
+ File Path:
+ </text>
+ <line_editor
+ border_style="line"
+ enabled="false"
+ border_thickness="1"
+ follows="left|bottom|right"
+ font="SansSerif"
+ height="20"
+ layout="topleft"
+ left_delta="65"
+ max_length_bytes="300"
+ name="script_path"
+ select_on_focus="true"
+ top_delta="-2"
+ width="320" />
+ <button
+ follows="right|bottom"
+ height="25"
+ label="Browse..."
+ label_selected="Browse..."
+ layout="topleft"
+ left_pad="5"
+ name="browse_btn"
+ top_delta="-2"
+ width="70" />
+ <button
+ follows="right|bottom"
+ height="25"
+ label="Run"
+ label_selected="Run"
+ layout="topleft"
+ left_pad="5"
+ name="run_btn"
+ width="50" />
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_lua_scripts.xml b/indra/newview/skins/default/xui/en/floater_lua_scripts.xml
new file mode 100644
index 0000000000..6859201650
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_lua_scripts.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ can_minimize="false"
+ can_resize="true"
+ can_close="true"
+ bevel_style="in"
+ height="220"
+ min_height="220"
+ layout="topleft"
+ name="LUA scripts"
+ save_rect="true"
+ title="LUA Scripts"
+ single_instance="true"
+ width="555"
+ min_width="555">
+ <scroll_list
+ column_padding="0"
+ draw_stripes="true"
+ draw_heading="true"
+ height="200"
+ left="10"
+ follows="all"
+ layout="topleft"
+ sort_column="script_name"
+ name="scripts_list"
+ top_pad="10"
+ width="535">
+ <scroll_list.columns
+ label="Name"
+ name="script_name"
+ width="180" />
+ <scroll_list.columns
+ label="Path"
+ name="script_path"/>
+ </scroll_list>
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_post_process.xml b/indra/newview/skins/default/xui/en/floater_post_process.xml
deleted file mode 100644
index 37339f79c8..0000000000
--- a/indra/newview/skins/default/xui/en/floater_post_process.xml
+++ /dev/null
@@ -1,426 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater
- legacy_header_height="18"
- height="400"
- layout="topleft"
- name="Post-Process Floater"
- help_topic="post_process_floater"
- title="POST-PROCESS SETTINGS"
- width="400">
- <tab_container
- follows="left|top"
- height="400"
- layout="topleft"
- left="0"
- name="Post-Process Tabs"
- tab_position="top"
- top="0"
- width="400">
- <panel
- border="true"
- follows="left|top|right|bottom"
- height="400"
- label="Color Filter"
- layout="topleft"
- left="1"
- mouse_opaque="false"
- help_topic="post_process_color_filter_tab"
- name="wmiColorFilterPanel"
- top="0"
- width="398">
- <check_box
- control_name="wmiColorFilterToggle"
- height="16"
- label="Enable"
- layout="topleft"
- left="14"
- name="wmiColorFilterToggle"
- top="4"
- width="200" />
- <text
- type="string"
- length="1"
- follows="left|top|right"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-4"
- name="wmiColorFilterBrightnessText"
- top_pad="4"
- width="355">
- Brightness
- </text>
- <slider
- control_name="wmiColorFilterBrightness"
- decimal_digits="2"
- follows="left"
- height="10"
- increment="0.01"
- initial_value="1.0"
- layout="topleft"
- left_delta="4"
- max_val="4"
- name="wmiColorFilterBrightness"
- top_pad="20"
- width="200" />
- <text
- type="string"
- length="1"
- follows="left|top|right"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-4"
- name="wmiColorFilterSaturationText"
- top_pad="4"
- width="355">
- Saturation
- </text>
- <slider
- control_name="wmiColorFilterSaturation"
- decimal_digits="2"
- follows="left"
- height="10"
- increment="0.01"
- initial_value="1.0"
- layout="topleft"
- left_delta="4"
- max_val="2"
- min_val="-1"
- name="wmiColorFilterSaturation"
- top_pad="20"
- width="200" />
- <text
- type="string"
- length="1"
- follows="left|top|right"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-4"
- name="wmiColorFilterContrastText"
- top_pad="4"
- width="355">
- Contrast
- </text>
- <slider
- control_name="wmiColorFilterContrast"
- decimal_digits="2"
- follows="left"
- height="10"
- increment="0.01"
- initial_value="1.0"
- layout="topleft"
- left_delta="4"
- max_val="4"
- name="wmiColorFilterContrast"
- top_pad="20"
- width="200" />
- <text
- type="string"
- length="1"
- follows="left|top|right"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-4"
- name="wmiColorFilterBaseText"
- top_pad="4"
- width="355">
- Contrast Base Color
- </text>
- <slider
- control_name="wmiColorFilterBaseR"
- follows="left"
- height="10"
- increment="0.01"
- initial_value="1.0"
- label="R"
- layout="topleft"
- left_delta="4"
- name="wmiColorFilterBaseR"
- top_pad="20"
- width="200" />
- <slider
- control_name="wmiColorFilterBaseG"
- follows="left"
- height="10"
- increment="0.01"
- initial_value="1.0"
- label="G"
- layout="topleft"
- left_delta="0"
- name="wmiColorFilterBaseG"
- top_pad="10"
- width="200" />
- <slider
- control_name="wmiColorFilterBaseB"
- follows="left"
- height="10"
- increment="0.01"
- initial_value="1.0"
- label="B"
- layout="topleft"
- left_delta="0"
- name="wmiColorFilterBaseB"
- top_pad="10"
- width="200" />
- <slider
- control_name="wmiColorFilterBaseI"
- follows="left"
- height="10"
- increment="0.01"
- initial_value="0.5"
- label="I"
- layout="topleft"
- left_delta="0"
- name="wmiColorFilterBaseI"
- top_pad="10"
- width="200" />
- </panel>
- <panel
- border="true"
- follows="left|top|right|bottom"
- height="400"
- label="Night Vision"
- layout="topleft"
- left_delta="0"
- mouse_opaque="false"
- help_topic="post_process_night_vision_tab"
- name="wmiNightVisionPanel"
- top_delta="-236"
- width="398">
- <check_box
- control_name="wmiNightVisionToggle"
- height="16"
- label="Enable"
- layout="topleft"
- left="14"
- name="wmiNightVisionToggle"
- top="4"
- width="200" />
- <text
- type="string"
- length="1"
- follows="left|top|right"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-4"
- name="wmiNightVisionBrightMultText"
- top_pad="5"
- width="355">
- Light Amplification Multiple
- </text>
- <slider
- control_name="wmiNightVisionBrightMult"
- follows="left"
- height="10"
- increment="0.01"
- initial_value="3.0"
- layout="topleft"
- left_delta="4"
- max_val="10"
- min_val="1"
- name="wmiNightVisionBrightMult"
- top_pad="20"
- width="200" />
- <text
- type="string"
- length="1"
- follows="left|top|right"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-4"
- name="wmiNightVisionNoiseSizeText"
- top_pad="4"
- width="355">
- Noise Size
- </text>
- <slider
- control_name="wmiNightVisionNoiseSize"
- follows="left"
- height="10"
- initial_value="1"
- layout="topleft"
- left_delta="4"
- max_val="100"
- min_val="1"
- name="wmiNightVisionNoiseSize"
- top_pad="20"
- width="200" />
- <text
- type="string"
- length="1"
- follows="left|top|right"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-4"
- name="wmiNightVisionNoiseStrengthText"
- top_pad="4"
- width="355">
- Noise Strength
- </text>
- <slider
- control_name="wmiNightVisionNoiseStrength"
- follows="left"
- height="10"
- increment="0.01"
- initial_value="0.3"
- layout="topleft"
- left_delta="4"
- name="wmiNightVisionNoiseStrength"
- top_pad="20"
- width="200" />
- </panel>
- <panel
- border="true"
- follows="left|top|right|bottom"
- height="400"
- label="Bloom"
- layout="topleft"
- left_delta="0"
- help_topic="post_process_bloom_tab"
- name="wmiBloomPanel"
- top_delta="-236"
- width="398">
- <check_box
- control_name="wmiBloomToggle"
- height="16"
- label="Enable"
- layout="topleft"
- left="14"
- name="wmiBloomToggle"
- top="4"
- width="200" />
- <text
- type="string"
- length="1"
- follows="left|top|right"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-4"
- name="wmiBloomExtractText"
- top_pad="5"
- width="355">
- Luminosity Extraction
- </text>
- <slider
- control_name="wmiBloomExtract"
- follows="left"
- height="10"
- increment="0.01"
- initial_value="0.9"
- layout="topleft"
- left_delta="4"
- name="wmiBloomExtract"
- top_pad="20"
- width="200" />
- <text
- type="string"
- length="1"
- follows="left|top|right"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-4"
- name="wmiBloomSizeText"
- top_pad="4"
- width="355">
- Bloom Size
- </text>
- <slider
- control_name="wmiBloomSize"
- follows="left"
- height="10"
- increment="0.01"
- initial_value="3.0"
- layout="topleft"
- left_delta="4"
- max_val="20"
- name="wmiBloomSize"
- top_pad="20"
- width="200" />
- <text
- type="string"
- length="1"
- follows="left|top|right"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-4"
- name="wmiBloomStrengthText"
- top_pad="4"
- width="355">
- Bloom Strength
- </text>
- <slider
- control_name="wmiBloomStrength"
- follows="left"
- height="10"
- increment="0.01"
- initial_value="1.2"
- layout="topleft"
- left_delta="4"
- max_val="10"
- name="wmiBloomStrength"
- top_pad="20"
- width="200" />
- </panel>
- <panel
- border="true"
- follows="left|top|right|bottom"
- height="400"
- label="Extras"
- layout="topleft"
- left_delta="0"
- mouse_opaque="false"
- help_topic="post_process_extras_tab"
- name="Extras"
- top_delta="-236"
- width="398">
- <button
- height="20"
- label="LoadEffect"
- label_selected="LoadEffect"
- layout="topleft"
- left="15"
- name="PPLoadEffect"
- top="13"
- width="100" />
- <button
- height="20"
- label="SaveEffect"
- label_selected="SaveEffect"
- layout="topleft"
- left_delta="0"
- name="PPSaveEffect"
- top_pad="7"
- width="100" />
- <combo_box
- height="18"
- layout="topleft"
- left_delta="120"
- name="PPEffectsCombo"
- top="15"
- width="150" />
- <line_editor
- border_style="line"
- border_thickness="1"
- follows="left|right|bottom"
- font="SansSerif"
- height="20"
- label="Effect Name"
- layout="topleft"
- left_delta="0"
- max_length_bytes="40"
- name="PPEffectNameEditor"
- tab_group="1"
- top_pad="22"
- width="150" />
- </panel>
- </tab_container>
-</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml
index 1deb81175e..73ea0f548e 100644
--- a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml
+++ b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml
@@ -222,7 +222,7 @@
height="16"
increment="1"
initial_value="12"
- label="Max. # of non-impostors:"
+ label="Max. # animated avatars:"
label_width="185"
layout="topleft"
left="30"
@@ -943,6 +943,57 @@
width="260">
</slider>
<!-- End of Sharpening Settings-->
+ <!-- Tone Mapping Settings -->
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="420"
+ name="TonemapTypeText"
+ text_readonly_color="LabelDisabledColor"
+ top_delta="25"
+ width="128">
+ Tone Mapper:
+ </text>
+ <combo_box
+ control_name="RenderTonemapType"
+ height="18"
+ layout="topleft"
+ left_delta="130"
+ top_delta="0"
+ name="TonemapType"
+ width="150">
+ <combo_box.item
+ label="Khronos Neutral"
+ name="0"
+ value="0"/>
+ <combo_box.item
+ label="ACES"
+ name="1"
+ value="1"/>
+ </combo_box>
+ <slider
+ control_name="RenderTonemapMix"
+ decimal_digits="1"
+ follows="left|top"
+ height="16"
+ increment="0.1"
+ initial_value="1"
+ label="Tone Mapping Mix:"
+ tool_tip="Mix between linear and tone mapped colors"
+ label_width="145"
+ layout="topleft"
+ left="420"
+ min_val="0.0"
+ max_val="1.0"
+ name="TonemapMix"
+ show_text="true"
+ top_delta="22"
+ width="260">
+ </slider>
+ <!-- End of Tone Mapping Settings-->
<!-- End of Advanced Settings block -->
<view_border
bevel_style="in"
diff --git a/indra/newview/skins/default/xui/en/floater_settings_debug.xml b/indra/newview/skins/default/xui/en/floater_settings_debug.xml
index a93be6a18d..0b8190df7e 100644
--- a/indra/newview/skins/default/xui/en/floater_settings_debug.xml
+++ b/indra/newview/skins/default/xui/en/floater_settings_debug.xml
@@ -43,6 +43,20 @@
label="Setting"
name="setting" />
</scroll_list>
+ <button
+ follows="right|bottom"
+ layout="topleft"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="Icon_Copy"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ name="copy_btn"
+ tool_tip="Copy to clipboard"
+ top_delta="8"
+ left_pad="10"
+ visible="false"
+ height="20"
+ width="20" />
<text
type="string"
length="1"
@@ -51,12 +65,11 @@
layout="topleft"
name="setting_name_txt"
font="SansSerifSmallBold"
- top_delta="8"
- left_pad="10"
+ left_pad="4"
visible="false"
use_ellipses="true"
text_color="White"
- width="240">
+ width="225">
Debug setting name
</text>
<text_editor
@@ -67,6 +80,7 @@
name="comment_text"
follows="left|top"
width="240"
+ left="320"
top_delta="20"
word_wrap="true" />
<radio_group
@@ -198,4 +212,15 @@
name="hide_default"
width="330">
</check_box>
+ <text_editor
+ read_only="true"
+ visible="false"
+ height="115"
+ layout="topleft"
+ name="llsd_text"
+ follows="left|top"
+ width="240"
+ left="320"
+ top="180"
+ word_wrap="true" />
</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml
index b0b818cde5..5ab0177de6 100644
--- a/indra/newview/skins/default/xui/en/floater_world_map.xml
+++ b/indra/newview/skins/default/xui/en/floater_world_map.xml
@@ -37,7 +37,8 @@
top="16"
left="0"
right="-1"
- bottom="-1">
+ bottom="-1"
+ orientation="horizontal">
<layout_panel
name="map_lp"
width="385"
diff --git a/indra/newview/skins/default/xui/en/menu_lua_scripts.xml b/indra/newview/skins/default/xui/en/menu_lua_scripts.xml
new file mode 100644
index 0000000000..645fee405d
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/menu_lua_scripts.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<context_menu
+ name="Scripts">
+ <menu_item_call
+ label="Open Containing Folder"
+ layout="topleft"
+ name="open_folder">
+ <menu_item_call.on_click
+ function="Script.OpenFolder" />
+ </menu_item_call>
+ <menu_item_separator/>
+ <menu_item_call
+ label="Terminate script"
+ layout="topleft"
+ name="terminate">
+ <menu_item_call.on_click
+ function="Script.Terminate" />
+ </menu_item_call>
+</context_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index bcd5a09d16..c825a811e6 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -465,24 +465,6 @@
<menu_item_check.on_click
function="World.AlwaysRun" />
</menu_item_check>
- <menu_item_check
- label="Hear Media and Sound from Avatar"
- name="Hear Media and Sound from Avatar">
- <menu_item_check.on_check
- control="MediaSoundsEarLocation" />
- <menu_item_check.on_click
- function="Agent.ToggleHearMediaSoundFromAvatar" />
- </menu_item_check>
- <menu_item_check
- label="Hear Voice from Avatar"
- name="Hear Voice from Avatar">
- <menu_item_check.on_check
- control="VoiceEarLocation" />
- <menu_item_check.on_click
- function="Agent.ToggleHearVoiceFromAvatar" />
- <menu_item_call.on_enable
- control="EnableVoiceChat" />
- </menu_item_check>
<menu_item_separator/>
<menu_item_check
label="Gestures..."
@@ -580,6 +562,25 @@
</menu_item_check>
<menu_item_separator/>
<menu_item_check
+ label="Hear Media and Sound from Avatar"
+ name="Hear Media and Sound from Avatar">
+ <menu_item_check.on_check
+ control="MediaSoundsEarLocation" />
+ <menu_item_check.on_click
+ function="Agent.ToggleHearMediaSoundFromAvatar" />
+ </menu_item_check>
+ <menu_item_check
+ label="Hear Voice from Avatar"
+ name="Hear Voice from Avatar">
+ <menu_item_check.on_check
+ control="VoiceEarLocation" />
+ <menu_item_check.on_click
+ function="Agent.ToggleHearVoiceFromAvatar" />
+ <menu_item_call.on_enable
+ control="EnableVoiceChat" />
+ </menu_item_check>
+ <menu_item_separator/>
+ <menu_item_check
label="Gestures..."
name="Gestures"
shortcut="control|G">
@@ -2653,6 +2654,37 @@ function="World.EnvPreset"
parameter="scene monitor" />
</menu_item_check>
<menu_item_separator/>
+ <menu_item_check
+ label="LUA Debug Console"
+ name="LUA Debug Console">
+ <menu_item_check.on_check
+ function="Floater.Visible"
+ parameter="lua_debug" />
+ <menu_item_check.on_click
+ function="Floater.Toggle"
+ parameter="lua_debug" />
+ <menu_item_check.on_visible
+ function="CheckControl"
+ parameter="LuaFeature" />
+ </menu_item_check>
+ <menu_item_check
+ label="LUA Scripts Info"
+ name="LUA Scripts">
+ <menu_item_check.on_check
+ function="Floater.Visible"
+ parameter="lua_scripts" />
+ <menu_item_check.on_click
+ function="Floater.Toggle"
+ parameter="lua_scripts" />
+ <menu_item_check.on_visible
+ function="CheckControl"
+ parameter="LuaFeature" />
+ </menu_item_check>
+ <menu_item_separator>
+ <menu_item_separator.on_visible
+ function="CheckControl"
+ parameter="LuaFeature"/>
+ </menu_item_separator>
<menu_item_call
label="Region Info to Debug Console"
@@ -4287,16 +4319,6 @@ function="World.EnvPreset"
<menu_item_separator/>
- <menu_item_check
- label="HTTP Textures"
- name="HTTP Textures">
- <menu_item_check.on_check
- function="CheckControl"
- parameter="ImagePipelineUseHTTP" />
- <menu_item_check.on_click
- function="ToggleControl"
- parameter="ImagePipelineUseHTTP" />
- </menu_item_check>
<menu_item_call
label="Compress Images"
name="Compress Images">
diff --git a/indra/newview/skins/default/xui/en/mime_types_linux.xml b/indra/newview/skins/default/xui/en/mime_types_linux.xml
index d0ecd0a11c..87284f564b 100644
--- a/indra/newview/skins/default/xui/en/mime_types_linux.xml
+++ b/indra/newview/skins/default/xui/en/mime_types_linux.xml
@@ -7,7 +7,7 @@
none
</defaultwidget>
<defaultimpl>
- media_plugin_webkit
+ media_plugin_cef
</defaultimpl>
<widgetset name="web">
<label name="web_label">
@@ -130,7 +130,7 @@
movie
</widgettype>
<impl>
- media_plugin_libvlc
+ media_plugin_gstreamer
</impl>
</scheme>
<mimetype name="blank">
@@ -141,7 +141,7 @@
none
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype name="none/none">
@@ -152,7 +152,7 @@
none
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype name="audio/*">
@@ -163,7 +163,7 @@
audio
</widgettype>
<impl>
- media_plugin_libvlc
+ media_plugin_gstreamer
</impl>
</mimetype>
<mimetype name="video/*">
@@ -174,7 +174,7 @@
movie
</widgettype>
<impl>
- media_plugin_libvlc
+ media_plugin_gstreamer
</impl>
</mimetype>
<mimetype name="image/*">
@@ -185,7 +185,7 @@
image
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype menu="1" name="video/vnd.secondlife.qt.legacy">
@@ -196,7 +196,7 @@
movie
</widgettype>
<impl>
- media_plugin_libvlc
+ media_plugin_gstreamer
</impl>
</mimetype>
<mimetype name="application/javascript">
@@ -207,7 +207,7 @@
web
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype name="application/ogg">
@@ -218,7 +218,7 @@
audio
</widgettype>
<impl>
- media_plugin_libvlc
+ media_plugin_gstreamer
</impl>
</mimetype>
<mimetype name="application/pdf">
@@ -229,7 +229,7 @@
image
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype name="application/postscript">
@@ -240,7 +240,7 @@
image
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype name="application/rtf">
@@ -251,7 +251,7 @@
image
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype name="application/smil">
@@ -262,7 +262,7 @@
movie
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype name="application/xhtml+xml">
@@ -273,7 +273,7 @@
web
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype name="application/x-director">
@@ -284,7 +284,7 @@
image
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype name="audio/mid">
@@ -295,7 +295,7 @@
audio
</widgettype>
<impl>
- media_plugin_libvlc
+ media_plugin_gstreamer
</impl>
</mimetype>
<mimetype name="audio/mpeg">
@@ -306,7 +306,7 @@
audio
</widgettype>
<impl>
- media_plugin_libvlc
+ media_plugin_gstreamer
</impl>
</mimetype>
<mimetype name="audio/x-aiff">
@@ -317,7 +317,7 @@
audio
</widgettype>
<impl>
- media_plugin_libvlc
+ media_plugin_gstreamer
</impl>
</mimetype>
<mimetype name="audio/x-wav">
@@ -328,7 +328,7 @@
audio
</widgettype>
<impl>
- media_plugin_libvlc
+ media_plugin_gstreamer
</impl>
</mimetype>
<mimetype menu="1" name="image/bmp">
@@ -339,7 +339,7 @@
image
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype menu="1" name="image/gif">
@@ -350,7 +350,7 @@
image
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype menu="1" name="image/jpeg">
@@ -361,7 +361,7 @@
image
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype menu="1" name="image/png">
@@ -372,7 +372,7 @@
image
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype name="image/svg+xml">
@@ -383,7 +383,7 @@
image
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype menu="1" name="image/tiff">
@@ -394,7 +394,7 @@
image
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype menu="1" name="text/html">
@@ -405,7 +405,7 @@
web
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype menu="1" name="text/plain">
@@ -416,7 +416,7 @@
text
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype name="text/xml">
@@ -427,7 +427,7 @@
text
</widgettype>
<impl>
- media_plugin_webkit
+ media_plugin_cef
</impl>
</mimetype>
<mimetype menu="1" name="video/mpeg">
@@ -438,7 +438,7 @@
movie
</widgettype>
<impl>
- media_plugin_libvlc
+ media_plugin_gstreamer
</impl>
</mimetype>
<mimetype name="video/mp4">
@@ -449,7 +449,7 @@
movie
</widgettype>
<impl>
- media_plugin_libvlc
+ media_plugin_gstreamer
</impl>
</mimetype>
<mimetype menu="1" name="video/quicktime">
@@ -460,7 +460,7 @@
movie
</widgettype>
<impl>
- media_plugin_libvlc
+ media_plugin_gstreamer
</impl>
</mimetype>
<mimetype name="video/x-ms-asf">
@@ -471,7 +471,7 @@
movie
</widgettype>
<impl>
- media_plugin_libvlc
+ media_plugin_gstreamer
</impl>
</mimetype>
<mimetype name="video/x-ms-wmv">
@@ -482,7 +482,7 @@
movie
</widgettype>
<impl>
- media_plugin_libvlc
+ media_plugin_gstreamer
</impl>
</mimetype>
<mimetype menu="1" name="video/x-msvideo">
@@ -493,7 +493,7 @@
movie
</widgettype>
<impl>
- media_plugin_libvlc
+ media_plugin_gstreamer
</impl>
</mimetype>
</mimetypes>
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 848d9aca7c..6c127ece53 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -7556,7 +7556,7 @@ Message from [NAME]:
type="notify">
<unique/>
This land has damage enabled.
-You can be hurt here. If you die, you will be teleported to your home location.
+You can be hurt here. If you die, you might be teleported to your home location or to the spawn point.
</notification>
<notification
diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml
index 02e135a2c7..868d54401e 100644
--- a/indra/newview/skins/default/xui/en/panel_group_roles.xml
+++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel
- height="750"
+ height="770"
label="Members &amp; Roles"
layout="topleft"
left="0"
@@ -18,9 +18,9 @@
<panel.string
name="help_text" />
<tab_container
- border="false"
+ border="false"
follows="left|top|right"
- height="552"
+ height="770"
halign="center"
layout="topleft"
left="0"
@@ -29,16 +29,10 @@
tab_position="top"
tab_height="22"
tab_min_width="90"
- top="0"
- width="304">
+ top="0">
<panel
border="false"
- follows="all"
- height="303"
label="MEMBERS"
- layout="topleft"
- left="0"
- right="-1"
help_topic="roles_members_tab"
name="members_sub_tab"
tool_tip="Members"
@@ -65,16 +59,16 @@ clicking on their names.
name="power_partial_icon" translate="false">
Checkbox_Off
</panel.string>
- <filter_editor
- layout="topleft"
- top="5"
- left="5"
- right="-5"
- height="22"
- search_button_visible="false"
- follows="left|top|right"
- label="Filter Members"
- name="filter_input" />
+ <filter_editor
+ layout="topleft"
+ top="5"
+ left="5"
+ right="-5"
+ height="22"
+ search_button_visible="false"
+ follows="left|top|right"
+ label="Filter Members"
+ name="filter_input" />
<name_list
column_padding="2"
draw_heading="true"
@@ -90,11 +84,11 @@ clicking on their names.
<name_list.columns
label="Member"
name="name"
- relative_width="0.44" />
+ relative_width="0.44" />
<name_list.columns
label="Donation"
name="donated"
- relative_width="0.2" />
+ relative_width="0.2" />
<name_list.columns
label="Status"
name="online"
@@ -118,25 +112,21 @@ clicking on their names.
left_pad="10"
name="member_eject"
width="100" />
- <button
- height="23"
- label="Ban Member(s)"
- follows="top|left"
- left_pad="10"
- name="member_ban"
- width="100" />
+ <button
+ height="23"
+ label="Ban Member(s)"
+ follows="top|left"
+ left_pad="10"
+ name="member_ban"
+ width="100" />
</panel>
<panel
border="false"
- height="303"
label="ROLES"
- layout="topleft"
- left="0"
- right="-1"
help_topic="roles_roles_tab"
name="roles_sub_tab"
class="panel_group_roles_subtab">
- <!-- <button
+ <!--<button
enabled="false"
height="20"
label="Show All"
@@ -145,411 +135,393 @@ clicking on their names.
right="-5"
name="show_all_button"
width="100" />-->
- <panel.string
- name="help_text">
- Roles have a title and an allowed list of Abilities
- that Members can perform. Members can belong to
- one or more Roles. A group can have up to 10 Roles,
- including the Everyone and Owner Roles.
- </panel.string>
- <panel.string
- name="cant_delete_role">
- The &apos;Everyone&apos; and &apos;Owners&apos; Roles are special and can't be deleted.
- </panel.string>
- <panel.string
- name="power_folder_icon" translate="false">
- Inv_FolderClosed
- </panel.string>
- <panel.string
- name="power_all_have_icon" translate="false">
- Checkbox_On
- </panel.string>
- <panel.string
- name="power_partial_icon" translate="false">
- Checkbox_Off
- </panel.string>
- <filter_editor
- layout="topleft"
- top="5"
- left="5"
- right="-5"
- height="22"
- search_button_visible="false"
- follows="left|top|right"
- label="Filter Roles"
- name="filter_input" />
- <scroll_list
- column_padding="0"
- draw_heading="true"
- draw_stripes="false"
- heading_height="23"
- height="132"
- layout="topleft"
- search_column="1"
- left="0"
- follows="left|top|right"
- right="-1"
- name="role_list"
- top_pad="2"
- width="310">
- <scroll_list.columns
- label="Role"
- name="name"
- relative_width="0.45" />
- <scroll_list.columns
- label="Title"
- name="title"
- relative_width="0.45" />
- <scroll_list.columns
- label="#"
- name="members"
- relative_width="0.15" />
- </scroll_list>
- <button
- follows="top|left"
- height="23"
- label="New Role"
- layout="topleft"
- left="0"
- name="role_create"
- width="100" />
- <button
- follows="top|left"
- height="23"
- label="Copy Role"
- layout="topleft"
- left_pad="10"
- name="role_copy"
- width="100" />
- <button
- height="23"
- follows="top|left"
- label="Delete Role"
- layout="topleft"
- left_pad="10"
- name="role_delete"
- width="100" />
- </panel>
+ <panel.string
+ name="help_text">
+ Roles have a title and an allowed list of Abilities
+that Members can perform. Members can belong to
+one or more Roles. A group can have up to 10 Roles,
+including the Everyone and Owner Roles.
+ </panel.string>
+ <panel.string
+ name="cant_delete_role">
+ The &apos;Everyone&apos; and &apos;Owners&apos; Roles are special and can't be deleted.
+ </panel.string>
+ <panel.string
+ name="power_folder_icon" translate="false">
+ Inv_FolderClosed
+ </panel.string>
+ <panel.string
+ name="power_all_have_icon" translate="false">
+ Checkbox_On
+ </panel.string>
+ <panel.string
+ name="power_partial_icon" translate="false">
+ Checkbox_Off
+ </panel.string>
+ <filter_editor
+ layout="topleft"
+ top="5"
+ left="5"
+ right="-5"
+ height="22"
+ search_button_visible="false"
+ follows="left|top|right"
+ label="Filter Roles"
+ name="filter_input" />
+ <scroll_list
+ column_padding="0"
+ draw_heading="true"
+ draw_stripes="false"
+ heading_height="23"
+ height="138"
+ layout="topleft"
+ search_column="1"
+ left="0"
+ follows="left|top|right"
+ right="-1"
+ name="role_list"
+ top_pad="2">
+ <scroll_list.columns
+ label="Role"
+ name="name"
+ relative_width="0.45" />
+ <scroll_list.columns
+ label="Title"
+ name="title"
+ relative_width="0.45" />
+ <scroll_list.columns
+ label="#"
+ name="members"
+ relative_width="0.15" />
+ </scroll_list>
+ <button
+ follows="top|left"
+ height="23"
+ label="New Role"
+ layout="topleft"
+ left="0"
+ name="role_create"
+ width="100" />
+ <button
+ follows="top|left"
+ height="23"
+ label="Copy Role"
+ layout="topleft"
+ left_pad="10"
+ name="role_copy"
+ width="100" />
+ <button
+ height="23"
+ follows="top|left"
+ label="Delete Role"
+ layout="topleft"
+ left_pad="10"
+ name="role_delete"
+ width="100" />
+ </panel>
+ <panel
+ border="false"
+ label="ABILITIES"
+ help_topic="roles_actions_tab"
+ name="actions_sub_tab"
+ class="panel_group_actions_subtab"
+ tool_tip="You can view an Ability&apos;s Description and which Roles and Members can execute the Ability.">
+ <panel.string
+ name="help_text">
+ Abilities allow Members in Roles to do specific
+things in this group. There&apos;s a broad variety of Abilities.
+ </panel.string>
+ <panel.string
+ name="power_folder_icon" translate="false">
+ Inv_FolderClosed
+ </panel.string>
+ <panel.string
+ name="power_all_have_icon" translate="false">
+ Checkbox_On
+ </panel.string>
+ <panel.string
+ name="power_partial_icon" translate="false">
+ Checkbox_Off
+ </panel.string>
+ <filter_editor
+ layout="topleft"
+ top="5"
+ left="5"
+ right="-5"
+ height="22"
+ search_button_visible="false"
+ follows="left|top|right"
+ label="Filter Abilities"
+ name="filter_input" />
+ <scroll_list
+ column_padding="0"
+ draw_stripes="true"
+ height="200"
+ follows="left|top|right"
+ layout="topleft"
+ left="0"
+ right="-1"
+ name="action_list"
+ search_column="2"
+ tool_tip="Select an Ability to view more details"
+ top_pad="5">
+ <scroll_list.columns
+ label=""
+ name="icon"
+ width="2" />
+ <scroll_list.columns
+ label=""
+ name="checkbox"
+ width="20" />
+ <scroll_list.columns
+ label=""
+ name="action" />
+ </scroll_list>
+ </panel>
+ <panel
+ border="false"
+ label="BANNED RESIDENTS"
+ help_topic="roles_banlist_tab"
+ name="banlist_sub_tab"
+ class="panel_group_banlist_subtab"
+ tool_tip="View the banned residents from this group.">
+ <panel.string
+ name="help_text">
+ Any resident on the ban list will be unable to join the group.
+ </panel.string>
+ <panel.string
+ name="ban_count_template">
+ Ban count: [COUNT]/[LIMIT]
+ </panel.string>
+ <name_list
+ column_padding="0"
+ draw_heading="true"
+ height="714"
+ follows="left|top|right"
+ layout="topleft"
+ left="0"
+ right="-1"
+ multi_select="true"
+ name="ban_list"
+ short_names="false"
+ top_pad="5">
+ <name_list.columns
+ label="Resident"
+ name="name"
+ font.name="SANSSERIF_SMALL"
+ font.style="NORMAL"
+ relative_width="0.7" />
+ <name_list.columns
+ label="Date Banned"
+ name="ban_date"
+ relative_width="0.3" />
+ </name_list>
+ <button
+ follows="top|left"
+ height="23"
+ label="Ban Resident(s)"
+ layout="topleft"
+ left="3"
+ name="ban_create"
+ tool_tip="Ban residents from your group"
+ width="120" />
+ <button
+ follows="top|left"
+ height="23"
+ label="Remove Ban(s)"
+ layout="topleft"
+ left_pad="5"
+ name="ban_delete"
+ tool_tip="Unban selected residents from your group"
+ width="120" />
+ <button
+ follows="top|left"
+ height="23"
+ width="23"
+ image_overlay="Refresh_Off"
+ layout="topleft"
+ left_pad="5"
+ name="ban_refresh"
+ tool_tip="Refresh the ban list" />
+ <text
+ type="string"
+ height="18"
+ left_pad="5"
+ follows="top|left"
+ layout="topleft"
+ name="ban_count"
+ width="100">
+ </text>
+ </panel>
+ </tab_container>
<panel
- border="false"
- height="303"
- label="ABILITIES"
+ height="350"
+ background_visible="false"
+ bg_alpha_color="FloaterUnfocusBorderColor"
layout="topleft"
+ follows="top|left|right"
left="0"
right="-1"
- help_topic="roles_actions_tab"
- name="actions_sub_tab"
- class="panel_group_actions_subtab"
- tool_tip="You can view an Ability&apos;s Description and which Roles and Members can execute the Ability."
- width="310">
- <panel.string
- name="help_text">
- Abilities allow Members in Roles to do specific
- things in this group. There&apos;s a broad variety of Abilities.
- </panel.string>
- <panel.string
- name="power_folder_icon" translate="false">
- Inv_FolderClosed
- </panel.string>
- <panel.string
- name="power_all_have_icon" translate="false">
- Checkbox_On
- </panel.string>
- <panel.string
- name="power_partial_icon" translate="false">
- Checkbox_Off
- </panel.string>
- <filter_editor
- layout="topleft"
- top="5"
- left="5"
- right="-5"
- height="22"
- search_button_visible="false"
- follows="left|top|right"
- label="Filter Abilities"
- name="filter_input" />
- <scroll_list
- column_padding="0"
- draw_stripes="true"
- height="200"
- follows="left|top|right"
- layout="topleft"
- left="0"
- right="-1"
- name="action_list"
- search_column="2"
- tool_tip="Select an Ability to view more details"
- top_pad="5"
- width="300">
- <scroll_list.columns
- label=""
- name="icon"
- width="2" />
- <scroll_list.columns
- label=""
- name="checkbox"
- width="20" />
- <scroll_list.columns
- label=""
- name="action" />
- </scroll_list>
+ mouse_opaque="false"
+ name="members_footer"
+ top="325"
+ visible="false">
+ <text
+ type="string"
+ height="16"
+ layout="topleft"
+ follows="left|top"
+ left="5"
+ top="8"
+ text_color="EmphasisColor"
+ name="static"
+ width="300">
+ Assigned Roles
+ </text>
+ <scroll_list
+ draw_stripes="true"
+ follows="left|top|right"
+ height="150"
+ layout="topleft"
+ left="0"
+ right="-1"
+ name="member_assigned_roles"
+ top_pad="0">
+ <scroll_list.columns
+ label=""
+ name="checkbox"
+ width="20" />
+ <scroll_list.columns
+ label=""
+ name="role"
+ width="270" />
+ </scroll_list>
+ <text
+ type="string"
+ height="16"
+ layout="topleft"
+ follows="left|top"
+ left="5"
+ top_pad="5"
+ text_color="EmphasisColor"
+ name="static2"
+ width="285">
+ Allowed Abilities
+ </text>
+ <scroll_list
+ draw_stripes="true"
+ follows="left|top|right"
+ height="150"
+ layout="topleft"
+ left="0"
+ right="-1"
+ name="member_allowed_actions"
+ search_column="2"
+ tool_tip="For details of each allowed ability see the abilities tab"
+ top_pad="0">
+ <scroll_list.columns
+ label=""
+ name="icon"
+ width="2" />
+ <scroll_list.columns
+ label=""
+ name="checkbox"
+ width="20" />
+ <scroll_list.columns
+ label=""
+ name="action"
+ width="270" />
+ </scroll_list>
</panel>
<panel
- border="false"
- height="303"
- label="BANNED RESIDENTS"
+ height="90"
+ background_visible="false"
+ bg_alpha_color="FloaterUnfocusBorderColor"
layout="topleft"
+ follows="top|left|right"
left="0"
right="-1"
- help_topic="roles_banlist_tab"
- name="banlist_sub_tab"
- class="panel_group_banlist_subtab"
- tool_tip="View the banned residents from this group."
- width="310">
- <panel.string
- name="help_text">
- Any resident on the ban list will be unable to join the group.
- </panel.string>
- <panel.string
- name="ban_count_template">
- Ban count: [COUNT]/[LIMIT]
- </panel.string>
- <name_list
- column_padding="0"
- draw_heading="true"
- height="400"
- follows="left|top|right"
- layout="topleft"
- left="0"
- right="-1"
- multi_select="true"
- name="ban_list"
- short_names="false"
- top_pad="5">
- <name_list.columns
- label="Resident"
- name="name"
- font.name="SANSSERIF_SMALL"
- font.style="NORMAL"
- relative_width="0.7" />
- <name_list.columns
- label="Date Banned"
- name="ban_date"
- relative_width="0.3" />
- </name_list>
- <button
- follows="top|left"
- height="23"
- label="Ban Resident(s)"
- layout="topleft"
- left="3"
- name="ban_create"
- tool_tip="Ban residents from your group"
- width="120" />
- <button
- follows="top|left"
- height="23"
- label="Remove Ban(s)"
- layout="topleft"
- left_pad="5"
- name="ban_delete"
- tool_tip="Unban selected residents from your group"
- width="120" />
- <button
- follows="top|left"
- height="23"
- width="23"
- image_overlay="Refresh_Off"
- layout="topleft"
- left_pad="5"
- name="ban_refresh"
- tool_tip="Refresh the ban list"
- />
- <text
- type="string"
- height="18"
- left_pad="5"
- follows="top|left"
- layout="topleft"
- name="ban_count"
- width="100">
- </text>
+ mouse_opaque="false"
+ name="members_header"
+ top_pad="3"
+ visible="false">
+ <text_editor
+ bg_readonly_color="Transparent"
+ text_readonly_color="EmphasisColor"
+ font="SansSerifSmall"
+ type="string"
+ enabled="false"
+ halign="left"
+ layout="topleft"
+ top_pad="0"
+ follows="left|top|right"
+ left="0"
+ right="-1"
+ height="90"
+ max_length="512"
+ name="member_action_description"
+ word_wrap="true">
+ This Ability is &apos;Eject Members from this Group&apos;. Only an Owner can eject another Owner.
+ </text_editor>
</panel>
- </tab_container>
- <panel
- height="350"
- background_visible="false"
- bg_alpha_color="FloaterUnfocusBorderColor"
- layout="topleft"
- follows="top|left|right"
- left="0"
- right="-1"
- width="313"
- mouse_opaque="false"
- name="members_footer"
- top="325"
- visible="false">
- <text
- type="string"
- height="16"
- layout="topleft"
- follows="left|top"
- left="5"
- top="8"
- text_color="EmphasisColor"
- name="static"
- width="300">
- Assigned Roles
- </text>
- <scroll_list
- draw_stripes="true"
- follows="left|top|right"
- height="150"
+ <panel
+ height="460"
+ background_visible="false"
+ bg_alpha_color="FloaterUnfocusBorderColor"
layout="topleft"
+ follows="top|left|right"
left="0"
right="-1"
- name="member_assigned_roles"
- top_pad="0">
- <scroll_list.columns
- label=""
- name="checkbox"
- width="20" />
- <scroll_list.columns
- label=""
- name="role"
- width="270" />
- </scroll_list>
- <text
- type="string"
- height="16"
- layout="topleft"
- follows="left|top"
- left="5"
- top_pad="5"
- text_color="EmphasisColor"
- name="static2"
- width="285">
- Allowed Abilities
- </text>
- <scroll_list
- draw_stripes="true"
+ mouse_opaque="false"
+ name="roles_footer"
+ top_delta="0"
+ top="215"
+ visible="false">
+ <text
+ type="string"
+ height="16"
+ layout="topleft"
+ follows="left|top"
+ left="5"
+ top="5"
+ name="static"
+ width="300">
+ Role Name
+ </text>
+ <line_editor
+ type="string"
+ height="20"
+ layout="topleft"
+ left="0"
follows="left|top|right"
- height="150"
- layout="topleft"
- left="0"
- right="-1"
- name="member_allowed_actions"
- search_column="2"
- tool_tip="For details of each allowed ability see the abilities tab"
- top_pad="0">
- <scroll_list.columns
- label=""
- name="icon"
- width="2" />
- <scroll_list.columns
- label=""
- name="checkbox"
- width="20" />
- <scroll_list.columns
- label=""
- name="action"
- width="270" />
- </scroll_list>
- </panel>
- <panel
- height="90"
- background_visible="false"
- bg_alpha_color="FloaterUnfocusBorderColor"
- layout="topleft"
- follows="top|left|right"
- left="0"
- right="-1"
- width="313"
- mouse_opaque="false"
- name="members_header"
- top_pad="3"
- visible="false">
- <text_editor
- bg_readonly_color="Transparent"
- text_readonly_color="EmphasisColor"
- font="SansSerifSmall"
- type="string"
- enabled="false"
- halign="left"
- layout="topleft"
- top_pad="0"
- follows="left|top|right"
- left="0"
- right="-1"
- height="90"
- max_length="512"
- name="member_action_description"
- word_wrap="true">
- This Ability is &apos;Eject Members from this Group&apos;. Only an Owner can eject another Owner.
- </text_editor>
- </panel>
- <panel
- height="460"
- background_visible="false"
- bg_alpha_color="FloaterUnfocusBorderColor"
- layout="topleft"
- follows="top|left|right"
- left="0"
- right="-1"
- width="313"
- mouse_opaque="false"
- name="roles_footer"
- top_delta="0"
- top="209"
- visible="false">
- <text
- type="string"
- height="16"
- layout="topleft"
- follows="left|top"
- left="5"
- top="5"
- name="static"
- width="300">
- Role Name
- </text>
- <line_editor
- type="string"
- height="20"
- layout="topleft"
- left="0"
- follows="left|top|right"
- right="-1"
- max_length_bytes="20"
- name="role_name"
- top_pad="0"
- width="300">
- </line_editor>
- <text
- type="string"
- height="16"
- layout="topleft"
- follows="left|top"
- left="5"
- name="static3"
- top_pad="5"
- width="300">
- Role Title
- </text>
- <line_editor
- type="string"
- height="20"
- layout="topleft"
- left="0"
- follows="left|top|right"
- right="-1"
- max_length_bytes="20"
- name="role_title"
- top_pad="0"
- width="300">
- </line_editor>
- <text
+ right="-1"
+ max_length_bytes="20"
+ name="role_name"
+ top_pad="0">
+ </line_editor>
+ <text
+ type="string"
+ height="16"
+ layout="topleft"
+ follows="left|top"
+ left="5"
+ name="static3"
+ top_pad="5"
+ width="300">
+ Role Title
+ </text>
+ <line_editor
+ type="string"
+ height="20"
+ layout="topleft"
+ left="0"
+ follows="left|top|right"
+ right="-1"
+ max_length_bytes="20"
+ name="role_title"
+ top_pad="0">
+ </line_editor>
+ <text
type="string"
height="16"
layout="topleft"
@@ -558,192 +530,185 @@ clicking on their names.
name="static2"
top_pad="5"
width="200">
- Description
- </text>
- <text_editor
- type="string"
- layout="topleft"
- left="0"
- follows="left|top|right"
- right="-1"
- max_length="295"
- height="35"
- name="role_description"
- top_pad="0"
- width="300"
- word_wrap="true">
- </text_editor>
- <text
- type="string"
- height="16"
- layout="topleft"
- follows="left|top"
- left="5"
- text_color="EmphasisColor"
- name="static4"
- top_pad="5"
- width="300">
- Assigned Members
- </text>
- <name_list
- draw_stripes="true"
- height="128"
- layout="topleft"
- left="0"
- follows="left|top|right"
- right="-1"
- name="role_assigned_members"
- top_pad="0"
- width="300" />
- <check_box
- height="15"
- label="Reveal members"
- left="5"
- layout="topleft"
- name="role_visible_in_list"
- tool_tip="Sets whether members of this role are visible in the General tab to people outside of the group."
- top_pad="4"
- width="300" />
- <text
- type="string"
- height="16"
- layout="topleft"
- follows="left|top"
- left="5"
- text_color="EmphasisColor"
- name="static5"
- top_pad="2"
- width="300">
- Allowed Abilities
- </text>
- <scroll_list
- draw_stripes="true"
- height="140"
- layout="topleft"
- left="0"
- follows="left|top|right"
- right="-1"
- name="role_allowed_actions"
- search_column="2"
- tool_tip="For details of each allowed ability see the abilities tab"
- top_pad="0"
- width="300">
- <scroll_list.columns
- label=""
- name="icon"
- width="2" />
- <scroll_list.columns
- label=""
- name="checkbox"
- width="20" />
- <scroll_list.columns
- label=""
- name="action" />
- </scroll_list>
- </panel>
- <panel
- height="90"
- background_visible="false"
- bg_alpha_color="FloaterUnfocusBorderColor"
- layout="topleft"
- follows="top|left|right"
- left="0"
- right="-1"
- width="313"
- mouse_opaque="false"
- name="roles_header"
- top_pad="3"
- visible="false">
- <text_editor
- bg_readonly_color="Transparent"
- text_readonly_color="EmphasisColor"
- font="SansSerifSmall"
- type="string"
- enabled="false"
- halign="left"
- layout="topleft"
- top_pad="0"
- follows="left|top|right"
- left="0"
- right="-1"
+ Description
+ </text>
+ <text_editor
+ type="string"
+ layout="topleft"
+ left="0"
+ follows="left|top|right"
+ right="-1"
+ max_length="295"
+ height="35"
+ name="role_description"
+ top_pad="0"
+ word_wrap="true">
+ </text_editor>
+ <text
+ type="string"
+ height="16"
+ layout="topleft"
+ follows="left|top"
+ left="5"
+ text_color="EmphasisColor"
+ name="static4"
+ top_pad="5"
+ width="300">
+ Assigned Members
+ </text>
+ <name_list
+ draw_stripes="true"
+ height="128"
+ layout="topleft"
+ left="0"
+ follows="left|top|right"
+ right="-1"
+ name="role_assigned_members"
+ top_pad="0" />
+ <check_box
+ height="15"
+ label="Reveal members"
+ left="5"
+ layout="topleft"
+ name="role_visible_in_list"
+ tool_tip="Sets whether members of this role are visible in the General tab to people outside of the group."
+ top_pad="4"
+ width="300" />
+ <text
+ type="string"
+ height="16"
+ layout="topleft"
+ follows="left|top"
+ left="5"
+ text_color="EmphasisColor"
+ name="static5"
+ top_pad="2"
+ width="300">
+ Allowed Abilities
+ </text>
+ <scroll_list
+ draw_stripes="true"
+ height="140"
+ layout="topleft"
+ left="0"
+ follows="left|top|right"
+ right="-1"
+ name="role_allowed_actions"
+ search_column="2"
+ tool_tip="For details of each allowed ability see the abilities tab"
+ top_pad="0">
+ <scroll_list.columns
+ label=""
+ name="icon"
+ width="2" />
+ <scroll_list.columns
+ label=""
+ name="checkbox"
+ width="20" />
+ <scroll_list.columns
+ label=""
+ name="action" />
+ </scroll_list>
+ </panel>
+ <panel
height="90"
- max_length="512"
- name="role_action_description"
- word_wrap="true">
- This Ability is &apos;Eject Members from this Group&apos;. Only an Owner can eject another Owner.
- </text_editor>
- </panel>
- <panel
- height="424"
- background_visible="false"
- bg_alpha_color="FloaterUnfocusBorderColor"
- layout="topleft"
- follows="top|left|right"
- left="0"
- right="-1"
- width="313"
- mouse_opaque="false"
- name="actions_footer"
- top_delta="0"
- top="255"
- visible="false">
- <text_editor
- bg_readonly_color="Transparent"
- text_readonly_color="EmphasisColor"
- font="SansSerifSmall"
- type="string"
- enabled="false"
- halign="left"
+ background_visible="false"
+ bg_alpha_color="FloaterUnfocusBorderColor"
layout="topleft"
- follows="left|top|right"
+ follows="top|left|right"
left="0"
right="-1"
- height="90"
- max_length="512"
- name="action_description"
- top="0"
- word_wrap="true">
- This Ability is &apos;Eject Members from this Group&apos;. Only an Owner can eject another Owner.
- </text_editor>
- <text
- type="string"
- height="16"
- layout="topleft"
- follows="left|top"
- left="5"
- name="static2"
- top_pad="1"
- width="300">
- Roles with this ability
- </text>
- <scroll_list
- height="172"
- layout="topleft"
- follows="left|top|right"
- left="5"
- right="-1"
- name="action_roles"
- top_pad="0"
- width="300" />
- <text
- type="string"
- height="16"
- layout="topleft"
- follows="left|top"
- left="5"
- name="static3"
- top_pad="5"
- width="300">
- Members with this ability
- </text>
- <name_list
- height="122"
- follows="left|top|right"
+ mouse_opaque="false"
+ name="roles_header"
+ top_pad="3"
+ visible="false">
+ <text_editor
+ bg_readonly_color="Transparent"
+ text_readonly_color="EmphasisColor"
+ font="SansSerifSmall"
+ type="string"
+ enabled="false"
+ halign="left"
+ layout="topleft"
+ top_pad="0"
+ follows="left|top|right"
+ left="0"
+ right="-1"
+ height="90"
+ max_length="512"
+ name="role_action_description"
+ word_wrap="true">
+ This Ability is &apos;Eject Members from this Group&apos;. Only an Owner can eject another Owner.
+ </text_editor>
+ </panel>
+ <panel
+ height="513"
+ background_visible="false"
+ bg_alpha_color="FloaterUnfocusBorderColor"
layout="topleft"
- left="5"
+ follows="top|left|right"
+ left="0"
right="-1"
- name="action_members"
- top_pad="0"
- width="300" />
- </panel>
+ mouse_opaque="false"
+ name="actions_footer"
+ top_delta="0"
+ top="255"
+ visible="false">
+ <text_editor
+ bg_readonly_color="Transparent"
+ text_readonly_color="EmphasisColor"
+ font="SansSerifSmall"
+ type="string"
+ enabled="false"
+ halign="left"
+ layout="topleft"
+ follows="left|top|right"
+ left="0"
+ right="-1"
+ height="90"
+ max_length="512"
+ name="action_description"
+ top="0"
+ word_wrap="true">
+ This Ability is &apos;Eject Members from this Group&apos;. Only an Owner can eject another Owner.
+ </text_editor>
+ <text
+ type="string"
+ height="16"
+ layout="topleft"
+ follows="left|top"
+ left="5"
+ name="static2"
+ top_pad="1"
+ width="300">
+ Roles with this ability
+ </text>
+ <scroll_list
+ height="216"
+ layout="topleft"
+ follows="left|top|right"
+ left="5"
+ right="-1"
+ name="action_roles"
+ top_pad="0" />
+ <text
+ type="string"
+ height="16"
+ layout="topleft"
+ follows="left|top"
+ left="5"
+ name="static3"
+ top_pad="5"
+ width="300">
+ Members with this ability
+ </text>
+ <name_list
+ height="167"
+ follows="left|top|right"
+ layout="topleft"
+ left="5"
+ right="-1"
+ name="action_members"
+ top_pad="0" />
+ </panel>
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_login_first.xml b/indra/newview/skins/default/xui/en/panel_login_first.xml
index c906e2f96c..d6ac71db94 100644
--- a/indra/newview/skins/default/xui/en/panel_login_first.xml
+++ b/indra/newview/skins/default/xui/en/panel_login_first.xml
@@ -179,7 +179,6 @@
control_name="RememberPassword"
follows="left|top"
font="SansSerifLarge"
- text_color="EmphasisColor"
height="24"
left="262"
bottom_delta="0"
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
index 5d347397bf..cb3e0e4b6a 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
@@ -210,26 +210,60 @@
increment="8"
initial_value="160"
label="Draw distance:"
- label_width="90"
+ label_width="187"
layout="topleft"
left="30"
min_val="64"
max_val="512"
name="DrawDistance"
top_delta="40"
- width="330" />
+ width="427" />
<text
type="string"
length="1"
follows="left|top"
height="12"
layout="topleft"
- left_delta="330"
+ left_delta="427"
name="DrawDistanceMeterText2"
top_delta="0"
width="128">
m
</text>
+ <slider
+ control_name="IndirectMaxNonImpostors"
+ name="IndirectMaxNonImpostors"
+ decimal_digits="0"
+ increment="1"
+ initial_value="12"
+ show_text="false"
+ min_val="1"
+ max_val="66"
+ label="Maximum number of animated avatars:"
+ follows="left|top"
+ layout="topleft"
+ height="16"
+ label_width="240"
+ left="30"
+ top_delta="40"
+ width="393">
+ <slider.commit_callback
+ function="Pref.UpdateIndirectMaxNonImpostors"
+ parameter="IndirectNonImpostorsText" />
+ </slider>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ top_delta="0"
+ left_delta="397"
+ text_readonly_color="LabelDisabledColor"
+ name="IndirectMaxNonImpostorsText"
+ width="65">
+ 0
+ </text>
<button
height="23"
diff --git a/indra/newview/skins/default/xui/en/panel_profile_pick.xml b/indra/newview/skins/default/xui/en/panel_profile_pick.xml
index 024120931f..4f441b9b49 100644
--- a/indra/newview/skins/default/xui/en/panel_profile_pick.xml
+++ b/indra/newview/skins/default/xui/en/panel_profile_pick.xml
@@ -200,6 +200,26 @@
<layout_panel
follows="all"
+ layout="bottomleft"
+ left_pad="2"
+ name="set_to_curr_location_btn_lp"
+ auto_resize="false"
+ width="100">
+ <button
+ name="set_to_curr_location_btn"
+ label="Set Location"
+ tool_tip="Set to Current Location"
+ left="0"
+ top="0"
+ height="23"
+ width="100"
+ follows="left|top"
+ layout="topleft"
+ />
+ </layout_panel>
+
+ <layout_panel
+ follows="all"
layout="topleft"
name="util_resizer_right"
auto_resize="true"
diff --git a/indra/newview/skins/default/xui/en/panel_region_environment.xml b/indra/newview/skins/default/xui/en/panel_region_environment.xml
index 6d23592948..6531233696 100644
--- a/indra/newview/skins/default/xui/en/panel_region_environment.xml
+++ b/indra/newview/skins/default/xui/en/panel_region_environment.xml
@@ -264,8 +264,7 @@
top_pad="1"
halign="right"
name="txt_alt1">
- Sky [INDEX]
- [ALTITUDE]m
+ Sky [INDEX]&#xA;[ALTITUDE]m
</text>
<line_editor
follows="left|top"
@@ -310,8 +309,7 @@
top_pad="1"
halign="right"
name="txt_alt2">
- Sky [INDEX]
- [ALTITUDE]m
+ Sky [INDEX]&#xA;[ALTITUDE]m
</text>
<line_editor
follows="left|top"
@@ -356,8 +354,7 @@
top_pad="1"
halign="right"
name="txt_alt3">
- Sky [INDEX]
- [ALTITUDE]m
+ Sky [INDEX]&#xA;[ALTITUDE]m
</text>
<line_editor
follows="left|top"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
index f8040b9a65..0cac1b410f 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
@@ -60,7 +60,7 @@
name="Large(512x512)"
value="[i512,i512]" />
<combo_box.item
- label="Current Window(512x512)"
+ label="Current Window"
name="CurrentWindow"
value="[i0,i0]" />
<combo_box.item
@@ -119,6 +119,8 @@
type="string"
word_wrap="true">
To save your image as a texture select one of the square formats.
+
+Upload cost: L$[UPLOAD_COST]
</text>
<button
follows="right|bottom"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
index 3a7731d235..2fb02af61c 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
@@ -31,7 +31,7 @@
image_overlay_alignment="left"
image_top_pad="-1"
imgoverlay_label_space="10"
- label="Save to Inventory (L$[AMOUNT])"
+ label="Save to Inventory"
layout="topleft"
left_delta="0"
name="save_to_inventory_btn"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index cebe1ff6c3..3ec4b7205b 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -535,7 +535,9 @@ http://secondlife.com/support for help fixing this problem.
<string name="ChangeYourDefaultAnimations">Change your default animations</string>
<string name="ForceSitAvatar">Force your avatar to sit</string>
<string name="ChangeEnvSettings">Change your environment settings</string>
-
+ <string name="ScriptBy" value="Script by "/>
+ <string name="ScriptStr" value="Script: "/>
+
<string name="NotConnected">Not Connected</string>
<string name="AgentNameSubst">(You)</string> <!-- Substitution for agent name -->
<string name="JoinAnExperience"/><!-- intentionally blank -->
@@ -4028,6 +4030,10 @@ Please check http://status.secondlifegrid.net to see if there is a known problem
<string name="DeleteItem">Delete selected item?</string>
<string name="EmptyOutfitText">There are no items in this outfit</string>
+ <string name="OutfitNotFound" value="Couldn't find outfit "/>
+ <string name="OutfitNotAdded" value="Can't add to COF outfit "/>
+ <string name="OutfitNotReplaced" value="Can't replace COF with outfit "/>
+ <string name="SystemFolderNotWorn" value="Can't wear system folder "/>
<!-- External editor status codes -->
<string name="ExternalEditorNotSet">Select an editor by setting the environment variable LL_SCRIPT_EDITOR or the ExternalEditor setting.
diff --git a/indra/newview/skins/default/xui/es/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/es/panel_snapshot_inventory.xml
index b5cf57ade7..c9eea9a58e 100644
--- a/indra/newview/skins/default/xui/es/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/es/panel_snapshot_inventory.xml
@@ -7,7 +7,7 @@
Guardar una imagen en el inventario cuesta [UPLOAD_COST] L$. Para guardar una imagen como una textura, selecciona uno de los formatos cuadrados.
</text>
<combo_box label="Resolución" name="texture_size_combo">
- <combo_box.item label="Ventana actual (512 × 512)" name="CurrentWindow"/>
+ <combo_box.item label="Ventana actual" name="CurrentWindow"/>
<combo_box.item label="Pequeña (128x128)" name="Small(128x128)"/>
<combo_box.item label="Mediana (256x256)" name="Medium(256x256)"/>
<combo_box.item label="Grande (512x512)" name="Large(512x512)"/>
diff --git a/indra/newview/skins/default/xui/es/panel_snapshot_options.xml b/indra/newview/skins/default/xui/es/panel_snapshot_options.xml
index 4eb9ecf28f..f3119c739e 100644
--- a/indra/newview/skins/default/xui/es/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/es/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="Guardar en disco" name="save_to_computer_btn"/>
- <button label="Guardar en inventario (L$[AMOUNT])" name="save_to_inventory_btn"/>
+ <button label="Guardar en inventario" name="save_to_inventory_btn"/>
<button label="Compartir en los comentarios de Mi perfil" name="save_to_profile_btn"/>
<button label="Compartir en Facebook" name="send_to_facebook_btn"/>
<button label="Compartir en Twitter" name="send_to_twitter_btn"/>
diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml
index cd8e7687ae..9fcfc2daa5 100644
--- a/indra/newview/skins/default/xui/es/strings.xml
+++ b/indra/newview/skins/default/xui/es/strings.xml
@@ -29,7 +29,6 @@ Distancia de dibujo: [DRAW_DISTANCE]m
Ancho de banda: [NET_BANDWITH]kbit/s
Factor LOD: [LOD_FACTOR]
Calidad de renderización: [RENDER_QUALITY]
-Modelo de iluminación avanzado: [GPU_SHADERS]
Memoria de textura: [TEXTURE_MEMORY]MB</string>
<string name="AboutOSXHiDPI">Modo de visualización HiDPi: [HIDPI]</string>
<string name="AboutLibs">Versión de descodificador J2C: [J2C_VERSION]
diff --git a/indra/newview/skins/default/xui/fr/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/fr/panel_snapshot_inventory.xml
index 3cf64583d2..a560ff8d5e 100644
--- a/indra/newview/skins/default/xui/fr/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/fr/panel_snapshot_inventory.xml
@@ -7,7 +7,7 @@
L&apos;enregistrement d&apos;une image dans l&apos;inventaire coûte [UPLOAD_COST] L$. Pour enregistrer votre image sous forme de texture, sélectionnez un format carré.
</text>
<combo_box label="Résolution" name="texture_size_combo">
- <combo_box.item label="Fenêtre actuelle (512x512)" name="CurrentWindow"/>
+ <combo_box.item label="Fenêtre actuelle" name="CurrentWindow"/>
<combo_box.item label="Petite (128 x 128)" name="Small(128x128)"/>
<combo_box.item label="Moyenne (256 x 256)" name="Medium(256x256)"/>
<combo_box.item label="Grande (512 x 512)" name="Large(512x512)"/>
diff --git a/indra/newview/skins/default/xui/fr/panel_snapshot_options.xml b/indra/newview/skins/default/xui/fr/panel_snapshot_options.xml
index bdedb9162f..52fa318f8e 100644
--- a/indra/newview/skins/default/xui/fr/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/fr/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="Enreg. sur le disque" name="save_to_computer_btn"/>
- <button label="Enreg. dans l&apos;inventaire ([AMOUNT] L$)" name="save_to_inventory_btn"/>
+ <button label="Enreg. dans l&apos;inventaire" name="save_to_inventory_btn"/>
<button label="Partager sur le flux de profil" name="save_to_profile_btn"/>
<button label="Partager sur Facebook" name="send_to_facebook_btn"/>
<button label="Partager sur Twitter" name="send_to_twitter_btn"/>
diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml
index 0a3fbeb603..55f6209fe1 100644
--- a/indra/newview/skins/default/xui/fr/strings.xml
+++ b/indra/newview/skins/default/xui/fr/strings.xml
@@ -32,7 +32,6 @@ Distance de dessin : [DRAW_DISTANCE]m
Bande passante : [NET_BANDWITH] kbit/s
Facteur LOD (niveau de détail) : [LOD_FACTOR]
Qualité de rendu : [RENDER_QUALITY]
-Modèle d’éclairage avancé : [GPU_SHADERS]
Mémoire textures : [TEXTURE_MEMORY] Mo</string>
<string name="AboutOSXHiDPI">Mode d'affichage HiDPI : [HIDPI]</string>
<string name="AboutLibs">J2C Decoder Version: [J2C_VERSION]
diff --git a/indra/newview/skins/default/xui/it/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/it/panel_snapshot_inventory.xml
index 75b5d64660..21b65e8e69 100644
--- a/indra/newview/skins/default/xui/it/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/it/panel_snapshot_inventory.xml
@@ -7,7 +7,7 @@
Salvare un&apos;immagine nell&apos;inventario costa L$[UPLOAD_COST]. Per salvare l&apos;immagine come texture, selezionare uno dei formati quadrati.
</text>
<combo_box label="Risoluzione" name="texture_size_combo">
- <combo_box.item label="Finestra corrente (512x512)" name="CurrentWindow"/>
+ <combo_box.item label="Finestra corrente" name="CurrentWindow"/>
<combo_box.item label="Piccola (128x128)" name="Small(128x128)"/>
<combo_box.item label="Media (256x256)" name="Medium(256x256)"/>
<combo_box.item label="Grande (512x512)" name="Large(512x512)"/>
diff --git a/indra/newview/skins/default/xui/it/panel_snapshot_options.xml b/indra/newview/skins/default/xui/it/panel_snapshot_options.xml
index 50fb3d39fa..7fce171326 100644
--- a/indra/newview/skins/default/xui/it/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/it/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="Salva sul disco" name="save_to_computer_btn"/>
- <button label="Salva nell&apos;inventario (L$[AMOUNT])" name="save_to_inventory_btn"/>
+ <button label="Salva nell&apos;inventario" name="save_to_inventory_btn"/>
<button label="Condividi sul feed del profilo" name="save_to_profile_btn"/>
<button label="Condividi su Facebook" name="send_to_facebook_btn"/>
<button label="Condividi su Twitter" name="send_to_twitter_btn"/>
diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml
index 178bb90ca6..f77ab1062a 100644
--- a/indra/newview/skins/default/xui/it/strings.xml
+++ b/indra/newview/skins/default/xui/it/strings.xml
@@ -31,7 +31,6 @@ Distanza visualizzazione: [DRAW_DISTANCE]m
Larghezza banda: [NET_BANDWITH]kbit/s
Fattore livello di dettaglio: [LOD_FACTOR]
Qualità di rendering: [RENDER_QUALITY]
-Modello illuminazione avanzato: [GPU_SHADERS]
Memoria texture: [TEXTURE_MEMORY]MB</string>
<string name="AboutOSXHiDPI">Modalità display HiDPI: [HIDPI]</string>
<string name="AboutLibs">J2C Versione decoder: [J2C_VERSION]
diff --git a/indra/newview/skins/default/xui/ja/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/ja/panel_snapshot_inventory.xml
index c55c11e928..04ecba4264 100644
--- a/indra/newview/skins/default/xui/ja/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/ja/panel_snapshot_inventory.xml
@@ -6,7 +6,7 @@
</text>
<view_border name="hr"/>
<combo_box label="解像度" name="texture_size_combo">
- <combo_box.item label="現在のウィンドウ (512✕512)" name="CurrentWindow"/>
+ <combo_box.item label="現在のウィンドウ" name="CurrentWindow"/>
<combo_box.item label="小(128✕128)" name="Small(128x128)"/>
<combo_box.item label="中(256✕256)" name="Medium(256x256)"/>
<combo_box.item label="大(512✕512)" name="Large(512x512)"/>
@@ -16,7 +16,7 @@
<spinner label="" name="inventory_snapshot_height"/>
<check_box label="縦横比の固定" name="inventory_keep_aspect_check"/>
<text name="hint_lbl">
- 画像をテクスチャとして保存する場合は、いずれかの正方形を選択してください。
+ 画像をインベントリに保存するには L$[UPLOAD_COST] の費用がかかります。画像をテクスチャとして保存するには平方形式の 1 つを選択してください。
</text>
<button label="キャンセル" name="cancel_btn"/>
<button label="保存" name="save_btn"/>
diff --git a/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml b/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml
index 7a1aa280ec..a979e31c9a 100644
--- a/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="ディスクに保存" name="save_to_computer_btn"/>
- <button label="インベントリに保存(L$ [AMOUNT])" name="save_to_inventory_btn"/>
+ <button label="インベントリに保存" name="save_to_inventory_btn"/>
<button label="プロフィールフィードで共有する" name="save_to_profile_btn"/>
<button label="メールで送信" name="save_to_email_btn"/>
<text name="fee_hint_lbl">
diff --git a/indra/newview/skins/default/xui/pl/panel_snapshot_options.xml b/indra/newview/skins/default/xui/pl/panel_snapshot_options.xml
index 016b9ca197..04c01940e1 100644
--- a/indra/newview/skins/default/xui/pl/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/pl/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel name="panel_snapshot_options">
<button label="Zapisz na dysku twardym" name="save_to_computer_btn" />
- <button label="Zapisz do Szafy ([AMOUNT]L$)" name="save_to_inventory_btn" />
+ <button label="Zapisz do Szafy" name="save_to_inventory_btn" />
<button label="Wyślij na mój Kanał" name="save_to_profile_btn" />
<button label="Załaduj na Facebook" name="send_to_facebook_btn" />
<button label="Załaduj na Twitter" name="send_to_twitter_btn" />
diff --git a/indra/newview/skins/default/xui/pl/strings.xml b/indra/newview/skins/default/xui/pl/strings.xml
index 26ec6cc9dc..8032443020 100644
--- a/indra/newview/skins/default/xui/pl/strings.xml
+++ b/indra/newview/skins/default/xui/pl/strings.xml
@@ -49,7 +49,6 @@ Pole widzenia (Draw Distance): [DRAW_DISTANCE]m
Przepustowość (Bandwidth): [NET_BANDWITH]kbit/s
Mnożnik poziomu detali (LOD Factor): [LOD_FACTOR]
Jakość wyświetlania (Render quality): [RENDER_QUALITY]
-Zaawansowane oświetlenie (Advanced Lighting Model): [GPU_SHADERS]
Pamięć tekstur (Texture memory): [TEXTURE_MEMORY]MB
Pamięć podręczna dysku (Disk cache): [DISK_CACHE_INFO]
</string>
diff --git a/indra/newview/skins/default/xui/pt/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/pt/panel_snapshot_inventory.xml
index f3357026d5..28a5142baa 100644
--- a/indra/newview/skins/default/xui/pt/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/pt/panel_snapshot_inventory.xml
@@ -7,7 +7,7 @@
Salvar uma imagem em seu inventário custa L$[UPLOAD_COST]. Para salvar sua imagem como uma textura, selecione um dos formatos quadrados.
</text>
<combo_box label="Resolução" name="texture_size_combo">
- <combo_box.item label="Janela ativa (512x512)" name="CurrentWindow"/>
+ <combo_box.item label="Janela ativa" name="CurrentWindow"/>
<combo_box.item label="Pequeno (128x128)" name="Small(128x128)"/>
<combo_box.item label="Médio (256x256)" name="Medium(256x256)"/>
<combo_box.item label="Grande (512x512)" name="Large(512x512)"/>
diff --git a/indra/newview/skins/default/xui/pt/panel_snapshot_options.xml b/indra/newview/skins/default/xui/pt/panel_snapshot_options.xml
index 067e5dbd76..f71bc7cd12 100644
--- a/indra/newview/skins/default/xui/pt/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/pt/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="Salvar no disco" name="save_to_computer_btn"/>
- <button label="Salvar em inventário (L$[AMOUNT])" name="save_to_inventory_btn"/>
+ <button label="Salvar em inventário" name="save_to_inventory_btn"/>
<button label="Compartilhar no feed do perfil" name="save_to_profile_btn"/>
<button label="Compartilhar no Facebook" name="send_to_facebook_btn"/>
<button label="Compartilhar no Twitter" name="send_to_twitter_btn"/>
diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml
index 6db5da2e89..4ce1e6d2ec 100644
--- a/indra/newview/skins/default/xui/pt/strings.xml
+++ b/indra/newview/skins/default/xui/pt/strings.xml
@@ -29,7 +29,6 @@ Estabelecer a distância: [DRAW_DISTANCE]m
Largura da banda: [NET_BANDWITH]kbit/s
LOD fator: [LOD_FACTOR]
Qualidade de renderização: [RENDER_QUALITY]
-Modelo avançado de luzes: [GPU_SHADERS]
Memória de textura: [TEXTURE_MEMORY]MB</string>
<string name="AboutOSXHiDPI">HiDPI modo de exibição: [HIDPI]</string>
<string name="AboutLibs">Versão do J2C Decoder: [J2C_VERSION]
diff --git a/indra/newview/skins/default/xui/ru/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/ru/panel_snapshot_inventory.xml
index f07e12e0ed..adc612dfd8 100644
--- a/indra/newview/skins/default/xui/ru/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/ru/panel_snapshot_inventory.xml
@@ -7,7 +7,7 @@
Сохранение изображения в инвентаре стоит L$[UPLOAD_COST]. Чтобы сохранить его как текстуру, выберите один из квадратных форматов.
</text>
<combo_box label="Размер" name="texture_size_combo">
- <combo_box.item label="Текущее окно (512x512)" name="CurrentWindow"/>
+ <combo_box.item label="Текущее окно" name="CurrentWindow"/>
<combo_box.item label="Маленький (128x128)" name="Small(128x128)"/>
<combo_box.item label="Средний (256x256)" name="Medium(256x256)"/>
<combo_box.item label="Большой (512x512)" name="Large(512x512)"/>
diff --git a/indra/newview/skins/default/xui/ru/panel_snapshot_options.xml b/indra/newview/skins/default/xui/ru/panel_snapshot_options.xml
index 7ba03ee0c9..f7fda0b1dc 100644
--- a/indra/newview/skins/default/xui/ru/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/ru/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="Сохранить на диске" name="save_to_computer_btn"/>
- <button label="Сохранить в инвентаре (L$[AMOUNT])" name="save_to_inventory_btn"/>
+ <button label="Сохранить в инвентаре" name="save_to_inventory_btn"/>
<button label="Поделиться в профиле" name="save_to_profile_btn"/>
<button label="Поделиться в Facebook" name="send_to_facebook_btn"/>
<button label="Поделиться в Twitter" name="send_to_twitter_btn"/>
diff --git a/indra/newview/skins/default/xui/ru/strings.xml b/indra/newview/skins/default/xui/ru/strings.xml
index 61d836a2d1..0079309ba2 100644
--- a/indra/newview/skins/default/xui/ru/strings.xml
+++ b/indra/newview/skins/default/xui/ru/strings.xml
@@ -69,7 +69,6 @@ SLURL: &lt;nolink&gt;[SLURL]&lt;/nolink&gt;
Ширина канала: [NET_BANDWITH] кбит/с
Коэффициент детализации: [LOD_FACTOR]
Качество визуализации: [RENDER_QUALITY]
-Расширенная модель освещения: [GPU_SHADERS]
Память текстур: [TEXTURE_MEMORY] МБ
</string>
<string name="AboutOSXHiDPI">
diff --git a/indra/newview/skins/default/xui/tr/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/tr/panel_snapshot_inventory.xml
index be5940c4b9..160cba8700 100644
--- a/indra/newview/skins/default/xui/tr/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/tr/panel_snapshot_inventory.xml
@@ -7,7 +7,7 @@
Bir görüntüyü envanterinize kaydetmenin maliyeti L$[UPLOAD_COST] olur. Görüntünüzü bir doku olarak kaydetmek için kare formatlardan birini seçin.
</text>
<combo_box label="Çözünürlük" name="texture_size_combo">
- <combo_box.item label="Mevcut Pencere(512x512)" name="CurrentWindow"/>
+ <combo_box.item label="Mevcut Pencere" name="CurrentWindow"/>
<combo_box.item label="Küçük (128x128)" name="Small(128x128)"/>
<combo_box.item label="Orta (256x256)" name="Medium(256x256)"/>
<combo_box.item label="Büyük (512x512)" name="Large(512x512)"/>
diff --git a/indra/newview/skins/default/xui/tr/panel_snapshot_options.xml b/indra/newview/skins/default/xui/tr/panel_snapshot_options.xml
index 1b48bbeec2..a028710b98 100644
--- a/indra/newview/skins/default/xui/tr/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/tr/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="Diske Kaydet" name="save_to_computer_btn"/>
- <button label="Envantere Kaydet (L$[AMOUNT])" name="save_to_inventory_btn"/>
+ <button label="Envantere Kaydet" name="save_to_inventory_btn"/>
<button label="Profil Akışında Paylaş" name="save_to_profile_btn"/>
<button label="Facebook&apos;ta Paylaş" name="send_to_facebook_btn"/>
<button label="Twitter&apos;da Paylaş" name="send_to_twitter_btn"/>
diff --git a/indra/newview/skins/default/xui/tr/strings.xml b/indra/newview/skins/default/xui/tr/strings.xml
index e709a4c5d6..fa2fd3a802 100644
--- a/indra/newview/skins/default/xui/tr/strings.xml
+++ b/indra/newview/skins/default/xui/tr/strings.xml
@@ -69,7 +69,6 @@ UI Ölçeklendirme: [UI_SCALE]
Bant genişliği: [NET_BANDWITH]kbit/s
LOD faktörü: [LOD_FACTOR]
İşleme kalitesi: [RENDER_QUALITY]
-Gelişmiş Aydınlatma Modeli: [GPU_SHADERS]
Doku belleği: [TEXTURE_MEMORY]MB
</string>
<string name="AboutOSXHiDPI">
diff --git a/indra/newview/skins/default/xui/zh/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/zh/panel_snapshot_inventory.xml
index 094bf019b4..9c45c54a5e 100644
--- a/indra/newview/skins/default/xui/zh/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/zh/panel_snapshot_inventory.xml
@@ -7,7 +7,7 @@
將圖像儲存到收納區的費用為 L$[UPLOAD_COST]。 若要將圖像存為材質,請選擇一個正方格式。
</text>
<combo_box label="解析度" name="texture_size_combo">
- <combo_box.item label="目前視窗(512x512)" name="CurrentWindow"/>
+ <combo_box.item label="目前視窗" name="CurrentWindow"/>
<combo_box.item label="小(128x128)" name="Small(128x128)"/>
<combo_box.item label="中(256x256)" name="Medium(256x256)"/>
<combo_box.item label="大(512x512)" name="Large(512x512)"/>
diff --git a/indra/newview/skins/default/xui/zh/panel_snapshot_options.xml b/indra/newview/skins/default/xui/zh/panel_snapshot_options.xml
index d7c65bb25e..d9536882ac 100644
--- a/indra/newview/skins/default/xui/zh/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/zh/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="儲存到硬碟" name="save_to_computer_btn"/>
- <button label="儲存到收納區(L$[AMOUNT])" name="save_to_inventory_btn"/>
+ <button label="儲存到收納區" name="save_to_inventory_btn"/>
<button label="分享至檔案訊息發佈" name="save_to_profile_btn"/>
<button label="分享到臉書" name="send_to_facebook_btn"/>
<button label="分享到推特" name="send_to_twitter_btn"/>
diff --git a/indra/newview/tests/cppfeatures_test.cpp b/indra/newview/tests/cppfeatures_test.cpp
index f5ea3a522b..ca94dcfc95 100644
--- a/indra/newview/tests/cppfeatures_test.cpp
+++ b/indra/newview/tests/cppfeatures_test.cpp
@@ -283,7 +283,7 @@ void cpp_features_test_object_t::test<8>()
ensure("init member inline 1", ii.mFoo==10);
InitInlineWithConstructor iici;
- ensure("init member inline 2", iici.mFoo=10);
+ ensure("init member inline 2", iici.mFoo==10);
ensure("init member inline 3", iici.mBar==25);
}
diff --git a/indra/newview/tests/llluamanager_test.cpp b/indra/newview/tests/llluamanager_test.cpp
new file mode 100644
index 0000000000..f0a1b32eed
--- /dev/null
+++ b/indra/newview/tests/llluamanager_test.cpp
@@ -0,0 +1,523 @@
+/**
+ * @file llluamanager_test.cpp
+ * @author Nat Goodspeed
+ * @date 2023-09-28
+ * @brief Test for llluamanager.
+ *
+ * $LicenseInfo:firstyear=2023&license=viewerlgpl$
+ * Copyright (c) 2023, Linden Research, Inc.
+ * $/LicenseInfo$
+ */
+
+// Precompiled header
+//#include "llviewerprecompiledheaders.h"
+// associated header
+#include "../newview/llluamanager.h"
+// STL headers
+// std headers
+#include <vector>
+// external library headers
+// other Linden headers
+#include "../llcommon/tests/StringVec.h"
+#include "../test/lltut.h"
+#include "llapp.h"
+#include "llcontrol.h"
+#include "lldate.h"
+#include "llevents.h"
+#include "lleventcoro.h"
+#include "llsdutil.h"
+#include "lluri.h"
+#include "lluuid.h"
+#include "lua_function.h"
+#include "lualistener.h"
+#include "stringize.h"
+
+class LLTestApp : public LLApp
+{
+public:
+ bool init() override { return true; }
+ bool cleanup() override { return true; }
+ bool frame() override { return true; }
+};
+
+LLControlGroup gSavedSettings("Global");
+
+/*****************************************************************************
+* TUT
+*****************************************************************************/
+namespace tut
+{
+ struct llluamanager_data
+ {
+ llluamanager_data()
+ {
+ // Load gSavedSettings from source tree
+ // indra/newview/tests/llluamanager_test.cpp =>
+ // indra/newview
+ auto newview{ fsyspath(__FILE__).parent_path().parent_path() };
+ auto settings{ newview / "app_settings" / "settings.xml" };
+ // true suppresses implicit declare; implicit declare requires
+ // that every variable in settings.xml has a Comment, which many don't.
+ gSavedSettings.loadFromFile(settings.u8string(), true);
+ // At test time, since we don't have the app bundle available,
+ // extend LuaRequirePath to include the require directory in the
+ // source tree.
+ auto require{ (newview / "scripts" / "lua" / "require").u8string() };
+ auto paths{ gSavedSettings.getLLSD("LuaRequirePath") };
+ bool found = false;
+ for (const auto& path : llsd::inArray(paths))
+ {
+ if (path.asString() == require)
+ {
+ found = true;
+ break;
+ }
+ }
+ if (! found)
+ {
+ paths.append(require);
+ gSavedSettings.setLLSD("LuaRequirePath", paths);
+ }
+ }
+ // We need an LLApp instance because LLLUAmanager uses coroutines,
+ // which suspend, and when a coroutine suspends it checks LLApp state,
+ // and if it's not APP_STATUS_RUNNING the coroutine terminates.
+ LLTestApp mApp;
+ };
+ typedef test_group<llluamanager_data> llluamanager_group;
+ typedef llluamanager_group::object object;
+ llluamanager_group llluamanagergrp("llluamanager");
+
+ static struct LuaExpr
+ {
+ std::string desc, expr;
+ LLSD expect;
+ } lua_expressions[] = {
+ { "nil", "nil", LLSD() },
+ { "true", "true", true },
+ { "false", "false", false },
+ { "int", "17", 17 },
+ { "real", "3.14", 3.14 },
+ { "string", "'string'", "string" },
+ // can't synthesize Lua userdata in Lua code: that can only be
+ // constructed by a C function
+ { "empty table", "{}", LLSD() },
+ { "nested empty table", "{ 1, 2, 3, {}, 5 }",
+ llsd::array(1, 2, 3, LLSD(), 5) },
+ { "nested non-empty table", "{ 1, 2, 3, {a=0, b=1}, 5 }",
+ llsd::array(1, 2, 3, llsd::map("a", 0, "b", 1), 5) },
+ };
+
+ template<> template<>
+ void object::test<1>()
+ {
+ set_test_name("test Lua results");
+ for (auto& luax : lua_expressions)
+ {
+ auto [count, result] =
+ LLLUAmanager::waitScriptLine("return " + luax.expr);
+ auto desc{ stringize("waitScriptLine(", luax.desc, "): ") };
+ // if count < 0, report Lua error message
+ ensure_equals(desc + result.asString(), count, 1);
+ ensure_equals(desc + "result", result, luax.expect);
+ }
+ }
+
+ void from_lua(const std::string& desc, std::string_view construct, const LLSD& expect)
+ {
+ LLSD fromlua;
+ LLStreamListener pump("testpump",
+ [&fromlua](const LLSD& data){ fromlua = data; });
+ const std::string lua(stringize(
+ "data = ", construct, "\n"
+ "LL.post_on('testpump', data)\n"
+ ));
+ auto [count, result] = LLLUAmanager::waitScriptLine(lua);
+ // We woke up again ourselves because the coroutine running Lua has
+ // finished. But our Lua chunk didn't actually return anything, so we
+ // expect count to be 0 and result to be undefined.
+ ensure_equals(desc + ": " + result.asString(), count, 0);
+ ensure_equals(desc, fromlua, expect);
+ }
+
+ template<> template<>
+ void object::test<2>()
+ {
+ set_test_name("LLSD from post_on()");
+ for (auto& luax : lua_expressions)
+ {
+ from_lua(luax.desc, luax.expr, luax.expect);
+ }
+ }
+
+ template<> template<>
+ void object::test<3>()
+ {
+ set_test_name("test post_on(), get_event_pumps(), get_event_next()");
+ StringVec posts;
+ LLStreamListener pump("testpump",
+ [&posts](const LLSD& data)
+ { posts.push_back(data.asString()); });
+ const std::string lua(
+ "-- test post_on,get_event_pumps,get_event_next\n"
+ "LL.post_on('testpump', 'entry')\n"
+ "LL.post_on('testpump', 'get_event_pumps()')\n"
+ "replypump, cmdpump = LL.get_event_pumps()\n"
+ "LL.post_on('testpump', replypump)\n"
+ "LL.post_on('testpump', 'get_event_next()')\n"
+ "pump, data = LL.get_event_next()\n"
+ "LL.post_on('testpump', data)\n"
+ "LL.post_on('testpump', 'exit')\n"
+ );
+ // It's important to let the startScriptLine() coroutine run
+ // concurrently with ours until we've had a chance to post() our
+ // reply.
+ auto future = LLLUAmanager::startScriptLine(lua);
+ StringVec expected{
+ "entry",
+ "get_event_pumps()",
+ "",
+ "get_event_next()",
+ "message",
+ "exit"
+ };
+ expected[2] = posts.at(2);
+ LL_DEBUGS() << "Found pumpname '" << expected[2] << "'" << LL_ENDL;
+ LLEventPump& luapump{ LLEventPumps::instance().obtain(expected[2]) };
+ LL_DEBUGS() << "Found pump '" << luapump.getName() << "', type '"
+ << LLError::Log::classname(luapump)
+ << "': post('" << expected[4] << "')" << LL_ENDL;
+ luapump.post(expected[4]);
+ auto [count, result] = future.get();
+ ensure_equals("post_on(): " + result.asString(), count, 0);
+ ensure_equals("post_on() sequence", posts, expected);
+ }
+
+ void round_trip(const std::string& desc, const LLSD& send, const LLSD& expect)
+ {
+ LLEventMailDrop testpump("testpump");
+ const std::string lua(
+ "-- test LLSD round trip\n"
+ "replypump, cmdpump = LL.get_event_pumps()\n"
+ "LL.post_on('testpump', replypump)\n"
+ "pump, data = LL.get_event_next()\n"
+ "return data\n"
+ );
+ auto future = LLLUAmanager::startScriptLine(lua);
+ // We woke up again ourselves because the coroutine running Lua has
+ // reached the get_event_next() call, which suspends the calling C++
+ // coroutine (including the Lua code running on it) until we post
+ // something to that reply pump.
+ auto luapump{ llcoro::suspendUntilEventOn(testpump).asString() };
+ LLEventPumps::instance().post(luapump, send);
+ // The C++ coroutine running the Lua script is now ready to run. Run
+ // it so it will echo the LLSD back to us.
+ auto [count, result] = future.get();
+ ensure_equals(stringize("round_trip(", desc, "): ", result.asString()), count, 1);
+ ensure_equals(desc, result, expect);
+ }
+
+ // Define an RTItem to be used for round-trip LLSD testing: what it is,
+ // what we send to Lua, what we expect to get back. They could be the
+ // same.
+ struct RTItem
+ {
+ RTItem(const std::string& name, const LLSD& send, const LLSD& expect):
+ mName(name),
+ mSend(send),
+ mExpect(expect)
+ {}
+ RTItem(const std::string& name, const LLSD& both):
+ mName(name),
+ mSend(both),
+ mExpect(both)
+ {}
+
+ std::string mName;
+ LLSD mSend, mExpect;
+ };
+
+ template<> template<>
+ void object::test<4>()
+ {
+ set_test_name("LLSD round trip");
+ LLSD::Binary binary{ 3, 1, 4, 1, 5, 9, 2, 6, 5 };
+ const char* uuid{ "01234567-abcd-0123-4567-0123456789ab" };
+ const char* date{ "2023-10-04T21:06:00Z" };
+ const char* uri{ "https://secondlife.com/index.html" };
+ std::vector<RTItem> items{
+ RTItem("undefined", LLSD()),
+ RTItem("true", true),
+ RTItem("false", false),
+ RTItem("int", 17),
+ RTItem("real", 3.14),
+ RTItem("int real", 27.0, 27),
+ RTItem("string", "string"),
+ RTItem("binary", binary),
+ RTItem("empty array", LLSD::emptyArray(), LLSD()),
+ RTItem("empty map", LLSD::emptyMap(), LLSD()),
+ RTItem("UUID", LLUUID(uuid), uuid),
+ RTItem("date", LLDate(date), date),
+ RTItem("uri", LLURI(uri), uri)
+ };
+ // scalars
+ for (const auto& item: items)
+ {
+ round_trip(item.mName, item.mSend, item.mExpect);
+ }
+
+ // array
+ LLSD send_array{ LLSD::emptyArray() }, expect_array{ LLSD::emptyArray() };
+ for (const auto& item: items)
+ {
+ send_array.append(item.mSend);
+ expect_array.append(item.mExpect);
+ }
+ // exercise the array tail trimming below
+ send_array.append(items[0].mSend);
+ expect_array.append(items[0].mExpect);
+ // Lua takes a table value of nil to mean: don't store this key. An
+ // LLSD array containing undefined entries (converted to nil) leaves
+ // "holes" in the Lua table. These will be converted back to undefined
+ // LLSD entries -- except at the end. Trailing undefined entries are
+ // simply omitted from the table -- so the table converts back to a
+ // shorter LLSD array. We've constructed send_array and expect_array
+ // according to 'items' above -- but truncate from expect_array any
+ // trailing entries whose mSend will map to Lua nil.
+ while (expect_array.size() > 0 &&
+ send_array[expect_array.size() - 1].isUndefined())
+ {
+ expect_array.erase(LLSD::Integer(expect_array.size() - 1));
+ }
+ round_trip("array", send_array, expect_array);
+
+ // map
+ LLSD send_map{ LLSD::emptyMap() }, expect_map{ LLSD::emptyMap() };
+ for (const auto& item: items)
+ {
+ send_map[item.mName] = item.mSend;
+ // see comment in the expect_array truncation loop above --
+ // Lua never stores table entries with nil values
+ if (item.mSend.isDefined())
+ {
+ expect_map[item.mName] = item.mExpect;
+ }
+ }
+ round_trip("map", send_map, expect_map);
+
+ // deeply nested map: exceed Lua's default stack space (20),
+ // i.e. verify that we have the right checkstack() calls
+ for (int i = 0; i < 20; ++i)
+ {
+ LLSD new_send_map{ send_map }, new_expect_map{ expect_map };
+ new_send_map["nested map"] = send_map;
+ new_expect_map["nested map"] = expect_map;
+ send_map = new_send_map;
+ expect_map = new_expect_map;
+ }
+ round_trip("nested map", send_map, expect_map);
+ }
+
+ template<> template<>
+ void object::test<5>()
+ {
+ set_test_name("leap.request() from main thread");
+ const std::string lua(
+ "-- leap.request() from main thread\n"
+ "\n"
+ "leap = require 'leap'\n"
+ "\n"
+ "return {\n"
+ " a=leap.request('echo', {data='a'}).data,\n"
+ " b=leap.request('echo', {data='b'}).data\n"
+ "}\n"
+ );
+
+ LLStreamListener pump(
+ "echo",
+ [](const LLSD& data)
+ {
+ LL_DEBUGS("Lua") << "echo pump got: " << data << LL_ENDL;
+ sendReply(data, data);
+ });
+
+ auto [count, result] = LLLUAmanager::waitScriptLine(lua);
+ ensure_equals("Lua script didn't return item", count, 1);
+ ensure_equals("echo failed", result, llsd::map("a", "a", "b", "b"));
+ }
+
+ template<> template<>
+ void object::test<6>()
+ {
+ set_test_name("interleave leap.request() responses");
+ const std::string lua(
+ "-- interleave leap.request() responses\n"
+ "\n"
+ "fiber = require('fiber')\n"
+ "leap = require('leap')\n"
+ "local function debug(...) end\n"
+ "-- debug = require('printf')\n"
+ "\n"
+ "-- negative priority ensures catchall is always last\n"
+ "catchall = leap.WaitFor(-1, 'catchall')\n"
+ "function catchall:filter(pump, data)\n"
+ " debug('catchall:filter(%s, %s)', pump, data)\n"
+ " return data\n"
+ "end\n"
+ "\n"
+ "-- but first, catch events with 'special' key\n"
+ "catch_special = leap.WaitFor(2, 'catch_special')\n"
+ "function catch_special:filter(pump, data)\n"
+ " debug('catch_special:filter(%s, %s)', pump, data)\n"
+ " return if data['special'] ~= nil then data else nil\n"
+ "end\n"
+ "\n"
+ "function drain(waitfor)\n"
+ " debug('%s start', waitfor.name)\n"
+ " -- It seems as though we ought to be able to code this loop\n"
+ " -- over waitfor:wait() as:\n"
+ " -- for item in waitfor.wait, waitfor do\n"
+ " -- However, that seems to stitch a detour through C code into\n"
+ " -- the coroutine call stack, which prohibits coroutine.yield():\n"
+ " -- 'attempt to yield across metamethod/C-call boundary'\n"
+ " -- So we resort to two different calls to waitfor:wait().\n"
+ " local item = waitfor:wait()\n"
+ " while item do\n"
+ " debug('%s caught %s', waitfor.name, item)\n"
+ " item = waitfor:wait()\n"
+ " end\n"
+ " debug('%s done', waitfor.name)\n"
+ "end\n"
+ "\n"
+ "function requester(name)\n"
+ " debug('requester(%s) start', name)\n"
+ " local response = leap.request('testpump', {name=name})\n"
+ " debug('requester(%s) got %s', name, response)\n"
+ " -- verify that the correct response was dispatched to this coroutine\n"
+ " assert(response.name == name)\n"
+ "end\n"
+ "\n"
+ "-- fiber.print_all()\n"
+ "fiber.launch('catchall', drain, catchall)\n"
+ "fiber.launch('catch_special', drain, catch_special)\n"
+ "fiber.launch('requester(a)', requester, 'a')\n"
+ "fiber.launch('requester(b)', requester, 'b')\n"
+ // A script can normally count on an implicit fiber.run() call
+ // because fiber.lua calls LL.atexit(fiber.run). But atexit()
+ // functions are called by ~LuaState(), which (in the code below)
+ // won't be called until *after* we expect to interact with the
+ // various fibers. So make an explicit call for test purposes.
+ "fiber.run()\n"
+ );
+
+ LLSD requests;
+ LLStreamListener pump(
+ "testpump",
+ [&requests](const LLSD& data)
+ {
+ LL_DEBUGS("Lua") << "testpump got: " << data << LL_ENDL;
+ requests.append(data);
+ });
+
+ auto future = LLLUAmanager::startScriptLine(lua);
+ // LuaState::expr() periodically interrupts a running chunk to ensure
+ // the rest of our coroutines get cycles. Nonetheless, for this test
+ // we have to wait until both requester() coroutines have posted and
+ // are waiting for a reply.
+ for (unsigned count=0; count < 100; ++count)
+ {
+ if (requests.size() == 2)
+ break;
+ llcoro::suspend();
+ }
+ ensure_equals("didn't get both requests", requests.size(), 2);
+ auto replyname{ requests[0]["reply"].asString() };
+ auto& replypump{ LLEventPumps::instance().obtain(replyname) };
+ // moreover, we expect they arrived in the order they were created
+ ensure_equals("a wasn't first", requests[0]["name"].asString(), "a");
+ ensure_equals("b wasn't second", requests[1]["name"].asString(), "b");
+ replypump.post(llsd::map("special", "K"));
+ // respond to requester(b) FIRST
+ replypump.post(requests[1]);
+ replypump.post(llsd::map("name", "not special"));
+ // now respond to requester(a)
+ replypump.post(requests[0]);
+ // tell leap we're done
+ replypump.post(LLSD());
+ auto [count, result] = future.get();
+ ensure_equals("leap.lua: " + result.asString(), count, 0);
+ }
+
+ template<> template<>
+ void object::test<7>()
+ {
+ set_test_name("stop hanging Lua script");
+ const std::string lua(
+ "-- hanging Lua script should terminate\n"
+ "\n"
+ "LL.get_event_next()\n"
+ );
+ auto future = LLLUAmanager::startScriptLine(lua);
+ // Poke LLTestApp to send its preliminary shutdown message.
+ mApp.setQuitting();
+ // but now we have to give the startScriptLine() coroutine a chance to run
+ auto [count, result] = future.get();
+ ensure_equals("killed Lua script terminated normally", count, -1);
+ ensure_contains("unexpected killed Lua script error",
+ result.asString(), "viewer is stopping");
+ }
+
+ template<> template<>
+ void object::test<8>()
+ {
+ set_test_name("stop looping Lua script");
+ const std::string desc("looping Lua script should terminate");
+ const std::string lua(
+ "-- " + desc + "\n"
+ "\n"
+ "while true do\n"
+ " x = 1\n"
+ "end\n"
+ );
+ auto [count, result] = LLLUAmanager::waitScriptLine(lua);
+ // We expect the above erroneous script has been forcibly terminated
+ // because it ran too long without doing any actual work.
+ ensure_equals(desc + " count: " + result.asString(), count, -1);
+ ensure_contains(desc + " result", result.asString(), "terminated");
+ }
+
+ template <typename T>
+ struct Visible
+ {
+ Visible(T name): name(name)
+ {
+ LL_INFOS() << "Visible<" << LLError::Log::classname<T>() << ">('" << name << "')" << LL_ENDL;
+ }
+ Visible(const Visible&) = delete;
+ Visible& operator=(const Visible&) = delete;
+ ~Visible()
+ {
+ LL_INFOS() << "~Visible<" << LLError::Log::classname<T>() << ">('" << name << "')" << LL_ENDL;
+ }
+ T name;
+ };
+
+ template<> template<>
+ void object::test<9>()
+ {
+ set_test_name("track distinct lua_emplace<T>() types");
+ LuaState L;
+ lua_emplace<Visible<std::string>>(L, "std::string 0");
+ int st0tag = lua_userdatatag(L, -1);
+ lua_emplace<Visible<const char*>>(L, "const char* 0");
+ int cp0tag = lua_userdatatag(L, -1);
+ lua_emplace<Visible<std::string>>(L, "std::string 1");
+ int st1tag = lua_userdatatag(L, -1);
+ lua_emplace<Visible<const char*>>(L, "const char* 1");
+ int cp1tag = lua_userdatatag(L, -1);
+ lua_settop(L, 0);
+ ensure_equals("lua_emplace<std::string>() tags diverge", st0tag, st1tag);
+ ensure_equals("lua_emplace<const char*>() tags diverge", cp0tag, cp1tag);
+ ensure_not_equals("lua_emplace<>() tags collide", st0tag, cp0tag);
+ }
+} // namespace tut
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index b2f9654eb3..daa7e58211 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -65,6 +65,8 @@ class ViewerManifest(LLManifest):
self.path(src="../../scripts/messages/message_template.msg", dst="app_settings/message_template.msg")
self.path(src="../../etc/message.xml", dst="app_settings/message.xml")
+ os.environ["XZ_DEFAULTS"] = "-T0"
+
if self.is_packaging_viewer():
with self.prefix(src_dst="app_settings"):
self.exclude("logcontrol.xml")
@@ -166,6 +168,8 @@ class ViewerManifest(LLManifest):
self.path("*/*/*/*.js")
self.path("*/*/*.html")
+ self.path('scripts/lua')
+
#build_data.json. Standard with exception handling is fine. If we can't open a new file for writing, we have worse problems
#platform is computed above with other arg parsing
build_data_dict = {"Type":"viewer","Version":'.'.join(self.args['version']),
@@ -275,13 +279,13 @@ class ViewerManifest(LLManifest):
# All lines up to and including the first blank line are the file header; skip them
lines.reverse() # so that pop will pull from first to last line
- while not re.match("\s*$", lines.pop()) :
+ while not re.match(r"\s*$", lines.pop()) :
pass # do nothing
# A line that starts with a non-whitespace character is a name; all others describe contributions, so collect the names
names = []
for line in lines :
- if re.match("\S", line) :
+ if re.match(r"\S", line) :
names.append(line.rstrip())
# It's not fair to always put the same people at the head of the list
random.shuffle(names)
@@ -1189,6 +1193,9 @@ class LinuxManifest(ViewerManifest):
super(LinuxManifest, self).construct()
pkgdir = os.path.join(self.args['build'], os.pardir, 'packages')
+ if "package_dir" in self.args:
+ pkgdir = self.args['package_dir']
+
relpkgdir = os.path.join(pkgdir, "lib", "release")
debpkgdir = os.path.join(pkgdir, "lib", "debug")
@@ -1207,49 +1214,125 @@ class LinuxManifest(ViewerManifest):
with self.prefix(dst="bin"):
self.path("secondlife-bin","do-not-directly-run-secondlife-bin")
- self.path("../linux_crash_logger/linux-crash-logger","linux-crash-logger.bin")
+ #self.path("../linux_crash_logger/linux-crash-logger","linux-crash-logger.bin")
self.path2basename("../llplugin/slplugin", "SLPlugin")
#this copies over the python wrapper script, associated utilities and required libraries, see SL-321, SL-322 and SL-323
- with self.prefix(src="../viewer_components/manager", dst=""):
- self.path("*.py")
+ #with self.prefix(src="../viewer_components/manager", dst=""):
+ # self.path("*.py")
# recurses, packaged again
self.path("res-sdl")
+ # We copy ll_icon.BMP in CMakeLists.txt to newview/res-sdl and this will let the above self.path step take care of copying
+ # the correct branded icon
# Get the icons based on the channel type
icon_path = self.icon_path()
- print("DEBUG: icon_path '%s'" % icon_path)
+ #print("DEBUG: icon_path '%s'" % icon_path)
with self.prefix(src=icon_path) :
self.path("secondlife_256.png","secondlife_icon.png")
with self.prefix(dst="res-sdl") :
self.path("secondlife_256.BMP","ll_icon.BMP")
- # plugins
- with self.prefix(src="../media_plugins", dst="bin/llplugin"):
- self.path("gstreamer010/libmedia_plugin_gstreamer010.so",
- "libmedia_plugin_gstreamer.so")
- self.path2basename("libvlc", "libmedia_plugin_libvlc.so")
-
- with self.prefix(src=os.path.join(pkgdir, 'lib', 'vlc', 'plugins'), dst="bin/llplugin/vlc/plugins"):
- self.path( "plugins.dat" )
- self.path( "*/*.so" )
+ with self.prefix(src=os.path.join(self.args['build'], os.pardir, "llwebrtc" ), dst="lib"):
+ self.path("libllwebrtc.so")
- with self.prefix(src=os.path.join(pkgdir, 'lib' ), dst="lib"):
- self.path( "libvlc*.so*" )
-
- # llcommon
- if not self.path("../llcommon/libllcommon.so", "lib/libllcommon.so"):
- print("Skipping llcommon.so (assuming llcommon was linked statically)")
+ # plugins
+ with self.prefix(src=os.path.join(self.args['build'], os.pardir, 'media_plugins'), dst="bin/llplugin"):
+ self.path("gstreamer10/libmedia_plugin_gstreamer10.so", "libmedia_plugin_gstreamer.so")
+
+ with self.prefix(src=os.path.join(self.args['build'], os.pardir, 'media_plugins'), dst="bin/llplugin"):
+ self.path("cef/libmedia_plugin_cef.so", "libmedia_plugin_cef.so" )
+ with self.prefix(src=os.path.join(pkgdir, 'lib', 'release'), dst="lib"):
+ self.path( "libcef.so" )
+
+ self.path( "libEGL*" )
+ self.path( "libvulkan*" )
+ self.path( "libvk_swiftshader*" )
+ self.path( "libGLESv2*" )
+ self.path( "vk_swiftshader_icd.json")
+
+ with self.prefix(src=os.path.join(pkgdir, 'bin', 'release'), dst="bin"):
+ self.path( "chrome-sandbox" )
+ self.path( "dullahan_host" )
+ self.path( "snapshot_blob.bin" )
+ self.path( "v8_context_snapshot.bin" )
+ with self.prefix(src=os.path.join(pkgdir, 'bin', 'release'), dst="lib"):
+ self.path( "snapshot_blob.bin" )
+ self.path( "v8_context_snapshot.bin" )
+
+ with self.prefix(src=os.path.join(pkgdir, 'resources'), dst="lib"):
+ self.path( "chrome_100_percent.pak" )
+ self.path( "chrome_200_percent.pak" )
+ self.path( "resources.pak" )
+ self.path( "icudtl.dat" )
+
+ with self.prefix(src=os.path.join(pkgdir, 'resources', 'locales'), dst=os.path.join('lib', 'locales')):
+ self.path("am.pak")
+ self.path("ar.pak")
+ self.path("bg.pak")
+ self.path("bn.pak")
+ self.path("ca.pak")
+ self.path("cs.pak")
+ self.path("da.pak")
+ self.path("de.pak")
+ self.path("el.pak")
+ self.path("en-GB.pak")
+ self.path("en-US.pak")
+ self.path("es-419.pak")
+ self.path("es.pak")
+ self.path("et.pak")
+ self.path("fa.pak")
+ self.path("fi.pak")
+ self.path("fil.pak")
+ self.path("fr.pak")
+ self.path("gu.pak")
+ self.path("he.pak")
+ self.path("hi.pak")
+ self.path("hr.pak")
+ self.path("hu.pak")
+ self.path("id.pak")
+ self.path("it.pak")
+ self.path("ja.pak")
+ self.path("kn.pak")
+ self.path("ko.pak")
+ self.path("lt.pak")
+ self.path("lv.pak")
+ self.path("ml.pak")
+ self.path("mr.pak")
+ self.path("ms.pak")
+ self.path("nb.pak")
+ self.path("nl.pak")
+ self.path("pl.pak")
+ self.path("pt-BR.pak")
+ self.path("pt-PT.pak")
+ self.path("ro.pak")
+ self.path("ru.pak")
+ self.path("sk.pak")
+ self.path("sl.pak")
+ self.path("sr.pak")
+ self.path("sv.pak")
+ self.path("sw.pak")
+ self.path("ta.pak")
+ self.path("te.pak")
+ self.path("th.pak")
+ self.path("tr.pak")
+ self.path("uk.pak")
+ self.path("vi.pak")
+ self.path("zh-CN.pak")
+ self.path("zh-TW.pak")
self.path("featuretable_linux.txt")
self.path("cube.dae")
- with self.prefix(src=pkgdir):
+ with self.prefix(src=pkgdir, dst="bin"):
self.path("ca-bundle.crt")
def package_finish(self):
installer_name = self.installer_base_name()
+ # When running as a GitHub Action job, RUNNER_TEMP is defined as the tmp dir
+ RUNNER_TEMP = os.getenv('RUNNER_TEMP')
+
self.strip_binaries()
# Fix access permissions
@@ -1264,84 +1347,77 @@ class LinuxManifest(ViewerManifest):
# temporarily move directory tree so that it has the right
# name in the tarfile
realname = self.get_dst_prefix()
- tempname = self.build_path_of(installer_name)
- self.run_command(["mv", realname, tempname])
+ versionedName = self.build_path_of(installer_name)
+
+ tarName = versionedName + ".tar.xz"
+
+ # If using a github runner we divert packaging a little. Considering this wil be a VM/docker image
+ # we can just pack the final installer into RUNNER_TEMP and not into the usual stop we'd pick when
+ # not building a GHA release
+ if RUNNER_TEMP:
+ tarName = os.path.join(RUNNER_TEMP, self.package_file)
+
+ self.run_command(["mv", realname, versionedName])
+
try:
# only create tarball if it's a release build.
if self.args['buildtype'].lower() == 'release':
- # --numeric-owner hides the username of the builder for
- # security etc.
self.run_command(['tar', '-C', self.get_build_prefix(),
'--numeric-owner', '-cJf',
- tempname + '.tar.xz', installer_name])
+ tarName, installer_name])
+ self.set_github_output_path('viewer_app', tarName)
else:
print("Skipping %s.tar.xz for non-Release build (%s)" % \
(installer_name, self.args['buildtype']))
finally:
- self.run_command(["mv", tempname, realname])
+ self.run_command(["mv", versionedName, realname])
def strip_binaries(self):
+ doStrip = False
if self.args['buildtype'].lower() == 'release' and self.is_packaging_viewer():
- print("* Going strip-crazy on the packaged binaries, since this is a RELEASE build")
+ doStrip = True
+ # In case of flatpak flatpak-build will call strip, disable doStrip here to get a flatpak symbol package. Increases flatpak size by about 1G
+ if "FLATPAK_DEST" in os.environ:
+ doStrip = True
+
+ if doStrip:
+ print("* Going strip-crazy on the packaged binaries, since this is a Release build")
# makes some small assumptions about our packaged dir structure
self.run_command(
["find"] +
[os.path.join(self.get_dst_prefix(), dir) for dir in ('bin', 'lib')] +
['-type', 'f', '!', '-name', '*.py',
+ '!', '-name', '*.pak',
+ '!', '-name', '*.bin',
+ '!', '-name', '*.dat',
+ '!', '-name', '*.crt',
+ '!', '-name', '*.dll',
+ '!', '-name', '*.lib',
'!', '-name', 'update_install', '-exec', 'strip', '-S', '{}', ';'])
-class Linux_i686_Manifest(LinuxManifest):
- address_size = 32
+class Linux_x86_64_Manifest(LinuxManifest):
+ address_size = 64
def construct(self):
- super(Linux_i686_Manifest, self).construct()
+ super(Linux_x86_64_Manifest, self).construct()
pkgdir = os.path.join(self.args['build'], os.pardir, 'packages')
+ if "package_dir" in self.args:
+ pkgdir = self.args['package_dir']
+
relpkgdir = os.path.join(pkgdir, "lib", "release")
debpkgdir = os.path.join(pkgdir, "lib", "debug")
with self.prefix(src=relpkgdir, dst="lib"):
- self.path("libdb*.so")
- self.path("libuuid.so*")
- self.path("libSDL-1.2.so.*")
- self.path("libdirectfb-1.*.so.*")
- self.path("libfusion-1.*.so.*")
- self.path("libdirect-1.*.so.*")
- self.path("libopenjp2.so*")
- self.path("libdirectfb-1.4.so.5")
- self.path("libfusion-1.4.so.5")
- self.path("libdirect-1.4.so.5*")
+ self.path("libapr-1.so*")
+ self.path("libaprutil-1.so*")
+ self.path_optional("libSDL*.so.*")
+
+ self.path_optional("libjemalloc*.so")
+
self.path("libalut.so*")
self.path("libopenal.so*")
self.path("libopenal.so", "libvivoxoal.so.1") # vivox's sdk expects this soname
- # KLUDGE: As of 2012-04-11, the 'fontconfig' package installs
- # libfontconfig.so.1.4.4, along with symlinks libfontconfig.so.1
- # and libfontconfig.so. Before we added support for library-file
- # wildcards, though, this self.path() call specifically named
- # libfontconfig.so.1.4.4 WITHOUT also copying the symlinks. When I
- # (nat) changed the call to self.path("libfontconfig.so.*"), we
- # ended up with the libfontconfig.so.1 symlink in the target
- # directory as well. But guess what! At least on Ubuntu 10.04,
- # certain viewer fonts look terrible with libfontconfig.so.1
- # present in the target directory. Removing that symlink suffices
- # to improve them. I suspect that means we actually do better when
- # the viewer fails to find our packaged libfontconfig.so*, falling
- # back on the system one instead -- but diagnosing and fixing that
- # is a bit out of scope for the present project. Meanwhile, this
- # particular wildcard specification gets us exactly what the
- # previous call did, without having to explicitly state the
- # version number.
- self.path("libfontconfig.so.*.*")
-
- # Include libfreetype.so. but have it work as libfontconfig does.
- self.path("libfreetype.so.*.*")
-
- try:
- self.path("libtcmalloc.so*") #formerly called google perf tools
- pass
- except:
- print("tcmalloc files not found, skipping")
- pass
# Vivox runtimes
with self.prefix(src=relpkgdir, dst="bin"):
@@ -1353,17 +1429,6 @@ class Linux_i686_Manifest(LinuxManifest):
self.path("libvivoxsdk.so")
self.strip_binaries()
-
-
-class Linux_x86_64_Manifest(LinuxManifest):
- address_size = 64
-
- def construct(self):
- super(Linux_x86_64_Manifest, self).construct()
-
- # support file for valgrind debug tool
- self.path("secondlife-i686.supp")
-
################################################################
if __name__ == "__main__":