-
Notifications
You must be signed in to change notification settings - Fork 1
Hooks
Basilius Sauter edited this page Sep 13, 2017
·
1 revision
LotGD\Module\NewDay\Module::HookBeforeNewDay
Catch this hook to redirect the user to a page before the new day actually happens, using the redirect context field. An example for this is found in LotGD\Module\Gender, where the user is prompted with gender selection before the new day happens:
if ($g->getCharacter()->getProperty(self::CharacterPropertyGender, null) === null) {
$context->setDataField(
"redirect",
$g->getEntityManager()
->getRepository(Scene::class)
->findOneBy(["template" => self::SceneGenderChoose])
);
}
The new day procedure is suspended until the module probably redirects the user to the Scene:
$scene = $g->getEntityManager()
->getRepository(Scene::class)
->findOneBy(["template" => NewDayModule::SceneContinue]);