void Inventory::onRightHandSlotMouseDown(MouseEvent* event) { if (Game::getInstance()->mouse()->state() == Mouse::HAND) { auto itemUi = dynamic_cast<ImageList*>(event->emitter()); Game::getInstance()->pushState(new InventoryDragItem(itemUi)); } else { auto itemPID = Game::getInstance()->player()->rightHandSlot()->PID(); _screenShow(itemPID); } }
void InventoryState::onRightHandSlotMouseDown(std::shared_ptr<MouseEvent> event) { auto state = dynamic_cast<InventoryState*>(event->reciever()); if (Game::getInstance()->mouse()->type() == Mouse::HAND) { auto itemUi = dynamic_cast<ImageList*>(event->emitter()); Game::getInstance()->pushState(new InventoryDragItemState(itemUi)); } else { auto itemPID = Game::getInstance()->player()->rightHandSlot()->PID(); state->_screenShow(itemPID); } }
void Inventory::backgroundRightClick(MouseEvent* event) { auto mouse = Game::getInstance()->mouse(); if (mouse->state() == Mouse::ACTION) { mouse->pushState(Mouse::HAND); } else { mouse->popState(); //state->_screenShow(1); } _screenShow(0); }
void InventoryState::backgroundRightClick(std::shared_ptr<MouseEvent> event) { auto state = dynamic_cast<InventoryState*>(event->reciever()); auto mouse = Game::getInstance()->mouse(); if (mouse->type() == Mouse::ACTION) { mouse->setType(Mouse::HAND); } else { mouse->setType(Mouse::ACTION); //state->_screenShow(1); } state->_screenShow(0); }