add game&rawdata
This commit is contained in:
parent
0133cd976c
commit
49b34b5546
45731 changed files with 709831 additions and 0 deletions
23
gamedata/scripts/smart_names.script
Normal file
23
gamedata/scripts/smart_names.script
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
local names_ini = ini_file("misc\\smart_names.ltx")
|
||||
smart_names_table = {}
|
||||
function init_smart_names_table()
|
||||
for i=0,names_ini:line_count("levels")-1 do
|
||||
temp1, level_name, temp2 = names_ini:r_line("levels", i, "", "")
|
||||
if(names_ini:section_exist(level_name)) then
|
||||
smart_names_table[level_name] = {}
|
||||
for i=0,names_ini:line_count(level_name)-1 do
|
||||
result, smart_name, value = names_ini:r_line(level_name, i, "", "")
|
||||
smart_names_table[level_name][smart_name] = value
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function get_smart_terrain_name(smart)
|
||||
local level_name = alife():level_name(game_graph():vertex(smart.m_game_vertex_id):level_id())
|
||||
local smart_name = smart:name()
|
||||
if(smart_names_table[level_name]~=nil) and (smart_names_table[level_name][smart_name]~=nil) then
|
||||
return game.translate_string(smart_names_table[level_name][smart_name])
|
||||
end
|
||||
return smart_name
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue