Concepts
Insertion
TheCartridgeLoaderSystem will send a CartridgeAddedEvent event to the cartridge entity when it gets inserted or installed onto the loader.
Installation
Cartridge prototypes can be specified on theCartridgeLoaderComponent that should be installed on map init and inserted cartridges can be installed onto the loader by players.
Cartridge loaders have a maximum amount of programs they can have installed.
The installation limit is ignored when installing cartridges specified in the loaders prototype.
Activation
A cartridge/program will be saved as active on the cartridge loader component and theCartridgeActivatedEvent will be raised at it when the player opens the program throught the ui.
Deactivation
When the player exits a program or changes to another program theCartridgeDeactivatedEvent will be raised at the currently active program and the saved active program will be changed/cleared.
This doesn’t happen when the players closes the loaders UI. Opening the UI agian will just display currently active program ui.
Event relay
TheCartridgeLoaderSystem will relay specific events to the currently active program and all programs that are running in the background. This includes device networking events.
Currently relayed events:
DeviceNetworkPacketEventusing theCartridgeDeviceNetPacketEventAfterInteractEventusing theCartridgeAfterInteractEvent- Any subclass of
CartridgeMessageEventwhich gets wrapped usingCartridgeUiMessage, a subclass ofBoundUserInterfaceMessagefor sending messages from the cartridges ui
LoaderUid.
Background programs
A program can register and deregister itself as active in the background and it will receive mostly the same events as the active program. TheCartridgeUiMessage event won’t be relayed to background programs.
Something like a messaging program would run in the background for example.
Program UI fragments
Cartridge UIs are subclasses of the abstractCartridgeUi class which defines methods for getting the root control of that piece of UI and methods for setting it up and updating it. The root control returned gets attached to a control in the catridge loaders UI using that controls AddChild method. Those pieces of UI are called UI fagments.
Cartridge prototypes specify the UI fragment to use in theCartridgeUiComponent’s Ui field.
Example:
Homescreen Items
Homescreen items are not yet implemented