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

◆ CheckForLightsAndNVG()

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

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

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

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

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