// Path: src/main/java/mnm/mods/itemdash/gui/dash/DashSettings.java
// public class DashSettings extends Dash {
// 
//     private final LiteModItemDash litemod = LiteModItemDash.getInstance();
//     private List<Supplier<Boolean>> focused = Lists.newArrayList();
// 
//     private List<Setting<?>> settings = Lists.newArrayList();
// 
//     public DashSettings(ItemDash itemdash) {
//         super(itemdash);
//         this.settings.add(new BoolSetting("Legacy IDs", litemod::setNumIds, litemod.isNumIds()));
//         this.settings.add(new BoolSetting("Survival Pick block", litemod::setSurvivalPick, litemod.isSurvivalPick()));
//         this.settings.add(new StringSetting(this, "Give Command", litemod::setGiveCommand, litemod.getGiveCommand())
//                 .preset("Vanilla", "/give {0} {1} {2} {3}")
//                 .preset("Essentials", "/i {1}:{3} {2}"));
//         this.settings.add(new OptionSetting<>("Sorting", litemod::setSort, litemod.getSort())
//                 .option(ItemSorter.DEFAULT, "Default")
//                 .option(ItemSorter.BY_ID, "By ID")
//                 .option(ItemSorter.BY_NAME, "By Name"));
//     }
// 
//     @Override
//     public void preRender(int mousex, int mousey) {
// 
//         int xPos = itemdash.xPos;
//         int yPos = itemdash.yPos;
// 
//         int lastHeight = 0;
//         int pos = yPos;
//         for (Setting<?> it : settings) {
//             it.setPos(xPos + 4, pos += lastHeight + 6);
//             lastHeight = it.height;
//         }
// 
//         this.settings.forEach(it -> it.draw(mousex, mousey));
//     }
// 
//     @Override
//     public void mouseClicked(int x, int y, int button) {
//         this.settings.forEach(it -> it.mouseClick(x, y, button));
//     }
// 
//     @Override
//     public void keyTyped(char key, int code) {
//         this.settings.forEach(it -> it.keyPush(key, code));
//     }
// 
//     @Override
//     public void onClose() {
//         LiteLoader.getInstance().writeConfig(litemod);
//         this.itemdash.dirty = true;
//     }
// 
//     @Override
//     public boolean isFocused() {
//         return this.focused.stream().anyMatch(Supplier::get);
//     }
// 
//     public void addFocus(Supplier<Boolean> focus) {
//         this.focused.add(focus);
//     }
// 
// }


import java.util.function.Consumer;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.mumfrey.liteloader.client.gui.GuiCheckbox;
import mnm.mods.itemdash.gui.dash.DashSettings;
import net.minecraft.client.gui.GuiTextField;
package mnm.mods.itemdash.setting;




public class StringSetting extends Setting<String> {

    private static final int W = 120;
    private static final int H = 15;

    private GuiTextField textBox;
    private BiMap<String, GuiCheckbox> presets = HashBiMap.create();

// Path: src/main/java/mnm/mods/itemdash/gui/dash/DashSettings.java
// public class DashSettings extends Dash {
// 
//     private final LiteModItemDash litemod = LiteModItemDash.getInstance();
//     private List<Supplier<Boolean>> focused = Lists.newArrayList();
// 
//     private List<Setting<?>> settings = Lists.newArrayList();
// 
//     public DashSettings(ItemDash itemdash) {
//         super(itemdash);
//         this.settings.add(new BoolSetting("Legacy IDs", litemod::setNumIds, litemod.isNumIds()));
//         this.settings.add(new BoolSetting("Survival Pick block", litemod::setSurvivalPick, litemod.isSurvivalPick()));
//         this.settings.add(new StringSetting(this, "Give Command", litemod::setGiveCommand, litemod.getGiveCommand())
//                 .preset("Vanilla", "/give {0} {1} {2} {3}")
//                 .preset("Essentials", "/i {1}:{3} {2}"));
//         this.settings.add(new OptionSetting<>("Sorting", litemod::setSort, litemod.getSort())
//                 .option(ItemSorter.DEFAULT, "Default")
//                 .option(ItemSorter.BY_ID, "By ID")
//                 .option(ItemSorter.BY_NAME, "By Name"));
//     }
// 
//     @Override
//     public void preRender(int mousex, int mousey) {
// 
//         int xPos = itemdash.xPos;
//         int yPos = itemdash.yPos;
// 
//         int lastHeight = 0;
//         int pos = yPos;
//         for (Setting<?> it : settings) {
//             it.setPos(xPos + 4, pos += lastHeight + 6);
//             lastHeight = it.height;
//         }
// 
//         this.settings.forEach(it -> it.draw(mousex, mousey));
//     }
// 
//     @Override
//     public void mouseClicked(int x, int y, int button) {
//         this.settings.forEach(it -> it.mouseClick(x, y, button));
//     }
// 
//     @Override
//     public void keyTyped(char key, int code) {
//         this.settings.forEach(it -> it.keyPush(key, code));
//     }
// 
//     @Override
//     public void onClose() {
//         LiteLoader.getInstance().writeConfig(litemod);
//         this.itemdash.dirty = true;
//     }
// 
//     @Override
//     public boolean isFocused() {
//         return this.focused.stream().anyMatch(Supplier::get);
//     }
// 
//     public void addFocus(Supplier<Boolean> focus) {
//         this.focused.add(focus);
//     }
// 
// }


// Path: src/main/java/mnm/mods/itemdash/setting/StringSetting.java
import java.util.function.Consumer;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.mumfrey.liteloader.client.gui.GuiCheckbox;
import mnm.mods.itemdash.gui.dash.DashSettings;
import net.minecraft.client.gui.GuiTextField;

package mnm.mods.itemdash.setting;




public class StringSetting extends Setting<String> {

    private static final int W = 120;
    private static final int H = 15;

    private GuiTextField textBox;
    private BiMap<String, GuiCheckbox> presets = HashBiMap.create();

    public StringSetting(DashSettings settings, String name, Consumer<String> apply, String current) {