Renamed Main to ForgeMain and added some config ui comment stuff

This commit is contained in:
coolGi
2022-06-03 17:13:28 +09:30
parent 4d2e68e4e5
commit e497b5f9e8
4 changed files with 34 additions and 5 deletions
@@ -18,6 +18,7 @@ import java.util.Map;
* @author coolGi
* @author Ran
*/
// Init the config after singletons have been blinded
public class ConfigBase {
/*
What the config works with
@@ -12,7 +12,7 @@ public abstract class AbstractConfigType<T, S> { // The S is the class that is e
public String name; // This should only be set once in the init
protected T value;
public Object guiValue; // This can be set by whatever gui you are using
public Object guiValue; // This is a storage variable something like the gui can use
protected ConfigEntryAppearance appearance;
@@ -47,22 +47,22 @@ public class ConfigEntry<T> extends AbstractConfigType<T, ConfigEntry<T>>
}
@Override
public void set(T newValue) {
this.value = newValue;
super.set(newValue);
save();
}
@Override
public T get() {
if (allowApiOverride && apiValue != null)
return apiValue;
return value;
return super.get();
}
public T getTrueValue() {
return value;
return super.get();
}
/** Sets the value without saving */
public void setWithoutSaving(T newValue) {
this.value = newValue;
super.set(newValue);
}
/** Gets the min value */
@@ -0,0 +1,28 @@
package com.seibel.lod.core.config.types;
/**
* Adds something like a ConfigEntry but without a button to change the input and only in the gui
*
* @author coolGi
*/
public class ConfigUIComment extends AbstractConfigType<String, ConfigUIComment>{
public ConfigUIComment(String value) {
super(ConfigEntryAppearance.ONLY_SHOW, value);
}
@Override
public void setAppearance(ConfigEntryAppearance newAppearance) {
return;
}
public static class Builder extends AbstractConfigType.Builder<String, Builder> {
@Override
public Builder setAppearance(ConfigEntryAppearance newAppearance) {
return this;
}
public ConfigUIComment build() {
return new ConfigUIComment(tmpValue);
}
}
}