Fixes to config GUI, added new localization
This commit is contained in:
parent
3cfc21cc94
commit
3abf36ef14
4 changed files with 37 additions and 27 deletions
|
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import mekanism.common.Mekanism;
|
import mekanism.common.Mekanism;
|
||||||
|
import mekanism.common.util.MekanismUtils;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraftforge.common.config.ConfigElement;
|
import net.minecraftforge.common.config.ConfigElement;
|
||||||
import net.minecraftforge.common.config.Configuration;
|
import net.minecraftforge.common.config.Configuration;
|
||||||
|
@ -19,15 +19,15 @@ public class GuiMekanismConfig extends GuiConfig
|
||||||
public GuiMekanismConfig(GuiScreen parent)
|
public GuiMekanismConfig(GuiScreen parent)
|
||||||
{
|
{
|
||||||
super(parent, getConfigElements(),
|
super(parent, getConfigElements(),
|
||||||
"Mekanism", false, false, GuiConfig.getAbridgedConfigPath(Mekanism.configuration.toString()));
|
"Mekanism", false, false, "Mekanism");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<IConfigElement> getConfigElements()
|
private static List<IConfigElement> getConfigElements()
|
||||||
{
|
{
|
||||||
List<IConfigElement> list = new ArrayList<IConfigElement>();
|
List<IConfigElement> list = new ArrayList<IConfigElement>();
|
||||||
list.add(new DummyCategoryElement("Mekanism General Settings", "mekanism.configgui.ctgy.general", GeneralEntry.class));
|
list.add(new DummyCategoryElement(MekanismUtils.localize("mekanism.configgui.ctgy.general"), "mekanism.configgui.ctgy.general", GeneralEntry.class));
|
||||||
list.add(new DummyCategoryElement("Usage Settings", "mekanism.configgui.ctgy.usage", UsageEntry.class));
|
list.add(new DummyCategoryElement(MekanismUtils.localize("mekanism.configgui.ctgy.usage"), "mekanism.configgui.ctgy.usage", UsageEntry.class));
|
||||||
list.add(new DummyCategoryElement("Client Settings", "mekanism.configgui.ctgy.client", ClientEntry.class));
|
list.add(new DummyCategoryElement(MekanismUtils.localize("mekanism.configgui.ctgy.client"), "mekanism.configgui.ctgy.client", ClientEntry.class));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,9 +41,9 @@ public class GuiMekanismConfig extends GuiConfig
|
||||||
@Override
|
@Override
|
||||||
protected GuiScreen buildChildScreen()
|
protected GuiScreen buildChildScreen()
|
||||||
{
|
{
|
||||||
return new GuiConfig(this.owningScreen,
|
return new GuiConfig(owningScreen,
|
||||||
new ConfigElement(Mekanism.configuration.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(),
|
new ConfigElement(Mekanism.configuration.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(),
|
||||||
this.owningScreen.modID, Configuration.CATEGORY_GENERAL, false, false,
|
owningScreen.modID, Configuration.CATEGORY_GENERAL, false, false,
|
||||||
GuiConfig.getAbridgedConfigPath(Mekanism.configuration.toString()));
|
GuiConfig.getAbridgedConfigPath(Mekanism.configuration.toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,9 +58,9 @@ public class GuiMekanismConfig extends GuiConfig
|
||||||
@Override
|
@Override
|
||||||
protected GuiScreen buildChildScreen()
|
protected GuiScreen buildChildScreen()
|
||||||
{
|
{
|
||||||
return new GuiConfig(this.owningScreen,
|
return new GuiConfig(owningScreen,
|
||||||
new ConfigElement(Mekanism.configuration.getCategory("usage")).getChildElements(),
|
new ConfigElement(Mekanism.configuration.getCategory("usage")).getChildElements(),
|
||||||
this.owningScreen.modID, Configuration.CATEGORY_GENERAL, false, false,
|
owningScreen.modID, Configuration.CATEGORY_GENERAL, false, false,
|
||||||
GuiConfig.getAbridgedConfigPath(Mekanism.configuration.toString()));
|
GuiConfig.getAbridgedConfigPath(Mekanism.configuration.toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,9 +75,9 @@ public class GuiMekanismConfig extends GuiConfig
|
||||||
@Override
|
@Override
|
||||||
protected GuiScreen buildChildScreen()
|
protected GuiScreen buildChildScreen()
|
||||||
{
|
{
|
||||||
return new GuiConfig(this.owningScreen,
|
return new GuiConfig(owningScreen,
|
||||||
new ConfigElement(Mekanism.configuration.getCategory("client")).getChildElements(),
|
new ConfigElement(Mekanism.configuration.getCategory("client")).getChildElements(),
|
||||||
this.owningScreen.modID, "client", false, false,
|
owningScreen.modID, "client", false, false,
|
||||||
GuiConfig.getAbridgedConfigPath(Mekanism.configuration.toString()));
|
GuiConfig.getAbridgedConfigPath(Mekanism.configuration.toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ public class GuiGeneratorsConfig extends GuiConfig
|
||||||
public GuiGeneratorsConfig(GuiScreen parent)
|
public GuiGeneratorsConfig(GuiScreen parent)
|
||||||
{
|
{
|
||||||
super(parent, new ConfigElement(Mekanism.configuration.getCategory("generation")).getChildElements(),
|
super(parent, new ConfigElement(Mekanism.configuration.getCategory("generation")).getChildElements(),
|
||||||
"MekanismGenerators", false, false, GuiConfig.getAbridgedConfigPath(Mekanism.configuration.toString()));
|
"MekanismGenerators", false, false, "MekanismGenerators");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import mekanism.common.Mekanism;
|
import mekanism.common.Mekanism;
|
||||||
|
import mekanism.common.util.MekanismUtils;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraftforge.common.config.ConfigElement;
|
import net.minecraftforge.common.config.ConfigElement;
|
||||||
import net.minecraftforge.common.config.Configuration;
|
import net.minecraftforge.common.config.Configuration;
|
||||||
|
@ -22,15 +22,15 @@ public class GuiToolsConfig extends GuiConfig
|
||||||
public GuiToolsConfig(GuiScreen parent)
|
public GuiToolsConfig(GuiScreen parent)
|
||||||
{
|
{
|
||||||
super(parent, getConfigElements(),
|
super(parent, getConfigElements(),
|
||||||
"Mekanism", false, false, GuiConfig.getAbridgedConfigPath(Mekanism.configuration.toString()));
|
"MekanismTools", false, false, "MekanismTools");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<IConfigElement> getConfigElements()
|
private static List<IConfigElement> getConfigElements()
|
||||||
{
|
{
|
||||||
List<IConfigElement> list = new ArrayList<IConfigElement>();
|
List<IConfigElement> list = new ArrayList<IConfigElement>();
|
||||||
list.add(new DummyCategoryElement("General", "mekanism.configgui.ctgy.tools.general", GeneralEntry.class));
|
list.add(new DummyCategoryElement(MekanismUtils.localize("mekanism.configgui.ctgy.tools.general"), "mekanism.configgui.ctgy.tools.general", GeneralEntry.class));
|
||||||
list.add(new DummyCategoryElement("Armor Balance", "mekanism.configgui.ctgy.tools.armor", ArmorEntry.class));
|
list.add(new DummyCategoryElement(MekanismUtils.localize("mekanism.configgui.ctgy.tools.armor"), "mekanism.configgui.ctgy.tools.armor", ArmorEntry.class));
|
||||||
list.add(new DummyCategoryElement("Tools Balance", "mekanism.configgui.ctgy.tools.tools", ToolsEntry.class));
|
list.add(new DummyCategoryElement(MekanismUtils.localize("mekanism.configgui.ctgy.tools.tools"), "mekanism.configgui.ctgy.tools.tools", ToolsEntry.class));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,10 +44,10 @@ public class GuiToolsConfig extends GuiConfig
|
||||||
@Override
|
@Override
|
||||||
protected GuiScreen buildChildScreen()
|
protected GuiScreen buildChildScreen()
|
||||||
{
|
{
|
||||||
return new GuiConfig(this.owningScreen,
|
return new GuiConfig(owningScreen,
|
||||||
new ConfigElement(Mekanism.configuration.getCategory("tools.general")).getChildElements(),
|
new ConfigElement(Mekanism.configuration.getCategory("tools.general")).getChildElements(),
|
||||||
this.owningScreen.modID, Configuration.CATEGORY_GENERAL, this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart,
|
owningScreen.modID, Configuration.CATEGORY_GENERAL, configElement.requiresWorldRestart() || owningScreen.allRequireWorldRestart,
|
||||||
this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart,
|
configElement.requiresMcRestart() || owningScreen.allRequireMcRestart,
|
||||||
GuiConfig.getAbridgedConfigPath(Mekanism.configuration.toString()));
|
GuiConfig.getAbridgedConfigPath(Mekanism.configuration.toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,10 +62,10 @@ public class GuiToolsConfig extends GuiConfig
|
||||||
@Override
|
@Override
|
||||||
protected GuiScreen buildChildScreen()
|
protected GuiScreen buildChildScreen()
|
||||||
{
|
{
|
||||||
return new GuiConfig(this.owningScreen,
|
return new GuiConfig(owningScreen,
|
||||||
new ConfigElement(Mekanism.configuration.getCategory("tools.armor-balance")).getChildElements(),
|
new ConfigElement(Mekanism.configuration.getCategory("tools.armor-balance")).getChildElements(),
|
||||||
this.owningScreen.modID, Configuration.CATEGORY_GENERAL, this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart,
|
owningScreen.modID, Configuration.CATEGORY_GENERAL, configElement.requiresWorldRestart() || owningScreen.allRequireWorldRestart,
|
||||||
this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart,
|
configElement.requiresMcRestart() || owningScreen.allRequireMcRestart,
|
||||||
GuiConfig.getAbridgedConfigPath(Mekanism.configuration.toString()));
|
GuiConfig.getAbridgedConfigPath(Mekanism.configuration.toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,10 +80,10 @@ public class GuiToolsConfig extends GuiConfig
|
||||||
@Override
|
@Override
|
||||||
protected GuiScreen buildChildScreen()
|
protected GuiScreen buildChildScreen()
|
||||||
{
|
{
|
||||||
return new GuiConfig(this.owningScreen,
|
return new GuiConfig(owningScreen,
|
||||||
new ConfigElement(Mekanism.configuration.getCategory("tools.tool-balance")).getChildElements(),
|
new ConfigElement(Mekanism.configuration.getCategory("tools.tool-balance")).getChildElements(),
|
||||||
this.owningScreen.modID, Configuration.CATEGORY_GENERAL, this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart,
|
owningScreen.modID, Configuration.CATEGORY_GENERAL, configElement.requiresWorldRestart() || owningScreen.allRequireWorldRestart,
|
||||||
this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart,
|
configElement.requiresMcRestart() || owningScreen.allRequireMcRestart,
|
||||||
GuiConfig.getAbridgedConfigPath(Mekanism.configuration.toString()));
|
GuiConfig.getAbridgedConfigPath(Mekanism.configuration.toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -309,8 +309,14 @@ entity.Robit.name=Robit
|
||||||
entity.BabySkeleton.name=Baby Skeleton
|
entity.BabySkeleton.name=Baby Skeleton
|
||||||
|
|
||||||
//Config Gui
|
//Config Gui
|
||||||
|
mekanism.configgui.ctgy.general=Mekanism General Settings
|
||||||
|
mekanism.configgui.ctgy.usage=Usage Settings
|
||||||
|
mekanism.configgui.ctgy.client=Client Settings
|
||||||
|
|
||||||
|
//Config Tooltips
|
||||||
mekanism.configgui.ctgy.general.tooltip=General settings regarding Mekanism and all its modules
|
mekanism.configgui.ctgy.general.tooltip=General settings regarding Mekanism and all its modules
|
||||||
mekanism.configgui.ctgy.usage.tooltip=Settings regarding machinery and their energy usage
|
mekanism.configgui.ctgy.usage.tooltip=Settings regarding machinery and their energy usage
|
||||||
|
mekanism.configgui.ctgy.client.tooltip=Client-specific settings regarding Mekanism and all its modules
|
||||||
|
|
||||||
//Gui text
|
//Gui text
|
||||||
gui.removeSpeedUpgrade=Remove speed upgrade
|
gui.removeSpeedUpgrade=Remove speed upgrade
|
||||||
|
@ -791,6 +797,11 @@ item.SteelHoe.name=Steel Hoe
|
||||||
item.SteelSword.name=Steel Sword
|
item.SteelSword.name=Steel Sword
|
||||||
|
|
||||||
//Config Gui
|
//Config Gui
|
||||||
|
mekanism.configgui.ctgy.tools.general=General
|
||||||
|
mekanism.configgui.ctgy.tools.armor=Armor Balance
|
||||||
|
mekanism.configgui.ctgy.tools.tools=Tools Balance
|
||||||
|
|
||||||
|
//Config Tooltips
|
||||||
mekanism.configgui.ctgy.tools.general.tooltip=Settings regarding MekanismTools' general configuration
|
mekanism.configgui.ctgy.tools.general.tooltip=Settings regarding MekanismTools' general configuration
|
||||||
mekanism.configgui.ctgy.tools.armor.tooltip=Settings regarding the protection values and balance of MekanismTools armor sets
|
mekanism.configgui.ctgy.tools.armor.tooltip=Settings regarding the protection values and balance of MekanismTools armor sets
|
||||||
mekanism.configgui.ctgy.tools.tools.tooltip=Settings regarding the efficiency values and balance of MekanismTools tool sets
|
mekanism.configgui.ctgy.tools.tools.tooltip=Settings regarding the efficiency values and balance of MekanismTools tool sets
|
Loading…
Add table
Reference in a new issue