Skip to content

Commit

Permalink
Merge pull request #19 from FA22B/DBOT-54-Plugin-Konfiguration
Browse files Browse the repository at this point in the history
Added missing functionality
  • Loading branch information
eawd123wadd4354as243df authored May 30, 2024
2 parents 2c3d60f + 7196c02 commit 763062b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/main/java/com/bothq/lib/plugin/config/IConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ public interface IConfig extends IConfigGroup {
IEnabled getEnabled();

default boolean isEnabled(long serverId){
return getEnabled().get(serverId).getValue();
return getEnabled()
.get(serverId)
.isEnabled();
}


Expand All @@ -15,4 +17,6 @@ default boolean isEnabled(long serverId){

IConfigGroup addConfigGroup(String uniqueId, String displayName);



}
4 changes: 3 additions & 1 deletion src/main/java/com/bothq/lib/plugin/config/IConfigGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
public interface IConfigGroup extends IConfigurable, INameable {
List<IConfigurable> getChildren();


ICheckBox addCheckBox(String uniqueId, String displayName, boolean defaultValue);

<T> IComboBox<T> addComboBox(String uniqueId, String displayName, List<T> elements, T defaultValue);
IComboBox addComboBox(String uniqueId, String displayName, List<String> elements, String defaultValue);

IRadioBox addRadioBox(String uniqueId, String displayName, String defaultValue, List<String> options);

ISlider addSlider(String uniqueId, String displayName, float minValue, float maxValue, float step, float defaultValue);

ITextBox addTextBox(String uniqueId, String displayName, String defaultValue);

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bothq.lib.plugin.config.component;

public interface IComboBox<T> extends IUnselectedServerComponent<IComboBoxServer<T>> {
public interface IComboBox extends IUnselectedServerComponent<IComboBoxServer> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

import java.util.List;

public interface IComboBoxServer<T> extends IComponent<T> {
List<T> getElements();
public interface IComboBoxServer extends IComponent<String> {
List getElements();
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ public interface IComponent<T> extends IConfigurable, INameable {
T getValue();

void setValue(T value);

boolean isAssignable(Object value);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.bothq.lib.plugin.config.enabled;

public interface IEnabledServer {
Boolean getValue();
boolean isEnabled();

}

0 comments on commit 763062b

Please sign in to comment.