Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Added option to show some features outside SB. #603

Merged
merged 39 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ccd91ec
Added option to show some features outside sb. (Attempt 2)
Obsidianninja11 Oct 19, 2023
4c0b2aa
Added ConfigFixEvent and fixed imports
Obsidianninja11 Oct 21, 2023
794ba1a
Oops forgot realTime.formatToggle
Obsidianninja11 Oct 21, 2023
3760199
Merge branch 'beta' into show-outside-2
hannibal002 Oct 28, 2023
874d487
code cleanup
hannibal002 Oct 28, 2023
d84e277
Merge branch 'hannibal002:beta' into show-outside-2
Obsidianninja11 Oct 31, 2023
41f1cbe
Fixes and composter display outside sb
Obsidianninja11 Oct 31, 2023
af63ba3
Added show outside for arrow trail and put all non dev show outsides …
Obsidianninja11 Nov 1, 2023
4e66940
Fixed tps display config
Obsidianninja11 Nov 5, 2023
9746ed3
Merge branch 'beta' into show-outside-2
Obsidianninja11 Nov 5, 2023
be075d3
reverted unnecessary changes.
hannibal002 Nov 5, 2023
c5da3bb
reverted unnecessary changes again.
hannibal002 Nov 5, 2023
c0827a8
reverted unnecessary changes again part 3
hannibal002 Nov 5, 2023
17d1402
better warn message
hannibal002 Nov 5, 2023
89c465d
use neu internal name object
hannibal002 Nov 5, 2023
13a49c0
making it a bit more readable
hannibal002 Nov 5, 2023
d9afa39
one line change
hannibal002 Nov 5, 2023
93ef2df
added enum
hannibal002 Nov 5, 2023
9b1f3f9
Using OutsideSbFeature.isSelected()
hannibal002 Nov 5, 2023
ac9f0ef
code cleanup
hannibal002 Nov 5, 2023
60260dd
Merge branch 'beta' into show-outside-2
Obsidianninja11 Nov 30, 2023
f1352dc
Fixed merge conflicts
Obsidianninja11 Dec 1, 2023
fbc9dd0
Merge branch 'beta' into show-outside-2
hannibal002 Dec 8, 2023
ed68534
fixed config migration version
hannibal002 Dec 8, 2023
30da809
Merge branch 'beta' into show-outside-2
Obsidianninja11 Dec 25, 2023
33f7063
Fixed merge conflicts
Obsidianninja11 Dec 25, 2023
5011fbb
Merge remote-tracking branch 'origin/show-outside-2' into show-outside-2
Obsidianninja11 Dec 25, 2023
579812b
Fixed merge conflicts + config migrator version
Obsidianninja11 Dec 25, 2023
572c510
Merge branch 'beta' into show-outside-2
hannibal002 Jan 11, 2024
8481d65
Merge branch 'beta' into fork/show-outside-2
hannibal002 Feb 9, 2024
4400741
fixing merge conflicts
hannibal002 Feb 10, 2024
3300de6
Merge branch 'beta' into show-outside-2
Obsidianninja11 Feb 21, 2024
7922afd
Better formatting
Obsidianninja11 Feb 21, 2024
02605de
Merge branch 'beta' into fork/show-outside-2
hannibal002 Mar 1, 2024
701d2ab
Fixes and code cleanup
Obsidianninja11 Mar 2, 2024
7437f4a
Merge branch 'beta' into show-outside-2
Obsidianninja11 Mar 4, 2024
6e8708e
fixed errors on startup
hannibal002 Mar 4, 2024
afad9a2
show information that composter timer needs a SkyBlock join to load p…
hannibal002 Mar 4, 2024
eebe4b4
Merge branch 'beta' into fork/show-outside-2
hannibal002 Mar 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ public static class WaypointsConfig {
@ConfigEditorBoolean
public boolean showPlatformNumber = false;

@Expose
@ConfigOption(name = "Show Outside SB", desc = "Make parkour waypoints outside of SkyBlock too.")
@ConfigEditorBoolean
public boolean showOutsideSB = false;
}

@Expose
Expand Down
72 changes: 48 additions & 24 deletions src/main/java/at/hannibal2/skyhanni/config/features/GUIConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@
import at.hannibal2.skyhanni.config.core.config.Position;
import at.hannibal2.skyhanni.data.GuiEditManager;
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.ConfigEditorKeybind;
import io.github.moulberry.moulconfig.annotations.ConfigEditorSlider;
import io.github.moulberry.moulconfig.annotations.ConfigEditorText;
import io.github.moulberry.moulconfig.annotations.ConfigOption;
import io.github.moulberry.moulconfig.annotations.*;
import io.github.moulberry.moulconfig.observer.Property;
import org.lwjgl.input.Keyboard;

