mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
Dehardcode the death formspec (#15155)
Co-authored-by: Paul Ouellette <oue.paul18@gmail.com>
This commit is contained in:
parent
3c48671076
commit
526a2f7b8c
79 changed files with 242 additions and 172 deletions
|
@ -1,15 +0,0 @@
|
|||
-- CSM death formspec. Only used when clientside modding is enabled, otherwise
|
||||
-- handled by the engine.
|
||||
|
||||
core.register_on_death(function()
|
||||
local formspec = "size[11,5.5]bgcolor[#320000b4;true]" ..
|
||||
"label[4.85,1.35;" .. fgettext("You died") ..
|
||||
"]button_exit[4,3;3,0.5;btn_respawn;".. fgettext("Respawn") .."]"
|
||||
core.show_formspec("bultin:death", formspec)
|
||||
end)
|
||||
|
||||
core.register_on_formspec_input(function(formname, fields)
|
||||
if formname == "bultin:death" then
|
||||
core.send_respawn()
|
||||
end
|
||||
end)
|
|
@ -9,6 +9,5 @@ dofile(commonpath .. "mod_storage.lua")
|
|||
dofile(commonpath .. "chatcommands.lua")
|
||||
dofile(commonpath .. "information_formspecs.lua")
|
||||
dofile(clientpath .. "chatcommands.lua")
|
||||
dofile(clientpath .. "death_formspec.lua")
|
||||
dofile(clientpath .. "misc.lua")
|
||||
assert(loadfile(commonpath .. "item_s.lua"))({}) -- Just for push/read node functions
|
||||
|
|
31
builtin/game/death_screen.lua
Normal file
31
builtin/game/death_screen.lua
Normal file
|
@ -0,0 +1,31 @@
|
|||
local F = core.formspec_escape
|
||||
local S = core.get_translator("__builtin")
|
||||
|
||||
function core.show_death_screen(player, _reason)
|
||||
local fs = {
|
||||
"formspec_version[1]",
|
||||
"size[11,5.5,true]",
|
||||
"bgcolor[#320000b4;true]",
|
||||
"label[4.85,1.35;", F(S("You died")), "]",
|
||||
"button_exit[4,3;3,0.5;btn_respawn;", F(S("Respawn")), "]",
|
||||
}
|
||||
core.show_formspec(player:get_player_name(), "__builtin:death", table.concat(fs, ""))
|
||||
end
|
||||
|
||||
core.register_on_dieplayer(function(player, reason)
|
||||
core.show_death_screen(player, reason)
|
||||
end)
|
||||
|
||||
core.register_on_joinplayer(function(player)
|
||||
if player:get_hp() == 0 then
|
||||
core.show_death_screen(player, nil)
|
||||
end
|
||||
end)
|
||||
|
||||
core.register_on_player_receive_fields(function(player, formname, fields)
|
||||
if formname == "__builtin:death" and fields.quit and player:get_hp() == 0 then
|
||||
player:respawn()
|
||||
core.log("action", player:get_player_name() .. " respawns at " ..
|
||||
player:get_pos():to_string())
|
||||
end
|
||||
end)
|
|
@ -38,6 +38,7 @@ dofile(gamepath .. "forceloading.lua")
|
|||
dofile(gamepath .. "hud.lua")
|
||||
dofile(gamepath .. "knockback.lua")
|
||||
dofile(gamepath .. "async.lua")
|
||||
dofile(gamepath .. "death_screen.lua")
|
||||
|
||||
core.after(0, builtin_shared.cache_content_ids)
|
||||
|
||||
|
|
3
builtin/locale/__builtin.be.tr
Normal file
3
builtin/locale/__builtin.be.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Вы загінулі
|
||||
Respawn=Адрадзіцца
|
3
builtin/locale/__builtin.bg.tr
Normal file
3
builtin/locale/__builtin.bg.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Умряхте
|
||||
Respawn=Прераждане
|
3
builtin/locale/__builtin.ca.tr
Normal file
3
builtin/locale/__builtin.ca.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Has mort
|
||||
Respawn=Reaparèixer
|
3
builtin/locale/__builtin.cs.tr
Normal file
3
builtin/locale/__builtin.cs.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Zemřel jsi
|
||||
Respawn=Oživit
|
3
builtin/locale/__builtin.cy.tr
Normal file
3
builtin/locale/__builtin.cy.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Buest ti farw
|
||||
Respawn=Atgyfodi
|
3
builtin/locale/__builtin.da.tr
Normal file
3
builtin/locale/__builtin.da.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Du døde
|
||||
Respawn=Genopstå
|
|
@ -244,3 +244,5 @@ A total of @1 sample(s) were taken.=Es wurden insgesamt @1 Datenpunkt(e) aufgeze
|
|||
The output is limited to '@1'.=Die Ausgabe ist beschränkt auf „@1“.
|
||||
Saving of profile failed: @1=Speichern des Profils fehlgeschlagen: @1
|
||||
Profile saved to @1=Profil abgespeichert nach @1
|
||||
You died=Sie sind gestorben
|
||||
Respawn=Wiederbeleben
|
||||
|
|
3
builtin/locale/__builtin.el.tr
Normal file
3
builtin/locale/__builtin.el.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Πέθανες
|
||||
Respawn=Επανεμφάνηση
|
|
@ -244,3 +244,5 @@ A total of @1 sample(s) were taken.=Sume @1 ekzemplero(j) konserviĝis.
|
|||
The output is limited to '@1'.=La eligo estas limigita al «@1».
|
||||
Saving of profile failed: @1=Konservado de profilo malsukcesis: @1
|
||||
Profile saved to @1=Profilo konservita al @1
|
||||
You died=Vi mortis
|
||||
Respawn=Renaskiĝi
|
||||
|
|
3
builtin/locale/__builtin.es.tr
Normal file
3
builtin/locale/__builtin.es.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Has muerto
|
||||
Respawn=Reaparecer
|
3
builtin/locale/__builtin.et.tr
Normal file
3
builtin/locale/__builtin.et.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Said surma
|
||||
Respawn=Ärka ellu
|
3
builtin/locale/__builtin.eu.tr
Normal file
3
builtin/locale/__builtin.eu.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Hil zara
|
||||
Respawn=Birsortu
|
3
builtin/locale/__builtin.fi.tr
Normal file
3
builtin/locale/__builtin.fi.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Kuolit
|
||||
Respawn=Synny uudelleen
|
3
builtin/locale/__builtin.fil.tr
Normal file
3
builtin/locale/__builtin.fil.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Namatay ka
|
||||
Respawn=Mag-respawn
|
|
@ -244,3 +244,5 @@ A total of @1 sample(s) were taken.=@1 échantillons ont été collectés.
|
|||
The output is limited to '@1'.=La sortie est limitée à '@1'.
|
||||
Saving of profile failed: @1=La sauvegarde du profil a échoué : @1
|
||||
Profile saved to @1=Le profil a été sauvegardé dans @1
|
||||
You died=Vous êtes mort
|
||||
Respawn=Réapparaître
|
||||
|
|
3
builtin/locale/__builtin.ga.tr
Normal file
3
builtin/locale/__builtin.ga.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Fuair tú bás
|
||||
Respawn=Athsceith
|
3
builtin/locale/__builtin.gl.tr
Normal file
3
builtin/locale/__builtin.gl.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Morreches
|
||||
Respawn=Reaparecer
|
3
builtin/locale/__builtin.hu.tr
Normal file
3
builtin/locale/__builtin.hu.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Meghaltál
|
||||
Respawn=Újraéledés
|
|
@ -244,3 +244,5 @@ A total of @1 sample(s) were taken.=Total @1 sampel yang diambil.
|
|||
The output is limited to '@1'.=Keluaran dibatasi ke '@1'.
|
||||
Saving of profile failed: @1=Penyimpanan profil gagal: @1
|
||||
Profile saved to @1=Profil disimpan ke @1
|
||||
You died=Anda mati
|
||||
Respawn=Bangkit kembali
|
||||
|
|
|
@ -245,3 +245,5 @@ A total of @1 sample(s) were taken.=Son stati ottenuti campioni per un totale di
|
|||
The output is limited to '@1'.=L'output è limitato a '@1'.
|
||||
Saving of profile failed: @1=Errore nel salvare il profilo: @1
|
||||
Profile saved to @1=Profilo salvato in @1
|
||||
You died=Sei morto
|
||||
Respawn=Rinasci
|
||||
|
|
3
builtin/locale/__builtin.ja.tr
Normal file
3
builtin/locale/__builtin.ja.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=死んでしまった
|
||||
Respawn=リスポーン
|
3
builtin/locale/__builtin.jbo.tr
Normal file
3
builtin/locale/__builtin.jbo.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=.i do morsi
|
||||
Respawn=tolcanci
|
3
builtin/locale/__builtin.jv.tr
Normal file
3
builtin/locale/__builtin.jv.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Panjenengan pejah
|
||||
Respawn=Bangkit Malilh
|
3
builtin/locale/__builtin.ko.tr
Normal file
3
builtin/locale/__builtin.ko.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=사망했습니다
|
||||
Respawn=리스폰
|
3
builtin/locale/__builtin.kv.tr
Normal file
3
builtin/locale/__builtin.kv.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Кулінныд
|
||||
Respawn=Ловзьыны
|
3
builtin/locale/__builtin.ky.tr
Normal file
3
builtin/locale/__builtin.ky.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Сиз өлдүңүз.
|
||||
Respawn=Кайтадан жаралуу
|
3
builtin/locale/__builtin.lt.tr
Normal file
3
builtin/locale/__builtin.lt.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Jūs numirėte
|
||||
Respawn=Prisikelti
|
3
builtin/locale/__builtin.lv.tr
Normal file
3
builtin/locale/__builtin.lv.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Jūs nomirāt
|
||||
Respawn=Atdzīvoties
|
3
builtin/locale/__builtin.lzh.tr
Normal file
3
builtin/locale/__builtin.lzh.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=尔死矣
|
||||
Respawn=复生
|
3
builtin/locale/__builtin.mn.tr
Normal file
3
builtin/locale/__builtin.mn.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Та үхсэн
|
||||
Respawn=Дахин төрөх
|
3
builtin/locale/__builtin.mr.tr
Normal file
3
builtin/locale/__builtin.mr.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=तू मेलास
|
||||
Respawn=पुनर्जन्म
|
|
@ -244,3 +244,5 @@ A total of @1 sample(s) were taken.=Sebanyak @1 sampel telah diambil secara kese
|
|||
The output is limited to '@1'.=Output dihadkan kepada '@1'.
|
||||
Saving of profile failed: @1=Penyimpanan profil telah gagal: @1
|
||||
Profile saved to @1=Profil telah disimpan ke @1
|
||||
You died=Anda telah meninggal
|
||||
Respawn=Jelma semula
|
||||
|
|
3
builtin/locale/__builtin.nb.tr
Normal file
3
builtin/locale/__builtin.nb.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Du døde
|
||||
Respawn=Gjenoppstå
|
3
builtin/locale/__builtin.nl.tr
Normal file
3
builtin/locale/__builtin.nl.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Je bent gestorven
|
||||
Respawn=Herboren worden
|
3
builtin/locale/__builtin.nn.tr
Normal file
3
builtin/locale/__builtin.nn.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Du døydde
|
||||
Respawn=Kom opp att
|
3
builtin/locale/__builtin.oc.tr
Normal file
3
builtin/locale/__builtin.oc.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Setz mòrt·a
|
||||
Respawn=Tornar
|
3
builtin/locale/__builtin.pl.tr
Normal file
3
builtin/locale/__builtin.pl.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Nie żyjesz
|
||||
Respawn=Wróć do gry
|
3
builtin/locale/__builtin.pt.tr
Normal file
3
builtin/locale/__builtin.pt.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Você morreu
|
||||
Respawn=Renascer
|
|
@ -244,3 +244,5 @@ A total of @1 sample(s) were taken.=Um total de @1 amostra(s) foi coletada.
|
|||
The output is limited to '@1'.=A saída é limitada a '@1'.
|
||||
Saving of profile failed: @1=Falha ao salvar o perfil: @1
|
||||
Profile saved to @1=Perfil salvo em @1
|
||||
You died=Você morreu
|
||||
Respawn=Reviver
|
||||
|
|
3
builtin/locale/__builtin.ro.tr
Normal file
3
builtin/locale/__builtin.ro.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Ai murit
|
||||
Respawn=Reînviere
|
|
@ -244,3 +244,5 @@ A total of @1 sample(s) were taken.=Всего было взято @1 образ
|
|||
The output is limited to '@1'.=Вывод ограничен значением '@1'.
|
||||
Saving of profile failed: @1=Не удалось сохранить данные профилирования: @1
|
||||
Profile saved to @1=Данные профилирования сохранены в @1
|
||||
You died=Вы умерли
|
||||
Respawn=Возродиться
|
||||
|
|
3
builtin/locale/__builtin.sk.tr
Normal file
3
builtin/locale/__builtin.sk.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Zomrel si
|
||||
Respawn=Oživiť
|
3
builtin/locale/__builtin.sl.tr
Normal file
3
builtin/locale/__builtin.sl.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Umrl si
|
||||
Respawn=Ponovno oživi
|
3
builtin/locale/__builtin.sr_Cyrl.tr
Normal file
3
builtin/locale/__builtin.sr_Cyrl.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Умро си
|
||||
Respawn=Врати се у живот
|
3
builtin/locale/__builtin.sr_Latn.tr
Normal file
3
builtin/locale/__builtin.sr_Latn.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Umro/la si.
|
||||
Respawn=Vrati se u zivot
|
3
builtin/locale/__builtin.sv.tr
Normal file
3
builtin/locale/__builtin.sv.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Du dog
|
||||
Respawn=Återuppstå
|
3
builtin/locale/__builtin.sw.tr
Normal file
3
builtin/locale/__builtin.sw.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Umekufa.
|
||||
Respawn=Respawn
|
3
builtin/locale/__builtin.tok.tr
Normal file
3
builtin/locale/__builtin.tok.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=sina moli
|
||||
Respawn=o kama sin
|
3
builtin/locale/__builtin.tr.tr
Normal file
3
builtin/locale/__builtin.tr.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Öldün
|
||||
Respawn=Yeniden Canlan
|
3
builtin/locale/__builtin.tt.tr
Normal file
3
builtin/locale/__builtin.tt.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Сез үлдегез
|
||||
Respawn=Тергезелергә
|
3
builtin/locale/__builtin.uk.tr
Normal file
3
builtin/locale/__builtin.uk.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Ви загинули
|
||||
Respawn=Відродитися
|
3
builtin/locale/__builtin.vi.tr
Normal file
3
builtin/locale/__builtin.vi.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=Bạn đã bị chết
|
||||
Respawn=Hồi sinh
|
3
builtin/locale/__builtin.zh_CN.tr
Normal file
3
builtin/locale/__builtin.zh_CN.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=您已死亡
|
||||
Respawn=重生
|
3
builtin/locale/__builtin.zh_TW.tr
Normal file
3
builtin/locale/__builtin.zh_TW.tr
Normal file
|
@ -0,0 +1,3 @@
|
|||
# textdomain: __builtin
|
||||
You died=您已死亡
|
||||
Respawn=重生
|
Loading…
Add table
Add a link
Reference in a new issue