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SKOVXTKVAUEL47HET566LJF7ZSWVKMMLBSJWUHFAC stop_button = function(x, y)styled_button('stop', x,y,function()Show_menu = nilclear_handlers()end)if car.quit thencall_protected(car.quit)endlocal w = App.width('stop')+10return x+w+10, yend
hide_code_button = function(x, y, r)return overflowable_button('hide', x, y, r,function()Show_menu = nilShow_code = falseend)end
show_code_button = function(x, y, r)return overflowable_button('show', x, y, r,function()Show_menu = nilShow_code = trueend)end
on.quit = function()call_protected(car.quit)end
if Show_code thenif App.mouse_y() < Current_pane.editor_state.bottom thenedit.mouse_wheel_move(Current_pane.editor_state, dx,dy)elseedit.mouse_wheel_move(Current_pane.output_editor_state, dx,dy)endelse-- editors hidden
if not Show_code then
x = stop_button(x, y)-- assume screen will always be wide enough to print this far without overflowif not Overflow_button thenlocal w = App.width('code')+10local w2 = App.width('>>')+10if x+w+10+w2+10 < r thenApp.color{r=0.5, g=0.5, b=0.5}love.graphics.print('code', x, y)x = x+w+10endendif Show_code thenx, y = hide_code_button(x, y, r)elsex, y = show_code_button(x, y, r)end
x, y = clear_pane_button(x, y, r)if not Overflow_button thenlocal w = App.width('screen')+10local w2 = App.width('>>')+10if x+w+10+w2+10 < r thenApp.color{r=0.5, g=0.5, b=0.5}love.graphics.print('screen', x, y)x = x+w+10endend
-- == menu areaif Button_pressed thenButton_pressed = nilreturnend-- == settings areaGlobal_state.selected_slider = nilif Show_menu == 'settings' thenif on_area(Settings_menu_area, x,y) then
if not Show_code thenif car.mouse_release thencall_protected(car.mouse_release, x,y, mouse_button)endif car.mousereleased thencall_protected(car.mousereleased, x,y, mouse_button)endelse-- == menu areaif Button_pressed thenButton_pressed = nil
end-- == main areaif Show_code then
-- == settings areaGlobal_state.selected_slider = nilif Show_menu == 'settings' thenif on_area(Settings_menu_area, x,y) thenreturnendend-- == main area
-- == menu area-- some hysteresis right after a button has been pressedif Active_button then return endif mouse_press_consumed_by_any_button(Global_state, x,y, mouse_button) thenButton_pressed = truereturnend-- == settings areaif mouse_press_consumed_by_any_slider(Global_state, x,y) thenreturnendif Show_menu == 'settings' thenif on_area(Settings_menu_area, x,y) then-- nothing atm in settings menu that isn't a button or sliderelseShow_menu = nil-- On mobile devices, we can't depend on on.save_settings() triggering on quit.-- So save settings every time we close the settings menu.love.filesystem.write('config', json.encode(settings()))
if not Show_code thenif car.mouse_press thencall_protected(car.mouse_press, x,y, mouse_button)endif car.mousepressed thencall_protected(car.mousepressed, x,y, mouse_button)endelse-- == menu area-- some hysteresis right after a button has been pressedif Active_button then return endif mouse_press_consumed_by_any_button(Global_state, x,y, mouse_button) thenButton_pressed = truereturnend-- == settings areaif mouse_press_consumed_by_any_slider(Global_state, x,y) thenreturnendif Show_menu == 'settings' thenif on_area(Settings_menu_area, x,y) then-- nothing atm in settings menu that isn't a button or sliderelseShow_menu = nil-- On mobile devices, we can't depend on on.save_settings() triggering on quit.-- So save settings every time we close the settings menu.love.filesystem.write('config', json.encode(settings()))endreturn
returnend-- == main areaShow_menu = nilif Show_code then
-- == main areaShow_menu = nil
if Show_file_dialog thentext_input_on_file_dialog(t)elseif Show_code thenif Current_pane.editor_state.cursor_x then
if Show_code thenif Show_file_dialog thentext_input_on_file_dialog(t)elseif Current_pane.editor_state.cursor_x then
if Show_file_dialog thenkeychord_press_on_file_dialog(chord, key)returnendif chord == 'C-=' thenupdate_font_settings(Current_pane.editor_state.font_height+2)elseif chord == 'C--' thenupdate_font_settings(Current_pane.editor_state.font_height-2)elseif chord == 'C-0' thenupdate_font_settings(20)elseif Show_code thenif Current_pane.editor_state.cursor_x then-- send keys to editor if cursor is visibleedit.keychord_press(Current_pane.editor_state, chord, key)
if Show_code thenif Show_file_dialog thenkeychord_press_on_file_dialog(chord, key)returnendif chord == 'C-=' thenupdate_font_settings(Current_pane.editor_state.font_height+2)elseif chord == 'C--' thenupdate_font_settings(Current_pane.editor_state.font_height-2)elseif chord == 'C-0' thenupdate_font_settings(20)elseif Current_pane.editor_state.cursor_x then-- send keys to editor if cursor is visibleedit.keychord_press(Current_pane.editor_state, chord, key)end
-- modal dialogif Show_file_dialog thendraw_file_dialog()returnendOverflow_button = nillove.graphics.setBackgroundColor(Background_color.r, Background_color.g, Background_color.b)App.color(Foreground_color)if car.draw then call_protected(car.draw) endlove.graphics.setFont(Font)App.color(Normal_color)love.graphics.setLineWidth(1)if Show_code then
if not Show_code thenif car.draw then call_protected(car.draw) endelse-- modal dialogif Show_file_dialog thendraw_file_dialog()returnendOverflow_button = nillove.graphics.setBackgroundColor(Background_color.r, Background_color.g, Background_color.b)App.color(Foreground_color)-- code editorlove.graphics.setFont(Font)App.color(Normal_color)love.graphics.setLineWidth(1)
-- == menu areaif Active_button and Active_button.expire <= Current_time thenActive_button = nil
if not Show_code thenif car.update then call_protected(car.update, dt) endelse-- == menu areaif Active_button and Active_button.expire <= Current_time thenActive_button = nilend-- == settings areaupdate_sliders(Global_state, App.mouse_x())-- == main areaif Current_pane.editor_state.scrollbar_drag thenadjust_scrollbar(Current_pane.editor_state, App.mouse_y())elseif Current_pane.output_editor_state.scrollbar_drag thenadjust_scrollbar(Current_pane.output_editor_state, App.mouse_y())end
-- == settings areaupdate_sliders(Global_state, App.mouse_x())-- == main areaif Current_pane.editor_state.scrollbar_drag thenadjust_scrollbar(Current_pane.editor_state, App.mouse_y())elseif Current_pane.output_editor_state.scrollbar_drag thenadjust_scrollbar(Current_pane.output_editor_state, App.mouse_y())endif car.update then call_protected(car.update, dt) end