mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 17:47:32 +00:00
Modern GUI to Experimental Config -- Default: False
This commit is contained in:
1 parent
9597f68a5e
commit
82c2a0f10f
5 files changed
+44
-13
No files matched your search
@@ -23,7 +23,7 @@ import noppes.npcs.client.gui.util.GuiContainerNPCInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface;
|
||||
import noppes.npcs.client.gui.util.IPlayerDataInfo;
|
||||
import noppes.npcs.client.gui.util.IScrollData;
|
||||
import noppes.npcs.config.ConfigClient;
|
||||
import noppes.npcs.config.ConfigExperimental;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import noppes.npcs.constants.EnumScrollData;
|
||||
import noppes.npcs.controllers.data.Dialog;
|
||||
@@ -195,7 +195,7 @@ public class NoppesUtil {
|
||||
dialog.readNBT(compound);
|
||||
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
|
||||
if(!(gui instanceof GuiDialogInteract)) {
|
||||
if (ConfigClient.ModernGuiSystem) {
|
||||
if (ConfigExperimental.ModernGuiSystem) {
|
||||
if (dialog.hasQuest()) {
|
||||
CustomNpcs.proxy.openGui(player, new GuiModernQuestDialog(npc, dialog.getQuest(), dialog, -2));
|
||||
} else {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package noppes.npcs.client.gui.player.modern;
|
||||
|
||||
import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.data.npc.DialogPacket;
|
||||
import kamkeel.npcs.network.packets.player.CheckPlayerValue;
|
||||
import kamkeel.npcs.network.packets.player.DialogSelectPacket;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -17,7 +16,6 @@ import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.NoppesUtilPlayer;
|
||||
import noppes.npcs.api.handler.data.IDialogImage;
|
||||
import noppes.npcs.api.handler.data.IQuestObjective;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
@@ -29,8 +27,7 @@ import noppes.npcs.client.gui.util.GuiNPCInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiTexturedButton;
|
||||
import noppes.npcs.client.gui.util.IGuiClose;
|
||||
import noppes.npcs.config.ConfigClient;
|
||||
import noppes.npcs.constants.EnumPlayerPacket;
|
||||
import noppes.npcs.config.ConfigExperimental;
|
||||
import noppes.npcs.controllers.FactionController;
|
||||
import noppes.npcs.controllers.PlayerDataController;
|
||||
import noppes.npcs.controllers.data.*;
|
||||
@@ -345,7 +342,7 @@ public class GuiModernQuestDialog extends GuiNPCInterface implements IGuiClose {
|
||||
if(optionId!=-2){
|
||||
PacketClient.sendClient(new DialogSelectPacket(prevDialog.id, optionId));
|
||||
}else{
|
||||
if(ConfigClient.ModernGuiSystem) {
|
||||
if(ConfigExperimental.ModernGuiSystem) {
|
||||
CustomNpcs.proxy.openGui(player, new GuiModernDialogInteract(npc, prevDialog));
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -49,9 +49,6 @@ public class ConfigClient {
|
||||
public static Property HideEffectsBarProperty;
|
||||
public static boolean HideEffectsBar = false;
|
||||
|
||||
public static Property ModernGuiSystemProperty;
|
||||
public static boolean ModernGuiSystem = true;
|
||||
|
||||
/**
|
||||
* Questing Properties
|
||||
**/
|
||||
@@ -225,9 +222,6 @@ public class ConfigClient {
|
||||
BannerAlertsProperty = config.get(VISUAL, "All Banner Alerts", true, "Universal enable/disable for Banner Alerts");
|
||||
BannerAlerts = BannerAlertsProperty.getBoolean(true);
|
||||
|
||||
ModernGuiSystemProperty = config.get(VISUAL, "Modern GUI", true, "Enables the new CNPC+ Modern GUI for Dialog and Quest information");
|
||||
ModernGuiSystem = ModernGuiSystemProperty.getBoolean(true);
|
||||
|
||||
WoodTextures = config.get(TEXTURE, "Wood Textures", false, "Models like Chairs and Stools will use default MC Wood Textures").getBoolean(false);
|
||||
|
||||
LegacyCampfire = config.get(MODEL, "Legacy Campfire Model", false).getBoolean(false);
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package noppes.npcs.config;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.config.legacy.LegacyConfig;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class ConfigExperimental {
|
||||
public static Configuration config;
|
||||
|
||||
public final static String CLIENT = "Client";
|
||||
public final static String SERVER = "Server";
|
||||
public static Property ModernGuiSystemProperty;
|
||||
public static boolean ModernGuiSystem = false;
|
||||
|
||||
|
||||
public static void init(File configFile) {
|
||||
config = new Configuration(configFile);
|
||||
|
||||
try {
|
||||
config.load();
|
||||
|
||||
ConfigExperimental.ModernGuiSystemProperty = config.get(CLIENT, "Experimental Modern GUI", false, "Enables the new CNPC+ Modern GUI for Dialog and Quest information");
|
||||
ConfigExperimental.ModernGuiSystem = ConfigExperimental.ModernGuiSystemProperty.getBoolean(false);
|
||||
} catch (Exception e) {
|
||||
FMLLog.log(Level.ERROR, e, "CNPC+ has had a problem loading its experimental configuration");
|
||||
} finally {
|
||||
if (config.hasChanged()) {
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ public class LoadConfiguration {
|
||||
public static File scriptConfigFile;
|
||||
public static File debugConfigFile;
|
||||
public static File clientConfigFile;
|
||||
public static File experimentalConfigFile;
|
||||
|
||||
public static void init(String configpath) {
|
||||
mainConfigFile = new File(configpath + "main.cfg");
|
||||
@@ -15,11 +16,13 @@ public class LoadConfiguration {
|
||||
clientConfigFile = new File(configpath + "client.cfg");
|
||||
scriptConfigFile = new File(configpath + "script.cfg");
|
||||
debugConfigFile = new File(configpath + "debug.cfg");
|
||||
experimentalConfigFile = new File(configpath + "experimental.cfg");
|
||||
|
||||
ConfigMain.init(mainConfigFile);
|
||||
ConfigItem.init(itemConfigFile);
|
||||
ConfigClient.init(clientConfigFile);
|
||||
ConfigScript.init(scriptConfigFile);
|
||||
ConfigDebug.init(debugConfigFile);
|
||||
ConfigExperimental.init(experimentalConfigFile);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user