Expand Down Expand Up @@ -76,23 +70,41 @@ public static class TextBoxConfig {
@ConfigEditorText
public Property<String> text = Property.of("&aYour Text Here\\n&bYour new line here");

@Expose
@ConfigOption(name = "Show Outside SB", desc = "Show textbox outside of SkyBlock.")
@ConfigEditorBoolean
public boolean showOutsideSB = false;

@Expose
public Position position = new Position(10, 80, false, true);
}

@Expose
@ConfigOption(name = "Real Time", desc = "Display the current computer time, a handy feature when playing in full-screen mode.")
@ConfigEditorBoolean
@FeatureToggle
public boolean realTime = false;
@ConfigOption(name = "Real Time", desc = "")
@Accordion
public RealTimeConfig realTime = new RealTimeConfig();

@Expose
@ConfigOption(name = "Real Time 12h Format", desc = "Display the current computer time in 12hr Format rather than 24h Format.")
@ConfigEditorBoolean
public boolean realTimeFormatToggle = false;
public static class RealTimeConfig {

@Expose
public Position realTimePosition = new Position(10, 10, false, true);
@Expose
@ConfigOption(name = "Real Time", desc = "Display the current computer time, a handy feature when playing in full-screen mode.")
@ConfigEditorBoolean
@FeatureToggle
public boolean enabled = false;

@Expose
@ConfigOption(name = "Real Time 12h Format", desc = "Display the current computer time in 12hr Format rather than 24h Format.")
@ConfigEditorBoolean
public boolean formatToggle = false;

@Expose
@ConfigOption(name = "Show Outside SB", desc = "Show the time outside of SkyBlock.")
@ConfigEditorBoolean
public boolean showOutsideSB = false;

@Expose
public Position position = new Position(10, 10, false, true);
}


@Expose
Expand Down Expand Up @@ -128,15 +140,27 @@ public static class InGameDateConfig {
public int RefreshSeconds = 10;
}


@Expose
@ConfigOption(name = "TPS Display", desc = "Show the TPS of the current server, like in Soopy.")
@ConfigEditorBoolean
@FeatureToggle
public boolean tpsDisplay = false;
@ConfigOption(name = "TPS Display", desc = "")
@Accordion
public TpsDisplayConfig tpsDisplay = new TpsDisplayConfig();

@Expose
public Position tpsDisplayPosition = new Position(10, 10, false, true);
public static class TpsDisplayConfig {

@Expose
@ConfigOption(name = "TPS Display", desc = "Show the TPS of the current server, like in Soopy.")
@ConfigEditorBoolean
@FeatureToggle
public boolean enabled = false;

@Expose
@ConfigOption(name = "Show Outside SB", desc = "Shows the TPS outside of SkyBlock.")
@ConfigEditorBoolean
public boolean showOutsideSB = false;

@Expose
public Position tpsDisplayPosition = new Position(10, 10, false, true);
}

