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);
|
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(
|
@ConfigItem(
|
||||||
keyName = "streak",
|
keyName = "streak",
|
||||||
name = "",
|
name = "",
|
||||||
|
|||||||
@@ -148,10 +148,6 @@ public class SlayerPlugin extends Plugin
|
|||||||
@Setter(AccessLevel.PACKAGE)
|
@Setter(AccessLevel.PACKAGE)
|
||||||
private int amount;
|
private int amount;
|
||||||
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
@Setter(AccessLevel.PACKAGE)
|
|
||||||
private int initialAmount;
|
|
||||||
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
@Getter(AccessLevel.PACKAGE)
|
||||||
@Setter(AccessLevel.PACKAGE)
|
@Setter(AccessLevel.PACKAGE)
|
||||||
private int expeditiousChargeCount;
|
private int expeditiousChargeCount;
|
||||||
@@ -191,7 +187,7 @@ public class SlayerPlugin extends Plugin
|
|||||||
streak = config.streak();
|
streak = config.streak();
|
||||||
setExpeditiousChargeCount(config.expeditious());
|
setExpeditiousChargeCount(config.expeditious());
|
||||||
setSlaughterChargeCount(config.slaughter());
|
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;
|
cachedXp = 0;
|
||||||
taskName = "";
|
taskName = "";
|
||||||
amount = 0;
|
amount = 0;
|
||||||
initialAmount = 0;
|
|
||||||
loginFlag = true;
|
loginFlag = true;
|
||||||
highlightedTargets.clear();
|
highlightedTargets.clear();
|
||||||
break;
|
break;
|
||||||
@@ -234,7 +229,7 @@ public class SlayerPlugin extends Plugin
|
|||||||
streak = config.streak();
|
streak = config.streak();
|
||||||
setExpeditiousChargeCount(config.expeditious());
|
setExpeditiousChargeCount(config.expeditious());
|
||||||
setSlaughterChargeCount(config.slaughter());
|
setSlaughterChargeCount(config.slaughter());
|
||||||
setTask(config.taskName(), config.amount(), config.initialAmount());
|
setTask(config.taskName(), config.amount());
|
||||||
loginFlag = false;
|
loginFlag = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -244,7 +239,6 @@ public class SlayerPlugin extends Plugin
|
|||||||
private void save()
|
private void save()
|
||||||
{
|
{
|
||||||
config.amount(amount);
|
config.amount(amount);
|
||||||
config.initialAmount(initialAmount);
|
|
||||||
config.taskName(taskName);
|
config.taskName(taskName);
|
||||||
config.points(points);
|
config.points(points);
|
||||||
config.streak(streak);
|
config.streak(streak);
|
||||||
@@ -283,7 +277,7 @@ public class SlayerPlugin extends Plugin
|
|||||||
|
|
||||||
if (mAssign.find())
|
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())
|
else if (mAssignFirst.find())
|
||||||
{
|
{
|
||||||
@@ -291,12 +285,12 @@ public class SlayerPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
else if (mAssignBoss.find())
|
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(",", ""));
|
points = Integer.parseInt(mAssignBoss.group(3).replaceAll(",", ""));
|
||||||
}
|
}
|
||||||
else if (mCurrent.find())
|
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:
|
default:
|
||||||
log.warn("Unreachable default case for message ending in '; return to Slayer master'");
|
log.warn("Unreachable default case for message ending in '; return to Slayer master'");
|
||||||
}
|
}
|
||||||
setTask("", 0, initialAmount);
|
setTask("", 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chatMsg.equals(CHAT_GEM_COMPLETE_MESSAGE) || chatMsg.equals(CHAT_CANCEL_MESSAGE) || chatMsg.equals(CHAT_CANCEL_MESSAGE_JAD))
|
if (chatMsg.equals(CHAT_GEM_COMPLETE_MESSAGE) || chatMsg.equals(CHAT_CANCEL_MESSAGE) || chatMsg.equals(CHAT_CANCEL_MESSAGE_JAD))
|
||||||
{
|
{
|
||||||
setTask("", 0, initialAmount);
|
setTask("", 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -441,7 +435,7 @@ public class SlayerPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
String gemTaskName = mProgress.group(1);
|
String gemTaskName = mProgress.group(1);
|
||||||
int gemAmount = Integer.parseInt(mProgress.group(2));
|
int gemAmount = Integer.parseInt(mProgress.group(2));
|
||||||
setTask(gemTaskName, gemAmount, initialAmount);
|
setTask(gemTaskName, gemAmount);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -450,7 +444,7 @@ public class SlayerPlugin extends Plugin
|
|||||||
if (bracerProgress.find())
|
if (bracerProgress.find())
|
||||||
{
|
{
|
||||||
final int taskAmount = Integer.parseInt(bracerProgress.group(1));
|
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)
|
// Avoid race condition (combat brace message goes through first before XP drop)
|
||||||
amount++;
|
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;
|
taskName = name;
|
||||||
amount = amt;
|
amount = amt;
|
||||||
initialAmount = initAmt;
|
|
||||||
save();
|
save();
|
||||||
removeCounter();
|
removeCounter();
|
||||||
addCounter();
|
addCounter();
|
||||||
@@ -607,38 +600,28 @@ public class SlayerPlugin extends Plugin
|
|||||||
|
|
||||||
private void addCounter()
|
private void addCounter()
|
||||||
{
|
{
|
||||||
if (config.showInfobox() && counter == null && !Strings.isNullOrEmpty(taskName))
|
if (!config.showInfobox() || counter != null || Strings.isNullOrEmpty(taskName))
|
||||||
{
|
{
|
||||||
Task task = Task.getTask(taskName);
|
return;
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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))
|
itemSpriteId = task.getItemSpriteId();
|
||||||
+ 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));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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()
|
private void removeCounter()
|
||||||
|
|||||||
Reference in New Issue
Block a user