simplify state management for menus

akkartik
Dec 5, 2023, 6:09 AM
W4EQ6IW4KVNJDAN32RUK7BLGWJB3TKZIE27PLIIGU5ARJPBMVS6QC

Dependencies

  • [2] XG6DGBFE hoist a temporary inside a function
  • [3] PUXFYOQ4 rename a function
  • [4] EHKB76GO UI improvement: more stable scrollbar movement
  • [5] OJGIQLZW bugfix: only check for settings menu when open
  • [6] OGDDLU5B close all menus when tapping any button
  • [7] 4QFVRJ5U get rid of pane transition animations
  • [8] 6DJMOJKE support event handlers
  • [9] XX7G2FFJ intermingle freehand line drawings with text
  • [10] ORKN6EOB Merge lines.love
  • [11] VP5KC4XZ Merge lines.love
  • [12] RVJNNICY bugfix: autosave settings
  • [13] T4FRZSYL delete an ancient, unused file
  • [14] VXORMHME delete experimental REPL
  • [15] NV4WC3K4 new example: interactivity
  • [16] 73OCE2MC after much struggle, a brute-force undo
  • [17] ESOJS6ZW extract a function
  • [18] ZGPYJMP3 bugfix: crash when saving to empty file
  • [19] YS4AQXJC hide other menus when opening one
  • [20] UUAIVZ4U 2 bugfixes in font rendering
  • [21] OGUV4HSA remove some memory leaks from rendered fragments
  • [22] 2DVVKKVA flesh out Readme
  • [23] QD4LOFQR Merge text.love
  • [24] LGIEVJE6 activate buttons for some time
  • [25] ZLJYLPOT Merge lines.love
  • [26] VHQCNMAR several more modules
  • [27] VTCPDL3A resolve conflicts
  • [28] VHUNJHXB Merge lines.love
  • [29] D2GCFTTT clean up repl functionality
  • [30] 66X36NZN a little more prose describing manual_tests
  • [31] R5QXEHUI somebody stop me
  • [32] 34BZ5ZKN Merge lines.love
  • [33] 6ARK6HWF bugfix: avoid overflowing 'delete' button in some situations
  • [34] D2TYFYG2 Merge text.love
  • [35] TBTRYEBP Merge lines.love
  • [36] VLTU33KW resolve conflicts
  • [37] FIUQJVL2 first draft of load/save buttons
  • [38] BULPIBEG beginnings of a module for the text editor
  • [39] VEAVIL4X resize handler
  • [40] 47VXAH2H delete some old code
  • [41] ED4Z6ORC cleaner API for file-system access
  • [42] I52S4E5F running `print` now appends to output editor
  • [43] JV27LDDK sliders for font size and color settings
  • [44] TVCPXAAU rename
  • [45] 5OVKHVY6 nice way to make on.* handlers more discoverable
  • [46] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [47] MZ3DMYPD start sketching out a scrollbar
  • [48] 4GX6NAY4 some very basic animations for switching panes
  • [49] Q6RXCILQ Merge text.love
  • [50] 6MQCFHXM remember when someone deletes an example
  • [51] E75L5QGU ok/cancel buttons in file dialog
  • [52] 4YDBYBA4 clean up memory leak experiments
  • [53] M5JXTW56 Merge text.love
  • [54] JOPVPUSA editing source code from within the app
  • [55] GWLETNMW Mike's suggested button layout
  • [56] K2X6G75Z start writing some tests for drawings
  • [57] X2DGB56U support undo of paste button
  • [58] 6VPJTZFS reset file system state with everything else
  • [59] 4SR3Z4Y3 document the version of LÖVE I've been using
  • [60] VXRYVZ74 Merge text.love
  • [61] SW5GN5LP suggest a default layout for freewheeling apps
  • [62] YCPA257V copy entire buffer when there's no selection
  • [63] KKQKPGCI resolve conflicts
  • [64] 6RYGW5H3 bugfix: output border color
  • [65] CE4LZV4T drop last couple of manual tests
  • [66] CMZDG7CJ bugfix: tapping in scrollbar area
  • [67] NVZTMKER partition handlers between screen regions
  • [68] D43U7GQ4 alter on-disk representation (manifest files)
  • [69] YY472LBU resolve conflicts
  • [70] OL7ZCZWD Merge text.love
  • [71] AVTNUQYR basic test-enabled framework
  • [72] YT7NMQ6Z delete dead code
  • [73] FM5LDKGT Merge text.love
  • [74] ZM7NOBRM new fork: carousel shell
  • [75] RK2ASPN7 add lots of buttons to the toolbar
  • [76] FPSPT5TM show current pane number
  • [77] GFBOJWNE resolve conflicts
  • [78] SGMA5JLE save the list of tests in repo
  • [79] SIJ5I4NZ extract a helper for buttons
  • [80] OOSUBWKX subject people to a tutorial
  • [81] VAVXKWZV aggregate global state inside a 'pane' object
  • [82] ZOGPQR4S really ignore hidden sliders
  • [83] UEG224LH debug animations
  • [84] SJXIMERS type out a filename to load/save
  • [85] IP4LD33D mouse events for scrollbar
  • [86] YV2GBDNW preserve settings across restart
  • [87] 5JMR2IJS bugfix: save settings on mobile devices
  • [88] QLJY3CKC bugfix: use border color in scrollbars
  • [89] 5RUFNRJO start of the visual skeleton
  • [90] OTIBCAUJ love2d scaffold
  • [91] SIASJPGR save the list of open files across restart
  • [92] KMSL74GA support selections in the source editor
  • [93] 3QNOKBFM beginnings of a test harness
  • [94] YF2ATH2Q Merge lines.love
  • [95] WR2WMEPE implement 'Run' button
  • [96] X2YWEIZS bugfix: missing variable in a button
  • [97] W3RRTO4P extract a second helper for buttons
  • [98] TLOAPLBJ add a license
  • [99] 3MJ2PYMW resolve conflicts
  • [100] 2L5MEZV3 experiment: new edit namespace
  • [101] 6LJZN727 handle chords
  • [102] 36Z442IV back to commit 8123959e52f without code editing
  • [103] ZENSSO3D pass remaining love handlers through
  • [104] N2NUGNN4 include a brief reference enabling many useful apps
  • [105] Z5M23NTK implement second, 'output' editor
  • [106] RSZD5A7G forgot to add json.lua
  • [107] VUF2SX7B implement carousel buttons for inserting/switching current pane
  • [108] HVXZLNCC send errors from event handlers to output editor
  • [109] CZQ3NJ4N Merge text0
  • [110] LWPFEZBI Merge lines.love
  • [111] 5MEJ7XNH lay out buttons based on device dimensions
  • [112] VQYLKEGD handle still narrower screens on phones
  • [113] 6VJTQKW7 start supporting LÖVE v12
  • [114] 2CFLXLIE Merge text.love
  • [115] KKMFQDR4 editing source code from within the app
  • [116] BLWAYPKV extract a module
  • [117] RU4HIK43 Merge lines.love
  • [118] CAG7PP5Y Merge text.love
  • [119] PJ5PQAQE record support for multiple versions
  • [120] QIG72BFJ really really ignore invisible sliders X-(
  • [121] FS2ITYYH record a known issue
  • [122] 2Q437U4F starting to experiment with animated pane transitions
  • [123] QGSOEM7Z bugfix: 'show' button layout
  • [124] EZHO4TSW new file-system format for freewheeling apps
  • [125] PRE6XPRN responsively increase/decrease font height
  • [126] LXTTOB33 extract a couple of files
  • [127] 57HKHZ7Z include the tool that's mentioned in representation.md
  • [128] LRDM35CE app running again
  • [129] 3PSFWAIL Merge lines.love

Change contents

  • file deletion: 0107-Show_overflow (----------)
    [7.2][7.1263:1305](),[7.1305][7.1154:1154]()
    -- True if the overflow menu has been opened and we want to render buttons within it.
    Show_overflow = false
  • file deletion: 0080-Show_settings (----------)
    [7.2][7.5384:5426](),[7.5426][7.5362:5362]()
    Show_settings =false
  • replacement in 0118-overflowable_button at line 8
    [7.230][7.230:258]()
    if not Show_overflow then
    [7.230]
    [7.258]
    if Show_menu ~= 'overflow' then
  • replacement in 0117-load_button at line 4
    [7.2513][6.4:54]()
    Show_overflow = false
    Show_settings = false
    [7.2513]
    [7.2570]
    Show_menu = nil
  • replacement in 0117-load_button at line 16
    [7.2713][7.2713:2716]()
    end
    [7.2713]
    end
  • replacement in 0116-save_button at line 4
    [7.2849][6.55:105]()
    Show_overflow = false
    Show_settings = false
    [7.2849]
    [7.2866]
    Show_menu = nil
  • replacement in 0116-save_button at line 16
    [7.3147][7.3147:3150]()
    end
    [7.3147]
    end
  • replacement in 0109-overflow_button at line 4
    [7.598][6.106:131](),[6.131][7.875:912](),[7.598][7.875:912](),[7.875][7.875:912]()
    Show_settings = false
    Show_overflow = not Show_overflow
    [7.598]
    [7.599]
    if Show_menu == 'overflow' then
    Show_menu = nil
    else
    Show_menu = 'overflow'
    end
  • replacement in 0109-overflow_button at line 11
    [7.54][7.953:956](),[7.953][7.953:956]()
    end
    [7.54]
    end
  • replacement in 0106-stop_button at line 4
    [6.173][6.173:223]()
    Show_overflow = false
    Show_settings = false
    [6.173]
    [6.223]
    Show_menu = nil
  • replacement in 0106-stop_button at line 9
    [7.1469][7.401:404](),[7.401][7.401:404]()
    end
    [7.1469]
    end
  • edit in 0086-select_settings_slider at line 2
    [3.55][3.55:93]()
    if not Show_settings then return end
  • edit in 0084-update_any_sliders at line 2
    [7.1751][7.94:132]()
    if not Show_settings then return end
  • replacement in 0084-update_any_sliders at line 18
    [7.2244][7.2244:2247]()
    end
    [7.2244]
    end
  • file addition: 0080-Show_menu (----------)
    [7.2]
    Show_menu = nil
  • replacement in 0076-delete_pane_button at line 4
    [7.713][6.251:301]()
    Show_overflow = false
    Show_settings = false
    [7.713]
    [7.779]
    Show_menu = nil
  • replacement in 0076-delete_pane_button at line 18
    [7.270][6.302:305]()
    end
    [7.270]
    end
  • replacement in 0074-clear_pane_button at line 4
    [6.319][6.319:369]()
    Show_overflow = false
    Show_settings = false
    [6.319]
    [6.369]
    Show_menu = nil
  • replacement in 0074-clear_pane_button at line 7
    [6.392][7.1310:1313](),[7.782][7.1310:1313](),[7.2271][7.1310:1313](),[7.1310][7.1310:1313]()
    end
    [6.392]
    end
  • replacement in 0072-settings_button at line 4
    [7.740][6.393:418](),[6.418][7.5520:5557](),[7.740][7.5520:5557](),[7.1684][7.5520:5557](),[7.169][7.0:29]()
    Show_overflow = false
    Show_settings = not Show_settings
    if not Show_settings then
    [7.740]
    [7.29]
    if Show_menu == 'settings' then
    Show_menu = nil
  • edit in 0072-settings_button at line 8
    [7.173]
    [7.173]
    else
    Show_menu = 'settings'
  • replacement in 0072-settings_button at line 12
    [2.181][7.1731:1734](),[7.1731][7.1731:1734]()
    end
    [7.748]
    end
  • replacement in 0067-paste_button at line 4
    [7.842][6.419:469]()
    Show_overflow = false
    Show_settings = false
    [7.842]
    [7.99]
    Show_menu = nil
  • replacement in 0067-paste_button at line 21
    [7.850][6.470:473]()
    end
    [7.850]
    end
  • replacement in 0066-copy_button at line 4
    [7.909][6.474:524]()
    Show_overflow = false
    Show_settings = false
    [7.909]
    [7.71]
    Show_menu = nil
  • replacement in 0066-copy_button at line 16
    [7.917][7.4682:4685](),[7.3059][7.4682:4685](),[7.4682][7.4682:4685]()
    end
    [7.917]
    end
  • replacement in 0065-hide_code_button at line 4
    [7.976][6.525:575]()
    Show_overflow = false
    Show_settings = false
    [7.976]
    [7.5069]
    Show_menu = nil
  • replacement in 0065-hide_code_button at line 7
    [7.984][7.5116:5119](),[7.3416][7.5116:5119](),[7.5116][7.5116:5119]()
    end
    [7.984]
    end
  • replacement in 0064-show_code_button at line 4
    [7.1043][6.576:626]()
    Show_overflow = false
    Show_settings = false
    [7.1043]
    [7.5508]
    Show_menu = nil
  • replacement in 0064-show_code_button at line 7
    [7.114][7.5554:5557](),[7.283][7.5554:5557](),[7.1051][7.5554:5557](),[7.3571][7.5554:5557](),[7.5554][7.5554:5557]()
    end
    [7.1051]
    end
  • replacement in 0061-new_pane_button at line 4
    [7.1109][6.627:677]()
    Show_overflow = false
    Show_settings = false
    [7.1109]
    [7.6000]
    Show_menu = nil
  • replacement in 0061-new_pane_button at line 9
    [7.1117][7.6170:6173](),[7.3944][7.6170:6173](),[7.6170][7.6170:6173]()
    end
    [7.1117]
    end
  • replacement in 0060-next_pane_button at line 8
    [7.6572][6.678:728]()
    Show_overflow = false
    Show_settings = false
    [7.6572]
    [7.1388]
    Show_menu = nil
  • replacement in 0060-next_pane_button at line 15
    [7.6672][7.6672:6675]()
    end
    [7.6672]
    end
  • replacement in 0059-previous_pane_button at line 8
    [7.7115][6.729:779]()
    Show_overflow = false
    Show_settings = false
    [7.7115]
    [7.1448]
    Show_menu = nil
  • replacement in 0059-previous_pane_button at line 15
    [7.7215][7.7215:7218]()
    end
    [7.7215]
    end
  • replacement in 0051-run_button at line 4
    [7.804][6.780:830]()
    Show_overflow = false
    Show_settings = false
    [7.804]
    [7.329]
    Show_menu = nil
  • replacement in 0051-run_button at line 32
    [7.195][7.1365:1368](),[7.4086][7.1365:1368](),[7.7580][7.1365:1368](),[7.1365][7.1365:1368]()
    end
    [7.4086]
    end
  • replacement in 0021-draw_menu at line 52
    [7.2238][7.5744:5767]()
    if Show_settings then
    [7.2238]
    [7.5767]
    if Show_menu == 'settings' then
  • replacement in 0021-draw_menu at line 55
    [7.2034][7.1096:1099](),[7.2238][7.1096:1099](),[7.5795][7.1096:1099](),[7.1096][7.1096:1099]()
    end
    [7.5795]
    end
  • replacement in 0017-on.mouse_release at line 9
    [7.166][5.0:23]()
    if Show_settings then
    [7.166]
    [5.23]
    if Show_menu == 'settings' then
  • replacement in 0017-on.mouse_release at line 40
    [7.1421][7.2312:2315](),[7.2312][7.2312:2315]()
    end
    [7.1421]
    end
  • edit in 0016-on.mouse_press at line 9
    [7.5838][7.4935:4958]()
    Show_overflow = false
  • replacement in 0016-on.mouse_press at line 10
    [7.304][7.304:327]()
    if Show_settings then
    [7.304]
    [7.327]
    if Show_menu == 'settings' then
  • replacement in 0016-on.mouse_press at line 14
    [7.419][7.419:444]()
    Show_settings = false
    [7.419]
    [7.444]
    Show_menu = nil
  • edit in 0016-on.mouse_press at line 22
    [7.617]
    [7.1330]
    Show_menu = nil
  • replacement in 0016-on.mouse_press at line 45
    [7.1606][4.445:448]()
    end
    [7.1606]
    end