Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat rule location config overhaul #1138

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Emirlol
Copy link
Collaborator

@Emirlol Emirlol commented Jan 16, 2025

Changes the string of locations to a checkbox list for each location instead.
It's basically the powder filter screen copied over to locations.

image

image

@LifeIsAParadox LifeIsAParadox added the reviews needed This PR needs reviews label Jan 16, 2025
@Emirlol
Copy link
Collaborator Author

Emirlol commented Jan 16, 2025

Probably needs some sort of migration from the old config to the new config, that part is not done yet

CheckboxWidget.builder(Text.of(item), client.textRenderer)
.checked(!filters.contains(item))
CheckboxWidget.builder(Text.of(item.toString()), client.textRenderer)
.checked(whitelist == filters.contains(item))
.callback((checkbox1, checked) -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

this if (checked) needs to be flipped when the white list is enabled so instead you would want: (checked == !whitelist)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This part is correct, inverting it causes the config to save unchecked locations as valid locations instead. The issue was the callback logic not changing according to whitelist/blacklist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reviews needed This PR needs reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants