mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 19:19:43 +00:00
Implemented proper functionality for the quest party options GUI.
This commit is contained in:
1 parent
71a272a08b
commit
680fc98d51
5 files changed
+91
-23
No files matched your search
@@ -4,12 +4,14 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class GuiNpcButton extends GuiButton{
|
||||
|
||||
|
||||
protected String[] display;
|
||||
private int displayValue = 0;
|
||||
public int id;
|
||||
|
||||
|
||||
public GuiNpcButton(int i, int j, int k, String s) {
|
||||
super(i, j, k, StatCollector.translateToLocal(s));
|
||||
id = i;
|
||||
@@ -29,28 +31,42 @@ public class GuiNpcButton extends GuiButton{
|
||||
this.display = display;
|
||||
this.displayValue = display.length == 0?0:val % display.length;
|
||||
}
|
||||
|
||||
public GuiNpcButton(int i, int j, int k, int l, int m, Enum<?>[] displayEnums,
|
||||
int val) {
|
||||
this(i, j, k, l, m, displayEnums.length == 0 ? "" : displayEnums[val % displayEnums.length].toString());
|
||||
|
||||
ArrayList<String> strings = new ArrayList<>();
|
||||
for (Enum<?> e : displayEnums) {
|
||||
strings.add(e.toString());
|
||||
}
|
||||
|
||||
this.display = strings.toArray(new String[0]);
|
||||
this.displayValue = display.length == 0?0:val % display.length;
|
||||
}
|
||||
|
||||
public void setDisplayText(String text){
|
||||
this.displayString = StatCollector.translateToLocal(text);
|
||||
}
|
||||
public int getValue(){
|
||||
return displayValue;
|
||||
}
|
||||
|
||||
|
||||
public void setEnabled(boolean bo){
|
||||
this.enabled = bo;
|
||||
}
|
||||
public void setVisible(boolean b) {
|
||||
this.visible = b;
|
||||
}
|
||||
}
|
||||
public boolean getVisible() {
|
||||
return visible;
|
||||
}
|
||||
|
||||
|
||||
public void setDisplay(int value){
|
||||
this.displayValue = value;
|
||||
this.setDisplayText(display[value]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setTextColor(int color){
|
||||
this.packedFGColour = color;
|
||||
}
|
||||
@@ -65,7 +81,7 @@ public class GuiNpcButton extends GuiButton{
|
||||
}
|
||||
return bo;
|
||||
}
|
||||
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user