Module:AocUtils: Difference between revisions
Jump to navigation
Jump to search
optimise
imported>Leoetlino No edit summary |
imported>Leoetlino (optimise) |
||
Line 2: | Line 2: | ||
aoc_resource_prefixes = { | 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/", | ||
" | "System/AocVersion.txt", | ||
"Pack/RemainsWind.pack", | |||
" | "Pack/RemainsElectric.pack", | ||
" | "Pack/RemainsWater.pack", | ||
" | "Pack/RemainsFire.pack", | ||
" | "Pack/FinalTrial.pack", | ||
" | |||
} | } | ||
local function starts_with(str, start) | |||
return str:sub(1, #start) == start | |||
end | |||
local function ends_with(str, ending) | |||
return ending == "" or str:sub(-#ending) == ending | |||
end | |||
function has_aoc_dungeon_num(s) | function has_aoc_dungeon_num(s) | ||
Line 34: | Line 41: | ||
function should_use_aoc_file_device(path) | function should_use_aoc_file_device(path) | ||
for i, p in ipairs(aoc_resource_prefixes) do | for i, p in ipairs(aoc_resource_prefixes) do | ||
if | if starts_with(path, p) then | ||
return true | return true | ||
end | end | ||
end | end | ||
if string.find(path, "^Pack/") and | if string.find(path, "^Voice/.*/Stream_Demo6.*/.*\.bfstm$") then | ||
return true | |||
end | |||
if starts_with(path, "Pack/") and ends_with(path, ".pack") and has_aoc_dungeon_num(path) then | |||
return true | return true | ||
end | end | ||
if | if starts_with(path, "Map/CDungeon/") and has_aoc_dungeon_num(path) then | ||
return true | return true | ||
end | end | ||
if | if starts_with(path, "Physics/StaticCompound/") and has_aoc_dungeon_num(path) then | ||
return true | return true | ||
end | end | ||
if | if starts_with(path, "NavMesh/CDungeon/") and has_aoc_dungeon_num(path) then | ||
return true | return true | ||
end | end |