stop putting button state in a global
[?]
Aug 23, 2022, 5:59 PM
PP2IIHL6EK4HBFFSYAQNV35BKIK6D4EL2JQOY7NZVJX2DXCLSMGACDependencies
- [2]
6D5MOJS4allow buttons to interrupt events - [3]
BJ46QVIPimprove explanation for buttons - [4]
U76D4P36fix a typo - [5]
ZNLTRNNKhighlight another global - [6]
OTIBCAUJlove2d scaffold - [7]
LNUHQOGHstart passing in Editor_state explicitly - [8]
OAHNWDYG. - [9]
ILOA5BYFseparate data structure for each line's cache data - [10]
AVTNUQYRbasic test-enabled framework - [11]
XX7G2FFJintermingle freehand line drawings with text - [12]
TGHAJBESuse line cache for drawings as well - [13]
BW2IUB3Kkeep all text cache writes inside text.lua - [14]
UH4YWHW5button framework is at the app level - [15]
WJBZZQE4fold together two largely similar cases - [16]
2L5MEZV3experiment: new edit namespace - [*]
4KC7I3E2make colors easier to edit
Change contents
- edit in main.lua at line 136
Button_handlers = {} - edit in edit.lua at line 131[4.2727][18.999]
State.button_handlers = {} - replacement in edit.lua at line 155
button('draw', {x=4,y=y+4, w=12,h=12, color={1,1,0},button(State, 'draw', {x=4,y=y+4, w=12,h=12, color={1,1,0}, - replacement in edit.lua at line 212
if propagate_to_button_handlers(x,y, mouse_button) thenif propagate_to_button_handlers(State, x,y, mouse_button) then - edit in button.lua at line 5
Button_handlers = {} - replacement in button.lua at line 7
function button(name, params)function button(State, name, params)if State.button_handlers == nil thenState.button_handlers = {}end - replacement in button.lua at line 14
table.insert(Button_handlers, params)table.insert(State.button_handlers, params) - replacement in button.lua at line 18
function propagate_to_button_handlers(x, y, mouse_button)for _,ev in ipairs(Button_handlers) dofunction propagate_to_button_handlers(State, x, y, mouse_button)if State.button_handlers == nil thenreturnendfor _,ev in ipairs(State.button_handlers) do