note blocks and sticky test
This commit is contained in:
parent
1bc1cdb11f
commit
d829b4972f
11 changed files with 3389 additions and 118 deletions
22
main.lua
22
main.lua
|
|
@ -35,6 +35,10 @@ jorgeBook = require "stories.jorge"
|
|||
-- the DEBUG env var (DEBUG=0 to force off, DEBUG=1 to force on).
|
||||
DEBUG = os.getenv("DEBUG") ~= "0"
|
||||
|
||||
-- Whether editor "note" annotations render over the room. Toggled with Tab (see
|
||||
-- love.keypressed); default on. Only ever consulted under DEBUG (see Room:draw).
|
||||
NOTES_VISIBLE = true
|
||||
|
||||
function love.load()
|
||||
globalAssetProperties = {} -- rebuilt from the filesystem (art/ + .meta) by getAllAssets
|
||||
|
||||
|
|
@ -165,6 +169,7 @@ function love.draw()
|
|||
love.graphics.setBlendMode("alpha")
|
||||
love.graphics.setColor(1, 1, 1, 1)
|
||||
if DEBUG then love.graphics.draw(sideBarCanvas, sideBarBox.x, sideBarBox.y) end
|
||||
if DEBUG then editorDrawNoteHover() end
|
||||
love.graphics.print("Current FPS: "..tostring(love.timer.getFPS( )), 10, 10)
|
||||
PerfProfiler:draw()
|
||||
Dialogue.draw()
|
||||
|
|
@ -206,6 +211,19 @@ function love.keypressed(key)
|
|||
return
|
||||
end
|
||||
|
||||
-- The focused note text field owns the keyboard entirely: arrows navigate the
|
||||
-- text instead of moving the player, Return inserts a newline, etc.
|
||||
if DEBUG and noteEditorActive() then
|
||||
if key == "escape" then cancelNoteMode() else noteEditorKeypressed(key) end
|
||||
return
|
||||
end
|
||||
|
||||
-- Tab toggles the editor's note overlay (DEBUG-only; default on).
|
||||
if DEBUG and key == "tab" then
|
||||
NOTES_VISIBLE = not NOTES_VISIBLE
|
||||
return
|
||||
end
|
||||
|
||||
if editorView == "wire" and editorWireKeypressed(key) then return end
|
||||
|
||||
if editorView ~= "world" and editorView ~= "wire" and Input.isPlayerMove(key) then
|
||||
|
|
@ -264,6 +282,10 @@ end
|
|||
|
||||
function love.textinput(t)
|
||||
if not DEBUG then return end
|
||||
if noteEditorActive() then
|
||||
noteEditorTextinput(t)
|
||||
return
|
||||
end
|
||||
response = response .. t
|
||||
editorTextHandler(response)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue