Ejemplo n.º 1
0
  public void onMouseButtonEvent(MouseButtonEvent event) {
    if (event.isReleased()) {
      return;
    }
    if (mouseStatus == null) {
      return;
    }
    PlayerControler p = game.getPlayerControler();

    if (event.getButtonIndex() == 0) // links
    {
      if (mouseStatus.getModel() == null) {
        p.mouseClick(0, mouseStatus.getX(), mouseStatus.getY());
      } else {
        p.mouseClick(0, (Unit) mouseStatus.getModel().getParent());
      }
    } else if (event.getButtonIndex() == 1) // rechts
    {
      if (mouseStatus.getModel() == null) {
        p.mouseClick(1, mouseStatus.getX(), mouseStatus.getY());
      } else {
        p.mouseClick(1, (Unit) mouseStatus.getModel().getParent());
      }
    } else { // mitte

    }
  }
Ejemplo n.º 2
0
 public void onMouseButtonEvent(MouseButtonEvent evt) {
   if (evt.getButtonIndex() == 0 && evt.isPressed()) {
     if (inventoryType == InventoryType.PointClick) {
       if (cursor.getUserData("worldObject") != null) {
         InteractiveNode node = cursor.getUserData("worldObject");
         main.getRootNode().attachChild(node);
         node.setIsInScene(true);
         cursor.setUserData("worldObject", null);
         cursor.setTextureAtlasImage(objIcons, iconDefault);
       }
     }
   }
 }
Ejemplo n.º 3
0
 private void onMouseButtonEventQueued(MouseButtonEvent evt) {
   int hash = MouseButtonTrigger.mouseButtonHash(evt.getButtonIndex());
   invokeActions(hash, evt.isPressed());
   invokeTimedActions(hash, evt.getTime(), evt.isPressed());
 }