pyplanet.contrib.mode

Mode contrib is managing mode settings and ui settings for the script mode.

class pyplanet.contrib.mode.ModeManager(instance)[source]

Mode Manager manges the script, script settings and the mode UI settings of the current game mode.

Warning

Don’t initiate this class yourself. Use instance.mode_manager for an static instance.

get_current_script(refresh=False)[source]

Get the current script name.

Parameters:refresh – Refresh from server.
get_current_script_info()[source]

Get the script info as a structure containing: Name, CompatibleTypes, Description, Version and the settings available.

get_next_script(refresh=False)[source]

Get the next script name.

Parameters:refresh – Refresh from server.
get_settings()[source]

Get the current mode settings as a dictionary.

get_variables()[source]

Get the mode script variables.

on_start()[source]

Handle startup, just before the apps will start. We will make sure we are ready to get requests for permissions.

set_next_script(name)[source]

Set the next played script name (after map restart/skip).

Parameters:name – Name
update_next_settings(update_dict)[source]

Queue setting changes for the next script (that will be active after restart).

Parameters:update_dict – The dictionary with the partial updated keys and values.
update_next_variables(update_dict)[source]

Queue variable changes for the next script (that will be active after restart).

Parameters:update_dict – The dictionary with the partial updated keys and values.
update_settings(update_dict)[source]

Update the current settings, merges current settings with the provided settings. Replaces by the keys you give if the data already exists.

Parameters:update_dict – The dictionary with the partial updated keys and values.
update_variables(update_dict)[source]

Update the current variables, merges current vars with the provided vars. Replaces by the keys you give if the data already exists.

Parameters:update_dict – The dictionary with the partial updated keys and values.

Signals

This file contains the contrib mode signals, related to the current script/mode.

pyplanet.contrib.mode.signals.script_mode_changed = <pyplanet.core.events.dispatcher.Signal object>

Is called after a new script has been loaded and became active!. Reporting two parameters:

Parameters:
  • unloaded_script – Old script name.
  • loaded_script – New and just loaded script.