Module:AocUtils: Difference between revisions
Jump to navigation
Jump to search
imported>Leoetlino No edit summary |
imported>Leoetlino No edit summary |
||
Line 22: | Line 22: | ||
"^Pack/FinalTrial.pack$", | "^Pack/FinalTrial.pack$", | ||
} | } | ||
function has_aoc_dungeon_num(s) | |||
local dungeon_num_str = string.match(s, "Dungeon(%d%d%d)") | |||
if dungeon_num_str == nil then | |||
return false | |||
end | |||
local dungeon_num = tonumber(dungeon_num_str) | |||
return dungeon_num > 119 | |||
end | |||
function should_use_aoc_path(path) | function should_use_aoc_path(path) | ||
Line 28: | Line 37: | ||
return true | return true | ||
end | end | ||
end | |||
if string.find(path, "^Pack/") and string.find(path, "\.pack$") and has_aoc_dungeon_num(path) then | |||
return true | |||
end | |||
if string.find(path, "^Map/CDungeon/") and has_aoc_dungeon_num(path) then | |||
return true | |||
end | |||
if string.find(path, "^Physics/StaticCompound/") and has_aoc_dungeon_num(path) then | |||
return true | |||
end | |||
if string.find(path, "^NavMesh/CDungeon/") and has_aoc_dungeon_num(path) then | |||
return true | |||
end | end | ||
return false | return false |
Revision as of 19:06, 8 September 2018
Documentation for this module may be created at Module:AocUtils/doc
local pack = {}
aoc_resource_prefixes = {
"^Terrain/A/AocField",
"^UI/StaffRollDLC/",
"^Map/MainField/",
"^Map/MainFieldDungeon/",
"^Map/AocField/",
"^Physics/StaticCompound/AocField/",
"^Physics/StaticCompound/MainFieldDungeon/",
"^Movie/Demo6",
"^Game/AocField/",
"^NavMesh/AocField/",
"^NavMesh/MainFieldDungeon/",
"^Physics/TeraMeshRigidBody/AocField/",
"^Voice/.+/Stream_Demo6.+/.+\.bfstm$",
"^System/AocVersion\.txt$",
"^Pack/RemainsWind.pack$",
"^Pack/RemainsElectric.pack$",
"^Pack/RemainsWater.pack$",
"^Pack/RemainsFire.pack$",
"^Pack/FinalTrial.pack$",
}
function has_aoc_dungeon_num(s)
local dungeon_num_str = string.match(s, "Dungeon(%d%d%d)")
if dungeon_num_str == nil then
return false
end
local dungeon_num = tonumber(dungeon_num_str)
return dungeon_num > 119
end
function should_use_aoc_path(path)
for i, p in ipairs(aoc_resource_prefixes) do
if string.find(path, p) then
return true
end
end
if string.find(path, "^Pack/") and string.find(path, "\.pack$") and has_aoc_dungeon_num(path) then
return true
end
if string.find(path, "^Map/CDungeon/") and has_aoc_dungeon_num(path) then
return true
end
if string.find(path, "^Physics/StaticCompound/") and has_aoc_dungeon_num(path) then
return true
end
if string.find(path, "^NavMesh/CDungeon/") and has_aoc_dungeon_num(path) then
return true
end
return false
end
return pack