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

Per Slot Text Toggle #1043

Merged
merged 6 commits into from
Jan 5, 2025
Merged

Conversation

viciscat
Copy link
Collaborator

@viciscat viciscat commented Nov 3, 2024

Moved Slot Text config to UI & Visuals and allowed configuring each adder individually

Adders just need to override a method that returns a ConfigInformation record.

Also I wanted to add a data fixer to move things but couldn't manage to do that :(

image

@LifeIsAParadox LifeIsAParadox added the reviews needed This PR needs reviews label Nov 3, 2024
Copy link
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.

The code looks fine. I am wondering if all that ConfigInformation is needed instead of just an id but should be fine.

Also cc @Emirlol if he wants to look at the api. The system is that SlotTextAdder gets config information from each slot text adder instance, than calls SlotTextManager with the config information to get whether it's enabled.

@Emirlol
Copy link
Collaborator

Emirlol commented Nov 4, 2024

Looks pretty good. 2 things though:

  • Perhaps the ConfigInformation could be stored in SimpleSlotTextAdder, which is passed in with the constructor with a default overriding method to retrieve it rather than each class handling it by itself.
  • The way that the default value of true for enabled is hardcoded in multiple places (the createSlotTextToggles method and the getOrDefault calls) rather than just handing the value from the default config kinda feels unnecessary.

@viciscat
Copy link
Collaborator Author

Added constructor to SimpleSlotTextAdder
But I don't see what you mean for the defaults, the getOrDefault call is there in case it's null. And if there's a config default it won't be null, so it will take that.

@LifeIsAParadox LifeIsAParadox added merge conflicts This PR has merge conflicts that need solving. and removed reviews needed This PR needs reviews labels Dec 22, 2024
@LifeIsAParadox LifeIsAParadox added reviews needed This PR needs reviews and removed merge conflicts This PR has merge conflicts that need solving. labels Dec 22, 2024
kevinthegreat1
kevinthegreat1 previously approved these changes Dec 22, 2024
@LifeIsAParadox LifeIsAParadox added merge me please Pull requests that are ready to merge and removed reviews needed This PR needs reviews labels Dec 22, 2024
public SlotTextMode slotTextMode = SlotTextMode.ENABLED;

@SerialEntry
public Map<String, Boolean> textEnabled = new Object2BooleanOpenHashMap<>();
Copy link
Collaborator

Choose a reason for hiding this comment

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

The type should be Object2BooleanOpenHashMap otherwise map accesses are being boxed, you will also need to use the getBoolean method when reading the options

@LifeIsAParadox LifeIsAParadox added changes requested This PR need changes and removed merge me please Pull requests that are ready to merge labels Dec 22, 2024
@LifeIsAParadox LifeIsAParadox added reviews needed This PR needs reviews and removed changes requested This PR need changes labels Jan 4, 2025
@LifeIsAParadox LifeIsAParadox added merge me please Pull requests that are ready to merge and removed reviews needed This PR needs reviews labels Jan 4, 2025
@kevinthegreat1 kevinthegreat1 merged commit f23a43b into SkyblockerMod:master Jan 5, 2025
1 check passed
@LifeIsAParadox LifeIsAParadox removed the merge me please Pull requests that are ready to merge label Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants