diff --git a/game/modules/tome/data/gfx/deathbox-ui/active_blood_life.png b/game/modules/tome/data/gfx/deathbox-ui/active_blood_life.png new file mode 100644 index 0000000000000000000000000000000000000000..287dd6b484ffdc7f93d302016f0b5a54684ba427 Binary files /dev/null and b/game/modules/tome/data/gfx/deathbox-ui/active_blood_life.png differ diff --git a/game/modules/tome/data/gfx/deathbox-ui/active_consume.png b/game/modules/tome/data/gfx/deathbox-ui/active_consume.png new file mode 100644 index 0000000000000000000000000000000000000000..2d7038101b1bfa9a28cdfaf7ed7d50f324aade40 Binary files /dev/null and b/game/modules/tome/data/gfx/deathbox-ui/active_consume.png differ diff --git a/game/modules/tome/data/gfx/deathbox-ui/active_skeleton.png b/game/modules/tome/data/gfx/deathbox-ui/active_skeleton.png new file mode 100644 index 0000000000000000000000000000000000000000..5f124a1f6aa674144af7a413ad53a92977b649a9 Binary files /dev/null and b/game/modules/tome/data/gfx/deathbox-ui/active_skeleton.png differ diff --git a/game/modules/tome/data/gfx/deathbox-ui/inactive_blood_life.png b/game/modules/tome/data/gfx/deathbox-ui/inactive_blood_life.png new file mode 100644 index 0000000000000000000000000000000000000000..d5d90889676347714c8ac941c02c9c55323e8986 Binary files /dev/null and b/game/modules/tome/data/gfx/deathbox-ui/inactive_blood_life.png differ diff --git a/game/modules/tome/data/gfx/deathbox-ui/inactive_consume.png b/game/modules/tome/data/gfx/deathbox-ui/inactive_consume.png new file mode 100644 index 0000000000000000000000000000000000000000..d65203e7919ce7e27007ca7083acd71a474d9c08 Binary files /dev/null and b/game/modules/tome/data/gfx/deathbox-ui/inactive_consume.png differ diff --git a/game/modules/tome/data/gfx/deathbox-ui/inactive_skeleton.png b/game/modules/tome/data/gfx/deathbox-ui/inactive_skeleton.png new file mode 100644 index 0000000000000000000000000000000000000000..a3bef79d5730175031e2286a402a66bf3a87e2a2 Binary files /dev/null and b/game/modules/tome/data/gfx/deathbox-ui/inactive_skeleton.png differ diff --git a/game/modules/tome/dialogs/DeathDialog.lua b/game/modules/tome/dialogs/DeathDialog.lua index fcc570551f3195442fa0a384fd94fb081d68ffb1..864c5279d72dbb2cbb86471a781613ef20169858 100644 --- a/game/modules/tome/dialogs/DeathDialog.lua +++ b/game/modules/tome/dialogs/DeathDialog.lua @@ -52,7 +52,23 @@ You can dump your character data to a file to remember her/him forever, or you c 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} + self.c_list = List.new{width=self.iw, nb_items=#self.list, list=self.list, fct=function(item) self:use(item) end, select=function(item) self.cur_item = item end} + + self.graphical_options = { + blood_life = { + available = self:getUITexture("ui/active_blood_life.png"), + unavailable = self:getUITexture("ui/inactive_blood_life.png"), + }, + consume = { + available = self:getUITexture("ui/active_consume.png"), + unavailable = self:getUITexture("ui/inactive_consume.png"), + }, + skeleton = { + available = self:getUITexture("ui/active_skeleton.png"), + unavailable = self:getUITexture("ui/inactive_skeleton.png"), + }, + } + if self.c_achv then self:loadUI{ @@ -271,6 +287,7 @@ end function _M:generateList() local list = {} + self.possible_items = {} local allow_res = true -- Pause the game @@ -303,8 +320,9 @@ function _M:generateList() local consumenb = 1 self.actor:inventoryApplyAll(function(inven, item, o) if o.one_shot_life_saving and (not o.slot or inven.worn) then - list[#list+1] = {name="Resurrect by consuming "..o:getName{do_colour=true}, action="consume"..consumenb, inven=inven, item=item, object=o} + list[#list+1] = {name="Resurrect by consuming "..o:getName{do_colour=true}, action="consume"..consumenb, inven=inven, item=item, object=o, is_consume=true} consumenb = consumenb + 1 + self.possible_items.consume = true end end) end @@ -316,4 +334,23 @@ function _M:generateList() list[#list+1] = {name="Exit to main menu", action="exit", subaction="none"} self.list = list + for _, item in ipairs(list) do self.possible_items[item.action] = true end +end + +function _M:innerDisplayBack(x, y, nb_keyframes, tx, ty) + x = x + self.frame.ox1 + y = y + self.frame.oy1 + + if self.possible_items.blood_life then + local d = self.graphical_options.blood_life[self.cur_item and self.cur_item.action == "blood_life" and "available" or "unavailable"] + d.t:toScreenFull(x + self.frame.w - d.w, y, d.w, d.h, d.tw, d.th, 1, 1, 1, 1) + end + if self.possible_items.consume then + local d = self.graphical_options.consume[self.cur_item and self.cur_item.is_consume and "available" or "unavailable"] + d.t:toScreenFull(x, y, d.w, d.h, d.tw, d.th, 1, 1, 1, 1) + end + if self.possible_items.skeleton then + local d = self.graphical_options.skeleton[self.cur_item and self.cur_item.action == "skeleton" and "available" or "unavailable"] + d.t:toScreenFull(x, y + self.frame.h - d.h, d.w, d.h, d.tw, d.th, 1, 1, 1, 1) + end end