Git Product home page Git Product logo

dialogueuiapi's People

Contributors

ohyanoox avatar poggit-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dialogueuiapi's Issues

Help creating the UI

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);

Bug when using Button

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;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.