2021-06-22 02:09:09 +00:00
|
|
|
(local util (require :lib.util))
|
2021-06-19 01:31:21 +00:00
|
|
|
(local core (require :core))
|
|
|
|
(local command (require :core.command))
|
|
|
|
(local keymap (require :core.keymap))
|
|
|
|
(local SlideshowView (require :presentation.engine))
|
|
|
|
|
2021-06-22 02:09:09 +00:00
|
|
|
(fn set-scale [multiplier]
|
|
|
|
(set _G.SCALE (* (love.graphics.getDPIScale) multiplier))
|
|
|
|
(util.hotswap :core.style))
|
|
|
|
|
2021-06-19 01:31:21 +00:00
|
|
|
(command.add nil {
|
|
|
|
"presentation:start" (fn []
|
|
|
|
(let [node (core.root_view:get_active_node)]
|
2021-06-22 02:09:09 +00:00
|
|
|
(node:add_view (SlideshowView (util.reload :presentation.slides))))
|
2021-06-19 01:31:21 +00:00
|
|
|
)
|
2021-06-22 02:09:09 +00:00
|
|
|
"presentation:scale-up" #(set-scale 2)
|
|
|
|
"presentation:restore-scale" #(set-scale 1)
|
2021-06-19 01:31:21 +00:00
|
|
|
})
|
|
|
|
(command.add :presentation.engine {
|
|
|
|
"presentation:next" #(core.active_view:advance)
|
|
|
|
"presentation:prev" #(core.active_view:back)
|
|
|
|
"presentation:next-slide" #(core.active_view:next-slide)
|
|
|
|
"presentation:prev-slide" #(core.active_view:prev-slide)
|
|
|
|
})
|
|
|
|
(keymap.add {
|
2021-06-22 02:09:09 +00:00
|
|
|
"left" "presentation:prev"
|
|
|
|
"right" "presentation:next"
|
|
|
|
"ctrl+left" "presentation:prev-slide"
|
|
|
|
"ctrl+right" "presentation:next-slide"
|
2021-06-19 01:31:21 +00:00
|
|
|
})
|
|
|
|
|