diff --git a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPanelMediator.java b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPanelMediator.java index a5216236..3e2046f9 100644 --- a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPanelMediator.java +++ b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPanelMediator.java @@ -63,7 +63,6 @@ public class TiledPanelMediator extends Mediator { return new String[]{ MsgAPI.SCENE_LOADED, TiledPlugin.TILE_ADDED, - TiledPlugin.IMAGE_BUNDLE_DROP_SINGLE, TiledPlugin.TILE_SELECTED, TiledPlugin.ACTION_DELETE_TILE, TiledPlugin.ACTION_SET_GRID_SIZE_FROM_LIST, @@ -72,6 +71,7 @@ public class TiledPanelMediator extends Mediator { TiledPlugin.GRID_CHANGED, SettingsTab.OK_BTN_CLICKED, TiledPlugin.ACTION_SET_GRID_SIZE_FROM_ITEM, + MsgAPI.IMAGE_BUNDLE_DROP_SINGLE, MsgAPI.ACTION_DELETE_IMAGE_RESOURCE, MsgAPI.TOOL_SELECTED, MsgAPI.ACTION_KEY_DOWN @@ -111,7 +111,7 @@ public class TiledPanelMediator extends Mediator { if (type == EntityFactory.IMAGE_TYPE) { // ensure that all selected images are dropped // the respective listener is responsible for dropping one-by-one, since he tracks the selected ones - tiledPlugin.facade.sendNotification(TiledPlugin.IMAGE_BUNDLE_DROP, new Object[]{tileName, type}); + tiledPlugin.facade.sendNotification(MsgAPI.IMAGE_BUNDLE_DROP, new Object[]{tileName, type}); } } }; @@ -120,7 +120,7 @@ public class TiledPanelMediator extends Mediator { viewComponent.setEngine(engine); viewComponent.setFixedPosition(); break; - case TiledPlugin.IMAGE_BUNDLE_DROP_SINGLE: + case MsgAPI.IMAGE_BUNDLE_DROP_SINGLE: // aliasing the drop from the main project case TiledPlugin.TILE_ADDED: Object[] payload = notification.getBody(); diff --git a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPlugin.java b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPlugin.java index 12e77eb3..77262acc 100644 --- a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPlugin.java +++ b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPlugin.java @@ -67,9 +67,6 @@ public class TiledPlugin extends H2DPluginAdapter { public static final String TILE_GRID_OFFSET_ADDED = CLASS_NAME + ".TILE_GRID_OFFSET_ADDED"; public static final String ACTION_SET_GRID_SIZE_FROM_ITEM = CLASS_NAME + ".ACTION_SET_GRID_SIZE_FROM_ITEM"; public static final String ACTION_SET_GRID_SIZE_FROM_LIST = CLASS_NAME + ".ACTION_SET_GRID_SIZE_FROM_LIST"; - // notification from the main project - public static final String IMAGE_BUNDLE_DROP_SINGLE = "games.rednblack.editor.view.ui.box.UIResourcesBoxMediator.IMAGE_BUNDLE_DROP_SINGLE"; - public static final String IMAGE_BUNDLE_DROP = "games.rednblack.editor.view.ui.box.UIResourcesBoxMediator.IMAGE_BUNDLE_DROP"; //-------end--------// public static final String TILE_TAG = "TILE"; diff --git a/src/main/java/games/rednblack/editor/view/ui/ImageResourceSelectionUIMediator.java b/src/main/java/games/rednblack/editor/view/ui/ImageResourceSelectionUIMediator.java index 78ccba95..e71e98da 100644 --- a/src/main/java/games/rednblack/editor/view/ui/ImageResourceSelectionUIMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/ImageResourceSelectionUIMediator.java @@ -15,6 +15,7 @@ import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.view.ui.box.UIResourcesBoxMediator; import games.rednblack.editor.view.ui.box.resourcespanel.UIImagesTab; import games.rednblack.editor.view.ui.box.resourcespanel.draggable.box.ImageResource; +import games.rednblack.h2d.common.MsgAPI; /** * This mediator is part of the behavior that allows multiple images to be selected and dropped to other panels (like the GridTilesTab from the tiles plugin). @@ -47,7 +48,7 @@ public class ImageResourceSelectionUIMediator extends Mediator { public String[] listNotificationInterests() { return new String[]{ UIResourcesBoxMediator.IMAGE_LEFT_CLICK, - UIResourcesBoxMediator.IMAGE_BUNDLE_DROP, + MsgAPI.IMAGE_BUNDLE_DROP, UIResourcesBoxMediator.IMAGE_TABLE_UPDATED }; } @@ -76,13 +77,13 @@ public class ImageResourceSelectionUIMediator extends Mediator { imageResourcePreviousClick = imageResource; break; - case UIResourcesBoxMediator.IMAGE_BUNDLE_DROP: + case MsgAPI.IMAGE_BUNDLE_DROP: Set nameSet = new HashSet<>(imageResourceSelectedSet); // remove the dropped one, so that it is not added twice Object[] payloadBody = notification.getBody(); nameSet.remove(payloadBody[0]); for (String name : nameSet) { - HyperLap2DFacade.getInstance().sendNotification(UIResourcesBoxMediator.IMAGE_BUNDLE_DROP_SINGLE, new Object[] {name, payloadBody[1]}); + HyperLap2DFacade.getInstance().sendNotification(MsgAPI.IMAGE_BUNDLE_DROP_SINGLE, new Object[] {name, payloadBody[1]}); } break; case UIResourcesBoxMediator.IMAGE_TABLE_UPDATED: diff --git a/src/main/java/games/rednblack/editor/view/ui/box/UIResourcesBoxMediator.java b/src/main/java/games/rednblack/editor/view/ui/box/UIResourcesBoxMediator.java index a7505c6e..711b9be4 100644 --- a/src/main/java/games/rednblack/editor/view/ui/box/UIResourcesBoxMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/box/UIResourcesBoxMediator.java @@ -46,9 +46,6 @@ public class UIResourcesBoxMediator extends PanelMediator { private static final String PREFIX = "games.rednblack.editor.view.ui.box.UIResourcesBoxMediator"; public static final String IMAGE_LEFT_CLICK = PREFIX + ".IMAGE_LEFT_CLICK"; - public static final String IMAGE_BUNDLE_DROP = PREFIX + ".IMAGE_BUNDLE_DROP"; - public static final String IMAGE_BUNDLE_DROP_SINGLE = PREFIX + ".IMAGE_BUNDLE_DROP_SINGLE"; - public static final String SHIFT_CTRL_EVENT_TYPE = PREFIX + ".SHIFT_CTRL_EVENT_TYPE"; public static final String SHIFT_EVENT_TYPE = PREFIX + ".SHIFT_EVENT_TYPE";