332 {
334 {
335 if( w == null )
336 {
337 return;
338 }
339 ItemPreviewWidget iw = ItemPreviewWidget.Cast( w.FindAnyWidget( "Render" ) );
340 if( !iw )
341 {
342 string name = w.GetName();
343 name.Replace(
"PanelWidget",
"Render" );
344 iw = ItemPreviewWidget.Cast( w.FindAnyWidget(
name ) );
345 }
346
347 if( !iw )
348 {
349 iw = ItemPreviewWidget.Cast( w );
350 }
351
353 if( !item )
354 {
355 return;
356 }
357
359 {
360 return;
361 }
362
363 if(
GetGame().
GetPlayer().GetInventory().HasInventoryReservation( item, null ) )
364 {
365 return;
366 }
367
368 if( !item.GetInventory().CanRemoveEntity() )
369 return;
370
372
373 if ( player.GetInventory().HasEntityInInventory( item ) &&
GetGame().
GetPlayer().GetHumanInventory().CanAddEntityInHands( item ) )
374 {
375 player.PredictiveTakeEntityToHands( item );
376 }
377 else
378 {
379 InventoryLocation dst = new InventoryLocation;
381 if( dst.
IsValid() && player.GetInventory().LocationCanAddEntity( dst ) )
382 {
383 SplitItemUtils.TakeOrSplitToInventoryLocation( player, dst );
384 }
385 }
386
387 HideOwnedTooltip();
389
391 if( menu )
392 {
393 menu.RefreshQuickbar();
394 }
395 }
396 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool IsValid()
verify current set inventory location
override bool IsTakeable()
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
void PrepareOwnedTooltipAfterItemTransferClick()
proto native CGame GetGame()