Skip to content

Commit

Permalink
Fix and Upgrade Routing Node Amount Text Box
Browse files Browse the repository at this point in the history
Made the Routing Node Amount Textbox selectable again.  Fixes WayofTime#1980

Made the Text Box only selectable if a Ghost Filter Slot has been clicked.  Prevents players from typing in a value for nothing.

Added a Right-Click function to the text box.  This will clear it, set the ghost item value back to 0 ("Everything"), and select the Text Box for a new number.
  • Loading branch information
VT-14 committed Oct 1, 2023
1 parent 660a4aa commit 4251bd0
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,20 @@ public boolean mouseClicked(double mouseX, double mouseY, int mouseButton)
{
boolean testBool = super.mouseClicked(mouseX, mouseY, mouseButton);

if (this.textBox.mouseClicked(mouseX, mouseY, mouseButton))
{
return true;
if (container.lastGhostSlotClicked != -1) { // Text box only selectable if a ghost slot has been clicked.
if (this.textBox.mouseClicked(mouseX, mouseY, mouseButton)) { // Left-Clicked
this.textBox.setFocused(true);
return true;
}
if (this.textBox.isMouseOver(mouseX, mouseY) && mouseButton == 1) // Right-Clicked
{
this.textBox.setValue("");
setValueOfGhostItemInSlot(container.lastGhostSlotClicked, 0);
this.textBox.setFocused(true);
return true;
}
}
this.textBox.setFocused(false);

if (container.lastGhostSlotClicked != -1)
{
Expand Down

0 comments on commit 4251bd0

Please sign in to comment.