load/save remaining shapes
[?]
May 15, 2022, 9:37 PM
SYS67ZEJ6M3UWLSXOBRG3AETJSHMFN7PE2NUDAGNHKHV2HI2LDBACDependencies
- [2]
LBQAAJN4load/save freehand strokes - [3]
YKRF5V3Zstarting to load/save - [*]
OTIBCAUJlove2d scaffold
Change contents
- replacement in main.lua at line 798
if shape.mode == 'line' thenif shape.mode == 'line' or shape.mode == 'manhattan' then - edit in main.lua at line 801
elseif shape.mode == 'polygon' thenfor i,p in ipairs(shape.vertices) doshape.vertices[i] = insert_point(drawing.points, p.x,p.y)endelseif shape.mode == 'circle' or shape.mode == 'arc' thenshape.center = insert_point(drawing.points, shape.center.x,shape.center.y) - edit in main.lua at line 817
outfile:write(json.encode({mode='freehand', points={{x=40,y=47}}})..'\n')for k,v in pairs(shape) doprint(k, v)endfor k,v in pairs(shape.points) doprint(k,v)if type(v) == 'table' thenfor k,v in pairs(v) doprint('', k,v)endendend - replacement in main.lua at line 818
elseif shape.mode == 'line' thenelseif shape.mode == 'line' or shape.mode == 'manhattan' then - edit in main.lua at line 820
outfile:write(line..'\n')elseif shape.mode == 'polygon' thenlocal obj = {mode=shape.mode, vertices={}}for _,p in ipairs(shape.vertices) dotable.insert(obj.vertices, drawing.points[p])endlocal line = json.encode(obj) - edit in main.lua at line 829
outfile:write(json.encode({mode=shape.mode, center=drawing.points[shape.center], radius=shape.radius})..'\n')elseif shape.mode == 'arc' thenoutfile:write(json.encode({mode=shape.mode, center=drawing.points[shape.center], radius=shape.radius, start_angle=shape.start_angle, end_angle=shape.end_angle})..'\n')