ohyanoox / dialogueuiapi Goto Github PK
View Code? Open in Web Editor NEWDisplay and manage NPC dialogue interfaces
License: GNU Affero General Public License v3.0
Display and manage NPC dialogue interfaces
License: GNU Affero General Public License v3.0
Hello, I´ve tried to use your DialogueAPI, but whenever I click a Button nothing happens and I stay in the menu and cant do anything to close it
This is my code:
public function onCommand(CommandSender $sender, Command $cmd, string $label, array $args): bool
{
$dialogue = DialogueAPI::create("Tools-Dialogue", "blacksmith", "Welcome to my little forge, do you want to §abuy §ror §csell §rsomething?",
[
DialogueButton::create("§aBuy")
->setHandler(function (Player $player, string $buttonName): void
{
$this->ToolsUI($player);
}),
DialogueButton::create("§cSell")
->setHandler(function (Player $player, string $buttonName): void
{
$player->sendMessage("§cThis feature is comming soon...");
})]);
if ($cmd->getName() === "shop") {
if($sender instanceof Player){
$this->ShopUI($sender);
}
return true;
}
if ( $cmd->getName() === "tools") {
if($sender instanceof Player){
$dialogue->displayTo([$sender]);
}
}
return true;
}
Im trying to make a Tutorial for my server which uses your dialogue UI's, the actual code works when i use sendMessage. But when i try using dialogues nothing happens no errors in console, but nothing runs.
Im using this:
$skin = $player->getSkin();
$skinId = $skin->getSkinId();
$skinData = $skin->getSkinData();
$capeData = $skin->getCapeData();
$geometryName = $skin->getGeometryName();
$geometryData = $skin->getGeometryData();
$dialogue = DialogueAPI::create("Welcome", "Tour Guide", 0, "Hello" . $player->getName() . "Welcome to Emporium Prison! You are in the training area, this area will teach you about how things work in Emporium Prison. To get started get your pickaxe from the Tour Guide he can be found at the bottom of the stairs",
[DialogueButton::create("Next")]);
$entity = new Human((new Location(0, 0, 0, EmporiumCore::getInstance()->getServer()->getWorldManager()->getWorldByName("TutorialMine"), 0, 0)), new Skin($skinId, $skinData, $capeData, $geometryName, $geometryData), null);
$dialogue->displayTo([$player], $entity);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.