fix few oversights

This commit is contained in:
radimous 2024-12-04 17:33:44 +01:00
parent 096a5e764a
commit 5ee6a0100c
3 changed files with 14 additions and 11 deletions

View file

@ -204,8 +204,11 @@ public class Modifiers {
MutableComponent res = null;
if (modifierTiers.size() > 1) {
res = rangeComponent(atrName, atr, atrGenerator, minConfig, maxConfig);
if (res != null) {
return res;
}
}
if (res == null && minConfigDisplay != null) {
if (minConfigDisplay != null) {
res = minConfigDisplay.withStyle(atr.getReader().getColoredTextStyle());
if (minConfig instanceof AbilityLevelAttribute.Config minConfigAbility) {
return abilityLvlComponent(res, atr, minConfigAbility);

View file

@ -211,10 +211,10 @@ public class GearModifierScreen extends AbstractElementScreen {
.layout(this.translateWorldSpatial());
NineSliceButtonElement<?> btnMinus =
new NineSliceButtonElement<>(Spatials.positionXY(this.getGuiSpatial().width() - 72 - 13, 35).size(15, 14),
ScreenTextures.BUTTON_EMPTY_TEXTURES, lvlInput::increment).layout(this.translateWorldSpatial());
ScreenTextures.BUTTON_EMPTY_TEXTURES, lvlInput::decrement).layout(this.translateWorldSpatial());
NineSliceButtonElement<?> btnPlus =
new NineSliceButtonElement<>(Spatials.positionXY(this.getGuiSpatial().width() - 25 - 13, 35).size(15, 14),
ScreenTextures.BUTTON_EMPTY_TEXTURES, lvlInput::decrement).layout(this.translateWorldSpatial());
ScreenTextures.BUTTON_EMPTY_TEXTURES, lvlInput::increment).layout(this.translateWorldSpatial());
this.addElement(btnMinus);
this.addElement(minusLabel);
this.addElement(plusLabel);
@ -270,8 +270,8 @@ public class GearModifierScreen extends AbstractElementScreen {
if (keyCode == InputConstants.KEY_TAB && hasShiftDown()) {
switchTab((currIndex - 1 + Items.getVaultGearItems().size()) % Items.getVaultGearItems().size());
}
// alt to toggle legendary
if (keyCode == InputConstants.KEY_LALT || keyCode == InputConstants.KEY_RALT) {
// ctrl to change tier increase (normal, greater, legendary)
if (keyCode == InputConstants.KEY_LCONTROL || keyCode == InputConstants.KEY_RCONTROL) {
toggleLegend();
}
// ctrl + , to toggle compact +lvl to abilities

View file

@ -12,6 +12,11 @@ import net.minecraft.client.gui.Font;
public class ScrollableLvlInputElement extends TextInputElement<ScrollableLvlInputElement> {
public ScrollableLvlInputElement(ISpatial spatial, Font font) {
super(spatial, font);
this.adjustEditBox(editBox -> {
editBox.setFilter(s -> isValidLevel(parseInt(s)));
editBox.setMaxLength(3);
editBox.setValue(String.valueOf(VaultBarOverlay.vaultLevel));
});
}
@Override
@ -22,11 +27,6 @@ public class ScrollableLvlInputElement extends TextInputElement<ScrollableLvlInp
this.setInput(String.valueOf(val));
return true;
}
this.adjustEditBox(editBox -> {
editBox.setFilter(s -> isValidLevel(parseInt(s)));
editBox.setMaxLength(3);
editBox.setValue(String.valueOf(VaultBarOverlay.vaultLevel));
});
return super.onMouseScrolled(mouseX, mouseY, delta);
}