Package games.stendhal.client.gui.chatlog

Examples of games.stendhal.client.gui.chatlog.HeaderLessEventLine


    boolean showAttackInfoForPlayer = (this.isUser() || attacker.isUser());
    showAttackInfoForPlayer = showAttackInfoForPlayer
        & (!stendhal.FILTER_ATTACK_MESSAGES);

    if (stendhal.SHOW_EVERYONE_ATTACK_INFO || showAttackInfoForPlayer) {
      ClientSingletonRepository.getUserInterface().addEventLine(new HeaderLessEventLine(
          getTitle() + " suffers "
              + Grammar.quantityplnoun(damage, "point")
              + " of damage from " + attacker.getTitle(),
          NotificationType.NEGATIVE));
    }
View Full Code Here


  // When entity is poisoned
  public final void onPoisoned(final int amount) {
    if ((User.squaredDistanceTo(x, y) < 15 * 15)) {
      poisoned = true;
      ClientSingletonRepository.getUserInterface().addEventLine(
          new HeaderLessEventLine(
          getTitle() + " is poisoned, losing "
              + Grammar.quantityplnoun(amount, "health point")
              + ".", NotificationType.NEGATIVE));
    }
  }
View Full Code Here

      LOGGER.error("Unkown texttype: ", e);
      type = NotificationType.PRIVMSG;
    }

   
    ClientSingletonRepository.getUserInterface().addEventLine(new HeaderLessEventLine(text, type));

    // Scene settings messages should not disturb playing, just create some atmosphere
    if (type != NotificationType.SCENE_SETTING) {
      ClientSingletonRepository.getUserInterface().addGameScreenText(
          getX() + (getWidth() / 2.0), getY(),
View Full Code Here

     
      //an emote action is changed server side to an chat action with a leading !me
      //this supports also invoking an emote with !me instead of /me
      if (text.startsWith("!me")) {
        line = line.replace("!me", getTitle());
        ClientSingletonRepository.getUserInterface().addEventLine(new HeaderLessEventLine(line, NotificationType.EMOTE));
       
        return;
      } else {
        //add the original version
        nonCreatureClientAddEventLine(text);
View Full Code Here

        if (User.squaredDistanceTo(x, y) < 15 * 15) {
          final int amount = newXp - xp;
          if (amount > 0) {
            addTextIndicator("+" + amount,
                NotificationType.SIGNIFICANT_POSITIVE);
            ClientSingletonRepository.getUserInterface().addEventLine(new HeaderLessEventLine(
                getTitle()
                + " earns "
                + Grammar.quantityplnoun(amount,
                "experience point") + ".",
                NotificationType.SIGNIFICANT_POSITIVE));
          } else if (amount < 0) {
            addTextIndicator("" + amount,
                NotificationType.SIGNIFICANT_NEGATIVE);
            ClientSingletonRepository.getUserInterface().addEventLine(new HeaderLessEventLine(
                getTitle()
                + " loses "
                + Grammar.quantityplnoun(-amount,
                "experience point") + ".",
                NotificationType.SIGNIFICANT_NEGATIVE));
          }
        }
      }
     
      xp = newXp;
    }

    if (changes.has("level") && object.has("level")) {
      if (User.squaredDistanceTo(x, y) < 15 * 15) {
        final String text = getTitle() + " reaches Level " + getLevel();
        ClientSingletonRepository.getUserInterface().addEventLine(new HeaderLessEventLine(text,
            NotificationType.SIGNIFICANT_POSITIVE));

        ClientSingletonRepository.getUserInterface().addGameScreenText(
            getX() + (getWidth() / 2.0), getY(),
            text, NotificationType.SIGNIFICANT_POSITIVE, false);
View Full Code Here

    if (message == null) {
      text = "You are no longer marked as being away.";
    } else {
      text = "You have been marked as being away.";
    }
    ClientSingletonRepository.getUserInterface().addEventLine(new HeaderLessEventLine(text, NotificationType.INFORMATION));
  }
View Full Code Here

  @Override
  public void onHealed(final int amount) {
    super.onHealed(amount);
    ClientSingletonRepository.getUserInterface().addEventLine(
      new HeaderLessEventLine(
      getTitle() + " heals "
      + Grammar.quantityplnoun(amount, "health point") + ".",
      NotificationType.POSITIVE));
  }
View Full Code Here

    if (object != null) {
      if (changes.has("offline")) {
        final String[] players = changes.get("offline").split(",");
        for (final String playername : players) {
            ClientSingletonRepository.getUserInterface().addEventLine(
              new HeaderLessEventLine(
              playername + " has left Stendhal.",
              NotificationType.INFORMATION));
        }
      }

      if (changes.has("online")) {
        final String[] players = changes.get("online").split(",");
        for (final String playerName : players) {
          ClientSingletonRepository.getUserInterface().addEventLine(
              new HeaderLessEventLine(
              playerName + " has joined Stendhal.",
              NotificationType.INFORMATION));
        }
      }

      if (changes.has("release")) {
        serverVersion = changes.get("release");
        if (!Version.checkCompatibility(serverVersion,
            stendhal.VERSION)) {
          ClientSingletonRepository.getUserInterface().addEventLine(
              new HeaderLessEventLine(
              "Your client may not function properly.\nThe version of this server is "
                  + serverVersion
                  + " but your client is version "
                  + stendhal.VERSION
                  + ".\nYou can download version " + serverVersion + " from http://arianne.sourceforge.net ",
View Full Code Here

            try {
              type = NotificationType.valueOf(event.get("texttype"));
            } catch (final RuntimeException e) {
              type = NotificationType.PRIVMSG;
            }
            ClientSingletonRepository.getUserInterface().addEventLine(new HeaderLessEventLine(text, type));

          } else if (event.getName().equals("text")) {

            // public chat
            ClientSingletonRepository.getUserInterface().addEventLine(new StandardHeaderedEventLine(name, event.get("text")));
View Full Code Here

    // Display a warning message in case the screen size was adjusted
    // This is a temporary solution until this issue is fixed server side.
    // I hope that it discourages its use without the risks of unupdateable
    // clients being distributed
    if (!screenSize.equals(new Dimension(640, 480))) {
      addEventLine(new HeaderLessEventLine("Using window size cheat: " + getWidth() + "x" + getHeight(), NotificationType.NEGATIVE));
    }

    // Display a hint if this is a debug client
    if (Debug.PRE_RELEASE_VERSION != null) {
      addEventLine(new HeaderLessEventLine("This is a pre release test client: " + Debug.VERSION + " - " + Debug.PRE_RELEASE_VERSION, NotificationType.CLIENT));
    }

    // set some default window positions
    final WtWindowManager windowManager = WtWindowManager.getInstance();
    windowManager.setDefaultProperties("corpse", false, 0, 190);
View Full Code Here

TOP

Related Classes of games.stendhal.client.gui.chatlog.HeaderLessEventLine

Copyright © 2018 www.massapicom. 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.