Merge template-live-editor

This commit is contained in:
Kartik K. Agaram 2023-04-16 11:26:36 -07:00
commit d1644c0615
484 changed files with 103 additions and 2167 deletions

1
0000-freewheeling-start Normal file
View File

@ -0,0 +1 @@
This file contains no definition, but is used as a marker in the save dir to indicate all definitions have been copied from the repo to the save dir.

View File

@ -1 +0,0 @@
{"fw_parent":0,"on":1}

View File

@ -1 +0,0 @@
Mode = 'teach'

View File

@ -1 +0,0 @@
{"on":1,"fw_app":"spell-cards","Mode":2,"fw_parent":1}

View File

@ -1,2 +0,0 @@
draw_teach_screen = function()
end

View File

@ -1 +0,0 @@
{"Mode":2,"fw_parent":2,"on":1,"fw_app":"spell-cards","draw_teach_screen":3}

View File

@ -1,2 +0,0 @@
draw_learn_screen = function()
end

View File

@ -1 +0,0 @@
{"Mode":2,"fw_parent":3,"on":1,"fw_app":"spell-cards","draw_teach_screen":3,"draw_learn_screen":4}

View File

@ -1 +0,0 @@
{"Mode":2,"draw_learn_screen":4,"fw_parent":4,"on":1,"fw_app":"spell-cards","draw_teach_screen":3,"on.draw":5}

View File

@ -1 +0,0 @@
Words = {'cat', 'mat', 'hat'}

View File

@ -1 +0,0 @@
{"Words":6,"Mode":2,"draw_learn_screen":4,"fw_parent":5,"on":1,"fw_app":"spell-cards","draw_teach_screen":3,"on.draw":5}

View File

@ -1 +0,0 @@
{"Words":6,"on.initialize":7,"Mode":2,"fw_app":"spell-cards","fw_parent":6,"on":1,"draw_learn_screen":4,"draw_teach_screen":3,"on.draw":5}

View File

@ -1,5 +0,0 @@
on.initialize = function(arg)
Font_height = 20
love.graphics.setFont(love.graphics.newFont(Font_height))
Line_height = math.floor(Font_height * 1.3)
end

View File

@ -1 +0,0 @@
{"Words":6,"Font_height":8,"on.initialize":7,"Mode":2,"fw_app":"spell-cards","fw_parent":7,"on":1,"draw_learn_screen":4,"draw_teach_screen":3,"on.draw":5}

View File

@ -1 +0,0 @@
{"Words":6,"Line_height":9,"Font_height":8,"on.initialize":7,"Mode":2,"fw_app":"spell-cards","fw_parent":8,"on":1,"draw_learn_screen":4,"draw_teach_screen":3,"on.draw":5}

View File

@ -1,3 +0,0 @@
draw_word = function(word, x,y)
App.screen.print(word, x,y)
end

View File

@ -1 +0,0 @@
{"fw_app":"spell-cards","Words":6,"Line_height":9,"Font_height":8,"on.initialize":7,"Mode":2,"draw_word":10,"fw_parent":9,"on":1,"draw_learn_screen":4,"draw_teach_screen":3,"on.draw":5}

View File

@ -1,7 +0,0 @@
draw_teach_screen = function()
local y = 50
for _,word in ipairs(Words) do
draw_word(word, 20, y)
y = y+Line_height*2
end
end

View File

@ -1 +0,0 @@
{"fw_app":"spell-cards","Words":6,"Line_height":9,"Font_height":8,"on.initialize":7,"Mode":2,"draw_word":10,"fw_parent":10,"on":1,"draw_learn_screen":4,"draw_teach_screen":11,"on.draw":5}

View File

@ -1 +0,0 @@
{"draw_teach_screen":11,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"Words":12,"on":1,"on.initialize":7,"Font_height":8,"Line_height":9,"draw_word":10,"Mode":2,"fw_parent":11}

View File

@ -1,3 +0,0 @@
draw_word = function(word, x,y)
App.screen.print(word.data, x,y)
end

View File

