Compare commits

..

No commits in common. "ae7723b0d2fe80e3197aaa01e8930829c28f2f6e" and "21576a7b9a6a3b649058c8d3128183f19e532bcc" have entirely different histories.

2 changed files with 14 additions and 30 deletions

View file

@ -22,8 +22,6 @@ class plugin : Plugin() {
@Exposed(description = "Default: true, Use Local JSON or the prices from the Live/Stable server API") @Exposed(description = "Default: true, Use Local JSON or the prices from the Live/Stable server API")
private var useLiveGEPrices = true private var useLiveGEPrices = true
@Exposed(description = "Default: true, Toggle GE/HA price visibility")
private var displayPrices = true
@Exposed( "Default: 5,000 (blue)") @Exposed( "Default: 5,000 (blue)")
private var lowValue = 5000 private var lowValue = 5000
@Exposed( "Default: 20,000 (green)") @Exposed( "Default: 20,000 (green)")
@ -57,7 +55,7 @@ class plugin : Plugin() {
"::setmed" to "medium-value", "::setmed" to "medium-value",
"::sethigh" to "high-value", "::sethigh" to "high-value",
"::setinsane" to "insane-value", "::setinsane" to "insane-value",
"::sethide" to "hide-below-value", "::sethide" to "hide-below-value"
) )
override fun Init() { override fun Init() {
@ -67,7 +65,6 @@ class plugin : Plugin() {
insaneValue = GetData("insane-value") as? Int ?: 100000 insaneValue = GetData("insane-value") as? Int ?: 100000
hideBelowValue = GetData("hide-below-value") as? Int ?: 0 hideBelowValue = GetData("hide-below-value") as? Int ?: 0
useLiveGEPrices = GetData("ground-item-use-remote") as? Boolean ?: true useLiveGEPrices = GetData("ground-item-use-remote") as? Boolean ?: true
displayPrices = GetData("ground-item-display-price") as? Boolean ?: true
taggedItems = GetData("ground-item-tags")?.let { it.toString().split(",").mapNotNull { it.toIntOrNull() } } ?: emptyList() taggedItems = GetData("ground-item-tags")?.let { it.toString().split(",").mapNotNull { it.toIntOrNull() } } ?: emptyList()
ignoredItems = GetData("ground-item-ignore")?.let { it.toString().split(",").mapNotNull { it.toIntOrNull() } } ?: emptyList() ignoredItems = GetData("ground-item-ignore")?.let { it.toString().split(",").mapNotNull { it.toIntOrNull() } } ?: emptyList()
if (gePriceMap.isEmpty()) SendMessage("Ground Items unable to load GE Prices, Remote: $useLiveGEPrices") if (gePriceMap.isEmpty()) SendMessage("Ground Items unable to load GE Prices, Remote: $useLiveGEPrices")
@ -99,10 +96,6 @@ class plugin : Plugin() {
tagItem(id).run() tagItem(id).run()
} }
} }
"::displayprices" -> {
displayPrices = !displayPrices
SendMessage("Display Prices Set To: $displayPrices")
}
else -> { else -> {
commandMap[commandStr]?.let { key -> commandMap[commandStr]?.let { key ->
args?.get(0)?.toInt()?.let { valueArg -> args?.get(0)?.toInt()?.let { valueArg ->
@ -162,11 +155,7 @@ class plugin : Plugin() {
"0" -> "${itemDef.name}$amountSuffix (HA: $formattedHaValue gp)" "0" -> "${itemDef.name}$amountSuffix (HA: $formattedHaValue gp)"
else -> "${itemDef.name}$amountSuffix (GE: $formattedGeValue gp) (HA: $formattedHaValue gp)" else -> "${itemDef.name}$amountSuffix (GE: $formattedGeValue gp) (HA: $formattedHaValue gp)"
} }
if(displayPrices) { drawTextWithDropShadow(screenX, screenY - offset, colorInt, itemNameAndValue)
drawTextWithDropShadow(screenX, screenY - offset, colorInt, itemNameAndValue)
} else {
drawTextWithDropShadow(screenX, screenY - offset, colorInt, "${itemDef.name}$amountSuffix")
}
offset -= 12 offset -= 12
item = objstacknodeLL.next() as ObjStackNode? item = objstacknodeLL.next() as ObjStackNode?
@ -178,7 +167,7 @@ class plugin : Plugin() {
} }
private fun getDisplayedStackSize(objstacknodeLL: LinkedList): Int{ private fun getDisplayedStackSize(objstacknodeLL: LinkedList): Int{
var displayedStackSize = 0 var displayedStackSize = 0;
var stackItem = objstacknodeLL.head() as ObjStackNode? var stackItem = objstacknodeLL.head() as ObjStackNode?
while (stackItem != null) { while (stackItem != null) {
if(shouldDisplayItem(stackItem)){ if(shouldDisplayItem(stackItem)){
@ -186,7 +175,7 @@ class plugin : Plugin() {
} }
stackItem = objstacknodeLL.next() as ObjStackNode? stackItem = objstacknodeLL.next() as ObjStackNode?
} }
return displayedStackSize return displayedStackSize;
} }
private fun shouldDisplayItem(item: ObjStackNode): Boolean { private fun shouldDisplayItem(item: ObjStackNode): Boolean {
val itemDef = ObjTypeList.get(item.value.type) val itemDef = ObjTypeList.get(item.value.type)
@ -238,6 +227,7 @@ class plugin : Plugin() {
} }
} }
private fun resetConfig() { private fun resetConfig() {
lowValue = 5000 lowValue = 5000
mediumValue = 20000 mediumValue = 20000
@ -245,16 +235,14 @@ class plugin : Plugin() {
insaneValue = 100000 insaneValue = 100000
hideBelowValue = 0 hideBelowValue = 0
useLiveGEPrices = true useLiveGEPrices = true
displayPrices = true StoreData("ground-item-tags","");
StoreData("ground-item-tags","") StoreData("ground-item-ignore","");
StoreData("ground-item-ignore","")
StoreData("low-value", lowValue) StoreData("low-value", lowValue)
StoreData("ground-item-use-remote", useLiveGEPrices)
StoreData("medium-value", mediumValue) StoreData("medium-value", mediumValue)
StoreData("high-value", highValue) StoreData("high-value", highValue)
StoreData("insane-value", insaneValue) StoreData("insane-value", insaneValue)
StoreData("hide-below-value", hideBelowValue) StoreData("hide-below-value", hideBelowValue)
StoreData("ground-item-use-remote", useLiveGEPrices)
StoreData("ground-item-display-price", displayPrices)
} }
private fun displayRanges() { private fun displayRanges() {
@ -265,7 +253,6 @@ class plugin : Plugin() {
val hide = hideBelowValue val hide = hideBelowValue
SendMessage("== Ground Item Config ==") SendMessage("== Ground Item Config ==")
SendMessage("Display Prices: $displayPrices")
SendMessage("Low: $low") SendMessage("Low: $low")
SendMessage("Medium: $medium") SendMessage("Medium: $medium")
SendMessage("High: $high") SendMessage("High: $high")
@ -281,8 +268,7 @@ class plugin : Plugin() {
val itemDef = ObjTypeList.get(item) val itemDef = ObjTypeList.get(item)
SendMessage("Tagged: ${itemDef.name} ${itemDef.id}") SendMessage("Tagged: ${itemDef.name} ${itemDef.id}")
} }
SendMessage("cmds ::set(low,med,high,insane,hide), ::(tag,ignore)item ID, ::(reset)groundconfig,") SendMessage("cmds ::set(low,med,high,insane,hide), ::(tag,ignore)item ID, ::(reset)groundconfig")
SendMessage("::displayprices")
} }
private fun drawTextWithDropShadow(x: Int, y: Int, color: Int, text: String) { private fun drawTextWithDropShadow(x: Int, y: Int, color: Int, text: String) {
@ -291,16 +277,15 @@ class plugin : Plugin() {
} }
fun OnKondoValueUpdated() { fun OnKondoValueUpdated() {
StoreData("ground-item-tags",taggedItems) StoreData("ground-item-tags",taggedItems);
StoreData("ground-item-ignore",ignoredItems) StoreData("ground-item-ignore",ignoredItems);
StoreData("low-value", lowValue) StoreData("low-value", lowValue)
StoreData("medium-value", mediumValue) StoreData("medium-value", mediumValue)
StoreData("high-value", highValue) StoreData("high-value", highValue)
StoreData("insane-value", insaneValue) StoreData("insane-value", insaneValue)
StoreData("hide-below-value", hideBelowValue)
StoreData("ground-item-use-remote", useLiveGEPrices) StoreData("ground-item-use-remote", useLiveGEPrices)
StoreData("ground-item-display-price", displayPrices) StoreData("hide-below-value", hideBelowValue)
gePriceMap = loadGEPrices() gePriceMap = loadGEPrices();
} }
fun loadGEPrices(): Map<String, String> { fun loadGEPrices(): Map<String, String> {

View file

@ -4,6 +4,5 @@ Commands:\
::set(low,med,high,insane,hide)\ ::set(low,med,high,insane,hide)\
::(tag,ignore)item ID\ ::(tag,ignore)item ID\
::(reset)groundconfig\ ::(reset)groundconfig\
::displayprices\
Special thanks to Chisato for the original skeleton. Special thanks to Chisato for the original skeleton.
VERSION=1.4 VERSION=1.3