Release 0.7.14-alpha

This commit is contained in:
Skyler Lehmkuhl 2025-01-23 16:43:22 -05:00
commit 42679cb02a
3 changed files with 52 additions and 11 deletions

View File

@ -1,3 +1,12 @@
# 0.7.14-alpha:
Changes:
- Moving frames can now be undone
- A wait cursor is shown during file loading
Bugfixes:
- Fix clicking on layers bug
- Fix "frame deleting" issue when clicking on frames in a scrolled timeline
# 0.7.13-alpha: # 0.7.13-alpha:
Changes: Changes:
- changed file MIME type from text/plain to application/lightningbeam to prevent editor woes on Linux - changed file MIME type from text/plain to application/lightningbeam to prevent editor woes on Linux

View File

@ -1,7 +1,7 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "Lightningbeam", "productName": "Lightningbeam",
"version": "0.7.13-alpha", "version": "0.7.14-alpha",
"identifier": "org.lightningbeam.core", "identifier": "org.lightningbeam.core",
"build": { "build": {
"frontendDist": "../src" "frontendDist": "../src"

View File

@ -1297,6 +1297,7 @@ let actions = {
const selectedFrames = structuredClone(context.selectedFrames); const selectedFrames = structuredClone(context.selectedFrames);
for (let frame of selectedFrames) { for (let frame of selectedFrames) {
frame.replacementUuid = uuidv4(); frame.replacementUuid = uuidv4();
frame.layer = context.activeObject.layers.length - frame.layer - 1;
} }
// const fillFrames = [] // const fillFrames = []
// for (let i=0; i<context.activeObject.layers.length;i++) { // for (let i=0; i<context.activeObject.layers.length;i++) {
@ -1332,7 +1333,8 @@ let actions = {
} }
} }
for (let frameObj of frameBuffer) { for (let frameObj of frameBuffer) {
const layer_idx = frameObj.layer + action.offset.layers; // TODO: figure out object tracking when moving frames between layers
const layer_idx = frameObj.layer// + action.offset.layers;
let layer = object.layers[layer_idx]; let layer = object.layers[layer_idx];
let frame = frameObj.frame; let frame = frameObj.frame;
layer.addFrame(frameObj.frameNum + action.offset.frames, frame, []); //fillFrames[layer_idx]) layer.addFrame(frameObj.frameNum + action.offset.frames, frame, []); //fillFrames[layer_idx])
@ -1341,7 +1343,27 @@ let actions = {
updateUI(); updateUI();
}, },
rollback: (action) => { rollback: (action) => {
// your code here const object = pointerList[action.object];
const frameBuffer = [];
for (let frameObj of action.selectedFrames) {
let layer = object.layers[frameObj.layer];
let frame = layer.frames[frameObj.frameNum + action.offset.frames];
if (frameObj) {
frameBuffer.push({
frame: frame,
frameNum: frameObj.frameNum,
layer: frameObj.layer,
});
layer.deleteFrame(frame.idx, "none")
}
}
for (let frameObj of frameBuffer) {
let layer = object.layers[frameObj.layer];
let frame = frameObj.frame;
if (frameObj) {
layer.addFrame(frameObj.frameNum, frame, [])
}
}
}, },
}, },
addMotionTween: { addMotionTween: {
@ -3763,7 +3785,7 @@ class GraphicsObject extends Widget {
this.setFrameNum(this.currentFrameNum - 1); this.setFrameNum(this.currentFrameNum - 1);
} }
getFrame(num) { getFrame(num) {
return this.activeLayer.getFrame(num); return this.activeLayer?.getFrame(num);
} }
setFrameNum(num) { setFrameNum(num) {
num = Math.max(0, num); num = Math.max(0, num);
@ -4470,6 +4492,7 @@ async function saveAs() {
} }
async function _open(path, returnJson = false) { async function _open(path, returnJson = false) {
document.body.style.cursor = "wait"
closeDialog(); closeDialog();
try { try {
const contents = await readTextFile(path); const contents = await readTextFile(path);
@ -4479,6 +4502,7 @@ async function _open(path, returnJson = false) {
title: "Load error", title: "Load error",
kind: "error", kind: "error",
}); });
document.body.style.cursor = "default"
return; return;
} }
if (file.version >= minFileVersion) { if (file.version >= minFileVersion) {
@ -4489,6 +4513,7 @@ async function _open(path, returnJson = false) {
"Could not import from this file. Re-save it with a current version of Lightningbeam.", "Could not import from this file. Re-save it with a current version of Lightningbeam.",
); );
} }
document.body.style.cursor = "default"
return file.json; return file.json;
} else { } else {
_newFile(file.width, file.height, file.fps); _newFile(file.width, file.height, file.fps);
@ -4497,6 +4522,7 @@ async function _open(path, returnJson = false) {
title: "Parse error", title: "Parse error",
kind: "error", kind: "error",
}); });
document.body.style.cursor = "default"
return; return;
} }
@ -4509,6 +4535,7 @@ async function _open(path, returnJson = false) {
`Invalid action ${action.name}. File may be corrupt.`, `Invalid action ${action.name}. File may be corrupt.`,
{ title: "Error", kind: "error" }, { title: "Error", kind: "error" },
); );
document.body.style.cursor = "default"
return; return;
} }
@ -4713,6 +4740,7 @@ async function _open(path, returnJson = false) {
); );
} }
} }
document.body.style.cursor = "default"
} }
async function open() { async function open() {
@ -4729,7 +4757,8 @@ async function open() {
}); });
console.log(path); console.log(path);
if (path) { if (path) {
_open(path); document.body.style.cursor = "wait"
setTimeout(()=>_open(path),10);
} }
} }
@ -6543,14 +6572,14 @@ function timeline() {
updateUI(); updateUI();
updateMenu(); updateMenu();
} else { } else {
context.activeObject.currentLayer = i; context.activeObject.currentLayer = i - context.activeObject.audioLayers.length;
} }
} }
} }
updateLayers(); updateLayers();
}); });
timeline_cvs.addEventListener("pointerup", (e) => { timeline_cvs.addEventListener("pointerup", (e) => {
let mouse = getMousePos(timeline_cvs, e); let mouse = getMousePos(timeline_cvs, e, true, true);
mouse.y += timeline_cvs.offsetY; mouse.y += timeline_cvs.offsetY;
if (mouse.x > layerWidth || timeline_cvs.draggingFrames) { if (mouse.x > layerWidth || timeline_cvs.draggingFrames) {
mouse.x += timeline_cvs.offsetX - layerWidth; mouse.x += timeline_cvs.offsetX - layerWidth;
@ -6570,7 +6599,7 @@ function timeline() {
} }
}); });
timeline_cvs.addEventListener("pointermove", (e) => { timeline_cvs.addEventListener("pointermove", (e) => {
let mouse = getMousePos(timeline_cvs, e); let mouse = getMousePos(timeline_cvs, e, true, true);
mouse.y += timeline_cvs.offsetY; mouse.y += timeline_cvs.offsetY;
if (mouse.x > layerWidth || timeline_cvs.draggingFrames) { if (mouse.x > layerWidth || timeline_cvs.draggingFrames) {
mouse.x += timeline_cvs.offsetX - layerWidth; mouse.x += timeline_cvs.offsetX - layerWidth;
@ -6748,7 +6777,8 @@ async function startup() {
createNewFileDialog(_newFile, _open, config); createNewFileDialog(_newFile, _open, config);
if (!window.openedFiles?.length) { if (!window.openedFiles?.length) {
if (config.reopenLastSession && config.recentFiles?.length) { if (config.reopenLastSession && config.recentFiles?.length) {
_open(config.recentFiles[0]) document.body.style.cursor = "wait"
setTimeout(()=>_open(config.recentFiles[0]), 10)
} else { } else {
showNewFileDialog(config); showNewFileDialog(config);
} }
@ -7886,7 +7916,8 @@ async function renderMenu() {
text: file, text: file,
enabled: true, enabled: true,
action: () => { action: () => {
_open(file); document.body.style.cursor = "wait"
setTimeout(()=>_open(file),10);
}, },
}); });
}); });
@ -8371,7 +8402,8 @@ function renderAll() {
renderAll(); renderAll();
if (window.openedFiles?.length>0) { if (window.openedFiles?.length>0) {
_open(window.openedFiles[0]) document.body.style.cursor = "wait"
setTimeout(()=>_open(window.openedFiles[0]),10)
for (let i=1; i<window.openedFiles.length; i++) { for (let i=1; i<window.openedFiles.length; i++) {
newWindow(window.openedFiles[i]) newWindow(window.openedFiles[i])
} }