Using Super.
This commit is contained in:
committed by
Alexander Harkness
parent
f931590bf0
commit
9ee47e5999
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
class cBeaconWindow :
|
||||
public cWindow
|
||||
{
|
||||
using super = cWindow;
|
||||
using Super = cWindow;
|
||||
|
||||
public:
|
||||
cBeaconWindow(cBeaconEntity * a_Beacon);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
class cBrewingstandWindow :
|
||||
public cWindow
|
||||
{
|
||||
using super = cWindow;
|
||||
using Super = cWindow;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
class cDropSpenserWindow :
|
||||
public cWindow
|
||||
{
|
||||
using super = cWindow;
|
||||
using Super = cWindow;
|
||||
|
||||
public:
|
||||
cDropSpenserWindow(cDropSpenserEntity * a_DropSpenser);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,12 +16,13 @@
|
||||
|
||||
|
||||
|
||||
class cEnderChestWindow :
|
||||
class cEnderChestWindow:
|
||||
public cWindow
|
||||
{
|
||||
typedef cWindow super;
|
||||
using Super = cWindow;
|
||||
|
||||
public:
|
||||
|
||||
cEnderChestWindow(cEnderChestEntity * a_EnderChest);
|
||||
|
||||
virtual ~cEnderChestWindow() override;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
class cFurnaceWindow :
|
||||
public cWindow
|
||||
{
|
||||
using super = cWindow;
|
||||
using Super = cWindow;
|
||||
|
||||
public:
|
||||
cFurnaceWindow(cFurnaceEntity * a_Furnace);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user