mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-16 18:54:45 +00:00
Update buildscript & apply automatic formatting rules
This commit is contained in:
1 parent
a7683b885d
commit
f7a900e910
173 files changed
+4581
-5321
No files matched your search
@@ -1,20 +1,18 @@
|
||||
package codechicken.nei.config;
|
||||
|
||||
import static codechicken.lib.gui.GuiDraw.drawString;
|
||||
|
||||
import codechicken.lib.vec.Rectangle4i;
|
||||
import codechicken.nei.LayoutManager;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static codechicken.lib.gui.GuiDraw.drawString;
|
||||
|
||||
public abstract class OptionStringSet extends Option
|
||||
{
|
||||
public abstract class OptionStringSet extends Option {
|
||||
public final LinkedList<String> options = new LinkedList<>();
|
||||
public final Multimap<String, String> dependants = ArrayListMultimap.create();
|
||||
public final Map<String, String> dependancies = new HashMap<>();
|
||||
@@ -53,12 +51,10 @@ public abstract class OptionStringSet extends Option
|
||||
|
||||
@Override
|
||||
public List<String> handleTooltip(int mousex, int mousey, List<String> currenttip) {
|
||||
if (new Rectangle4i(4, 4, 50, 20).contains(mousex, mousey))
|
||||
currenttip.add(translateN(name + ".tip"));
|
||||
if (new Rectangle4i(4, 4, 50, 20).contains(mousex, mousey)) currenttip.add(translateN(name + ".tip"));
|
||||
int x = buttonX();
|
||||
for (String option : options) {
|
||||
if (new Rectangle4i(x, 0, 20, 20).contains(mousex, mousey))
|
||||
currenttip.add(translateN(name + "." + option));
|
||||
if (new Rectangle4i(x, 0, 20, 20).contains(mousex, mousey)) currenttip.add(translateN(name + "." + option));
|
||||
|
||||
x += 24;
|
||||
}
|
||||
@@ -67,8 +63,7 @@ public abstract class OptionStringSet extends Option
|
||||
|
||||
@Override
|
||||
public void mouseClicked(int x, int y, int button) {
|
||||
if (clickButton(x, y, button))
|
||||
playClickSound();
|
||||
if (clickButton(x, y, button)) playClickSound();
|
||||
}
|
||||
|
||||
public boolean clickButton(int mousex, int mousey, int button) {
|
||||
@@ -93,16 +88,13 @@ public abstract class OptionStringSet extends Option
|
||||
}
|
||||
|
||||
public void setValue(String s) {
|
||||
if (values().contains(s))
|
||||
return;
|
||||
if (values().contains(s)) return;
|
||||
|
||||
String dep = dependancies.get(s);
|
||||
if (dep != null)
|
||||
setValue(dep);
|
||||
if (dep != null) setValue(dep);
|
||||
|
||||
if (groups.containsKey(s)) {
|
||||
for (String grp : groups.get(s))
|
||||
setValue(grp);
|
||||
for (String grp : groups.get(s)) setValue(grp);
|
||||
} else {
|
||||
List<String> setUtils = new LinkedList<>(values());
|
||||
setUtils.add(s);
|
||||
@@ -111,12 +103,10 @@ public abstract class OptionStringSet extends Option
|
||||
}
|
||||
|
||||
public void remValue(String s) {
|
||||
for (String dep : dependants.get(s))
|
||||
remValue(dep);
|
||||
for (String dep : dependants.get(s)) remValue(dep);
|
||||
|
||||
if (groups.containsKey(s)) {
|
||||
for (String grp : groups.get(s))
|
||||
remValue(grp);
|
||||
for (String grp : groups.get(s)) remValue(grp);
|
||||
} else {
|
||||
List<String> values = new LinkedList<>(values());
|
||||
values.remove(s);
|
||||
@@ -127,8 +117,7 @@ public abstract class OptionStringSet extends Option
|
||||
public void setValues(List<String> values) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String s : values) {
|
||||
if (sb.length() > 0)
|
||||
sb.append(", ");
|
||||
if (sb.length() > 0) sb.append(", ");
|
||||
sb.append(s);
|
||||
}
|
||||
getTag().setValue(sb.toString());
|
||||
|
||||
Reference in new issue
Block a user