App Class
Method Index
- abandon()
- afterLoad()
- checkForUpdates()
- checkInstallFolder()
- checkMissingStringsInLanguage(dir, language)
- dispatch(evt_type, ...)
- drawFrame()
- dumpStrings()
- exit()
- fixConfig()
- getBitmapDir()
- getFPS()
- getVersion(version)
- init()
- initLanguage()
- initSavegameDir()
- initScreenshotsDir()
- load(filename)
- loadLevel(level, ...)
- loadLuaFolder(dir, no_results, append_to)
- loadMainMenu(message)
- onKeyDown(...)
- onKeyUp(...)
- onMouseDown(...)
- onMouseMove(...)
- onMouseUp(...)
- onMovieOver(...)
- onMusicOver(...)
- onTick(...)
- onWindowActive(...)
- quickLoad()
- quickSave()
- readBitmapDataFile(filename)
- readDataFile(dir, filename)
- readLevelDataFile(filename)
- restart()
- run()
- save(filename)
- saveConfig()
- setCommandLine(...)
Member Index
- animation_manager
- anims
- audio
- caption
- check_for_updates
- command_line
- config
- diseases
- eventHandlers
- fs
- fullscreen
- gfx
- good_install_folder
- humanoid_actions
- last_dispatch_type
- map
- modes
- moviePlayer
- objects
- resetInfiniteLoopChecker
- rooms
- running
- runtime_config
- savegame_dir
- savegame_version
- screenshot_dir
- strings
- ui
- using_demo_files
- video
- walls
- world
function App:App()
Declared on: line 36 of Lua/app.lua.
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:checkForUpdates()
Declared on: line 1248 of Lua/app.lua.
function App:checkInstallFolder()
Declared on: line 906 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:
Name | Type | Description |
---|---|---|
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:
Name | Type | Description |
---|---|---|
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:fixConfig()
Declared on: line 632 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:getFPS()
Declared on: line 868 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:
Name | Type | Description |
---|---|---|
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:init()
Declared on: line 70 of Lua/app.lua.
function App:initLanguage()
Declared on: line 353 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:initScreenshotsDir()
Declared on: line 335 of Lua/app.lua.
function App:load(filename)
Parameters:
Name | Type | Description |
---|---|---|
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:
Name | Type | Description |
---|---|---|
level | ? | ? |
... | ? | ? |
Declared on: line 425 of Lua/app.lua.
function App:loadLuaFolder(dir, no_results, append_to)
Parameters:
Name | Type | Description |
---|---|---|
dir | ? | ? |
no_results | ? | ? |
append_to | ? | ? |
Declared on: line 1089 of Lua/app.lua.
function App:loadMainMenu(message)
Parameters:
Name | Type | Description |
---|---|---|
message | ? | ? |
Declared on: line 402 of Lua/app.lua.
function App:onKeyDown(...)
Parameters:
Name | Type | Description |
---|---|---|
... | ? | ? |
Declared on: line 874 of Lua/app.lua.
function App:onKeyUp(...)
Parameters:
Name | Type | Description |
---|---|---|
... | ? | ? |
Declared on: line 878 of Lua/app.lua.
function App:onMouseDown(...)
Parameters:
Name | Type | Description |
---|---|---|
... | ? | ? |
Declared on: line 886 of Lua/app.lua.
function App:onMouseMove(...)
Parameters:
Name | Type | Description |
---|---|---|
... | ? | ? |
Declared on: line 890 of Lua/app.lua.
function App:onMouseUp(...)
Parameters:
Name | Type | Description |
---|---|---|
... | ? | ? |
Declared on: line 882 of Lua/app.lua.
function App:onMovieOver(...)
Parameters:
Name | Type | Description |
---|---|---|
... | ? | ? |
Declared on: line 902 of Lua/app.lua.
function App:onMusicOver(...)
Parameters:
Name | Type | Description |
---|---|---|
... | ? | ? |
Declared on: line 898 of Lua/app.lua.
function App:onTick(...)
Parameters:
Name | Type | Description |
---|---|---|
... | ? | ? |
Declared on: line 836 of Lua/app.lua.
function App:onWindowActive(...)
Parameters:
Name | Type | Description |
---|---|---|
... | ? | ? |
Declared on: line 894 of Lua/app.lua.
function App:quickLoad()
Declared on: line 1165 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:
Name | Type | Description |
---|---|---|
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:
Name | Type | Description |
---|---|---|
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:
Name | Type | Description |
---|---|---|
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:run()
Declared on: line 727 of Lua/app.lua.
function App:save(filename)
Parameters:
Name | Type | Description |
---|---|---|
filename | ? | ? |
Declared on: line 1152 of Lua/app.lua.
function App:saveConfig()
Declared on: line 666 of Lua/app.lua.
function App:setCommandLine(...)
Parameters:
Name | Type | Description |
---|---|---|
... | ? | ? |
Declared on: line 60 of Lua/app.lua.