-
Notifications
You must be signed in to change notification settings - Fork 35
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
Customizable GUI #328
base: master
Are you sure you want to change the base?
Customizable GUI #328
Conversation
2c0e6b1
to
6a570cf
Compare
src/main/java/net/sacredlabyrinth/phaed/simpleclans/ui/SCFrame.java
Outdated
Show resolved
Hide resolved
src/main/java/net/sacredlabyrinth/phaed/simpleclans/utils/Paginator.java
Outdated
Show resolved
Hide resolved
src/main/java/net/sacredlabyrinth/phaed/simpleclans/ui/SCFrame.java
Outdated
Show resolved
Hide resolved
src/main/java/net/sacredlabyrinth/phaed/simpleclans/managers/SettingsManager.java
Show resolved
Hide resolved
src/main/java/net/sacredlabyrinth/phaed/simpleclans/ui/SCComponentImpl.java
Outdated
Show resolved
Hide resolved
public void createComponents() { | ||
SCComponent back = new SCComponentImpl.Builder(getConfig(), "back") | ||
.withDisplayNameKey("gui.back.title").build(); | ||
back.setListener(ClickType.LEFT, () -> InventoryDrawer.open(getParent())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It probably doesn't make to call InventoryDrawer.open()
(and put it in the listeners map consequently) if getParent()
is 'null'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getParent()
may or may not return null; also InventoryDrawer checks for null.
src/main/java/net/sacredlabyrinth/phaed/simpleclans/ui/PageableFrame.java
Outdated
Show resolved
Hide resolved
src/main/java/net/sacredlabyrinth/phaed/simpleclans/ui/SCComponentImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/sacredlabyrinth/phaed/simpleclans/ui/SCComponentImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/net/sacredlabyrinth/phaed/simpleclans/ui/SCComponentImpl.java
Outdated
Show resolved
Hide resolved
return frameConfigs.computeIfAbsent(clazz, this::readConfig); | ||
} | ||
|
||
private FileConfiguration readConfig(Class<? extends SCFrame> clazz) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method readConfig
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Example config:
To do: