|
|
|
@ -58,10 +58,17 @@ const EL_FIELDS: Partial<Record<MonoDisplay.ElementTypeName, ElFieldMeta[]>> = { |
|
|
|
{ key: "xOffset", label: "X offset", type: "number", default: 0 }, |
|
|
|
{ key: "xOffset", label: "X offset", type: "number", default: 0 }, |
|
|
|
{ key: "yOffset", label: "Y offset", type: "number", default: 32 }, |
|
|
|
{ key: "yOffset", label: "Y offset", type: "number", default: 32 }, |
|
|
|
{ key: "width", label: "Width", type: "number", default: 30 }, |
|
|
|
{ key: "width", label: "Width", type: "number", default: 30 }, |
|
|
|
{ key: "height", label: "Height", type: "number", default: 10}, |
|
|
|
{ key: "height", label: "Height", type: "number", default: 10 }, |
|
|
|
{ key: "scrollSpeed", label: "Scroll speed", type: "number", default: 50 }, |
|
|
|
{ key: "scrollSpeed", label: "Scroll speed", type: "number", default: 50 }, |
|
|
|
{ key: "fontIndex", label: "Font", type: "font", default: 0 }, |
|
|
|
{ key: "fontIndex", label: "Font", type: "font", default: 0 }, |
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
Line: [ |
|
|
|
|
|
|
|
{ key: "xOrigin", label: "X offset", type: "number", default: 0 }, |
|
|
|
|
|
|
|
{ key: "yOrigin", label: "Y offset", type: "number", default: 32 }, |
|
|
|
|
|
|
|
{ key: "xTarget", label: "X offset", type: "number", default: 0 }, |
|
|
|
|
|
|
|
{ key: "yTarget", label: "Y offset", type: "number", default: 32 }, |
|
|
|
|
|
|
|
{ key: "linestyle", label: "Lintylee S", type: "number", default: 0 }, |
|
|
|
|
|
|
|
], |
|
|
|
CurrentTime: [ |
|
|
|
CurrentTime: [ |
|
|
|
{ key: "xOffset", label: "X offset", type: "number", default: 0 }, |
|
|
|
{ key: "xOffset", label: "X offset", type: "number", default: 0 }, |
|
|
|
{ key: "yOffset", label: "Y offset", type: "number", default: 8 }, |
|
|
|
{ key: "yOffset", label: "Y offset", type: "number", default: 8 }, |
|
|
|
@ -122,7 +129,7 @@ function saveToStorage() { |
|
|
|
const buf = file.toBuffer(); |
|
|
|
const buf = file.toBuffer(); |
|
|
|
const b64 = btoa(String.fromCharCode(...buf)); |
|
|
|
const b64 = btoa(String.fromCharCode(...buf)); |
|
|
|
localStorage.setItem(STORAGE_KEY, JSON.stringify({ filename: currentFilename, data: b64 })); |
|
|
|
localStorage.setItem(STORAGE_KEY, JSON.stringify({ filename: currentFilename, data: b64 })); |
|
|
|
} catch {} |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function loadFromStorage() { |
|
|
|
function loadFromStorage() { |
|
|
|
@ -139,7 +146,7 @@ function loadFromStorage() { |
|
|
|
isDirty = true; |
|
|
|
isDirty = true; |
|
|
|
document.getElementById("filename")?.classList.add("dirty"); |
|
|
|
document.getElementById("filename")?.classList.add("dirty"); |
|
|
|
m.redraw(); |
|
|
|
m.redraw(); |
|
|
|
} catch {} |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// --- Dirty tracking ----------------------------------------------------------
|
|
|
|
// --- Dirty tracking ----------------------------------------------------------
|
|
|
|
@ -167,7 +174,8 @@ function newSec(): MonoDisplay.MonoFormatElementsAlways { |
|
|
|
clearBuffer: true, |
|
|
|
clearBuffer: true, |
|
|
|
drawBack: true, |
|
|
|
drawBack: true, |
|
|
|
drawFront: true, |
|
|
|
drawFront: true, |
|
|
|
} }; |
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function createNewElement(type: MonoDisplay.ElementType): MonoDisplay.MonoFormatElement { |
|
|
|
function createNewElement(type: MonoDisplay.ElementType): MonoDisplay.MonoFormatElement { |
|
|
|
@ -714,7 +722,7 @@ const SectionCard: m.Component<{ si: number }> = { |
|
|
|
), |
|
|
|
), |
|
|
|
section.sectionType === MonoDisplay.SectionType.ElementsTimespan |
|
|
|
section.sectionType === MonoDisplay.SectionType.ElementsTimespan |
|
|
|
? m(".el-list", |
|
|
|
? m(".el-list", |
|
|
|
([ ["Start Time", "startTimestamp"], ["Stop Time", "endTimestamp"] ] as [string, string][]) |
|
|
|
([["Start Time", "startTimestamp"], ["Stop Time", "endTimestamp"]] as [string, string][]) |
|
|
|
.map(([label, key]) => { |
|
|
|
.map(([label, key]) => { |
|
|
|
let posix: bigint = (section as any)[key]; |
|
|
|
let posix: bigint = (section as any)[key]; |
|
|
|
if (!posix) { |
|
|
|
if (!posix) { |
|
|
|
|