Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Module Editor?

A topic by flymasterv created Feb 28, 2024 Views: 136 Replies: 2
Viewing posts 1 to 2
(+1)

Is there a way to edit the code in a module, or create a new module,  WITHIN Decker? I can open the .deck in VSCode, but having a window directly in Decker would be even better.

Alternatively, can I use lilt to interact with Modules-as-Modules, rather than just as lil code?

Developer (2 edits)

Decker itself doesn't (currently) offer a built-in editor for module scripts. You can, however, create/edit/delete modules from Lil scripts, either within Decker itself or via Lilt, so it would be entirely possible to build your own editor. For example, at the Listener:

deck.add["module" "custom"]
c:deck.modules.custom
c.description:"my fancy module"
c.script:"
on foo x do 2*x end
mod.foo:foo
"
c.value.foo[3]  # 6

The Module interface describes most of the details. Note that if you edit a module's script at runtime its closure is discarded and regenerated, so any non-serialized state will be lost.

Lilt has complete access to the normal Decker DOM APIs, you just need to start by making an instance of the Deck interface, usually with "readdeck[]" given no parameters. Fun fact: you can even inject events into "headless" decks in Lilt and observe their effects; this is used extensively in Decker's test suite. With careful design, it's possible to make decks that are directly usable by Lilt as APIs.

Does that help?

(+1)

It does. I mostly just got tired of reloading my deck manually to debug.