summaryrefslogtreecommitdiffstats
path: root/src/UI/SlotArea.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/UI/SlotArea.h')
-rw-r--r--src/UI/SlotArea.h46
1 files changed, 22 insertions, 24 deletions
diff --git a/src/UI/SlotArea.h b/src/UI/SlotArea.h
index cd340408a..b150c47a1 100644
--- a/src/UI/SlotArea.h
+++ b/src/UI/SlotArea.h
@@ -35,19 +35,19 @@ public:
int GetNumSlots(void) const { return m_NumSlots; }
- /// Called to retrieve an item in the specified slot for the specified player. Must return a valid cItem.
+ /** Called to retrieve an item in the specified slot for the specified player. Must return a valid cItem. */
virtual const cItem * GetSlot(int a_SlotNum, cPlayer & a_Player) const = 0;
- /// Called to set an item in the specified slot for the specified player
+ /** Called to set an item in the specified slot for the specified player */
virtual void SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) = 0;
- /// Called when a player clicks in the window. Parameters taken from the click packet.
+ /** Called when a player clicks in the window. Parameters taken from the click packet. */
virtual void Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickAction, const cItem & a_ClickedItem);
- /// Called from Clicked when the action is a shiftclick (left or right)
+ /** Called from Clicked when the action is a shiftclick (left or right) */
virtual void ShiftClicked(cPlayer & a_Player, int a_SlotNum, const cItem & a_ClickedItem);
- /// Called from Clicked when the action is a caDblClick
+ /** Called from Clicked when the action is a caDblClick */
virtual void DblClicked(cPlayer & a_Player, int a_SlotNum);
/** Called from Clicked when the action is a middleclick */
@@ -59,24 +59,23 @@ public:
/** Called from Clicked when the action is a number click. */
virtual void NumberClicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickAction);
- /// Called when a new player opens the same parent window. The window already tracks the player. CS-locked.
+ /** Called when a new player opens the same parent window. The window already tracks the player. CS-locked. */
virtual void OnPlayerAdded(cPlayer & a_Player);
- /// Called when one of the players closes the parent window. The window already doesn't track the player. CS-locked.
+ /** Called when one of the players closes the parent window. The window already doesn't track the player. CS-locked. */
virtual void OnPlayerRemoved(cPlayer & a_Player);
/** Called to store as much of a_ItemStack in the area as possible. a_ItemStack is modified to reflect the change.
The default implementation searches each slot for available space and distributes the stack there.
if a_ShouldApply is true, the changes are written into the slots;
if a_ShouldApply is false, only a_ItemStack is modified to reflect the number of fits (for fit-testing purposes)
- If a_KeepEmptySlots is true, empty slots will be skipped and won't be filled
- */
+ If a_KeepEmptySlots is true, empty slots will be skipped and won't be filled */
virtual void DistributeStack(cItem & a_ItemStack, cPlayer & a_Player, bool a_ShouldApply, bool a_KeepEmptySlots, bool a_BackFill);
- /// Called on DblClicking to collect all stackable items into hand.
- /// The items are accumulated in a_Dragging and removed from the slots immediately.
- /// If a_CollectFullStacks is false, slots with full stacks are skipped while collecting.
- /// Returns true if full stack has been collected in a_Dragging, false if there's space remaining to fill.
+ /** Called on DblClicking to collect all stackable items into hand.
+ The items are accumulated in a_Dragging and removed from the slots immediately.
+ If a_CollectFullStacks is false, slots with full stacks are skipped while collecting.
+ Returns true if full stack has been collected in a_Dragging, false if there's space remaining to fill. */
virtual bool CollectItemsToHand(cItem & a_Dragging, cPlayer & a_Player, bool a_CollectFullStacks);
protected:
@@ -88,7 +87,7 @@ protected:
-/// Handles any part of the inventory, using parameters in constructor to distinguish between the parts
+/** Handles any part of the inventory, using parameters in constructor to distinguish between the parts */
class cSlotAreaInventoryBase :
public cSlotArea
{
@@ -111,7 +110,7 @@ protected:
-/// Handles the main inventory of each player, excluding the armor and hotbar
+/** Handles the main inventory of each player, excluding the armor and hotbar */
class cSlotAreaInventory :
public cSlotAreaInventoryBase
{
@@ -128,7 +127,7 @@ public:
-/// Handles the hotbar of each player
+/** Handles the hotbar of each player */
class cSlotAreaHotBar :
public cSlotAreaInventoryBase
{
@@ -145,7 +144,7 @@ public:
-/// Handles the armor area of the player's inventory
+/** Handles the armor area of the player's inventory */
class cSlotAreaArmor :
public cSlotAreaInventoryBase
{
@@ -168,7 +167,7 @@ public:
-/// Handles any slot area that is representing a cItemGrid; same items for all the players
+/** Handles any slot area that is representing a cItemGrid; same items for all the players */
class cSlotAreaItemGrid :
public cSlotArea,
public cItemGrid::cListener
@@ -196,8 +195,7 @@ 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.
-*/
+This common ancestor stores the items in a per-player map. It also implements tossing items from the map. */
class cSlotAreaTemporary :
public cSlotArea
{
@@ -212,7 +210,7 @@ public:
virtual void OnPlayerAdded (cPlayer & a_Player) override;
virtual void OnPlayerRemoved(cPlayer & a_Player) override;
- /// Tosses the player's items in slots [a_Begin, a_End) (ie. incl. a_Begin, but excl. a_End)
+ /** Tosses the player's items in slots [a_Begin, a_End) (ie. incl. a_Begin, but excl. a_End) */
void TossItems(cPlayer & a_Player, int a_Begin, int a_End);
protected:
@@ -220,7 +218,7 @@ protected:
cItemMap m_Items;
- /// Returns the pointer to the slot array for the player specified.
+ /** Returns the pointer to the slot array for the player specified. */
cItem * GetPlayerSlots(cPlayer & a_Player);
} ;
@@ -234,7 +232,7 @@ class cSlotAreaCrafting :
typedef cSlotAreaTemporary super;
public:
- /// a_GridSize is allowed to be only 2 or 3
+ /** a_GridSize is allowed to be only 2 or 3 */
cSlotAreaCrafting(int a_GridSize, cWindow & a_ParentWindow);
// cSlotAreaTemporary overrides:
@@ -450,7 +448,7 @@ protected:
// cItemGrid::cListener overrides:
virtual void OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum) override;
- /// Called after an item has been smelted to handle statistics etc.
+ /** Called after an item has been smelted to handle statistics etc. */
void HandleSmeltItem(const cItem & a_Result, cPlayer & a_Player);
} ;