Skip to content
Snippets Groups Projects
Commit 027fd3fc authored by DarkGod's avatar DarkGod
Browse files

show text can have a custom title

parent 6ac65e3c
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,8 @@ end
function _M:generateList(file, replace)
local f, err = loadfile("/data/texts/"..file..".lua")
if not f and err then error(err) end
setfenv(f, setmetatable({}, {__index=_G}))
local env = setmetatable({}, {__index=_G})
setfenv(f, env)
local str = f()
str = str:gsub("@([^@]+)@", function(what)
......@@ -60,5 +61,10 @@ function _M:generateList(file, replace)
end)
self.text = str
if env.title then
self.title = env.title
end
return true
end
......@@ -268,7 +268,7 @@ function _M:newGame()
self.paused = true
print("[PLAYER BIRTH] resolved!")
local birthend = function()
local d = require("engine.dialogs.ShowText").new("Welcome to ToME", "intro-"..self.player.starting_intro, {name=self.player.name}, nil, nil, function()
local d = require("engine.dialogs.ShowText").new("Welcome to #LIGHT_BLUE#Tales of Maj'Eyal", "intro-"..self.player.starting_intro, {name=self.player.name}, nil, nil, function()
self.player:resetToFull()
self.player:registerCharacterPlayed()
self.player:onBirth(birth)
......
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