@@ -45,7 +45,7 @@ public class WaypointEditorScreen extends AbstractButtonListScreen {
45
45
private final Map <ResourceKey <Level >, Boolean > collapsed = new HashMap <>();
46
46
private final Map <ResourceKey <Level >, List <WaypointImpl >> waypoints = new HashMap <>();
47
47
private final Button buttonCollapseAll , buttonExpandAll ;
48
- private int widestWp = 0 ;
48
+ private int widestWaypoint = 0 ;
49
49
50
50
public WaypointEditorScreen () {
51
51
showBottomPanel (false );
@@ -56,19 +56,19 @@ public WaypointEditorScreen() {
56
56
waypoints .put (resourceKeyListEntry .getKey (), new ArrayList <>(resourceKeyListEntry .getValue ()));
57
57
}
58
58
59
- calcWidestWpText ();
59
+ computeWaypointTextWidth ();
60
60
61
61
buttonExpandAll = new SimpleButton (topPanel , List .of (Component .translatable ("gui.expand_all" ), hotkeyTooltip ("=" ), hotkeyTooltip ("+" )), Icons .UP ,
62
62
(widget , button ) -> toggleAll (true ));
63
63
buttonCollapseAll = new SimpleButton (topPanel , List .of (Component .translatable ("gui.collapse_all" ), hotkeyTooltip ("-" )), Icons .DOWN ,
64
64
(widget , button ) -> toggleAll (false ));
65
65
}
66
66
67
- private void calcWidestWpText () {
68
- widestWp = 0 ;
67
+ private void computeWaypointTextWidth () {
68
+ widestWaypoint = 0 ;
69
69
for (var dimKey : waypoints .entrySet ()) {
70
70
for (var wp : dimKey .getValue ()) {
71
- widestWp = Math .max (widestWp , getTheme ().getStringWidth (wp .getName ()));
71
+ widestWaypoint = Math .max (widestWaypoint , getTheme ().getStringWidth (wp .getName ()));
72
72
}
73
73
}
74
74
}
@@ -94,7 +94,7 @@ protected void doAccept() {
94
94
95
95
@ Override
96
96
public boolean onInit () {
97
- setWidth (Mth .clamp (widestWp + 80 , 220 , getScreen ().getGuiScaledWidth () * 4 / 5 ));
97
+ setWidth (Mth .clamp (widestWaypoint + 80 , 220 , getScreen ().getGuiScaledWidth () * 4 / 5 ));
98
98
setHeight (getScreen ().getGuiScaledHeight () * 4 / 5 );
99
99
return true ;
100
100
}
@@ -306,7 +306,7 @@ public boolean mousePressed(MouseButton button) {
306
306
if (accepted ) {
307
307
wp .setName (config .getValue ());
308
308
}
309
- calcWidestWpText ();
309
+ computeWaypointTextWidth ();
310
310
openGui ();
311
311
});
312
312
}));
0 commit comments