add state arg to few functions
[?]
Jul 13, 2022, 12:05 AM
P4376EXKQXGN6KUOKIZDSGN65J5C33XVX3RDXHYVOOTG7P2ISZWQCDependencies
- [2]
LF7BWEG4group all editor globals - [3]
C6QTJYA4keep online help inside of drawing - [4]
4KC7I3E2make colors easier to edit - [5]
BERHYBXMfix help for rectangles and squares - [6]
NUCZBE77bugfix: alignment of help screen - [7]
HOSPP2ANcrisp font rendering - [8]
DRFE3B3Zmouse buttons are integers, not strings - [9]
XRLJDW3Wcasting about for more helpers to extract.. - [10]
DXT4QTAHa few more integer coordinates - [11]
NQH7DEEWbugfix: missed rename in one file - [12]
M6TH7VSZrip out notion of Line_width - [13]
7JH2ZT3Fadd state arg to Drawing.draw - [14]
LAW2O3NWextract variable Margin_left - [15]
BLWAYPKVextract a module - [16]
GSV7DABCmake online help fit within a drawing - [17]
VHQCNMARseveral more modules - [18]
WTDKUACNrectangle and square shapes - [19]
253TWKDAclean up - [20]
JFFUF5ALoverride mouse state lookups in tests - [21]
WPW3AVFSmore precise shape selection
Change contents
- replacement in help.lua at line 1
function draw_help_without_mouse_pressed(drawing)function draw_help_without_mouse_pressed(State, drawing) - replacement in help.lua at line 4
love.graphics.print("Things you can do:", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightlove.graphics.print("* Press the mouse button to start drawing a "..current_shape(), Editor_state.margin_left+30,y)y = y + Editor_state.line_heightlove.graphics.print("* Hover on a point and press 'ctrl+u' to pick it up and start moving it,", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightlove.graphics.print("then press the mouse button to drop it", Editor_state.margin_left+30+bullet_indent(),y)y = y + Editor_state.line_heightlove.graphics.print("* Hover on a point and press 'ctrl+n', type a name, then press 'enter'", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightlove.graphics.print("* Hover on a point or shape and press 'ctrl+d' to delete it", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightif Editor_state.current_drawing_mode ~= 'freehand' thenlove.graphics.print("* Press 'ctrl+p' to switch to drawing freehand strokes", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightlove.graphics.print("Things you can do:", State.margin_left+30,y)y = y + State.line_heightlove.graphics.print("* Press the mouse button to start drawing a "..current_shape(State), State.margin_left+30,y)y = y + State.line_heightlove.graphics.print("* Hover on a point and press 'ctrl+u' to pick it up and start moving it,", State.margin_left+30,y)y = y + State.line_heightlove.graphics.print("then press the mouse button to drop it", State.margin_left+30+bullet_indent(),y)y = y + State.line_heightlove.graphics.print("* Hover on a point and press 'ctrl+n', type a name, then press 'enter'", State.margin_left+30,y)y = y + State.line_heightlove.graphics.print("* Hover on a point or shape and press 'ctrl+d' to delete it", State.margin_left+30,y)y = y + State.line_heightif State.current_drawing_mode ~= 'freehand' thenlove.graphics.print("* Press 'ctrl+p' to switch to drawing freehand strokes", State.margin_left+30,y)y = y + State.line_height - replacement in help.lua at line 20
if Editor_state.current_drawing_mode ~= 'line' thenlove.graphics.print("* Press 'ctrl+l' to switch to drawing lines", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightif State.current_drawing_mode ~= 'line' thenlove.graphics.print("* Press 'ctrl+l' to switch to drawing lines", State.margin_left+30,y)y = y + State.line_height - replacement in help.lua at line 24
if Editor_state.current_drawing_mode ~= 'manhattan' thenlove.graphics.print("* Press 'ctrl+m' to switch to drawing horizontal/vertical lines", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightif State.current_drawing_mode ~= 'manhattan' thenlove.graphics.print("* Press 'ctrl+m' to switch to drawing horizontal/vertical lines", State.margin_left+30,y)y = y + State.line_height - replacement in help.lua at line 28
if Editor_state.current_drawing_mode ~= 'circle' thenlove.graphics.print("* Press 'ctrl+o' to switch to drawing circles/arcs", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightif State.current_drawing_mode ~= 'circle' thenlove.graphics.print("* Press 'ctrl+o' to switch to drawing circles/arcs", State.margin_left+30,y)y = y + State.line_height - replacement in help.lua at line 32
if Editor_state.current_drawing_mode ~= 'polygon' thenlove.graphics.print("* Press 'ctrl+g' to switch to drawing polygons", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightif State.current_drawing_mode ~= 'polygon' thenlove.graphics.print("* Press 'ctrl+g' to switch to drawing polygons", State.margin_left+30,y)y = y + State.line_height - replacement in help.lua at line 36
if Editor_state.current_drawing_mode ~= 'rectangle' thenlove.graphics.print("* Press 'ctrl+r' to switch to drawing rectangles", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightif State.current_drawing_mode ~= 'rectangle' thenlove.graphics.print("* Press 'ctrl+r' to switch to drawing rectangles", State.margin_left+30,y)y = y + State.line_height - replacement in help.lua at line 40
if Editor_state.current_drawing_mode ~= 'square' thenlove.graphics.print("* Press 'ctrl+s' to switch to drawing squares", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightif State.current_drawing_mode ~= 'square' thenlove.graphics.print("* Press 'ctrl+s' to switch to drawing squares", State.margin_left+30,y)y = y + State.line_height - replacement in help.lua at line 44
love.graphics.print("* Press 'ctrl+=' or 'ctrl+-' to zoom in or out, ctrl+0 to reset zoom", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightlove.graphics.print("Press 'esc' now to hide this message", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightlove.graphics.print("* Press 'ctrl+=' or 'ctrl+-' to zoom in or out, ctrl+0 to reset zoom", State.margin_left+30,y)y = y + State.line_heightlove.graphics.print("Press 'esc' now to hide this message", State.margin_left+30,y)y = y + State.line_height - replacement in help.lua at line 49
love.graphics.rectangle('fill', Editor_state.margin_left,drawing.y, App.screen.width-Editor_state.margin_width, math.max(Drawing.pixels(drawing.h),y-drawing.y))love.graphics.rectangle('fill', State.margin_left,drawing.y, App.screen.width-State.margin_width, math.max(Drawing.pixels(drawing.h),y-drawing.y)) - replacement in help.lua at line 52
function draw_help_with_mouse_pressed(drawing)function draw_help_with_mouse_pressed(State, drawing) - replacement in help.lua at line 55
love.graphics.print("You're currently drawing a "..current_shape(drawing.pending), Editor_state.margin_left+30,y)y = y + Editor_state.line_heightlove.graphics.print('Things you can do now:', Editor_state.margin_left+30,y)y = y + Editor_state.line_heightif Editor_state.current_drawing_mode == 'freehand' thenlove.graphics.print('* Release the mouse button to finish drawing the stroke', Editor_state.margin_left+30,y)y = y + Editor_state.line_heightelseif Editor_state.current_drawing_mode == 'line' or Editor_state.current_drawing_mode == 'manhattan' thenlove.graphics.print('* Release the mouse button to finish drawing the line', Editor_state.margin_left+30,y)y = y + Editor_state.line_heightelseif Editor_state.current_drawing_mode == 'circle' thenlove.graphics.print("You're currently drawing a "..current_shape(State, drawing.pending), State.margin_left+30,y)y = y + State.line_heightlove.graphics.print('Things you can do now:', State.margin_left+30,y)y = y + State.line_heightif State.current_drawing_mode == 'freehand' thenlove.graphics.print('* Release the mouse button to finish drawing the stroke', State.margin_left+30,y)y = y + State.line_heightelseif State.current_drawing_mode == 'line' or State.current_drawing_mode == 'manhattan' thenlove.graphics.print('* Release the mouse button to finish drawing the line', State.margin_left+30,y)y = y + State.line_heightelseif State.current_drawing_mode == 'circle' then - replacement in help.lua at line 67
love.graphics.print('* Release the mouse button to finish drawing the circle', Editor_state.margin_left+30,y)y = y + Editor_state.line_heightlove.graphics.print("* Press 'a' to draw just an arc of a circle", Editor_state.margin_left+30,y)love.graphics.print('* Release the mouse button to finish drawing the circle', State.margin_left+30,y)y = y + State.line_heightlove.graphics.print("* Press 'a' to draw just an arc of a circle", State.margin_left+30,y) - replacement in help.lua at line 71
love.graphics.print('* Release the mouse button to finish drawing the arc', Editor_state.margin_left+30,y)love.graphics.print('* Release the mouse button to finish drawing the arc', State.margin_left+30,y) - replacement in help.lua at line 73
y = y + Editor_state.line_heightelseif Editor_state.current_drawing_mode == 'polygon' thenlove.graphics.print('* Release the mouse button to finish drawing the polygon', Editor_state.margin_left+30,y)y = y + Editor_state.line_heightlove.graphics.print("* Press 'p' to add a vertex to the polygon", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightelseif Editor_state.current_drawing_mode == 'rectangle' theny = y + State.line_heightelseif State.current_drawing_mode == 'polygon' thenlove.graphics.print('* Release the mouse button to finish drawing the polygon', State.margin_left+30,y)y = y + State.line_heightlove.graphics.print("* Press 'p' to add a vertex to the polygon", State.margin_left+30,y)y = y + State.line_heightelseif State.current_drawing_mode == 'rectangle' then - replacement in help.lua at line 81
love.graphics.print("* Press 'p' to add a vertex to the rectangle", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightlove.graphics.print("* Press 'p' to add a vertex to the rectangle", State.margin_left+30,y)y = y + State.line_height - replacement in help.lua at line 84
love.graphics.print('* Release the mouse button to finish drawing the rectangle', Editor_state.margin_left+30,y)y = y + Editor_state.line_heightlove.graphics.print("* Press 'p' to replace the second vertex of the rectangle", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightlove.graphics.print('* Release the mouse button to finish drawing the rectangle', State.margin_left+30,y)y = y + State.line_heightlove.graphics.print("* Press 'p' to replace the second vertex of the rectangle", State.margin_left+30,y)y = y + State.line_height - replacement in help.lua at line 89
elseif Editor_state.current_drawing_mode == 'square' thenelseif State.current_drawing_mode == 'square' then - replacement in help.lua at line 91
love.graphics.print("* Press 'p' to add a vertex to the square", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightlove.graphics.print("* Press 'p' to add a vertex to the square", State.margin_left+30,y)y = y + State.line_height - replacement in help.lua at line 94
love.graphics.print('* Release the mouse button to finish drawing the square', Editor_state.margin_left+30,y)y = y + Editor_state.line_heightlove.graphics.print("* Press 'p' to replace the second vertex of the square", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightlove.graphics.print('* Release the mouse button to finish drawing the square', State.margin_left+30,y)y = y + State.line_heightlove.graphics.print("* Press 'p' to replace the second vertex of the square", State.margin_left+30,y)y = y + State.line_height - replacement in help.lua at line 100
love.graphics.print("* Press 'esc' then release the mouse button to cancel the current shape", Editor_state.margin_left+30,y)y = y + Editor_state.line_heighty = y + Editor_state.line_heightif Editor_state.current_drawing_mode ~= 'line' thenlove.graphics.print("* Press 'l' to switch to drawing lines", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightlove.graphics.print("* Press 'esc' then release the mouse button to cancel the current shape", State.margin_left+30,y)y = y + State.line_heighty = y + State.line_heightif State.current_drawing_mode ~= 'line' thenlove.graphics.print("* Press 'l' to switch to drawing lines", State.margin_left+30,y)y = y + State.line_height - replacement in help.lua at line 107
if Editor_state.current_drawing_mode ~= 'manhattan' thenlove.graphics.print("* Press 'm' to switch to drawing horizontal/vertical lines", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightif State.current_drawing_mode ~= 'manhattan' thenlove.graphics.print("* Press 'm' to switch to drawing horizontal/vertical lines", State.margin_left+30,y)y = y + State.line_height - replacement in help.lua at line 111
if Editor_state.current_drawing_mode ~= 'circle' thenlove.graphics.print("* Press 'o' to switch to drawing circles/arcs", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightif State.current_drawing_mode ~= 'circle' thenlove.graphics.print("* Press 'o' to switch to drawing circles/arcs", State.margin_left+30,y)y = y + State.line_height - replacement in help.lua at line 115
if Editor_state.current_drawing_mode ~= 'polygon' thenlove.graphics.print("* Press 'g' to switch to drawing polygons", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightif State.current_drawing_mode ~= 'polygon' thenlove.graphics.print("* Press 'g' to switch to drawing polygons", State.margin_left+30,y)y = y + State.line_height - replacement in help.lua at line 119
if Editor_state.current_drawing_mode ~= 'rectangle' thenlove.graphics.print("* Press 'r' to switch to drawing rectangles", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightif State.current_drawing_mode ~= 'rectangle' thenlove.graphics.print("* Press 'r' to switch to drawing rectangles", State.margin_left+30,y)y = y + State.line_height - replacement in help.lua at line 123
if Editor_state.current_drawing_mode ~= 'square' thenlove.graphics.print("* Press 's' to switch to drawing squares", Editor_state.margin_left+30,y)y = y + Editor_state.line_heightif State.current_drawing_mode ~= 'square' thenlove.graphics.print("* Press 's' to switch to drawing squares", State.margin_left+30,y)y = y + State.line_height - replacement in help.lua at line 128
love.graphics.rectangle('fill', Editor_state.margin_left,drawing.y, App.screen.width-Editor_state.margin_width, math.max(Drawing.pixels(drawing.h),y-drawing.y))love.graphics.rectangle('fill', State.margin_left,drawing.y, App.screen.width-State.margin_width, math.max(Drawing.pixels(drawing.h),y-drawing.y)) - replacement in help.lua at line 131
function current_shape(shape)if Editor_state.current_drawing_mode == 'freehand' thenfunction current_shape(State, shape)if State.current_drawing_mode == 'freehand' then - replacement in help.lua at line 134
elseif Editor_state.current_drawing_mode == 'line' thenelseif State.current_drawing_mode == 'line' then - replacement in help.lua at line 136
elseif Editor_state.current_drawing_mode == 'manhattan' thenelseif State.current_drawing_mode == 'manhattan' then - replacement in help.lua at line 138
elseif Editor_state.current_drawing_mode == 'circle' and shape and shape.start_angle thenelseif State.current_drawing_mode == 'circle' and shape and shape.start_angle then - replacement in help.lua at line 141
return Editor_state.current_drawing_modereturn State.current_drawing_mode - replacement in drawing.lua at line 19
draw_help_with_mouse_pressed(line)draw_help_with_mouse_pressed(State, line) - replacement in drawing.lua at line 25
draw_help_without_mouse_pressed(line)draw_help_without_mouse_pressed(State, line)