DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ DoubleClick()

void VicinitySlotsContainer::DoubleClick ( Widget w,
int x,
int y,
int button )
inlineprotected

См. определение в файле VicinitySlotsContainer.c строка 331

332 {
333 if( button == MouseState.LEFT && !g_Game.IsLeftCtrlDown())
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
352 ItemBase item = ItemBase.Cast( iw.GetItem() );
353 if( !item )
354 {
355 return;
356 }
357
358 if( !item.IsTakeable() )
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
371 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
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;
380 player.GetInventory().FindFreeLocationFor( item, FindInventoryLocationType.ANY, dst );
381 if( dst.IsValid() && player.GetInventory().LocationCanAddEntity( dst ) )
382 {
383 SplitItemUtils.TakeOrSplitToInventoryLocation( player, dst );
384 }
385 }
386
387 HideOwnedTooltip();
388 GetGame().GetCallQueue(CALL_CATEGORY_GUI).CallLater(PrepareOwnedTooltipAfterItemTransferClick, 300); //update item tooltip after vicinity item has been transfered and the current selected row gets populated with a new item
389
390 InventoryMenu menu = InventoryMenu.Cast( GetGame().GetUIManager().FindMenu( MENU_INVENTORY ) );
391 if( menu )
392 {
393 menu.RefreshQuickbar();
394 }
395 }
396 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DayZGame g_Game
Определения DayZGame.c:3868
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
void InventoryMenu()
Определения InventoryMenu.c:20
PlayerBase GetPlayer()
Определения ModifierBase.c:51
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1187
proto native bool IsValid()
verify current set inventory location
override bool IsTakeable()
Определения BaseBuildingBase.c:988
proto native EntityAI GetItem()
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()
Определения VicinitySlotsContainer.c:653
proto native CGame GetGame()
const int MENU_INVENTORY
Определения constants.c:180
MouseState
Определения EnSystem.c:311
const int CALL_CATEGORY_GUI
Определения tools.c:9

Перекрестные ссылки CALL_CATEGORY_GUI, ScriptCallQueue::CallLater(), g_Game, CGame::GetCallQueue(), GetGame(), ItemPreviewWidget::GetItem(), GetPlayer(), InventoryMenu(), ItemBase::IsTakeable(), InventoryLocation::IsValid(), MENU_INVENTORY, name, PrepareOwnedTooltipAfterItemTransferClick(), SplitItemUtils::TakeOrSplitToInventoryLocation(), x и y.