Skip to content
Snippets Groups Projects
Commit 137db177 authored by dg's avatar dg
Browse files

Quests grant/update are displayed much more evidently

git-svn-id: http://svn.net-core.org/repos/t-engine4@5228 51575b47-30f0-44d4-a5cc-537603b46e54
parent f8196772
No related branches found
No related tags found
No related merge requests found
......@@ -23,35 +23,49 @@ local Map = require "engine.Map"
module(..., package.seeall, class.make)
function _M:init(font, size)
self.font = core.display.newFont(font, size)
self.font = core.display.newFont(font, size, true)
self.font:setStyle("bold")
self.text_shadow = 0.8
end
function _M:say(time, txt, ...)
txt = txt:format(...)
self.time = time or 60
self.list = self.font:draw(txt:toString(), math.floor(game.w * 0.8), 255, 255, 255)
self.list_y = (game.h - self.list[1].h * #self.list)
self.max_time = self.time
self.list, self.max_lines, self.max_w = self.font:draw(txt:toString(), math.floor(game.w * 0.8), 255, 255, 255)
self.list_x = (- self.max_w) / 2
self.list_y = (- self.list[1].h * #self.list) / 2
self.center_x = (game.w) / 2
self.center_y = (game.h) / 2
end
function _M:display(nb_keyframes)
if not self.list then return end
core.display.glTranslate(self.center_x, self.center_y, 0)
local scale = util.bound(1-math.log10(self.time / self.max_time)^2, 0, 1)
core.display.glScale(scale, scale, scale)
local x = self.list_x
local y = self.list_y
for i = 1, #self.list do
local item = self.list[i]
if not item then break end
local x = (game.w - item.w) / 2
if self.text_shadow then item._tex:toScreenFull(x+4, y+4, item.w, item.h, item._tex_w, item._tex_h, 0, 0, 0, self.text_shadow) end
item._tex:toScreenFull(x, y, item.w, item.h, item._tex_w, item._tex_h)
y = y + item.h
end
self.time = self.time - nb_keyframes
if self.time < 0 then
if self.time < 0 then
self.time = nil
self.list = nil
end
core.display.glScale()
core.display.glTranslate(-self.center_x, -self.center_y, 0)
end
......@@ -97,7 +97,7 @@ function _M:run()
self.flyers:enableShadow(0.6)
game:setFlyingText(self.flyers)
self.bignews = BigNews.new("/data/font/DroidSansMono.ttf", 26)
self.bignews = BigNews.new("/data/font/DroidSansMono.ttf", 30)
self.nicer_tiles = NicerTiles.new()
......
......@@ -407,7 +407,7 @@ function _M:playerFOV()
end
end, true, true, true)
end
-- Overseer of Nations bonus
local bonus = 0
if self:knowTalent(self.T_OVERSEER_OF_NATIONS) then
......@@ -1223,7 +1223,7 @@ function _M:on_quest_status(quest, status, sub)
game.bignews:say(60, "#LIGHT_GREEN#Quest '%s' done!", quest.name)
elseif status == engine.Quest.FAILED then
game.logPlayer(game.player, "#LIGHT_RED#Quest '%s' is failed! #WHITE#(Press 'j' to see the quest log)", quest.name)
game.bignews:say(60, "#LIGHT_GREEN#Quest '%s' failed!", quest.name)
game.bignews:say(60, "#LIGHT_RED#Quest '%s' failed!", quest.name)
end
end
......
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