@ -1 +0,0 @@
{"draw_teach_screen":11,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"Words":12,"on":1,"on.initialize":7,"Font_height":8,"Line_height":9,"draw_word":13,"Mode":2,"fw_parent":12}

View File

@ -1,10 +0,0 @@
draw_teach_screen = function()
App.color{r=0.7, g=0.7, b=1, a=1}
love.graphics.rectangle(20, 5, 50, 25)
local y = 50
App.color{r=0.2, g=0.2, b=0.2, a=1}
for _,word in ipairs(Words) do
draw_word(word, 20, y)
y = y+Line_height*2
end
end

View File

@ -1 +0,0 @@
{"draw_teach_screen":14,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"Words":12,"on":1,"on.initialize":7,"Font_height":8,"Line_height":9,"draw_word":13,"Mode":2,"fw_parent":13}

View File

@ -1,10 +0,0 @@
draw_teach_screen = function()
App.color{r=0.7, g=0.7, b=1, a=1}
love.graphics.rectangle('fill', 20, 5, 50, 25)
local y = 50
App.color{r=0.2, g=0.2, b=0.2, a=1}
for _,word in ipairs(Words) do
draw_word(word, 20, y)
y = y+Line_height*2
end
end

View File

@ -1 +0,0 @@
{"draw_teach_screen":15,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"Words":12,"on":1,"on.initialize":7,"Font_height":8,"Line_height":9,"draw_word":13,"Mode":2,"fw_parent":14}

View File

@ -1,11 +0,0 @@
draw_teach_screen = function()
App.color{r=0.7, g=0.7, b=1, a=1}
love.graphics.rectangle('fill', 20, 5, 50, 25)
App.color{r=0.2, g=0.2, b=0.2, a=1}
App.screen.print('new word (ctrl+n)', 22, 7)
local y = 50
for _,word in ipairs(Words) do
draw_word(word, 20, y)
y = y+Line_height*2
end
end

View File

@ -1 +0,0 @@
{"draw_teach_screen":16,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"Words":12,"on":1,"on.initialize":7,"Font_height":8,"Line_height":9,"draw_word":13,"Mode":2,"fw_parent":15}

View File

@ -1,14 +0,0 @@
draw_teach_screen = function()
App.color{r=0.7, g=0.7, b=1, a=1}
local cmd = 'new word (ctrl+n)'
local cmd_text = to_text(cmd)
local cmd_width = App.width(cmd_text)
love.graphics.rectangle('fill', 20, 5, cmd_width+4, 25)
App.color{r=0.2, g=0.2, b=0.2, a=1}
App.screen.print(cmd, 22, 7)
local y = 50
for _,word in ipairs(Words) do
draw_word(word, 20, y)
y = y+Line_height*2
end
end

View File

@ -1 +0,0 @@
{"draw_teach_screen":17,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"Words":12,"on":1,"on.initialize":7,"Font_height":8,"Line_height":9,"draw_word":13,"Mode":2,"fw_parent":16}

View File

@ -1,14 +0,0 @@
draw_teach_screen = function()
App.color{r=0.7, g=0.7, b=1, a=1}
local cmd = 'new word (ctrl+n)'
local cmd_text = to_text(cmd)
local cmd_width = App.width(cmd_text)
love.graphics.rectangle('fill', 20, 5, cmd_width+10, Line_height+10)
App.color{r=0.2, g=0.2, b=0.2, a=1}
App.screen.print(cmd, 20+5, 5+5)
local y = 50
for _,word in ipairs(Words) do
draw_word(word, 20, y)
y = y+Line_height*2
end
end

View File

