2018-10-25, 18:52
Kodi Leia adds the ability to play games. This is a major feature, so I'll document all the changes and additions I made to allow game support.
New windows
New dialogs (for in-game OSD)
New controls
New content types
New add-on sources
New plugin sources
New add-on categories
New settings
New settings category
New builtin actions
New infolabels
New infobools
New default icons
New windows
- FullscreenGame (VideoFullScreen.xml) - This window is analogous to FullscreenVideo, but doesn't use any controls.
- Games (MyGames.xml) - The game library window. Incredibly limited, just files and add-ons, I could use some help improving this.
- GameSettings (SettingsCategory.xml) - The settings category window for game settings (details)
New dialogs (for in-game OSD)
- GameOSD (GameOSD.xml) - The root OSD for games. You can find some pictures here: Game playback controls (wiki)
- GameVideoFilter (DialogSelect.xml) - The dialog for selecting video filters (a.k.a. shaders)
- GameStretchMode (DialogSelect.xml) - The dialog for selecting stretch modes (e.g. normal, 4:3, fullscreen, original size)
- GameVideoRotation (DialogSelect.xml) - The dialog for rotating the game's video output
- GameVolume (DialogSlider.xml) - The dialog for changing the volume. Game plays in the background.
- GameControllers (DialogGameControllers.xml) - Added in v17, heavily modified for v18. Only shows controllers for the current game, or all controllers if no game is playing
- GameAdvancedSettings - Virtual window that opens AddonSettings (DialogAddonSettings.xml) for the current game client (e.g. ActivateWindow(GameAdvancedSettings))
New controls
- gamewindow - A thumbnail view of the FullscreenGame window, analogous to the videowindow control
- gamecontroller - A game controller image set by core. Added in v17, aspect ratio set to square in v18
New content types
- games (details)
New add-on sources
- game - Python scripts and standalone game clients (e.g. addons://sources/game/)
New plugin sources
- game - Provides games (e.g. <provides>game</provides>)
New add-on categories
- category.gameaddons - Python scripts and standalone game clients (e.g. addons://all/category.gameaddons)
- category.emulators - Game add-ons that can be used to emulate a file
- category.standalonegames - Game add-ons that can be launched standalone
- category.gameproviders - Game plugins
- category.gameresources - Not used yet
- category.gamesupport - Add-ons that offer additional game features, such as Libretro support or shader support
New settings
- gamesgeneral.enable - Whether games are enabled or not. True by default
- gamesgeneral.showosdhelp - True if the help dialog should be shown in the GameOSD dialog
- gamesgeneral.enableautosave- True if autosave is enabled
- gamesgeneral.enablerewind - True if rewind is enabled
- gamesgeneral.rewindtime - Rewind buffer time, in seconds
- input.asknewcontrollers - True if Kodi will ask about configuring new controllers
- input.controllerpoweroff - True if Kodi will power off controllers (only supported on Windows)
New settings category
- gamesettings
New builtin actions
- PlayerControl(Reset) - Action to do a virtual reset on the emulator, analogous to pushing "Reset" on a game console
New infolabels
- RetroPlayer.VideoFilter - The filter/shader used for the fullscreen game window. Values are:
- nearest - Filter using nearest-neighbor (a.k.a. pixelate)
- linear - Filter using bilinear filtering (a.k.a. smooth blur)
- nearest - Filter using nearest-neighbor (a.k.a. pixelate)
- RetroPlayer.StretchMode - The stretch mode for the fullscreen game window. Values are:
- normal - Show the game normally
- 4:3 - Stretch to 4:3 aspect ratio
- fullscreen - Stretch to fullscreen
- original - Show game at original size
- normal - Show the game normally
- RetroPlayer.VideoRotation - The COUNTER-CLOCKWISE rotation used in the fullscreen game window. Values are:
- 0
- 90 (Shown in the GUI as 270°)
- 180
- 270 (Shown in the GUI as 90°)
- 0
- ListItem.Title - The game title - (infolabel extended to support game types)
- ListItem.Platform - The game platform
- ListItem.Genres - The game genres
- ListItem.Publisher - The game publisher
- ListItem.Developer - The game developer
- ListItem.Overview - The game overview/summary
- ListItem.Year - The game release year (infolabel extended to support game types)
- ListItem.GameClient - The add-on ID of the game client (a.k.a. emulator) to use for playing the game
- Listitem.Property(Game.VideoFilter) - The filter/shader used for the gamewindow control. Values match RetroPlayer.VideoFilter
- Listitem.Property(Game.StretchMode) - The stretch mode used for the gamewindow control. Values match RetroPlayer.StretchMode
- Listitem.Property(Game.VideoRotation) - The COUNTER-CLOCKWISE rotation used for the gamewindow control. Values match RetroPlayer.VideoRotation
New infobools
- Player.HasGame (details)
New default icons
- DefaultAddonGame.png - Used for game controllers, game clients, Python game add-ons, game resources, and "game" add-on sources