I52S4E5FT6E6FHH3QEDJPWO7C6W7AIMAFDP2KQ5FEWXFQX7RY6CAC VAVXKWZVOFJGWHCWYLTPDKSKKMSJEBKXNKXUW3T6IZAC3HE6HOIQC R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC PRE6XPRNICDCHMF7C45A6DRPVT47IPAIWW6Q7AHNGW3D2PBGOPNAC 5RUFNRJOK3PXQKJTPDEN5K5PI67MGB25QUA44WOCCH2O5KHXT45QC 6RYGW5H3J44O73WFXGFVTBW5N5UEQ4E732AJJUZNBVQLYDA5LGLAC WR2WMEPEKNFAB4CAUBVFBACAJJSX2VX5B2VHKKSNTJSJBIIXFVZQC Z5M23NTKKGEACSQJT27DRNS7NEK6OSLR2IOWVAH2C2PRAIU46BIQC run_button = function()button(Global_state, 'run', {x=Menu_left+5, y=Menu_top+5, w=App.width('Run')+10, h=Line_height, bg={r=0.6, g=0.8, b=0.6},icon = function(p)App.color(Normal_color)love.graphics.rectangle('line', p.x,p.y, p.w,p.h, 2,2)love.graphics.print('Run', p.x+5,p.y+2)end,onpress1 = function()-- ## run: initializelocal buf = table.concat(map(Current_pane.editor_state.lines, function(line) return line.data end), '\n')Current_pane.canvas = love.graphics.newCanvas()love.graphics.setCanvas(Current_pane.canvas)love.graphics.push('all')love.graphics.setBackgroundColor(1,1,1)love.graphics.setColor(0,0,0)Current_pane.output_editor_state.lines = {}Text.redraw_all(Current_pane.output_editor_state)local real_print = printprint = print_to_output-- ## runlocal status, result = live.eval(buf)-- ## run: save some stuff, clean up the restprint = real_printprint(status, result)if result then-- could be either output or errortable.insert(Current_pane.output_editor_state.lines, {data=tostring(result)})endif #Current_pane.output_editor_state.lines == 0 thentable.insert(Current_pane.output_editor_state.lines, {data=''})endText.redraw_all(Current_pane.output_editor_state)love.graphics.pop()love.graphics.setCanvas()end,})end
print_to_output = function(...)local line = table.concat(map({...}, tostring), ' ')table.insert(Current_pane.output_editor_state.lines,{data=line})end
button(Global_state, 'run', {x=Menu_left+5, y=Menu_top+5, w=App.width('Run')+10, h=Line_height, bg={r=0.6, g=0.8, b=0.6},icon = function(p)App.color(Normal_color)love.graphics.rectangle('line', p.x,p.y, p.w,p.h, 2,2)love.graphics.print('Run', p.x+5,p.y+2)end,onpress1 = function()print('run')local buf = table.concat(map(Current_pane.editor_state.lines, function(line) return line.data end), '\n')Current_pane.canvas = love.graphics.newCanvas()love.graphics.setCanvas(Current_pane.canvas)love.graphics.push('all')love.graphics.setBackgroundColor(1,1,1)love.graphics.setColor(0,0,0)local status, result = live.eval(buf)print(status, result)if result then-- could be either output or errorCurrent_pane.output_editor_state.lines = {{data=tostring(result)},}Text.redraw_all(Current_pane.output_editor_state)endlove.graphics.pop()love.graphics.setCanvas()end,})
run_button()