Skip to content
Snippets Groups Projects
Commit 014ff330 authored by DarkGod's avatar DarkGod
Browse files

UIs can now have special mouse cursors

Added two new hooks to the boot module "Boot:load" and "Boot:run"
parent 6e8ddeb7
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,12 @@ end
--- Default mouse cursor
function _M:defaultMouseCursor()
self:setMouseCursor("/data/gfx/ui/mouse.png", "/data/gfx/ui/mouse-down.png", -4, -4)
local UIBase = require "engine.ui.Base"
if fs.exists("/data/gfx/"..UIBase.ui.."-ui/mouse.png") and fs.exists("/data/gfx/"..UIBase.ui.."-ui/mouse-down.png") then
self:setMouseCursor("/data/gfx/"..UIBase.ui.."-ui/mouse.png", "/data/gfx/"..UIBase.ui.."-ui/mouse-down.png", -4, -4)
else
self:setMouseCursor("/data/gfx/ui/mouse.png", "/data/gfx/ui/mouse-down.png", -4, -4)
end
end
function _M:setMouseCursor(mouse, mouse_down, offsetx, offsety)
......
......@@ -86,6 +86,8 @@ function _M:loaded()
end
function _M:run()
self:triggerHook{"Boot:run"}
self.flyers = FlyingText.new()
self:setFlyingText(self.flyers)
self.log = function(style, ...) end
......
......@@ -64,4 +64,6 @@ Birther:loadDefinition("/data/birth/descriptors.lua")
-- Switch to realtime, with 8 ticks per second
core.game.setRealtime(8)
class:triggerHook{"Boot:load"}
return {require "mod.class.Game" }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment