Skip to content
Snippets Groups Projects
Commit b7bcd8c7 authored by Otowa Kotori's avatar Otowa Kotori
Browse files

bug fixes and add more _t

parent cb0764ff
No related branches found
No related tags found
No related merge requests found
Showing
with 374 additions and 375 deletions
......@@ -38,7 +38,7 @@ function _M:init(title, player)
local nb = 0
for id, data in pairs(world.achieved) do nb = nb + 1 end
Dialog.init(self, (title or _t("Achievements(%s/%s)"):tformat(nb, total) , game.w * 0.8, game.h * 0.8)
Dialog.init(self, title or ("Achievements(%s/%s)"):tformat(nb, total), game.w * 0.8, game.h * 0.8)
self.c_self = Checkbox.new{title=_t"Yours only", default=false, fct=function() end, on_change=function(s) if s then self:switchTo("self") end end}
self.c_main = Checkbox.new{title=_t"All achieved", default=true, fct=function() end, on_change=function(s) if s then self:switchTo("main") end end}
......
......@@ -104,7 +104,7 @@ function _M:defineHotkey(id)
if not item or not item.object then return end
self.actor.hotkey[id] = {"inventory", item.object:getName{no_add_name=true, no_count=true}}
self:simplePopup(("Hotkey %s assigned"):tformat(id), ("%s assigned to hotkey %s"):tformat(item.object:getName{no_add_name=true, no_count=true}:capitalize(), id)
self:simplePopup(("Hotkey %s assigned"):tformat(id), ("%s assigned to hotkey %s"):tformat(item.object:getName{no_add_name=true, no_count=true}:capitalize(), id))
self.actor.changed = true
end
......
......@@ -132,7 +132,7 @@ If you are not currently connected to the internet, please report this bug when
end
if realpath_errfile then
local realpath_errfile_t = Textzone.new{text="Log saved to file (click to copy to clipboard):#LIGHT_BLUE#%s":tformat(realpath_errfile), width=self.iw, auto_height=true, fct=function() core.key.setClipboard(realpath_errfile) game.log("File location copied to clipboard.") end}
local realpath_errfile_t = Textzone.new{text=("Log saved to file (click to copy to clipboard):#LIGHT_BLUE#%s"):tformat(realpath_errfile), width=self.iw, auto_height=true, fct=function() core.key.setClipboard(realpath_errfile) game.log("File location copied to clipboard.") end}
for i, ui in ipairs(uis) do if ui.bottom then ui.bottom = ui.bottom + realpath_errfile_t.h end end
table.insert(uis, 1, {left=0, bottom=0, ui=realpath_errfile_t})
end
......
......@@ -107,7 +107,7 @@ function _M:getTargets(only_friends)
end
local name_added = {}
for login, data in pairs(self.chat.friends) do list[#list+1] = {name=("Friend: %s")):tformat(data.name), id=data.name} name_added[data.name] = true end
for login, data in pairs(self.chat.friends) do list[#list+1] = {name=("Friend: %s"):tformat(data.name), id=data.name} name_added[data.name] = true end
if not only_friends and self.chat.channels[self.chat.cur_channel] then
for login, data in pairs(self.chat.channels[self.chat.cur_channel].users) do if not name_added[data.name] then list[#list+1] = {name=("User: %s"):tformat(data.name), id=data.name} name_added[data.name] = true end end
......
......@@ -79,7 +79,7 @@ function _M:defineHotkey(id)
if not item or not item.talent then return end
self.actor.hotkey[id] = {"talent", item.talent}
self:simplePopup(("Hotkey %s assigned"):tformat(id), ("%s assigned to hotkey %s"):tformat(self.actor:getTalentFromId(item.talent).name:capitalize(), id)
self:simplePopup(("Hotkey %s assigned"):tformat(id), ("%s assigned to hotkey %s"):tformat(self.actor:getTalentFromId(item.talent).name:capitalize(), id))
self.actor.changed = true
end
......
......@@ -366,7 +366,7 @@ function _M:paymentSuccess()
end end
game:unregisterDialog(self)
Dialog:simpleLongPopup(_t"Payment", "Payment accepted.\n%s":tformat(table.concat(list, "\n")), 700)
Dialog:simpleLongPopup(_t"Payment", ("Payment accepted.\n%s"):tformat(table.concat(list, "\n")), 700)
end
function _M:paymentFailure()
......
......@@ -110,7 +110,7 @@ function _M:gainPersonalAchievement(silent, id, src, ...)
src.achievements[id] = {turn=game.turn, who=self:achievementWho(src), when=os.date("%Y-%m-%d %H:%M:%S")}
if not silent then
local color = a.huge and "GOLD" or "LIGHT_GREEN"
game.log("#%s#Personal New Achievement: %s!". color, a.name)
game.log("#%s#Personal New Achievement: %s!", color, a.name)
self:showAchievement(("Personal New Achievement: #%s#%s"):tformat(color, a.name), a)
if not a.no_chat_broadcast then profile.chat:achievement(a.name, a.huge, false) end
end
......
......@@ -94,7 +94,7 @@ function _M:generateList()
mod.highscores[world] = HighScores.createHighScoreTable(world,formatter)
end
end
mod.zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text="#{bold}##GOLD#%s#GREEN# High Scores#WHITE##{normal}#\n\n":tformat(mod.long_name)}
mod.zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=("#{bold}##GOLD#%s#GREEN# High Scores#WHITE##{normal}#\n\n"):tformat(mod.long_name)}
table.insert(self.list, mod)
end
end
......@@ -111,7 +111,7 @@ function _M:changemodules(item)
self.c_sublist:setList(worlds)
if #worlds > 0 then
-- show text from first world
item.zone.text = "#{bold}##GOLD#%s(%s)#GREEN# High Scores#WHITE##{normal}#\n\n":tformat(item.long_name, worlds[1].world)
item.zone.text = ("#{bold}##GOLD#%s(%s)#GREEN# High Scores#WHITE##{normal}#\n\n"):tformat(item.long_name, worlds[1].world)
item.zone.text = item.zone.text .. item.highscores[worlds[1].world]
item.zone:generate()
end
......@@ -121,7 +121,7 @@ end
function _M:changeworlds(item)
if item and self.uis[2] then
world = item.world;
self.cur_sel.zone.text = "#{bold}##GOLD#%s(%s)#GREEN# High Scores#WHITE##{normal}#\n\n":tformat(self.cur_sel.long_name, world)
self.cur_sel.zone.text = ("#{bold}##GOLD#%s(%s)#GREEN# High Scores#WHITE##{normal}#\n\n"):tformat(self.cur_sel.long_name, world)
self.cur_sel.zone.text = self.cur_sel.zone.text .. self.cur_sel.highscores[world]
self.cur_sel.zone:generate()
end
......
......@@ -49,16 +49,15 @@ end
function _M:printRanking()
local scores = world.arena.scores
if not scores[1].name then return "#LIGHT_GREEN#No high scores. This should not happen."
if not scores[1].name then return _t"#LIGHT_GREEN#No high scores. This should not happen."
else
local text = ""
local tmp = ""
local line = function (txt, col) return " "..col..txt.."\n" end
local stri = "%s (%s %s %s)\n Score %d[%s]) - Wave: %d"
local i = 1
while(scores[i] and scores[i].name) do
p = scores[i]
tmp = stri:format((p.name or "unknown"):capitalize(), p.sex or "unknown", p.race or "unknown", p.class or "unknown", p.score or "unknown", p.perk or "unknown", p.wave or -1)
tmp = ("%s (%s %s %s)\n Score %d[%s]) - Wave: %d"):tformat((p.name or _t"unknown"):capitalize(), p.sex or _t"unknown", p.race or _t"unknown", p.class or _t"unknown", p.score or _t"unknown", p.perk or _t"unknown", p.wave or -1)
if p.name == world.arena.lastScore.name and p.score == world.arena.lastScore.score and p.wave == world.arena.lastScore.wave and p.perk == world.arena.lastScore.perk then
text = text..line(tmp, "#YELLOW#")
else
......@@ -149,7 +148,7 @@ function _M:use(item)
elseif act == "dump" then
game:registerDialog(require("mod.dialogs.CharacterSheet").new(self.actor))
elseif act == "log" then
game:registerDialog(require("mod.dialogs.ShowChatLog").new("Message Log", 0.6, game.uiset.logdisplay, profile.chat))
game:registerDialog(require("mod.dialogs.ShowChatLog").new(_t"Message Log", 0.6, game.uiset.logdisplay, profile.chat))
elseif act == "lichform" then
local t = self.actor:getTalentFromId(self.actor.T_LICHFORM)
......@@ -166,12 +165,12 @@ end
function _M:generateList()
local list = {}
if config.settings.cheat then list[#list+1] = {name="Resurrect by cheating", action="cheat"} end
list[#list+1] = {name=(not profile.auth and "Message Log" or "Message/Chat log (allows to talk)"), action="log"}
list[#list+1] = {name="Character dump", action="dump"}
list[#list+1] = {name="Restart the same character", action="exit", subaction="restart"}
list[#list+1] = {name="Restart with a new character", action="exit", subaction="restart-new"}
list[#list+1] = {name="Exit to main menu", action="exit", subaction="none"}
if config.settings.cheat then list[#list+1] = {name=_t"Resurrect by cheating", action="cheat"} end
list[#list+1] = {name=(not profile.auth and _t"Message Log" or _t"Message/Chat log (allows to talk)"), action="log"}
list[#list+1] = {name=_t"Character dump", action="dump"}
list[#list+1] = {name=_t"Restart the same character", action="exit", subaction="restart"}
list[#list+1] = {name=_t"Restart with a new character", action="exit", subaction="restart-new"}
list[#list+1] = {name=_t"Exit to main menu", action="exit", subaction="none"}
self.list = list
if self.actor:isTalentActive(self.actor.T_LICHFORM) then
......
This diff is collapsed.
......@@ -33,7 +33,7 @@ function _M:init(actor)
self:generateList()
local c_desc = Textzone.new{width=350, auto_height=true, text="A malevolent aura begins to form around you. Choose your curse:"}
local c_desc = Textzone.new{width=350, auto_height=true, text=_t"A malevolent aura begins to form around you. Choose your curse:"}
local c_list = List.new{width=350, height=400, nb_items=#self.list, list=self.list, fct=function(item) self:use(item) end}
self:loadUI{
{left=0, top=0, ui=c_desc},
......
......@@ -39,12 +39,12 @@ function _M:init(actor)
if self.dont_show then return end
if not config.settings.cheat then game:saveGame() end
local text = [[Death in #{bold}#Tales of Maj'Eyal#{normal}# is usually permanent, but if you have a means of resurrection it will be proposed in the menu below.
local text = _t[[Death in #{bold}#Tales of Maj'Eyal#{normal}# is usually permanent, but if you have a means of resurrection it will be proposed in the menu below.
You can dump your character data to a file to remember her/him forever, or you can exit and try once again to survive in the wilds!
]]
if #game.party.on_death_show_achieved > 0 then
self.c_achv = Textzone.new{width=self.iw, scrollbar=true, height=100, text="#LIGHT_GREEN#During your game you#WHITE#:\n* "..table.concat(game.party.on_death_show_achieved, "\n* ")}
self.c_achv = Textzone.new{width=self.iw, scrollbar=true, height=100, text=("#LIGHT_GREEN#During your game you#WHITE#:\n* %s"):tformat(table.concat(game.party.on_death_show_achieved, "\n* "))}
end
self:setTitleShadowShader(Shader.default.textoutline and Shader.default.textoutline.shad, 1.5)
......@@ -168,7 +168,7 @@ function _M:eidolonPlane()
game:onTickEnd(function()
if not self.actor:attr("infinite_lifes") then
self.actor:attr("easy_mode_lifes", -1)
game.log("#LIGHT_RED#You have %s left.", (self.actor:attr("easy_mode_lifes") and self.actor:attr("easy_mode_lifes").." life(s)") or "no more lives")
game.log("#LIGHT_RED#You have %s left.", (self.actor:attr("easy_mode_lifes") and self.actor:attr("easy_mode_lifes").._t" life(s)") or _t"no more lives")
end
local is_exploration = game.permadeath == game.PERMADEATH_INFINITE
......@@ -213,7 +213,7 @@ function _M:use(item)
elseif act == "dump" then
game:registerDialog(require("mod.dialogs.CharacterSheet").new(self.actor))
elseif act == "log" then
game:registerDialog(require("mod.dialogs.ShowChatLog").new("Message Log", 0.6, game.uiset.logdisplay, profile.chat))
game:registerDialog(require("mod.dialogs.ShowChatLog").new(_t"Message Log", 0.6, game.uiset.logdisplay, profile.chat))
elseif act == "cheat" then
game.logPlayer(self.actor, "#LIGHT_BLUE#You resurrect! CHEATER!")
......@@ -298,7 +298,7 @@ function _M:generateList()
allow_res = false
end
if config.settings.cheat then list[#list+1] = {name="Resurrect by cheating", action="cheat"} end
if config.settings.cheat then list[#list+1] = {name=_t"Resurrect by cheating", action="cheat"} end
if not self.actor.no_resurrect and allow_res then
if self.actor:hasEffect(self.actor.EFF_SEE_THREADS) and game._chronoworlds then
self:use{action="threads"}
......@@ -330,11 +330,11 @@ function _M:generateList()
self.actor:fireTalentCheck("callbackOnDeathbox", self, list)
end
list[#list+1] = {name=(not profile.auth and "Message Log" or "Message/Chat log (allows to talk)"), action="log"}
list[#list+1] = {name="Character dump", action="dump"}
list[#list+1] = {name="Restart the same character", action="exit", subaction="restart"}
list[#list+1] = {name="Restart with a new character", action="exit", subaction="restart-new"}
list[#list+1] = {name="Exit to main menu", action="exit", subaction="none"}
list[#list+1] = {name=(not profile.auth and _t"Message Log" or _t"Message/Chat log (allows to talk)"), action="log"}
list[#list+1] = {name=_t"Character dump", action="dump"}
list[#list+1] = {name=_t"Restart the same character", action="exit", subaction="restart"}
list[#list+1] = {name=_t"Restart with a new character", action="exit", subaction="restart-new"}
list[#list+1] = {name=_t"Exit to main menu", action="exit", subaction="none"}
self.list = list
for _, item in ipairs(list) do self.possible_items[item.action] = true end
......
......@@ -41,32 +41,32 @@ function _M:init(source)
local recur = false
if not profile.auth or not tonumber(profile.auth.donated) or tonumber(profile.auth.donated) <= 1 or true then
local donation_features = { "#GOLD#Character cosmetic customization and special tiles#WHITE#", "#GOLD#Exploration mode (infinite lives)#WHITE#", "#GOLD#Item's appearance change (Shimmering)#WHITE#"}
local donation_features = { _t"#GOLD#Character cosmetic customization and special tiles#WHITE#", "#GOLD#Exploration mode (infinite lives)#WHITE#", "#GOLD#Item's appearance change (Shimmering)#WHITE#"}
self:triggerHook{"DonationDialog:features", list=donation_features}
-- First time donation
desc = Textzone.new{width=self.iw, auto_height=true, text=[[Hi, I am Nicolas (DarkGod), the maker of this game.
desc = Textzone.new{width=self.iw, auto_height=true, text=([[Hi, I am Nicolas (DarkGod), the maker of this game.
It is my dearest hope that you find my game enjoyable, and that you will continue to do so for many years to come!
ToME is free and open-source and will stay that way, but that does not mean I can live without money, so I have come to disturb you here and now to ask for your kindness.
If you feel that the (many) hours you have spent having fun were worth it, please consider making a donation for the future of the game.
Donators are also granted a few special features: ]]..table.concatNice(donation_features, ", ", " and ").."."}
Donators are also granted a few special features: .]]):tformat(table.concatNice(donation_features, ", ", _t" and "))}
else
-- Recurring donation
recur = true
desc = Textzone.new{width=self.iw, auto_height=true, text=[[Thank you for supporting ToME, your donation was greatly appreciated.
desc = Textzone.new{width=self.iw, auto_height=true, text=_t[[Thank you for supporting ToME, your donation was greatly appreciated.
If you want to continue supporting ToME you are welcome to make a new donation or even a reccuring one which helps ensure the future of the game.
Thank you for your kindness!]]}
end
self.c_donate = Numberbox.new{title=_t"Donation amount: ", number=10, max=1000, min=5, chars=5, fct=function() end}
self.c_recur = Checkbox.new{title=_t"Monthly donation", default=recur, fct=function() end}
local euro = Textzone.new{auto_width=true, auto_height=true, text=[[euro]]}
local euro = Textzone.new{auto_width=true, auto_height=true, text=_t[[euro]]}
local patreon = ButtonImage.new{alpha_unfocus=1, file="ui/patreon.png", fct=function() self:patreon() end}
local paypal = ButtonImage.new{alpha_unfocus=1, file="ui/paypal.png", fct=function() self:paypal() end}
local cancel = Button.new{text="Cancel", fct=function() self:cancel() end}
local patreon_explain = Textzone.new{width=patreon.w, auto_height=true, text=[[You can also make a pledge on Patreon if you prefer.]]}
local cancel = Button.new{text=_t"Cancel", fct=function() self:cancel() end}
local patreon_explain = Textzone.new{width=patreon.w, auto_height=true, text=_t[[You can also make a pledge on Patreon if you prefer.]]}
local hsep = Separator.new{dir="horizontal", size=self.c_donate.h+paypal.h+self.c_recur.h-cancel.h}
self:loadUI{
......@@ -95,7 +95,7 @@ function _M:paypal()
local inside = jit and jit.os ~= "Linux" and core.webview and true or false
if not inside then self:simplePopup("Thank you", "Thank you, a paypal page should now open in your browser.") end
if not inside then self:simplePopup(_t"Thank you", _t"Thank you, a paypal page should now open in your browser.") end
local url = ("https://te4.org/ingame-donate/%s/%s/%s/EUR/%s"):format(self.c_donate.number, self.c_recur.checked and "monthly" or "onetime", (profile.auth and profile.auth.drupid) and profile.auth.drupid or "0", self.donation_source)
......@@ -106,6 +106,6 @@ end
function _M:patreon()
game:unregisterDialog(self)
self:simplePopup("Thank you", "Thank you, a Patreon page should now open in your browser.")
self:simplePopup(_t"Thank you", _t"Thank you, a Patreon page should now open in your browser.")
util.browserOpenUrl("https://www.patreon.com/darkgodone", {is_external=true})
end
This diff is collapsed.
......@@ -30,13 +30,13 @@ local Map = require "engine.Map"
module(..., package.seeall, class.inherit(Dialog))
tiles_packs = {
shockbolt = {name= "Modern", order=1},
ascii = {name= "ASCII", order=5},
ascii_full = {name= "ASCII with background", order=6},
customtiles = {name= "Custom Tileset", order=7},
shockbolt = {name= _t"Modern", order=1},
ascii = {name= _t"ASCII", order=5},
ascii_full = {name= _t"ASCII with background", order=6},
customtiles = {name= _t"Custom Tileset", order=7},
}
if fs.exists("/data/gfx/altefcat") then tiles_packs.altefcat = {name= "Altefcat/Gervais", order=3} end
if fs.exists("/data/gfx/oldrpg") then tiles_packs.oldrpg = {name= "Old RPG", order=4} end
if fs.exists("/data/gfx/altefcat") then tiles_packs.altefcat = {name= _t"Altefcat/Gervais", order=3} end
if fs.exists("/data/gfx/oldrpg") then tiles_packs.oldrpg = {name= _t"Old RPG", order=4} end
function _M:init()
......@@ -74,15 +74,15 @@ function _M:isTome()
end
function _M:doCustomTiles()
local d = Dialog.new("Custom Tileset", 100, 100)
local d = Dialog.new(_t"Custom Tileset", 100, 100)
local help = Textzone.new{width=500, auto_height=true, text=[[You can configure the game to use a custom tileset.
local help = Textzone.new{width=500, auto_height=true, text=_t[[You can configure the game to use a custom tileset.
You must place all files of your tileset in a subfolder of the modules's data/gfx/ folder, just like the existing tilesets.
Each tile must be correctly named according to the existing tilesets.]]}
local dir = Textbox.new{title=_t"Folder: ", text="", chars=30, max_len=50, fct=function() end}
local moddable_tiles = Checkbox.new{title=_t"Use moddable tiles (equipment showing on player)", default=false, fct=function() end }
local adv_tiles = Checkbox.new{title=_t"Use advanced tiles (transitions, wide tiles, ...)", default=false, fct=function() end }
local ok = Button.new{text="Use custom tileset", fct=function()
local ok = Button.new{text=_t"Use custom tileset", fct=function()
config.settings.tome.gfx.tiles = "customtiles"
config.settings.tome.gfx.tiles_custom_dir = dir.text
config.settings.tome.gfx.tiles_custom_moddable = moddable_tiles.checked
......@@ -91,7 +91,7 @@ Each tile must be correctly named according to the existing tilesets.]]}
self:use{change_sel = "main"}
game:unregisterDialog(d)
end}
local cancel = Button.new{text="Cancel", fct=function() game:unregisterDialog(d) end}
local cancel = Button.new{text=_t"Cancel", fct=function() game:unregisterDialog(d) end}
d:loadUI{
{left=0, top=0, ui=help},
......@@ -112,7 +112,7 @@ function _M:use(item)
if item.sub and item.val then
if item.val == "customsize" then
game:registerDialog(GetQuantity.new("Tile size", "From 10 to 128", Map.tile_w or 64, 128, function(qty)
game:registerDialog(GetQuantity.new(_t"Tile size", _t"From 10 to 128", Map.tile_w or 64, 128, function(qty)
qty = math.floor(util.bound(qty, 10, 128))
self:use{name=qty.."x"..qty, sub=item.sub, val=qty.."x"..qty}
end, 10))
......@@ -139,8 +139,8 @@ function _M:generateList()
if self.cur_sel == "main" then
local cur = tiles_packs[config.settings.tome.gfx.tiles]
list = {
{name="Select style [current: "..(cur and cur.name or "???").."]", change_sel="tiles"},
{name="Select tiles size [current: "..config.settings.tome.gfx.size.."]", change_sel="size"},
{name=("Select style [current: %s]"):tformat(cur and cur.name or "???"), change_sel="tiles"},
{name=("Select tiles size [current: %s]"):tformat(config.settings.tome.gfx.size), change_sel="size"},
}
elseif self.cur_sel == "tiles" then
list = {}
......@@ -150,11 +150,11 @@ function _M:generateList()
table.sort(list, function(a, b) return a.order < b.order end)
elseif self.cur_sel == "size" then
list = {
{name="64x64", sub="size", val="64x64"},
{name="48x48", sub="size", val="48x48"},
{name="32x32", sub="size", val="32x32"},
{name="16x16", sub="size", val="16x16"},
{name="Custom", sub="size", val="customsize"},
{name=_t"64x64", sub="size", val="64x64"},
{name=_t"48x48", sub="size", val="48x48"},
{name=_t"32x32", sub="size", val="32x32"},
{name=_t"16x16", sub="size", val="16x16"},
{name=_t"Custom", sub="size", val="customsize"},
}
end
......
This diff is collapsed.
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