some keyboard shortcuts on non-mobile devices
Dependencies
- [2]
KCFQO6K5clean up some debug drawing - [3]
YR7AXEYBadd keyboard shortcuts for common operations - [4]
LGIEVJE6activate buttons for some time - [5]
OGDDLU5Bclose all menus when tapping any button - [6]
FIUQJVL2first draft of load/save buttons - [7]
SJXIMERStype out a filename to load/save - [8]
W3RRTO4Pextract a second helper for buttons - [9]
SIJ5I4NZextract a helper for buttons - [10]
AZMYKWMHresolve conflicts - [11]
5MEJ7XNHlay out buttons based on device dimensions - [12]
DZLFYLDUmanually save settings on change to loaded filenames - [13]
GWLETNMWMike's suggested button layout - [14]
6ARK6HWFbugfix: avoid overflowing 'delete' button in some situations - [15]
X2YWEIZSbugfix: missing variable in a button - [16]
6VPJTZFSreset file system state with everything else - [17]
I52S4E5Frunning `print` now appends to output editor - [18]
RK2ASPN7add lots of buttons to the toolbar - [19]
W4EQ6IW4simplify state management for menus - [*]
XX7G2FFJintermingle freehand line drawings with text - [*]
LJUJH5GPbugfix: propagate mouse press if any button would - [*]
R5QXEHUIsomebody stop me - [*]
ZM7NOBRMnew fork: carousel shell - [*]
2Q437U4Fstarting to experiment with animated pane transitions
Change contents
- edit in button.lua at line 35
endfunction draw_button_tooltips(State)if App.mouse_down(1) then return endlocal x,y = love.mouse.getPosition()for _,ev in ipairs(State.button_handlers) doif ev.tooltip thenif x>ev.x and x<ev.x+ev.w and y>ev.y and y<ev.y+ev.h thenev.tooltip(x,y)endendend - file addition: 0175-show_tooltip[23.2]
show_tooltip = function(x,y, tooltip_text)if not tooltip_text then return endApp.color(Tooltip_background)local w = App.width(tooltip_text)love.graphics.rectangle('fill', x,y, w+10, Line_height+10, 2,2)App.color(Tooltip_foreground)love.graphics.print(tooltip_text, x+5, y+5)end - file addition: 0174-Is_mobile[23.2]
Is_mobile = (OS == 'Android' or OS == 'iOS') - file addition: 0173-Tooltip_foreground[23.2]
Tooltip_foreground = {r=0, g=0, b=0} - file addition: 0172-Tooltip_background[23.2]
Tooltip_background = {r=0.8, g=0.8, b=0.8} - edit in 0168-press_previous_pane_button at line 3
if Current_pane_index <=1 then return end - edit in 0167-press_next_pane_button at line 3
if Current_pane_index >= #Panes then return end - replacement in 0124-styled_button at line 1
styled_button = function(name, x, y, onpress1)styled_button = function(name, x, y, onpress1, tooltip_text) - edit in 0124-styled_button at line 20
tooltip = function(x,y)show_tooltip(x,y+20, tooltip_text)end, - replacement in 0124-styled_button at line 24
end[4.346]end - replacement in 0118-overflowable_button at line 3
overflowable_button = function(name, x, y, r, onpress1, final_button)overflowable_button = function(name, x, y, r, onpress1, final_button, tooltip_text) - replacement in 0118-overflowable_button at line 14
styled_button(name, x,y, onpress1)styled_button(name, x,y, onpress1, tooltip_text) - replacement in 0118-overflowable_button at line 20
end[4.649]end - replacement in 0117-load_button at line 3[4.2500]→[4.2500:2513](∅→∅),[4.2513]→[4.35:54](∅→∅),[4.54]→[4.2570:2642](∅→∅),[4.54]→[4.2570:2642](∅→∅),[4.2570]→[4.2570:2642](∅→∅),[4.2642]→[4.2721:2824](∅→∅),[4.2824]→[4.2642:2699](∅→∅),[4.2642]→[4.2642:2699](∅→∅),[4.2699]→[4.57:247](∅→∅),[4.247]→[4.2699:2713](∅→∅),[4.2699]→[4.2699:2713](∅→∅)
function()Show_menu = nilShow_file_dialog = trueFile_dialog_callback = function(filename)if filename == '' then-- clear filenameCurrent_pane.filename = nilreturnendCurrent_pane.filename = filenameone_time_load()-- Load new filename in future sessions.-- On mobile devices, we can't depend on on.save_settings() triggering on quit.love.filesystem.write('config', json.encode(settings()))endend)press_load_button, --[[final button?]] false, not Is_mobile and Show_code and 'F5') - replacement in 0116-save_button at line 2
return overflowable_button('save', x, y, r, press_save_button)return overflowable_button('save', x, y, r, press_save_button, --[[final button?]] false, not Is_mobile and Show_code and 'F4') - replacement in 0106-stop_button at line 2
styled_button('stop', x,y, press_stop_button)styled_button('stop', x,y, press_stop_button, not Is_mobile and Show_code and 'F2') - replacement in 0065-hide_code_button at line 2
return overflowable_button('hide', x, y, r, press_hide_button)return overflowable_button('hide', x, y, r, press_hide_button, nil, not Is_mobile and 'F3') - replacement in 0064-show_code_button at line 2
return overflowable_button('show', x, y, r, press_show_button)return overflowable_button('show', x, y, r, press_show_button, nil, not Is_mobile and 'F3') - edit in 0060-next_pane_button at line 8
tooltip = function(x,y)local w = App.width('ctrl+right')show_tooltip(x-w-10,y+20, not Is_mobile and Show_code and 'ctrl+right')end, - edit in 0059-previous_pane_button at line 8
tooltip = function(x,y)show_tooltip(x,y+20, not Is_mobile and Show_code and 'ctrl+left')end, - replacement in 0051-run_button at line 2
styled_button('run', x,y, press_run_button)styled_button('run', x,y, press_run_button, not Is_mobile and Show_code and 'F1') - edit in 0012-on.draw at line 27[25.2223][2.146]
draw_button_tooltips(Global_state)