ohYanoox / DialogueUIAPI

Display and manage NPC dialogue interfaces
GNU Affero General Public License v3.0
9 stars 5 forks source link

Help creating the UI #1

Closed EmporiumPvP closed 1 year ago

EmporiumPvP commented 1 year ago

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);
ohYanoox commented 1 year ago

=> https://github.com/pmmp/PocketMine-MP/blob/4562cfb85bc5f8d9bd15077716eb9956e784c975/src/entity/Entity.php#L1497

I assume there's a delay between sending AddActorPacket (to spawn the entity to the client) and sending NpcDialoguePacket to display the dialog interface to the client.

However, I am adding a way to display a dialog interface without entity.

I close the ticket.

EmporiumPvP commented 1 year ago

Thank you it works ill let you know if i find any bugs