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.-
async
get_current_full_script
(refresh=False)[source]¶ Get the current full script name.
- Parameters
refresh – Refresh from server.
-
async
get_current_script
(refresh=False)[source]¶ Get the current script name.
- Parameters
refresh – Refresh from server.
-
async
get_current_script_info
()[source]¶ Get the script info as a structure containing: Name, CompatibleTypes, Description, Version and the settings available.
-
async
get_next_full_script
(refresh=False)[source]¶ Get the next full script name.
- Parameters
refresh – Refresh from server.
-
async
get_next_script
(refresh=False)[source]¶ Get the next script name.
- Parameters
refresh – Refresh from server.
-
async
on_start
()[source]¶ Handle startup, just before the apps will start. We will make sure we are ready to get requests for permissions.
-
async
set_next_script
(name)[source]¶ Set the next played script name (after map restart/skip).
- Parameters
name – Name
-
async
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.
-
async
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.
-
async
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.