up
This commit is contained in:
parent
89d5a7a736
commit
c137c2525f
1 changed files with 23 additions and 0 deletions
23
control-util.lua
Normal file
23
control-util.lua
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
local me = require("me")
|
||||||
|
|
||||||
|
local util = {}
|
||||||
|
util.me = me
|
||||||
|
|
||||||
|
function decode(data)
|
||||||
|
if type(data) == "string" then return data end
|
||||||
|
local str = {}
|
||||||
|
for i = 2, #data do
|
||||||
|
str[i-1] = decode(data[i])
|
||||||
|
end
|
||||||
|
return table.concat(str, "")
|
||||||
|
end
|
||||||
|
|
||||||
|
function util.get_list()
|
||||||
|
local p = game.item_prototypes[me.name.."-list"]
|
||||||
|
if p then
|
||||||
|
data = p.localised_description
|
||||||
|
return decode(data)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return util
|
||||||
Loading…
Add table
Add a link
Reference in a new issue