about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-11-12 19:53:58 -0800
committerKartik K. Agaram <vc@akkartik.com>2023-11-12 19:53:58 -0800
commita8dc0ee2be9ebbc55f40bbc12b591a6b2d4a0cfe (patch)
treed7ea0fbe60b8cbc9809d592323132024ce8cf23c
parenta1da45228ae5e242a8087f8833dfd578011211e7 (diff)
parent5cce5115507800eeca7ba9c271e07c23473228f4 (diff)
downloadview.love-a8dc0ee2be9ebbc55f40bbc12b591a6b2d4a0cfe.tar.gz
Merge lines.love
-rw-r--r--main.lua18
1 files changed, 13 insertions, 5 deletions
diff --git a/main.lua b/main.lua
index b515b8e..7b7bdb7 100644
--- a/main.lua
+++ b/main.lua
@@ -64,6 +64,7 @@ function App.load()
         load_file_from_source_or_save_directory('help.lua')
       load_file_from_source_or_save_directory('drawing_tests.lua')
     load_file_from_source_or_save_directory('source_tests.lua')
+  elseif Current_app == 'error' then
   else
     assert(false, 'unknown app "'..Current_app..'"')
   end
@@ -91,6 +92,7 @@ function App.initialize_globals()
     run.initialize_globals()
   elseif Current_app == 'source' then
     source.initialize_globals()
+  elseif Current_app == 'error' then
   else
     assert(false, 'unknown app "'..Current_app..'"')
   end
@@ -111,6 +113,7 @@ function App.initialize(arg)
     run.initialize(arg)
   elseif Current_app == 'source' then
     source.initialize(arg)
+  elseif Current_app == 'error' then
   else
     assert(false, 'unknown app "'..Current_app..'"')
   end
@@ -121,6 +124,7 @@ function App.resize(w,h)
     if run.resize then run.resize(w,h) end
   elseif Current_app == 'source' then
     if source.resize then source.resize(w,h) end
+  elseif Current_app == 'error' then
   else
     assert(false, 'unknown app "'..Current_app..'"')
   end
@@ -132,6 +136,7 @@ function App.filedropped(file)
     if run.file_drop then run.file_drop(file) end
   elseif Current_app == 'source' then
     if source.file_drop then source.file_drop(file) end
+  elseif Current_app == 'error' then
   else
     assert(false, 'unknown app "'..Current_app..'"')
   end
@@ -145,21 +150,22 @@ function App.focus(in_focus)
     if run.focus then run.focus(in_focus) end
   elseif Current_app == 'source' then
     if source.focus then source.focus(in_focus) end
+  elseif Current_app == 'error' then
   else
     assert(false, 'unknown app "'..Current_app..'"')
   end
 end
 
 function App.draw()
-  if Current_app == 'error' then
+  if Current_app == 'run' then
+    run.draw()
+  elseif Current_app == 'source' then
+    source.draw()
+  elseif Current_app == 'error' then
     love.graphics.setColor(0,0,1)
     love.graphics.rectangle('fill', 0,0, App.screen.width, App.screen.height)
     love.graphics.setColor(1,1,1)
     love.graphics.printf(Error_message, 40,40, 600)
-  elseif Current_app == 'run' then
-    run.draw()
-  elseif Current_app == 'source' then
-    source.draw()
   else
     assert(false, 'unknown app "'..Current_app..'"')
   end
@@ -176,6 +182,7 @@ function App.update(dt)
     run.update(dt)
   elseif Current_app == 'source' then
     source.update(dt)
+  elseif Current_app == 'error' then
   else
     assert(false, 'unknown app "'..Current_app..'"')
   end
@@ -207,6 +214,7 @@ function App.keychord_press(chord, key)
       if source.quit then source.quit() end
       Current_app = 'run'
       Error_message = nil
+    elseif Current_app == 'error' then
     else
       assert(false, 'unknown app "'..Current_app..'"')
     end