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CWCRJHBKHKWA4WZSPWYUDQC
UEG224LHBOPWSKOVXTKVAUEL47HET566LJF7ZSWVKMMLBSJWUHFAC
stop_button = function(x, y)
styled_button('stop', x,y,
function()
Show_menu = nil
clear_handlers()
end)
if car.quit then
call_protected(car.quit)
end
local w = App.width('stop')+10
return x+w+10, y
end
hide_code_button = function(x, y, r)
return overflowable_button('hide', x, y, r,
function()
Show_menu = nil
Show_code = false
end)
end
show_code_button = function(x, y, r)
return overflowable_button('show', x, y, r,
function()
Show_menu = nil
Show_code = true
end)
end
on.quit = function()
call_protected(car.quit)
end
if Show_code then
if App.mouse_y() < Current_pane.editor_state.bottom then
edit.mouse_wheel_move(Current_pane.editor_state, dx,dy)
else
edit.mouse_wheel_move(Current_pane.output_editor_state, dx,dy)
end
else
-- editors hidden
if not Show_code then
x = stop_button(x, y)
-- assume screen will always be wide enough to print this far without overflow
if not Overflow_button then
local w = App.width('code')+10
local w2 = App.width('>>')+10
if x+w+10+w2+10 < r then
App.color{r=0.5, g=0.5, b=0.5}
love.graphics.print('code', x, y)
x = x+w+10
end
end
if Show_code then
x, y = hide_code_button(x, y, r)
else
x, y = show_code_button(x, y, r)
end
x, y = clear_pane_button(x, y, r)
if not Overflow_button then
local w = App.width('screen')+10
local w2 = App.width('>>')+10
if x+w+10+w2+10 < r then
App.color{r=0.5, g=0.5, b=0.5}
love.graphics.print('screen', x, y)
x = x+w+10
end
end
-- == menu area
if Button_pressed then
Button_pressed = nil
return
end
-- == settings area
Global_state.selected_slider = nil
if Show_menu == 'settings' then
if on_area(Settings_menu_area, x,y) then
if not Show_code then
if car.mouse_release then
call_protected(car.mouse_release, x,y, mouse_button)
end
if car.mousereleased then
call_protected(car.mousereleased, x,y, mouse_button)
end
else
-- == menu area
if Button_pressed then
Button_pressed = nil
end
-- == main area
if Show_code then
-- == settings area
Global_state.selected_slider = nil
if Show_menu == 'settings' then
if on_area(Settings_menu_area, x,y) then
return
end
end
-- == main area
-- == menu area
-- some hysteresis right after a button has been pressed
if Active_button then return end
if mouse_press_consumed_by_any_button(Global_state, x,y, mouse_button) then
Button_pressed = true
return
end
-- == settings area
if mouse_press_consumed_by_any_slider(Global_state, x,y) then
return
end
if Show_menu == 'settings' then
if on_area(Settings_menu_area, x,y) then
-- nothing atm in settings menu that isn't a button or slider
else
Show_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 then
if car.mouse_press then
call_protected(car.mouse_press, x,y, mouse_button)
end
if car.mousepressed then
call_protected(car.mousepressed, x,y, mouse_button)
end
else
-- == menu area
-- some hysteresis right after a button has been pressed
if Active_button then return end
if mouse_press_consumed_by_any_button(Global_state, x,y, mouse_button) then
Button_pressed = true
return
end
-- == settings area
if mouse_press_consumed_by_any_slider(Global_state, x,y) then
return
end
if Show_menu == 'settings' then
if on_area(Settings_menu_area, x,y) then
-- nothing atm in settings menu that isn't a button or slider
else
Show_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()))
end
return
return
end
-- == main area
Show_menu = nil
if Show_code then
-- == main area
Show_menu = nil
if Show_file_dialog then
text_input_on_file_dialog(t)
elseif Show_code then
if Current_pane.editor_state.cursor_x then
if Show_code then
if Show_file_dialog then
text_input_on_file_dialog(t)
elseif Current_pane.editor_state.cursor_x then
if Show_file_dialog then
keychord_press_on_file_dialog(chord, key)
return
end
if chord == 'C-=' then
update_font_settings(Current_pane.editor_state.font_height+2)
elseif chord == 'C--' then
update_font_settings(Current_pane.editor_state.font_height-2)
elseif chord == 'C-0' then
update_font_settings(20)
elseif Show_code then
if Current_pane.editor_state.cursor_x then
-- send keys to editor if cursor is visible
edit.keychord_press(Current_pane.editor_state, chord, key)
if Show_code then
if Show_file_dialog then
keychord_press_on_file_dialog(chord, key)
return
end
if chord == 'C-=' then
update_font_settings(Current_pane.editor_state.font_height+2)
elseif chord == 'C--' then
update_font_settings(Current_pane.editor_state.font_height-2)
elseif chord == 'C-0' then
update_font_settings(20)
else
if Current_pane.editor_state.cursor_x then
-- send keys to editor if cursor is visible
edit.keychord_press(Current_pane.editor_state, chord, key)
end
-- modal dialog
if Show_file_dialog then
draw_file_dialog()
return
end
Overflow_button = nil
love.graphics.setBackgroundColor(Background_color.r, Background_color.g, Background_color.b)
App.color(Foreground_color)
if car.draw then call_protected(car.draw) end
love.graphics.setFont(Font)
App.color(Normal_color)
love.graphics.setLineWidth(1)
if Show_code then
if not Show_code then
if car.draw then call_protected(car.draw) end
else
-- modal dialog
if Show_file_dialog then
draw_file_dialog()
return
end
Overflow_button = nil
love.graphics.setBackgroundColor(Background_color.r, Background_color.g, Background_color.b)
App.color(Foreground_color)
-- code editor
love.graphics.setFont(Font)
App.color(Normal_color)
love.graphics.setLineWidth(1)
-- == menu area
if Active_button and Active_button.expire <= Current_time then
Active_button = nil
if not Show_code then
if car.update then call_protected(car.update, dt) end
else
-- == menu area
if Active_button and Active_button.expire <= Current_time then
Active_button = nil
end
-- == settings area
update_sliders(Global_state, App.mouse_x())
-- == main area
if Current_pane.editor_state.scrollbar_drag then
adjust_scrollbar(Current_pane.editor_state, App.mouse_y())
elseif Current_pane.output_editor_state.scrollbar_drag then
adjust_scrollbar(Current_pane.output_editor_state, App.mouse_y())
end
-- == settings area
update_sliders(Global_state, App.mouse_x())
-- == main area
if Current_pane.editor_state.scrollbar_drag then
adjust_scrollbar(Current_pane.editor_state, App.mouse_y())
elseif Current_pane.output_editor_state.scrollbar_drag then
adjust_scrollbar(Current_pane.output_editor_state, App.mouse_y())
end
if car.update then call_protected(car.update, dt) end