-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
887 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/mods/betterfoliage/client/gui/ConfigGuiGrass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package mods.betterfoliage.client.gui; | ||
|
||
import mods.betterfoliage.BetterFoliage; | ||
import mods.betterfoliage.client.gui.widget.OptionDoubleWidget; | ||
import net.minecraft.client.gui.GuiButton; | ||
import net.minecraft.client.gui.GuiScreen; | ||
import cpw.mods.fml.client.FMLClientHandler; | ||
|
||
public class ConfigGuiGrass extends ConfigGuiScreenBase { | ||
|
||
public ConfigGuiGrass(GuiScreen parent) { | ||
super(parent); | ||
int id = 10; | ||
widgets.add(new OptionDoubleWidget(BetterFoliage.config.grassSize, -100, -70, 200, 50, id++, id++, "message.betterfoliage.size", "%.2f")); | ||
widgets.add(new OptionDoubleWidget(BetterFoliage.config.grassHOffset, -100, -40, 200, 50, id++, id++, "message.betterfoliage.hOffset", "%.3f")); | ||
widgets.add(new OptionDoubleWidget(BetterFoliage.config.grassHeightMin, -100, -10, 200, 50, id++, id++, "message.betterfoliage.minHeight", "%.2f")); | ||
widgets.add(new OptionDoubleWidget(BetterFoliage.config.grassHeightMax, -100, 20, 200, 50, id++, id++, "message.betterfoliage.maxHeight", "%.2f")); | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
@Override | ||
public void addButtons(int x, int y) { | ||
buttonList.add(new GuiButton(0, x - 50, y + 50, 100, 20, "Close")); | ||
} | ||
|
||
@Override | ||
protected void onButtonPress(int id) { | ||
if (id == 0) FMLClientHandler.instance().showGuiScreen(parent); | ||
|
||
if (BetterFoliage.config.grassHeightMin.value > BetterFoliage.config.grassHeightMax.value) BetterFoliage.config.grassHeightMin.value = BetterFoliage.config.grassHeightMax.value; | ||
} | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/mods/betterfoliage/client/gui/ConfigGuiLeaves.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package mods.betterfoliage.client.gui; | ||
|
||
import mods.betterfoliage.BetterFoliage; | ||
import mods.betterfoliage.client.gui.widget.OptionDoubleWidget; | ||
import net.minecraft.client.gui.GuiButton; | ||
import net.minecraft.client.gui.GuiScreen; | ||
import cpw.mods.fml.client.FMLClientHandler; | ||
|
||
public class ConfigGuiLeaves extends ConfigGuiScreenBase { | ||
|
||
public enum Button {CLOSE, LEAVES_OFFSET_MODE} | ||
|
||
public ConfigGuiLeaves(GuiScreen parent) { | ||
super(parent); | ||
int id = 10; | ||
widgets.add(new OptionDoubleWidget(BetterFoliage.config.leavesSize, -100, -70, 200, 50, id++, id++, "message.betterfoliage.size", "%.2f")); | ||
widgets.add(new OptionDoubleWidget(BetterFoliage.config.leavesHOffset, -100, -10, 200, 50, id++, id++, "message.betterfoliage.hOffset", "%.3f")); | ||
widgets.add(new OptionDoubleWidget(BetterFoliage.config.leavesVOffset, -100, 20, 200, 50, id++, id++, "message.betterfoliage.vOffset", "%.3f")); | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
@Override | ||
public void addButtons(int x, int y) { | ||
buttonList.add(new GuiButton(Button.CLOSE.ordinal(), x - 50, y + 50, 100, 20, "Close")); | ||
buttonList.add(new GuiButton(Button.LEAVES_OFFSET_MODE.ordinal(), x - 100, y - 40, 200, 20, "")); | ||
} | ||
|
||
protected void updateButtons() { | ||
setButtonOptionBoolean(Button.LEAVES_OFFSET_MODE.ordinal(), "message.betterfoliage.leavesMode", BetterFoliage.config.leavesSkew ? "message.betterfoliage.leavesSkew" : "message.betterfoliage.leavesTranslate"); | ||
} | ||
|
||
@Override | ||
protected void onButtonPress(int id) { | ||
if (id == Button.CLOSE.ordinal()) FMLClientHandler.instance().showGuiScreen(parent); | ||
if (id == Button.LEAVES_OFFSET_MODE.ordinal()) BetterFoliage.config.leavesSkew = !BetterFoliage.config.leavesSkew; | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/mods/betterfoliage/client/gui/ConfigGuiLilypad.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package mods.betterfoliage.client.gui; | ||
|
||
import mods.betterfoliage.BetterFoliage; | ||
import mods.betterfoliage.client.gui.widget.OptionDoubleWidget; | ||
import mods.betterfoliage.client.gui.widget.OptionIntegerWidget; | ||
import net.minecraft.client.gui.GuiButton; | ||
import net.minecraft.client.gui.GuiScreen; | ||
import cpw.mods.fml.client.FMLClientHandler; | ||
|
||
public class ConfigGuiLilypad extends ConfigGuiScreenBase { | ||
|
||
public ConfigGuiLilypad(GuiScreen parent) { | ||
super(parent); | ||
int id = 10; | ||
widgets.add(new OptionDoubleWidget(BetterFoliage.config.lilypadHOffset, -100, -40, 200, 50, id++, id++, "message.betterfoliage.hOffset", "%.3f")); | ||
widgets.add(new OptionIntegerWidget(BetterFoliage.config.lilypadChance, -100, -10, 200, 50, id++, id++, "message.betterfoliage.flowerChance")); | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
@Override | ||
public void addButtons(int x, int y) { | ||
buttonList.add(new GuiButton(0, x - 50, y + 50, 100, 20, "Close")); | ||
} | ||
|
||
@Override | ||
protected void onButtonPress(int id) { | ||
if (id == 0) FMLClientHandler.instance().showGuiScreen(parent); | ||
} | ||
|
||
} |
75 changes: 75 additions & 0 deletions
75
src/main/java/mods/betterfoliage/client/gui/ConfigGuiMain.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package mods.betterfoliage.client.gui; | ||
|
||
import mods.betterfoliage.BetterFoliage; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.GuiButton; | ||
import net.minecraft.client.gui.GuiScreen; | ||
import net.minecraft.client.resources.I18n; | ||
import cpw.mods.fml.client.FMLClientHandler; | ||
import cpw.mods.fml.relauncher.Side; | ||
import cpw.mods.fml.relauncher.SideOnly; | ||
|
||
@SideOnly(Side.CLIENT) | ||
public class ConfigGuiMain extends ConfigGuiScreenBase { | ||
|
||
public enum Button {CLOSE, | ||
TOGGLE_LEAVES, CONFIG_LEAVES, | ||
TOGGLE_GRASS, CONFIG_GRASS, | ||
TOGGLE_CACTUS, CONFIG_CACTUS, | ||
TOGGLE_LILYPAD, CONFIG_LILYPAD, | ||
TOGGLE_REED, CONFIG_REED} | ||
|
||
public ConfigGuiMain(GuiScreen parent) { | ||
super(parent); | ||
|
||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
@Override | ||
protected void addButtons(int x, int y) { | ||
buttonList.add(new GuiButton(Button.CLOSE.ordinal(), x - 50, y + 80, 100, 20, "Close")); | ||
buttonList.add(new GuiButton(Button.TOGGLE_LEAVES.ordinal(), x - 100, y - 100, 150, 20, "")); | ||
buttonList.add(new GuiButton(Button.CONFIG_LEAVES.ordinal(), x + 60, y - 100, 40, 20, I18n.format("message.betterfoliage.config"))); | ||
|
||
buttonList.add(new GuiButton(Button.TOGGLE_GRASS.ordinal(), x - 100, y - 70, 150, 20, "")); | ||
buttonList.add(new GuiButton(Button.CONFIG_GRASS.ordinal(), x + 60, y - 70, 40, 20, I18n.format("message.betterfoliage.config"))); | ||
|
||
buttonList.add(new GuiButton(Button.TOGGLE_CACTUS.ordinal(), x - 100, y - 40, 150, 20, "")); | ||
buttonList.add(new GuiButton(Button.CONFIG_CACTUS.ordinal(), x + 60, y - 40, 40, 20, I18n.format("message.betterfoliage.config"))); | ||
|
||
buttonList.add(new GuiButton(Button.TOGGLE_LILYPAD.ordinal(), x - 100, y - 10, 150, 20, "")); | ||
buttonList.add(new GuiButton(Button.CONFIG_LILYPAD.ordinal(), x + 60, y - 10, 40, 20, I18n.format("message.betterfoliage.config"))); | ||
|
||
buttonList.add(new GuiButton(Button.TOGGLE_REED.ordinal(), x - 100, y + 20, 150, 20, "")); | ||
buttonList.add(new GuiButton(Button.CONFIG_REED.ordinal(), x + 60, y + 20, 40, 20, I18n.format("message.betterfoliage.config"))); | ||
} | ||
|
||
protected void updateButtons() { | ||
setButtonOptionBoolean(Button.TOGGLE_LEAVES.ordinal(), "message.betterfoliage.betterLeaves", BetterFoliage.config.leavesEnabled); | ||
setButtonOptionBoolean(Button.TOGGLE_GRASS.ordinal(), "message.betterfoliage.betterGrass", BetterFoliage.config.grassEnabled); | ||
setButtonOptionBoolean(Button.TOGGLE_CACTUS.ordinal(), "message.betterfoliage.betterCactus", BetterFoliage.config.cactusEnabled); | ||
setButtonOptionBoolean(Button.TOGGLE_LILYPAD.ordinal(), "message.betterfoliage.betterLilypad", BetterFoliage.config.lilypadEnabled); | ||
setButtonOptionBoolean(Button.TOGGLE_REED.ordinal(), "message.betterfoliage.betterReed", BetterFoliage.config.reedEnabled); | ||
((GuiButton) buttonList.get(Button.CONFIG_CACTUS.ordinal())).enabled = false; | ||
} | ||
|
||
@Override | ||
protected void onButtonPress(int id) { | ||
if (id == Button.CLOSE.ordinal()) { | ||
BetterFoliage.config.save(); | ||
Minecraft.getMinecraft().renderGlobal.loadRenderers(); | ||
FMLClientHandler.instance().showGuiScreen(parent); | ||
} | ||
if (id == Button.TOGGLE_LEAVES.ordinal()) BetterFoliage.config.leavesEnabled = !BetterFoliage.config.leavesEnabled; | ||
if (id == Button.TOGGLE_GRASS.ordinal()) BetterFoliage.config.grassEnabled = !BetterFoliage.config.grassEnabled; | ||
if (id == Button.TOGGLE_CACTUS.ordinal()) BetterFoliage.config.cactusEnabled = !BetterFoliage.config.cactusEnabled; | ||
if (id == Button.TOGGLE_LILYPAD.ordinal()) BetterFoliage.config.lilypadEnabled = !BetterFoliage.config.lilypadEnabled; | ||
if (id == Button.TOGGLE_REED.ordinal()) BetterFoliage.config.reedEnabled = !BetterFoliage.config.reedEnabled; | ||
|
||
if (id== Button.CONFIG_LEAVES.ordinal()) FMLClientHandler.instance().showGuiScreen(new ConfigGuiLeaves(this)); | ||
if (id== Button.CONFIG_GRASS.ordinal()) FMLClientHandler.instance().showGuiScreen(new ConfigGuiGrass(this)); | ||
if (id== Button.CONFIG_LILYPAD.ordinal()) FMLClientHandler.instance().showGuiScreen(new ConfigGuiLilypad(this)); | ||
if (id== Button.CONFIG_REED.ordinal()) FMLClientHandler.instance().showGuiScreen(new ConfigGuiReed(this)); | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/mods/betterfoliage/client/gui/ConfigGuiReed.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package mods.betterfoliage.client.gui; | ||
|
||
import mods.betterfoliage.BetterFoliage; | ||
import mods.betterfoliage.client.gui.widget.OptionDoubleWidget; | ||
import mods.betterfoliage.client.gui.widget.OptionIntegerWidget; | ||
import net.minecraft.client.gui.GuiButton; | ||
import net.minecraft.client.gui.GuiScreen; | ||
import cpw.mods.fml.client.FMLClientHandler; | ||
|
||
public class ConfigGuiReed extends ConfigGuiScreenBase { | ||
|
||
public ConfigGuiReed(GuiScreen parent) { | ||
super(parent); | ||
int id = 10; | ||
widgets.add(new OptionDoubleWidget(BetterFoliage.config.reedHOffset, -100, -70, 200, 50, id++, id++, "message.betterfoliage.hOffset", "%.3f")); | ||
widgets.add(new OptionDoubleWidget(BetterFoliage.config.reedHeightMin, -100, -40, 200, 50, id++, id++, "message.betterfoliage.minHeight", "%.2f")); | ||
widgets.add(new OptionDoubleWidget(BetterFoliage.config.reedHeightMax, -100, -10, 200, 50, id++, id++, "message.betterfoliage.maxHeight", "%.2f")); | ||
widgets.add(new OptionIntegerWidget(BetterFoliage.config.reedChance, -100, 20, 200, 50, id++, id++, "message.betterfoliage.reedChance")); | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
@Override | ||
public void addButtons(int x, int y) { | ||
buttonList.add(new GuiButton(0, x - 50, y + 50, 100, 20, "Close")); | ||
} | ||
|
||
@Override | ||
protected void onButtonPress(int id) { | ||
if (id == 0) FMLClientHandler.instance().showGuiScreen(parent); | ||
|
||
if (BetterFoliage.config.reedHeightMin.value > BetterFoliage.config.reedHeightMax.value) BetterFoliage.config.reedHeightMin.value = BetterFoliage.config.reedHeightMax.value; | ||
} | ||
|
||
} |
Oops, something went wrong.