Closed ghost closed 3 years ago
@Dapro718 Share InvMenu listener code
$menu->setListener(InvMenu::readonly(function(DeterministicInvMenuTransaction $transaction):void{
if($transaction->getItemClicked()->getId() === ItemIds::BOOK) {
$transaction->getPlayer()->removeWindow($transaction->getAction()->getInventory());
FormUI::sendHelpForm($transaction->getPlayer());
} elseif($transaction->getItemClicked()->getId() === BlockIds::CONCRETE && $transaction->getItemClicked()->getDamage() === 14){
$transaction->getPlayer()->removeWindow($transaction->getAction()->getInventory());
} elseif($transaction->getItemClicked()->getId() === BlockIds::CONCRETE && $transaction->getItemClicked()->getDamage() === 15){
$transaction->getPlayer()->removeWindow($transaction->getAction()->getInventory());
Forms::getDatabase()->updatePlayerSetting($transaction->getPlayer(), "formui");
$transaction->getPlayer()->sendMessage(C::colorize(
str_replace(["{prev_setting}". "{new_setting}"],
["Inventory UI", "Form UI"],
Forms::getMessage("setting-changed"))
));
}
}));
Can you open your player inventory after clicking the red concrete?
No. This problem happens with all the items. It can be fixed by having the player leave then rejoin.
This sounds like a client issue likely introduced in v1.16.210
PHPStorm shows that the namespace: Ds\Queue
is not found. Not sure if this effects anything.
Do you have any intentions to fix this bug?
When I use InvMenu->onClose(), the window works as expected, and players can receive more windows. The only time this issue occurs is when Player->removeWindow() is used.
The first time the player runs a command and is sent the inventory window, it works with no problem. After the window is removed, whenever the player runs the command again, the window does not appear. A chest also appears behind them, and when interacted with, disappears.
https://user-images.githubusercontent.com/60823817/111855257-33f7a000-88fa-11eb-8dc8-99aad349d61c.mp4