Revert "Add initial kill counter to slayer task (#6654)"
This reverts commit 4104c04d37.
This commit is contained in:
@@ -136,24 +136,6 @@ public interface SlayerConfig extends Config
|
||||
)
|
||||
void amount(int amt);
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "initialAmount",
|
||||
name = "",
|
||||
description = "",
|
||||
hidden = true
|
||||
)
|
||||
default int initialAmount()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "initialAmount",
|
||||
name = "",
|
||||
description = ""
|
||||
)
|
||||
void initialAmount(int initAmt);
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "streak",
|
||||
name = "",
|
||||
|
||||
@@ -148,10 +148,6 @@ public class SlayerPlugin extends Plugin
|
||||
@Setter(AccessLevel.PACKAGE)
|
||||
private int amount;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@Setter(AccessLevel.PACKAGE)
|
||||
private int initialAmount;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@Setter(AccessLevel.PACKAGE)
|
||||
private int expeditiousChargeCount;
|
||||
@@ -191,7 +187,7 @@ public class SlayerPlugin extends Plugin
|
||||
streak = config.streak();
|
||||
setExpeditiousChargeCount(config.expeditious());
|
||||
setSlaughterChargeCount(config.slaughter());
|
||||
clientThread.invoke(() -> setTask(config.taskName(), config.amount(), config.initialAmount()));
|
||||
clientThread.invoke(() -> setTask(config.taskName(), config.amount()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,7 +217,6 @@ public class SlayerPlugin extends Plugin
|
||||
cachedXp = 0;
|
||||
taskName = "";
|
||||
amount = 0;
|
||||
initialAmount = 0;
|
||||
loginFlag = true;
|
||||
highlightedTargets.clear();
|
||||
break;
|
||||
@@ -234,7 +229,7 @@ public class SlayerPlugin extends Plugin
|
||||
streak = config.streak();
|
||||
setExpeditiousChargeCount(config.expeditious());
|
||||
setSlaughterChargeCount(config.slaughter());
|
||||
setTask(config.taskName(), config.amount(), config.initialAmount());
|
||||
setTask(config.taskName(), config.amount());
|
||||
loginFlag = false;
|
||||
}
|
||||
break;
|
||||
@@ -244,7 +239,6 @@ public class SlayerPlugin extends Plugin
|
||||
private void save()
|
||||
{
|
||||
config.amount(amount);
|
||||
config.initialAmount(initialAmount);
|
||||
config.taskName(taskName);
|
||||
config.points(points);
|
||||
config.streak(streak);
|
||||
@@ -283,7 +277,7 @@ public class SlayerPlugin extends Plugin
|
||||
|
||||
if (mAssign.find())
|
||||
{
|
||||
setTask(mAssign.group(2), Integer.parseInt(mAssign.group(1)), Integer.parseInt(mAssign.group(1)));
|
||||
setTask(mAssign.group(2), Integer.parseInt(mAssign.group(1)));
|
||||
}
|
||||
else if (mAssignFirst.find())
|
||||
{
|
||||
@@ -291,12 +285,12 @@ public class SlayerPlugin extends Plugin
|
||||
}
|
||||
else if (mAssignBoss.find())
|
||||
{
|
||||
setTask(mAssignBoss.group(1), Integer.parseInt(mAssignBoss.group(2)), Integer.parseInt(mAssignBoss.group(2)));
|
||||
setTask(mAssignBoss.group(1), Integer.parseInt(mAssignBoss.group(2)));
|
||||
points = Integer.parseInt(mAssignBoss.group(3).replaceAll(",", ""));
|
||||
}
|
||||
else if (mCurrent.find())
|
||||
{
|
||||
setTask(mCurrent.group(1), Integer.parseInt(mCurrent.group(2)), Integer.parseInt(mCurrent.group(2)));
|
||||
setTask(mCurrent.group(1), Integer.parseInt(mCurrent.group(2)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -419,13 +413,13 @@ public class SlayerPlugin extends Plugin
|
||||
default:
|
||||
log.warn("Unreachable default case for message ending in '; return to Slayer master'");
|
||||
}
|
||||
setTask("", 0, initialAmount);
|
||||
setTask("", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatMsg.equals(CHAT_GEM_COMPLETE_MESSAGE) || chatMsg.equals(CHAT_CANCEL_MESSAGE) || chatMsg.equals(CHAT_CANCEL_MESSAGE_JAD))
|
||||
{
|
||||
setTask("", 0, initialAmount);
|
||||
setTask("", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -441,7 +435,7 @@ public class SlayerPlugin extends Plugin
|
||||
{
|
||||
String gemTaskName = mProgress.group(1);
|
||||
int gemAmount = Integer.parseInt(mProgress.group(2));
|
||||
setTask(gemTaskName, gemAmount, initialAmount);
|
||||
setTask(gemTaskName, gemAmount);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -450,7 +444,7 @@ public class SlayerPlugin extends Plugin
|
||||
if (bracerProgress.find())
|
||||
{
|
||||
final int taskAmount = Integer.parseInt(bracerProgress.group(1));
|
||||
setTask(taskName, taskAmount, initialAmount);
|
||||
setTask(taskName, taskAmount);
|
||||
|
||||
// Avoid race condition (combat brace message goes through first before XP drop)
|
||||
amount++;
|
||||
@@ -590,11 +584,10 @@ public class SlayerPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
private void setTask(String name, int amt, int initAmt)
|
||||
private void setTask(String name, int amt)
|
||||
{
|
||||
taskName = name;
|
||||
amount = amt;
|
||||
initialAmount = initAmt;
|
||||
save();
|
||||
removeCounter();
|
||||
addCounter();
|
||||
@@ -607,38 +600,28 @@ public class SlayerPlugin extends Plugin
|
||||
|
||||
private void addCounter()
|
||||
{
|
||||
if (config.showInfobox() && counter == null && !Strings.isNullOrEmpty(taskName))
|
||||
if (!config.showInfobox() || counter != null || Strings.isNullOrEmpty(taskName))
|
||||
{
|
||||
Task task = Task.getTask(taskName);
|
||||
int itemSpriteId = ItemID.ENCHANTED_GEM;
|
||||
if (task != null)
|
||||
{
|
||||
itemSpriteId = task.getItemSpriteId();
|
||||
}
|
||||
|
||||
BufferedImage taskImg = itemManager.getImage(itemSpriteId);
|
||||
counter = new TaskCounter(taskImg, this, amount);
|
||||
infoBoxManager.addInfoBox(counter);
|
||||
return;
|
||||
}
|
||||
|
||||
if (counter != null && !Strings.isNullOrEmpty(taskName))
|
||||
Task task = Task.getTask(taskName);
|
||||
int itemSpriteId = ItemID.ENCHANTED_GEM;
|
||||
if (task != null)
|
||||
{
|
||||
String taskTooltip = ColorUtil.prependColorTag("%s</br>", new Color(255, 119, 0))
|
||||
+ ColorUtil.wrapWithColorTag("Pts:", Color.YELLOW)
|
||||
+ " %s</br>"
|
||||
+ ColorUtil.wrapWithColorTag("Streak:", Color.YELLOW)
|
||||
+ " %s";
|
||||
|
||||
// makes it so upon updating to track initialAmount people's previously active task won't show X/-1
|
||||
if (initialAmount != -1)
|
||||
{
|
||||
taskTooltip += "</br>"
|
||||
+ ColorUtil.wrapWithColorTag("Start:", Color.YELLOW)
|
||||
+ " " + initialAmount;
|
||||
|
||||
}
|
||||
counter.setTooltip(String.format(taskTooltip, capsString(taskName), points, streak));
|
||||
itemSpriteId = task.getItemSpriteId();
|
||||
}
|
||||
|
||||
BufferedImage taskImg = itemManager.getImage(itemSpriteId);
|
||||
final String taskTooltip = ColorUtil.prependColorTag("%s</br>", new Color(255, 119, 0))
|
||||
+ ColorUtil.wrapWithColorTag("Pts:", Color.YELLOW)
|
||||
+ " %s</br>"
|
||||
+ ColorUtil.wrapWithColorTag("Streak:", Color.YELLOW)
|
||||
+ " %s";
|
||||
counter = new TaskCounter(taskImg, this, amount);
|
||||
counter.setTooltip(String.format(taskTooltip, capsString(taskName), points, streak));
|
||||
|
||||
infoBoxManager.addInfoBox(counter);
|
||||
}
|
||||
|
||||
private void removeCounter()
|
||||
|
||||
Reference in New Issue
Block a user