Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
Restore copy/paste and undo/redo in SFX tool and fixed edit JSON in C…
Browse files Browse the repository at this point in the history
…hip Editor to open data.json file.
  • Loading branch information
jessefreeman committed Mar 10, 2021
1 parent 4aa6005 commit dba3ac5
Show file tree
Hide file tree
Showing 14 changed files with 136 additions and 12,220 deletions.
10 changes: 5 additions & 5 deletions Disks/PixelVisionOS/System/Libs/pixel-vision-os-undo-v2.lua
Expand Up @@ -60,7 +60,7 @@ end
-- NOTE: Make sure to balance each call to :BeginUndoable(data) with a call
-- to :EndUndoable(data). They can nest fine, just don't forget one.
function PixelVisionOS:BeginUndoable(data)
print("test start", data)

if data.currentUndo then
-- we have already stashed the data & state, just track how deep we are
data.currentUndo.count = data.currentUndo.count + 1
Expand All @@ -75,7 +75,7 @@ end

-- Call :EndUndoable(data) after each modification to the text in the editor.
function PixelVisionOS:EndUndoable(data)
print("test end",data)

-- We might be inside several nested calls to begin/endUndoable
data.currentUndo.count = data.currentUndo.count - 1
-- If this was the last of the nesting
Expand Down Expand Up @@ -103,7 +103,7 @@ function PixelVisionOS:Undo(data)
table.insert(data.redoStack, data:GetState())

-- restore the cursor state
data:SetState(state)
self:SetState(state)

end

Expand All @@ -120,7 +120,7 @@ function PixelVisionOS:Redo(data)
table.insert(data.undoStack, data:GetState())

-- restore the cursor state
data:SetState(state)
self:SetState(state)
end

function PixelVisionOS:UpdateHistoryButtons(data)
Expand All @@ -131,7 +131,7 @@ function PixelVisionOS:UpdateHistoryButtons(data)
end

function PixelVisionOS:BeginUndo(data)
self:BeginUndoable(self)
self:BeginUndoable(data)
end

function PixelVisionOS:EndUndo(data)
Expand Down
Expand Up @@ -162,7 +162,7 @@ function MouseCursor:Draw()
self.pos.y + self.cursorData.offset.y,
false,
false,
DrawMode.SpriteAbove
10 -- This forces a layer higher than the default DrawModes
)

end
Expand Down
Expand Up @@ -62,7 +62,7 @@ function ChipEditorTool:EditJSON()

local metaData = {
directory = self.rootDirectory,
file = self.rootDirectory .. "info.json",
file = self.rootDirectory .. "data.json",
}

LoadGame(self.textEditorPath, metaData)
Expand Down
Expand Up @@ -38,7 +38,7 @@ function DrawTool:CreateCanvas()

--print("First Press!", editorUI.inFocusUI.name, self.canvasData.inDrawMode, self.canvasData.mouseState)

self:BeginUndo(data)
self:BeginUndo()

self.canvasData.inDrawMode = true

Expand All @@ -55,7 +55,7 @@ function DrawTool:CreateCanvas()
if(editorUI.inFocusUI ~= nil and editorUI.inFocusUI.name == self.canvasData.name) then
print("Release")
self:OnSaveCanvasChanges()
self:EndUndo(data)
self:EndUndo()
end

end
Expand Down
Binary file not shown.
Binary file not shown.
130 changes: 0 additions & 130 deletions Disks/PixelVisionOS/System/Tools/MusicTool/_archive/sb-sprites.lua

This file was deleted.

Binary file not shown.

0 comments on commit dba3ac5

Please sign in to comment.