Skip to content

Commit

Permalink
Fixed text colour of int-like Property not white after clicking + or -
Browse files Browse the repository at this point in the history
  • Loading branch information
brentmaas committed Jul 19, 2021
1 parent 889da28 commit e15583b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/brentmaas/buildguide/property/PropertyInt.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ public PropertyInt(int x, int y, int value, TextComponent name, Runnable onUpdat
buttonList.add(new Button(x + 90, y, 20, 20, new StringTextComponent("-"), button -> {
--this.value;
valueWidget.setText("" + this.value);
valueWidget.setTextColor(0xFFFFFF);
if(onUpdate != null) onUpdate.run();
}));
buttonList.add(new Button(x + 190, y, 20, 20, new StringTextComponent("+"), button -> {
++this.value;
valueWidget.setText("" + this.value);
valueWidget.setTextColor(0xFFFFFF);
if(onUpdate != null) onUpdate.run();
}));
buttonList.add(new Button(x + 160, y, 30, 20, new TranslationTextComponent("screen.buildguide.set"), button -> {
Expand All @@ -43,6 +45,7 @@ public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partia
public void setValue(Integer value) {
super.setValue(value);
valueWidget.setText("" + value);
valueWidget.setTextColor(0xFFFFFF);
}

public void addTextFields(FontRenderer fr) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ public PropertyMinimumInt(int x, int y, int value, TextComponent name, Runnable
buttonList.add(new Button(x + 90, y, 20, 20, new StringTextComponent("-"), button -> {
if(this.value > this.minInt) --this.value;
valueWidget.setText("" + this.value);
valueWidget.setTextColor(0xFFFFFF);
if(onUpdate != null) onUpdate.run();
}));
buttonList.add(new Button(x + 190, y, 20, 20, new StringTextComponent("+"), button -> {
++this.value;
valueWidget.setText("" + this.value);
valueWidget.setTextColor(0xFFFFFF);
if(onUpdate != null) onUpdate.run();
}));
buttonList.add(new Button(x + 160, y, 30, 20, new TranslationTextComponent("screen.buildguide.set"), button -> {
Expand All @@ -50,6 +52,7 @@ public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partia
public void setValue(Integer value) {
super.setValue(value);
valueWidget.setText("" + value);
valueWidget.setTextColor(0xFFFFFF);
}

public void addTextFields(FontRenderer fr) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ public PropertyNonzeroInt(int x, int y, int value, TextComponent name, Runnable
--this.value;
if(this.value == 0) --this.value;
valueWidget.setText("" + this.value);
valueWidget.setTextColor(0xFFFFFF);
if(onUpdate != null) onUpdate.run();
}));
buttonList.add(new Button(x + 190, y, 20, 20, new StringTextComponent("+"), button -> {
++this.value;
if(this.value == 0) ++this.value;
valueWidget.setText("" + this.value);
valueWidget.setTextColor(0xFFFFFF);
if(onUpdate != null) onUpdate.run();
}));
buttonList.add(new Button(x + 160, y, 30, 20, new TranslationTextComponent("screen.buildguide.set"), button -> {
Expand All @@ -50,6 +52,7 @@ public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partia
public void setValue(Integer value) {
super.setValue(value);
valueWidget.setText("" + value);
valueWidget.setTextColor(0xFFFFFF);
}

public void addTextFields(FontRenderer fr) {
Expand Down

0 comments on commit e15583b

Please sign in to comment.