To avoid duplicated tests registration. Start discovery by sending an event. First for global tests and the for local inside global event handler with timeout. Check for duplicates. Check coroutine status after the end of a test to catch failures not caused by asserts. Support bypass in the menu.newGame to start morrowind tests from a menu script skipping intro video. Add --list_tests flag to print all found tests.
80 lines
2.3 KiB
Lua
80 lines
2.3 KiB
Lua
---
|
|
-- Provides interfaces to interact with menu elements.
|
|
-- @context menu
|
|
-- @module menu
|
|
-- @usage local menu = require('openmw.menu')
|
|
|
|
---
|
|
-- @type STATE
|
|
-- @field [parent=#STATE] NoGame
|
|
-- @field [parent=#STATE] Running
|
|
-- @field [parent=#STATE] Ended
|
|
|
|
---
|
|
-- All possible game states returned by @{#menu.getState}
|
|
-- @field [parent=#menu] #STATE STATE
|
|
|
|
---
|
|
-- Current game state
|
|
-- @function [parent=#menu] getState
|
|
-- @return #STATE
|
|
|
|
---
|
|
-- A table of parameters for @{#menu.newGame}
|
|
-- @type NewGameOptions
|
|
-- @field #boolean bypass Skip new game video and character generation (default: false)
|
|
|
|
---
|
|
-- Start a new game
|
|
-- @function [parent=#menu] newGame
|
|
-- @param #NewGameOptions options An optional table with additional optional arguments
|
|
|
|
---
|
|
-- Load the game from a save slot
|
|
-- @function [parent=#menu] loadGame
|
|
-- @param #string directory name of the save directory (e. g. character)
|
|
-- @param #string slotName name of the save slot
|
|
|
|
---
|
|
-- Delete a saved game
|
|
-- @function [parent=#menu] deleteGame
|
|
-- @param #string directory name of the save directory (e. g. character)
|
|
-- @param #string slotName name of the save slot
|
|
|
|
---
|
|
-- Current save directory
|
|
-- @function [parent=#menu] getCurrentSaveDir
|
|
-- @return #string
|
|
|
|
---
|
|
-- Save the game
|
|
-- @function [parent=#menu] saveGame
|
|
-- @param #string description human readable description of the save
|
|
-- @param #string slotName name of the save slot
|
|
|
|
---
|
|
-- @type SaveInfo
|
|
-- @field #string description
|
|
-- @field #string playerName
|
|
-- @field #string playerLevel
|
|
-- @field #number timePlayed Gameplay time for this saved game. Note: available even with [time played](../modding/settings/saves.html#timeplayed) turned off
|
|
-- @field #number creationTime Time at which the game was saved, as a timestamp in seconds. Can be passed as the second argument to `os.data`.
|
|
-- @field #list<#string> contentFiles
|
|
|
|
---
|
|
-- All the saves for the given directory
|
|
-- @function [parent=#menu] getSaves
|
|
-- @param #string directory name of the save directory (e. g. character)
|
|
-- @return #map<#string, #SaveInfo> map with save filenames as keys
|
|
|
|
---
|
|
-- List of all available saves, grouped by directory
|
|
-- @function [parent=#menu] getAllSaves
|
|
-- @return #map<#string, #map<#string, #SaveInfo>> map with directory names as keys, returning maps with save filenames as keys
|
|
|
|
---
|
|
-- Exit the game
|
|
-- @function [parent=#menu] quit
|
|
|
|
return nil
|