Skip to content
Snippets Groups Projects
Commit a09e5e95 authored by dg's avatar dg
Browse files

Onetime worldmap encounters can not be dismissed by a missclick

git-svn-id: http://svn.net-core.org/repos/t-engine4@2725 51575b47-30f0-44d4-a5cc-537603b46e54
parent 145d10b7
No related branches found
No related tags found
No related merge requests found
......@@ -77,14 +77,14 @@ function _M:simpleLongPopup(title, text, w, fct, no_leave, force_height)
end
--- Requests a simple yes-no dialog
function _M:yesnoPopup(title, text, fct, yes_text, no_text)
function _M:yesnoPopup(title, text, fct, yes_text, no_text, no_leave)
local w, h = self.font:size(text)
local d = new(title, 1, 1)
-- d.key:addBind("EXIT", function() game:unregisterDialog(d) fct(false) end)
local ok = require("engine.ui.Button").new{text=yes_text or "Yes", fct=function() game:unregisterDialog(d) fct(true) end}
local cancel = require("engine.ui.Button").new{text=no_text or "No", fct=function() game:unregisterDialog(d) fct(false) end}
d.key:addBind("EXIT", function() game:unregisterDialog(d) game:unregisterDialog(d) fct(false) end)
if not no_leave then d.key:addBind("EXIT", function() game:unregisterDialog(d) game:unregisterDialog(d) fct(false) end) end
d:loadUI{
{left = 3, top = 3, ui=require("engine.ui.Textzone").new{width=w+20, height=h+5, text=text}},
{left = 3, bottom = 3, ui=ok},
......@@ -98,14 +98,14 @@ function _M:yesnoPopup(title, text, fct, yes_text, no_text)
end
--- Requests a long yes-no dialog
function _M:yesnoLongPopup(title, text, w, fct, yes_text, no_text)
function _M:yesnoLongPopup(title, text, w, fct, yes_text, no_text, no_leave)
local list = text:splitLines(w - 10, font)
local d = new(title, 1, 1)
-- d.key:addBind("EXIT", function() game:unregisterDialog(d) fct(false) end)
local ok = require("engine.ui.Button").new{text=yes_text or "Yes", fct=function() game:unregisterDialog(d) fct(true) end}
local cancel = require("engine.ui.Button").new{text=no_text or "No", fct=function() game:unregisterDialog(d) fct(false) end}
d.key:addBind("EXIT", function() game:unregisterDialog(d) game:unregisterDialog(d) fct(false) end)
if not no_leave then d.key:addBind("EXIT", function() game:unregisterDialog(d) game:unregisterDialog(d) fct(false) end) end
d:loadUI{
{left = 3, top = 3, ui=require("engine.ui.Textzone").new{width=w+20, height=self.font_h * #list, text=text}},
{left = 3, bottom = 3, ui=ok},
......
......@@ -110,7 +110,7 @@ newEntity{
game.logPlayer(who, "#LIGHT_RED#As you enter you notice the trap door has no visible handle on the inside. You are stuck here!")
who:grantQuest("lost-merchant")
end
end, "Enter the tunnels", "Leave carefully")
end, "Enter the tunnels", "Leave carefully", true)
return true
end,
}
......@@ -132,7 +132,7 @@ newEntity{
game.logPlayer(who, "#LIGHT_RED#You carefully open the door and enter the underground crypt...")
game.logPlayer(who, "#LIGHT_RED#As you enter you notice the door has no visible handle on the inside. You are stuck here!")
end
end, "Enter the crypt", "Leave carefully")
end, "Enter the crypt", "Leave carefully", true)
return true
end,
}
......
......@@ -99,7 +99,7 @@ else
end
-- Iron Council is only known to dwarves
if game.player:knowTalent(game.player.T_DWARVEN_RESILIENCE) then
if game.player:knowTalent(game.player.T_DWARF_RESILIENCE) then
quickEntity('iron-council', {always_remember = true, show_tooltip=true, name="Iron Council (Town)", desc="Heart of the dwarven Empire", display='*', color={r=255, g=255, b=255}, back_color=colors.DARK_GREEN, image="terrain/town1.png", notice = true, change_level=1, change_zone="town-iron-council"})
else
quickEntity('iron-council', '#')
......
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