Rename class appropriately

This commit is contained in:
somehussar committed 2024-05-21 02:16:25 +02:00
1 parent a42d0ac6e8
commit b2303dcaac
2 files changed
+16 -10

No files matched your search

@@ -36,7 +36,7 @@ public abstract class GuiNPCInterface extends GuiScreen
protected HashMap<Integer,GuiCustomScroll> scrolls = new HashMap<Integer,GuiCustomScroll>();
protected HashMap<Integer,GuiNpcSlider> sliders = new HashMap<Integer,GuiNpcSlider>();
protected HashMap<Integer,GuiScreen> extra = new HashMap<Integer,GuiScreen>();
protected HashMap<Integer, GuiScrollable> scrollableGuiInserts = new HashMap<>();
protected HashMap<Integer, GuiScrollableComponent> scrollableGuiInserts = new HashMap<>();
public String title;
private ResourceLocation background = null;
@@ -108,7 +108,7 @@ public abstract class GuiNPCInterface extends GuiScreen
extra.put(gui.id, gui);
}
public void addScrollableGui(int id, GuiScrollable gui){
public void addScrollableGui(int id, GuiScrollableComponent gui){
gui.setWorldAndResolution(mc, width, height);
gui.initGui();
scrollableGuiInserts.put(id, gui);
@@ -123,9 +123,9 @@ public abstract class GuiNPCInterface extends GuiScreen
if(tf.enabled)
tf.mouseClicked(i, j, k);
for(GuiScrollable guiScrollable : scrollableGuiInserts.values()) {
if(guiScrollable.isMouseOver(i, j))
guiScrollable.mouseClicked(i, j, k);
for(GuiScrollableComponent guiScrollableComponent : scrollableGuiInserts.values()) {
if(guiScrollableComponent.isMouseOver(i, j))
guiScrollableComponent.mouseClicked(i, j, k);
}
if (k == 0){
@@ -204,7 +204,7 @@ public abstract class GuiNPCInterface extends GuiScreen
return labels.get(i);
}
public GuiScrollable getScrollableGui(int i) {
public GuiScrollableComponent getScrollableGui(int i) {
return scrollableGuiInserts.get(i);
}
@@ -263,8 +263,8 @@ public abstract class GuiNPCInterface extends GuiScreen
button.drawHover(i, j, subGui);
}
}
for(GuiScrollable guiScrollable : scrollableGuiInserts.values()){
guiScrollable.drawScreen(i, j, f, guiScrollable.isMouseOver(i,j)?scrolled:0);
for(GuiScrollableComponent guiScrollableComponent : scrollableGuiInserts.values()){
guiScrollableComponent.drawScreen(i, j, f, guiScrollableComponent.isMouseOver(i,j)?scrolled:0);
}
if(subgui != null)
@@ -4,10 +4,11 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.util.ChatComponentText;
import noppes.npcs.entity.EntityNPCInterface;
import noppes.npcs.scripted.CustomNPCsException;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
public class GuiScrollable extends GuiNPCInterface{
public class GuiScrollableComponent extends GuiNPCInterface{
protected ScaledResolution scaledResolution;
public int clipWidth;
@@ -24,7 +25,7 @@ public class GuiScrollable extends GuiNPCInterface{
return a + lambda * (b - a);
}
public GuiScrollable(EntityNPCInterface npc, int posX, int posY, int clipWidth, int clipHeight, int maxScroll){
public GuiScrollableComponent(EntityNPCInterface npc, int posX, int posY, int clipWidth, int clipHeight, int maxScroll){
super(npc);
this.xPos = posX;
this.yPos = posY;
@@ -98,6 +99,11 @@ public class GuiScrollable extends GuiNPCInterface{
}
}
@Override
public void addScrollableGui(int id, GuiScrollableComponent d){
throw new CustomNPCsException("You can't put scrollable GUIs into a scrollable GUI");
}
@Override
public void buttonEvent(GuiButton button){
mc.thePlayer.addChatMessage(new ChatComponentText("LOL"));