Record Class WidgetLayoutConfig
java.lang.Object
java.lang.Record
johnsmith.enchantingoverhauled.client.gui.widget.enchant.WidgetLayoutConfig
- Record Components:
- The overall width of the enchantment slot background button.- The overall height of the enchantment slot background button.costWidth- The width of the lapis cost sprite indicator.costHeight- The height of the lapis cost sprite indicator.costXOffset- The internal X offset relative to the button origin for the cost sprite.costYOffset- The internal Y offset relative to the button origin for the cost sprite.powerXOffset- The internal X offset for the required XP power text.powerYOffset- The internal Y offset for the required XP power text.textXOffset- The internal X offset for the enchantment's name component.textYOffset- The internal Y offset for the enchantment's name component.textMaxWidth- The maximum pixel width allowed before the text wraps/truncates.
public record WidgetLayoutConfig(int buttonWidth, int buttonHeight, int costWidth, int costHeight, int costXOffset, int costYOffset, int powerXOffset, int powerYOffset, int textXOffset, int textYOffset, int textMaxWidth)
extends Record
A configuration record encapsulating all static positioning and dimensional constants
for the structural rendering of an
EnchantWidget.
Extracted to avoid magic numbers and facilitate centralized UI scaling adjustments.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final WidgetLayoutConfigThe standard default layout definitions matching the vanilla enchanting UI proportions. -
Constructor Summary
ConstructorsConstructorDescriptionWidgetLayoutConfig(int buttonWidth, int buttonHeight, int costWidth, int costHeight, int costXOffset, int costYOffset, int powerXOffset, int powerYOffset, int textXOffset, int textYOffset, int textMaxWidth) Creates an instance of aWidgetLayoutConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thebuttonHeightrecord component.intReturns the value of thebuttonWidthrecord component.intReturns the value of thecostHeightrecord component.intReturns the value of thecostWidthrecord component.intReturns the value of thecostXOffsetrecord component.intReturns the value of thecostYOffsetrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thepowerXOffsetrecord component.intReturns the value of thepowerYOffsetrecord component.intReturns the value of thetextMaxWidthrecord component.intReturns the value of thetextXOffsetrecord component.intReturns the value of thetextYOffsetrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT
The standard default layout definitions matching the vanilla enchanting UI proportions.
-
-
Constructor Details
-
WidgetLayoutConfig
public WidgetLayoutConfig(int buttonWidth, int buttonHeight, int costWidth, int costHeight, int costXOffset, int costYOffset, int powerXOffset, int powerYOffset, int textXOffset, int textYOffset, int textMaxWidth) Creates an instance of aWidgetLayoutConfigrecord class.- Parameters:
buttonWidth- the value for thebuttonWidthrecord componentbuttonHeight- the value for thebuttonHeightrecord componentcostWidth- the value for thecostWidthrecord componentcostHeight- the value for thecostHeightrecord componentcostXOffset- the value for thecostXOffsetrecord componentcostYOffset- the value for thecostYOffsetrecord componentpowerXOffset- the value for thepowerXOffsetrecord componentpowerYOffset- the value for thepowerYOffsetrecord componenttextXOffset- the value for thetextXOffsetrecord componenttextYOffset- the value for thetextYOffsetrecord componenttextMaxWidth- the value for thetextMaxWidthrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
buttonWidth
public int buttonWidth()Returns the value of thebuttonWidthrecord component.- Returns:
- the value of the
buttonWidthrecord component
-
buttonHeight
public int buttonHeight()Returns the value of thebuttonHeightrecord component.- Returns:
- the value of the
buttonHeightrecord component
-
costWidth
public int costWidth()Returns the value of thecostWidthrecord component.- Returns:
- the value of the
costWidthrecord component
-
costHeight
public int costHeight()Returns the value of thecostHeightrecord component.- Returns:
- the value of the
costHeightrecord component
-
costXOffset
public int costXOffset()Returns the value of thecostXOffsetrecord component.- Returns:
- the value of the
costXOffsetrecord component
-
costYOffset
public int costYOffset()Returns the value of thecostYOffsetrecord component.- Returns:
- the value of the
costYOffsetrecord component
-
powerXOffset
public int powerXOffset()Returns the value of thepowerXOffsetrecord component.- Returns:
- the value of the
powerXOffsetrecord component
-
powerYOffset
public int powerYOffset()Returns the value of thepowerYOffsetrecord component.- Returns:
- the value of the
powerYOffsetrecord component
-
textXOffset
public int textXOffset()Returns the value of thetextXOffsetrecord component.- Returns:
- the value of the
textXOffsetrecord component
-
textYOffset
public int textYOffset()Returns the value of thetextYOffsetrecord component.- Returns:
- the value of the
textYOffsetrecord component
-
textMaxWidth
public int textMaxWidth()Returns the value of thetextMaxWidthrecord component.- Returns:
- the value of the
textMaxWidthrecord component
-