Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/beta' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
j10a1n15 committed Apr 9, 2024
2 parents 45e63f9 + ca07710 commit 563b5cb
Show file tree
Hide file tree
Showing 302 changed files with 1,368 additions and 950 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ plugins {
}

group = "at.hannibal2.skyhanni"
version = "0.25.Beta.3"
version = "0.25.Beta.4"

val gitHash by lazy {
val baos = ByteArrayOutputStream()
Expand Down Expand Up @@ -151,7 +151,7 @@ loom {
property("devauth.configDir", rootProject.file(".devauth").absolutePath)
}
arg("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker")
arg("--tweakClass", "io.github.moulberry.moulconfig.tweaker.DevelopmentResourceTweaker")
arg("--tweakClass", "io.github.notenoughupdates.moulconfig.tweaker.DevelopmentResourceTweaker")
arg("--mods", devenvMod.resolve().joinToString(",") { it.relativeTo(file("run")).path })
}
}
Expand Down Expand Up @@ -241,7 +241,7 @@ tasks.shadowJar {
}
exclude("META-INF/versions/**")
mergeServiceFiles()
relocate("io.github.moulberry.moulconfig", "at.hannibal2.skyhanni.deps.moulconfig")
relocate("io.github.notenoughupdates.moulconfig", "at.hannibal2.skyhanni.deps.moulconfig")
relocate("moe.nea.libautoupdate", "at.hannibal2.skyhanni.deps.libautoupdate")
}
tasks.jar {
Expand Down
20 changes: 20 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
+ Added SA Jump Notification. - CarsCupcake (https://github.com/hannibal002/SkyHanni/pull/852)
+ Warn shorty before a Shadow Assassin jumps to you in dungeons.

#### Config Features

+ Added a link from HUD elements to config options. - nea (https://github.com/hannibal002/SkyHanni/pull/1383)
+ Simply right-click a HUD element in the HUD editor to jump to its associated options.
+ Does not yet work on every GUI element. Wait for the missing elements in the following betas.

#### Misc Features

+ Added No Bits Available Warning. - Empa (https://github.com/hannibal002/SkyHanni/pull/1286)
Expand Down Expand Up @@ -61,6 +67,10 @@

+ Add /trade to tab completeable commands. - CalMWolfs (https://github.com/hannibal002/SkyHanni/pull/1354)

#### Config Improvements

+ Added right click support for many garden GUI elements. - hannibal2 + nea (https://github.com/hannibal002/SkyHanni/pull/1395)

#### Misc Improvements

+ Improved mod performance. - CalMWolfs, ThatGravyBoat (https://github.com/hannibal002/SkyHanni/pull/1342)
Expand All @@ -83,6 +93,8 @@
+ Fixed coins from leveling up farming counting to Pest Profit Tracker. - Empa (https://github.com/hannibal002/SkyHanni/pull/1358)
+ Fixed not being able to teleport to other infested plots immediately after killing a pest. - Empa (https://github.com/hannibal002/SkyHanni/pull/1357)
+ Fixed Jacob's contest detection. - HiZe (https://github.com/hannibal002/SkyHanni/pull/1375)
+ Fixed updating pests before pest count got updated. - Empa (https://github.com/hannibal002/SkyHanni/pull/1386)
+ Fixed being able to have duplicate custom key binds. - Empa (https://github.com/hannibal002/SkyHanni/pull/1387)

#### Chat Fixes

Expand All @@ -97,6 +109,8 @@
+ Fixed bits available being subtracted in an infinite loop. - Empa (https://github.com/hannibal002/SkyHanni/pull/1292)
+ Fixed not setting No Power Active. - Empa (https://github.com/hannibal002/SkyHanni/pull/1366)
+ Fixed Objective Lines never being shown in Custom Scoreboard. - j10a1n15 (https://github.com/hannibal002/SkyHanni/pull/1377)
+ Fixed Crystal Hollows Island size being 26 instead of 24 in Custom Scoreboard. - j10a1n15 (https://github.com/hannibal002/SkyHanni/pull/1389)
+ Fixed "unknown lines" error with an objective line in Custom Scoreboard. - j10a1n15 (https://github.com/hannibal002/SkyHanni/pull/1394)

#### Dungeon Fixes

Expand All @@ -111,6 +125,7 @@
+ Fixed tick event being called twice a tick. - CalMWolfs (https://github.com/hannibal002/SkyHanni/pull/1342)
+ Fixes random error in mob detection. - Thunderblade73 (https://github.com/hannibal002/SkyHanni/pull/1361)
+ Fixed a spelling mistake in the Deep Caverns Parkour config. - jani (https://github.com/hannibal002/SkyHanni/pull/1349)
+ Rendered Items in SkyHanni GUIs no longer have partially broken textures. (on default size) - Empa (https://github.com/hannibal002/SkyHanni/pull/1390)

### Technical Details

Expand Down Expand Up @@ -155,6 +170,11 @@
+ Add isEnabled to BasketWaypoints and remove unused code line. - CalMWolfs (https://github.com/hannibal002/SkyHanni/pull/1207)
+ Added feature toggle adapter to automatically turn on features. - nea (https://github.com/hannibal002/SkyHanni/pull/581)
+ Fixed mob detection: decoy, m7 dragon, husks. - Thunderblade73 (https://github.com/hannibal002/SkyHanni/pull/1367)
+ Added clickableUserError. - Empa (https://github.com/hannibal002/SkyHanni/pull/1387)
+ Fixed itemScale for Renderable.itemStack. - Thunderblade73 (https://github.com/hannibal002/SkyHanni/pull/1390)
+ Bump MoulConfig to 3.0.0 betas - !nea (https://github.com/hannibal002/SkyHanni/pull/1382)
+ Adds jumps, links and portals.
+ Changes the package from a mix of `io.github.moulberry.moulconfig` and `io.github.notenoughupdates.moulconfig` to just `io.github.notenoughupdates.moulconfig`

### Removed Features

Expand Down
3 changes: 3 additions & 0 deletions docs/FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,9 @@ Use `/sh` or `/skyhanni` to open the SkyHanni config in game.
+ A ton of settings.
+ No Bits Available Warning. - Empa (https://github.com/hannibal002/SkyHanni/pull/1286)
+ Warns when you run out of available bits to generate.
+ Link from HUD elements to config options. - nea (https://github.com/hannibal002/SkyHanni/pull/1383)
+ Simply right-click a HUD element in the HUD editor to jump to its associated options.
+ Does not yet work on every GUI element. Wait for the missing elements in the following betas.

</details>
<details open><summary>
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
libautoupdate = "1.3.1"
moulconfig = "2.5.0"
moulconfig = "3.0.0-beta.7"
headlessLwjgl = "1.7.2"
jbAnnotations = "24.1.0"

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ import org.apache.logging.log4j.Logger
clientSideOnly = true,
useMetadata = true,
guiFactory = "at.hannibal2.skyhanni.config.ConfigGuiForgeInterop",
version = "0.25.Beta.3",
version = "0.25.Beta.4",
)
class SkyHanniMod {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package at.hannibal2.skyhanni.config

import io.github.moulberry.moulconfig.gui.GuiScreenElementWrapper
import io.github.notenoughupdates.moulconfig.gui.GuiScreenElementWrapper
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiScreen
import net.minecraftforge.fml.client.IModGuiFactory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package at.hannibal2.skyhanni.config

import at.hannibal2.skyhanni.SkyHanniMod
import io.github.moulberry.moulconfig.gui.GuiScreenElementWrapper
import io.github.moulberry.moulconfig.gui.MoulConfigEditor
import io.github.notenoughupdates.moulconfig.gui.GuiScreenElementWrapper
import io.github.notenoughupdates.moulconfig.gui.MoulConfigEditor

object ConfigGuiManager {

Expand Down
43 changes: 34 additions & 9 deletions src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package at.hannibal2.skyhanni.config

import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.core.config.Position
import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.data.jsonobjects.local.FriendsJson
import at.hannibal2.skyhanni.data.jsonobjects.local.JacobContestsJson
import at.hannibal2.skyhanni.data.jsonobjects.local.KnownFeaturesJson
import at.hannibal2.skyhanni.data.jsonobjects.local.VisualWordsJson
import at.hannibal2.skyhanni.data.jsonobjects.other.HypixelApiTrophyFish
import at.hannibal2.skyhanni.events.LorenzEvent
import at.hannibal2.skyhanni.features.fishing.trophy.TrophyRarity
import at.hannibal2.skyhanni.features.misc.update.UpdateManager
import at.hannibal2.skyhanni.utils.FeatureTogglesByDefaultAdapter
import at.hannibal2.skyhanni.utils.IdentityCharacteristics
import at.hannibal2.skyhanni.utils.KotlinTypeAdapterFactory
import at.hannibal2.skyhanni.utils.LorenzLogger
import at.hannibal2.skyhanni.utils.LorenzRarity
Expand All @@ -29,10 +32,11 @@ import com.google.gson.TypeAdapterFactory
import com.google.gson.stream.JsonReader
import com.google.gson.stream.JsonToken
import com.google.gson.stream.JsonWriter
import io.github.moulberry.moulconfig.observer.PropertyTypeAdapterFactory
import io.github.moulberry.moulconfig.processor.BuiltinMoulConfigGuis
import io.github.moulberry.moulconfig.processor.ConfigProcessorDriver
import io.github.moulberry.moulconfig.processor.MoulConfigProcessor
import io.github.notenoughupdates.moulconfig.annotations.ConfigLink
import io.github.notenoughupdates.moulconfig.observer.PropertyTypeAdapterFactory
import io.github.notenoughupdates.moulconfig.processor.BuiltinMoulConfigGuis
import io.github.notenoughupdates.moulconfig.processor.ConfigProcessorDriver
import io.github.notenoughupdates.moulconfig.processor.MoulConfigProcessor
import net.minecraft.item.ItemStack
import java.io.BufferedReader
import java.io.BufferedWriter
Expand Down Expand Up @@ -213,11 +217,32 @@ class ConfigManager {
processor = MoulConfigProcessor(SkyHanniMod.feature)
BuiltinMoulConfigGuis.addProcessors(processor)
UpdateManager.injectConfigProcessor(processor)
ConfigProcessorDriver.processConfig(
features.javaClass,
features,
processor
)
ConfigProcessorDriver(processor).processConfig(features)

try {
findPositionLinks(features, mutableSetOf())
} catch (e: Exception) {
if (LorenzEvent.isInGuardedEventHandler)
throw e
}
}

private fun findPositionLinks(obj: Any?, slog: MutableSet<IdentityCharacteristics<Any>>) {
if (obj == null) return
if (!obj.javaClass.name.startsWith("at.hannibal2.skyhanni.")) return
val ic = IdentityCharacteristics(obj)
if (ic in slog) return
slog.add(ic)
for (field in obj.javaClass.fields) {
field.isAccessible = true
if (field.type != Position::class.java) {
findPositionLinks(field.get(obj), slog)
continue
}
val configLink = field.getAnnotation(ConfigLink::class.java) ?: continue
val position = field.get(obj) as Position
position.setLink(configLink)
}
}

private fun firstLoadFile(file: File?, fileType: ConfigFileType, defaultValue: Any): Any {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.google.gson.JsonPrimitive
object ConfigUpdaterMigrator {

val logger = LorenzLogger("ConfigMigration")
const val CONFIG_VERSION = 31
const val CONFIG_VERSION = 32
fun JsonElement.at(chain: List<String>, init: Boolean): JsonElement? {
if (chain.isEmpty()) return this
if (this !is JsonObject) return null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package at.hannibal2.skyhanni.config

import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean

/**
* Annotate a [ConfigEditorBoolean] to indicate that it is a feature toggle.
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/at/hannibal2/skyhanni/config/Features.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import at.hannibal2.skyhanni.config.storage.Storage;
import at.hannibal2.skyhanni.utils.LorenzUtils;
import com.google.gson.annotations.Expose;
import io.github.moulberry.moulconfig.Config;
import io.github.moulberry.moulconfig.Social;
import io.github.moulberry.moulconfig.annotations.Category;
import io.github.moulberry.moulconfig.gui.HorizontalAlign;
import io.github.moulberry.moulconfig.processor.ProcessedCategory;
import io.github.notenoughupdates.moulconfig.Config;
import io.github.notenoughupdates.moulconfig.Social;
import io.github.notenoughupdates.moulconfig.annotations.Category;
import io.github.notenoughupdates.moulconfig.gui.HorizontalAlign;
import io.github.notenoughupdates.moulconfig.processor.ProcessedCategory;
import net.minecraft.util.ResourceLocation;

import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,7 @@ object Commands {
if (!LorenzUtils.inSkyBlock) {
ChatUtils.userError("Join SkyBlock to open the fortune guide!")
} else {
CaptureFarmingGear.captureFarmingGear()
SkyHanniMod.screenToOpen = FFGuideGUI()
FFGuideGUI.open()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,18 @@
package at.hannibal2.skyhanni.config.core.config;

import at.hannibal2.skyhanni.SkyHanniMod;
import at.hannibal2.skyhanni.config.ConfigGuiManager;
import at.hannibal2.skyhanni.config.Features;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.ConfigLink;
import io.github.notenoughupdates.moulconfig.gui.GuiScreenElementWrapper;
import io.github.notenoughupdates.moulconfig.gui.MoulConfigEditor;
import io.github.notenoughupdates.moulconfig.processor.ProcessedOption;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import org.jetbrains.annotations.NotNull;

import java.lang.reflect.Field;

public class Position {
@Expose
Expand All @@ -39,6 +48,8 @@ public class Position {
@Expose
private boolean centerY;

public transient Field linkField;

private boolean clicked = false;
public String internalName = null;

Expand Down Expand Up @@ -203,4 +214,22 @@ public int moveY(int deltaY, int objHeight) {
}
return deltaY;
}

public boolean canJumpToConfigOptions() {
return linkField != null && ConfigGuiManager.INSTANCE.getEditorInstance().getProcessedConfig().getOptionFromField(linkField) != null;
}

public void jumpToConfigOptions() {
MoulConfigEditor<Features> editor = ConfigGuiManager.INSTANCE.getEditorInstance();
if (linkField == null) return;
ProcessedOption option = editor.getProcessedConfig().getOptionFromField(linkField);
if (option == null) return;
editor.search("");
if (!editor.goToOption(option)) return;
SkyHanniMod.Companion.setScreenToOpen(new GuiScreenElementWrapper(editor));
}

public void setLink(@NotNull ConfigLink configLink) throws NoSuchFieldException {
linkField = configLink.owner().getField(configLink.field());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ class GuiPositionEditor(private val positions: List<Position>, private val borde
val location = "§7x: §e${pos.rawX}§7, y: §e${pos.rawY}§7, scale: §e${pos.scale.round(2)}"
GuiRenderUtils.drawStringCentered("§b" + pos.internalName, getScaledWidth() / 2, 18)
GuiRenderUtils.drawStringCentered(location, getScaledWidth() / 2, 28)
if (pos.canJumpToConfigOptions())
GuiRenderUtils.drawStringCentered(
"§aRight-Click to open associated config options",
getScaledWidth() / 2,
38
)
}

private fun renderRectangles(): Int {
Expand Down Expand Up @@ -142,7 +148,6 @@ class GuiPositionEditor(private val positions: List<Position>, private val borde
override fun mouseClicked(originalX: Int, priginalY: Int, mouseButton: Int) {
super.mouseClicked(originalX, priginalY, mouseButton)

if (mouseButton != 0) return

val mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth
val mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1
Expand All @@ -152,19 +157,20 @@ class GuiPositionEditor(private val positions: List<Position>, private val borde
val elementHeight = position.getDummySize().y
val x = position.getAbsX()
val y = position.getAbsY()
if (!position.clicked &&
GuiRenderUtils.isPointInRect(

mouseX,
mouseY,
x - border,
y - border,
elementWidth + border * 2,
elementHeight + border * 2

)

) {
val isHovered = GuiRenderUtils.isPointInRect(
mouseX,
mouseY,
x - border,
y - border,
elementWidth + border * 2,
elementHeight + border * 2
)
if (!isHovered) continue
if (mouseButton == 1) {
position.jumpToConfigOptions()
break
}
if (!position.clicked && mouseButton == 0) {
clickedPos = i
position.clicked = true
grabbedX = mouseX
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/at/hannibal2/skyhanni/config/features/About.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import at.hannibal2.skyhanni.features.misc.update.ConfigVersionDisplay;
import at.hannibal2.skyhanni.utils.OSUtils;
import com.google.gson.annotations.Expose;
import io.github.moulberry.moulconfig.annotations.Accordion;
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
import io.github.moulberry.moulconfig.annotations.ConfigEditorButton;
import io.github.moulberry.moulconfig.annotations.ConfigEditorDropdown;
import io.github.moulberry.moulconfig.annotations.ConfigOption;
import io.github.moulberry.moulconfig.observer.Property;
import io.github.notenoughupdates.moulconfig.annotations.Accordion;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorButton;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown;
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;
import io.github.notenoughupdates.moulconfig.observer.Property;

public class About {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import at.hannibal2.skyhanni.config.FeatureToggle;
import com.google.gson.annotations.Expose;
import io.github.moulberry.moulconfig.annotations.Accordion;
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
import io.github.moulberry.moulconfig.annotations.ConfigEditorDraggableList;
import io.github.moulberry.moulconfig.annotations.ConfigEditorKeybind;
import io.github.moulberry.moulconfig.annotations.ConfigOption;
import io.github.notenoughupdates.moulconfig.annotations.Accordion;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDraggableList;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorKeybind;
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;
import org.lwjgl.input.Keyboard;

import java.util.ArrayList;
Expand Down
Loading

0 comments on commit 563b5cb

Please sign in to comment.