コード例 #1
0
  @Override
  public void addTooltip(List<String> list) {
    int x = parent.getMouseX() + parent.getGuiLeft(), y = parent.getMouseY() + parent.getGuiTop();

    for (int i = 0; i < 5; i++) {
      if (scrollAmount + i >= dial.glyphList.size()) break;

      int entryOffset = i * entryHeight;
      boolean
          mouseOverEntry =
              y >= posY + offsetY + entryOffset && y <= posY + offsetY + entryOffset + 20,
          mouseOverSmall =
              mouseOverEntry
                  && x >= posX + offsetX + sizeMButton + buttonSpacing
                  && x < posX + offsetX + sizeMButton + buttonSpacing + sizeSButton;

      if (mouseOverSmall) {
        if (GuiScreen.isShiftKeyDown()) {
          list.add(Localisation.get(EPMod.ID, Locale.GUI_DELETE));
          break;
        }

        list.add(Localisation.get(EPMod.ID, Locale.GUI_EDIT));
        break;
      }
    }
  }
コード例 #2
0
  @Override
  public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
    int damage = stack.getItemDamage();

    if (damage > 0) list.add(Localisation.get(EPMod.ID, Locale.BLOCK_PORTAL_FRAME_PART));
  }