Fixed some Manual stuff

This commit is contained in:
Ellpeck 2015-08-31 11:48:15 +02:00
parent ef51a85d49
commit 5b812a6b67
6 changed files with 47 additions and 29 deletions

View file

@ -170,6 +170,7 @@ public class GuiBooklet extends GuiScreen{
super.func_146283_a(list, x, y); super.func_146283_a(list, x, y);
} }
@SuppressWarnings("unchecked")
@Override @Override
public void drawScreen(int x, int y, float f){ public void drawScreen(int x, int y, float f){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
@ -217,25 +218,31 @@ public class GuiBooklet extends GuiScreen{
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
this.searchField.drawTextBox(); this.searchField.drawTextBox();
if(this.currentIndexEntry != null && this.currentChapter != null && this.currentPage != null){
this.currentPage.render(this, x, y, this.mouseClicked);
}
//Achievements Hover Text //Achievements Hover Text
if(x >= this.guiLeft+138 && x <= this.guiLeft+138+7 && y >= this.guiTop && y <= this.guiTop+7){ if(x >= this.guiLeft+138 && x <= this.guiLeft+138+7 && y >= this.guiTop && y <= this.guiTop+7){
this.func_146283_a(Collections.singletonList("Show Achievements"), x, y); this.func_146283_a(Collections.singletonList(EnumChatFormatting.GOLD+"Show Achievements"), x, y);
} }
//Config Hover Text //Config Hover Text
if(x >= this.guiLeft+138 && x <= this.guiLeft+138+7 && y >= this.guiTop+10 && y <= this.guiTop+10+7){ if(x >= this.guiLeft+138 && x <= this.guiLeft+138+7 && y >= this.guiTop+10 && y <= this.guiTop+10+7){
this.func_146283_a(Collections.singletonList("Show Config"), x, y); ArrayList list = new ArrayList();
list.add(EnumChatFormatting.GOLD+"Show Configuration GUI");
list.add(EnumChatFormatting.ITALIC+"It is highly recommended that you restart");
list.add(EnumChatFormatting.ITALIC+"your game after changing anything as");
list.add(EnumChatFormatting.ITALIC+"that prevents possible bugs occuring!");
this.func_146283_a(list, x, y);
} }
//Twitter Hover Text //Twitter Hover Text
if(x >= this.guiLeft && x <= this.guiLeft+7 && y >= this.guiTop && y <= this.guiTop+7){ if(x >= this.guiLeft && x <= this.guiLeft+7 && y >= this.guiTop && y <= this.guiTop+7){
this.func_146283_a(Collections.singletonList("Open @ActAddMod on Twitter in Browser"), x, y); this.func_146283_a(Collections.singletonList(EnumChatFormatting.GOLD+"Open @ActAddMod on Twitter in Browser"), x, y);
} }
//Forum Hover Text //Forum Hover Text
if(x >= this.guiLeft && x <= this.guiLeft+7 && y >= this.guiTop+10 && y <= this.guiTop+10+7){ if(x >= this.guiLeft && x <= this.guiLeft+7 && y >= this.guiTop+10 && y <= this.guiTop+10+7){
this.func_146283_a(Collections.singletonList("Open Minecraft Forum Post in Browser"), x, y); this.func_146283_a(Collections.singletonList(EnumChatFormatting.GOLD+"Open Minecraft Forum Post in Browser"), x, y);
}
if(this.currentIndexEntry != null && this.currentChapter != null && this.currentPage != null){
this.currentPage.render(this, x, y, this.mouseClicked);
} }
if(this.mouseClicked) this.mouseClicked = false; if(this.mouseClicked) this.mouseClicked = false;

View file

@ -47,6 +47,10 @@ public class PageCrusherRecipe extends BookletPage{
if(recipe == null){ if(recipe == null){
gui.unicodeRenderer.drawSplitString(StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".recipeDisabled"), gui.guiLeft+14, gui.guiTop+15, 115, 0); gui.unicodeRenderer.drawSplitString(StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".recipeDisabled"), gui.guiLeft+14, gui.guiTop+15, 115, 0);
} }
else{
String strg = "Crusher Recipe";
gui.unicodeRenderer.drawString(strg, gui.guiLeft+gui.xSize/2-gui.unicodeRenderer.getStringWidth(strg)/2, gui.guiTop+10, 0);
}
String text = gui.currentPage.getText(); String text = gui.currentPage.getText();
if(text != null && !text.isEmpty() && !text.contains("booklet.")){ if(text != null && !text.isEmpty() && !text.contains("booklet.")){

View file

@ -55,6 +55,10 @@ public class PageFurnace extends BookletPage{
if(input == null){ if(input == null){
gui.unicodeRenderer.drawSplitString(StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".recipeDisabled"), gui.guiLeft+14, gui.guiTop+15, 115, 0); gui.unicodeRenderer.drawSplitString(StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".recipeDisabled"), gui.guiLeft+14, gui.guiTop+15, 115, 0);
} }
else{
String strg = "Furnace Recipe";
gui.unicodeRenderer.drawString(strg, gui.guiLeft+gui.xSize/2-gui.unicodeRenderer.getStringWidth(strg)/2, gui.guiTop+10, 0);
}
String text = gui.currentPage.getText(); String text = gui.currentPage.getText();
if(text != null && !text.isEmpty() && !text.contains("booklet.")){ if(text != null && !text.isEmpty() && !text.contains("booklet.")){

View file

@ -12,24 +12,25 @@ package ellpeck.actuallyadditions.config;
public enum ConfigCategories{ public enum ConfigCategories{
FOOD_CRAFTING("food crafting"), FOOD_CRAFTING("food crafting", "Crafting Recipes for Food Items"),
MISC_CRAFTING("misc crafting"), BLOCKS_CRAFTING("block crafting", "Crafting Recipes for Blocks"),
BLOCKS_CRAFTING("block crafting"), ITEMS_CRAFTING("item crafting", "Crafting Recipes for Items"),
ITEMS_CRAFTING("item crafting"), TOOL_VALUES("tool values", "Values for Tools"),
TOOL_VALUES("tool values"), MACHINE_VALUES("machine values", "Values for Machines"),
MACHINE_VALUES("machine values"), MOB_DROPS("mob drops", "Everything regarding Item drops from mobs"),
MOB_DROPS("mob drops"), WORLD_GEN("world gen", "Everything regarding World Generation"),
WORLD_GEN("world gen"), POTION_RING_CRAFTING("ring crafting", "Crafting Recipes for Rings"),
POTION_RING_CRAFTING("ring crafting"), OTHER("other", "Everything else"),
OTHER("other"), FLUIDS("fluids", "Everything regarding fluids"),
FLUIDS("fluids"), DRILL_VALUES("drill values", "Properties of Drills and their Upgrades"),
DRILL_VALUES("drill values"), CRUSHER_RECIPES("crusher recipes", "Recipes for the Crusher"),
CRUSHER_RECIPES("crusher recipes"), ARMOR_VALUES("armor values", "Values for Armor");
ARMOR_VALUES("armor values");
public final String name; public final String name;
public final String comment;
ConfigCategories(String name){ ConfigCategories(String name, String comment){
this.name = name; this.name = name.toLowerCase();
this.comment = comment;
} }
} }

View file

@ -32,16 +32,16 @@ public class ConfigValues{
public static void defineConfigValues(Configuration config){ public static void defineConfigValues(Configuration config){
for(ConfigCrafting currConf : craftingConfig){ for(ConfigCrafting currConf : craftingConfig){
currConf.currentValue = config.getBoolean(currConf.name, currConf.category, currConf.defaultValue, "If the " + currConf.extraText + "Crafting Recipe for the "+currConf.name+" is Enabled"); currConf.currentValue = config.getBoolean(currConf.name, currConf.category.toLowerCase(), currConf.defaultValue, "If the "+currConf.extraText+"Crafting Recipe for the "+currConf.name+" is Enabled");
} }
for(ConfigIntValues currConf : intConfig){ for(ConfigIntValues currConf : intConfig){
currConf.currentValue = config.getInt(currConf.name, currConf.category, currConf.defaultValue, currConf.min, currConf.max, currConf.desc); currConf.currentValue = config.getInt(currConf.name, currConf.category.toLowerCase(), currConf.defaultValue, currConf.min, currConf.max, currConf.desc);
} }
for(ConfigFloatValues currConf : floatConfig){ for(ConfigFloatValues currConf : floatConfig){
currConf.currentValue = config.getFloat(currConf.name, currConf.category, currConf.defaultValue, currConf.min, currConf.max, currConf.desc); currConf.currentValue = config.getFloat(currConf.name, currConf.category.toLowerCase(), currConf.defaultValue, currConf.min, currConf.max, currConf.desc);
} }
for(ConfigBoolValues currConf : boolConfig){ for(ConfigBoolValues currConf : boolConfig){
currConf.currentValue = config.getBoolean(currConf.name, currConf.category, currConf.defaultValue, currConf.desc); currConf.currentValue = config.getBoolean(currConf.name, currConf.category.toLowerCase(), currConf.defaultValue, currConf.desc);
} }
crusherRecipeExceptions = config.getStringList("Crusher Recipe Exceptions", ConfigCategories.CRUSHER_RECIPES.name, new String[]{"ingotBrick", "ingotBrickNether"}, "The Ingots, Dusts and Ores blacklisted from being auto-registered to be crushed by the Crusher. This list uses OreDictionary Names of the Inputs only."); crusherRecipeExceptions = config.getStringList("Crusher Recipe Exceptions", ConfigCategories.CRUSHER_RECIPES.name, new String[]{"ingotBrick", "ingotBrickNether"}, "The Ingots, Dusts and Ores blacklisted from being auto-registered to be crushed by the Crusher. This list uses OreDictionary Names of the Inputs only.");

View file

@ -29,7 +29,9 @@ public class GuiConfiguration extends GuiConfig{
private static List<IConfigElement> getConfigElements(){ private static List<IConfigElement> getConfigElements(){
List<IConfigElement> list = new ArrayList<IConfigElement>(); List<IConfigElement> list = new ArrayList<IConfigElement>();
for(int i = 0; i < ConfigCategories.values().length; i++){ for(int i = 0; i < ConfigCategories.values().length; i++){
list.add(new ConfigElement<ConfigCategory>(ConfigurationHandler.config.getCategory(ConfigCategories.values()[i].name.toLowerCase()))); ConfigCategories cat = ConfigCategories.values()[i];
ConfigurationHandler.config.setCategoryComment(cat.name, cat.comment);
list.add(new ConfigElement<ConfigCategory>(ConfigurationHandler.config.getCategory(cat.name)));
} }
return list; return list;
} }