diff --git a/game/engines/default/engine/ui/Dialog.lua b/game/engines/default/engine/ui/Dialog.lua index e51c4c78e2437b60c0c5a3a0aa04f43bea50b38e..407b158cebbe07c4b7b98b1f8aafd0d6bb7e5fe6 100644 --- a/game/engines/default/engine/ui/Dialog.lua +++ b/game/engines/default/engine/ui/Dialog.lua @@ -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) diff --git a/game/modules/tome/data/gfx/deathbox-ui/dialogframe_1.png b/game/modules/tome/data/gfx/deathbox-ui/dialogframe_1.png new file mode 100644 index 0000000000000000000000000000000000000000..4d479b10879812ae4cfe7891725b88add9ee9ac5 Binary files /dev/null and b/game/modules/tome/data/gfx/deathbox-ui/dialogframe_1.png differ diff --git a/game/modules/tome/data/gfx/deathbox-ui/dialogframe_2.png b/game/modules/tome/data/gfx/deathbox-ui/dialogframe_2.png new file mode 100644 index 0000000000000000000000000000000000000000..ea4ab957f16248da0acc5a917719beca7d0bec6e Binary files /dev/null and b/game/modules/tome/data/gfx/deathbox-ui/dialogframe_2.png differ diff --git a/game/modules/tome/data/gfx/deathbox-ui/dialogframe_3.png b/game/modules/tome/data/gfx/deathbox-ui/dialogframe_3.png new file mode 100644 index 0000000000000000000000000000000000000000..74305fa1522cc00e20fdee6f52d3e5bd8a340d6f Binary files /dev/null and b/game/modules/tome/data/gfx/deathbox-ui/dialogframe_3.png differ diff --git a/game/modules/tome/data/gfx/deathbox-ui/dialogframe_4.png b/game/modules/tome/data/gfx/deathbox-ui/dialogframe_4.png new file mode 100644 index 0000000000000000000000000000000000000000..b37f54fba2d25f9f2a299c87be51d65dfad1020f Binary files /dev/null and b/game/modules/tome/data/gfx/deathbox-ui/dialogframe_4.png differ diff --git a/game/modules/tome/data/gfx/deathbox-ui/dialogframe_5.png b/game/modules/tome/data/gfx/deathbox-ui/dialogframe_5.png new file mode 100644 index 0000000000000000000000000000000000000000..98e3769444e7e03b078a1a4d189df0786241cc0c Binary files /dev/null and b/game/modules/tome/data/gfx/deathbox-ui/dialogframe_5.png differ diff --git a/game/modules/tome/data/gfx/deathbox-ui/dialogframe_6.png b/game/modules/tome/data/gfx/deathbox-ui/dialogframe_6.png new file mode 100644 index 0000000000000000000000000000000000000000..32dacc886f64c629abee06548332fe0bc21d695a Binary files /dev/null and b/game/modules/tome/data/gfx/deathbox-ui/dialogframe_6.png differ diff --git a/game/modules/tome/data/gfx/deathbox-ui/dialogframe_7.png b/game/modules/tome/data/gfx/deathbox-ui/dialogframe_7.png new file mode 100644 index 0000000000000000000000000000000000000000..25e4dcac8e6319bb1ea3a63dc34d0866f3cd4ba4 Binary files /dev/null and b/game/modules/tome/data/gfx/deathbox-ui/dialogframe_7.png differ diff --git a/game/modules/tome/data/gfx/deathbox-ui/dialogframe_8.png b/game/modules/tome/data/gfx/deathbox-ui/dialogframe_8.png new file mode 100644 index 0000000000000000000000000000000000000000..a6937bf3fb78d36e2801c2482f178d30af531c67 Binary files /dev/null and b/game/modules/tome/data/gfx/deathbox-ui/dialogframe_8.png differ diff --git a/game/modules/tome/data/gfx/deathbox-ui/dialogframe_9.png b/game/modules/tome/data/gfx/deathbox-ui/dialogframe_9.png new file mode 100644 index 0000000000000000000000000000000000000000..bd5ab939862138076e44ea8fe31902673e89fe54 Binary files /dev/null and b/game/modules/tome/data/gfx/deathbox-ui/dialogframe_9.png differ diff --git a/game/modules/tome/data/gfx/ui/definitions/deathbox.lua b/game/modules/tome/data/gfx/ui/definitions/deathbox.lua new file mode 100644 index 0000000000000000000000000000000000000000..0890497c4c2dfec8e4872aa5092192bedd765bf6 --- /dev/null +++ b/game/modules/tome/data/gfx/ui/definitions/deathbox.lua @@ -0,0 +1,28 @@ +-- 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 diff --git a/game/modules/tome/dialogs/DeathDialog.lua b/game/modules/tome/dialogs/DeathDialog.lua index b77ba92d49c481f6e89f757791c3ae7f3cc77b64..f3f4b2abd26b3a4ec8691278c23b8c7163249f41 100644 --- a/game/modules/tome/dialogs/DeathDialog.lua +++ b/game/modules/tome/dialogs/DeathDialog.lua @@ -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