@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;
  }
 public ConveyorGuiConfig(GuiScreen guiScreen) {
   super(
       guiScreen,
       getConfigElements(),
       Reference.MOD_ID,
       false,
       false,
       GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
 }
 public AgriCraftGuiConfig(GuiScreen guiScreen) {
   super(
       guiScreen,
       getConfigElements(),
       Reference.MOD_ID,
       false,
       false,
       GuiConfig.getAbridgedConfigPath(ConfigurationHandler.config.toString()));
 }
  @Override
  protected void actionPerformed(GuiButton guiButton) {
    super.actionPerformed(guiButton);

    if (guiButton != null) {
      if (TabMap.containsKey(guiButton)) {
        NavigateTo(TabMap.get(guiButton));
      }
    }
  }
 public ModGuiConfig(GuiScreen guiScreen) {
   super(
       guiScreen,
       new ConfigElement(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL))
           .getChildElements(),
       Reference.MOD_ID,
       false,
       false,
       GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
 }
Exemple #6
0
 @SuppressWarnings({"unchecked", "rawtypes"})
 public TailsConfigGUI(GuiScreen parentScreen) {
   super(
       parentScreen,
       new ConfigElement(Tails.configuration.getCategory(Configuration.CATEGORY_GENERAL))
           .getChildElements(),
       Tails.MOD_ID,
       false,
       false,
       GuiConfig.getAbridgedConfigPath(Tails.configuration.toString()));
 }
  public ModGuiConfig(GuiScreen guiScreen) {

    // I swear, this is like the most complicated piece of code in this whole tutorial so far
    super(
        guiScreen,
        new ConfigElement(ConfigurationHandler.config.getCategory(Configuration.CATEGORY_GENERAL))
            .getChildElements(),
        Reference.MODID,
        false,
        false,
        GuiConfig.getAbridgedConfigPath(ConfigurationHandler.config.toString()));
  }
 @Override
 @SuppressWarnings("unchecked")
 protected GuiScreen buildChildScreen() {
   return new GuiConfig(
       this.owningScreen,
       new ConfigElement(
               ConfigurationHandler.config.getCategory(ConfigurationHandler.CATEGORY_IRRIGATION))
           .getChildElements(),
       this.owningScreen.modID,
       ConfigurationHandler.CATEGORY_IRRIGATION,
       false,
       false,
       GuiConfig.getAbridgedConfigPath(ConfigurationHandler.config.toString()));
 }