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

New Death dialog art, more .. death-like !

parent 2e012210
No related branches found
No related tags found
No related merge requests found
Showing
with 59 additions and 10 deletions
......@@ -558,18 +558,18 @@ function _M:drawFrame(x, y, r, g, b, a)
x = x + self.frame.ox1
y = y + self.frame.oy1
-- Corners
self.b7.t:toScreenFull(x, y, self.b7.w, self.b7.h, self.b7.tw, self.b7.th, r, g, b, a)
self.b1.t:toScreenFull(x, y + self.frame.h - self.b1.h, self.b1.w, self.b1.h, self.b1.tw, self.b1.th, r, g, b, a)
self.b9.t:toScreenFull(x + self.frame.w - self.b9.w, y, self.b9.w, self.b9.h, self.b9.tw, self.b9.th, r, g, b, a)
self.b3.t:toScreenFull(x + self.frame.w - self.b3.w, y + self.frame.h - self.b3.h, self.b3.w, self.b3.h, self.b3.tw, self.b3.th, r, g, b, a)
-- Sides
self.b8.t:toScreenFull(x + self.b7.w, y, self.frame.w - self.b7.w - self.b9.w, self.b8.h, self.b8.tw, self.b8.th, r, g, b, a)
self.b2.t:toScreenFull(x + self.b7.w, y + self.frame.h - self.b3.h, self.frame.w - self.b7.w - self.b9.w, self.b2.h, self.b2.tw, self.b2.th, r, g, b, a)
self.b4.t:toScreenFull(x, y + self.b7.h, self.b4.w, self.frame.h - self.b7.h - self.b1.h, self.b4.tw, self.b4.th, r, g, b, a)
self.b6.t:toScreenFull(x + self.frame.w - self.b9.w, y + self.b7.h, self.b6.w, self.frame.h - self.b7.h - self.b1.h, self.b6.tw, self.b6.th, r, g, b, a)
-- Corners
self.b1.t:toScreenFull(x, y + self.frame.h - self.b1.h, self.b1.w, self.b1.h, self.b1.tw, self.b1.th, r, g, b, a)
self.b7.t:toScreenFull(x, y, self.b7.w, self.b7.h, self.b7.tw, self.b7.th, r, g, b, a)
self.b9.t:toScreenFull(x + self.frame.w - self.b9.w, y, self.b9.w, self.b9.h, self.b9.tw, self.b9.th, r, g, b, a)
self.b3.t:toScreenFull(x + self.frame.w - self.b3.w, y + self.frame.h - self.b3.h, self.b3.w, self.b3.h, self.b3.tw, self.b3.th, r, g, b, a)
-- Body
self.b5.t:toScreenFull(x + self.b7.w, y + self.b7.h, self.frame.w - self.b7.w - self.b3.w , self.frame.h - self.b7.h - self.b3.h, self.b5.tw, self.b5.th, r, g, b, a)
......@@ -621,9 +621,16 @@ end
function _M:firstDisplay()
end
function _M:setTitleShadowShader(shader, power)
self.shadow_shader = shader
self.shadow_power = power
end
function _M:toScreen(x, y, nb_keyframes)
if self.__hidden then return end
local shader = self.shadow_shader
local zoom = 1
if self.__showup then
local eff = self.__showup_effect or "pop"
......@@ -656,8 +663,17 @@ function _M:toScreen(x, y, nb_keyframes)
-- Title
if self.title then
if self.title_shadow then self.title_tex[1]:toScreenFull(x + (self.w - self.title_tex.w) / 2 + 3 + self.frame.title_x, y + 3 + self.frame.title_y, self.title_tex.w, self.title_tex.h, self.title_tex[2], self.title_tex[3], 0, 0, 0, 0.5) end
if self.title_shadow then
if shader then
shader:use(true)
shader:uniOutlineSize(self.shadow_power, self.shadow_power)
shader:uniTextSize(self.title_tex[2], self.title_tex[3])
else
self.title_tex[1]:toScreenFull(x + (self.w - self.title_tex.w) / 2 + 3 + self.frame.title_x, y + 3 + self.frame.title_y, self.title_tex.w, self.title_tex.h, self.title_tex[2], self.title_tex[3], 0, 0, 0, 0.5)
end
end
self.title_tex[1]:toScreenFull(x + (self.w - self.title_tex.w) / 2 + self.frame.title_x, y + self.frame.title_y, self.title_tex.w, self.title_tex.h, self.title_tex[2], self.title_tex[3])
if self.title_shadow and shader then shader:use(false) end
end
self:innerDisplayBack(x, y, nb_keyframes, tx, ty)
......
game/modules/tome/data/gfx/deathbox-ui/dialogframe_1.png

