-
Notifications
You must be signed in to change notification settings - Fork 7
/
soundextractor.lua
52 lines (38 loc) · 1.75 KB
/
soundextractor.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
-- $Id: soundextractor.lua 3171 2008-11-06 09:06:29Z det $
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--
-- file: soundextractor.lua
-- brief: extracts unit sounds for use in snd_noises.lua
--
-- author: quantum
--
-- Copyright (C) 2007.
-- Licensed under the terms of the GNU GPL, v2 or later.
--
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
local lfs = require"lfs" -- http://www.keplerproject.org/luafilesystem/
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
local FBI_DIRNAME = "fbi"
local soundTable = {}
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function lowerkeys(t)
local a, b = next(t)
return string.lower(a), b
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
dofile("savetable.lua")
for file in lfs.dir(FBI_DIRNAME) do
if (file ~= "." and file ~= "..") then
local fileName = FBI_DIRNAME.."\\"..file
local unitName, unitTable = dofile(fileName)
soundTable[unitName] = unitTable.sounds
end
end
table.save(soundTable, "sounds.lua")
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------