...
 
Commits (3)
......@@ -31,6 +31,9 @@ function item_icon_builder:new(game, config)
end
function item_icon:on_draw(dst_surface)
if not game:get_value("display_item_slot") then
return
end
local x, y = dst_x, dst_y
local width, height = dst_surface:get_size()
......@@ -87,6 +90,15 @@ function item_icon_builder:new(game, config)
return item_icon
end
-- Check if the hero obtains an assignable item
-- to display the item slot in the hud.
local item_meta = sol.main.get_metatable("item")
item_meta:register_event("on_obtained", function(item)
if item:is_assignable() then
sol.main.game:set_value("display_item_slot", true)
end
end)
return item_icon_builder
......@@ -13,7 +13,7 @@ local initial_game = {}
function initial_game:initialize_new_savegame(game)
game:set_starting_location("intro")
game:set_max_money(999) -- TODO check this
game:set_max_money(999)
game:set_max_life(6)
game:set_life(game:get_max_life())
game:get_item("tunic"):set_variant(1)
......