File: patches.lua

package info (click to toggle)
boswars 2.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 96,652 kB
  • sloc: cpp: 57,250; python: 1,715; sh: 25; makefile: 17
file content (26 lines) | stat: -rw-r--r-- 551 bytes parent folder | download | duplicates (5)
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

function patchType(name, file, tileWidth, tileHeight, flags, theme)
  if (theme == nil) then
    theme = ""
  end
  return Map.PatchManager:newPatchType(name, file, tileWidth, tileHeight, flags, theme)
end

function patch(name, x, y)
  return Map.PatchManager:add(name, x, y)
end


function LoadPatches(path)
  local list = ListFilesInDirectory(path)
  for k,v in ipairs(list) do
    if (string.find(v, ".lua$")) then
      DebugPrint("Loading patch: " .. v)
      Load(path .. v)
    end
  end
end

LoadPatches("patches/")
LoadPatches("~patches/")