Skip to content

Commit

Permalink
fix: some UI issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Uhutown committed Jun 21, 2024
1 parent dde5c0b commit 1956b16
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public class ContainerSignalBox extends ContainerBase implements UIClientSync, I
private Consumer<List<Point>> signalUpdates;
private Runnable counterUpdater;
private Consumer<List<Point>> trainNumberUpdater;
private EntityPlayer player;

public ContainerSignalBox(final GuiInfo info) {
super(info);
Expand Down Expand Up @@ -491,8 +492,8 @@ public Map<BlockPos, LinkType> getPositionForTypes() {
public boolean canInteractWith(final EntityPlayer playerIn) {
if (tile.isBlocked() && !tile.isValid(playerIn))
return false;
if (this.info.player == null) {
this.info.player = playerIn;
if (this.player == null) {
this.player = playerIn;
this.tile.add(this);
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ private void initializeFieldTemplate(final BiConsumer<UIEntity, UISignalBoxTile>
plane.setWidth(TILE_COUNT * TILE_WIDTH);
plane.setHeight(TILE_COUNT * TILE_WIDTH);
splitter.add(new UIScroll(s -> {
final float newScale = (float) (plane.getScaleX() + s * 0.05f);
final float newScale = (float) (plane.getScaleX() + s * 0.001f);
if (newScale <= 0)
return;
plane.setScaleX(newScale);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public SidePanel(final UIEntity lowerEntity, final GuiSignalBox gui) {
helpPage.add(new UIBox(UIBox.VBOX, 2));

final UIRotate rotate = new UIRotate();
rotate.setRotateZ((float) Math.PI / 2.0f);
rotate.setRotateZ((float) 90);
label.add(rotate);
final UILabel labelComponent = new UILabel(I18Wrapper.format("info.infolabel"));
labelComponent.setTextColor(new UIEntity().getBasicTextColor());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static void initializeGrid(final UIEntity entity, final SignalBoxGrid gri
plane.setHeight(GuiSignalBox.TILE_COUNT * GuiSignalBox.TILE_WIDTH);
plane.setScale(0.5f);
splitter.add(new UIScroll(s -> {
final float newScale = (float) (plane.getScaleX() + s * 0.05f);
final float newScale = (float) (plane.getScaleX() + s * 0.001f);
if (newScale <= 0)
return;
plane.setScaleX(newScale);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private void localAdd(final ModeSet modeSet) {
final UIEntity entity = new UIEntity();
if (!modeSet.rotation.equals(Rotation.NONE)) {
final UIRotate rotation = new UIRotate();
rotation.setRotateZ(modeSet.rotation.ordinal() * ((float) Math.PI / 2.0f));
rotation.setRotateZ(modeSet.rotation.ordinal() * ((float) 90));
entity.add(rotation);
}
entity.add(new UIIndependentTranslate(0, 0, 1));
Expand Down

0 comments on commit 1956b16

Please sign in to comment.