MBSubModuleBase extended
Introduces an interface to use in your MBSubModuleBase
-derived class, that provides new SubModule events for additional control over crucial parts of game and campaign loading or unloading.
Usage
To access additional events you should derive your submodule from MBSubModuleBaseEx
instead of MBSubModuleBase
.
public class SubModule : MBSubModuleBaseEx
{
public override void OnAllSubModulesUnLoaded()
{
base.OnAllSubModulesUnLoaded();
}
public override void OnBeforeInitialModuleScreenSetAsRootDelayed()
{
base.OnBeforeInitialModuleScreenSetAsRootDelayed();
}
public override void OnGameStartDelayed(Game game, IGameStarter gameStarterObject)
{
base.OnGameStartDelayed(game, gameStarterObject);
}
public override void OnGameEndDelayed(Game game)
{
base.OnGameEndDelayed(game);
}
}
Alternatively, you can derive directly from the IMBSubModuleBaseEx
interface. This way you can derive from other virual or abstract classes and still access all the additional events, introduced by the MBSubModuleBase extended.
public class SubModule : MBSubModuleBaseWrapper, IMBSubModuleBaseEx
{
public void OnAllSubModulesUnLoaded()
{
//Leave empty or add an implementation here
}
public void OnBeforeInitialModuleScreenSetAsRootDelayed()
{
//Leave empty or add an implementation here
}
public void OnGameStartDelayed(Game game, IGameStarter gameStarterObject)
{
//Leave empty or add an implementation here
}
public void OnGameEndDelayed(Game game)
{
//Leave empty or add an implementation here
}
}
This page was last modified at 05/14/2024 20:48:29 +03:00 (UTC).
Commit Message
Author: Alexey Chernyshov
Commit: d76fb0604f29fb7028974b2ac3dd16ea20a8a450
Fixed a buch of refs in docs