Ah effectivement, je n’avais pas pensé à regarde là, merci. Je vais essayer.
EDIT: Donc mon code ressemble à ça:
Mon GuiTest:
package diabolicatrix.project;
import java.util.ArrayList;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import fr.altiscraft.altiscraft.common.GuiInv;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.inventory.GuiContainerCreative;
import net.minecraft.client.renderer.InventoryEffectRenderer;
import net.minecraft.client.resources.I18n;
import net.minecraft.inventory.ContainerChest;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryBasic;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
public class GuiTest extends GuiScreen
{
private boolean needsScrollBars;
private float currentScroll = 0;
private boolean isScrolling;
private boolean wasClicking;
private boolean mouseClicked;
private ArrayList invList;
private boolean hasScrollBar = true;
private GuiScrollingTest scroll;
private int xSize = 194;
private int ySize = 135;
public GuiTest()
{
this.allowUserInput = true;
}
public void initGui()
{
this.scroll = new GuiScrollingTest(40, this, 130, 90);
this.scroll.registerScrollButtons(GuiInv.list, 12, 13);
super.initGui();
}
public void drawScreen(int x, int y, float ticks)
{
this.drawDefaultBackground();
this.scroll.drawScreen(x, y, ticks);
super.drawScreen(x, y, ticks);
}
public boolean doesGuiPauseGame()
{
return false;
}
}
Mon GuiScroll:
package diabolicatrix.project;
import cpw.mods.fml.client.GuiScrollingList;
import fr.altiscraft.altiscraft.common.GuiInv;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
public class GuiScrollingTest extends GuiScrollingList {
private GuiTest parent;
public GuiScrollingTest(int width, GuiTest parent, int left, int top) {
super(parent.mc, width, parent.height, top, parent.height - 84, left, 20);
this.parent = parent;
}
@Override
protected int getSize() {
return GuiInv.list.size();
}
@Override
protected void elementClicked(int index, boolean doubleClick) {
}
@Override
protected boolean isSelected(int index) {
return false;
}
@Override
protected void drawBackground() {
}
@Override
protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) {
}
}
Et ça donne ça:
:::
:::
Mon problème vient surement du drawSlot, mais je ne comprend pas l’utilité de celui-ci. Avec son nom j’imaginais que c’était pour dessiner la list, mais Scarex dessinait un string.