CorsixTH Lua Documentation

App Class

Declared on: line 34 of Lua/app.lua.

Method Index

Member Index

function App:abandon()

Exits the game completly without saving the config i.e. Alt+F4 for Quit Application

Declared on: line 1208 of Lua/app.lua.

function App:afterLoad()

This function is automatically called after loading a game and serves for compatibility.

Declared on: line 1213 of Lua/app.lua.

function App:checkMissingStringsInLanguage(dir, language)

Compares strings provided by language file of given language WITHOUT inheritance with strings provided by english language with inheritance (i.e. all strings). This will give translators an idea which strings are missing in their translation.

Parameters:

NameTypeDescription
dir ? The directory where the file to write to should be.
language ? The language to check against.

Declared on: line 564 of Lua/app.lua.

function App:dispatch(evt_type, ...)

Parameters:

NameTypeDescription
evt_type ? ?
... ? ?

Declared on: line 821 of Lua/app.lua.

function App:drawFrame()

Used to loop through fps_history when [over]writing

Declared on: line 849 of Lua/app.lua.

function App:dumpStrings()

This is a useful debug and development aid

Declared on: line 480 of Lua/app.lua.

function App:exit()

Exits the game completely (no confirmation window)

Declared on: line 1201 of Lua/app.lua.

function App:getBitmapDir()

function App:checkLanguageFile() -- Some TH installs are trimmed down to a single language file, rather than -- providing every language file. If the user has selected a language which -- isn't present, then we should detect this and inform the user of their -- options. local filename = self:getDataFilename("Lang-" .. self.config.language .. ".dat") local file, err = io.open(filename, "rb") if file then -- Everything is fine file:close() return end print "Theme Hospital install seems to be missing the language file for the language which you requested." print "The following language files are present:" local none = true local is_win32 = not not package.cpath:lower():find(".dll", 1, true) for item in lfs.dir(self.config.theme_hospital_install .. self.data_dir_map.DATA) do local n = item:upper():match"^LANG%-([0-9]+)%.DAT$" if n then local name = languages_by_num[tonumber(n)] or "??" local warning = "" if not is_win32 and item ~= item:upper() then warning = " (Needs to be renamed to " .. item:upper() .. ")" end print(" " .. item .. " (" .. name .. ")" .. warning) none = false end end if none then print " (none)" end error(err) end

Get the directory containing the bitmap files.

Declared on: line 982 of Lua/app.lua.

function App:getVersion(version)

which save game version it is. This was added after the Beta 8

release, which is why the checks prior to that version aren't made.

Parameters:

NameTypeDescription
version ? An optional value if you want to find what game version a specific savegame verion is from.

Declared on: line 1126 of Lua/app.lua.

function App:initSavegameDir()

Tries to initialize the savegame directory, returns true on success and

false on failure.

Declared on: line 315 of Lua/app.lua.

function App:load(filename)

Parameters:

NameTypeDescription
filename ? ?

Declared on: line 1161 of Lua/app.lua.

function App:loadLevel(level, ...)

Loads the specified level. If a string is passed it looks for the file with the same name in the "Levels" folder of CorsixTH, if it is a number it tries to load that level from the original game.

Parameters:

NameTypeDescription
level ? ?
... ? ?

Declared on: line 425 of Lua/app.lua.

function App:loadLuaFolder(dir, no_results, append_to)

Parameters:

NameTypeDescription
dir ? ?
no_results ? ?
append_to ? ?

Declared on: line 1089 of Lua/app.lua.

function App:loadMainMenu(message)

Parameters:

NameTypeDescription
message ? ?

Declared on: line 402 of Lua/app.lua.

function App:onKeyDown(...)

Parameters:

NameTypeDescription
... ? ?

Declared on: line 874 of Lua/app.lua.

function App:onKeyUp(...)

Parameters:

NameTypeDescription
... ? ?

Declared on: line 878 of Lua/app.lua.

function App:onMouseDown(...)

Parameters:

NameTypeDescription
... ? ?

Declared on: line 886 of Lua/app.lua.

function App:onMouseMove(...)

Parameters:

NameTypeDescription
... ? ?

Declared on: line 890 of Lua/app.lua.

function App:onMouseUp(...)

Parameters:

NameTypeDescription
... ? ?

Declared on: line 882 of Lua/app.lua.

function App:onMovieOver(...)

Parameters:

NameTypeDescription
... ? ?

Declared on: line 902 of Lua/app.lua.

function App:onMusicOver(...)

Parameters:

NameTypeDescription
... ? ?

Declared on: line 898 of Lua/app.lua.

function App:onTick(...)

Parameters:

NameTypeDescription
... ? ?

Declared on: line 836 of Lua/app.lua.

function App:onWindowActive(...)

Parameters:

NameTypeDescription
... ? ?

Declared on: line 894 of Lua/app.lua.

function App:quickSave()

Omit the usual file extension so this file cannot be seen from the normal load and save screen and cannot be overwritten

Declared on: line 1155 of Lua/app.lua.

function App:readBitmapDataFile(filename)

Load bitmap data into memory.

Parameters:

NameTypeDescription
filename ? Name of the file to load.

Declared on: line 1027 of Lua/app.lua.

function App:readDataFile(dir, filename)

Read a data file of the application into memory (possibly with decompression).

Parameters:

NameTypeDescription
dir string Directory to read from. "Bitmap" and "Levels" are meta-directories, and get resolved to real directories in the function.
filename string or or or nil If specified, the file to load. If 'nil', the 'dir' parameter is the filename in the "Data" directory.

Declared on: line 1041 of Lua/app.lua.

function App:readLevelDataFile(filename)

Get a level file.

Parameters:

NameTypeDescription
filename string Name of the level file.

Declared on: line 1062 of Lua/app.lua.

function App:restart()

Restarts the current level (offers confirmation window first)

Declared on: line 1175 of Lua/app.lua.

function App:save(filename)

Parameters:

NameTypeDescription
filename ? ?

Declared on: line 1152 of Lua/app.lua.

function App:setCommandLine(...)

Parameters:

NameTypeDescription
... ? ?

Declared on: line 60 of Lua/app.lua.

Page generated on Sat Feb 07, 2015 at 18:38:27 by LDocGen.