34 void SetSize(
int newSize)
45 for (; i < newSize; i++)
48 if ( entity != NULL && entity.GetHierarchyRootPlayer() ==
_player )
56 for (i--; i >= newSize; i--)
63 _player.m_Hud.RefreshQuickbar(
true);
124 _player.m_Hud.RefreshQuickbar(
true);
134 _player.m_Hud.RefreshQuickbar(
true);
140 entity.GetInventory().GetCurrentInventoryLocation(loc);
143 return (entity && entity.GetHierarchyRootPlayer() ==
_player && parent.CanAssignAttachmentsToQuickbar() && entity.CanAssignToQuickbar());
184 if (!ctx.Read(param))
199 if (!ctx.Read(index))
203 if (!ctx.Read(force))
213 if ( entity == NULL )
230 int slotsCount =
_player.GetQuickBarBonus();
231 int attCount =
_player.GetInventory().AttachmentCount();
233 for (
int i = 0; i < attCount; ++i)
235 slotsCount +=
_player.GetInventory().GetAttachmentFromIndex(i).GetQuickBarBonus();
239 SetSize(
Math.Min(slotsCount, 10));
252 _player.m_Hud.RefreshQuickbar(
true);
272 _player.m_Hud.RefreshQuickbar(
true);
286 if (hic && hic.IsQuickBarSlot() == index + 1)
287 _player.OnQuickBarContinuousUseEnd(index + 1);
Serialization general interface. Serializer API works with:
bool OnInputUserDataProcess(int userDataType, ParamsReadContext ctx)
proto native CGame GetGame()
void _RemoveEntity(int index)
void QuickBarBase(PlayerBase player)
void OnSetEntityRequest(ParamsReadContext ctx)
Reaction on SetEntityShortcut from client.
class QuickBarItem m_aQuickbarEnts[MAX_QUICKBAR_SLOTS_COUNT]
EntityAI GetEntity(int index)
void _SetEntity(EntityAI entity, int index, bool force=false)
void OnSetEntityRPC(ParamsReadContext ctx)
Reaction on Rpc from server for set inicial state for quickbar.
void _SetEntityShortcut(EntityAI entity, int index, bool force=false)
void SetEntityShortcut(EntityAI entity, int index, bool force=false)
void OnSetEntityNoSync(EntityAI entity, int index, bool force=false)
const int MAX_QUICKBAR_SLOTS_COUNT
void CancelContinuousUse(int index)
bool CanAddAsShortcut(EntityAI entity)
void SetShotcutEnable(int index, bool value)
void UpdateShotcutVisibility(int index)
int FindEntityIndex(EntityAI entity)