Varrock Museum Curator Haig Hele no longer gets stuck in endless "please waiting"
Achievement diary no longer gets completed on every repeated interaction with the Varrock Museum Curator Grammar fixes for shield of arrav quest
This commit is contained in:
@@ -130,13 +130,16 @@ abstract class DialogueFile {
|
||||
player?.dialogueInterpreter?.sendDialogue(*messages)
|
||||
}
|
||||
|
||||
fun showTopics(vararg topics: Topic<*>) {
|
||||
fun showTopics(vararg topics: Topic<*>): Boolean {
|
||||
val validTopics = ArrayList<String>()
|
||||
topics.filter { if(it is IfTopic) it.showCondition else true }.forEach {
|
||||
topic -> interpreter!!.activeTopics.add(topic)
|
||||
validTopics.add(topic.text)
|
||||
}
|
||||
if (validTopics.size == 1) {
|
||||
if(validTopics.size == 0) {
|
||||
return true
|
||||
}
|
||||
else if (validTopics.size == 1) {
|
||||
val topic = topics[0]
|
||||
if(topic.toStage is DialogueFile) {
|
||||
val topicFile = topic.toStage as DialogueFile
|
||||
@@ -146,7 +149,10 @@ abstract class DialogueFile {
|
||||
}
|
||||
player(topic.text)
|
||||
interpreter!!.activeTopics.clear()
|
||||
return false
|
||||
}
|
||||
else { options(*validTopics.toTypedArray())
|
||||
return false
|
||||
}
|
||||
else options(*validTopics.toTypedArray())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -362,7 +362,7 @@ public abstract class DialoguePlugin implements Plugin<Player> {
|
||||
return player(expr, splitLines(msg, 54));
|
||||
}
|
||||
|
||||
public void showTopics(Topic<?>... topics) {
|
||||
public boolean showTopics(Topic<?>... topics) {
|
||||
ArrayList<String> validTopics = new ArrayList<>();
|
||||
for(Topic<?> topic : topics)
|
||||
{
|
||||
@@ -370,21 +370,25 @@ public abstract class DialoguePlugin implements Plugin<Player> {
|
||||
interpreter.activeTopics.add(topic);
|
||||
validTopics.add(topic.getText());
|
||||
}
|
||||
|
||||
if (validTopics.size() == 1) {
|
||||
Topic topic = interpreter.activeTopics.get(0);
|
||||
|
||||
if(topic.getToStage() instanceof DialogueFile) {
|
||||
DialogueFile topicFile = (DialogueFile) topic.getToStage();
|
||||
interpreter.getDialogue().loadFile(topicFile);
|
||||
} else if(topic.getToStage() instanceof Integer) {
|
||||
stage = (Integer) topic.getToStage();
|
||||
}
|
||||
|
||||
player(topic.getText());
|
||||
interpreter.activeTopics.clear();
|
||||
if(validTopics.size() == 0) {
|
||||
return true;
|
||||
}
|
||||
else if (validTopics.size() == 1) {
|
||||
Topic topic = interpreter.activeTopics.get(0);
|
||||
if(topic.getToStage() instanceof DialogueFile) {
|
||||
DialogueFile topicFile = (DialogueFile) topic.getToStage();
|
||||
interpreter.getDialogue().loadFile(topicFile);
|
||||
}
|
||||
else if(topic.getToStage() instanceof Integer) {
|
||||
stage = (Integer) topic.getToStage();
|
||||
}
|
||||
player(topic.getText());
|
||||
interpreter.activeTopics.clear();
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
options(validTopics.toArray(new String[0]));
|
||||
return false;
|
||||
}
|
||||
|
||||
options(validTopics.toArray(new String[0]));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user