@ -1 +0,0 @@
{"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"Words":12,"on":1,"on.initialize":7,"Font_height":8,"Line_height":9,"draw_word":13,"Mode":2,"fw_parent":17}

View File

@ -1 +0,0 @@
{"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"Words":12,"on":1,"on.initialize":7,"Font_height":8,"on.mouse_press":19,"Line_height":9,"draw_word":13,"Mode":2,"fw_parent":18}

View File

@ -1,2 +0,0 @@
on.mouse_press = function(x,y, mouse_button)
end

View File

@ -1 +0,0 @@
{"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"Words":12,"on":1,"on.initialize":7,"on.mouse_release":20,"Font_height":8,"on.mouse_press":19,"Line_height":9,"draw_word":13,"Mode":2,"fw_parent":19}

View File

@ -1,2 +0,0 @@
on.mouse_release = function(x,y, mouse_button)
end

View File

@ -1 +0,0 @@
{"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.keychord_press":21,"Words":12,"on":1,"on.initialize":7,"on.mouse_release":20,"Font_height":8,"on.mouse_press":19,"Line_height":9,"draw_word":13,"Mode":2,"fw_parent":20}

View File

@ -1,2 +0,0 @@
on.keychord_press = function(chord, key)
end

View File

@ -1 +0,0 @@
{"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.key_release":22,"on.draw":5,"on.keychord_press":21,"Words":12,"on":1,"on.initialize":7,"on.mouse_release":20,"Font_height":8,"on.mouse_press":19,"Line_height":9,"draw_word":13,"Mode":2,"fw_parent":21}

View File

@ -1,2 +0,0 @@
on.key_release = function(key, scancode)
end

View File

@ -1 +0,0 @@
{"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":22,"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.key_release":22,"on.initialize":7,"on.text_input":23,"Font_height":8,"Words":12,"Line_height":9,"on.mouse_press":19,"draw_word":13,"on.keychord_press":21}

View File

@ -1,2 +0,0 @@
on.text_input = function(t)
end

View File

@ -1 +0,0 @@
{"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":23,"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Cursor_word":24,"on.initialize":7,"on.text_input":23,"Font_height":8,"Words":12,"Line_height":9,"on.mouse_press":19,"draw_word":13,"on.keychord_press":21}

View File

@ -1 +0,0 @@
{"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":24,"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Cursor_word":24,"on.initialize":7,"on.text_input":23,"Font_height":8,"Words":12,"Line_height":9,"on.mouse_press":19,"draw_word":13,"on.keychord_press":25}

View File

@ -1,5 +0,0 @@
on.keychord_press = function(chord, key)
if chord == 'C-n' then
new_word()
end
end

View File

@ -1 +0,0 @@
{"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":25,"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Cursor_word":24,"on.initialize":7,"on.text_input":23,"Font_height":8,"Words":12,"Line_height":9,"on.mouse_press":26,"draw_word":13,"on.keychord_press":25}

View File

@ -1,6 +0,0 @@
on.mouse_press = function(x,y, mouse_button)
if x >= 20 and x < 20+App.width(to_text('new word (ctrl+n)')) + 10 and
y >= 5 and y < 5 + Line_height + 10 then
add_word()
end
end

View File

@ -1 +0,0 @@
{"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":26,"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Cursor_word":24,"on.initialize":7,"on.text_input":23,"Font_height":8,"Words":12,"Line_height":9,"on.mouse_press":27,"draw_word":13,"on.keychord_press":25}

View File

@ -1,6 +0,0 @@
on.mouse_press = function(x,y, mouse_button)
if x >= 20 and x < 20+App.width(to_text('new word (ctrl+n)')) + 10 and
y >= 5 and y < 5 + Line_height + 10 then
new_word()
end
end

View File

@ -1 +0,0 @@
{"new_word":28,"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":27,"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Cursor_word":24,"on.initialize":7,"on.text_input":23,"Font_height":8,"Words":12,"Line_height":9,"on.mouse_press":27,"draw_word":13,"on.keychord_press":25}

View File

@ -1,5 +0,0 @@
new_word = function()
Cursor_word = edit.initialize_state(50 + #Words*Line_height*2, 20, 100, Font_height, Line_height)
Cursor_word.contents = ''
table.insert(Words, Cursor_word)
end

View File

@ -1,3 +0,0 @@
draw_word = function(word, x,y)
App.screen.print(word.contents, x,y)
end

View File

@ -1 +0,0 @@
{"new_word":28,"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":28,"draw_teach_screen":18,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Cursor_word":24,"on.initialize":7,"on.text_input":23,"Font_height":8,"Words":12,"Line_height":9,"on.mouse_press":27,"draw_word":29,"on.keychord_press":25}

View File

@ -1,14 +0,0 @@
draw_teach_screen = function()
App.color{r=0.7, g=0.7, b=1, a=1}
local cmd = 'new word (ctrl+n)'
local cmd_text = to_text(cmd)
local cmd_width = App.width(cmd_text)
love.graphics.rectangle('fill', 20, 5, cmd_width+10, Line_height+10)
App.color{r=0.2, g=0.2, b=0.2, a=1}
App.screen.print(cmd, 20+5, 5+5)
local y = 50
for _,word in ipairs(Words) do
draw_word(word)
y = y+Line_height*2
end
end

View File

@ -1 +0,0 @@
{"new_word":28,"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":29,"draw_teach_screen":30,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Cursor_word":24,"on.initialize":7,"on.text_input":23,"Font_height":8,"Words":12,"Line_height":9,"on.mouse_press":27,"draw_word":29,"on.keychord_press":25}

View File

@ -1,6 +0,0 @@
draw_word = function(word)
if word == Cursor_word then
edit.draw(word, Text_color)
else
App.screen.print(word.contents, word.left, word.top)
end

View File

@ -1 +0,0 @@
{"new_word":28,"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":30,"draw_teach_screen":30,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Cursor_word":24,"on.initialize":7,"on.text_input":23,"Font_height":8,"Words":12,"Line_height":9,"on.mouse_press":27,"draw_word":31,"on.keychord_press":25}

View File

@ -1,7 +0,0 @@
draw_word = function(word)
if word == Cursor_word then
edit.draw(word, Text_color)
else
App.screen.print(word.contents, word.left, word.top)
end
end

View File

@ -1 +0,0 @@
{"new_word":28,"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":30,"on.text_input":23,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"Words":12,"on.key_release":22,"on.initialize":7,"Cursor_word":24,"Font_height":8,"on.mouse_press":27,"Line_height":9,"draw_teach_screen":30,"draw_word":32,"on.keychord_press":25}

View File

@ -1 +0,0 @@
{"new_word":28,"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":32,"on.text_input":33,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"Words":12,"on.key_release":22,"on.initialize":7,"Cursor_word":24,"Font_height":8,"on.mouse_press":27,"Line_height":9,"draw_teach_screen":30,"draw_word":32,"on.keychord_press":25}

View File

@ -1,5 +0,0 @@
on.text_input = function(t)
if Cursor_word then
edit.text_input(Cursor_word, t)
end
end

View File

@ -1 +0,0 @@
{"new_word":28,"on":1,"on.mouse_release":20,"Mode":2,"fw_parent":33,"on.text_input":33,"fw_app":"spell-cards","draw_learn_screen":4,"on.draw":5,"Words":12,"on.key_release":22,"on.initialize":7,"Cursor_word":24,"Font_height":8,"on.mouse_press":27,"Line_height":9,"draw_teach_screen":30,"draw_word":32,"on.keychord_press":34}

View File

@ -1,10 +0,0 @@
on.keychord_press = function(chord, key)
if chord == 'C-n' then
new_word()
elseif Cursor_word then
if chord == 'return' then
Cursor_word.contents = Cursor_word.lines[1].data
Cursor_word = nil
end
end
end

View File

@ -1 +0,0 @@
{"on":1,"Line_height":9,"draw_word":32,"on.mouse_press":27,"on.mouse_release":20,"on.keychord_press":34,"draw_teach_screen":30,"fw_parent":34,"Mode":2,"fw_app":"spell-cards","on.text_input":33,"Cursor_word":24,"draw_learn_screen":4,"on.draw":5,"on.key_release":22,"Words":12,"new_word":35,"on.initialize":7,"Font_height":8}

View File

@ -1,6 +0,0 @@
new_word = function()
Cursor_word = edit.initialize_state(50 + #Words*Line_height*2, 20, 100, Font_height, Line_height)
Text.redraw_all(Cursor_word)
Cursor_word.contents = ''
table.insert(Words, Cursor_word)
end

Some files were not shown because too many files have changed in this diff Show More