Пример #1
0
  @Override
  public void initGui() {
    if (TabMap != null) {
      this.buttonList.removeAll(TabMap.keySet());
      TabMap.clear();
    } else {
      TabMap = new HashMap<GuiButton, GuiConfigTabEntry>();
    }

    int x = 8;
    int y = 27;
    int height = 16;

    for (GuiConfigTabEntry tab : Provider.getTabs()) {
      String text = tab.Title;
      int width = this.fontRendererObj.getStringWidth(text) + 16;

      GuiButton button = new GuiButton(getUniqueButtonId(), x, y, width, height, text);
      if (tab.Category.equals(this.Category)) {
        button.packedFGColour = 255 << 8;
      }

      this.TabMap.put(button, tab);
      this.buttonList.add(button);

      x += (width + 8);
    }

    super.initGui();
    this.entryList.top = y + height;
  }