mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-19 03:49:12 +00:00
Stop auto-creating NEI config files, add export buttons instead (#1104)
This commit is contained in:
1 parent
c1a525594c
commit
aea4c2866a
16 files changed
+247
-217
No files matched your search
@@ -0,0 +1,42 @@
|
||||
package codechicken.nei.config;
|
||||
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
|
||||
import codechicken.nei.ClientHandler;
|
||||
import codechicken.nei.NEIClientUtils;
|
||||
|
||||
public class OptionExportConfig extends OptionButton {
|
||||
|
||||
private final String fileName;
|
||||
|
||||
public OptionExportConfig(String fileName) {
|
||||
super("tools.export_configs." + fileName.substring(0, fileName.lastIndexOf('.')));
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPrefix() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return translateN("tools.export_configs.button");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onClick(int button) {
|
||||
final boolean exported = ClientHandler.exportDefaultConfig(fileName);
|
||||
|
||||
NEIClientUtils.printChatMessage(
|
||||
new ChatComponentTranslation(
|
||||
exported ? "nei.options.tools.export_configs.done" : "nei.options.tools.export_configs.skipped",
|
||||
fileName));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user