Skip to content

Added time input calculator#2189

Open
NamelessJu wants to merge 5 commits into
SkyblockerMod:mainfrom
NamelessJu:master
Open

Added time input calculator#2189
NamelessJu wants to merge 5 commits into
SkyblockerMod:mainfrom
NamelessJu:master

Conversation

@NamelessJu
Copy link
Copy Markdown

Currently the AH duration input uses the regular input calculator, which shows errors on valid time inputs such as "2d".
This time calculator fixes this by displaying the entered amount of time instead:

Screenshot 2026-03-02 001719
(Correctly uses the time unit selected in the AH menu by default, so either hours or minutes)

It also allows for inputting multiple time units along with comma values:

Screenshot 2026-03-02 001514

Also converts whatever is entered into a cleaner format:

Screenshot 2026-03-02 001554
(I did a quick test and the auction house actually allows and correctly uses values like this, even though it only shows the highest unit entered in the auction creation screen)

+ I added config values for this new calculator:

  • enabled (default: true)
  • close sign on enter (default: true)

I also added a German translation for this, but I am not sure how exactly how you handle translations so I made it a separate commit to disconnect it from the core feature implementation

@LifeIsAParadox LifeIsAParadox added the reviews needed This PR needs reviews label Mar 2, 2026
@NamelessJu
Copy link
Copy Markdown
Author

My bad, I only now found out about the checkstyle gradle tasks. Should be fine now (hopefully)

@NamelessJu
Copy link
Copy Markdown
Author

And we try again (sorry), I ran a full successful build on my end now (don't know why I didn't do this earlier)

@AzureAaron AzureAaron added the new feature This issue or PR is a new feature label Mar 6, 2026
Copy link
Copy Markdown
Collaborator

@kevinthegreat1 kevinthegreat1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't particularly like the extra config, but I'll see if anyone else has anything to say before approving. Also some unit tests would be nice.

Comment on lines +53 to +57
if (numberString.startsWith("-")) {
seconds = -1;
error = Component.translatable("skyblocker.config.uiAndVisuals.timeInputCalculator.invalidNumberError", numberString).withStyle(ChatFormatting.RED);
return;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice negative time (your regex doesn't allow this btw).

Comment on lines +39 to +40
if (message.equals(lastInput)) return;
lastInput = message;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to check time type as well instead of just last input?

@LifeIsAParadox LifeIsAParadox added merge conflicts This PR has merge conflicts that need solving. and removed reviews needed This PR needs reviews labels Apr 20, 2026
@viciscat
Copy link
Copy Markdown
Collaborator

I don't particularly like the extra config, but I'll see if anyone else has anything to say before approving.

It is a bit redundant but I don't really mind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflicts This PR has merge conflicts that need solving. new feature This issue or PR is a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants