Skip to content

Commit

Permalink
Feature: Skymart Copper Price Bazaar Options (#2030)
Browse files Browse the repository at this point in the history
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
  • Loading branch information
Triggered0 and hannibal002 authored Jun 9, 2024
1 parent 60db3c6 commit 783c4f3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import at.hannibal2.skyhanni.config.core.config.Position;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider;
import io.github.notenoughupdates.moulconfig.annotations.ConfigLink;
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;
Expand All @@ -23,4 +24,26 @@ public class SkyMartConfig {
@Expose
@ConfigLink(owner = SkyMartConfig.class, field = "copperPrice")
public Position copperPricePos = new Position(211, 132, false, true);

@Expose
@ConfigOption(name = "Overlay Price", desc = "Toggle for Bazaar 'sell order' vs 'instant sell' price in copper price overlay.")
@ConfigEditorDropdown
public OverlayPriceTypeEntry overlayPriceType = OverlayPriceTypeEntry.INSTANT_SELL;

public enum OverlayPriceTypeEntry {
INSTANT_SELL("Instant Sell"),
SELL_ORDER("Sell Order"),
;
private final String str;


OverlayPriceTypeEntry(String str) {
this.str = str;
}

@Override
public String toString() {
return str;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.features.garden.inventory

import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.config.features.garden.SkyMartConfig
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.InventoryCloseEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
Expand Down Expand Up @@ -55,7 +56,8 @@ object SkyMartCopperPrice {
} ?: continue

val internalName = item.getInternalName()
val itemPrice = internalName.getPriceOrNull() ?: continue
val useSellPrice = config.overlayPriceType == SkyMartConfig.OverlayPriceTypeEntry.SELL_ORDER
val itemPrice = internalName.getPriceOrNull(useSellPrice) ?: continue
val profit = itemPrice - (otherItemsPrice ?: 0.0)

val factor = profit / copper
Expand Down

0 comments on commit 783c4f3

Please sign in to comment.