From e0947d34906e7dbc4a3a06f41a8821e8a2c8102e Mon Sep 17 00:00:00 2001 From: James Seibel Date: Sat, 2 Jul 2022 22:11:52 -0500 Subject: [PATCH] Add API Debug Config --- .../apiObjects/enums/EDhApiDebugMode.java | 67 +++++++++++++++++++ .../config/client/DhApiDebugging.java | 34 ++++++++++ .../lod/core/enums/rendering/EDebugMode.java | 19 +++++- 3 files changed, 117 insertions(+), 3 deletions(-) create mode 100644 src/main/java/com/seibel/lod/core/api/external/apiObjects/enums/EDhApiDebugMode.java create mode 100644 src/main/java/com/seibel/lod/core/api/external/config/client/DhApiDebugging.java diff --git a/src/main/java/com/seibel/lod/core/api/external/apiObjects/enums/EDhApiDebugMode.java b/src/main/java/com/seibel/lod/core/api/external/apiObjects/enums/EDhApiDebugMode.java new file mode 100644 index 000000000..c437a5a7b --- /dev/null +++ b/src/main/java/com/seibel/lod/core/api/external/apiObjects/enums/EDhApiDebugMode.java @@ -0,0 +1,67 @@ +/* + * This file is part of the Distant Horizons mod (formerly the LOD Mod), + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2022 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.seibel.lod.core.api.external.apiObjects.enums; + +/** + * OFF,
+ * SHOW_WIREFRAME,
+ * SHOW_DETAIL,
+ * SHOW_DETAIL_WIREFRAME,
+ * SHOW_GENMODE,
+ * SHOW_GENMODE_WIREFRAME,
+ * SHOW_OVERLAPPING_QUADS,
+ * SHOW_OVERLAPPING_QUADS_WIREFRAME,
+ * + * @author Leetom + * @author James Seibel + * @version 2022-7-2 + */ +public enum EDhApiDebugMode +{ + // Reminder: + // when adding items up the API minor version + // when removing items up the API major version + + + /** LODs are rendered normally */ + OFF, + + /** LOD draws in wireframe. */ + SHOW_WIREFRAME, + + /** LOD colors are based on their detail */ + SHOW_DETAIL, + + /** LOD colors are based on their detail, and draws in wireframe. */ + SHOW_DETAIL_WIREFRAME, + + /** LOD colors are based on their gen mode. */ + SHOW_GENMODE, + + /** LOD colors are based on their gen mode, and draws in wireframe. */ + SHOW_GENMODE_WIREFRAME, + + /** Only draw overlapping LOD quads. */ + SHOW_OVERLAPPING_QUADS, + + /** Only draw overlapping LOD quads, and draws in wireframe. */ + SHOW_OVERLAPPING_QUADS_WIREFRAME; + +} diff --git a/src/main/java/com/seibel/lod/core/api/external/config/client/DhApiDebugging.java b/src/main/java/com/seibel/lod/core/api/external/config/client/DhApiDebugging.java new file mode 100644 index 000000000..0127c4137 --- /dev/null +++ b/src/main/java/com/seibel/lod/core/api/external/config/client/DhApiDebugging.java @@ -0,0 +1,34 @@ +package com.seibel.lod.core.api.external.config.client; + +import com.seibel.lod.core.api.external.apiObjects.enums.EDhApiDebugMode; +import com.seibel.lod.core.api.external.apiObjects.wrapperInterfaces.IDhApiConfig; +import com.seibel.lod.core.api.implementation.objects.GenericEnumConverter; +import com.seibel.lod.core.api.implementation.wrappers.DhApiConfig; +import com.seibel.lod.core.config.Config.Client.Advanced.Debugging; +import com.seibel.lod.core.enums.rendering.EDebugMode; + +/** + * Multiplayer settings. + * + * @author James Seibel + * @version 2022-7-2 + */ +public class DhApiDebugging +{ + + /** + * Returns the config related to if/how Distant Horizons + * uses debug rendering. + */ + public static IDhApiConfig getDebugRenderModeConfig() + { return new DhApiConfig<>(Debugging.debugMode, new GenericEnumConverter<>(EDebugMode.class, EDhApiDebugMode.class)); } + + /** + * Returns the config related to if Distant Horizons + * debug keybindings are active or not. + */ + public static IDhApiConfig getEnableDebugKeybindingsConfig() + { return new DhApiConfig<>(Debugging.enableDebugKeybindings); } + + +} diff --git a/src/main/java/com/seibel/lod/core/enums/rendering/EDebugMode.java b/src/main/java/com/seibel/lod/core/enums/rendering/EDebugMode.java index f87fbe106..26198cf0d 100644 --- a/src/main/java/com/seibel/lod/core/enums/rendering/EDebugMode.java +++ b/src/main/java/com/seibel/lod/core/enums/rendering/EDebugMode.java @@ -20,13 +20,26 @@ package com.seibel.lod.core.enums.rendering; /** - * off, detail, detail wireframe - * + * OFF,
+ * SHOW_WIREFRAME,
+ * SHOW_DETAIL,
+ * SHOW_DETAIL_WIREFRAME,
+ * SHOW_GENMODE,
+ * SHOW_GENMODE_WIREFRAME,
+ * SHOW_OVERLAPPING_QUADS,
+ * SHOW_OVERLAPPING_QUADS_WIREFRAME,
+ * + * @author Leetom * @author James Seibel - * @version 8-28-2021 + * @version 2022-7-2 */ public enum EDebugMode { + // Reminder: + // when adding items up the API minor version + // when removing items up the API major version + + /** LODs are rendered normally */ OFF,