activate buttons for some time

akkartik
Dec 2, 2023, 4:11 AM
LGIEVJE6W72DAIY7NEWDIMPSI6K5GR2M4BREPQ4TYFWCZYGA6MHQC

Dependencies

  • [2] HVXZLNCC send errors from event handlers to output editor
  • [3] W3RRTO4P extract a second helper for buttons
  • [4] IP4LD33D mouse events for scrollbar
  • [5] VAVXKWZV aggregate global state inside a 'pane' object
  • [6] 6DJMOJKE support event handlers
  • [7] Z5M23NTK implement second, 'output' editor
  • [*] R5QXEHUI somebody stop me
  • [*] ZM7NOBRM new fork: carousel shell
  • [*] UEG224LH debug animations
  • [*] JV27LDDK sliders for font size and color settings

Change contents

  • file addition: 0148-Active_button (----------)
    [9.2]
    Active_button = nil
    -- When a button is pressed:
    -- {name=..., expire=...}
  • file addition: 0147-Highlighted_button_color (----------)
    [9.2]
    Highlighted_button_color = {r=1, g=1, b=1}
  • replacement in 0124-styled_button at line 5
    [3.185][3.185:212]()
    App.color(Normal_color)
    [3.185]
    [3.212]
    if Active_button and Active_button.name == name and Active_button.expire > Current_time then
    App.color(Highlighted_button_color)
    else
    App.color(Normal_color)
    end
  • replacement in 0124-styled_button at line 13
    [3.319][3.319:342]()
    onpress1 = onpress1,
    [3.319]
    [3.342]
    onpress1 = function()
    onpress1()
    Active_button = {
    name=name,
    expire=Current_time+0.1,
    }
    end,
  • replacement in 0124-styled_button at line 21
    [3.346][3.346:349]()
    end
    [3.346]
    end
  • edit in 0016-on.mouse_press at line 2
    [10.2409]
    [4.3121]
    -- some hysteresis right after a button has been pressed
    if Active_button then return end
  • edit in 0004-on.update at line 3
    [11.1760]
    [12.6183]
    if Active_button and Active_button.expire <= Current_time then
    Active_button = nil
    end
  • replacement in 0004-on.update at line 15
    [2.1949][4.1677:1680](),[4.3135][4.1677:1680](),[4.1677][4.1677:1680]()
    end
    [2.1949]
    end