diff --git a/objects/NavigationOverlayHandler.797ede.luascriptstate b/objects/NavigationOverlayHandler.797ede.luascriptstate index ad09ed79..1bee11ea 100644 --- a/objects/NavigationOverlayHandler.797ede.luascriptstate +++ b/objects/NavigationOverlayHandler.797ede.luascriptstate @@ -1 +1 @@ -{"claims":{"Black":[],"Blue":[],"Brown":[],"Green":[],"Grey":[],"Orange":[],"Pink":[],"Purple":[],"Red":[],"Teal":[],"White":[],"Yellow":[]},"pitch":[],"visibility":{"Black":{"full":false,"play":false},"Blue":{"full":false,"play":false},"Brown":{"full":false,"play":false},"Green":{"full":false,"play":false},"Grey":{"full":false,"play":false},"Orange":{"full":false,"play":false},"Pink":{"full":false,"play":false},"Purple":{"full":false,"play":false},"Red":{"full":false,"play":false},"Teal":{"full":false,"play":false},"White":{"full":false,"play":false},"Yellow":{"full":false,"play":false}}} +{"claims":{"Black":[],"Blue":[],"Brown":[],"Green":[],"Grey":[],"Orange":[],"Pink":[],"Purple":[],"Red":[],"Teal":[],"White":[],"Yellow":[]},"distance":[],"pitch":[],"visibility":{"Black":{"full":false,"play":false},"Blue":{"full":false,"play":false},"Brown":{"full":false,"play":false},"Green":{"full":false,"play":false},"Grey":{"full":false,"play":false},"Orange":{"full":false,"play":false},"Pink":{"full":false,"play":false},"Purple":{"full":false,"play":false},"Red":{"full":false,"play":false},"Teal":{"full":false,"play":false},"White":{"full":false,"play":false},"Yellow":{"full":false,"play":false}}} diff --git a/src/core/NavigationOverlayHandler.ttslua b/src/core/NavigationOverlayHandler.ttslua index 77fdc345..ce94cb6e 100644 --- a/src/core/NavigationOverlayHandler.ttslua +++ b/src/core/NavigationOverlayHandler.ttslua @@ -66,6 +66,7 @@ local settingsOpenForColor local visibility = {} local claims = {} local pitch = {} +local distance = {} --------------------------------------------------------- -- save/load functionality @@ -75,7 +76,8 @@ function onSave() return JSON.encode({ visibility = visibility, claims = claims, - pitch = pitch + pitch = pitch, + distance = distance }) end @@ -85,6 +87,7 @@ function onLoad(savedData) visibility = loadedData.visibility claims = loadedData.claims pitch = loadedData.pitch + distance = loadedData.distance else local allColors = Player.getColors() @@ -346,6 +349,9 @@ function loadCamera(player, index) -- set pitch to default if not edited lookHere.pitch = pitch[player.color] or 75 + -- update distance based on selected multiplier + lookHere.distance = lookHere.distance * (distance[player.color] or 100) / 100 + -- delay is to account for colorswap Wait.frames(function() player.lookAt(lookHere) end, 2) end @@ -366,8 +372,9 @@ function loadDefaultSettings(player) claims[player.color][color] = (player.color == color) end - -- reset pitch for that player + -- reset pitch/distance for that player pitch[player.color] = nil + distance[player.color] = nil -- update the UI accordingly updateSettingsUI(player) @@ -389,15 +396,21 @@ function toggleSettings(player) end end --- called by the slider +-- called by the navigation overlay options function updatePitch(player, number) pitch[player.color] = number end +-- called by the navigation overlay options +function updateDistance(player, number) + distance[player.color] = number +end + -- updates the settings UI for the provided player function updateSettingsUI(player) - -- update the slider + -- update the sliders UI.setAttribute("sliderPitch", "value", pitch[player.color] or 75) + UI.setAttribute("sliderDistance", "value", distance[player.color] or 100) -- update the claims local matColorList = { "White", "Orange", "Green", "Red" } diff --git a/xml/Global/NavigationOverlay.xml b/xml/Global/NavigationOverlay.xml index 4ebe45dd..4eec7caa 100644 --- a/xml/Global/NavigationOverlay.xml +++ b/xml/Global/NavigationOverlay.xml @@ -21,7 +21,7 @@ fontSize="20" font="font_teutonic-arkham"/> @@ -68,7 +68,7 @@ + + + + + + + Viewing distance (relative): + + +