Пример #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();
}