class heshell.HEShell(HLShell)

HEShell is a subclass of HLShell for use by games having a level editor. It provides user interface code for managing editor menu and editing screens, creating level sets, loading and saving level files, and testing levels.

Class Attributes

edit_menu_screen = None
Optional. An EditMenuScreen (or other Screen object) providing a menu of level editor commands.
editor_screen = None
Optional. A Screen object where level editing takes place.

Methods

show_edit_menu_screen()
Switches to the edit_menu_screen, if any.
show_editor_screen()
Switches to the editor_screen, if any,
The following methods implement the editing-related menu commands found on the MainMenuScreen and EditMenuScreen.
test_level_cmd()
Implementation of the "Test Level" menu command.
enter_level_editor_cmd()
Implementation of the "Level Editor" menu command.
create_level_set_cmd()
Implementation of the "Create Level Set" menu command.
new_level_cmd()
Implementation of the "New Level" menu command.
open_level_cmd()
Implementation of the "Open Level" menu command.
save_level_cmd()
Implementation of the "Save Level" menu command.
edit_level_cmd()
Implementation of the "Resume Editing" menu command.
exit_level_editor_cmd()
Implementation of the "Exit Editor" menu command.
You probably won't have to call the following methods yourself. They are documented here in case you want to know about them for customization purposes.
write_level(ask_path)
Writes the current level to a file. If ask_path is true, or the level has not been saved before, asks the user for a pathname, otherwise writes it to the previously-used pathname. Reports errors to the user. Returns true if successful.
ask_save()
If there is any unsaved game progress or unsaved changes to a level, gives the user an opportunity to save them. Reports errors to the user. Raises Cancel if cancelled or an error occurs.
---