char gui species name

This commit is contained in:
Sen 2025-03-30 21:15:22 +02:00
parent 5e20c6f90d
commit 40bd8d2758
2 changed files with 8 additions and 7 deletions

View file

@ -11,13 +11,13 @@ import game.init.SpeciesRegistry;
import game.packet.CPacketAction;
import game.renderer.Drawing;
public class GuiSpecies extends GuiList<GuiSpecies.SkinEntry> implements ActButton.Callback
public class GuiSpecies extends GuiList<GuiSpecies.SpeciesEntry> implements ActButton.Callback
{
protected class SkinEntry implements ListEntry
protected class SpeciesEntry implements ListEntry
{
private final SpeciesInfo species;
protected SkinEntry(SpeciesInfo species)
protected SpeciesEntry(SpeciesInfo species)
{
this.species = species;
}
@ -49,7 +49,7 @@ public class GuiSpecies extends GuiList<GuiSpecies.SkinEntry> implements ActButt
this.setDimensions(400, height, 32, height - 32);
this.elements.clear();
for(SpeciesInfo species : SpeciesRegistry.SPECIMEN) {
this.elements.add(new SkinEntry(species));
this.elements.add(new SpeciesEntry(species));
}
this.add(new NavButton(width - 198 * 2, height - 28, 194, 24, GuiChar.INSTANCE, "Zurück"));
this.selectButton = this.add(new ActButton(width - 198, height - 28, 194, 24, this, "Spezies ändern"));
@ -70,7 +70,7 @@ public class GuiSpecies extends GuiList<GuiSpecies.SkinEntry> implements ActButt
}
public void use(ActButton elem, Mode action) {
SkinEntry entry = this.getSelected();
SpeciesEntry entry = this.getSelected();
if(entry != null && GuiSpecies.this.gm.thePlayer != null)
GuiSpecies.this.gm.thePlayer.sendQueue.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_SPECIES, EntityRegistry.getEntityID(entry.species.clazz)));
}