Examples of StringLogicProperty


Examples of com.pointcliki.dizgruntled.StringLogicProperty

    return "[Checkpoint]";
  }

  @Override
  public void initProperties() {
    StringLogicProperty group = new StringLogicProperty("group") {
     
      @Override
      public String description() {
        return "The group(s) of the effect";
      }
View Full Code Here

Examples of com.pointcliki.dizgruntled.StringLogicProperty

    int n = 100;
    // Add properties
    if (l.properties() == null) return;
    for (LogicProperty p: l.properties()) {
      if (p instanceof StringLogicProperty) {
        final StringLogicProperty s = (StringLogicProperty) p;
        // Add label
        TextEntity label = new TextEntity(s.name(), TextEntity.ALIGN_LEFT, GruntzGame.resourceManager().UIFont(), Color.darkGray);
        label.position(new Vector2f(2, i + 14));
        addChild(label, n);
        n--;
        i += 26;
       
        String[] choices = s.choices();
        if (choices == null) {
          TextBox box = new TextBox(s.value().equals("") ? s.name() : s.value(), s.name());
          box.position(new Vector2f(0, i)).resize(new Vector2f(155, 24));
          box.setChangedMinion(new Minion<IEvent>() {
            @Override
            public long run(Dispatcher<IEvent> dispatcher, String type, IEvent event) {
              s.value(type);
              editLogic(l);
              return Minion.CONTINUE;
            }
          });
          addChild(box, n);
        } else {
          DropDownMenu drop = new DropDownMenu(new Minion<SelectionEvent>() {
            @Override
            public long run(Dispatcher<SelectionEvent> dispatcher, String type, SelectionEvent event) {
              s.choice(event.value());
              editLogic(l);
              return Minion.CONTINUE;
            }
          });
          drop.position(new Vector2f(0, i)).resize(new Vector2f(155, 24));
          for (String str: choices) drop.add(str.toLowerCase());
          if (!s.value().equals("")) drop.select(s.value().toLowerCase());
          addChild(drop, n);
        }
      }
      n--;
      i += 26;
View Full Code Here

Examples of com.pointcliki.dizgruntled.StringLogicProperty

    }
  }

  @Override
  public void initProperties() {
    StringLogicProperty mode = new StringLogicProperty("mode") {
       
      @Override
      public String description() {
        return "The mode of the effect";
      }
     
      @Override
      public String value() {
        return MODES[fMode];
      }
     
      @Override
      public String[] choices() {
        return MODES;
      }

      @Override
      public void choice(int i) {
        fMode = i;
        initProperties();
      }
    };
    StringLogicProperty group = new StringLogicProperty("group") {
     
      @Override
      public String description() {
        return "The group(s) of the effect";
      }
     
      @Override
      public String value() {
        return groupString();
      }
     
      @Override
      public String[] choices() {
        return null;
      }

      @Override
      public void value(String s) {
        fGroups = s.split(" ");         
      }
    };
    StringLogicProperty delay = new StringLogicProperty("delay") {
     
      @Override
      public String description() {
        return "The delay of the effect";
      }
     
      @Override
      public String value() {
        return fDelay + "";
      }
     
      @Override
      public String[] choices() {
        return null;
      }

      @Override
      public void value(String s) {
        try {
          fDelay = Integer.parseInt(s);
        } catch (Exception e) {
          fDelay = 0;
        }
      }
    };
    StringLogicProperty flip = new StringLogicProperty("flip time") {
     
      @Override
      public String description() {
        return "The flip duration of the effect";
      }
     
      @Override
      public String value() {
        return fFlip + "";
      }
     
      @Override
      public String[] choices() {
        return null;
      }

      @Override
      public void value(String s) {
        try {
          fFlip = Integer.parseInt(s);
        } catch (Exception e) {
          fFlip = 0;
        }
      }
    };
    StringLogicProperty flop = new StringLogicProperty("flop time") {
     
      @Override
      public String description() {
        return "The flop duration of the effect";
      }
     
      @Override
      public String value() {
        return fFlop + "";
      }
     
      @Override
      public String[] choices() {
        return null;
      }

      @Override
      public void value(String s) {
        try {
          fFlop = Integer.parseInt(s);
        } catch (Exception e) {
          fFlop = 0;
        }
      }
    };
    StringLogicProperty tileset = new StringLogicProperty("tile layer") {
     
      @Override
      public String description() {
        return "The layer index of the tile to change";
      }
     
      @Override
      public String value() {
        return fLayer + "";
      }
     
      @Override
      public String[] choices() {
        return null;
      }

      @Override
      public void value(String s) {
        try {
          fLayer = Integer.parseInt(s);
        } catch (Exception e) {
          fLayer = 0;
        }
      }
    };
    StringLogicProperty type = new StringLogicProperty("tile type") {
     
      @Override
      public String description() {
        return "The type of the replacement tile";
      }
View Full Code Here

Examples of com.pointcliki.dizgruntled.StringLogicProperty

    return "[HelpBook]";
  }

  @Override
  public void initProperties() {
    StringLogicProperty text = new StringLogicProperty("text") {
     
      @Override
      public String description() {
        return "The text in the book";
      }
View Full Code Here

Examples of com.pointcliki.dizgruntled.StringLogicProperty

    return "[Pickup " + fItem + "]";
  }

  @Override
  public void initProperties() {
    StringLogicProperty type = new StringLogicProperty("type") {
       
      @Override
      public String description() {
        return "The type of pickup";
      }
     
      @Override
      public String value() {
        return fType;
      }
     
      @Override
      public String[] choices() {
        return TYPES;
      }

      @Override
      public void choice(int i) {
        fType = TYPES[i];
        if (fType.equals("TOOL")) fItem = "GAUNTLETZ";
        else if (fType.equals("TOY")) fItem = "BEACHBALL";
        else if (fType.equals("REWARD")) fItem = "COIN";
        else if (fType.equals("POWERUP")) fItem = "GHOST";
        else if (fType.equals("CURSE")) fItem = "SCREENSHAKE";
        else if (fType.equals("UTILITY")) fItem = "MEGAPHONEZ";
        initProperties();
        updateAnimation();
      }
    };
    StringLogicProperty item = new StringLogicProperty("item") {
       
      @Override
      public String description() {
        return "The item to pickup";
      }
     
      @Override
      public String value() {
        return fItem;
      }
     
      @Override
      public String[] choices() {
        if (fType.equals("TOOL")) return TOOLS;
        else if (fType.equals("TOY")) return TOYS;
        else if (fType.equals("POWERUP")) return POWERUPS;
        else if (fType.equals("CURSE")) return CURSES;
        else if (fType.equals("REWARD")) return REWARDS;
        else return UTILITIES;
      }

      @Override
      public void choice(int i) {
        if (fType.equals("TOOL")) fItem = TOOLS[i];
        else if (fType.equals("TOY")) fItem = TOYS[i];
        else if (fType.equals("POWERUP")) fItem = POWERUPS[i];
        else if (fType.equals("CURSE")) fItem = CURSES[i];
        else if (fType.equals("REWARD")) fItem = REWARDS[i];
        else fItem = UTILITIES[i];
        initProperties();
        updateAnimation();
      }
    };
    if (fItem.equals("MEGAPHONEZ")) {
     
      StringLogicProperty subtype = new StringLogicProperty("subtype") {
       
        @Override
        public String description() {
          return "The sub item of pickup";
        }
       
        @Override
        public String value() {
          return fSubType;
        }
       
        @Override
        public String[] choices() {
          return MEGAPHONE_TYPES;
        }

        @Override
        public void choice(int i) {
          fSubType = MEGAPHONE_TYPES[i];
          initProperties();
          updateAnimation();
        }
      };
     
      StringLogicProperty subitem = new StringLogicProperty("subitem") {
       
        @Override
        public String description() {
          return "The sub type of the pickup";
        }
View Full Code Here

Examples of com.pointcliki.dizgruntled.StringLogicProperty

    return "[Fort]";
  }

  @Override
  public void initProperties() {
    StringLogicProperty area = new StringLogicProperty("area") {
     
      @Override
      public String description() {
        return "The world which the fort comes from";
      }
     
      @Override
      public String value() {
        return fArea;
      }
     
      @Override
      public String[] choices() {
        return Map.WORLDS;
      }

      @Override
      public void choice(int i) {
        fArea = Map.AREAS[i];
        updateAnimation();
      }
    };
    StringLogicProperty team = new StringLogicProperty("team") {
     
      @Override
      public String description() {
        return "The team which the flag comes from";
      }
View Full Code Here

Examples of com.pointcliki.dizgruntled.StringLogicProperty

  }

  @Override
  public void initProperties() {
    fProperties = new LogicProperty[] {
      new StringLogicProperty("tool") {
       
        @Override
        public String description() {
          return "The tool the grunt starts with";
        }
       
        @Override
        public String value() {
          return fTool;
        }
       
        @Override
        public String[] choices() {
          return TOOLS;
        }

        @Override
        public void choice(int i) {
          fTool = TOOLS[i];
          animate("IDLE1", "IDLE");
        }
      },
      new StringLogicProperty("toy") {
       
        @Override
        public String description() {
          return "The toy the grunt starts with";
        }
       
        @Override
        public String value() {
          return fToy;
        }
       
        @Override
        public String[] choices() {
          return TOYS;
        }

        @Override
        public void choice(int i) {
          fToy = TOYS[i];
        }
      },
      new StringLogicProperty("color") {
       
        @Override
        public String description() {
          return "The color of the grunt";
        }
       
        @Override
        public String value() {
          return fColor;
        }
       
        @Override
        public String[] choices() {
          return COLORS;
        }

        @Override
        public void choice(int i) {
          fColor = COLORS[i];
          fPalette = new GruntPalette(fColor, GruntzGame.resourceManager().rez().file("GRUNTZ/PALETTEZ/" + fColor + "TOOL", "pal"));
          animate("IDLE1", "IDLE");
        }
      },
      new StringLogicProperty("player") {
       
        @Override
        public String description() {
          return "The player of the grunt";
        }
       
        @Override
        public String value() {
          return PLAYERS[fPlayerValue];
        }
       
        @Override
        public String[] choices() {
          return PLAYERS;
        }

        @Override
        public void choice(int i) {
          fPlayerValue = i;
        }
      },
      new StringLogicProperty("ai") {
       
        @Override
        public String description() {
          return "The AI type of the grunt";
        }
View Full Code Here

Examples of com.pointcliki.dizgruntled.StringLogicProperty

    }
  }

  @Override
  public void initProperties() {
    StringLogicProperty area = new StringLogicProperty("area") {
     
      @Override
      public String description() {
        return "The world which the ball comes from";
      }
     
      @Override
      public String value() {
        return fArea;
      }
     
      @Override
      public String[] choices() {
        return Map.WORLDS;
      }

      @Override
      public void choice(int i) {
        fArea = Map.AREAS[i];
        updateAnimation();
      }
    };
    StringLogicProperty direction = new StringLogicProperty("item") {
       
      @Override
      public String description() {
        return "The initial direction of the ball";
      }
     
      @Override
      public String value() {
        return fDir.toName();
      }
     
      @Override
      public String[] choices() {
        return GridCoordinate.COMPASS;
      }

      @Override
      public void choice(int i) {
        fDir = GridCoordinate.fromString(GridCoordinate.COMPASS[i]);
        updateAnimation();
      }
    };
    StringLogicProperty speed = new StringLogicProperty("speed") {
     
      @Override
      public String description() {
        return "The speed of the rolling ball";
      }
View Full Code Here

Examples of com.pointcliki.dizgruntled.StringLogicProperty

    return "[Fortress Flag]";
  }

  @Override
  public void initProperties() {
    StringLogicProperty team = new StringLogicProperty("team") {
     
      @Override
      public String description() {
        return "The team which the flag comes from";
      }
View Full Code Here

Examples of com.pointcliki.dizgruntled.StringLogicProperty

    cleanup();
  }
 
  @Override
  public void initProperties() {
    StringLogicProperty type = new StringLogicProperty("type") {
     
      @Override
      public String description() {
        return "The type of pickup";
      }
     
      @Override
      public String value() {
        return fType;
      }
     
      @Override
      public String[] choices() {
        return Pickup.TYPES;
      }

      @Override
      public void choice(int i) {
        fType = Pickup.TYPES[i];
        if (fType.equals("TOOL")) fItem = "GAUNTLETZ";
        else if (fType.equals("TOY")) fItem = "BEACHBALL";
        else if (fType.equals("REWARD")) fItem = "COIN";
        else if (fType.equals("POWERUP")) fItem = "GHOST";
        else if (fType.equals("CURSE")) fItem = "SCREENSHAKE";
        else if (fType.equals("UTILITY")) fItem = "MEGAPHONEZ";
        initProperties();
      }
    };
    StringLogicProperty item = new StringLogicProperty("item") {
       
      @Override
      public String description() {
        return "The item to pickup";
      }
     
      @Override
      public String value() {
        return fItem;
      }
     
      @Override
      public String[] choices() {
        if (fType.equals("TOOL")) return Pickup.TOOLS;
        else if (fType.equals("TOY")) return Pickup.TOYS;
        else if (fType.equals("POWERUP")) return Pickup.POWERUPS;
        else if (fType.equals("CURSE")) return Pickup.CURSES;
        else if (fType.equals("REWARD")) return Pickup.REWARDS;
        else return Pickup.UTILITIES;
      }

      @Override
      public void choice(int i) {
        if (fType.equals("TOOL")) fItem = Pickup.TOOLS[i];
        else if (fType.equals("TOY")) fItem = Pickup.TOYS[i];
        else if (fType.equals("POWERUP")) fItem = Pickup.POWERUPS[i];
        else if (fType.equals("CURSE")) fItem = Pickup.CURSES[i];
        else if (fType.equals("REWARD")) fItem = Pickup.REWARDS[i];
        else fItem = Pickup.UTILITIES[i];
        initProperties();
      }
    };
    StringLogicProperty tileset = new StringLogicProperty("tile layer") {
     
      @Override
      public String description() {
        return "The layer index of the tile to change";
      }
     
      @Override
      public String value() {
        return fLayer + "";
      }
     
      @Override
      public String[] choices() {
        return null;
      }

      @Override
      public void value(String s) {
        try {
          fLayer = Integer.parseInt(s);
        } catch (Exception e) {
          fLayer = 0;
        }
      }
    };
    StringLogicProperty tile = new StringLogicProperty("tile type") {
     
      @Override
      public String description() {
        return "The type of the hidden tile";
      }
     
      @Override
      public String value() {
        return fNewTile;
      }
     
      @Override
      public String[] choices() {
        return null;
      }

      @Override
      public void value(String s) {
        fNewTile = s;
      }
    };
    if (fItem != null && fItem.equals("MEGAPHONEZ")) {
     
      StringLogicProperty subtype = new StringLogicProperty("subtype") {
       
        @Override
        public String description() {
          return "The sub item of pickup";
        }
       
        @Override
        public String value() {
          return fSubType;
        }
       
        @Override
        public String[] choices() {
          return Pickup.MEGAPHONE_TYPES;
        }

        @Override
        public void choice(int i) {
          fSubType = Pickup.MEGAPHONE_TYPES[i];
          initProperties();
        }
      };
     
      StringLogicProperty subitem = new StringLogicProperty("subitem") {
       
        @Override
        public String description() {
          return "The sub type of the pickup";
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.