1
0
Fork 0

revert gui element height changes

This commit is contained in:
Sen 2025-09-04 12:00:11 +02:00
parent 6a663e5b6d
commit 45594e5b61
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
4 changed files with 103 additions and 90 deletions

View file

@ -278,7 +278,7 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
this.dimensions.add(dim);
}
this.waiting = true;
this.setDimensions(390, height, 32, height - 32);
this.setDimensions(390, height, BASE_HEIGHT + BASE_GAP * 2, height - BASE_HEIGHT - BASE_GAP * 2);
if(this.gm.getRenderManager().gm == null) {
this.unload();
this.adjust = null;
@ -286,7 +286,7 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
}
this.currentSkin = this.gm.player != null && !EntityTexManager.hasCustomSkin(this.gm.player.getId()) ? this.gm.player.getChar() : null;
this.load(this.gm.player == null ? ModelType.HUMANOID : this.gm.player.getModel(), this.gm.player != null ? this.gm.player.getSpecies() : SpeciesRegistry.CLASSES.get(EntityHuman.class));
this.add(new ActButton(2, 12, 193, 0, new ButtonCallback() {
this.add(new ActButton(2, BASE_GAP, 193, 0, new ButtonCallback() {
public void use(ActButton elem, PressType action) {
GuiChar.this.gm.showFileDialog(FileMode.FILE_LOAD_MULTI, "Skin konvertieren", TEXTURE_FOLDER, new FileCallback() {
public void selected(File file) {
@ -296,7 +296,7 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
});
}
}, "Importieren: Standard"));
this.add(new ActButton(197, 12, 193, 0, new ButtonCallback() {
this.add(new ActButton(197, BASE_GAP, 193, 0, new ButtonCallback() {
public void use(ActButton elem, PressType action) {
GuiChar.this.gm.showFileDialog(FileMode.FILE_LOAD_MULTI, "Skin konvertieren (schlank)", TEXTURE_FOLDER, new FileCallback() {
public void selected(File file) {
@ -306,13 +306,13 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
});
}
}, "Importieren: Schlank"));
this.addSelector("char_filter_species", 392, 12, 250, 0);
this.add(new ActButton(2, height - 30, 193, 0, new ButtonCallback() {
this.addSelector("char_filter_species", 392, BASE_GAP, 250, 0);
this.add(new ActButton(2, height - BASE_SHIFT, 193, 0, new ButtonCallback() {
public void use(ActButton elem, PressType action) {
GuiChar.this.gm.show(GuiChar.this);
}
}, "Neu laden"));
this.templateButton = this.add(new ActButton(197, height - 30, 193, 0, new ButtonCallback() {
this.templateButton = this.add(new ActButton(197, height - BASE_SHIFT, 193, 0, new ButtonCallback() {
public void use(ActButton elem, PressType action) {
SkinEntry skin = GuiChar.this.getSelected();
if(skin != null && skin.getLocation() != null) {
@ -346,64 +346,24 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
}
}
}, "Vorlage kopieren"));
if(width >= 784 + 460 && height >= 128 + 640)
this.adjust = this.add(new DragAdjust(width / 2 - 230, height - 64 - 640, 460, 640));
else
this.adjust = this.add(new DragAdjust(390 - 115 - 4, height - 32 - 160 - 4, 115, 160));
this.add(new Label(width - 390, 48, 388, "Spezies: " + (this.gm.player == null ? "<?>" : this.gm.player.getSpecies().name), true));
this.add(new NavButton(width - 390, 48, 388, 0, GuiSpecies.INSTANCE, "Spezies ändern"));
this.add(new Label(width - 390, 82, 388, "Klasse: " + (this.gm.player == null || this.gm.player.getSpecies().classEnum == null || this.gm.player.getNpcClass() == null || this.gm.player.getNpcClass().toString().isEmpty() ? "<Keine>" : this.gm.player.getNpcClass().toString()), true))
.enabled = this.gm.player != null && this.gm.player.getSpecies().classEnum != null;
this.add(new NavButton(width - 390, 82, 388, 0, GuiClass.INSTANCE, "Klasse ändern"))
.enabled = this.gm.player != null && this.gm.player.getSpecies().classEnum != null;
final ActButton[] alignBtns = new ActButton[Alignment.values().length];
for (int z = 0; z < Alignment.values().length; z++)
{
final Alignment align = Alignment.values()[z];
alignBtns[z] = this.add(new ActButton(width - 390 + (z % 3) * 130, height - 32 - 20 * 3 + 20 * (z / 3), 128, 0, new ButtonCallback() {
public void use(ActButton elem, PressType action) {
if(GuiChar.this.gm.player != null) {
GuiChar.this.waiting = false;
GuiChar.this.gm.player.client.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_ALIGN, align.ordinal()));
for(ActButton btn : alignBtns) {
btn.enabled = btn != elem;
}
}
}
}, align.color + align.display));
alignBtns[z].enabled = this.gm.player == null || this.gm.player.getAlignment() != align;
}
this.add(new Slider(width - 390, 136, 388, 0, 1, this.gm.player == null ? 120 : this.gm.player.getMinSize(), this.gm.player == null ? 320 : this.gm.player.getMaxSize(), this.gm.player == null ? 180 : this.gm.player.getDefaultSize(), this.gm.player == null ? 180 : this.gm.player.getCurrentSize(), new SliderCallback() {
public void use(Slider elem, int value) {
if(GuiChar.this.gm.player != null) {
GuiChar.this.waiting = false;
GuiChar.this.gm.player.client.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_HEIGHT, value));
}
}
}, "Spieler-Größe", "cm")).enabled = this.gm.player == null || this.gm.player.getMinSize() != this.gm.player.getMaxSize();
this.add(new Label(width - 390, 116, 388, "Name", true));
this.add(new Label(width - 390, 170, 388, "Beschreibung", true));
final Area descField = this.add(new Area(width - 390, 170, 388, height - 328, IPlayer.MAX_INFO_LENGTH, ""));
this.add(new ActButton(width - 195, height - 30, 193, 0, new ButtonCallback() {
public void use(ActButton elem, PressType action) {
if(GuiChar.this.gm.player != null) {
GuiChar.this.gm.show(new GuiLoading("Lade Welt ..."));
Dimension dim = GuiChar.this.dimensions.get(GuiChar.this.dimension);
GuiChar.this.gm.player.client.addToSendQueue(new CPacketMessage(CPacketMessage.Type.INFO, descField.getText()));
GuiChar.this.gm.player.client.addToSendQueue(new CPacketAction(CPacketAction.Action.CLOSE_EDITOR, DimensionMapping.getId(dim)));
}
}
}, "Charakter erstellen"));
this.cancelButton = this.add(new ActButton(width - 390, height - 30, 193, 0, new ButtonCallback() {
public void use(ActButton elem, PressType action) {
if(GuiChar.this.gm.player != null)
GuiChar.this.gm.show(GuiCharacters.INSTANCE);
}
}, "Abbrechen"));
this.setCharsAvailable();
this.add(new Field(width - 390, 116, 388, 0, IPlayer.MAX_NICK_LENGTH, new FieldCallback() {
if(width >= 784 + 460 && height >= 128 + 640)
this.adjust = this.add(new DragAdjust(width / 2 - 230, height - (BASE_HEIGHT + BASE_GAP * 2) * 2 - 640, 460, 640));
else
this.adjust = this.add(new DragAdjust(390 - 115 - 4, height - (BASE_HEIGHT + BASE_GAP * 2) - 160 - 4, 115, 160));
int y = BASE_HEIGHT + BASE_GAP * 2 + LABEL_SHIFT - BASE_SHIFT;
this.add(new Label(width - 390, y, 388, "Spezies: " + (this.gm.player == null ? "<?>" : this.gm.player.getSpecies().name), true));
this.add(new NavButton(width - 390, y, 388, 0, GuiSpecies.INSTANCE, "Spezies ändern"));
this.add(new Label(width - 390, y += LABEL_SHIFT, 388, "Klasse: " + (this.gm.player == null || this.gm.player.getSpecies().classEnum == null || this.gm.player.getNpcClass() == null || this.gm.player.getNpcClass().toString().isEmpty() ? "<Keine>" : this.gm.player.getNpcClass().toString()), true))
.enabled = this.gm.player != null && this.gm.player.getSpecies().classEnum != null;
this.add(new NavButton(width - 390, y, 388, 0, GuiClass.INSTANCE, "Klasse ändern"))
.enabled = this.gm.player != null && this.gm.player.getSpecies().classEnum != null;
this.add(new Label(width - 390, y += LABEL_SHIFT, 388, "Name", true));
this.add(new Field(width - 390, y, 388, 0, IPlayer.MAX_NICK_LENGTH, new FieldCallback() {
public void use(Field elem, FieldAction value) {
if(value == FieldAction.SEND || value == FieldAction.UNFOCUS) {
String name = elem.getText();
@ -416,21 +376,17 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
}
}
}, IPlayer.VALID_NICK, this.gm.player == null ? "" : this.gm.player.getCustomNameTag()));
this.templateButton.enabled = false;
this.dimension = new Random().zrange(this.dimensions.size());
EntityInfo info = EntityRegistry.DNA.get(this.gm.player == null ? EntityRegistry.getEntityString(EntityHuman.class) : EntityRegistry.getEntityString(this.gm.player));
if(info != null && info.origin() != null) {
Dimension dim = DimensionMapping.getDimension(info.origin());
if(dim != null) {
for(int z = 0; z < this.dimensions.size(); z++) {
if(this.dimensions.get(z) == dim) {
this.dimension = z;
break;
}
}
}
}
this.dimButton = this.add(new ActButton(width - 390, height - 156, 388, 0, new ButtonCallback() {
this.add(new Slider(width - 390, y += SEPARATOR_SHIFT, 388, 0, 1, this.gm.player == null ? 120 : this.gm.player.getMinSize(), this.gm.player == null ? 320 : this.gm.player.getMaxSize(), this.gm.player == null ? 180 : this.gm.player.getDefaultSize(), this.gm.player == null ? 180 : this.gm.player.getCurrentSize(), new SliderCallback() {
public void use(Slider elem, int value) {
if(GuiChar.this.gm.player != null) {
GuiChar.this.waiting = false;
GuiChar.this.gm.player.client.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_HEIGHT, value));
}
}
}, "Spieler-Größe", "cm")).enabled = this.gm.player == null || this.gm.player.getMinSize() != this.gm.player.getMaxSize();
this.dimButton = this.add(new ActButton(width - 390, y += SEPARATOR_SHIFT, 388, 0, new ButtonCallback() {
public void use(ActButton elem, PressType mode) {
if(mode == PressType.TERTIARY) {
GuiChar.this.dimension = new Random().zrange(GuiChar.this.dimensions.size());
@ -446,7 +402,64 @@ public class GuiChar extends GuiList<GuiChar.SkinEntry>
GuiChar.this.setDimButton();
}
}, ""));
this.descLines = this.add(new MultiLabel(width - 390, height - 156 + BASE_HEIGHT, 388, 42, "", true));
this.descLines = this.add(new MultiLabel(width - 390, y + BASE_HEIGHT, 388, 42, "", true));
this.add(new Label(width - 390, y += LABEL_SHIFT + 42, 388, "Ausrichtung", true));
final ActButton[] alignBtns = new ActButton[Alignment.values().length];
for (int z = 0; z < Alignment.values().length; z++)
{
if(z != 0 && z % 3 == 0)
y += BASE_SHIFT;
final Alignment align = Alignment.values()[z];
alignBtns[z] = this.add(new ActButton(width - 390 + (z % 3) * 130, y, 128, 0, new ButtonCallback() {
public void use(ActButton elem, PressType action) {
if(GuiChar.this.gm.player != null) {
GuiChar.this.waiting = false;
GuiChar.this.gm.player.client.addToSendQueue(new CPacketAction(CPacketAction.Action.SET_ALIGN, align.ordinal()));
for(ActButton btn : alignBtns) {
btn.enabled = btn != elem;
}
}
}
}, align.color + align.display));
alignBtns[z].enabled = this.gm.player == null || this.gm.player.getAlignment() != align;
}
this.add(new Label(width - 390, y += LABEL_SHIFT, 388, "Beschreibung", true));
final Area descField = this.add(new Area(width - 390, y, 388, height - y - BASE_HEIGHT - BASE_GAP * 3, IPlayer.MAX_INFO_LENGTH, ""));
this.add(new ActButton(width - 195, height - BASE_SHIFT, 193, 0, new ButtonCallback() {
public void use(ActButton elem, PressType action) {
if(GuiChar.this.gm.player != null) {
GuiChar.this.gm.show(new GuiLoading("Lade Welt ..."));
Dimension dim = GuiChar.this.dimensions.get(GuiChar.this.dimension);
GuiChar.this.gm.player.client.addToSendQueue(new CPacketMessage(CPacketMessage.Type.INFO, descField.getText()));
GuiChar.this.gm.player.client.addToSendQueue(new CPacketAction(CPacketAction.Action.CLOSE_EDITOR, DimensionMapping.getId(dim)));
}
}
}, "Charakter erstellen"));
this.cancelButton = this.add(new ActButton(width - 390, height - BASE_SHIFT, 193, 0, new ButtonCallback() {
public void use(ActButton elem, PressType action) {
if(GuiChar.this.gm.player != null)
GuiChar.this.gm.show(GuiCharacters.INSTANCE);
}
}, "Abbrechen"));
this.setCharsAvailable();
this.templateButton.enabled = false;
this.dimension = new Random().zrange(this.dimensions.size());
EntityInfo info = EntityRegistry.DNA.get(this.gm.player == null ? EntityRegistry.getEntityString(EntityHuman.class) : EntityRegistry.getEntityString(this.gm.player));
if(info != null && info.origin() != null) {
Dimension dim = DimensionMapping.getDimension(info.origin());
if(dim != null) {
for(int z = 0; z < this.dimensions.size(); z++) {
if(this.dimensions.get(z) == dim) {
this.dimension = z;
break;
}
}
}
}
this.setDimButton();
}

View file

@ -72,7 +72,7 @@ public class GuiCharacters extends GuiList<GuiCharacters.CharacterEntry> impleme
public void init(int width, int height)
{
super.init(width, height);
this.setDimensions(width - 300, height, 32, height - 32);
this.setDimensions(width - 300, height, BASE_HEIGHT + BASE_GAP * 2, height - BASE_HEIGHT - BASE_GAP * 2);
this.elements.clear();
int selected = this.gm.selectedCharacter;
for(PlayerCharacter character : this.gm.characterList) {
@ -81,10 +81,10 @@ public class GuiCharacters extends GuiList<GuiCharacters.CharacterEntry> impleme
if(!this.gm.charEditor)
this.elements.add(new CharacterEntry(null, false));
this.setSelected(ExtMath.clampi(selected, -1, this.elements.size() - 1));
this.descField = this.add(new Area(width - 300, 32, 300, height - 64, ""));
this.deleteButtom = this.add(new ActButton(width / 2 - 302, height - 30, 200, 0, this, "Charakter löschen"));
this.actionButtom = this.add(new ActButton(width / 2 - 100, height - 30, 200, 0, this, ""));
this.add(new NavButton(width / 2 + 102, height - 30, 200, 0, this.gm.charEditor ? GuiChar.INSTANCE : GuiMenu.INSTANCE, this.gm.charEditor ? "Zurück" : "Abbrechen"));
this.descField = this.add(new Area(width - 300, BASE_HEIGHT + BASE_GAP * 2, 300, height - (BASE_HEIGHT + BASE_GAP * 2) * 2, ""));
this.deleteButtom = this.add(new ActButton(width / 2 - 302, height - BASE_SHIFT, 200, 0, this, "Charakter löschen"));
this.actionButtom = this.add(new ActButton(width / 2 - 100, height - BASE_SHIFT, 200, 0, this, ""));
this.add(new NavButton(width / 2 + 102, height - BASE_SHIFT, 200, 0, this.gm.charEditor ? GuiChar.INSTANCE : GuiMenu.INSTANCE, this.gm.charEditor ? "Zurück" : "Abbrechen"));
this.updateButtons();
}

View file

@ -44,14 +44,14 @@ public class GuiClass extends GuiList<GuiClass.ClassEntry> implements ButtonCall
public void init(int width, int height)
{
super.init(width, height);
this.setDimensions(width, height, 32, height - 32);
this.setDimensions(width, height, BASE_HEIGHT + BASE_GAP * 2, height - BASE_HEIGHT - BASE_GAP * 2);
this.elements.clear();
if(this.gm.player != null && this.gm.player.getSpecies().classEnum != null)
for(Enum clazz : this.gm.player.getSpecies().classEnum.getEnumConstants()) {
this.elements.add(new ClassEntry(clazz));
}
this.add(new NavButton(width / 2 - 195, height - 30, 194, 0, GuiChar.INSTANCE, "Zurück"));
this.selectButton = this.add(new ActButton(width / 2 + 1, height - 30, 194, 0, this, "Klasse ändern"));
this.add(new NavButton(width / 2 - BASE_WIDTH - BASE_GAP / 2, height - BASE_SHIFT, 0, 0, GuiChar.INSTANCE, "Zurück"));
this.selectButton = this.add(new ActButton(width / 2 + BASE_GAP / 2, height - BASE_SHIFT, 0, 0, this, "Klasse ändern"));
}
public String getTitle() {

View file

@ -49,13 +49,13 @@ public class GuiSpecies extends GuiList<GuiSpecies.SpeciesEntry> implements Butt
public void init(int width, int height)
{
super.init(width, height);
this.setDimensions(width, height, 32, height - 32);
this.setDimensions(width, height, BASE_HEIGHT + BASE_GAP * 2, height - BASE_HEIGHT - BASE_GAP * 2);
this.elements.clear();
for(SpeciesInfo species : SpeciesRegistry.SPECIMEN) {
this.elements.add(new SpeciesEntry(species));
}
this.add(new NavButton(width / 2 - 195, height - 30, 194, 0, GuiChar.INSTANCE, "Zurück"));
this.selectButton = this.add(new ActButton(width / 2 + 1, height - 30, 194, 0, this, "Spezies ändern"));
this.add(new NavButton(width / 2 - BASE_WIDTH - BASE_GAP / 2, height - BASE_SHIFT, 0, 0, GuiChar.INSTANCE, "Zurück"));
this.selectButton = this.add(new ActButton(width / 2 + BASE_GAP / 2, height - BASE_SHIFT, 0, 0, this, "Spezies ändern"));
}
public String getTitle() {