Files
2006Scape/2006Scape Server/src/main/java/com/rs2/game/dialogues/DialoguePlugin.java
T
Qweqker 8ee88848a3 Astraeus Dialogue System Port (#512)
* - Marked As Deprecated
- Reorganized DialogueOptions.java so that option buttons are grouped with each interface
- Added temporary Dialogue Executor to make new Dialogue System function
- Remove Man, Woman, and Banker Dialogue and Dialogue Options

* - Refactored Dialogue.java into DialoguePacket.java
- Moved DialoguePacket.java into impl packets package
- Added Astraeus dialogue executor

* - Removed useless file
- Reorganized the Misc.java file

* - Ported Astraeus Dialogue System
- Rewrote Man, Woman, and Banker Dialogues
- Added line splitter in AstraeusDialogueFactory.java

* - Renamed Astraeus* classes to *Plugin
- Fixed an issue where the Dialogue Option buttons were not executed through the Kotlin file

(cherry picked from commit 6deaa4162a)
2021-12-14 05:53:33 +00:00

37 lines
1.0 KiB
Java

package com.rs2.game.dialogues;
import com.google.common.collect.ImmutableList;
/**
* Represents an abstract dialogue, in which extending classes will be able to construct and send
* dialogues to a player.
*
* @author Vult-R
*/
public abstract class DialoguePlugin {
/**
* The action buttons responsible for dialogues.
*/
public static final ImmutableList<Integer> DIALOGUE_BUTTONS = ImmutableList.of(9157, 9167, 9178, 9190,
9158, 9168, 9179, 9191, 9169, 9180, 9192, 9181, 9193, 9194);
/**
* Sends a player a dialogue.
*
* @param factory The factory for this dialogue.
*/
public abstract void sendDialogues(DialogueFactoryPlugin factory);
/**
* Checks if the button triggered is an optional dialogue button.
*
* @param button The index of the button being checked.
*
* @return The result of the operation.
*/
public static final boolean isDialogueButton(int button) {
return DIALOGUE_BUTTONS.stream().anyMatch(search -> search == button);
}
}