Search in sources :

Example 1 with SceneDataManager

use of games.rednblack.editor.proxy.SceneDataManager in project HyperLap2D by rednblackgames.

the class TalosVFXAsset method deleteAllItemsWithParticleName.

private void deleteAllItemsWithParticleName(String name) {
    for (CompositeItemVO compositeItemVO : projectManager.getCurrentProjectInfoVO().libraryItems.values()) {
        deleteAllParticles(compositeItemVO, name);
    }
    for (SceneVO scene : projectManager.currentProjectInfoVO.scenes) {
        SceneVO loadedScene = resourceManager.getSceneVO(scene.sceneName);
        CompositeItemVO tmpVo = new CompositeItemVO(loadedScene.composite);
        deleteAllParticles(tmpVo, name);
        loadedScene.composite = tmpVo;
        SceneDataManager sceneDataManager = facade.retrieveProxy(SceneDataManager.NAME);
        sceneDataManager.saveScene(loadedScene);
    }
}
Also used : CompositeItemVO(games.rednblack.editor.renderer.data.CompositeItemVO) SceneVO(games.rednblack.editor.renderer.data.SceneVO) SceneDataManager(games.rednblack.editor.proxy.SceneDataManager)

Example 2 with SceneDataManager

use of games.rednblack.editor.proxy.SceneDataManager in project HyperLap2D by rednblackgames.

the class ParticleEffectAsset method deleteAllItemsWithParticleName.

private void deleteAllItemsWithParticleName(String name) {
    for (CompositeItemVO compositeItemVO : projectManager.getCurrentProjectInfoVO().libraryItems.values()) {
        deleteAllParticles(compositeItemVO, name);
    }
    for (SceneVO scene : projectManager.currentProjectInfoVO.scenes) {
        SceneVO loadedScene = resourceManager.getSceneVO(scene.sceneName);
        CompositeItemVO tmpVo = new CompositeItemVO(loadedScene.composite);
        deleteAllParticles(tmpVo, name);
        loadedScene.composite = tmpVo;
        SceneDataManager sceneDataManager = facade.retrieveProxy(SceneDataManager.NAME);
        sceneDataManager.saveScene(loadedScene);
    }
}
Also used : CompositeItemVO(games.rednblack.editor.renderer.data.CompositeItemVO) SceneVO(games.rednblack.editor.renderer.data.SceneVO) SceneDataManager(games.rednblack.editor.proxy.SceneDataManager)

Example 3 with SceneDataManager

use of games.rednblack.editor.proxy.SceneDataManager in project HyperLap2D by rednblackgames.

the class SpineAsset method deleteAllItemsSpineAnimations.

private void deleteAllItemsSpineAnimations(String spineAnimationName) {
    for (CompositeItemVO compositeItemVO : projectManager.getCurrentProjectInfoVO().libraryItems.values()) {
        deleteAllSpineAnimationsOfItem(compositeItemVO, spineAnimationName);
    }
    for (SceneVO scene : projectManager.currentProjectInfoVO.scenes) {
        SceneVO loadedScene = resourceManager.getSceneVO(scene.sceneName);
        CompositeItemVO tmpVo = new CompositeItemVO(loadedScene.composite);
        deleteAllSpineAnimationsOfItem(tmpVo, spineAnimationName);
        loadedScene.composite = tmpVo;
        SceneDataManager sceneDataManager = facade.retrieveProxy(SceneDataManager.NAME);
        sceneDataManager.saveScene(loadedScene);
    }
}
Also used : SceneDataManager(games.rednblack.editor.proxy.SceneDataManager)

Example 4 with SceneDataManager

use of games.rednblack.editor.proxy.SceneDataManager in project HyperLap2D by rednblackgames.

the class SpriteAnimationAtlasAsset method deleteAllItemsSpriteAnimations.

