CorsixTH Lua Documentation

App Class

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

Method Index

Member Index

function App:afterLoad()

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

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

function App:dispatch(evt_type, ...)

Parameters:

NameTypeDescription
evt_type ? ?
... ? ?

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

function App:drawFrame()

Used to loop through fps_history when [over]writing

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

function App:dumpStrings()

This is a useful debug and development aid

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

function App:exit()

Exits the game completely (no confirmation window)

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

function App:load(filename)

Parameters:

NameTypeDescription
filename ? ?

Declared on: line 789 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 271 of Lua/app.lua.

function App:loadLuaFolder(dir, no_results, append_to)

Parameters:

NameTypeDescription
dir ? ?
no_results ? ?
append_to ? ?

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

function App:loadMainMenu(message)

Parameters:

NameTypeDescription
message ? ?

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

function App:onKeyDown(...)

Parameters:

NameTypeDescription
... ? ?

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

function App:onKeyUp(...)

Parameters:

NameTypeDescription
... ? ?

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

function App:onMouseDown(...)

Parameters:

NameTypeDescription
... ? ?

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

function App:onMouseMove(...)

Parameters:

NameTypeDescription
... ? ?

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

function App:onMouseUp(...)

Parameters:

NameTypeDescription
... ? ?

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

function App:onMusicOver(...)

Parameters:

NameTypeDescription
... ? ?

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

function App:onTick(...)

Parameters:

NameTypeDescription
... ? ?

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

function App:quit()

Quits the running game and returns to main menu (offers confirmation window first)

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

function App:readBitmapDataFile(filename)

TODO: is it okay to remove this without replacement?

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

Parameters:

NameTypeDescription
filename ? ?

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

function App:readDataFile(dir, filename)

Parameters:

NameTypeDescription
dir ? ?
filename ? ?

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

function App:readLevelDataFile(filename)

Parameters:

NameTypeDescription
filename ? ?

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

function App:save(filename)

Parameters:

NameTypeDescription
filename ? ?

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

function App:setCommandLine(...)

Parameters:

NameTypeDescription
... ? ?

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

Page generated on Thu Jun 24, 2010 at 02:46:54 by LDocGen.