Created
July 10, 2018 18:47
-
-
Save jon-grangien/b544da54623f3cf992befb1e0c7cf081 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local nextSunTexture = function() | |
local textures = { | |
'${DATA}/mas/br_photo_bas05_trans_20G_offset.png', | |
'${DATA}/mas/br_photo_bas05_trans_100G_offset.png', | |
'${DATA}/mas/br_photo_bas05_trans_1000G_offset.png' | |
} | |
local currentTex = openspace.getPropertyValue('Scene.Sun.renderable.ColorTexture') | |
local newIndex = 1 | |
for i, tex in ipairs(textures) do | |
if (currentTex == tex) then | |
newIndex = 3 | |
end | |
end | |
-- if (newIndex > #textures) then | |
-- newIndex = 1 | |
-- end | |
local texToSet = "\'" .. textures[newIndex] .. "\'" | |
return "openspace.setPropertyValueSingle('Scene.Sun.renderable.ColorTexture', " .. texToSet .. ");" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment