diff options
author | Mattes D <github@xoft.cz> | 2020-04-13 18:38:06 +0200 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2020-04-16 22:07:48 +0200 |
commit | 9ee47e59995f858ec531b3ee467f131594e4ba1f (patch) | |
tree | f005d8af4a0362d7eab8a96a71aca0d73275f8e1 /src/UI | |
parent | Prevent crash when breeding (diff) | |
download | cuberite-9ee47e59995f858ec531b3ee467f131594e4ba1f.tar cuberite-9ee47e59995f858ec531b3ee467f131594e4ba1f.tar.gz cuberite-9ee47e59995f858ec531b3ee467f131594e4ba1f.tar.bz2 cuberite-9ee47e59995f858ec531b3ee467f131594e4ba1f.tar.lz cuberite-9ee47e59995f858ec531b3ee467f131594e4ba1f.tar.xz cuberite-9ee47e59995f858ec531b3ee467f131594e4ba1f.tar.zst cuberite-9ee47e59995f858ec531b3ee467f131594e4ba1f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/UI/AnvilWindow.cpp | 2 | ||||
-rw-r--r-- | src/UI/AnvilWindow.h | 5 | ||||
-rw-r--r-- | src/UI/BeaconWindow.cpp | 6 | ||||
-rw-r--r-- | src/UI/BeaconWindow.h | 2 | ||||
-rw-r--r-- | src/UI/BrewingstandWindow.cpp | 8 | ||||
-rw-r--r-- | src/UI/BrewingstandWindow.h | 2 | ||||
-rw-r--r-- | src/UI/ChestWindow.cpp | 4 | ||||
-rw-r--r-- | src/UI/ChestWindow.h | 5 | ||||
-rw-r--r-- | src/UI/CraftingWindow.cpp | 6 | ||||
-rw-r--r-- | src/UI/CraftingWindow.h | 5 | ||||
-rw-r--r-- | src/UI/DropSpenserWindow.cpp | 6 | ||||
-rw-r--r-- | src/UI/DropSpenserWindow.h | 2 | ||||
-rw-r--r-- | src/UI/EnchantingWindow.cpp | 8 | ||||
-rw-r--r-- | src/UI/EnchantingWindow.h | 5 | ||||
-rw-r--r-- | src/UI/EnderChestWindow.cpp | 4 | ||||
-rw-r--r-- | src/UI/EnderChestWindow.h | 5 | ||||
-rw-r--r-- | src/UI/FurnaceWindow.cpp | 6 | ||||
-rw-r--r-- | src/UI/FurnaceWindow.h | 2 | ||||
-rw-r--r-- | src/UI/HopperWindow.cpp | 6 | ||||
-rw-r--r-- | src/UI/HopperWindow.h | 5 | ||||
-rw-r--r-- | src/UI/InventoryWindow.cpp | 8 | ||||
-rw-r--r-- | src/UI/InventoryWindow.h | 5 | ||||
-rw-r--r-- | src/UI/MinecartWithChestWindow.h | 9 | ||||
-rw-r--r-- | src/UI/SlotArea.cpp | 32 | ||||
-rw-r--r-- | src/UI/SlotArea.h | 82 |
25 files changed, 126 insertions, 104 deletions
diff --git a/src/UI/AnvilWindow.cpp b/src/UI/AnvilWindow.cpp index daa35cf47..6d1d673df 100644 --- a/src/UI/AnvilWindow.cpp +++ b/src/UI/AnvilWindow.cpp @@ -75,7 +75,7 @@ void cAnvilWindow::DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer & a_ // Inventory or Hotbar AreasInOrder.push_back(m_SlotAreas[0]); /* Anvil */ } - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); } diff --git a/src/UI/AnvilWindow.h b/src/UI/AnvilWindow.h index e23c744fe..0b9a0e27e 100644 --- a/src/UI/AnvilWindow.h +++ b/src/UI/AnvilWindow.h @@ -15,12 +15,13 @@ -class cAnvilWindow : +class cAnvilWindow: public cWindow { - typedef cWindow super; + using Super = cWindow; public: + cAnvilWindow(int a_BlockX, int a_BlockY, int a_BlockZ); /** Gets the repaired item name. */ diff --git a/src/UI/BeaconWindow.cpp b/src/UI/BeaconWindow.cpp index e0e9b9c5c..d72eb5603 100644 --- a/src/UI/BeaconWindow.cpp +++ b/src/UI/BeaconWindow.cpp @@ -35,7 +35,7 @@ void cBeaconWindow::DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer & a // Beacon Area AreasInOrder.push_back(m_SlotAreas[2]); /* Hotbar */ AreasInOrder.push_back(m_SlotAreas[1]); /* Inventory */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); } else { @@ -54,7 +54,7 @@ void cBeaconWindow::DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer & a // Hotbar Area AreasInOrder.push_back(m_SlotAreas[1]); /* Inventory */ } - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); } } @@ -64,7 +64,7 @@ void cBeaconWindow::DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer & a void cBeaconWindow::OpenedByPlayer(cPlayer & a_Player) { - super::OpenedByPlayer(a_Player); + Super::OpenedByPlayer(a_Player); a_Player.GetClientHandle()->SendWindowProperty(*this, 0, m_Beacon->GetBeaconLevel()); a_Player.GetClientHandle()->SendWindowProperty(*this, 1, m_Beacon->GetPrimaryEffect()); diff --git a/src/UI/BeaconWindow.h b/src/UI/BeaconWindow.h index 14f7456b4..4b40bd635 100644 --- a/src/UI/BeaconWindow.h +++ b/src/UI/BeaconWindow.h @@ -19,7 +19,7 @@ class cBeaconWindow : public cWindow { - using super = cWindow; + using Super = cWindow; public: cBeaconWindow(cBeaconEntity * a_Beacon); diff --git a/src/UI/BrewingstandWindow.cpp b/src/UI/BrewingstandWindow.cpp index 08fb7d93f..928eef7a8 100644 --- a/src/UI/BrewingstandWindow.cpp +++ b/src/UI/BrewingstandWindow.cpp @@ -14,7 +14,7 @@ cBrewingstandWindow::cBrewingstandWindow(cBrewingstandEntity * a_Brewingstand): - super(wtBrewery, "Brewingstand") + Super(wtBrewery, "Brewingstand") { m_SlotAreas.push_back(new cSlotAreaBrewingstand(a_Brewingstand, *this)); m_SlotAreas.push_back(new cSlotAreaInventory(*this)); @@ -36,13 +36,13 @@ void cBrewingstandWindow::DistributeStack(cItem & a_ItemStack, int a_Slot, cPlay // Brewing stand Area AreasInOrder.push_back(m_SlotAreas[2]); /* Hotbar */ AreasInOrder.push_back(m_SlotAreas[1]); /* Inventory */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); } else { AreasInOrder.push_back(m_SlotAreas[1]); /* Inventory */ AreasInOrder.push_back(m_SlotAreas[2]); /* Hotbar */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); } } else @@ -63,6 +63,6 @@ void cBrewingstandWindow::DistributeStack(cItem & a_ItemStack, int a_Slot, cPlay AreasInOrder.push_back(m_SlotAreas[1]); /* Inventory */ } - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); } } diff --git a/src/UI/BrewingstandWindow.h b/src/UI/BrewingstandWindow.h index 9c89d29bd..97838ccfc 100644 --- a/src/UI/BrewingstandWindow.h +++ b/src/UI/BrewingstandWindow.h @@ -18,7 +18,7 @@ class cBrewingstandWindow : public cWindow { - using super = cWindow; + using Super = cWindow; public: diff --git a/src/UI/ChestWindow.cpp b/src/UI/ChestWindow.cpp index 03347dfed..56c1c96e6 100644 --- a/src/UI/ChestWindow.cpp +++ b/src/UI/ChestWindow.cpp @@ -115,13 +115,13 @@ void cChestWindow::DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer & a_ // Chest Area AreasInOrder.push_back(m_SlotAreas[2]); /* Hotbar */ AreasInOrder.push_back(m_SlotAreas[1]); /* Inventory */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); } else { // Hotbar or Inventory AreasInOrder.push_back(m_SlotAreas[0]); /* Chest */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); } } diff --git a/src/UI/ChestWindow.h b/src/UI/ChestWindow.h index 932f7a2ec..18f330519 100644 --- a/src/UI/ChestWindow.h +++ b/src/UI/ChestWindow.h @@ -15,12 +15,13 @@ -class cChestWindow : +class cChestWindow: public cWindow { - typedef cWindow super; + using Super = cWindow; public: + cChestWindow(cChestEntity * a_Chest); cChestWindow(cChestEntity * a_PrimaryChest, cChestEntity * a_SecondaryChest); diff --git a/src/UI/CraftingWindow.cpp b/src/UI/CraftingWindow.cpp index ca44056f9..b5e7ec5a9 100644 --- a/src/UI/CraftingWindow.cpp +++ b/src/UI/CraftingWindow.cpp @@ -40,19 +40,19 @@ void cCraftingWindow::DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer & AreasInOrder.push_back(m_SlotAreas[1]); /* Inventory */ AreasInOrder.push_back(m_SlotAreas[2]); /* Hotbar */ } - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, (a_Slot == 0)); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, (a_Slot == 0)); } else if (a_ClickedArea == m_SlotAreas[1]) { // Inventory Area AreasInOrder.push_back(m_SlotAreas[2]); /* Hotbar */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); } else { // Hotbar AreasInOrder.push_back(m_SlotAreas[1]); /* Inventory */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); } } diff --git a/src/UI/CraftingWindow.h b/src/UI/CraftingWindow.h index 01b2da73a..2412bfdd7 100644 --- a/src/UI/CraftingWindow.h +++ b/src/UI/CraftingWindow.h @@ -15,12 +15,13 @@ -class cCraftingWindow : +class cCraftingWindow: public cWindow { - typedef cWindow super; + using Super = cWindow; public: + cCraftingWindow(int a_BlockX, int a_BlockY, int a_BlockZ); virtual void DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer & a_Player, cSlotArea * a_ClickedArea, bool a_ShouldApply) override; diff --git a/src/UI/DropSpenserWindow.cpp b/src/UI/DropSpenserWindow.cpp index 38b38e56f..8949d8fe0 100644 --- a/src/UI/DropSpenserWindow.cpp +++ b/src/UI/DropSpenserWindow.cpp @@ -12,7 +12,7 @@ cDropSpenserWindow::cDropSpenserWindow(cDropSpenserEntity * a_DropSpenser): - super(wtDropSpenser, (a_DropSpenser->GetBlockType() == E_BLOCK_DISPENSER) ? "Dispenser" : "Dropper") + Super(wtDropSpenser, (a_DropSpenser->GetBlockType() == E_BLOCK_DISPENSER) ? "Dispenser" : "Dropper") { m_SlotAreas.push_back(new cSlotAreaItemGrid(a_DropSpenser->GetContents(), *this)); m_SlotAreas.push_back(new cSlotAreaInventory(*this)); @@ -32,13 +32,13 @@ void cDropSpenserWindow::DistributeStack(cItem & a_ItemStack, int a_Slot, cPlaye // DropSpenser Area AreasInOrder.push_back(m_SlotAreas[2]); /* Hotbar */ AreasInOrder.push_back(m_SlotAreas[1]); /* Inventory */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); } else { // Inventory or Hotbar AreasInOrder.push_back(m_SlotAreas[0]); /* DropSpenser */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); } } diff --git a/src/UI/DropSpenserWindow.h b/src/UI/DropSpenserWindow.h index d24c3b7a3..0fb961712 100644 --- a/src/UI/DropSpenserWindow.h +++ b/src/UI/DropSpenserWindow.h @@ -19,7 +19,7 @@ class cDropSpenserWindow : public cWindow { - using super = cWindow; + using Super = cWindow; public: cDropSpenserWindow(cDropSpenserEntity * a_DropSpenser); diff --git a/src/UI/EnchantingWindow.cpp b/src/UI/EnchantingWindow.cpp index 5ac75a2da..3e0f2cd4c 100644 --- a/src/UI/EnchantingWindow.cpp +++ b/src/UI/EnchantingWindow.cpp @@ -37,7 +37,7 @@ void cEnchantingWindow::SetProperty(short a_Property, short a_Value, cPlayer & a } m_PropertyValue[a_Property] = a_Value; - super::SetProperty(a_Property, a_Value, a_Player); + Super::SetProperty(a_Property, a_Value, a_Player); } @@ -53,7 +53,7 @@ void cEnchantingWindow::SetProperty(short a_Property, short a_Value) } m_PropertyValue[a_Property] = a_Value; - super::SetProperty(a_Property, a_Value); + Super::SetProperty(a_Property, a_Value); } @@ -84,13 +84,13 @@ void cEnchantingWindow::DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer // Enchanting Area AreasInOrder.push_back(m_SlotAreas[2]); /* Hotbar */ AreasInOrder.push_back(m_SlotAreas[1]); /* Inventory */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); } else { // Inventory or Hotbar AreasInOrder.push_back(m_SlotAreas[0]); /* Enchanting */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); } } diff --git a/src/UI/EnchantingWindow.h b/src/UI/EnchantingWindow.h index bf805c6c8..61a40036f 100644 --- a/src/UI/EnchantingWindow.h +++ b/src/UI/EnchantingWindow.h @@ -15,12 +15,13 @@ -class cEnchantingWindow : +class cEnchantingWindow: public cWindow { - typedef cWindow super; + using Super = cWindow; public: + cEnchantingWindow(int a_BlockX, int a_BlockY, int a_BlockZ); virtual void SetProperty(short a_Property, short a_Value, cPlayer & a_Player) override; diff --git a/src/UI/EnderChestWindow.cpp b/src/UI/EnderChestWindow.cpp index 9f8a891ad..4b48f7ad2 100644 --- a/src/UI/EnderChestWindow.cpp +++ b/src/UI/EnderChestWindow.cpp @@ -63,13 +63,13 @@ void cEnderChestWindow::DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer // Chest Area AreasInOrder.push_back(m_SlotAreas[2]); /* Hotbar */ AreasInOrder.push_back(m_SlotAreas[1]); /* Inventory */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); } else { // Hotbar or Inventory AreasInOrder.push_back(m_SlotAreas[0]); /* Chest */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); } } diff --git a/src/UI/EnderChestWindow.h b/src/UI/EnderChestWindow.h index b14c760e1..491e94a2a 100644 --- a/src/UI/EnderChestWindow.h +++ b/src/UI/EnderChestWindow.h @@ -16,12 +16,13 @@ -class cEnderChestWindow : +class cEnderChestWindow: public cWindow { - typedef cWindow super; + using Super = cWindow; public: + cEnderChestWindow(cEnderChestEntity * a_EnderChest); virtual ~cEnderChestWindow() override; diff --git a/src/UI/FurnaceWindow.cpp b/src/UI/FurnaceWindow.cpp index d4447b8ee..7be7a92d6 100644 --- a/src/UI/FurnaceWindow.cpp +++ b/src/UI/FurnaceWindow.cpp @@ -37,14 +37,14 @@ void cFurnaceWindow::DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer & // Result Slot AreasInOrder.push_back(m_SlotAreas[2]); /* Hotbar */ AreasInOrder.push_back(m_SlotAreas[1]); /* Inventory */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); } else { // Furnace Input / Fuel Slot AreasInOrder.push_back(m_SlotAreas[1]); /* Inventory */ AreasInOrder.push_back(m_SlotAreas[2]); /* Hotbar */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); } } else @@ -65,7 +65,7 @@ void cFurnaceWindow::DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer & // Hotbar Area AreasInOrder.push_back(m_SlotAreas[1]); /* Inventory */ } - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); } } diff --git a/src/UI/FurnaceWindow.h b/src/UI/FurnaceWindow.h index d10485563..9cea458f6 100644 --- a/src/UI/FurnaceWindow.h +++ b/src/UI/FurnaceWindow.h @@ -18,7 +18,7 @@ class cFurnaceWindow : public cWindow { - using super = cWindow; + using Super = cWindow; public: cFurnaceWindow(cFurnaceEntity * a_Furnace); diff --git a/src/UI/HopperWindow.cpp b/src/UI/HopperWindow.cpp index db79e6857..8ac90401b 100644 --- a/src/UI/HopperWindow.cpp +++ b/src/UI/HopperWindow.cpp @@ -14,7 +14,7 @@ cHopperWindow::cHopperWindow(cHopperEntity * a_Hopper): - super(wtHopper, "Hopper") + Super(wtHopper, "Hopper") { m_SlotAreas.push_back(new cSlotAreaItemGrid(a_Hopper->GetContents(), *this)); m_SlotAreas.push_back(new cSlotAreaInventory(*this)); @@ -34,13 +34,13 @@ void cHopperWindow::DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer & a // Hopper Area AreasInOrder.push_back(m_SlotAreas[2]); /* Hotbar */ AreasInOrder.push_back(m_SlotAreas[1]); /* Inventory */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); } else { // Inventory or Hotbar AreasInOrder.push_back(m_SlotAreas[0]); /* Hopper */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); } } diff --git a/src/UI/HopperWindow.h b/src/UI/HopperWindow.h index b4a0cef84..98bfccbb3 100644 --- a/src/UI/HopperWindow.h +++ b/src/UI/HopperWindow.h @@ -15,12 +15,13 @@ -class cHopperWindow : +class cHopperWindow: public cWindow { - typedef cWindow super; + using Super = cWindow; public: + cHopperWindow(cHopperEntity * a_Hopper); virtual void DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer & a_Player, cSlotArea * a_ClickedArea, bool a_ShouldApply) override; diff --git a/src/UI/InventoryWindow.cpp b/src/UI/InventoryWindow.cpp index 571651d20..3c787ff7c 100644 --- a/src/UI/InventoryWindow.cpp +++ b/src/UI/InventoryWindow.cpp @@ -44,28 +44,28 @@ void cInventoryWindow::DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer AreasInOrder.push_back(m_SlotAreas[2]); /* Inventory */ AreasInOrder.push_back(m_SlotAreas[3]); /* Hotbar */ } - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, (a_Slot == 0)); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, (a_Slot == 0)); } else if (a_ClickedArea == m_SlotAreas[1]) { // Armor Area AreasInOrder.push_back(m_SlotAreas[2]); /* Inventory */ AreasInOrder.push_back(m_SlotAreas[3]); /* Hotbar */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); } else if (a_ClickedArea == m_SlotAreas[2]) { // Inventory Area AreasInOrder.push_back(m_SlotAreas[1]); /* Armor */ AreasInOrder.push_back(m_SlotAreas[3]); /* Hotbar */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); } else { // Hotbar AreasInOrder.push_back(m_SlotAreas[1]); /* Armor */ AreasInOrder.push_back(m_SlotAreas[2]); /* Inventory */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); } } diff --git a/src/UI/InventoryWindow.h b/src/UI/InventoryWindow.h index c02dcfbbb..108f58fa0 100644 --- a/src/UI/InventoryWindow.h +++ b/src/UI/InventoryWindow.h @@ -15,12 +15,13 @@ -class cInventoryWindow : +class cInventoryWindow: public cWindow { - typedef cWindow super; + using Super = cWindow; public: + cInventoryWindow(cPlayer & a_Player); virtual void DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer & a_Player, cSlotArea * a_ClickedArea, bool a_ShouldApply) override; diff --git a/src/UI/MinecartWithChestWindow.h b/src/UI/MinecartWithChestWindow.h index 80d1ebfce..7303ecf96 100644 --- a/src/UI/MinecartWithChestWindow.h +++ b/src/UI/MinecartWithChestWindow.h @@ -16,12 +16,13 @@ -class cMinecartWithChestWindow : +class cMinecartWithChestWindow: public cWindow { - typedef cWindow super; + using Super = cWindow; public: + cMinecartWithChestWindow(cMinecartWithChest * a_ChestCart) : cWindow(wtChest, "Minecart with Chest"), m_ChestCart(a_ChestCart) @@ -42,13 +43,13 @@ public: // Chest Area AreasInOrder.push_back(m_SlotAreas[2]); /* Hotbar */ AreasInOrder.push_back(m_SlotAreas[1]); /* Inventory */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); } else { // Hotbar or Inventory AreasInOrder.push_back(m_SlotAreas[0]); /* Chest */ - super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); + Super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); } } diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index 84e6efb77..5c00c918e 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -543,7 +543,7 @@ void cSlotAreaCrafting::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction return; } - super::Clicked(a_Player, a_SlotNum, a_ClickAction, a_ClickedItem); + Super::Clicked(a_Player, a_SlotNum, a_ClickAction, a_ClickedItem); UpdateRecipe(a_Player); } @@ -558,7 +558,7 @@ void cSlotAreaCrafting::DblClicked(cPlayer & a_Player, int a_SlotNum) // Dbl-clicking the crafting result slot shouldn't collect items to hand return; } - super::DblClicked(a_Player, a_SlotNum); + Super::DblClicked(a_Player, a_SlotNum); } @@ -590,7 +590,7 @@ void cSlotAreaCrafting::OnPlayerRemoved(cPlayer & a_Player) void cSlotAreaCrafting::SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) { // Update the recipe after setting the slot, if the slot is not the result slot: - super::SetSlot(a_SlotNum, a_Player, a_Item); + Super::SetSlot(a_SlotNum, a_Player, a_Item); if (a_SlotNum != 0) { UpdateRecipe(a_Player); @@ -799,7 +799,7 @@ void cSlotAreaAnvil::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_C ASSERT((a_SlotNum >= 0) && (a_SlotNum < GetNumSlots())); if (a_SlotNum != 2) { - super::Clicked(a_Player, a_SlotNum, a_ClickAction, a_ClickedItem); + Super::Clicked(a_Player, a_SlotNum, a_ClickAction, a_ClickedItem); UpdateResult(a_Player); return; } @@ -895,7 +895,7 @@ void cSlotAreaAnvil::ShiftClicked(cPlayer & a_Player, int a_SlotNum, const cItem { if (a_SlotNum != 2) { - super::ShiftClicked(a_Player, a_SlotNum, a_ClickedItem); + Super::ShiftClicked(a_Player, a_SlotNum, a_ClickedItem); UpdateResult(a_Player); return; } @@ -1052,7 +1052,7 @@ bool cSlotAreaAnvil::CanTakeResultItem(cPlayer & a_Player) void cSlotAreaAnvil::OnPlayerRemoved(cPlayer & a_Player) { TossItems(a_Player, 0, 2); - super::OnPlayerRemoved(a_Player); + Super::OnPlayerRemoved(a_Player); } @@ -1580,7 +1580,7 @@ void cSlotAreaEnchanting::DistributeStack(cItem & a_ItemStack, cPlayer & a_Playe void cSlotAreaEnchanting::OnPlayerAdded(cPlayer & a_Player) { - super::OnPlayerAdded(a_Player); + Super::OnPlayerAdded(a_Player); UpdateResult(a_Player); } @@ -1593,7 +1593,7 @@ void cSlotAreaEnchanting::OnPlayerRemoved(cPlayer & a_Player) // Toss the item in the enchanting slot, as well as lapis TossItems(a_Player, 0, m_NumSlots); - super::OnPlayerRemoved(a_Player); + Super::OnPlayerRemoved(a_Player); } @@ -1602,7 +1602,7 @@ void cSlotAreaEnchanting::OnPlayerRemoved(cPlayer & a_Player) void cSlotAreaEnchanting::SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) { - super::SetSlot(a_SlotNum, a_Player, a_Item); + Super::SetSlot(a_SlotNum, a_Player, a_Item); UpdateResult(a_Player); } @@ -1878,7 +1878,7 @@ void cSlotAreaFurnace::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a return; } - super::Clicked(a_Player, a_SlotNum, a_ClickAction, a_ClickedItem); + Super::Clicked(a_Player, a_SlotNum, a_ClickAction, a_ClickedItem); } @@ -2056,7 +2056,7 @@ void cSlotAreaBrewingstand::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAct { HandleBrewedItem(a_Player, Slot); } - super::ShiftClicked(a_Player, a_SlotNum, Slot); + Super::ShiftClicked(a_Player, a_SlotNum, Slot); break; } default: @@ -2079,7 +2079,7 @@ void cSlotAreaBrewingstand::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAct case caShiftLeftClick: case caShiftRightClick: { - super::ShiftClicked(a_Player, a_SlotNum, Slot); + Super::ShiftClicked(a_Player, a_SlotNum, Slot); break; } default: @@ -2102,7 +2102,7 @@ void cSlotAreaBrewingstand::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAct case caShiftLeftClick: case caShiftRightClick: { - super::ShiftClicked(a_Player, a_SlotNum, Slot); + Super::ShiftClicked(a_Player, a_SlotNum, Slot); break; } default: @@ -2117,7 +2117,7 @@ void cSlotAreaBrewingstand::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAct } } - super::Clicked(a_Player, a_SlotNum, a_ClickAction, a_ClickedItem); + Super::Clicked(a_Player, a_SlotNum, a_ClickAction, a_ClickedItem); } @@ -2296,7 +2296,7 @@ void cSlotAreaInventoryBase::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAc } // Survival inventory and all other windows' inventory has the same handling as normal slot areas - super::Clicked(a_Player, a_SlotNum, a_ClickAction, a_ClickedItem); + Super::Clicked(a_Player, a_SlotNum, a_ClickAction, a_ClickedItem); return; } @@ -2469,7 +2469,7 @@ bool cSlotAreaArmor::CanPlaceArmorInSlot(int a_SlotNum, const cItem & a_Item) // cSlotAreaItemGrid: cSlotAreaItemGrid::cSlotAreaItemGrid(cItemGrid & a_ItemGrid, cWindow & a_ParentWindow) : - super(a_ItemGrid.GetNumSlots(), a_ParentWindow), + Super(a_ItemGrid.GetNumSlots(), a_ParentWindow), m_ItemGrid(a_ItemGrid) { m_ItemGrid.AddListener(*this); diff --git a/src/UI/SlotArea.h b/src/UI/SlotArea.h index 4463cb315..a744fea2c 100644 --- a/src/UI/SlotArea.h +++ b/src/UI/SlotArea.h @@ -91,12 +91,13 @@ protected: /** Handles any part of the inventory, using parameters in constructor to distinguish between the parts */ -class cSlotAreaInventoryBase : +class cSlotAreaInventoryBase: public cSlotArea { - typedef cSlotArea super; + using Super = cSlotArea; public: + cSlotAreaInventoryBase(int a_NumSlots, int a_SlotOffset, cWindow & a_ParentWindow); // Creative inventory's click handling is somewhat different from survival inventory's, handle that here: @@ -114,14 +115,15 @@ protected: /** Handles the main inventory of each player, excluding the armor and hotbar */ -class cSlotAreaInventory : +class cSlotAreaInventory: public cSlotAreaInventoryBase { - typedef cSlotAreaInventoryBase super; + using Super = cSlotAreaInventoryBase; public: - cSlotAreaInventory(cWindow & a_ParentWindow) : - cSlotAreaInventoryBase(cInventory::invInventoryCount, cInventory::invInventoryOffset, a_ParentWindow) + + cSlotAreaInventory(cWindow & a_ParentWindow): + Super(cInventory::invInventoryCount, cInventory::invInventoryOffset, a_ParentWindow) { } } ; @@ -131,14 +133,14 @@ public: /** Handles the hotbar of each player */ -class cSlotAreaHotBar : +class cSlotAreaHotBar: public cSlotAreaInventoryBase { - typedef cSlotAreaInventoryBase super; + using Super = cSlotAreaInventoryBase; public: - cSlotAreaHotBar(cWindow & a_ParentWindow) : - cSlotAreaInventoryBase(cInventory::invHotbarCount, cInventory::invHotbarOffset, a_ParentWindow) + cSlotAreaHotBar(cWindow & a_ParentWindow): + Super(cInventory::invHotbarCount, cInventory::invHotbarOffset, a_ParentWindow) { } } ; @@ -148,14 +150,15 @@ public: /** Handles the shield of each player */ -class cSlotAreaShield : +class cSlotAreaShield: public cSlotAreaInventoryBase { - typedef cSlotAreaInventoryBase super; + using Super = cSlotAreaInventoryBase; public: - cSlotAreaShield(cWindow & a_ParentWindow) : - cSlotAreaInventoryBase(cInventory::invShieldCount, cInventory::invShieldOffset, a_ParentWindow) + + cSlotAreaShield(cWindow & a_ParentWindow): + Super(cInventory::invShieldCount, cInventory::invShieldOffset, a_ParentWindow) { } }; @@ -165,12 +168,15 @@ public: /** Handles the armor area of the player's inventory */ -class cSlotAreaArmor : +class cSlotAreaArmor: public cSlotAreaInventoryBase { + using Super = cSlotAreaInventoryBase; + public: - cSlotAreaArmor(cWindow & a_ParentWindow) : - cSlotAreaInventoryBase(cInventory::invArmorCount, cInventory::invArmorOffset, a_ParentWindow) + + cSlotAreaArmor(cWindow & a_ParentWindow): + Super(cInventory::invArmorCount, cInventory::invArmorOffset, a_ParentWindow) { } @@ -188,13 +194,14 @@ public: /** Handles any slot area that is representing a cItemGrid; same items for all the players */ -class cSlotAreaItemGrid : +class cSlotAreaItemGrid: public cSlotArea, public cItemGrid::cListener { - typedef cSlotArea super; + using Super = cSlotArea; public: + cSlotAreaItemGrid(cItemGrid & a_ItemGrid, cWindow & a_ParentWindow); virtual ~cSlotAreaItemGrid() override; @@ -216,12 +223,13 @@ protected: /** A cSlotArea with items layout that is private to each player and is temporary, such as a crafting grid or an enchantment table. This common ancestor stores the items in a per-player map. It also implements tossing items from the map. */ -class cSlotAreaTemporary : +class cSlotAreaTemporary: public cSlotArea { - typedef cSlotArea super; + using Super = cSlotArea; public: + cSlotAreaTemporary(int a_NumSlots, cWindow & a_ParentWindow); // cSlotArea overrides: @@ -234,7 +242,7 @@ public: void TossItems(cPlayer & a_Player, int a_Begin, int a_End); protected: - typedef std::map<UInt32, std::vector<cItem> > cItemMap; // Maps EntityID -> items + using cItemMap = std::map<UInt32, std::vector<cItem> >; // Maps EntityID -> items cItemMap m_Items; @@ -246,12 +254,13 @@ protected: -class cSlotAreaCrafting : +class cSlotAreaCrafting: public cSlotAreaTemporary { - typedef cSlotAreaTemporary super; + using Super = cSlotAreaTemporary; public: + /** a_GridSize is allowed to be only 2 or 3 */ cSlotAreaCrafting(int a_GridSize, cWindow & a_ParentWindow); @@ -298,12 +307,13 @@ protected: -class cSlotAreaAnvil : +class cSlotAreaAnvil: public cSlotAreaTemporary { - typedef cSlotAreaTemporary super; + using Super = cSlotAreaTemporary; public: + cSlotAreaAnvil(cWindow & a_ParentWindow); // cSlotArea overrides: @@ -335,13 +345,14 @@ protected: -class cSlotAreaBeacon : +class cSlotAreaBeacon: public cSlotArea, public cItemGrid::cListener { - typedef cSlotArea super; + using Super = cSlotArea; public: + cSlotAreaBeacon(cBeaconEntity * a_Beacon, cWindow & a_ParentWindow); virtual ~cSlotAreaBeacon() override; @@ -363,12 +374,13 @@ protected: -class cSlotAreaEnchanting : +class cSlotAreaEnchanting: public cSlotAreaTemporary { - typedef cSlotAreaTemporary super; + using Super = cSlotAreaTemporary; public: + cSlotAreaEnchanting(cWindow & a_ParentWindow, int a_BlockX, int a_BlockY, int a_BlockZ); // cSlotArea overrides: @@ -446,13 +458,14 @@ protected: -class cSlotAreaFurnace : +class cSlotAreaFurnace: public cSlotArea, public cItemGrid::cListener { - typedef cSlotArea super; + using Super = cSlotArea; public: + cSlotAreaFurnace(cFurnaceEntity * a_Furnace, cWindow & a_ParentWindow); virtual ~cSlotAreaFurnace() override; @@ -476,13 +489,14 @@ protected: -class cSlotAreaBrewingstand : +class cSlotAreaBrewingstand: public cSlotArea, public cItemGrid::cListener { - typedef cSlotArea super; + using Super = cSlotArea; public: + cSlotAreaBrewingstand(cBrewingstandEntity * a_Brewingstand, cWindow & a_ParentWindow); virtual ~cSlotAreaBrewingstand() override; |