@Override
 public void clicked(InputEvent event, float x, float y) {
   super.clicked(event, x, y);
   Overlap2DFacade facade = Overlap2DFacade.getInstance();
   ResolutionEntryVO resolutionEntryVO = new ResolutionEntryVO();
   resolutionEntryVO.name = nameVisTextField.getText();
   resolutionEntryVO.width = Integer.parseInt(widthVisTextField.getText());
   resolutionEntryVO.height = Integer.parseInt(heightVisTextField.getText());
   resolutionEntryVO.base = buttonGroup.getCheckedIndex();
   facade.sendNotification(CREATE_BTN_CLICKED, resolutionEntryVO);
 }
  @Override
  public void onRegister() {
    super.onRegister();

    sandbox = Sandbox.getInstance();

    actionSets.put(SCENE_ACTIONS_SET, new Array<>());
    actionSets.get(SCENE_ACTIONS_SET).add(Sandbox.ACTION_PASTE);

    actionSets.put(RESOURCE_ACTION_SET, new Array<>());
    actionSets.get(RESOURCE_ACTION_SET).add(Sandbox.ACTION_DELETE);

    actionSets.put(IMAGE_RESOURCE_ACTION_SET, new Array<>());
    // actionSets.get(IMAGE_RESOURCE_ACTION_SET).add(Sandbox.ACTION_DELETE_RESOURCE);

    actionSets.put(ITEMS_ACTIONS_SET, new Array<>());
    actionSets.get(ITEMS_ACTIONS_SET).add(Sandbox.ACTION_CUT);
    actionSets.get(ITEMS_ACTIONS_SET).add(Sandbox.ACTION_COPY);
    actionSets.get(ITEMS_ACTIONS_SET).add(Sandbox.ACTION_PASTE);
    actionSets.get(ITEMS_ACTIONS_SET).add(Sandbox.ACTION_DELETE);
    actionSets.get(ITEMS_ACTIONS_SET).add(Sandbox.ACTION_GROUP_ITEMS);
    actionSets.get(ITEMS_ACTIONS_SET).add(Sandbox.ACTION_CONVERT_TO_BUTTON);

    facade = Overlap2DFacade.getInstance();
  }
 public UIItemsTreeBox() {
   super("Items Tree", 166);
   setMovable(false);
   facade = Overlap2DFacade.getInstance();
   treeTable = new VisTable();
   treeTable.left();
   createCollapsibleWidget(treeTable);
 }
Example #4
0
  @Override
  public void undoAction() {
    Json json = new Json();
    CompositeVO compositeVO = json.fromJson(CompositeVO.class, backup);
    Set<Entity> newEntitiesList = PasteItemsCommand.createEntitiesFromVO(compositeVO);

    for (Entity entity : newEntitiesList) {
      Overlap2DFacade.getInstance().sendNotification(ItemFactory.NEW_ITEM_ADDED, entity);
    }

    sandbox.getSelector().setSelections(newEntitiesList, true);
  }
Example #5
0
  public void initPlugin(O2DPlugin plugin) {
    if (plugins.contains(plugin)) return;

    registerPlugin(plugin);

    plugin.setAPI(this);
    plugin.setEngine(Sandbox.getInstance().getEngine());
    plugin.setFacade(Overlap2DFacade.getInstance());
    plugin.setStage(Sandbox.getInstance().getUIStage());

    plugin.initPlugin();
  }
  @Override
  public void handleNotification(Notification notification) {
    super.handleNotification(notification);

    switch (notification.getName()) {
      case UIPhysicsProperties.CLOSE_CLICKED:
        Overlap2DFacade.getInstance()
            .sendNotification(
                Sandbox.ACTION_REMOVE_COMPONENT,
                RemoveComponentFromItemCommand.payload(
                    observableReference, PhysicsBodyComponent.class));
        break;
    }
  }
  @Override
  public void undoAction() {
    Entity entity = EntityUtils.getByUniqueId(entityId);

    PolygonComponent polygonComponent = ComponentRetriever.get(entity, PolygonComponent.class);
    polygonComponent.vertices = dataFrom;

    // if it's image update polygon sprite data
    TextureRegionComponent textureRegionComponent =
        ComponentRetriever.get(entity, TextureRegionComponent.class);
    if (textureRegionComponent != null && textureRegionComponent.isPolygon) {
      DimensionsComponent dimensionsComponent =
          ComponentRetriever.get(entity, DimensionsComponent.class);
      dimensionsComponent.setPolygon(polygonComponent);
      textureRegionComponent.setPolygonSprite(polygonComponent);
    }

    Overlap2DFacade.getInstance().sendNotification(Overlap2D.ITEM_DATA_UPDATED, entity);
  }
  public EditSpriteAnimationDialog() {
    super("Edit Sprite Animation Ranges");
    addCloseButton();

    facade = Overlap2DFacade.getInstance();

    VisTable mainTable = new VisTable();

    animationsList = new VisTable();
    newAnimationTable = new VisTable();

    createNewAnimationTable();

    mainTable.add(animationsList);
    mainTable.row();
    mainTable.add(newAnimationTable);
    mainTable.row();

    add(mainTable);
  }
 @Override
 public void changed(int number) {
   Overlap2DFacade facade = Overlap2DFacade.getInstance();
   facade.sendNotification(eventName, number);
 }
Example #10
0
 @Override
 public void onRegister() {
   super.onRegister();
   facade = Overlap2DFacade.getInstance();
   resolutionManager = facade.retrieveProxy(ResolutionManager.NAME);
 }
Example #11
0
 @Override
 public void onRegister() {
   super.onRegister();
   facade = Overlap2DFacade.getInstance();
 }
 @Override
 public void changed(ChangeEvent changeEvent, Actor actor) {
   Overlap2DFacade facade = Overlap2DFacade.getInstance();
   facade.sendNotification(eventName, ((VisCheckBox) actor).isChecked());
 }
Example #13
0
 public PluginManager() {
   super(NAME);
   facade = Overlap2DFacade.getInstance();
 }
 public SandboxCommand() {
   sandbox = Sandbox.getInstance();
   facade = Overlap2DFacade.getInstance();
 }