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

Custom made tiles can now be used (by donators), simply follow the howto in the birth dialog

allow for vim regen to work on rest
parent 466f1e72
No related branches found
No related tags found
No related merge requests found
......@@ -868,6 +868,7 @@ function _M:onRestStart()
self:setEffect(self.EFF_SPACETIME_TUNING, duration, {power=power})
end
end
self:fireTalentCheck("callbackOnRest", "start")
end
--- We stopped resting
......@@ -880,6 +881,7 @@ function _M:onRestStop()
self:attr("mana_regen", -self.resting.mana_regen)
self.resting.mana_regen = nil
end
self:fireTalentCheck("callbackOnRest", "stop")
end
--- Can we continue resting ?
......@@ -921,6 +923,7 @@ function _M:restCheck()
if self:getMana() < self:getMaxMana() and self.mana_regen > 0 then return true end
if self:getStamina() < self:getMaxStamina() and self.stamina_regen > 0 then return true end
if self:getPsi() < self:getMaxPsi() and self.psi_regen > 0 then return true end
if self:getVim() < self:getMaxVim() and self.vim_regen > 0 then return true end
if self:getEquilibrium() > self:getMinEquilibrium() and self.equilibrium_regen < 0 then return true end
if self.life < self.max_life and self.life_regen> 0 then return true end
for act, def in pairs(game.party.members) do if game.level:hasEntity(act) and not act.dead then
......@@ -928,7 +931,7 @@ function _M:restCheck()
end end
if ammo and ammo.combat.shots_left < ammo.combat.capacity then return true end
if self:fireTalentCheck("callbackOnRest") then return true end
if self:fireTalentCheck("callbackOnRest", "check") then return true end
else
return true
end
......
......@@ -1401,12 +1401,27 @@ function _M:selectTile()
"player/ascii_player_exotic_01.png",
"player/ascii_player_shopper_01.png",
}
fs.mkdir("/data/gfx/custom-tiles/")
for file in fs.iterate("/data/gfx/custom-tiles/", function(file) return file:find("%.png") end) do
list[#list+1] = "custom-tiles/"..file
end
self:triggerHook{"Birther:donatorTiles", list=list}
local remove = Button.new{text="Use default tile", width=500, fct=function()
local remove = Button.new{text="Use default tile", width=240, fct=function()
game:unregisterDialog(d)
self.has_custom_tile = nil
self:setTile()
end}
local custom = Button.new{text="Use custom-made tile", width=240, fct=function()
self:simpleLongPopup("Howto: Custom-made tiles", ([[You can use your own custom tiles if you are a donator.
For the game to use them you must simply respect a few rules:
- they must be 64x64 or 64x128 tiles
- they must be saved as PNG files
- you must place them in folder #LIGHT_BLUE#%s#WHITE#
Once you have done so, simply restart the game and the tiles will be listed at the bottom of the list.]]):format(fs.getRealPath("/data/gfx/custom-tiles/")), 500)
end}
local list = ImageList.new{width=500, height=500, tile_w=64, tile_h=64, padding=10, scrollbar=true, list=list, fct=function(item)
game:unregisterDialog(d)
if not self:isDonator() then
......@@ -1418,6 +1433,7 @@ function _M:selectTile()
d:loadUI{
{left=0, top=0, ui=list},
{left=0, bottom=0, ui=remove},
{left=250, bottom=0, ui=custom},
}
d:setupUI(true, true)
d.key:addBind("EXIT", function() game:unregisterDialog(d) 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