private void deleteAllItemsSpriteAnimations(String spriteAnimationName) {
    for (CompositeItemVO compositeItemVO : projectManager.getCurrentProjectInfoVO().libraryItems.values()) {
        deleteAllSpriteAnimationsOfItem(compositeItemVO, spriteAnimationName);
    }
    for (SceneVO scene : projectManager.currentProjectInfoVO.scenes) {
        SceneVO loadedScene = resourceManager.getSceneVO(scene.sceneName);
        CompositeItemVO tmpVo = new CompositeItemVO(loadedScene.composite);
        deleteAllSpriteAnimationsOfItem(tmpVo, spriteAnimationName);
        loadedScene.composite = tmpVo;
        SceneDataManager sceneDataManager = facade.retrieveProxy(SceneDataManager.NAME);
        sceneDataManager.saveScene(loadedScene);
    }
}
Also used : SceneDataManager(games.rednblack.editor.proxy.SceneDataManager)

Example 5 with SceneDataManager

use of games.rednblack.editor.proxy.SceneDataManager in project HyperLap2D by rednblackgames.

the class UISceneBoxMediator method handleNotification.

@Override
public void handleNotification(INotification notification) {
    super.handleNotification(notification);
    Sandbox sandbox = Sandbox.getInstance();
    switch(notification.getName()) {
        case ProjectManager.PROJECT_OPENED:
        case MsgAPI.SCENE_LOADED:
            viewComponent.update();
            break;
        case UISceneBox.CHANGE_SCENE_BTN_CLICKED:
            facade.sendNotification(MsgAPI.CHECK_EDITS_ACTION, (Runnable) () -> sandbox.loadScene(notification.getBody()));
            break;
        case UISceneBox.CREATE_NEW_SCENE_BTN_CLICKED:
            Dialogs.showInputDialog(sandbox.getUIStage(), "Create New Scene", "Scene Name : ", false, new StringNameValidator(), new InputDialogListener() {

                @Override
                public void finished(String input) {
                    if (input == null || input.equals("")) {
                        viewComponent.setCurrentScene();
                        return;
                    }
                    SceneDataManager sceneDataManager = facade.retrieveProxy(SceneDataManager.NAME);
                    sceneDataManager.createNewScene(input);
                    facade.sendNotification(MsgAPI.CHECK_EDITS_ACTION, (Runnable) () -> sandbox.loadScene(input));
                }

                @Override
                public void canceled() {
                    viewComponent.setCurrentScene();
                }
            });
            break;
        case UISceneBox.DELETE_CURRENT_SCENE_BTN_CLICKED:
            Dialogs.showConfirmDialog(sandbox.getUIStage(), "Delete Scene", "Do you really want to delete '" + notification.getBody() + "' scene?", new String[] { "Cancel", "Delete" }, new Integer[] { 0, 1 }, result -> {
                if (result == 1) {
                    SceneDataManager sceneDataManager = facade.retrieveProxy(SceneDataManager.NAME);
                    sceneDataManager.deleteCurrentScene();
                    sandbox.loadScene("MainScene");
                }
            }).padBottom(20).pack();
            break;
        default:
            break;
    }
}
Also used : StringNameValidator(games.rednblack.editor.view.ui.validator.StringNameValidator) InputDialogListener(com.kotcrab.vis.ui.util.dialog.InputDialogListener) SceneDataManager(games.rednblack.editor.proxy.SceneDataManager) Sandbox(games.rednblack.editor.view.stage.Sandbox)

Aggregations

SceneDataManager (games.rednblack.editor.proxy.SceneDataManager)5 CompositeItemVO (games.rednblack.editor.renderer.data.CompositeItemVO)2 SceneVO (games.rednblack.editor.renderer.data.SceneVO)2 InputDialogListener (com.kotcrab.vis.ui.util.dialog.InputDialogListener)1 Sandbox (games.rednblack.editor.view.stage.Sandbox)1 StringNameValidator (games.rednblack.editor.view.ui.validator.StringNameValidator)1