コード例 #1
0
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);
    }
}
コード例 #2
0
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);
    }
}
コード例 #3
0
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);
}
コード例 #4
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);
}