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KBMUNTSV3L2UWFJIQLH43MOFN3QC
2Y7YH7UPQWDNYDJN4BYY2MOHA36B2BIRX6DMIAKHJPQC7UP2R6NQC
EGS44RTAG7JVLLEA4KH63MBZAD4O5HNRSJQIOC6SRKHUG3G56R6QC
VHQCNMARPMNBSIUFLJG7HVK4QGDNPCGNVFLHS3I4IGNVSV5MRLYQC
IFGHOCUOIAKC722BNCIRNE2EDMGF77FBTYS57H5UWN6YXOLSZHQQC
2L5MEZV344TOZLVY3432RHJFIRVXFD6O3GWLL5O4CV66BGAFTURQC
LNUHQOGHIOFGJXNGA3DZLYEASLYYDGLN2I3EDZY5ANASQAHCG3YQC
4BX4GJEWW7Z5LA4SJUXADYLAHOYFL4IBOYH4J4DJYRAVKKGGFHGQC
AVTNUQYRBW7IX2YQ3KDLVQ23RGW3BAKTAE7P73ASBYNKOHMQMH5AC
3QNOKBFMKBGXBVJIRHR2444JRRMBTABHE4674NR3DT67RRM2X6GAC
PX7DDEMOBGPVK3FXKK5XEPG24CJXZSVW67DLG2JZZ5E77NVEAA3AC
add_hotkey_to_menu('ctrl+i: create/edit debug print')
add_hotkey_to_menu('ctrl+f: find in file')
add_hotkey_to_menu('alt+left alt+right: prev/next word')
elseif Focus == 'log_browser' then
-- nothing yet
else
assert(false, 'unknown focus "'..Focus..'"')
end
add_hotkey_to_menu('ctrl+z ctrl+y: undo/redo')
add_hotkey_to_menu('ctrl+x ctrl+c ctrl+v: cut/copy/paste')
add_hotkey_to_menu('ctrl+= ctrl+- ctrl+0: zoom')
end
function add_hotkey_to_menu(s)
if Text_cache[s] == nil then
Text_cache[s] = App.newText(love.graphics.getFont(), s)
end
local width = App.width(Text_cache[s])
if Menu_cursor + width > App.screen.width - 5 then
return
end
App.color(Menu_command_color)
App.screen.draw(Text_cache[s], Menu_cursor,5)
Menu_cursor = Menu_cursor + width + 30
end
function source.draw_file_navigator()
for i,file in ipairs(File_navigation.candidates) do
if file == 'source' then
App.color(Menu_border_color)
love.graphics.line(Menu_cursor-10,2, Menu_cursor-10,Menu_status_bar_height-2)
end
add_file_to_menu(file, i == File_navigation.index)
end
end
function add_file_to_menu(s, cursor_highlight)
if Text_cache[s] == nil then
Text_cache[s] = App.newText(love.graphics.getFont(), s)
end
local width = App.width(Text_cache[s])
if Menu_cursor + width > App.screen.width - 5 then
return
end
if cursor_highlight then
App.color(Menu_highlight_color)
love.graphics.rectangle('fill', Menu_cursor-5,5-2, App.width(Text_cache[s])+5*2,Editor_state.line_height+2*2)
end
App.color(Menu_command_color)
App.screen.draw(Text_cache[s], Menu_cursor,5)
Menu_cursor = Menu_cursor + width + 30
end
function keychord_pressed_on_file_navigator(chord, key)
if chord == 'escape' then
Show_file_navigator = false
elseif chord == 'return' then
local candidate = guess_source(File_navigation.candidates[File_navigation.index]..'.lua')
source.switch_to_file(candidate)
Show_file_navigator = false
elseif chord == 'left' then
if File_navigation.index > 1 then
File_navigation.index = File_navigation.index-1
end
elseif chord == 'right' then
if File_navigation.index < #File_navigation.candidates then
File_navigation.index = File_navigation.index+1
end
end
end
outfile:write(json.encode({mode=shape.mode, center=drawing.points[shape.center], radius=shape.radius, start_angle=shape.start_angle, end_angle=shape.end_angle}), '\n')
outfile:write(json.encode({mode=shape.mode, center=drawing.points[shape.center], radius=shape.radius, start_angle=shape.start_angle, end_angle=shape.end_angle}))
outfile:write('\n')
load_file_from_source_or_save_directory('drawing.lua')
load_file_from_source_or_save_directory('geom.lua')
load_file_from_source_or_save_directory('help.lua')
load_file_from_source_or_save_directory('drawing_tests.lua')
else
elseif Current_app == 'source' then
if Current_app == nil or Current_app == 'run' then
App.open_for_reading = function(filename) return io.open(filename, 'r') end
App.open_for_writing = function(filename) return io.open(filename, 'w') end
elseif Current_app == 'source' then
-- HACK: source editor requires a couple of different foundational definitions
App.open_for_reading =
function(filename)
local result = love.filesystem.newFile(filename)
local ok, err = result:open('r')
if ok then
return result
else
return ok, err
end
end
App.open_for_writing =
function(filename)
local result = love.filesystem.newFile(filename)
local ok, err = result:open('w')
if ok then
return result
else
return ok, err
end
end
end