allow define light color with d c

This commit is contained in:
2024-10-13 19:12:41 -05:00
parent a7a1799896
commit ed3b20ce74

View File

@@ -873,6 +873,27 @@
(#when debug
(preload
(withFunctions [(defineLightColor [cc]
(when doingSomething (return))
(set doingSomething true)
(set lastCommand defineLightColor)
(let [arr (lightSources.get sceneKey)
stringArr (for ls arr (ls.stringify))
stringMap (for [key ls] (zipThrow stringArr arr) =>key ls)]
(director.chooseString "Color which light source?" (withCancel stringArr)
(unlessCancel choice
(let [ls (dictGet stringMap choice)]
(SimpleWindow.promptForColor "Which color?"
->color {
(set ls.color color)
(lightSources.put sceneKey arr)
(_updateLighting)
(cc)
}
null ls.color true)
(return))))))]
(.registerItem (director.shortcutHandler) "[d]efine light [c]olor" defineLightColor))
(.registerItem (director.shortcutHandler) "[n]ext label"
->cc
(unless doingSomething (set doingSomething true)