App Class
Method Index
- afterLoad()
- checkInstallFolder()
- dispatch(evt_type, ...)
- drawFrame()
- dumpStrings()
- exit()
- fixConfig()
- getFPS()
- init()
- initLanguage()
- load(filename)
- loadLevel(level, ...)
- loadLuaFolder(dir, no_results, append_to)
- loadMainMenu(message)
- onKeyDown(...)
- onKeyUp(...)
- onMouseDown(...)
- onMouseMove(...)
- onMouseUp(...)
- onMusicOver(...)
- onTick(...)
- quit()
- readBitmapDataFile(filename)
- readDataFile(dir, filename)
- readLevelDataFile(filename)
- run()
- save(filename)
- saveConfig()
- scanSavegames()
- setCommandLine(...)
Member Index
- animation_manager
- anims
- audio
- caption
- command_line
- config
- diseases
- eventHandlers
- fs
- fullscreen
- gfx
- humanoid_actions
- last_dispatch_type
- map
- modes
- objects
- rooms
- running
- runtime_config
- savegame_dir
- savegame_version
- strings
- ui
- video
- walls
- world
function App:App()
Declared on: line 35 of Lua/app.lua.
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:checkInstallFolder()
Declared on: line 610 of Lua/app.lua.
function App:dispatch(evt_type, ...)
Parameters:
Name | Type | Description |
---|---|---|
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:fixConfig()
Declared on: line 372 of Lua/app.lua.
function App:getFPS()
Declared on: line 580 of Lua/app.lua.
function App:init()
Declared on: line 66 of Lua/app.lua.
function App:initLanguage()
Declared on: line 226 of Lua/app.lua.
function App:load(filename)
Parameters:
Name | Type | Description |
---|---|---|
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:
Name | Type | Description |
---|---|---|
level | ? | ? |
... | ? | ? |
Declared on: line 271 of Lua/app.lua.
function App:loadLuaFolder(dir, no_results, append_to)
Parameters:
Name | Type | Description |
---|---|---|
dir | ? | ? |
no_results | ? | ? |
append_to | ? | ? |
Declared on: line 739 of Lua/app.lua.
function App:loadMainMenu(message)
Parameters:
Name | Type | Description |
---|---|---|
message | ? | ? |
Declared on: line 254 of Lua/app.lua.
function App:onKeyDown(...)
Parameters:
Name | Type | Description |
---|---|---|
... | ? | ? |
Declared on: line 586 of Lua/app.lua.
function App:onKeyUp(...)
Parameters:
Name | Type | Description |
---|---|---|
... | ? | ? |
Declared on: line 590 of Lua/app.lua.
function App:onMouseDown(...)
Parameters:
Name | Type | Description |
---|---|---|
... | ? | ? |
Declared on: line 598 of Lua/app.lua.
function App:onMouseMove(...)
Parameters:
Name | Type | Description |
---|---|---|
... | ? | ? |
Declared on: line 602 of Lua/app.lua.
function App:onMouseUp(...)
Parameters:
Name | Type | Description |
---|---|---|
... | ? | ? |
Declared on: line 594 of Lua/app.lua.
function App:onMusicOver(...)
Parameters:
Name | Type | Description |
---|---|---|
... | ? | ? |
Declared on: line 606 of Lua/app.lua.
function App:onTick(...)
Parameters:
Name | Type | Description |
---|---|---|
... | ? | ? |
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:
Name | Type | Description |
---|---|---|
filename | ? | ? |
Declared on: line 651 of Lua/app.lua.
function App:readDataFile(dir, filename)
Parameters:
Name | Type | Description |
---|---|---|
dir | ? | ? |
filename | ? | ? |
Declared on: line 700 of Lua/app.lua.
function App:readLevelDataFile(filename)
Parameters:
Name | Type | Description |
---|---|---|
filename | ? | ? |
Declared on: line 716 of Lua/app.lua.
function App:run()
Declared on: line 467 of Lua/app.lua.
function App:save(filename)
Parameters:
Name | Type | Description |
---|---|---|
filename | ? | ? |
Declared on: line 785 of Lua/app.lua.
function App:saveConfig()
Declared on: line 406 of Lua/app.lua.
function App:scanSavegames()
Declared on: line 775 of Lua/app.lua.
function App:setCommandLine(...)
Parameters:
Name | Type | Description |
---|---|---|
... | ? | ? |
Declared on: line 56 of Lua/app.lua.