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

◆ CheckForLightsAndNVG()

void UIScriptedMenu::CheckForLightsAndNVG ( out array< ref RadialQuickbarItem > items,
int last_idx )
inlineprotected

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

306 {
307 PlayerBase player = PlayerBase.Cast( g_Game.GetPlayer() );
308 int count = 0;
309 EntityAI entity;
310 ItemBase headgear = ItemBase.Cast(player.FindAttachmentBySlotName("Headgear"));
311 ItemBase eyewear = ItemBase.Cast(player.FindAttachmentBySlotName("Eyewear"));
312
313 //nvg - headgear check
314 if ( headgear )
315 {
316 entity = headgear.FindAttachmentBySlotName("NVG");
317 if (entity)
318 {
319 items.Insert( new RadialQuickbarItem( count, entity, "", RadialQuickbarCategory.SPECIALIZED_LIGHTS ) );
320 count++;
321 }
322 }
323 //nvg/light - eyewear check
324 if ( eyewear )
325 {
326 entity = eyewear.FindAttachmentBySlotName("NVG");
327 if (entity)
328 {
329 items.Insert( new RadialQuickbarItem( count, entity, "", RadialQuickbarCategory.SPECIALIZED_LIGHTS ) );
330 count++;
331 }
332 else if ( eyewear.IsLightSource() && eyewear.HasEnergyManager() && eyewear.GetCompEM().CanWork() )
333 {
334 entity = eyewear;
335 items.Insert( new RadialQuickbarItem( count, entity, "", RadialQuickbarCategory.SPECIALIZED_LIGHTS ) );
336 count++;
337 }
338 }
339 //light
340 if ( headgear )
341 {
342 if ( headgear.GetInventory().AttachmentCount() > 0 )
343 {
344 ItemBase attachment;
345 for (int i = 0; i < headgear.GetInventory().AttachmentCount(); i++)
346 {
347 attachment = ItemBase.Cast(headgear.GetInventory().GetAttachmentFromIndex(i));
348 if ( attachment && attachment.IsLightSource() && attachment.HasEnergyManager() && attachment.GetCompEM().CanWork() )
349 {
350 entity = attachment;
351 items.Insert( new RadialQuickbarItem( count, entity, "", RadialQuickbarCategory.SPECIALIZED_LIGHTS ) );
352 count++;
353 }
354 }
355 }
356 }
357
358 //Add a category switchers
359 if (m_CurrentCategory == RadialQuickbarCategory.DEFAULT && count > 0)
360 {
361 items.InsertAt( new RadialQuickbarItem(32,null,"#toggle_lights",RadialQuickbarCategory.DEFAULT,RadialQuickbarCategory.SPECIALIZED_LIGHTS),0 );
362 }
363 else if (m_CurrentCategory == RadialQuickbarCategory.SPECIALIZED_LIGHTS)
364 {
365 items.InsertAt( new RadialQuickbarItem(32,null,"#menu_back",RadialQuickbarCategory.SPECIALIZED_LIGHTS,RadialQuickbarCategory.DEFAULT),0 );
366 }
367 }
class LogManager EntityAI
DayZGame g_Game
Определения DayZGame.c:3942
class GP5GasMask extends MaskBase ItemBase
RadialQuickbarCategory
Определения RadialQuickbarMenu.c:2
void RadialQuickbarItem(int id, EntityAI item, string item_name, int category=RadialQuickbarCategory.DEFAULT, int category_switch=-1)
Определения RadialQuickbarMenu.c:21
int m_CurrentCategory
Определения GesturesMenu.c:123

Перекрестные ссылки g_Game, m_CurrentCategory и RadialQuickbarItem().

Используется в GetItems().