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

View file

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