Skip to content

v0.1.1

Latest
Compare
Choose a tag to compare
@Muqsit Muqsit released this 08 Apr 11:32
  • Added a property $update_existing to NpcDialogueManager::send() to update existing dialogue
  • Added an await-generator based asynchronous mechanism to request dialogues
    $name = "Hello, " . $player->getName();
    $text = "Click the Button!";
    $buttons = [SimpleNpcDialogueButton::simple("Click me")];
    $update_existing = false;
    while(true){
    	try{
    		$response = yield from NpcDialogueManager::request($player, $name, $text, buttons: $buttons, update_existing: $update_existing);
    	}catch(NpcDialogueException){
    		break; // closed, disconnected, or gave invalid response - see NpcDialogueException::getCode()
    	}
    	assert(isset($buttons[$response]));
    	$update_existing = true;
    	$text = "You clicked the button on " . (new DateTimeImmutable())->format("Y-m-d H:i:s");
    }
    https://i.imgur.com/2ky23TD.mp4
  • Fixed crashes when sending dialogues to players post-quit