From aeae078b67ad31f531d9134822e7336d96859e65 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Sun, 20 Sep 2020 23:37:55 -0400 Subject: [PATCH] Update some archived scripts. --- script-archive/acScripts/ControlACs.js | 5 +---- .../acScripts/botProceduralWayPoints.js | 14 ++++++-------- script-archive/acScripts/bot_randomExpression.js | 9 +++------ script-archive/acScripts/playbackMaster.js | 7 ++----- script-archive/example/ui/overlaysExample.js | 16 ++++++---------- script-archive/fireworks.js | 4 +--- script-archive/golfclub/golfClub.js | 4 +--- script-archive/grenade.js | 9 +++------ script-archive/libraries/constants.js | 4 +--- script-archive/libraries/virtualKeyboard.js | 4 ++-- script-archive/lineRider.js | 4 +--- script-archive/lobby.js | 15 ++++++--------- script-archive/pointer.js | 7 +------ script-archive/recorder.js | 6 ++---- .../utilities/diagnostics/inWorldTestTone.js | 5 +---- .../utilities/diagnostics/moveJoints.js | 4 +--- .../utilities/diagnostics/playSoundLoop.js | 8 +++----- .../utilities/diagnostics/playSoundWave.js | 5 +---- script-archive/utilities/tools/cookies.js | 9 +++------ script-archive/walk.js | 3 +-- 20 files changed, 46 insertions(+), 96 deletions(-) diff --git a/script-archive/acScripts/ControlACs.js b/script-archive/acScripts/ControlACs.js index 0208aefab6..688efa3b6e 100644 --- a/script-archive/acScripts/ControlACs.js +++ b/script-archive/acScripts/ControlACs.js @@ -9,9 +9,6 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var networkingConstants = Script.require("/~/system/libraries/networkingConstants.js"); -var VIRCADIA_PUBLIC_CDN = networkingConstants.PUBLIC_BUCKET_CDN_URL; - // Set the following variables to the right value var NUM_AC = 3; // This is the number of AC. Their ID need to be unique and between 0 (included) and NUM_AC (excluded) var NAMES = new Array("Craig", "Clement", "Jeff"); // ACs names ordered by IDs (Default name is "ACx", x = ID + 1)) @@ -36,7 +33,7 @@ var LOAD = 6; var windowDimensions = Controller.getViewportDimensions(); -var TOOL_ICON_URL = VIRCADIA_PUBLIC_CDN + "images/tools/"; +var TOOL_ICON_URL = ExternalResource.getUrl(ExternalResource.Assets, "images/tools/"); var ALPHA_ON = 1.0; var ALPHA_OFF = 0.7; var COLOR_TOOL_BAR = { red: 0, green: 0, blue: 0 }; diff --git a/script-archive/acScripts/botProceduralWayPoints.js b/script-archive/acScripts/botProceduralWayPoints.js index 0b757bebee..393633cb5f 100644 --- a/script-archive/acScripts/botProceduralWayPoints.js +++ b/script-archive/acScripts/botProceduralWayPoints.js @@ -20,9 +20,7 @@ // //For procedural walk animation -var networkingConstants = Script.require("/~/system/libraries/networkingConstants.js"); -var VIRCADIA_PUBLIC_CDN = networkingConstants.PUBLIC_BUCKET_CDN_URL; -Script.include(VIRCADIA_PUBLIC_CDN + "scripts/acScripts/proceduralAnimationAPI.js"); +Script.include(ExternalResource.getUrl(ExternalResource.Assets, "scripts/acScripts/proceduralAnimationAPI.js"); var procAnimAPI = new ProcAnimAPI(); @@ -122,9 +120,9 @@ var newBodyFilePrefix = "bot" + botNumber; // set the face model fst using the bot number // there is no need to change the body model - we're using the default -Avatar.faceModelURL = VIRCADIA_PUBLIC_CDN + "meshes/" + newFaceFilePrefix + ".fst"; -Avatar.skeletonModelURL = VIRCADIA_PUBLIC_CDN + "meshes/" + newBodyFilePrefix + "_a.fst"; -Avatar.billboardURL = VIRCADIA_PUBLIC_CDN + "meshes/billboards/bot" + botNumber + ".png"; +Avatar.faceModelURL = ExternalResource.getUrl(ExternalResource.Assets, "meshes/" + newFaceFilePrefix + ".fst"); +Avatar.skeletonModelURL = ExternalResource.getUrl(ExternalResource.Assets, "meshes/" + newBodyFilePrefix + "_a.fst"); +Avatar.billboardURL = ExternalResource.getUrl(ExternalResource.Assets, "meshes/billboards/bot" + botNumber + ".png"); Agent.isAvatar = true; Agent.isListeningToAudioStream = true; @@ -147,9 +145,9 @@ function loadSounds() { var footstep_filenames = ["FootstepW2Left-12db.wav", "FootstepW2Right-12db.wav", "FootstepW3Left-12db.wav", "FootstepW3Right-12db.wav", "FootstepW5Left-12db.wav", "FootstepW5Right-12db.wav"]; - var SOUND_BASE_URL = VIRCADIA_PUBLIC_CDN + "sounds/Cocktail+Party+Snippets/Raws/"; + var SOUND_BASE_URL = ExternalResource.getUrl(ExternalResource.Assets, "sounds/Cocktail+Party+Snippets/Raws/"); - var FOOTSTEP_BASE_URL = VIRCADIA_PUBLIC_CDN + "sounds/Footsteps/"; + var FOOTSTEP_BASE_URL = ExternalResource.getUrl(ExternalResource.Assets, "sounds/Footsteps/"); for (var i = 0; i < sound_filenames.length; i++) { sounds.push(SoundCache.getSound(SOUND_BASE_URL + sound_filenames[i])); diff --git a/script-archive/acScripts/bot_randomExpression.js b/script-archive/acScripts/bot_randomExpression.js index 30d30b79b5..dfd26b54b5 100644 --- a/script-archive/acScripts/bot_randomExpression.js +++ b/script-archive/acScripts/bot_randomExpression.js @@ -12,9 +12,6 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var networkingConstants = Script.require("/~/system/libraries/networkingConstants.js"); -VIRCADIA_PUBLIC_CDN = networkingConstants.CONTENT_CDN_URL; - function getRandomFloat(min, max) { return Math.random() * (max - min) + min; } @@ -45,9 +42,9 @@ newBodyFilePrefix = "bot" + botNumber; // set the face model fst using the bot number // there is no need to change the body model - we're using the default -Avatar.faceModelURL = VIRCADIA_PUBLIC_CDN + "meshes/" + newFaceFilePrefix + ".fst"; -Avatar.skeletonModelURL = VIRCADIA_PUBLIC_CDN + "meshes/" + newBodyFilePrefix + ".fst"; -Avatar.billboardURL = VIRCADIA_PUBLIC_CDN + "meshes/billboards/bot" + botNumber + ".png"; +Avatar.faceModelURL = ExternalResource.getUrl(ExternalResource.Assets, "meshes/" + newFaceFilePrefix + ".fst"); +Avatar.skeletonModelURL = ExternalResource.getUrl(ExternalResource.Assets, "meshes/" + newBodyFilePrefix + ".fst"); +Avatar.billboardURL = ExternalResource.getUrl(ExternalResource.Assets, "meshes/billboards/bot" + botNumber + ".png"); Agent.isAvatar = true; Agent.isListeningToAudioStream = true; diff --git a/script-archive/acScripts/playbackMaster.js b/script-archive/acScripts/playbackMaster.js index 83b9374d67..65105f531b 100644 --- a/script-archive/acScripts/playbackMaster.js +++ b/script-archive/acScripts/playbackMaster.js @@ -10,16 +10,13 @@ // Script.include("./AgentPoolController.js"); -var networkingConstants = Script.require("/~/system/libraries/networkingConstants.js"); -var VIRCADIA_PUBLIC_CDN = networkingConstants.PUBLIC_BUCKET_CDN_URL; - var masterController = new MasterController(); var input_text = null; // Script. DO NOT MODIFY BEYOND THIS LINE. //Script.include("../libraries/toolBars.js"); -Script.include(VIRCADIA_PUBLIC_CDN + "scripts/libraries/toolBars.js"); +Script.include(ExternalResource.getUrl(ExternalResource.Assets, "scripts/libraries/toolBars.js")); // We want small icons Tool.IMAGE_HEIGHT /= 2; Tool.IMAGE_WIDTH /= 2; @@ -30,7 +27,7 @@ var STOP = 3; var LOAD = 6; var windowDimensions = Controller.getViewportDimensions(); -var TOOL_ICON_URL = VIRCADIA_PUBLIC_CDN + "images/tools/"; +var TOOL_ICON_URL = ExternalResource.getUrl(ExternalResource.Assets, "images/tools/"); var ALPHA_ON = 1.0; var ALPHA_OFF = 0.7; var COLOR_TOOL_BAR = { red: 0, green: 0, blue: 0 }; diff --git a/script-archive/example/ui/overlaysExample.js b/script-archive/example/ui/overlaysExample.js index 13324fa9f1..a4c15ee831 100644 --- a/script-archive/example/ui/overlaysExample.js +++ b/script-archive/example/ui/overlaysExample.js @@ -10,10 +10,6 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // - -var networkingConstants = Script.require("/~/system/libraries/networkingConstants.js"); -var VIRCADIA_PUBLIC_CDN = networkingConstants.PUBLIC_BUCKET_CDN_URL; - // The "Swatches" example of this script will create 9 different image overlays, that use the color feature to // display different colors as color swatches. The overlays can be clicked on, to change the "selectedSwatch" variable // and update the image used for the overlay so that it appears to have a selected indicator. @@ -53,7 +49,7 @@ for (s = 0; s < numberOfSwatches; s++) { width: 31, height: 54, subImage: { x: imageFromX, y: imageFromY, width: 30, height: 54 }, - imageURL: VIRCADIA_PUBLIC_CDN + "images/testing-swatches.svg", + imageURL: ExternalResource.getUrl(ExternalResource.Assets, "images/testing-swatches.svg"), color: swatchColors[s], alpha: 1 }); @@ -81,7 +77,7 @@ var toolA = Overlays.addOverlay("image", { width: 62, height: 40, subImage: { x: 0, y: 0, width: 62, height: 40 }, - imageURL: VIRCADIA_PUBLIC_CDN + "images/hifi-interface-tools.svg", + imageURL: ExternalResource.getUrl(ExternalResource.Assets, "images/hifi-interface-tools.svg"), color: { red: 255, green: 255, blue: 255}, visible: false }); @@ -91,7 +87,7 @@ var toolA = Overlays.addOverlay("image", { var slider = Overlays.addOverlay("image", { // alternate form of expressing bounds bounds: { x: 100, y: 300, width: 158, height: 35}, - imageURL: VIRCADIA_PUBLIC_CDN + "images/slider.png", + imageURL: ExternalResource.getUrl(ExternalResource.Assets, "images/slider.png"), color: { red: 255, green: 255, blue: 255}, alpha: 1 }); @@ -105,7 +101,7 @@ var thumb = Overlays.addOverlay("image", { y: 309, width: 18, height: 17, - imageURL: VIRCADIA_PUBLIC_CDN + "images/thumb.png", + imageURL: ExternalResource.getUrl(ExternalResource.Assets, "images/thumb.png"), color: { red: 255, green: 255, blue: 255}, alpha: 1 }); @@ -201,8 +197,8 @@ print("Cube overlay color =\n" // This model overlay example causes intermittent crashes in NetworkGeometry::setTextureWithNameToURL() //var modelOverlayProperties = { // textures: { -// filename1: VIRCADIA_PUBLIC_CDN + "images/testing-swatches.svg", -// filename2: VIRCADIA_PUBLIC_CDN + "images/hifi-interface-tools.svg" +// filename1: ExternalResource.getUrl(ExternalResource.Assets, "images/testing-swatches.svg",) +// filename2: ExternalResource.getUrl(ExternalResource.Assets, "images/hifi-interface-tools.svg") // } //} //var modelOverlay = Overlays.addOverlay("model", modelOverlayProperties); diff --git a/script-archive/fireworks.js b/script-archive/fireworks.js index 11f50fb478..fe0ff81203 100644 --- a/script-archive/fireworks.js +++ b/script-archive/fireworks.js @@ -1,6 +1,4 @@ -var networkingConstants = Script.require("/~/system/libraries/networkingConstants.js"); -var VIRCADIA_PUBLIC_CDN = networkingConstants.PUBLIC_BUCKET_CDN_URL; -var fireSound = SoundCache.getSound(VIRCADIA_PUBLIC_CDN + "sounds/Guns/GUN-SHOT2.raw"); +var fireSound = SoundCache.getSound(ExternalResource.getUrl(ExternalResource.Assets, "sounds/Guns/GUN-SHOT2.raw")); var audioOptions = { volume: 0.9, position: Vec3.sum(Camera.getPosition(), Quat.getFront(Camera.getOrientation())) diff --git a/script-archive/golfclub/golfClub.js b/script-archive/golfclub/golfClub.js index 0fb13a47ad..4b1e76d3d0 100644 --- a/script-archive/golfclub/golfClub.js +++ b/script-archive/golfclub/golfClub.js @@ -13,9 +13,7 @@ (function () { var ball = null; - var var networkingConstants = Script.require("/~/system/libraries/networkingConstants.js"); -var VIRCADIA_PUBLIC_CDN = networkingConstants.PUBLIC_BUCKET_CDN_URL; - var collisionSoundURL = VIRCADIA_PUBLIC_CDN + "sounds/Collisions-ballhitsandcatches/billiards/collision1.wav"; + var collisionSoundURL = ExternalResource.getUrl(ExternalResource.Assets, "sounds/Collisions-ballhitsandcatches/billiards/collision1.wav"); var triggerState = false; var BALL_GRAVITY = -9.8; var BALL_START_VELOCITY = 0.1; diff --git a/script-archive/grenade.js b/script-archive/grenade.js index 264c884162..57d8be4ef5 100644 --- a/script-archive/grenade.js +++ b/script-archive/grenade.js @@ -9,12 +9,9 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var networkingConstants = Script.require("/~/system/libraries/networkingConstants.js"); -var VIRCADIA_PUBLIC_CDN = networkingConstants.PUBLIC_BUCKET_CDN_URL; - -var grenadeURL = VIRCADIA_PUBLIC_CDN + "models/props/grenade/grenade.fbx"; -var fuseSoundURL = VIRCADIA_PUBLIC_CDN + "sounds/burningFuse.wav"; -var boomSoundURL = VIRCADIA_PUBLIC_CDN + "sounds/explosion.wav"; +var grenadeURL = ExternalResource.getUrl(ExternalResource.Assets, "models/props/grenade/grenade.fbx"); +var fuseSoundURL = ExternalResource.getUrl(ExternalResource.Assets, "sounds/burningFuse.wav"); +var boomSoundURL = ExternalResource.getUrl(ExternalResource.Assets, "sounds/explosion.wav"); var AudioRotationOffset = Quat.fromPitchYawRollDegrees(0, -90, 0); var audioOptions = { diff --git a/script-archive/libraries/constants.js b/script-archive/libraries/constants.js index fa9fe7def9..774c69bd39 100644 --- a/script-archive/libraries/constants.js +++ b/script-archive/libraries/constants.js @@ -6,9 +6,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var networkingConstants = Script.require("/~/system/libraries/networkingConstants.js"); -var VIRCADIA_PUBLIC_CDN = networkingConstants.PUBLIC_BUCKET_CDN_URL; -STICK_URL = VIRCADIA_PUBLIC_CDN + "models/props/geo_stick.fbx"; +STICK_URL = ExternalResource.getUrl(ExternalResource.Assets, "models/props/geo_stick.fbx"); ZERO_VECTOR = { x: 0, y: 0, z: 0 }; diff --git a/script-archive/libraries/virtualKeyboard.js b/script-archive/libraries/virtualKeyboard.js index 0774fe6f95..674be2a9fc 100644 --- a/script-archive/libraries/virtualKeyboard.js +++ b/script-archive/libraries/virtualKeyboard.js @@ -22,8 +22,8 @@ KBD_UPPERCASE_HOVER = 2; KBD_LOWERCASE_HOVER = 3; KBD_BACKGROUND = 4; -KEYBOARD_URL = VIRCADIA_PUBLIC_CDN + "images/keyboard.svg"; -CURSOR_URL = VIRCADIA_PUBLIC_CDN + "images/cursor.svg"; +KEYBOARD_URL = ExternalResource.getUrl(ExternalResource.Assets, "images/keyboard.svg"); +CURSOR_URL = ExternalResource.getUrl(ExternalResource.Assets, "images/cursor.svg"); RETURN_CHARCODE = 0x01000004; ENTER_CHARCODE = 0x01000005; diff --git a/script-archive/lineRider.js b/script-archive/lineRider.js index d2e8b67070..b3fcb3e74a 100644 --- a/script-archive/lineRider.js +++ b/script-archive/lineRider.js @@ -11,8 +11,6 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html LineRider = function() { - var networkingConstants = Script.require("/~/system/libraries/networkingConstants.js"); -var VIRCADIA_PUBLIC_CDN = networkingConstants.PUBLIC_BUCKET_CDN_URL; var screenSize = Controller.getViewportDimensions(); var BUTTON_SIZE = 32; @@ -35,7 +33,7 @@ var VIRCADIA_PUBLIC_CDN = networkingConstants.PUBLIC_BUCKET_CDN_URL; y: screenSize.y - (BUTTON_SIZE + PADDING), width: BUTTON_SIZE, height: BUTTON_SIZE, - imageURL: VIRCADIA_PUBLIC_CDN + "images/coaster.png?v2", + imageURL: ExternalResource.getUrl(ExternalResource.Assets, "images/coaster.png?v2"), color: this.buttonOffColor, alpha: 1 }); diff --git a/script-archive/lobby.js b/script-archive/lobby.js index 714a329f09..bed34ccb82 100644 --- a/script-archive/lobby.js +++ b/script-archive/lobby.js @@ -9,9 +9,6 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var networkingConstants = Script.require("/~/system/libraries/networkingConstants.js"); -var VIRCADIA_PUBLIC_CDN = networkingConstants.PUBLIC_BUCKET_CDN_URL; - var panelWall = false; var orbShell = false; var descriptionText = false; @@ -46,16 +43,16 @@ var panelsCenterShift = Vec3.subtract(panelsCenter, orbCenter); var ORB_SHIFT = { x: 0, y: -1.4, z: -0.8}; -var LOBBY_PANEL_WALL_URL = VIRCADIA_PUBLIC_CDN + "models/sets/Lobby/PanelWallForInterface.fbx"; -var LOBBY_BLANK_PANEL_TEXTURE_URL = VIRCADIA_PUBLIC_CDN + "models/sets/Lobby/Texture.jpg"; -var LOBBY_SHELL_URL = VIRCADIA_PUBLIC_CDN + "models/sets/Lobby/LobbyShellForInterface.fbx"; +var LOBBY_PANEL_WALL_URL = ExternalResource.getUrl(ExternalResource.Assets, "models/sets/Lobby/PanelWallForInterface.fbx"); +var LOBBY_BLANK_PANEL_TEXTURE_URL = ExternalResource.getUrl(ExternalResource.Assets, "models/sets/Lobby/Texture.jpg"); +var LOBBY_SHELL_URL = ExternalResource.getUrl(ExternalResource.Assets, "models/sets/Lobby/LobbyShellForInterface.fbx"); -var droneSound = SoundCache.getSound(VIRCADIA_PUBLIC_CDN + "sounds/Lobby/drone.stereo.raw") +var droneSound = SoundCache.getSound(ExternalResource.getUrl(ExternalResource.Assets, "sounds/Lobby/drone.stereo.raw")); var currentDrone = null; -var latinSound = SoundCache.getSound(VIRCADIA_PUBLIC_CDN + "sounds/Lobby/latin.stereo.raw") +var latinSound = SoundCache.getSound(ExternalResource.getUrl(ExternalResource.Assets, "sounds/Lobby/latin.stereo.raw")); var latinInjector = null; -var elevatorSound = SoundCache.getSound(VIRCADIA_PUBLIC_CDN + "sounds/Lobby/elevator.stereo.raw") +var elevatorSound = SoundCache.getSound(ExternalResource.getUrl(ExternalResource.Assets, "sounds/Lobby/elevator.stereo.raw")); var elevatorInjector = null; var currentMuzakInjector = null; var currentSound = null; diff --git a/script-archive/pointer.js b/script-archive/pointer.js index d7e9ec9914..68f36c488f 100644 --- a/script-archive/pointer.js +++ b/script-archive/pointer.js @@ -29,9 +29,6 @@ var buttonOnColor = { blue: 100 }; -var networkingConstants = Script.require("/~/system/libraries/networkingConstants.js"); -var VIRCADIA_PUBLIC_CDN = networkingConstants.PUBLIC_BUCKET_CDN_URL; - var userCanPoint = false; Script.include(["libraries/toolBars.js"]); var toolBar = new ToolBar(0, 0, ToolBar.HORIZONTAL, "highfidelity.pointer.toolbar", function (screenSize) { @@ -40,14 +37,12 @@ var toolBar = new ToolBar(0, 0, ToolBar.HORIZONTAL, "highfidelity.pointer.toolba var pointerButton = toolBar.addOverlay("image", { width: BUTTON_SIZE, height: BUTTON_SIZE, - imageURL: VIRCADIA_PUBLIC_CDN + "images/laser.png", + imageURL: ExternalResource.getUrl(ExternalResource.Assets, "images/laser.png"), color: buttonOffColor, alpha: 1 }); - - function nearLinePoint(targetPosition) { var handPosition = MyAvatar.getRightPalmPosition(); var along = Vec3.subtract(targetPosition, handPosition); diff --git a/script-archive/recorder.js b/script-archive/recorder.js index c5f379c0e2..cb597f7491 100644 --- a/script-archive/recorder.js +++ b/script-archive/recorder.js @@ -9,10 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -/* globals VIRCADIA_PUBLIC_CDN:true, Tool, ToolBar */ +/* globals Tool, ToolBar */ -var networkingConstants = Script.require("/~/system/libraries/networkingConstants.js"); -var VIRCADIA_PUBLIC_CDN = networkingConstants.PUBLIC_BUCKET_CDN_URL; Script.include("/~/system/libraries/toolBars.js"); var recordingFile = "recording.hfr"; @@ -26,7 +24,7 @@ function setDefaultPlayerOptions() { } var windowDimensions = Controller.getViewportDimensions(); -var TOOL_ICON_URL = VIRCADIA_PUBLIC_CDN + "images/tools/"; +var TOOL_ICON_URL = ExternalResource.getUrl(ExternalResource.Assets, + "images/tools/"); var ALPHA_ON = 1.0; var ALPHA_OFF = 0.7; var COLOR_ON = { red: 128, green: 0, blue: 0 }; diff --git a/script-archive/utilities/diagnostics/inWorldTestTone.js b/script-archive/utilities/diagnostics/inWorldTestTone.js index 43b22f9ca7..950d6783bc 100644 --- a/script-archive/utilities/diagnostics/inWorldTestTone.js +++ b/script-archive/utilities/diagnostics/inWorldTestTone.js @@ -11,10 +11,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var networkingConstants = Script.require("/~/system/libraries/networkingConstants.js"); -var VIRCADIA_PUBLIC_CDN = networkingConstants.PUBLIC_BUCKET_CDN_URL; - -var sound = SoundCache.getSound(VIRCADIA_PUBLIC_CDN + "sounds/220Sine.wav"); +var sound = SoundCache.getSound(ExternalResource.getUrl(ExternalResource.Assets, "sounds/220Sine.wav")); var soundPlaying = false; diff --git a/script-archive/utilities/diagnostics/moveJoints.js b/script-archive/utilities/diagnostics/moveJoints.js index a997dc69a0..62ca70b313 100644 --- a/script-archive/utilities/diagnostics/moveJoints.js +++ b/script-archive/utilities/diagnostics/moveJoints.js @@ -9,9 +9,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -Script.include("../../libraries/globals.js"); - -var testAnimation = VIRCADIA_PUBLIC_CDN + "ozan/animations/forStephen/sniperJump.fbx"; +var testAnimation = ExternalResource.getUrl(ExternalResource.Assets, "ozan/animations/forStephen/sniperJump.fbx"); var FRAME_RATE = 24.0; // frames per second var isAnimating = false; diff --git a/script-archive/utilities/diagnostics/playSoundLoop.js b/script-archive/utilities/diagnostics/playSoundLoop.js index 27a01a500f..59a76cc3f8 100644 --- a/script-archive/utilities/diagnostics/playSoundLoop.js +++ b/script-archive/utilities/diagnostics/playSoundLoop.js @@ -11,14 +11,12 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var networkingConstants = Script.require("/~/system/libraries/networkingConstants.js"); -var VIRCADIA_PUBLIC_CDN = networkingConstants.PUBLIC_BUCKET_CDN_URL; // A few sample files you may want to try: -var sound = SoundCache.getSound(VIRCADIA_PUBLIC_CDN + "sounds/Guitars/Guitar+-+Nylon+A.raw"); -//var sound = SoundCache.getSound(VIRCADIA_PUBLIC_CDN + "sounds/220Sine.wav"); -//var sound = SoundCache.getSound(VIRCADIA_PUBLIC_CDN + "sounds/Cocktail+Party+Snippets/Bandcamp.wav"); +var sound = SoundCache.getSound(ExternalResource.getUrl(ExternalResource.Assets, "sounds/Guitars/Guitar+-+Nylon+A.raw")); +//var sound = SoundCache.getSound(ExternalResource.getUrl(ExternalResource.Assets, "sounds/220Sine.wav")); +//var sound = SoundCache.getSound(ExternalResource.getUrl(ExternalResource.Assets, "sounds/Cocktail+Party+Snippets/Bandcamp.wav")); var soundPlaying = false; var options = { diff --git a/script-archive/utilities/diagnostics/playSoundWave.js b/script-archive/utilities/diagnostics/playSoundWave.js index 00febbeecb..f09457ed33 100644 --- a/script-archive/utilities/diagnostics/playSoundWave.js +++ b/script-archive/utilities/diagnostics/playSoundWave.js @@ -9,10 +9,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var networkingConstants = Script.require("/~/system/libraries/networkingConstants.js"); -var VIRCADIA_PUBLIC_CDN = networkingConstants.PUBLIC_BUCKET_CDN_URL; - -var soundClip = SoundCache.getSound(VIRCADIA_PUBLIC_CDN + "sounds/Cocktail%20Party%20Snippets/Walken1.wav"); +var soundClip = SoundCache.getSound(ExternalResource.getUrl(ExternalResource.Assets, "sounds/Cocktail%20Party%20Snippets/Walken1.wav")); function playSound() { Audio.playSound(soundClip, { diff --git a/script-archive/utilities/tools/cookies.js b/script-archive/utilities/tools/cookies.js index 8dd6a1d6da..aee45a8230 100644 --- a/script-archive/utilities/tools/cookies.js +++ b/script-archive/utilities/tools/cookies.js @@ -10,9 +10,6 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var networkingConstants = Script.require("/~/system/libraries/networkingConstants.js"); -var VIRCADIA_PUBLIC_CDN = networkingConstants.PUBLIC_BUCKET_CDN_URL; - var SLIDER_RANGE_INCREMENT_SCALE = 1 / 1000; var THUMB_COLOR = { red: 150, @@ -785,7 +782,7 @@ var CHECK_MARK_COLOR = { green: 255, blue: 255 }, - imageURL: VIRCADIA_PUBLIC_CDN + 'images/tools/expand-ui.svg', + imageURL: ExternalResource.getUrl(ExternalResource.Assets, 'images/tools/expand-ui.svg'), x: x, y: y, width: rawHeight, @@ -1148,13 +1145,13 @@ var CHECK_MARK_COLOR = { if (!item.isCollapsed && item.isCollapsable && clickedOverlay == item.thumb) { Overlays.editOverlay(item.thumb, { - imageURL: VIRCADIA_PUBLIC_CDN + 'images/tools/expand-right.svg' + imageURL: ExternalResource.getUrl(ExternalResource.Assets, 'images/tools/expand-right.svg') }); this.collapse(clickedOverlay); item.isCollapsed = true; } else if (item.isCollapsed && item.isCollapsable && clickedOverlay == item.thumb) { Overlays.editOverlay(item.thumb, { - imageURL: VIRCADIA_PUBLIC_CDN + 'images/tools/expand-ui.svg' + imageURL: ExternalResource.getUrl(ExternalResource.Assets, 'images/tools/expand-ui.svg') }); this.expand(clickedOverlay); item.isCollapsed = false; diff --git a/script-archive/walk.js b/script-archive/walk.js index 1901450c81..bfea51d7aa 100644 --- a/script-archive/walk.js +++ b/script-archive/walk.js @@ -14,8 +14,7 @@ // // animations, reach poses, reach pose parameters, transitions, transition parameters, sounds, image/s and reference files -const VIRCADIA_PUBLIC_CDN = "https://hifi-public.s3.amazonaws.com/"; -var pathToAssets = VIRCADIA_PUBLIC_CDN + "procedural-animator/assets/"; +var pathToAssets = ExternalResource.getUrl(ExternalResource.Assets, "procedural-animator/assets/"); Script.include([ "./libraries/walkConstants.js",