Search in sources :

Example 1 with UsagePrompt

use of io.github.wysohn.triggerreactor.bukkit.tools.prompts.UsagePrompt in project TriggerReactor by wysohn.

the class ScriptEditManager method startEdit.

@Override
public void startEdit(ICommandSender sender, String title, String script, SaveHandler saveHandler) {
    ConversationFactory factory = new ConversationFactory(plugin.getMain());
    EditingPrompt prompt = new EditingPrompt(plugin.getMain(), sender.get(), new ScriptEditor(title, script, saveHandler));
    Conversation conv = factory.thatExcludesNonPlayersWithMessage("Sorry, this is in-game only feature!").withFirstPrompt(new UsagePrompt(prompt)).addConversationAbandonedListener(this).buildConversation(sender.get());
    conv.getContext().setSessionData("edit", prompt);
    conv.begin();
}
Also used : EditingPrompt(io.github.wysohn.triggerreactor.bukkit.tools.prompts.EditingPrompt) UsagePrompt(io.github.wysohn.triggerreactor.bukkit.tools.prompts.UsagePrompt) ConversationFactory(org.bukkit.conversations.ConversationFactory) Conversation(org.bukkit.conversations.Conversation) ScriptEditor(io.github.wysohn.triggerreactor.tools.ScriptEditor)

Aggregations

EditingPrompt (io.github.wysohn.triggerreactor.bukkit.tools.prompts.EditingPrompt)1 UsagePrompt (io.github.wysohn.triggerreactor.bukkit.tools.prompts.UsagePrompt)1 ScriptEditor (io.github.wysohn.triggerreactor.tools.ScriptEditor)1 Conversation (org.bukkit.conversations.Conversation)1 ConversationFactory (org.bukkit.conversations.ConversationFactory)1