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

◆ DraggingOverGrid() [1/2]

bool ClosableContainer::DraggingOverGrid ( Widget w,
int x,
int y,
Widget reciever )
inlineprotected

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

245 {
246 if( w == null )
247 {
248 return false;
249 }
250
251 PlayerBase player = PlayerBase.Cast( g_Game.GetPlayer() );
252 if( !player.CanManipulateInventory() )
253 {
254 return false;
255 }
256
257 EntityAI item = GetItemPreviewItem( w );
258
259 if( !item )
260 {
261 return false;
262 }
263
264 if( !item.GetInventory().CanRemoveEntity() )
265 {
266 return false;
267 }
268
269 int color, c_x, c_y;
270
271 #ifdef PLATFORM_CONSOLE
272 int idx = -1;
273 #else
274 int idx = 0;
275 #endif
276
278 if( cargo )
279 {
280 c_x = cargo.GetHeight();
281 c_y = cargo.GetWidth();
282 }
283
284 InventoryLocation dst = new InventoryLocation;
285 #ifdef PLATFORM_CONSOLE
286 x = 0;
287 y = cargo.GetItemCount();
289 #else
290 dst.SetCargoAuto(cargo, item, x, y, item.GetInventory().GetFlipCargo());
291 #endif
292
293 #ifdef PLATFORM_CONSOLE
295 #else
296 if( m_Entity && c_x > x && c_y > y && m_Entity.GetInventory().LocationCanAddEntityEx(dst))
297 #endif
298 {
299 ItemManager.GetInstance().HideDropzones();
300 if( m_Entity.GetHierarchyRootPlayer() == g_Game.GetPlayer() )
301 {
302 ItemManager.GetInstance().GetRightDropzone().SetAlpha( 1 );
303 }
304 else
305 {
306 ItemManager.GetInstance().GetLeftDropzone().SetAlpha( 1 );
307 }
308 color = ColorManager.GREEN_COLOR;
309 }
310 else
311 {
312 color = ColorManager.RED_COLOR;
313 ItemManager.GetInstance().ShowSourceDropzone( item );
314 }
315
316 if( w.FindAnyWidget("Cursor") )
317 {
318 w.FindAnyWidget("Cursor").SetColor( color );
319 }
320 else
321 {
322 string name = w.GetName();
323 name.Replace( "PanelWidget", "Cursor" );
324 if( w.FindAnyWidget( name ) )
325 {
326 w.FindAnyWidget( name ).SetColor( color );
327 }
328 }
329
330 return true;
331 }
class LogManager EntityAI
Entity m_Entity
Определения CachedEquipmentStorageBase.c:14
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DayZGame g_Game
Определения DayZGame.c:3942
Icon x
Icon y
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:18
proto native int GetItemCount()
proto native int GetWidth()
proto native int GetHeight()
int m_CargoIndex
Определения ContainerWithCargo.c:4
EntityAI GetItemPreviewItem(Widget w)
Определения ContainerWithCargo.c:224
proto native Man GetHierarchyRootPlayer()
Returns root of current hierarchy cast to Man.
proto native GameInventory GetInventory()
proto native CargoBase GetCargoFromIndex(int index)
proto native bool FindFreeLocationFor(notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFreeLocationFor.
static bool LocationCanAddEntityEx(notnull InventoryLocation inv_loc)
proto native bool IsValid()
verify current set inventory location
proto native void SetCargoAuto(notnull CargoBase cargo, EntityAI e, int row, int col, bool flip)
based on Cargo.IsProxyCargo uses SetProxyCargo or SetCargo respectively

Перекрестные ссылки g_Game, CargoBase::GetHeight(), ItemManager::GetInstance(), CargoBase::GetItemCount(), GetItemPreviewItem(), ItemManager::GetLeftDropzone(), ItemManager::GetRightDropzone(), CargoBase::GetWidth(), ColorManager::GREEN_COLOR, ItemManager::HideDropzones(), InventoryLocation::IsValid(), m_CargoIndex, m_Entity, name, ColorManager::RED_COLOR, InventoryLocation::SetCargoAuto(), ItemManager::ShowSourceDropzone(), x и y.