diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-05-10 14:05:44 +0200 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-05-10 14:05:44 +0200 |
commit | d478e3cfb19c0347ba0b5513d3250af9d69443de (patch) | |
tree | aaba81bda1ee2e53e5e4d9fdad0c2998ba8edb0f /src/UI/Window.cpp | |
parent | Maybe coverage working? (diff) | |
parent | Merge pull request #992 from mc-server/coverity_fixes (diff) | |
download | cuberite-d478e3cfb19c0347ba0b5513d3250af9d69443de.tar cuberite-d478e3cfb19c0347ba0b5513d3250af9d69443de.tar.gz cuberite-d478e3cfb19c0347ba0b5513d3250af9d69443de.tar.bz2 cuberite-d478e3cfb19c0347ba0b5513d3250af9d69443de.tar.lz cuberite-d478e3cfb19c0347ba0b5513d3250af9d69443de.tar.xz cuberite-d478e3cfb19c0347ba0b5513d3250af9d69443de.tar.zst cuberite-d478e3cfb19c0347ba0b5513d3250af9d69443de.zip |
Diffstat (limited to 'src/UI/Window.cpp')
-rw-r--r-- | src/UI/Window.cpp | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/src/UI/Window.cpp b/src/UI/Window.cpp index 0a78578fc..46885390b 100644 --- a/src/UI/Window.cpp +++ b/src/UI/Window.cpp @@ -591,7 +591,7 @@ void cWindow::OnLeftPaintEnd(cPlayer & a_Player) const cSlotNums & SlotNums = a_Player.GetInventoryPaintSlots(); cItem ToDistribute(a_Player.GetDraggingItem()); - int ToEachSlot = (int)ToDistribute.m_ItemCount / SlotNums.size(); + int ToEachSlot = (int)ToDistribute.m_ItemCount / (int)SlotNums.size(); int NumDistributed = DistributeItemToSlots(a_Player, ToDistribute, ToEachSlot, SlotNums); @@ -805,6 +805,51 @@ cCraftingWindow::cCraftingWindow(int a_BlockX, int a_BlockY, int a_BlockZ) : /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// cAnvilWindow: + +cAnvilWindow::cAnvilWindow(int a_BlockX, int a_BlockY, int a_BlockZ) : + cWindow(wtAnvil, "Repair"), + m_RepairedItemName(""), + m_BlockX(a_BlockX), + m_BlockY(a_BlockY), + m_BlockZ(a_BlockZ) +{ + m_AnvilSlotArea = new cSlotAreaAnvil(*this); + m_SlotAreas.push_back(m_AnvilSlotArea); + m_SlotAreas.push_back(new cSlotAreaInventory(*this)); + m_SlotAreas.push_back(new cSlotAreaHotBar(*this)); +} + + + + + +void cAnvilWindow::SetRepairedItemName(const AString & a_Name, cPlayer * a_Player) +{ + m_RepairedItemName = a_Name; + + if (a_Player != NULL) + { + m_AnvilSlotArea->UpdateResult(*a_Player); + } +} + + + + + +void cAnvilWindow::GetBlockPos(int & a_PosX, int & a_PosY, int & a_PosZ) +{ + a_PosX = m_BlockX; + a_PosY = m_BlockY; + a_PosZ = m_BlockZ; +} + + + + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // cEnchantingWindow: cEnchantingWindow::cEnchantingWindow(int a_BlockX, int a_BlockY, int a_BlockZ) : |