forked from public/foundryvtt-wh4-lang-fr-fr
Traduction des effets
This commit is contained in:
File diff suppressed because one or more lines are too long
24175
tools/beasts2.jsonn
24175
tools/beasts2.jsonn
File diff suppressed because one or more lines are too long
44
tools/foundry_wh4_patch_effects.lua
Normal file
44
tools/foundry_wh4_patch_effects.lua
Normal file
@ -0,0 +1,44 @@
|
||||
|
||||
package.path = package.path .. ";luajson/?.lua"
|
||||
local JSON = require"json"
|
||||
|
||||
--local talent_db = "../../WFRP4e-FoundryVTT/packs/talents.db"
|
||||
local dbfile ='/home/morr/.local/share/FoundryVTT/Data/modules/wfrp4e-core/packs/spells.db'
|
||||
local jsonfile = "../compendium/wfrp4e-core.spells.json"
|
||||
|
||||
local dbf = io.open(dbfile)
|
||||
|
||||
local jsonf = io.open(jsonfile)
|
||||
local strjson = jsonf:read("*a")
|
||||
jsonf:close()
|
||||
local datajson = JSON.decode(strjson)
|
||||
|
||||
local function trim1(s)
|
||||
return (s:gsub("^%s*(.-)%s*$", "%1"))
|
||||
end
|
||||
|
||||
local line = dbf:read()
|
||||
while line do
|
||||
--print(line)
|
||||
local itemdb = JSON.decode( line )
|
||||
--print("Testing : ", db_talent.name )
|
||||
for _, data in pairs(datajson.entries) do
|
||||
if data.id == itemdb.name then
|
||||
data.effects = itemdb.effects
|
||||
for _, effect in pairs(data.effects) do
|
||||
if effect.label == itemdb.name then
|
||||
effect.label = data.name
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
line = dbf:read()
|
||||
end
|
||||
dbf:close()
|
||||
|
||||
|
||||
local jsonout = JSON.encode( datajson )
|
||||
local fout = io.open("witheffects.json", "w+")
|
||||
fout:write( jsonout )
|
||||
fout:close()
|
Reference in New Issue
Block a user