very basic code editing!
This commit is contained in:
7
sheet.ts
7
sheet.ts
@ -3,10 +3,15 @@ import { runCode, addToContext } from "./runcode.ts";
|
||||
|
||||
export type SheetType = "code" | "spritesheet" | "map" | "sfx" | "patterns" | "fonts";
|
||||
|
||||
const getSheet = (n: number) => {
|
||||
export const getSheet = (n: number) => {
|
||||
return getCart()[n].value;
|
||||
}
|
||||
|
||||
// deno-lint-ignore no-explicit-any
|
||||
export const setSheet = (n: number, type: SheetType, value: any) => {
|
||||
return getCart()[n] = {sheet_type: type, value};
|
||||
}
|
||||
|
||||
export const codeSheet = (sheet: number) => {
|
||||
const code = getSheet(sheet);
|
||||
return runCode(code);
|
||||
|
Reference in New Issue
Block a user