Skip to content

Commit

Permalink
merge client configs
Browse files Browse the repository at this point in the history
  • Loading branch information
boubou19 committed Sep 11, 2024
1 parent d42c0b1 commit eb2b7d5
Show file tree
Hide file tree
Showing 11 changed files with 175 additions and 193 deletions.
12 changes: 2 additions & 10 deletions src/main/java/gregtech/GTMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.Map;
import java.util.function.Predicate;

import gregtech.common.config.client.Client;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
Expand Down Expand Up @@ -81,11 +82,6 @@
import gregtech.common.GTNetwork;
import gregtech.common.GTProxy;
import gregtech.common.RecipeAdder;
import gregtech.common.config.client.ConfigColorModulation;
import gregtech.common.config.client.ConfigInterface;
import gregtech.common.config.client.ConfigPreference;
import gregtech.common.config.client.ConfigRender;
import gregtech.common.config.client.ConfigWaila;
import gregtech.common.config.gregtech.ConfigDebug;
import gregtech.common.config.gregtech.ConfigFeatures;
import gregtech.common.config.gregtech.ConfigGeneral;
Expand Down Expand Up @@ -190,11 +186,7 @@ public class GTMod implements IGTMod {
static {
try {
// Client
ConfigurationManager.registerConfig(ConfigColorModulation.class);
ConfigurationManager.registerConfig(ConfigInterface.class);
ConfigurationManager.registerConfig(ConfigPreference.class);
ConfigurationManager.registerConfig(ConfigRender.class);
ConfigurationManager.registerConfig(ConfigWaila.class);
ConfigurationManager.registerConfig(Client.class);

// GregTech.cfg
ConfigurationManager.registerConfig(ConfigDebug.class);
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/gregtech/api/util/GTClientPreference.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package gregtech.api.util;

import gregtech.common.config.client.ConfigPreference;
import gregtech.common.config.client.ConfigWaila;
import gregtech.common.config.client.Client;

public class GTClientPreference {

Expand All @@ -19,10 +18,10 @@ public GTClientPreference(boolean mSingleBlockInitialFilter, boolean mSingleBloc
}

public GTClientPreference() {
this.mSingleBlockInitialFilter = ConfigPreference.singleBlockInitialFilter;
this.mSingleBlockInitialMultiStack = ConfigPreference.singleBlockInitialAllowMultiStack;
this.mInputBusInitialFilter = ConfigPreference.inputBusInitialFilter;
this.wailaAverageNS = ConfigWaila.wailaAverageNS;
this.mSingleBlockInitialFilter = Client.preference.singleBlockInitialFilter;
this.mSingleBlockInitialMultiStack = Client.preference.singleBlockInitialAllowMultiStack;
this.mInputBusInitialFilter = Client.preference.inputBusInitialFilter;
this.wailaAverageNS = Client.waila.wailaAverageNS;
}

public boolean isSingleBlockInitialFilterEnabled() {
Expand Down
14 changes: 3 additions & 11 deletions src/main/java/gregtech/client/GTGUIClientConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,20 @@

import static gregtech.api.enums.Mods.GregTech;

import gregtech.common.config.client.Client;
import net.minecraft.client.gui.GuiScreen;

import com.gtnewhorizon.gtnhlib.config.ConfigException;
import com.gtnewhorizon.gtnhlib.config.SimpleGuiConfig;

import gregtech.common.config.client.ConfigColorModulation;
import gregtech.common.config.client.ConfigInterface;
import gregtech.common.config.client.ConfigPreference;
import gregtech.common.config.client.ConfigRender;
import gregtech.common.config.client.ConfigWaila;

public class GTGUIClientConfig extends SimpleGuiConfig {

public GTGUIClientConfig(GuiScreen parentScreen) throws ConfigException {
super(
parentScreen,
GregTech.ID,
"GregTech",
ConfigColorModulation.class,
ConfigInterface.class,
ConfigPreference.class,
ConfigRender.class,
ConfigWaila.class);
true,
Client.class);
}
}
138 changes: 138 additions & 0 deletions src/main/java/gregtech/common/config/client/Client.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
package gregtech.common.config.client;

import com.gtnewhorizon.gtnhlib.config.Config;
import gregtech.api.enums.Mods;

@Config(
modid = Mods.Names.GREG_TECH,
category = "Client",
configSubDirectory = "GregTech",
filename = "Client")
public class Client {

@Config.Comment("Color Modulation section")
@Config.LangKey("GT5U.gui.config.color_modulation")
public static final ColorModulation colorModulation = new ColorModulation();

@Config.Comment("Interface section")
@Config.LangKey("GT5U.gui.config.interface")
public static final Interface iface = new Interface();

@Config.Comment("Preference section")
@Config.LangKey("GT5U.gui.config.preference")
public static final Preference preference = new Preference();

@Config.Comment("Render section")
@Config.LangKey("GT5U.gui.config.render")
public static final Render render = new Render();

@Config.Comment("Waila section")
@Config.LangKey("GT5U.gui.config.waila")
public static final Waila waila = new Waila();

public static class ColorModulation {

@Config.Comment("hex value for the cable insulation color modulation.")
@Config.DefaultString("#404040")
public String cableInsulation;

@Config.Comment("hex value for the construction foam color modulation.")
@Config.DefaultString("#404040")
public String constructionFoam;

@Config.Comment("hex value for the machine metal color modulation.")
@Config.DefaultString("#D2DCFF")
public String machineMetal;
}

public static class Interface {

@Config.Comment("if true, makes cover tabs visible on GregTech machines.")
@Config.DefaultBoolean(true)
public boolean coverTabsVisible;

@Config.Comment("if true, puts the cover tabs display on the right of the UI instead of the left.")
@Config.DefaultBoolean(false)
public boolean coverTabsFlipped;

@Config.Comment("How verbose should tooltips be? 0: disabled, 1: one-line, 2: normal, 3+: extended.")
@Config.DefaultInt(2)
public int tooltipVerbosity;

@Config.Comment("How verbose should tooltips be when LSHIFT is held? 0: disabled, 1: one-line, 2: normal, 3+: extended.")
@Config.DefaultInt(3)
public int tooltipShiftVerbosity;

@Config.Comment("Which style to use for title tab on machine GUI? 0: text tab split-dark, 1: text tab unified, 2: item icon tab.")
@Config.DefaultInt(0)
public int titleTabStyle;
}
public static class Preference {

@Config.Comment("if true, input filter will initially be on when input buses are placed in the world.")
@Config.DefaultBoolean(false)
public boolean inputBusInitialFilter;

@Config.Comment("if true, allow multistacks on single blocks by default when they are first placed in the world.")
@Config.DefaultBoolean(false)
public boolean singleBlockInitialAllowMultiStack;

@Config.Comment("if true, input filter will initially be on when machines are placed in the world.")
@Config.DefaultBoolean(false)
public boolean singleBlockInitialFilter;
}

public static class Render {

@Config.Comment("if true, enables ambient-occlusion smooth lighting on tiles.")
@Config.DefaultBoolean(true)
public boolean renderTileAmbientOcclusion;

@Config.Comment("if true, enables glowing of the machine controllers.")
@Config.DefaultBoolean(true)
public boolean renderGlowTextures;

@Config.Comment("if true, render flipped machine with flipped textures.")
@Config.DefaultBoolean(true)
public boolean renderFlippedMachinesFlipped;

@Config.Comment("if true, render indicators on hatches.")
@Config.DefaultBoolean(true)
public boolean renderIndicatorsOnHatch;

@Config.Comment("if true, enables dirt particles when pollution reaches the threshold.")
@Config.DefaultBoolean(true)
public boolean renderDirtParticles;

@Config.Comment("if true, enables pollution fog when pollution reaches the threshold.")
@Config.DefaultBoolean(true)
public boolean renderPollutionFog;

@Config.Comment("if true, enables the green -> red durability for an item's damage value.")
@Config.DefaultBoolean(true)
public boolean renderItemDurabilityBar;

@Config.Comment("if true, enables the blue charge bar for an electric item's charge.")
@Config.DefaultBoolean(true)
public boolean renderItemChargeBar;

@Config.Comment("enables BaseMetaTileEntity block updates handled by BlockUpdateHandler.")
@Config.DefaultBoolean(false)
public boolean useBlockUpdateHandler;

}

public static class Waila {

/**
* This enables showing voltage tier of transformer for Waila, instead of raw voltage number
*/
@Config.Comment("if true, enables showing voltage tier of transformer for Waila, instead of raw voltage number.")
@Config.DefaultBoolean(true)
public boolean wailaTransformerVoltageTier;

@Config.Comment("if true, enables showing voltage tier of transformer for Waila, instead of raw voltage number.")
@Config.DefaultBoolean(false)
public boolean wailaAverageNS;
}
}

This file was deleted.

29 changes: 0 additions & 29 deletions src/main/java/gregtech/common/config/client/ConfigInterface.java

This file was deleted.

21 changes: 0 additions & 21 deletions src/main/java/gregtech/common/config/client/ConfigPreference.java

This file was deleted.

46 changes: 0 additions & 46 deletions src/main/java/gregtech/common/config/client/ConfigRender.java

This file was deleted.

21 changes: 0 additions & 21 deletions src/main/java/gregtech/common/config/client/ConfigWaila.java

This file was deleted.

Loading

0 comments on commit eb2b7d5

Please sign in to comment.