176 KiB

game/modules/tome/data/gfx/deathbox-ui/dialogframe_2.png

47 KiB

game/modules/tome/data/gfx/deathbox-ui/dialogframe_3.png

183 KiB

game/modules/tome/data/gfx/deathbox-ui/dialogframe_4.png

39.9 KiB

game/modules/tome/data/gfx/deathbox-ui/dialogframe_5.png

12.7 KiB

game/modules/tome/data/gfx/deathbox-ui/dialogframe_6.png

40.4 KiB

game/modules/tome/data/gfx/deathbox-ui/dialogframe_7.png

181 KiB

game/modules/tome/data/gfx/deathbox-ui/dialogframe_8.png

47.2 KiB

game/modules/tome/data/gfx/deathbox-ui/dialogframe_9.png

177 KiB

-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009 - 2014 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
deathbox = {
frame_shadow = {x=15, y=15, a=0.5},
frame_alpha = 1,
frame_ox1 = -60,
frame_ox2 = 60,
frame_oy1 = -60,
frame_oy2 = 60,
-- title_bar = {x=0, y=-17, w=4, h=25},
}
\ No newline at end of file
......@@ -18,6 +18,7 @@
-- darkgod@te4.org
require "engine.class"
local Shader = require "engine.Shader"
local Dialog = require "engine.ui.Dialog"
local Textzone = require "engine.ui.Textzone"
local Separator = require "engine.ui.Separator"
......@@ -29,7 +30,8 @@ module(..., package.seeall, class.inherit(Dialog))
function _M:init(actor)
self.actor = actor
Dialog.init(self, "Death!", 500, 300)
self.ui = "deathbox"
Dialog.init(self, "You have #LIGHT_RED#died#LAST#!", 500, 600)
actor:saveUUID()
......@@ -37,8 +39,7 @@ function _M:init(actor)
if self.dont_show then return end
if not config.settings.cheat then game:saveGame() end
local text = [[You have #LIGHT_RED#died#LAST#!
Death in ToME is usually permanent, but if you have a means of resurrection it will be proposed in the menu below.
local text = [[Death in #{bold}#Tales of Maj'Eyal#{normal}# is usually permanent, but if you have a means of resurrection it will be proposed in the menu below.
You can dump your character data to a file to remember her/him forever, or you can exit and try once again to survive in the wilds!
]]
......@@ -46,7 +47,11 @@ You can dump your character data to a file to remember her/him forever, or you c
self.c_achv = Textzone.new{width=self.iw, scrollbar=true, height=100, text="#LIGHT_GREEN#During your game you#WHITE#:\n* "..table.concat(game.party.on_death_show_achieved, "\n* ")}
end
self:setTitleShadowShader(Shader.default.textoutline and Shader.default.textoutline.shad, 1.5)
self.c_desc = Textzone.new{width=self.iw, auto_height=true, text=text}
self.c_desc:setTextShadow(1)
self.c_desc:setShadowShader(Shader.default.textoutline and Shader.default.textoutline.shad, 1.2)
self.c_list = List.new{width=self.iw, nb_items=#self.list, list=self.list, fct=function(item) self:use(item) end}
if self.c_achv then
......
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