@Expose
@ConfigOption(name = "Config Button", desc = "Add a button to the pause menu to configure SkyHanni.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@
import at.hannibal2.skyhanni.features.garden.inventory.GardenPlotIcon;
import at.hannibal2.skyhanni.utils.LorenzUtils;
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.ConfigEditorDraggableList;
import io.github.moulberry.moulconfig.annotations.ConfigEditorDropdown;
import io.github.moulberry.moulconfig.annotations.ConfigEditorKeybind;
import io.github.moulberry.moulconfig.annotations.ConfigEditorSlider;
import io.github.moulberry.moulconfig.annotations.ConfigEditorText;
import io.github.moulberry.moulconfig.annotations.ConfigOption;
import io.github.moulberry.moulconfig.annotations.*;
import io.github.moulberry.moulconfig.observer.Property;
import net.minecraft.client.Minecraft;
import org.lwjgl.input.Keyboard;
Expand Down Expand Up @@ -782,6 +774,16 @@ public static class EliteFarmingWeightConfig {
@ConfigOption(name = "Show below 200", desc = "Show the farming weight data even if you are below 200 weight.")
@ConfigEditorBoolean
public boolean ignoreLow = false;

@Expose
@ConfigOption(name = "Show outside garden", desc = "Show the farming weight outside of the garden.")
@ConfigEditorBoolean
public boolean showOutsideGarden = false;

@Expose
@ConfigOption(name = "Show outside SB", desc = "Show the farming weight outside of SkyBlock.")
Obsidianninja11 marked this conversation as resolved.
Show resolved Hide resolved
@ConfigEditorBoolean
public boolean showOutsideSB = false;
}

@Expose
Expand Down Expand Up @@ -937,9 +939,14 @@ public static class NextJacobContestConfig {
public boolean display = true;

@Expose
@ConfigOption(name = "Outside Garden", desc = "Show the timer not only in Garden but everywhere in SkyBlock.")
@ConfigOption(name = "Show Outside Garden", desc = "Show the timer outside of the Garden")
@ConfigEditorBoolean
public boolean everywhere = false;
public boolean showOutsideGarden = false;

@Expose
@ConfigOption(name = "Show Outside SB", desc = "Show the timer outside of SkyBlock.")
@ConfigEditorBoolean
public boolean showOutsideSB = false;

@Expose
@ConfigOption(name = "In Other Guis", desc = "Mark the current or next Farming Contest crops in other farming GUIs as underlined.")
Expand Down Expand Up @@ -1286,9 +1293,14 @@ public static class YawPitchDisplayConfig {
public boolean showWithoutTool = false;

@Expose
@ConfigOption(name = "Show Outside Garden", desc = "The overlay will work outside of the Garden.")
@ConfigOption(name = "Show Outside Garden", desc = "Show the overlay outside of the Garden.")
@ConfigEditorBoolean
public boolean showOutsideGarden = false;

@Expose
@ConfigOption(name = "Show Outside SB", desc = "Show the overlay outside of SkyBlock.")
@ConfigEditorBoolean
public boolean showEverywhere = false;
public boolean showOutsideSB = false;

@Expose
@ConfigOption(name = "Ignore Timeout", desc = "Ignore the timeout after not moving mouse.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ public class MarkedPlayerConfig {
@ConfigOption(name = "Mark Own Name", desc = "Mark own player name.")
@ConfigEditorBoolean()
public Property<Boolean> markOwnName = Property.of(false);

@Expose
@ConfigOption(name = "Mark Outside SB", desc = "Show marked players outside of SkyBlock.")
@ConfigEditorBoolean
public boolean markOutsideSB = true;
}
54 changes: 36 additions & 18 deletions src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,7 @@
import at.hannibal2.skyhanni.config.FeatureToggle;
import at.hannibal2.skyhanni.config.core.config.Position;
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.ConfigEditorColour;
import io.github.moulberry.moulconfig.annotations.ConfigEditorDraggableList;
import io.github.moulberry.moulconfig.annotations.ConfigEditorDropdown;
import io.github.moulberry.moulconfig.annotations.ConfigEditorKeybind;
import io.github.moulberry.moulconfig.annotations.ConfigEditorSlider;
import io.github.moulberry.moulconfig.annotations.ConfigEditorText;
import io.github.moulberry.moulconfig.annotations.ConfigOption;
import io.github.moulberry.moulconfig.annotations.*;
import io.github.moulberry.moulconfig.observer.Property;
import org.lwjgl.input.Keyboard;

Expand Down Expand Up @@ -445,6 +437,11 @@ public static class QuickModMenuSwitch {
@ConfigEditorBoolean
public boolean insidePlayerInventory = false;

@Expose
@ConfigOption(name = "Show Outside SB", desc = "Show the mod list outside of SkyBlock.")
@ConfigEditorBoolean
public boolean showOutsideSB = false;

@Expose
public Position pos = new Position(-178, 143, false, true);
}
Expand Down Expand Up @@ -488,6 +485,11 @@ public static class FollowingLineConfig {
@ConfigOption(name = "Behind Blocks", desc = "Show behind blocks.")
@ConfigEditorBoolean
public boolean behindBlocks = false;

@Expose
@ConfigOption(name = "Show Outside SB", desc = "Show the line outside of SkyBlock.")
@ConfigEditorBoolean
public boolean showOutsideSB = false;
}
}

Expand Down Expand Up @@ -539,6 +541,10 @@ public static class HighlightPartyMembers {
@ConfigEditorColour
public String outlineColor = "0:245:85:255:85";

@Expose
@ConfigOption(name = "Show Outside SB", desc = "Highlight party members outside of SkyBlock.")
@ConfigEditorBoolean
public boolean showOutsideSB = false;
}


Expand Down Expand Up @@ -664,6 +670,27 @@ public static class KickDurationConfig {
public Position position = new Position(400, 200, 1.3f);
}

@Expose
@ConfigOption(name = "Movement Speed", desc = "")
@Accordion
public MovementSpeedConfig movementSpeed = new MovementSpeedConfig();

public static class MovementSpeedConfig {
@Expose
@ConfigOption(name = "Movement Speed", desc = "Show the player movement speed in blocks per second.")
@ConfigEditorBoolean
@FeatureToggle
public boolean enabled = false;

@Expose
@ConfigOption(name = "Show Outside SB", desc = "Show the player movement speed outside of SkyBlock.")
@ConfigEditorBoolean
public boolean showOutsideSB = false;

@Expose
public Position position = new Position(394, 124, false, true);
}

@Expose
@ConfigOption(name = "Exp Bottles", desc = "Hides all the experience orbs lying on the ground.")
@ConfigEditorBoolean
Expand Down Expand Up @@ -715,15 +742,6 @@ public static class KickDurationConfig {
@FeatureToggle
public boolean pasteIntoSigns = true;

@Expose
@ConfigOption(name = "Movement Speed", desc = "Show the player movement speed in blocks per second.")
@ConfigEditorBoolean
@FeatureToggle
public boolean playerMovementSpeed = false;

@Expose
public Position playerMovementSpeedPos = new Position(394, 124, false, true);

@Expose
@ConfigOption(name = "Pet Candy Used", desc = "Show the number of Pet Candy used on a pet.")
@ConfigEditorBoolean
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import at.hannibal2.skyhanni.config.core.config.gui.GuiPositionEditor
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.LorenzKeyPressEvent
import at.hannibal2.skyhanni.test.SkyHanniDebugsAndTests
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.isRancherSign
import at.hannibal2.skyhanni.utils.NEUItems
import net.minecraft.client.Minecraft
Expand All @@ -21,7 +20,6 @@ import java.util.UUID
class GuiEditManager {
@SubscribeEvent
fun onKeyClick(event: LorenzKeyPressEvent) {
if (!LorenzUtils.inSkyBlock) return
if (event.keyCode != SkyHanniMod.feature.gui.keyBindOpen) return
if (isInGui()) return

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CosmeticFollowingLine {

@SubscribeEvent
fun onRenderWorld(event: LorenzRenderWorldEvent) {
if (!LorenzUtils.inSkyBlock) return
if (!LorenzUtils.inSkyBlock && !config.showOutsideSB) return
if (!config.enabled) return

updateClose(event)
Expand Down Expand Up @@ -96,7 +96,7 @@ class CosmeticFollowingLine {

@SubscribeEvent
fun onTick(event: LorenzTickEvent) {
if (!LorenzUtils.inSkyBlock) return
if (!LorenzUtils.inSkyBlock && !config.showOutsideSB) return
if (!config.enabled) return

if (event.isMod(5)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ object GardenNextJacobContest {
}
}

private fun isEnabled() = LorenzUtils.inSkyBlock && config.display
&& (GardenAPI.inGarden() || config.everywhere)
private fun isEnabled() = (LorenzUtils.inSkyBlock || config.showOutsideSB) && config.display
&& (GardenAPI.inGarden() || config.showOutsideGarden)

private fun isFetchEnabled() = isEnabled() && config.fetchAutomatically
private fun isSendEnabled() = isFetchEnabled() && config.shareAutomatically != 2 // 2 = Disabled
Expand Down
Obsidianninja11 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class GardenYawAndPitch {

@SubscribeEvent
fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) {
if (!LorenzUtils.inSkyBlock) return
if (!LorenzUtils.inSkyBlock && !config.showOutsideSB) return
if (!config.enabled) return
Obsidianninja11 marked this conversation as resolved.
Show resolved Hide resolved
if (GardenAPI.hideExtraGuis()) return
if (!GardenAPI.inGarden() && !config.showEverywhere) return
if (!GardenAPI.inGarden() && !config.showOutsideGarden) return
if (GardenAPI.toolInHand == null && !config.showWithoutTool) return

val player = Minecraft.getMinecraft().thePlayer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ class FarmingWeightDisplay {
}

private fun update() {
if (!GardenAPI.inGarden()) return
if (!LorenzUtils.inSkyBlock && !config.showOutsideSB) return
if (!GardenAPI.inGarden() && !config.showOutsideGarden) return
if (apiError) {
display = errorMessage
return
Expand Down Expand Up @@ -325,7 +326,8 @@ class FarmingWeightDisplay {
)
}

private fun isEnabled() = GardenAPI.inGarden() && config.display
private fun isEnabled() = (LorenzUtils.inSkyBlock || config.showOutsideSB) && (GardenAPI.inGarden() || config.showOutsideGarden) && config.display

private fun isEtaEnabled() = config.overtakeETA

fun addCrop(crop: CropType, addedCounter: Int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CustomTextBox {
@SubscribeEvent
fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) {
if (!config.enabled) return
if (!LorenzUtils.inSkyBlock) return
if (!LorenzUtils.inSkyBlock && !config.showOutsideSB) return

config.position.renderStrings(display, posLabel = "Custom Text Box")
}
Expand Down
Loading