示例#1
0
    void InventoryWindow::onFrame()
    {
        if (!mMainWidget->getVisible())
            return;

        updateEncumbranceBar();
    }
示例#2
0
void CompanionWindow::open(MWWorld::Ptr npc)
{
    openContainer(npc);
    setTitle(MWWorld::Class::get(npc).getName(npc));
    drawItems();
    updateEncumbranceBar();
}
示例#3
0
void CompanionWindow::onItemSelected(int index)
{
    if (mDragAndDrop->mIsOnDragAndDrop)
    {
        mDragAndDrop->drop(mModel, mItemView);
        updateEncumbranceBar();
        return;
    }

    const ItemStack& item = mSortModel->getItem(index);

    MWWorld::Ptr object = item.mBase;
    int count = item.mCount;
    bool shift = MyGUI::InputManager::getInstance().isShiftPressed();
    if (MyGUI::InputManager::getInstance().isControlPressed())
        count = 1;

    mSelectedItem = mSortModel->mapToSource(index);

    if (count > 1 && !shift)
    {
        CountDialog* dialog = MWBase::Environment::get().getWindowManager()->getCountDialog();
        dialog->open(object.getClass().getName(object), "#{sTake}", count);
        dialog->eventOkClicked.clear();
        dialog->eventOkClicked += MyGUI::newDelegate(this, &CompanionWindow::dragItem);
    }
    else
        dragItem (NULL, count);
}
示例#4
0
void CompanionWindow::onBackgroundSelected()
{
    if (mDragAndDrop->mIsOnDragAndDrop)
    {
        mDragAndDrop->drop(mModel, mItemView);
        updateEncumbranceBar();
    }
}
示例#5
0
void CompanionWindow::notifyItemDragged(MWWorld::Ptr item, int count)
{
    if (mPtr.getTypeName() == typeid(ESM::NPC).name())
    {
        MWMechanics::NpcStats& stats = MWWorld::Class::get(mPtr).getNpcStats(mPtr);
        stats.modifyProfit(MWWorld::Class::get(item).getValue(item) * count);
    }
    updateEncumbranceBar();
}
示例#6
0
    void InventoryWindow::open()
    {
        updateEncumbranceBar();

        mTrading = false;

        mBoughtItems.clear();

        onWindowResize(static_cast<MyGUI::Window*>(mMainWidget));
    }
示例#7
0
    void InventoryWindow::open()
    {
        mPtr = MWBase::Environment::get().getWorld()->getPlayerPtr();

        updateEncumbranceBar();

        mItemView->update();

        notifyContentChanged();
        adjustPanes();
    }
示例#8
0
void CompanionWindow::open(const MWWorld::Ptr& npc)
{
    mPtr = npc;
    updateEncumbranceBar();

    mModel = new CompanionItemModel(npc);
    mSortModel = new SortFilterItemModel(mModel);
    mItemView->setModel(mSortModel);

    setTitle(npc.getClass().getName(npc));
}
示例#9
0
    void InventoryWindow::open()
    {
        mPtr = MWMechanics::getPlayer();

        updateEncumbranceBar();

        mItemView->update();

        notifyContentChanged();
        adjustPanes();
    }
示例#10
0
void CompanionWindow::onFrame()
{
    updateEncumbranceBar();
}