Esempio n. 1
0
void GD_API ReplaceScene(RuntimeScene & scene, gd::String newSceneName, bool clearOthers)
{
    if (!scene.game->HasLayoutNamed(newSceneName)) return;
    scene.RequestChange(clearOthers ?
        RuntimeScene::SceneChange::CLEAR_SCENES :
        RuntimeScene::SceneChange::REPLACE_SCENE, newSceneName);
}
Esempio n. 2
0
bool GD_API WarnAboutInfiniteLoop( RuntimeScene & scene )
{
    #if !defined(GD_NO_WX_GUI)
    if (wxMessageBox(_("A \"While\" event was repeated 100000 times: You may have created an infinite loop, which is repeating itself indefinitely and which is going to freeze the software.\n"
                       "\n"
                       "If you want to stop the preview to correct the issue, click on Yes.\n"
                       "If you want to continue the preview, click on No.\n"
                       "You can deactivate this warning by double clicking on While events.\n"
                       "\n"
                       "Stop the preview?"), _("Infinite loop"), wxYES_NO|wxICON_EXCLAMATION ) == wxYES)
    {
        scene.RequestChange(RuntimeScene::SceneChange::STOP_GAME);
        return true;
    }
    #else
    gd::LogWarning("While event repeated 100000 times!");
    #endif

    return false;
}
Esempio n. 3
0
void GD_API PopScene(RuntimeScene & scene)
{
    scene.RequestChange(RuntimeScene::SceneChange::POP_SCENE);
}
Esempio n. 4
0
void GD_API PushScene(RuntimeScene & scene, gd::String newSceneName)
{
    if (!scene.game->HasLayoutNamed(newSceneName)) return;
    scene.RequestChange(RuntimeScene::SceneChange::PUSH_SCENE, newSceneName);
}
Esempio n. 5
0
void GD_API StopGame( RuntimeScene & scene )
{
    scene.RequestChange(RuntimeScene::SceneChange::STOP_GAME);
}