Frontend
The frontend object is automatically provided by the frontend game environment to script, and provides functionality specific to the frontend. The functions it provides may be called directly on the object in the following form.
Example:
					frontend.<function_name>(<args>)
				| Loaded in Campaign | 
										 | 
								
| Loaded in Battle | 
										 | 
								
| Loaded in Frontend | 
										 | 
								
- 
							
frontend.steal_escape_key() - 
							Steals the ESC key. While the ESC key is stolen, and provided no other game element steals the ESC key later, the lua function 
Esc_Key_Pressedwill be called when the ESC key is pressed.Returns:
nil
 
- 
							
frontend.release_escape_key() - 
							Releases the ESC key after it's been stolen by 
frontend.steal_escape_key.Returns:
nil
 
- 
							
frontend.steal_input_focus() - 
							Steals input focus, preventing any user input at all.
							
Returns:
nil
 
- 
							
frontend.release_input_focus() - 
							Release input focus after it's been stolen with 
frontend.release_input_focus.Returns:
nil
 
- 
							
frontend.disable_shortcut(shortcut namestring,should disableboolean) - 
							Enables or disables a particular keyboard shortcut. Keyboard shortcut names can be found in 
default_keys.xml.Parameters:
1
shortcut name
2
should disable
Returns:
nil
 
- 
							
frontend.start_named_battle(keystring) - 
							Starts a named battle specified by key from the 
battlestable.Parameters:
1
key
Returns:
nil
 
- 
							
frontend.start_xml_battle(xml_pathstring, [start_campaign_paramstable]) - 
							Starts a battle from xml
							
Parameters:
1
xml_path
2
optional, default value=nil
If present, new campaign will be started after the battle, with the supplied parameters. The format of the table is: {campaign = "camapgin_key", faction = "faction_key", campaign_difficulty = 1, battle_difficulty = 1}, where difficulty is: 1 easy, 0 normal, -1 hard, -2 very hard, -3 legendary
Returns:
nil
 
- 
							
frontend.start_campaign(campaign keystring,faction keystring,political party keystring) - 
							Starts the specified campaign, by string key from the 
campaignstable. A faction key from thefactionstable and a political party key frompolitical_partiestable.Parameters:
1
campaign key
2
faction key
3
political party key
Returns:
nil
 
- 
							
frontend.load_campaign(file pathstring, [from cloudboolean]) - 
							Loads a campaign save file by name.
							
Parameters:
1
file path
2
optional, default value=false
from cloud
Returns:
nil
 
- 
							
frontend.continue_campaign([from cloudboolean]) - 
							Loads the most recently saved campaign game.
							
Parameters:
1
optional, default value=false
from cloud
Returns:
nil
 
- 
							
frontend.campaign_saves_exist() - 
							Returns whether any singleplayer campaign save files exists.
							
Returns:
saves existboolean
 
- 
							
frontend.campaign_saves_exist_mp() - 
							Returns whether any multiplayer campaign save files exists.
							
Returns:
saves existboolean