diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-08-06 19:56:02 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-06 12:56:02 +0200 |
commit | c79dc3cf7b3750aa03fb33a07b4af044b37f9407 (patch) | |
tree | b593104ebb8e60b31744fb16f70787300194f87e /src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java | |
parent | 8319a68d09f0ef8a771d16b274b1737e21cd3500 (diff) | |
download | OneConfig-c79dc3cf7b3750aa03fb33a07b4af044b37f9407.tar.gz OneConfig-c79dc3cf7b3750aa03fb33a07b4af044b37f9407.tar.bz2 OneConfig-c79dc3cf7b3750aa03fb33a07b4af044b37f9407.zip |
new: add forge config button compat (#80)
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java index ffac8e3..841a157 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java @@ -8,6 +8,7 @@ import cc.polyfrost.oneconfig.gui.pages.ModsPage; import cc.polyfrost.oneconfig.internal.assets.Colors; import cc.polyfrost.oneconfig.internal.assets.SVGs; import cc.polyfrost.oneconfig.internal.config.OneConfigConfig; +import cc.polyfrost.oneconfig.internal.config.compatibility.forge.ForgeCompat; import cc.polyfrost.oneconfig.internal.config.core.ConfigCore; import cc.polyfrost.oneconfig.platform.Platform; import cc.polyfrost.oneconfig.renderer.RenderManager; @@ -92,8 +93,16 @@ public class ModCard extends BasicElement { } public void onClick() { - if (isHoveredMain) + if (isHoveredMain) { + if (modData instanceof ForgeCompat.ForgeCompatMod) { + Runnable runnable = ForgeCompat.compatMods.get(modData); + if (runnable != null) { + runnable.run(); + return; + } + } OneConfigGui.INSTANCE.openPage(new ModConfigPage(modData.defaultPage)); + } } public Mod getModData() { |