diff options
| author | 1029chris <1029chris@gmail.com> | 2016-04-20 10:51:32 -0700 |
|---|---|---|
| committer | 1029chris <1029chris@gmail.com> | 2016-04-20 10:51:32 -0700 |
| commit | 6b3b3d0aa652bdda25189742160b4649afd40409 (patch) | |
| tree | d54e47f1404d8e1039bf95f6ededdfcc70c37726 /panel.lua | |
| parent | f7c70cec2946b25ca050796d7c9160044717ce29 (diff) | |
Moved notification code to panel.lua
deleted notification.lua
Diffstat (limited to 'panel.lua')
| -rw-r--r-- | panel.lua | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -59,3 +59,38 @@ function drawStart() end end end +function drawNoti() + if notify.yes == true or notify.op ~= 0 then + love.graphics.setColor(255, 255, 255, notify.op) + love.graphics.draw(notification.bubble, notify.x, notify.y) + love.graphics.setColor(colors.font.dark, notify.op) + love.graphics.print(notify.title, notify.x+10, notify.y+10) + love.graphics.printf(notify.body, notify.x+10, notify.y+30, 200) + if notify.sound == true then + notification.sound1:play() + notify.sound = false + end + if notify.op ~= 255 and notify.yes == true then + notify.op = notify.op + 17 + elseif notify.op ~= 0 and notify.yes == false then + notify.op = notify.op - 17 + end + end +end +function timeNoti(dt) + notify.timer = notify.timer + dt + if notify.timer >= 4 then + notify.yes = false + notify.timer = 0 + notify.sound = false + end +end +function notifyNow(title, body) + if notify.yes == false and notify.sound == false then + notify.sound = true + notify.timer = 0 + end + notify.yes = true + notify.title = title + notify.body = body +end |
