local var
[?]
Jun 3, 2022, 3:00 PM
SRVDX4I5QKWAH3Y5DX25PG34U7NY55H46ZYG2APH47BUZT3EJ2HACDependencies
- [2]
UZVWYRTYmissing temporary modes in a couple more places - [3]
WTDKUACNrectangle and square shapes - [4]
BJ2C6F2Bignore 'name' mode in a few places - [5]
RT6EV6OPdelegate update events to drawings - [6]
6DE7RBZ6move mouse_released events to Drawing - [*]
BLWAYPKVextract a module
Change contents
- replacement in drawing.lua at line 264
if Lines.current.pending thenif Lines.current.pending.mode == 'freehand' thenlocal drawing = Lines.currentif drawing.pending thenif drawing.pending.mode == 'freehand' then - replacement in drawing.lua at line 268
table.insert(Lines.current.shapes, Lines.current.pending)elseif Lines.current.pending.mode == 'line' thenlocal mx,my = Drawing.coord(x-16), Drawing.coord(y-Lines.current.y)if mx >= 0 and mx < 256 and my >= 0 and my < Lines.current.h thenlocal j = Drawing.insert_point(Lines.current.points, mx,my)Lines.current.pending.p2 = jtable.insert(Lines.current.shapes, Lines.current.pending)table.insert(drawing.shapes, drawing.pending)elseif drawing.pending.mode == 'line' thenlocal mx,my = Drawing.coord(x-16), Drawing.coord(y-drawing.y)if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h thenlocal j = Drawing.insert_point(drawing.points, mx,my)drawing.pending.p2 = jtable.insert(drawing.shapes, drawing.pending) - replacement in drawing.lua at line 276
elseif Lines.current.pending.mode == 'manhattan' thenlocal p1 = Lines.current.points[Lines.current.pending.p1]local mx,my = Drawing.coord(x-16), Drawing.coord(y-Lines.current.y)if mx >= 0 and mx < 256 and my >= 0 and my < Lines.current.h thenelseif drawing.pending.mode == 'manhattan' thenlocal p1 = drawing.points[drawing.pending.p1]local mx,my = Drawing.coord(x-16), Drawing.coord(y-drawing.y)if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h then - replacement in drawing.lua at line 281
local j = Drawing.insert_point(Lines.current.points, mx, p1.y)Lines.current.pending.p2 = jlocal j = Drawing.insert_point(drawing.points, mx, p1.y)drawing.pending.p2 = j - replacement in drawing.lua at line 284
local j = Drawing.insert_point(Lines.current.points, p1.x, my)Lines.current.pending.p2 = jlocal j = Drawing.insert_point(drawing.points, p1.x, my)drawing.pending.p2 = j - replacement in drawing.lua at line 287
local p2 = Lines.current.points[Lines.current.pending.p2]love.mouse.setPosition(16+Drawing.pixels(p2.x), Lines.current.y+Drawing.pixels(p2.y))table.insert(Lines.current.shapes, Lines.current.pending)local p2 = drawing.points[drawing.pending.p2]love.mouse.setPosition(16+Drawing.pixels(p2.x), drawing.y+Drawing.pixels(p2.y))table.insert(drawing.shapes, drawing.pending) - replacement in drawing.lua at line 291[3.1696]→[3.1696:1904](∅→∅),[3.1904]→[3.4302:4408](∅→∅),[3.4408]→[3.1974:2042](∅→∅),[3.1974]→[3.1974:2042](∅→∅)
elseif Lines.current.pending.mode == 'polygon' thenlocal mx,my = Drawing.coord(x-16), Drawing.coord(y-Lines.current.y)if mx >= 0 and mx < 256 and my >= 0 and my < Lines.current.h thentable.insert(Lines.current.pending.vertices, Drawing.insert_point(Lines.current.points, mx,my))table.insert(Lines.current.shapes, Lines.current.pending)elseif drawing.pending.mode == 'polygon' thenlocal mx,my = Drawing.coord(x-16), Drawing.coord(y-drawing.y)if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h thentable.insert(drawing.pending.vertices, Drawing.insert_point(drawing.points, mx,my))table.insert(drawing.shapes, drawing.pending) - replacement in drawing.lua at line 297
elseif Lines.current.pending.mode == 'rectangle' thenassert(#Lines.current.pending.vertices <= 2)if #Lines.current.pending.vertices == 2 thenlocal mx,my = Drawing.coord(x-16), Drawing.coord(y-Lines.current.y)if mx >= 0 and mx < 256 and my >= 0 and my < Lines.current.h thenlocal first = Lines.current.points[Lines.current.pending.vertices[1]]local second = Lines.current.points[Lines.current.pending.vertices[2]]elseif drawing.pending.mode == 'rectangle' thenassert(#drawing.pending.vertices <= 2)if #drawing.pending.vertices == 2 thenlocal mx,my = Drawing.coord(x-16), Drawing.coord(y-drawing.y)if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h thenlocal first = drawing.points[drawing.pending.vertices[1]]local second = drawing.points[drawing.pending.vertices[2]] - replacement in drawing.lua at line 305
table.insert(Lines.current.pending.vertices, Drawing.insert_point(Lines.current.points, thirdx,thirdy))table.insert(Lines.current.pending.vertices, Drawing.insert_point(Lines.current.points, fourthx,fourthy))table.insert(Lines.current.shapes, Lines.current.pending)table.insert(drawing.pending.vertices, Drawing.insert_point(drawing.points, thirdx,thirdy))table.insert(drawing.pending.vertices, Drawing.insert_point(drawing.points, fourthx,fourthy))table.insert(drawing.shapes, drawing.pending) - replacement in drawing.lua at line 312
elseif Lines.current.pending.mode == 'square' thenassert(#Lines.current.pending.vertices <= 2)if #Lines.current.pending.vertices == 2 thenlocal mx,my = Drawing.coord(x-16), Drawing.coord(y-Lines.current.y)if mx >= 0 and mx < 256 and my >= 0 and my < Lines.current.h thenlocal first = Lines.current.points[Lines.current.pending.vertices[1]]local second = Lines.current.points[Lines.current.pending.vertices[2]]elseif drawing.pending.mode == 'square' thenassert(#drawing.pending.vertices <= 2)if #drawing.pending.vertices == 2 thenlocal mx,my = Drawing.coord(x-16), Drawing.coord(y-drawing.y)if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h thenlocal first = drawing.points[drawing.pending.vertices[1]]local second = drawing.points[drawing.pending.vertices[2]] - replacement in drawing.lua at line 320
table.insert(Lines.current.pending.vertices, Drawing.insert_point(Lines.current.points, thirdx,thirdy))table.insert(Lines.current.pending.vertices, Drawing.insert_point(Lines.current.points, fourthx,fourthy))table.insert(Lines.current.shapes, Lines.current.pending)table.insert(drawing.pending.vertices, Drawing.insert_point(drawing.points, thirdx,thirdy))table.insert(drawing.pending.vertices, Drawing.insert_point(drawing.points, fourthx,fourthy))table.insert(drawing.shapes, drawing.pending) - replacement in drawing.lua at line 325
elseif Lines.current.pending.mode == 'circle' thenlocal mx,my = Drawing.coord(x-16), Drawing.coord(y-Lines.current.y)if mx >= 0 and mx < 256 and my >= 0 and my < Lines.current.h thenlocal center = Lines.current.points[Lines.current.pending.center]Lines.current.pending.radius = geom.dist(center.x,center.y, mx,my)table.insert(Lines.current.shapes, Lines.current.pending)elseif drawing.pending.mode == 'circle' thenlocal mx,my = Drawing.coord(x-16), Drawing.coord(y-drawing.y)if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h thenlocal center = drawing.points[drawing.pending.center]drawing.pending.radius = geom.dist(center.x,center.y, mx,my)table.insert(drawing.shapes, drawing.pending) - replacement in drawing.lua at line 332
elseif Lines.current.pending.mode == 'arc' thenlocal mx,my = Drawing.coord(x-16), Drawing.coord(y-Lines.current.y)if mx >= 0 and mx < 256 and my >= 0 and my < Lines.current.h thenlocal center = Lines.current.points[Lines.current.pending.center]Lines.current.pending.end_angle = geom.angle_with_hint(center.x,center.y, mx,my, Lines.current.pending.end_angle)table.insert(Lines.current.shapes, Lines.current.pending)elseif drawing.pending.mode == 'arc' thenlocal mx,my = Drawing.coord(x-16), Drawing.coord(y-drawing.y)if mx >= 0 and mx < 256 and my >= 0 and my < drawing.h thenlocal center = drawing.points[drawing.pending.center]drawing.pending.end_angle = geom.angle_with_hint(center.x,center.y, mx,my, drawing.pending.end_angle)table.insert(drawing.shapes, drawing.pending) - replacement in drawing.lua at line 339
elseif Lines.current.pending.mode == 'move' thenelseif drawing.pending.mode == 'move' then - replacement in drawing.lua at line 341
elseif Lines.current.pending.mode == 'name' thenelseif drawing.pending.mode == 'name' then - replacement in drawing.lua at line 344
print(Lines.current.pending.mode)print(drawing.pending.mode)