DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
missionGameplay.c
См. документацию.
2{
5
7
9 ImageWidget m_MicrophoneIcon;
10
14 ref IngameHud m_Hud;
16 ref LogoutMenu m_Logout;
19
21
22 protected ref GameplayEffectWidgets m_EffectWidgets;
23
25 ref WidgetFadeTimer m_ChatChannelFadeTimer;
26 ref WidgetFadeTimer m_MicFadeTimer;
27
30 NoteMenu m_Note;
31
32 protected ref Timer m_ToggleHudTimer;
33 protected const int HOLD_LIMIT_TIME = 300; //ms
34 protected int m_ActionDownTime;
35 protected int m_ActionUpTime;
36 protected bool m_InitOnce;
37 protected bool m_ControlDisabled; //DEPRECATED; disabled mode stored below
38 protected int m_ControlDisabledMode;
39 protected ref array<string> m_ActiveInputExcludeGroups; //exclude groups defined in 'specific.xml' file
40 protected ref array<int> m_ActiveInputRestrictions; //additional scripted restrictions
41 protected bool m_ProcessInputExcludes;
42 protected bool m_QuickbarHold;
43 protected bool m_PlayerRespawning;
44 protected int m_RespawnModeClient; //for client-side usage
45 protected bool m_PauseQueued;
46
47 // von control info
48 protected bool m_VoNActive;
52
53 protected bool m_InputBufferFull;
55
57 {
59 m_Initialized = false;
60 m_EffectWidgets = new GameplayEffectWidgets;
61 m_HudRootWidget = null;
62 m_Chat = new Chat;
64 m_LifeState = -1;
65 m_Hud = new IngameHud;
66 m_VoNActive = false;
67 m_PauseQueued = false;
68 m_ChatChannelFadeTimer = new WidgetFadeTimer;
69 m_MicFadeTimer = new WidgetFadeTimer;
72
73 m_ActiveRefresherLocations = new array<vector>;
75 }
76
78 {
80 #ifndef NO_GUI
81 if (g_Game.GetUIManager() && g_Game.GetUIManager().ScreenFadeVisible())
82 {
83 g_Game.GetUIManager().ScreenFadeOut(0);
84 }
85 Continue();
86 #endif
87 }
88
93
94 override void OnInit()
95 {
96 super.OnInit();
97
98 if ( m_Initialized )
99 {
100 return;
101 }
102
103 #ifndef BULDOZER
104 #ifdef DIAG_DEVELOPER
105 if (!GetGame().IsMultiplayer())//to make it work in single during development
106 {
109 }
110 #endif
111 #endif
112
113 PPEffects.Init(); //DEPRECATED, left in for legacy purposes only
115
117
118 m_Initialized = true;
119
120 // init hud ui
121 if ( !m_HudRootWidget )
122 {
123 m_HudRootWidget = GetGame().GetWorkspace().CreateWidgets("gui/layouts/day_z_hud.layout");
124
125 m_HudRootWidget.Show(false);
126
127 m_Chat.Init(m_HudRootWidget.FindAnyWidget("ChatFrameWidget"));
128
129 m_ActionMenu.Init( m_HudRootWidget.FindAnyWidget("ActionsPanel"), TextWidget.Cast( m_HudRootWidget.FindAnyWidget("DefaultActionWidget") ) );
130
131 m_Hud.Init( m_HudRootWidget.FindAnyWidget("HudPanel") );
132
133 // von enabled icon
134 m_MicrophoneIcon = ImageWidget.Cast( m_HudRootWidget.FindAnyWidget("mic") );
135 m_MicrophoneIcon.Show(false);
136
137 // von voice level
138 m_VoiceLevels = m_HudRootWidget.FindAnyWidget("VoiceLevelsPanel");
139 m_VoiceLevelsWidgets = new map<int, ImageWidget>; // [key] voice level
140 m_VoiceLevelTimers = new map<int,ref WidgetFadeTimer>; // [key] voice level
141
142 if ( m_VoiceLevels )
143 {
144 m_VoiceLevelsWidgets.Set(VoiceLevelWhisper, ImageWidget.Cast( m_VoiceLevels.FindAnyWidget("Whisper") ));
145 m_VoiceLevelsWidgets.Set(VoiceLevelTalk, ImageWidget.Cast( m_VoiceLevels.FindAnyWidget("Talk") ));
146 m_VoiceLevelsWidgets.Set(VoiceLevelShout, ImageWidget.Cast( m_VoiceLevels.FindAnyWidget("Shout") ));
147
148 m_VoiceLevelTimers.Set(VoiceLevelWhisper, new WidgetFadeTimer);
149 m_VoiceLevelTimers.Set(VoiceLevelTalk, new WidgetFadeTimer);
150 m_VoiceLevelTimers.Set(VoiceLevelShout, new WidgetFadeTimer);
151 }
152
154
155 // chat channel
156 m_ChatChannelArea = m_HudRootWidget.FindAnyWidget("ChatChannelPanel");
157 m_ChatChannelText = TextWidget.Cast( m_HudRootWidget.FindAnyWidget("ChatChannelText") );
158 }
159
160 // init hud ui
161 #ifdef DEVELOPER
162 m_HudDebug = new HudDebug;
163
164 if ( !m_HudDebug.IsInitialized() )
165 {
166 m_HudDebug.Init( GetGame().GetWorkspace().CreateWidgets("gui/layouts/debug/day_z_hud_debug.layout") );
167 PluginConfigDebugProfile.GetInstance().SetLogsEnabled(LogManager.IsLogsEnable());
168 }
169 #endif
170
171 // experimental hud watermark
172 #ifndef DIAG_DEVELOPER
173 #ifdef BUILD_EXPERIMENTAL
174 m_Watermark = new Watermark();
175 #endif
176 #endif
177 }
178
180 {
181 return m_UIManager;
182 }
183
184 override void OnMissionStart()
185 {
186 g_Game.SetConnecting(false);
187
188#ifndef FEATURE_CURSOR
190 GetUIManager().ShowUICursor(false);
191#endif
192
193 g_Game.SetMissionState(DayZGame.MISSION_STATE_GAME);
194 }
195
197 {
198 if ( !m_InventoryMenu )
199 {
200 m_InventoryMenu = InventoryMenu.Cast( GetUIManager().CreateScriptedMenu(MENU_INVENTORY, null) );
201 }
202 }
203
204 void TickScheduler(float timeslice)
205 {
206 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
207
208 if( player )
209 player.OnScheduledTick(timeslice);
210
211 if (g_Game.m_AutotestEnabled)
212 {
213 if (!AutotestRunner.IsDone())
214 {
217
218 AutotestRunner.Update(timeslice);
219 }
220 else
221 {
222 g_Game.RequestExit(0);
223 }
224 }
225 }
226
228 {
229 if( mute_list && mute_list.Count() > 0 )
230 {
231 ScriptRPC rpc = new ScriptRPC();
232 rpc.Write(mute_list);
233 rpc.Send(null, ERPCs.RPC_USER_SYNC_PERMISSIONS, true, null);
234 }
235 }
236
238 {
239 super.UpdateInputDevicesAvailability();
240
241 g_Game.GetInput().UpdateConnectedInputDeviceList();
242 g_Game.UpdateInputDeviceDisconnectWarning();
243 }
244
245 override void OnMissionFinish()
246 {
247 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
248
249 //Print("OnMissionFinish");
250 GetUIManager().HideDialog();
252
253 m_Chat.Destroy();
254 delete m_HudRootWidget;
255
256 if (m_DebugMonitor)
257 m_DebugMonitor.Hide();
258#ifndef FEATURE_CURSOR
259 g_Game.GetUIManager().ShowUICursor(false);
260#endif
263 g_Game.SetMissionState( DayZGame.MISSION_STATE_FINNISH );
264 }
265
266 override void OnUpdate(float timeslice)
267 {
268#ifdef DIAG_DEVELOPER
269 UpdateInputDeviceDiag();
270#endif
271
272#ifdef FEATURE_CURSOR
273 if (GetTimeStamp() == 0)
274 {
275 if (!g_Game.IsAppActive() || IsCLIParam("launchPaused"))
276 {
277 m_PauseQueued = true;
278 }
279 else
280 {
282 GetUIManager().ShowUICursor(false);
283 }
284 }
285#endif
286
287 if (m_PauseQueued && !IsPaused())
288 {
289 Pause();
290 }
291
292 Man player = GetGame().GetPlayer();
293 PlayerBase playerPB = PlayerBase.Cast(player);
294 TickScheduler(timeslice);
295 UpdateDummyScheduler();//for external entities
296 UIScriptedMenu menu = m_UIManager.GetMenu();
297 InventoryMenu inventory = InventoryMenu.Cast( m_UIManager.FindMenu(MENU_INVENTORY) );
298 NoteMenu note_menu = NoteMenu.Cast( m_UIManager.FindMenu(MENU_NOTE) );
299 GesturesMenu gestures_menu = GesturesMenu.Cast(m_UIManager.FindMenu(MENU_GESTURES));
300 RadialQuickbarMenu quickbar_menu = RadialQuickbarMenu.Cast(m_UIManager.FindMenu(MENU_RADIAL_QUICKBAR));
301 InspectMenuNew inspect = InspectMenuNew.Cast( m_UIManager.FindMenu(MENU_INSPECT) );
302 Input input = GetGame().GetInput();
303 ActionBase runningAction;
304 bool manualInputUnlockProcessed = false;
305
306 if ( playerPB )
307 {
308 #ifdef DIAG_DEVELOPER
309 if ( DiagMenu.GetBool(DiagMenuIDs.MISC_HOLOGRAM) )
310 {
311 DbgUI.Begin("Hologram Debug", 5, 5);
312 }
313 #endif
314
315 if ( playerPB.GetHologramLocal() )
316 {
317 playerPB.GetHologramLocal().UpdateHologram( timeslice );
318 }
319 #ifdef DIAG_DEVELOPER
320 else if ( DiagMenu.GetBool(DiagMenuIDs.MISC_HOLOGRAM) )
321 {
322 DbgUI.Text("No active Hologram");
323 }
324
325 if ( DiagMenu.GetBool(DiagMenuIDs.MISC_HOLOGRAM) )
326 {
327 DbgUI.End();
328 }
329 #endif
330
331 runningAction = playerPB.GetActionManager().GetRunningAction();
332 }
333
334#ifdef PLATFORM_CONSOLE
335 //'Special behaviour' for colliding VON distance input actions [CONSOLE ONLY]
336 if (GetUApi().GetInputByID(UAVoiceModifierHelper).LocalValue() && !menu)
337 {
338 GetUApi().GetInputByID(UAUIQuickbarRadialOpen).Lock();
339 GetUApi().GetInputByID(UAZoomInToggle).Lock();
340 GetUApi().GetInputByID(UAPersonView).Lock();
341 GetUApi().GetInputByID(UALeanLeft).Lock();
342 GetUApi().GetInputByID(UALeanRight).Lock();
343 }
344 else if (GetUApi().GetInputByID(UAVoiceModifierHelper).LocalRelease()) //unlocks on release, if already excluded, all the other inputs should be locked/unlocked in the exclude (if defined properly!)
345 {
346 GetUApi().GetInputByID(UAUIQuickbarRadialOpen).Unlock();
347 GetUApi().GetInputByID(UAZoomInToggle).Unlock();
348 GetUApi().GetInputByID(UAPersonView).Unlock();
349 if (playerPB && !playerPB.IsSprinting())
350 {
351 GetUApi().GetInputByID(UALeanLeft).Unlock();
352 GetUApi().GetInputByID(UALeanRight).Unlock();
353 }
354
355 manualInputUnlockProcessed = true;
356 }
357
358 //Radial quickbar
359 if (GetUApi().GetInputByID(UAUIQuickbarRadialOpen).LocalPress() && playerPB)
360 {
361 //open quickbar menu
362 if ( playerPB.IsAlive() && !playerPB.IsRaised() && !playerPB.IsUnconscious() && !playerPB.GetCommand_Vehicle() ) //player hands not raised, player is not in prone and player is not interacting with vehicle
363 {
364 if ( !GetUIManager().IsMenuOpen( MENU_RADIAL_QUICKBAR ) )
365 {
366 RadialQuickbarMenu.OpenMenu();
367 m_Hud.ShowHudUI( false );
368 }
369 }
370 }
371
372 bool b1 = RadialQuickbarMenu.GetItemToAssign() != null;
373 //close quickbar menu from world
374 if (GetUIManager().IsMenuOpen( MENU_RADIAL_QUICKBAR ) && (!RadialQuickbarMenu.GetMenuInstance().GetParentMenu() || RadialQuickbarMenu.GetMenuInstance().GetParentMenu() != inventory) && (GetUApi().GetInputByID(UAUIQuickbarRadialOpen).LocalRelease() || !GetUApi().GetInputByID(UAUIQuickbarRadialOpen).LocalValue()))
375 {
376 RadialQuickbarMenu.CloseMenu();
377 m_Hud.ShowHudUI( true );
378 }
379
380 //Radial Quickbar from inventory
381 if ((RadialQuickbarMenu.instance && RadialQuickbarMenu.GetMenuInstance().GetParentMenu() && RadialQuickbarMenu.GetMenuInstance().GetParentMenu() == inventory) && GetUApi().GetInputByID(UAUIQuickbarRadialInventoryOpen).LocalRelease())
382 {
383 //close radial quickbar menu
384 if (GetGame().GetUIManager().IsMenuOpen(MENU_RADIAL_QUICKBAR))
385 {
386 RadialQuickbarMenu.CloseMenu();
387 RadialQuickbarMenu.SetItemToAssign(NULL);
388
389 if (GetGame().GetUIManager().IsMenuOpen(MENU_INVENTORY))
390 {
391 AddActiveInputExcludes({"inventory"});
392 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
393 }
394 }
395 }
396
397 if (playerPB)
398 {
399 //Special behaviour for leaning [CONSOLE ONLY]
400 if (playerPB.IsRaised() || playerPB.IsInRasedProne())
401 {
402 GetUApi().GetInputByID(UALeanLeftGamepad).Unlock();
403 GetUApi().GetInputByID(UALeanRightGamepad).Unlock();
404
405 manualInputUnlockProcessed = true;
406 }
407 else if (!GetUApi().GetInputByID(UALeanLeftGamepad).IsLocked() || !GetUApi().GetInputByID(UALeanRightGamepad).IsLocked())
408 {
409 GetUApi().GetInputByID(UALeanLeftGamepad).Lock();
410 GetUApi().GetInputByID(UALeanRightGamepad).Lock();
411 }
412
413 //Special behaviour for freelook & zeroing [CONSOLE ONLY]
414 if (playerPB.IsRaised())
415 {
416 GetUApi().GetInputByID(UALookAround).Lock(); //disable freelook
417 GetUApi().GetInputByID(UALookAroundToggle).Lock(); //disable freelook
418
419 GetUApi().GetInputByID(UAZeroingUp).Unlock(); //enable zeroing
420 GetUApi().GetInputByID(UAZeroingDown).Unlock();
421
422 manualInputUnlockProcessed = true;
423 }
424 else if (GetUApi().GetInputByID(UALookAround).IsLocked() || GetUApi().GetInputByID(UALookAroundToggle).IsLocked())
425 {
426 GetUApi().GetInputByID(UALookAround).Unlock(); //enable freelook
427 GetUApi().GetInputByID(UALookAroundToggle).Unlock(); //enable freelook
428
429 GetUApi().GetInputByID(UAZeroingUp).Lock(); //disable zeroing
430 GetUApi().GetInputByID(UAZeroingDown).Lock();
431
432 manualInputUnlockProcessed = true;
433 }
434 }
435#endif
436
437 if (manualInputUnlockProcessed)
438 {
440 }
441
442 //Gestures
443 if ( GetUApi().GetInputByID(UAUIGesturesOpen).LocalPress() && playerPB)
444 {
445 //open gestures menu
446 if ( !playerPB.IsRaised() && (playerPB.GetActionManager().ActionPossibilityCheck(playerPB.m_MovementState.m_CommandTypeId) || playerPB.IsEmotePlaying()) && !playerPB.GetCommand_Vehicle() )
447 {
448 if (GesturesMenu.CanOpenMenu() && !GetUIManager().IsMenuOpen(MENU_GESTURES))
449 {
450 GesturesMenu.OpenMenu();
451 m_Hud.ShowHudUI(false);
452 }
453 }
454 }
455
456 if ( GetUApi().GetInputByID(UAUIGesturesOpen).LocalRelease() || GetUApi().GetInputByID(UAUIGesturesOpen).LocalValue() == 0 )
457 {
458 //close gestures menu
459 if ( GetUIManager().IsMenuOpen( MENU_GESTURES ) )
460 {
461 GesturesMenu.CloseMenu();
462 m_Hud.ShowHudUI( true );
463 }
464 }
465
466 if (player && m_LifeState == EPlayerStates.ALIVE && !player.IsUnconscious() )
467 {
468 // enables HUD on spawn
469 if (m_HudRootWidget)
470 {
471 m_HudRootWidget.Show(true);
472 }
473
474 #ifndef NO_GUI
475 // fade out black screen
476
477 if ( GetUIManager().ScreenFadeVisible() )
478 {
479 GetUIManager().ScreenFadeOut(0.5);
480 }
481
482 #endif
483
484 if (GetUApi().GetInputByID(UAGear).LocalPress())
485 {
486 if (!inventory && playerPB.CanManipulateInventory() && IsMapUnfoldActionRunning(runningAction))
487 {
489 menu = m_InventoryMenu;
490 }
491 else if (menu == inventory && m_InventoryMenu && m_InventoryMenu.IsOpened())
492 {
494 }
495 }
496
497 if (GetUApi().GetInputByID(UAUIMenu).LocalPress() && menu && inventory && menu == inventory)
498 {
500 }
501
502 #ifndef PLATFORM_CONSOLE
503 if (GetUApi().GetInputByID(UAChat).LocalPress() && input.IsEnabledMouseAndKeyboardEvenOnServer())
504 {
505 ChatInputMenu chat = ChatInputMenu.Cast( m_UIManager.FindMenu(MENU_CHAT) );
506 if ( menu == NULL )
507 {
508 ShowChat();
509 }
510 }
511 #endif
512
513 // voice level updated
515
516 if (GetUApi().GetInputByID(UAUIQuickbarToggle).LocalHold())
517 {
518 if (!m_QuickbarHold)
519 {
520 m_QuickbarHold = true;
521 m_Hud.ShowHudPlayer(m_Hud.GetHudVisibility().IsContextFlagActive(EHudContextFlags.HUD_HIDE));
522 }
523 }
524
525 if (GetUApi().GetInputByID(UAUIQuickbarToggle).LocalRelease())
526 {
527 if (!m_QuickbarHold)
528 {
529 m_Hud.ShowQuickbarPlayer(m_Hud.GetHudVisibility().IsContextFlagActive(EHudContextFlags.QUICKBAR_HIDE));
530 }
531 m_QuickbarHold = false;
532 }
533
534 if (GetUApi().GetInputByID(UAZeroingUp).LocalPress() || GetUApi().GetInputByID(UAZeroingDown).LocalPress() || GetUApi().GetInputByID(UAToggleWeapons).LocalPress())
535 {
536 m_Hud.ZeroingKeyPress();
537 }
538
539 if (menu == NULL)
540 {
541 m_ActionMenu.Refresh();
542
543 if (GetUApi().GetInputByID(UANextActionCategory).LocalPress())
544 {
545 m_ActionMenu.NextActionCategory();
546 }
547 else if (GetUApi().GetInputByID(UAPrevActionCategory).LocalPress())
548 {
549 m_ActionMenu.PrevActionCategory();
550 }
551 else if (GetUApi().GetInputByID(UANextAction).LocalPress())
552 {
553 m_ActionMenu.NextAction();
554 }
555 else if (GetUApi().GetInputByID(UAPrevAction).LocalPress())
556 {
557 m_ActionMenu.PrevAction();
558 }
559 }
560 else
561 {
562 m_ActionMenu.Hide();
563 }
564
565 //hologram rotation
566 if (menu == NULL && playerPB.IsPlacingLocal() && playerPB.GetHologramLocal().GetParentEntity().PlacementCanBeRotated())
567 {
568 if (GetUApi().GetInputByID(UANextAction).LocalRelease())
569 {
570 playerPB.GetHologramLocal().SubtractProjectionRotation(15);
571 }
572
573 if (GetUApi().GetInputByID(UAPrevAction).LocalRelease())
574 {
575 playerPB.GetHologramLocal().AddProjectionRotation(15);
576 }
577 }
578
580 {
581 if (GetUApi().GetInputByID(UAMapToggle).LocalPress() && !m_UIManager.GetMenu())
582 {
583 if (IsMapUnfoldActionRunning(runningAction))
584 {
586 }
587 }
588 }
589 }
590
591 // life state check
592 if (player)
593 {
594 int life_state = player.GetPlayerState();
595 m_LifeState = life_state;
596 }
597
598 if (menu && !menu.UseKeyboard() && menu.UseMouse())
599 {
600 int i;
601 for (i = 0; i < 5; i++)
602 {
606 }
607
608 for (i = 0; i < 6; i++)
609 {
611 }
612 }
613
614 if (!m_UIManager.IsDialogVisible())
615 {
616 if (menu)
617 {
618 if (menu == inspect)
619 {
620 if (GetUApi().GetInputByID(UAGear).LocalPress())
621 {
623 {
625 }
626 }
627 else if (GetUApi().GetInputByID(UAUIBack).LocalPress())
628 {
630 {
632 }
633 }
634 }
635 else if (menu == note_menu && (!IsInputExcludeActive("inventory") || !IsInputRestrictionActive(EInputRestrictors.INVENTORY)))
636 {
637 AddActiveInputExcludes({"inventory"});
638 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
639 }
640 else if (menu == gestures_menu && !gestures_menu.IsMenuClosing() && !IsInputExcludeActive("radialmenu"))
641 {
642 AddActiveInputExcludes({"radialmenu"});
643 GetUApi().GetInputByID(UAUIGesturesOpen).Unlock();
644 }
645 else if (menu == quickbar_menu && !quickbar_menu.IsMenuClosing() && !IsInputExcludeActive("radialmenu"))
646 {
647 AddActiveInputExcludes({"radialmenu"});
648 GetUApi().GetInputByID(UAUIQuickbarRadialOpen).Unlock();
649 }
650 else if (IsPaused())
651 {
652 InGameMenuXbox menu_xb = InGameMenuXbox.Cast(GetGame().GetUIManager().GetMenu());
653 if (!g_Game.GetUIManager().ScreenFadeVisible() && (!menu_xb || !menu_xb.IsOnlineOpen() && !menu_xb.FeedbackDialogVisible()))
654 {
655 if (GetUApi().GetInputByID(UAUIMenu).LocalPress())
656 {
657 Continue();
658 }
659 else if (GetUApi().GetInputByID(UAUIBack).LocalPress())
660 {
661 Continue();
662 }
663 }
664 else if (GetUApi().GetInputByID(UAUIBack).LocalPress())
665 {
666 if (menu_xb && menu_xb.IsOnlineOpen())
667 {
668 menu_xb.CloseOnline();
669 }
670 }
671 }
672 }
673 else if (GetUApi().GetInputByID(UAUIMenu).LocalPress())
674 {
675 if (IsMapUnfoldActionRunning(runningAction))
676 {
677 Pause();
678 }
679 }
680 }
681
683
685
686 if (!GetGame().IsMultiplayer())
687 m_WorldData.UpdateBaseEnvTemperature( timeslice );
688
689#ifdef DIAG_DEVELOPER
691#endif
693 {
696 }
697
698 super.OnUpdate( timeslice );
699 }
700
701 override void OnKeyPress(int key)
702 {
703 super.OnKeyPress(key);
704 m_Hud.KeyPress(key);
705 }
706
707 override void OnKeyRelease(int key)
708 {
709 super.OnKeyRelease(key);
710 }
711
712 override void OnEvent(EventType eventTypeId, Param params)
713 {
714 super.OnEvent(eventTypeId, params);
715 InventoryMenu menu;
716 Man player = GetGame().GetPlayer();
717
718 switch (eventTypeId)
719 {
721 ChatMessageEventParams chat_params = ChatMessageEventParams.Cast( params );
722 if (m_LifeState == EPlayerStates.ALIVE)
723 {
724 m_Chat.Add(chat_params);
725 }
726 break;
727
729 ChatChannelEventParams cc_params = ChatChannelEventParams.Cast( params );
730 ChatInputMenu chatMenu = ChatInputMenu.Cast( GetUIManager().FindMenu(MENU_CHAT_INPUT) );
731 if (chatMenu)
732 {
733 chatMenu.UpdateChannel();
734 }
735 else
736 {
737 m_ChatChannelText.SetText(ChatInputMenu.GetChannelName(cc_params.param1));
738 m_ChatChannelFadeTimer.FadeIn(m_ChatChannelArea, 0.5, true);
740 }
741 break;
742
743 case WindowsResizeEventTypeID:
745 m_Hud.OnResizeScreen();
746
747 break;
748
750 SetFreeCameraEventParams set_free_camera_event_params = SetFreeCameraEventParams.Cast( params );
751 PluginDeveloper plugin_developer = PluginDeveloper.Cast( GetPlugin(PluginDeveloper) );
752 plugin_developer.OnSetFreeCameraEvent( PlayerBase.Cast( player ), set_free_camera_event_params.param1 );
753 break;
755 NetworkInputBufferEventParams networkInputBufferParams = NetworkInputBufferEventParams.Cast(params);
756 if (networkInputBufferParams)
757 {
758 OnInputBufferEvent(networkInputBufferParams.param1);
759 }
760 break;
761 }
762 }
763
764 override void OnItemUsed(InventoryItem item, Man owner)
765 {
766 if (item && GetUIManager().GetMenu() == NULL)
767 {
768 if (item.IsInherited(ItemBook))
769 {
770 BookMenu bookMenu = BookMenu.Cast( GetUIManager().EnterScriptedMenu(MENU_BOOK, NULL) );
771 if (bookMenu)
772 {
773 bookMenu.ReadBook(item);
774 }
775 }
776 }
777 }
778
779#ifdef DEVELOPER
780 override void SetInputSuppression(bool state)
781 {
782 m_SuppressNextFrame = state;
783 }
784
785 override bool GetInputSuppression()
786 {
787 return m_SuppressNextFrame;
788 }
789#endif
790
792 override void PlayerControlEnable( bool bForceSupress )
793 {
794 super.PlayerControlEnable(bForceSupress);
795
796 if (m_ControlDisabledMode != -1)
797 {
798 switch (m_ControlDisabledMode)
799 {
801 {
802 RemoveActiveInputExcludes({"menu"},bForceSupress);
803 break;
804 }
806 {
807 RemoveActiveInputExcludes({"inventory"},bForceSupress);
808 RemoveActiveInputRestriction(EInputRestrictors.INVENTORY);
809 break;
810 }
812 {
813 RemoveActiveInputExcludes({"loopedactions"},bForceSupress);
814 RemoveActiveInputRestriction(EInputRestrictors.MAP);
815 break;
816 }
818 {
819 RemoveActiveInputExcludes({"radialmenu"},bForceSupress);
820 break;
821 }
823 {
824 RemoveActiveInputExcludes({"radialmenu"},bForceSupress);
825 break;
826 }
827 }
828
830
831 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
832 if (player)
833 {
834 HumanInputController hic = player.GetInputController();
835 hic.LimitsDisableSprint(false);
836 }
837 }
838 }
839
841 override void PlayerControlDisable(int mode)
842 {
843 super.PlayerControlDisable(mode);
844
845 switch (mode)
846 {
848 {
849 AddActiveInputExcludes({"menu"});
850 break;
851 }
853 {
854 AddActiveInputExcludes({"inventory"});
855 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
856 break;
857 }
859 {
860 AddActiveInputExcludes({"loopedactions"});
861 AddActiveInputRestriction(EInputRestrictors.MAP);
862 break;
863 }
865 {
866 AddActiveInputExcludes({"radialmenu"});
867 break;
868 }
870 {
871 AddActiveInputExcludes({"radialmenu"});
872 break;
873 }
874 default:
875 {
876 Debug.Log("Unknown controls disable mode");
877 return;
878 }
879 }
880
882
883 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
884 if ( player )
885 {
886 ItemBase item = player.GetItemInHands();
887 if (item && item.IsWeapon())
888 player.RequestResetADSSync();
889 }
890 }
891
893 override void RemoveActiveInputExcludes(array<string> excludes, bool bForceSupress = false)
894 {
895 super.RemoveActiveInputExcludes(excludes,bForceSupress);
896
897 if (excludes.Count() != 0)
898 {
899 bool changed = false;
900
902 {
903 foreach (string excl : excludes)
904 {
905 if (m_ActiveInputExcludeGroups.Find(excl) != -1)
906 {
907 m_ActiveInputExcludeGroups.RemoveItem(excl);
908 changed = true;
909 }
910 }
911
912 if (changed)
913 {
915 }
916 }
917
918 // supress control for next frame
919 GetUApi().SupressNextFrame(bForceSupress);
920 }
921 }
922
924 override void RemoveActiveInputRestriction(int restrictor)
925 {
926 //unique behaviour outside regular excludes
927 if (restrictor > -1)
928 {
929 switch (restrictor)
930 {
931 case EInputRestrictors.INVENTORY:
932 {
933 GetUApi().GetInputByID(UAWalkRunForced).ForceEnable(false); // force walk off!
934 break;
935 }
936 case EInputRestrictors.MAP:
937 {
938 GetUApi().GetInputByID(UAWalkRunForced).ForceEnable(false); // force walk off!
939 break;
940 }
941 }
942
943 if (m_ActiveInputRestrictions && m_ActiveInputRestrictions.Find(restrictor) != -1)
944 {
945 m_ActiveInputRestrictions.RemoveItem(restrictor);
946 }
947 }
948 }
949
951 override void AddActiveInputExcludes(array<string> excludes)
952 {
953 super.AddActiveInputExcludes(excludes);
954
955 if (excludes.Count() != 0)
956 {
957 bool changed = false;
959 {
961 }
962
963 foreach (string excl : excludes)
964 {
965 if (m_ActiveInputExcludeGroups.Find(excl) == -1)
966 {
967 m_ActiveInputExcludeGroups.Insert(excl);
968 changed = true;
969 }
970 }
971
972 if (changed)
973 {
975 #ifdef BULDOZER
977 #endif
978 }
979 }
980 }
981
983 override void AddActiveInputRestriction(int restrictor)
984 {
985 //unique behaviour outside regular excludes
986 if (restrictor > -1)
987 {
988 switch (restrictor)
989 {
990 case EInputRestrictors.INVENTORY:
991 {
992 GetUApi().GetInputByID(UAWalkRunForced).ForceEnable(true); // force walk on!
993 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
994 if ( player )
995 {
996 ItemBase item = player.GetItemInHands();
997 if (item && item.IsWeapon())
998 player.RequestResetADSSync();
999 }
1000 break;
1001 }
1002 case EInputRestrictors.MAP:
1003 {
1004 GetUApi().GetInputByID(UAWalkRunForced).ForceEnable(true); // force walk on!
1005 break;
1006 }
1007 }
1008
1010 {
1012 }
1013 if (m_ActiveInputRestrictions.Find(restrictor) == -1)
1014 {
1015 m_ActiveInputRestrictions.Insert(restrictor);
1016 }
1017 }
1018 }
1019
1021 override void RefreshExcludes()
1022 {
1024 }
1025
1027 protected void PerformRefreshExcludes()
1028 {
1030 {
1031 foreach (string excl : m_ActiveInputExcludeGroups)
1032 {
1033 GetUApi().ActivateExclude(excl);
1034 }
1035 }
1036
1038 }
1039
1041 override void EnableAllInputs(bool bForceSupress = false)
1042 {
1044
1046 {
1047 int count = m_ActiveInputRestrictions.Count();
1048 for (int i = 0; i < count; i++)
1049 {
1051 }
1052 m_ActiveInputRestrictions.Clear(); //redundant?
1053 }
1055 {
1057 }
1058
1059 GetUApi().UpdateControls(); //it is meant to happen instantly, does not wait for update to process
1060 GetUApi().SupressNextFrame(bForceSupress); // supress control for next frame
1061 }
1062
1064 override bool IsControlDisabled()
1065 {
1066 bool active = false;
1068 {
1069 active |= m_ActiveInputExcludeGroups.Count() > 0;
1070 }
1072 {
1073 active |= m_ActiveInputRestrictions.Count() > 0;
1074 }
1075 active |= m_ControlDisabledMode >= INPUT_EXCLUDE_ALL; //legacy stuff, Justin case
1076 return active;
1077 }
1078
1080 override bool IsInputExcludeActive(string exclude)
1081 {
1082 return m_ActiveInputExcludeGroups && m_ActiveInputExcludeGroups.Find(exclude) != -1;
1083 }
1084
1086 override bool IsInputRestrictionActive(int restriction)
1087 {
1088 return m_ActiveInputRestrictions && m_ActiveInputRestrictions.Find(restriction) != -1;
1089 }
1090
1093 {
1094 return m_ControlDisabledMode;
1095 }
1096
1098 {
1099 GetUIManager().CloseAll();
1100 }
1101
1102
1104 {
1105 if( GetUIManager() )
1106 {
1107 GetUIManager().HideDialog();
1108 GetUIManager().CloseAll();
1109 }
1110
1112
1113 if( m_Chat )
1114 m_Chat.Clear();
1115 }
1116
1117 void MoveHudForInventory( bool inv_open )
1118 {
1119 #ifdef PLATFORM_CONSOLE
1120 IngameHud hud = IngameHud.Cast( GetHud() );
1121 if( hud )
1122 {
1123 if( inv_open )
1124 {
1125 hud.GetHudPanelWidget().SetPos( 0, -0.055 );
1126 }
1127 else
1128 {
1129 hud.GetHudPanelWidget().SetPos( 0, 0 );
1130 }
1131 }
1132 #endif
1133 }
1134
1135 override void ShowInventory()
1136 {
1137 UIScriptedMenu menu = GetUIManager().GetMenu();
1138
1139 if ( !menu && GetGame().GetPlayer().GetHumanInventory().CanOpenInventory() && !GetGame().GetPlayer().IsInventorySoftLocked() )
1140 {
1141 if( !m_InventoryMenu )
1142 {
1143 InitInventory();
1144 }
1145
1146 if( !GetUIManager().FindMenu( MENU_INVENTORY ) )
1147 {
1148 GetUIManager().ShowScriptedMenu(m_InventoryMenu, null);
1149 PlayerBase.Cast(GetGame().GetPlayer()).OnInventoryMenuOpen();
1150 }
1151 AddActiveInputExcludes({"inventory"});
1152 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
1153 }
1154 }
1155
1156 override void HideInventory()
1157 {
1158 if (m_InventoryMenu)
1159 {
1160 GetUIManager().HideScriptedMenu(m_InventoryMenu);
1161 RemoveActiveInputExcludes({"inventory"},false);
1162 RemoveActiveInputRestriction(EInputRestrictors.INVENTORY);
1163 PlayerBase.Cast(GetGame().GetPlayer()).OnInventoryMenuClose();
1165 }
1166 }
1167
1169 {
1170 if (m_InventoryMenu)
1171 {
1172 if (!m_InventoryMenu.GetParentMenu() && GetUIManager().GetMenu() != m_InventoryMenu)
1173 {
1174 m_InventoryMenu.SetParentMenu(GetUIManager().GetMenu()); //hack; guarantees the 'm_pCurrentMenu' will be set to whatever is on top currently
1175 }
1176 m_InventoryMenu.Close();
1177 m_InventoryMenu = NULL;
1178 }
1179 }
1180
1181 override void ResetGUI()
1182 {
1184 InitInventory();
1185 }
1186
1187 override void ShowChat()
1188 {
1191 m_ChatChannelArea.Show(false);
1192 m_UIManager.EnterScriptedMenu(MENU_CHAT_INPUT, NULL);
1193
1194 int level = GetGame().GetVoiceLevel();
1196
1197 AddActiveInputExcludes({"menu"});
1198 }
1199
1200 override void HideChat()
1201 {
1202 RemoveActiveInputExcludes({"menu"},true);
1203 }
1204
1206 {
1207 if ( GetHud() )
1208 GetHud().ShowVehicleInfo();
1209 }
1210
1212 {
1213 if ( GetHud() )
1214 GetHud().HideVehicleInfo();
1215 }
1216
1217 override Hud GetHud()
1218 {
1219 return m_Hud;
1220 }
1221
1223 {
1224 return m_HudDebug;
1225 }
1226
1228 {
1229 if (GetHudDebug())
1230 GetHudDebug().RefreshCrosshairVisibility();
1231 }
1232
1234 {
1235 if (GetHudDebug())
1236 GetHudDebug().HideCrosshairVisibility();
1237 }
1238
1239 override bool IsPaused()
1240 {
1242 }
1243
1244 override void Pause()
1245 {
1246 if (IsPaused() || (GetGame().GetUIManager().GetMenu() && GetGame().GetUIManager().GetMenu().GetID() == MENU_INGAME))
1247 {
1248 return;
1249 }
1250
1251 m_PauseQueued = true;
1252
1253 if ( g_Game.IsClient() && g_Game.GetGameState() != DayZGameState.IN_GAME )
1254 {
1255 return;
1256 }
1257
1258 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
1259 if ( player && !player.IsPlayerLoaded() || IsPlayerRespawning() )
1260 {
1261 return;
1262 }
1263
1264 CloseAllMenus();
1265
1266 // open ingame menu
1267 UIScriptedMenu menu = GetUIManager().EnterScriptedMenu( MENU_INGAME, GetGame().GetUIManager().GetMenu() );
1268 if (!menu || !menu.IsVisible())
1269 {
1270 return;
1271 }
1272
1273 AddActiveInputExcludes({"menu"});
1274 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
1275
1276 m_PauseQueued = false;
1277 }
1278
1279 override void Continue()
1280 {
1282 if (menu)
1283 {
1284 int menu_id = menu.GetID();
1285 if (!IsPaused() || (menu_id != MENU_INGAME && menu_id != MENU_LOGOUT && menu_id != MENU_RESPAWN_DIALOGUE) || (m_Logout && m_Logout.layoutRoot.IsVisible()))
1286 {
1287 return;
1288 }
1289 }
1290
1291 RemoveActiveInputExcludes({"menu"},true);
1292 RemoveActiveInputRestriction(EInputRestrictors.INVENTORY);
1293 GetUIManager().CloseMenu(MENU_INGAME);
1294 }
1295
1296 override bool IsMissionGameplay()
1297 {
1298 return true;
1299 }
1300
1301 override void AbortMission()
1302 {
1303 #ifdef BULDOZER
1305 #else
1307 #endif
1308 }
1309
1310 override void CreateLogoutMenu(UIMenuPanel parent)
1311 {
1312 // prevent creating logout dialog if input buffer has reached server config maximumClientInputs limit.
1313 if (GetGame() && m_InputBufferFull)
1314 return;
1315
1316 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
1317 // do not show logout screen if player's dead
1318 if (!player || player.IsDamageDestroyed())
1319 {
1320 // exit the game immediately
1321 AbortMission();
1322 return;
1323 }
1324
1325 if (parent)
1326 {
1327 m_Logout = LogoutMenu.Cast(parent.EnterScriptedMenu(MENU_LOGOUT));
1328
1329 if (m_Logout)
1330 {
1331 m_Logout.SetLogoutTime();
1332 }
1333 }
1334 }
1335
1336 override void StartLogoutMenu(int time)
1337 {
1338 if (m_Logout)
1339 {
1340 if (time > 0)
1341 {
1342 // character will be deleted from server int "time" seconds
1343 m_Logout.SetTime(time);
1344 m_Logout.Show();
1345
1346 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(m_Logout.UpdateTime, 1000, true);
1347 }
1348 else
1349 {
1350 // no waiting time -> player is most likely dead
1351 m_Logout.Exit();
1352 }
1353 }
1354 }
1355
1356 override void CreateDebugMonitor()
1357 {
1358 if (!m_DebugMonitor)
1359 {
1361 m_DebugMonitor.Init();
1362 }
1363 else
1364 m_DebugMonitor.Show();
1365
1366 }
1367 override void HideDebugMonitor()
1368 {
1369 if (m_DebugMonitor)
1370 {
1371 m_DebugMonitor.Hide();
1372 }
1373 }
1374
1375 protected void HandleMapToggleByKeyboardShortcut(Man player)
1376 {
1378 if (um && !um.IsMenuOpen(MENU_MAP))
1379 {
1380 um.CloseAll();
1382 {
1383 um.EnterScriptedMenu(MENU_MAP, null);
1385 GetGame().GetMission().AddActiveInputRestriction(EInputRestrictors.MAP);
1386 }
1387 }
1388 }
1389
1390 protected bool IsMapUnfoldActionRunning(ActionBase pAction)
1391 {
1392 return !pAction || pAction.Type() != ActionUnfoldMap;
1393 }
1394
1395 /*void ChangeBleedingIndicatorVisibility(bool visible)
1396 {
1397 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
1398 if (player)
1399 {
1400 BleedingSourcesManagerRemote manager = player.GetBleedingManagerRemote();
1401 if (manager && manager.GetBleedingSourcesCount() > 0)
1402 {
1403 manager.ChangeBleedingIndicatorVisibility(visible);
1404 }
1405 }
1406 }*/
1407
1409 {
1410 if (!m_DebugMonitor) return;
1411
1412 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
1413 if (player)
1414 {
1415 DebugMonitorValues values = player.GetDebugMonitorValues();
1416 if (values)
1417 {
1418 m_DebugMonitor.SetHealth(values.GetHealth());
1419 m_DebugMonitor.SetBlood(values.GetBlood());
1420 m_DebugMonitor.SetLastDamage(values.GetLastDamage());
1421 m_DebugMonitor.SetPosition(MiscGameplayFunctions.TruncateVec(player.GetPosition(),1));
1422 }
1423 }
1424
1425 float currFPS = GetGame().GetAvgFPS(10); // Not using last, but average of last x to prevent jitter
1426 float minFPS, maxFPS, avgFPS;
1427 GetGame().GetFPSStats(minFPS, maxFPS, avgFPS);
1428 m_DebugMonitor.SetFramerate(currFPS, minFPS, maxFPS, avgFPS);
1429 }
1430
1431 void SetActionDownTime( int time_down )
1432 {
1433 m_ActionDownTime = time_down;
1434 }
1435
1436 void SetActionUpTime( int time_up )
1437 {
1438 m_ActionUpTime = time_up;
1439 }
1440
1442 {
1443 return m_ActionDownTime;
1444 }
1445
1447 {
1448 return m_ActionUpTime;
1449 }
1450
1452 {
1453 float hold_action_time = LocalReleaseTime() - LocalPressTime();
1454 return hold_action_time;
1455 }
1456
1458 {
1459#ifndef SERVER
1460 ShowHairDebugValues(DiagMenu.GetBool(DiagMenuIDs.MISC_HAIR_DISPLAY_DEBUG));
1461#endif
1462 }
1463
1464 void ShowHairDebugValues(bool state)
1465 {
1466#ifdef DIAG_DEVELOPER
1467 if ( state )
1468 {
1470
1471 int i = DiagMenu.GetValue(DiagMenuIDs.MISC_HAIR_LEVEL);
1472 bool bState = diagmenu.m_HairHidingStateMap.Get(i);
1473 string selectionState;
1474 if (!bState)
1475 selectionState = "Hidden";
1476 else
1477 selectionState = "Shown";
1478 string selectionName = diagmenu.m_HairSelectionArray.Get(i);
1479
1481 DbgUI.Begin("Hair Debug", 50, 150);
1482 DbgUI.Text("Current Hair Selection:" + selectionName);
1483 DbgUI.Text("State: " + selectionState);
1484
1485 DbgUI.End();
1487 }
1488 else
1489 {
1491 DbgUI.Begin("Hair Debug", 50, 50);
1492 DbgUI.End();
1494 }
1495#endif
1496 }
1497
1498 override void UpdateVoiceLevelWidgets(int level)
1499 {
1500 for ( int n = 0; n < m_VoiceLevelsWidgets.Count(); n++ )
1501 {
1502 int voiceKey = m_VoiceLevelsWidgets.GetKey(n);
1503 ImageWidget voiceWidget = m_VoiceLevelsWidgets.Get(n);
1504
1505 // stop fade timer since it will be refreshed
1506 WidgetFadeTimer timer = m_VoiceLevelTimers.Get(n);
1507 timer.Stop();
1508
1509 // show widgets according to the level
1510 if ( voiceKey <= level )
1511 {
1512 voiceWidget.SetAlpha(1.0); // reset from possible previous fade out
1513 voiceWidget.Show(true);
1514
1515 if ( !m_VoNActive && !GetUIManager().FindMenu(MENU_CHAT_INPUT) )
1516 timer.FadeOut(voiceWidget, 3.0);
1517 }
1518 else
1519 voiceWidget.Show(false);
1520 }
1521
1522 // fade out microphone icon when switching levels without von on
1523 if ( !m_VoNActive )
1524 {
1525 if ( !GetUIManager().FindMenu(MENU_CHAT_INPUT) )
1526 {
1527 m_MicrophoneIcon.SetAlpha(1.0);
1528 m_MicrophoneIcon.Show(true);
1529
1530 m_MicFadeTimer.FadeOut(m_MicrophoneIcon, 3.0);
1531 }
1532 }
1533 else
1534 {
1535 // stop mic icon fade timer when von is activated
1536 m_MicFadeTimer.Stop();
1537 }
1538 }
1539
1540 override ImageWidget GetMicrophoneIcon()
1541 {
1542 return m_MicrophoneIcon;
1543 }
1544
1545 override WidgetFadeTimer GetMicWidgetFadeTimer()
1546 {
1547 return m_MicFadeTimer;
1548 }
1549
1554
1559
1560 override bool IsVoNActive()
1561 {
1562 return m_VoNActive;
1563 }
1564
1565 override void SetVoNActive(bool active)
1566 {
1567 m_VoNActive = active;
1568 }
1569
1571 {
1572 for ( int n = 0; n < m_VoiceLevelsWidgets.Count(); n++ )
1573 {
1574 ImageWidget voiceWidget = m_VoiceLevelsWidgets.Get( n );
1575 voiceWidget.Show(false);
1576 }
1577 }
1578
1580 {
1581 return m_Note;
1582 };
1583
1584 override void SetNoteMenu(UIScriptedMenu menu)
1585 {
1586 m_Note = NoteMenu.Cast(menu);
1587 };
1588
1589 override void OnPlayerRespawned(Man player)
1590 {
1591 #ifdef DIAG_DEVELOPER
1592 if (m_HudDebug)
1593 m_HudDebug.RefreshByLocalProfile();
1594 #endif
1595
1596 PlayerBase playerBase = PlayerBase.Cast(player);
1597 if (playerBase)
1598 {
1599 GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(playerBase.ShowDeadScreen, false, 0);
1600 }
1601
1602 GetGame().GetSoundScene().SetSoundVolume(g_Game.m_volume_sound,1);
1603 GetGame().GetSoundScene().SetSpeechExVolume(g_Game.m_volume_speechEX,1);
1604 GetGame().GetSoundScene().SetMusicVolume(g_Game.m_volume_music,1);
1605 GetGame().GetSoundScene().SetVOIPVolume(g_Game.m_volume_VOIP,1);
1606 GetGame().GetSoundScene().SetRadioVolume(g_Game.m_volume_radio,1);
1607 }
1608
1609 override void SetPlayerRespawning(bool state)
1610 {
1611 m_PlayerRespawning = state;
1612 }
1613
1614 override bool IsPlayerRespawning()
1615 {
1616 return m_PlayerRespawning;
1617 }
1618
1620 {
1621 return m_ActiveRefresherLocations;
1622 }
1623
1624 override void SetRespawnModeClient(int mode)
1625 {
1626 m_RespawnModeClient = mode;
1627 }
1628
1630 {
1631 return m_RespawnModeClient;
1632 }
1633
1634 override GameplayEffectWidgets GetEffectWidgets()
1635 {
1636 return m_EffectWidgets;
1637 }
1638
1647
1648 protected void OnInputBufferEvent(bool state)
1649 {
1650 if (m_InputBufferFull != state)
1651 {
1652 m_InputBufferFull = state;
1654 {
1655 if (GetGame().GetUIManager().GetMenu() && GetGame().GetUIManager().GetMenu().GetID() == MENU_INVENTORY)
1656 {
1658 }
1659
1661
1664 }
1665 }
1666 }
1667
1668 protected void InputBufferCheck()
1669 {
1670 PlayerBase player;
1672 ActionBase action;
1673
1675 {
1676 if (m_ConnectionMenu && (!GetGame().GetPlayer().IsAlive() || GetGame().GetPlayer().IsUnconscious()))
1677 {
1678 m_ConnectionMenu.Close();
1679
1680 player = PlayerBase.Cast(GetGame().GetPlayer());
1681 if (!player)
1682 return;
1683
1684 amb = player.GetActionManager();
1685 if (!amb)
1686 return;
1687
1688 action = amb.GetRunningAction();
1689 if (action && amb.GetActionState(action) != UA_NONE)
1690 {
1691 amb.RequestInterruptAction();
1692 }
1693 return;
1694 }
1695
1696 if (!m_ConnectionMenu)
1697 {
1698 if (GetGame().GetUIManager().GetMenu() && GetGame().GetUIManager().GetMenu().GetID() == MENU_INVENTORY)
1699 {
1701 }
1702
1705 }
1706 }
1707 else
1708 {
1709 if (m_ConnectionMenu)
1710 {
1712 m_ConnectionMenu.Close();
1713
1714 player = PlayerBase.Cast(GetGame().GetPlayer());
1715 if (!player)
1716 return;
1717
1718 amb = player.GetActionManager();
1719 if (!amb)
1720 return;
1721
1722 action = amb.GetRunningAction();
1723 if (action && amb.GetActionState(action) != UA_NONE)
1724 {
1725 amb.RequestInterruptAction();
1726 }
1727 }
1728 }
1729 }
1730}
void ActionManagerBase(PlayerBase player)
Определения ActionManagerBase.c:63
ActionUnfoldMapCB ActionBaseCB ActionUnfoldMap()
Определения ActionUnfoldMap.c:174
map
Определения ControlsXboxNew.c:4
DayZGame g_Game
Определения DayZGame.c:3868
DiagMenuIDs
Определения EDiagMenuIDs.c:2
EPlayerStates
Определения EPlayerStates.c:2
ERPCs
Определения ERPCs.c:2
int GetID()
Get the ID registered in SEffectManager.
Определения Effect.c:536
void HudDebug()
Определения HudDebug.c:108
void InventoryMenu()
Определения InventoryMenu.c:20
bool IsLocked()
Определения ModifierBase.c:140
PlayerBase GetPlayer()
Определения ModifierBase.c:51
PPERequesterCategory
Определения PPEConstants.c:29
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:316
proto native UAInputAPI GetUApi()
Определения ActionBase.c:53
Определения ActionMenu.c:2
static void Start()
Определения AutotestRunner.c:19
static bool IsRunning()
Определения AutotestRunner.c:9
static bool IsDone()
Определения AutotestRunner.c:14
static void Update(float deltaTime)
Определения AutotestRunner.c:55
Определения AutotestRunner.c:5
proto native UIManager GetUIManager()
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1187
proto native float GetAvgFPS(int nFrames=64)
Returns average framerate over last n frames.
proto native AbstractSoundScene GetSoundScene()
proto native int GetVoiceLevel(Object player=null)
Get voice level of VoN (on both client and server) (VoiceLevelWhisper = 0, VoiceLevelNormal = 1,...
proto native DayZPlayer GetPlayer()
proto native WorkspaceWidget GetWorkspace()
void GetFPSStats(out float min, out float max, out float avg, int nFrames=64)
Outputs framerate statistics.
Определения Game.c:837
proto native Input GetInput()
proto native Mission GetMission()
static bool GetUse3DMap()
Определения CfgGameplayHandler.c:382
static bool LoadData()
Определения CfgGameplayHandler.c:44
static bool GetMapIgnoreMapOwnership()
Определения CfgGameplayHandler.c:403
Определения Chat.c:15
Определения DbgUI.c:60
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Определения Debug.c:122
Определения Debug.c:2
Определения DebugMonitor.c:2
float GetHealth()
Определения DebugMonitorValues.c:69
float GetBlood()
Определения DebugMonitorValues.c:64
string GetLastDamage()
Определения DebugMonitorValues.c:74
Определения EnDebug.c:233
Определения gameplay.c:639
proto native void LimitsDisableSprint(bool pDisable)
this disables sprint
Определения human.c:18
proto native void DisableKey(int key)
Disable key until end of frame.
proto native bool IsEnabledMouseAndKeyboardEvenOnServer()
Определения input.c:11
Определения ItemBase.c:15
Определения InventoryItem.c:731
EntityAI GetSelectedItem()
Определения ItemManager.c:85
static ItemManager GetInstance()
Определения ItemManager.c:282
Определения ItemManager.c:2
static bool IsLogsEnable()
Определения Debug.c:628
Определения Debug.c:594
static void Init()
Определения MapMarkersInfo.c:5
Определения MapMarkersInfo.c:2
void AddActiveInputRestriction(int restrictor)
void AddActiveInputExcludes(array< string > excludes)
void HideInventory()
Определения gameplay.c:809
void ~MissionGameplay()
Определения missionGameplay.c:77
UIManager GetUIManager()
Определения missionGameplay.c:179
override void EnableAllInputs(bool bForceSupress=false)
Removes all active input excludes and restrictions.
Определения missionGameplay.c:1041
override void CreateDebugMonitor()
Определения missionGameplay.c:1356
override void PlayerControlEnable(bool bForceSupress)
Deprecated; removes last input exclude and associated controls restrictions.
Определения missionGameplay.c:792
HudDebug GetHudDebug()
Определения missionGameplay.c:1222
int m_LifeState
Определения missionGameplay.c:3
void InputBufferCheck()
Определения missionGameplay.c:1668
ref array< int > m_ActiveInputRestrictions
Определения missionGameplay.c:40
float GetHoldActionTime()
Определения missionGameplay.c:1451
override UIScriptedMenu GetNoteMenu()
Определения missionGameplay.c:1579
void SendMuteListToServer(map< string, bool > mute_list)
Определения missionGameplay.c:227
override void AddActiveInputExcludes(array< string > excludes)
Adds one or more exclude groups to disable and refreshes excludes.
Определения missionGameplay.c:951
ref Watermark m_Watermark
Определения missionGameplay.c:18
int m_ControlDisabledMode
Определения missionGameplay.c:38
bool m_QuickbarHold
Определения missionGameplay.c:42
ref ActionMenu m_ActionMenu
Определения missionGameplay.c:13
override void OnUpdate(float timeslice)
Определения missionGameplay.c:266
override void OnInit()
Определения missionGameplay.c:94
override void RemoveActiveInputExcludes(array< string > excludes, bool bForceSupress=false)
Removes one or more exclude groups and refreshes excludes.
Определения missionGameplay.c:893
void SetActionUpTime(int time_up)
Определения missionGameplay.c:1436
bool m_ControlDisabled
Определения missionGameplay.c:37
override map< int, ref WidgetFadeTimer > GetVoiceLevelTimers()
Определения missionGameplay.c:1555
override void OnPlayerRespawned(Man player)
Определения missionGameplay.c:1589
override void ShowInventory()
Определения missionGameplay.c:1135
void HideVehicleInfo()
Определения missionGameplay.c:1211
ref IngameHud m_Hud
Определения missionGameplay.c:14
override void PlayerControlDisable(int mode)
Deprecated; simple input restrictions.
Определения missionGameplay.c:841
void DestroyInventory()
Определения missionGameplay.c:1168
override void Continue()
Определения missionGameplay.c:1279
ref map< int, ImageWidget > m_VoiceLevelsWidgets
Определения missionGameplay.c:50
ref HudDebug m_HudDebug
Определения missionGameplay.c:15
bool m_VoNActive
Определения missionGameplay.c:48
override bool IsInputExcludeActive(string exclude)
Returns true if the particular input exclude group had been activated via script and is active.
Определения missionGameplay.c:1080
int m_RespawnModeClient
Определения missionGameplay.c:44
override void StartLogoutMenu(int time)
Определения missionGameplay.c:1336
bool m_PlayerRespawning
Определения missionGameplay.c:43
ImageWidget m_MicrophoneIcon
Определения missionGameplay.c:9
override bool IsControlDisabled()
returns if ANY exclude groups, restriction (or deprecated disable, if applicable) is active
Определения missionGameplay.c:1064
int m_ActionUpTime
Определения missionGameplay.c:35
override map< int, ImageWidget > GetVoiceLevelWidgets()
Определения missionGameplay.c:1550
void DestroyAllMenus()
Определения missionGameplay.c:1103
bool m_InitOnce
Определения missionGameplay.c:36
UIManager m_UIManager
Определения missionGameplay.c:6
override ImageWidget GetMicrophoneIcon()
Определения missionGameplay.c:1540
override void SetNoteMenu(UIScriptedMenu menu)
Определения missionGameplay.c:1584
void TickScheduler(float timeslice)
Определения missionGameplay.c:204
override void HideDebugMonitor()
Определения missionGameplay.c:1367
override void ResetGUI()
Определения missionGameplay.c:1181
override void ShowChat()
Определения missionGameplay.c:1187
override void OnKeyRelease(int key)
Определения missionGameplay.c:707
void HandleMapToggleByKeyboardShortcut(Man player)
Определения missionGameplay.c:1375
override void HideCrosshairVisibility()
Определения missionGameplay.c:1233
override void RefreshCrosshairVisibility()
Определения missionGameplay.c:1227
ref ScriptInvoker m_OnConnectivityChanged
Определения missionGameplay.c:20
override bool IsInputRestrictionActive(int restriction)
Returns true if the particular 'restriction' (those govern special behaviour outside regular input ex...
Определения missionGameplay.c:1086
override void SetVoNActive(bool active)
Определения missionGameplay.c:1565
ref DebugMonitor m_DebugMonitor
Определения missionGameplay.c:17
void CloseAllMenus()
Определения missionGameplay.c:1097
override bool IsMissionGameplay()
Определения missionGameplay.c:1296
override void HideChat()
Определения missionGameplay.c:1200
override void OnEvent(EventType eventTypeId, Param params)
Определения missionGameplay.c:712
void ShowHairDebugValues(bool state)
Определения missionGameplay.c:1464
ref WidgetFadeTimer m_ChatChannelFadeTimer
Определения missionGameplay.c:25
override int GetControlDisabledMode()
(mostly)DEPRECATED; only set on the old 'PlayerControlDisable' method
Определения missionGameplay.c:1092
override bool IsPlayerRespawning()
Определения missionGameplay.c:1614
int LocalPressTime()
Определения missionGameplay.c:1441
Widget m_VoiceLevels
Определения missionGameplay.c:49
override void AbortMission()
Определения missionGameplay.c:1301
override Hud GetHud()
Определения missionGameplay.c:1217
ref WidgetFadeTimer m_MicFadeTimer
Определения missionGameplay.c:26
const int HOLD_LIMIT_TIME
Определения missionGameplay.c:33
void SetActionDownTime(int time_down)
Определения missionGameplay.c:1431
override void HideVoiceLevelWidgets()
Определения missionGameplay.c:1570
override bool IsVoNActive()
Определения missionGameplay.c:1560
bool m_PauseQueued
Определения missionGameplay.c:45
void MissionGameplay()
Определения missionGameplay.c:56
ref Timer m_ChatChannelHideTimer
Определения missionGameplay.c:24
InventoryMenu GetInventory()
Определения missionGameplay.c:89
override void OnKeyPress(int key)
Определения missionGameplay.c:701
TextWidget m_ChatChannelText
Определения missionGameplay.c:29
override void RefreshExcludes()
queues refresh of input excludes
Определения missionGameplay.c:1021
ScriptInvoker GetConnectivityInvoker()
Определения missionGameplay.c:1639
ref array< string > m_ActiveInputExcludeGroups
Определения missionGameplay.c:39
ref LogoutMenu m_Logout
Определения missionGameplay.c:16
Widget m_HudRootWidget
Определения missionGameplay.c:8
override int GetRespawnModeClient()
Определения missionGameplay.c:1629
void InitInventory()
Определения missionGameplay.c:196
UIScriptedMenu m_ConnectionMenu
Определения missionGameplay.c:54
override void AddActiveInputRestriction(int restrictor)
Adds one input restriction (specific behaviour oudside regular excludes, defined below)
Определения missionGameplay.c:983
override void HideInventory()
Определения missionGameplay.c:1156
int LocalReleaseTime()
Определения missionGameplay.c:1446
override void Pause()
Определения missionGameplay.c:1244
override void CreateLogoutMenu(UIMenuPanel parent)
Определения missionGameplay.c:1310
override GameplayEffectWidgets GetEffectWidgets()
Определения missionGameplay.c:1634
void OnInputBufferEvent(bool state)
Определения missionGameplay.c:1648
ref map< int, ref WidgetFadeTimer > m_VoiceLevelTimers
Определения missionGameplay.c:51
Widget m_ChatChannelArea
Определения missionGameplay.c:28
void MoveHudForInventory(bool inv_open)
Определения missionGameplay.c:1117
void UpdateDebugMonitor()
Определения missionGameplay.c:1408
override void OnMissionFinish()
Определения missionGameplay.c:245
bool m_ProcessInputExcludes
Определения missionGameplay.c:41
override void SetPlayerRespawning(bool state)
Определения missionGameplay.c:1609
void PerformRefreshExcludes()
applies queued excludes (0 == clear excludes)
Определения missionGameplay.c:1027
ref GameplayEffectWidgets m_EffectWidgets
Определения missionGameplay.c:22
override void RemoveActiveInputRestriction(int restrictor)
Removes one restriction (specific behaviour oudside regular excludes, defined below)
Определения missionGameplay.c:924
ref Chat m_Chat
Определения missionGameplay.c:12
override void OnMissionStart()
Определения missionGameplay.c:184
bool IsMapUnfoldActionRunning(ActionBase pAction)
Определения missionGameplay.c:1390
override bool IsPaused()
Определения missionGameplay.c:1239
void ShowVehicleInfo()
Определения missionGameplay.c:1205
void DisplayHairDebug()
Определения missionGameplay.c:1457
ref Timer m_ToggleHudTimer
Определения missionGameplay.c:32
override void SetRespawnModeClient(int mode)
Определения missionGameplay.c:1624
override WidgetFadeTimer GetMicWidgetFadeTimer()
Определения missionGameplay.c:1545
override void UpdateVoiceLevelWidgets(int level)
Определения missionGameplay.c:1498
NoteMenu m_Note
Определения missionGameplay.c:30
override void UpdateInputDevicesAvailability()
Определения missionGameplay.c:237
bool m_InputBufferFull
Определения missionGameplay.c:53
ref InventoryMenu m_InventoryMenu
Определения missionGameplay.c:11
override void OnItemUsed(InventoryItem item, Man owner)
Определения missionGameplay.c:764
override array< vector > GetActiveRefresherLocations()
Определения missionGameplay.c:1619
int m_ActionDownTime
Определения missionGameplay.c:34
bool m_Initialized
Определения missionGameplay.c:4
Определения missionGameplay.c:2
static PPEManager GetPPEManager()
Returns the manager instance singleton.
Определения PPEManager.c:27
Static component of PPE manager, used to hold the instance.
Определения PPEManager.c:3
static void Init()
Определения PPEffects.c:52
Deprecated; 'PPEManager' used instead.
Определения PPEffects.c:3
Определения EntityAI.c:95
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Определения param.c:12
Определения PlayerBaseClient.c:2
static ref ScriptInvoker Event_OnFrameUpdate
Static invoker for the SEffectManager.Event_OnFrameUpdate called form MissionGameplay....
Определения EffectManager.c:24
Manager class for managing Effect (EffectParticle, EffectSound)
Определения EffectManager.c:6
proto void Remove(func fn)
remove specific call from queue
proto void Call(func fn, 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 ...
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 ...
ScriptInvoker Class provide list of callbacks usage:
Определения tools.c:116
proto native void Send(Object target, int rpc_type, bool guaranteed, PlayerIdentity recipient=NULL)
Initiate remote procedure call. When called on client, RPC is evaluated on server; When called on ser...
Определения gameplay.c:105
proto bool Write(void value_out)
static void RegisterEvents()
Определения SyncEvents.c:3
Определения SyncEvents.c:2
Определения EnWidgets.c:220
Определения DayZPlayerImplement.c:63
proto native void ForceEnable(bool bEnable)
proto native void Unlock()
proto native void UpdateControls()
proto native void ActivateExclude(string sExcludeName)
proto native UAInput GetInputByID(int iID)
returns list of all bindable (i.e. visible) inputs from the active group ('core' by default)
proto native void SupressNextFrame(bool bForce)
proto native void Lock()
proto native UIScriptedMenu GetMenu()
Returns most-top open menu.
proto native UIScriptedMenu EnterScriptedMenu(int id, UIMenuPanel parent)
Create & open menu with specific id (see MenuID) and set its parent.
bool IsMenuOpen(int id)
Returns true if menu with specific ID is opened (see MenuID)
Определения UIManager.c:154
bool CloseAll()
Close all opened menus.
Определения UIManager.c:78
Определения UIManager.c:2
proto native UIScriptedMenu EnterScriptedMenu(int id)
Create & open menu with specific id (see MenuID) and set this menu as its parent.
Part of main menu hierarchy to create custom menus from script.
Определения UIScriptedMenu.c:3
override bool UseMouse()
Определения GesturesMenu.c:274
override bool UseKeyboard()
Определения ChatInputMenu.c:24
bool IsMenuClosing()
Определения GesturesMenu.c:669
Определения DayZGame.c:64
static void SpawnAllTriggerCarriers()
Определения UndergroundAreaLoader.c:84
static VONManagerBase GetInstance()
Main way to access VONManager functionality from script.
Определения VONManager.c:292
void HandleInput(Input inp)
Manager class which handles Voice-over-network functionality while player is connected to a server.
Определения VONManager.c:285
void ResetRefreshCounter()
Определения VicinityItemManager.c:76
static VicinityItemManager GetInstance()
Определения VicinityItemManager.c:22
Определения Watermark.c:2
Определения EnWidgets.c:190
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Param1< bool > NetworkInputBufferEventParams
isFull
Определения gameplay.c:463
const EventType SetFreeCameraEventTypeID
params: SetFreeCameraEventParams
Определения gameplay.c:565
Param4< int, string, string, string > ChatMessageEventParams
channel, from, text, color config class
Определения gameplay.c:407
Param1< int > ChatChannelEventParams
Определения gameplay.c:408
const EventType NetworkInputBufferEventTypeID
params: NetworkInputBufferEventParams
Определения gameplay.c:573
const EventType ChatChannelEventTypeID
params: ChatChannelEventParams
Определения gameplay.c:501
proto native CGame GetGame()
Param1< FreeDebugCamera > SetFreeCameraEventParams
Camera.
Определения gameplay.c:455
const EventType ChatMessageEventTypeID
params: ChatMessageEventParams
Определения gameplay.c:499
static proto native void End()
static proto native void Begin(string windowTitle, float x=0, float y=0)
static proto native void Text(string label)
static proto void BeginCleanupScope()
static proto native void EndCleanupScope()
static proto bool GetBool(int id, bool reverse=false)
Get value as bool from the given script id.
static proto int GetValue(int id)
Get value as int from the given script id.
const int INPUT_EXCLUDE_MOUSE_RADIAL
Определения constants.c:655
const int INPUT_EXCLUDE_ALL
Определения constants.c:652
const int INPUT_EXCLUDE_INVENTORY
Определения constants.c:653
const int INPUT_EXCLUDE_MAP
Определения constants.c:656
const int INPUT_EXCLUDE_MOUSE_ALL
Определения constants.c:654
const int INPUT_DEVICE_MOUSE
Определения constants.c:24
const int INPUT_ACTION_TYPE_DOUBLETAP
Определения constants.c:40
const int INPUT_DEVICE_MOUSE_AXIS
Определения constants.c:42
const int INPUT_ACTION_TYPE_DOWN_EVENT
Определения constants.c:33
const int MENU_LOGOUT
Определения constants.c:195
const int MENU_INSPECT
Определения constants.c:179
const int MENU_MAP
Определения constants.c:191
const int MENU_RESPAWN_DIALOGUE
Определения constants.c:209
const int MENU_GESTURES
Определения constants.c:194
const int MENU_CONNECTION_DIALOGUE
Определения constants.c:215
const int MENU_CHAT
Определения constants.c:175
const int MENU_INVENTORY
Определения constants.c:180
const int MENU_NOTE
Определения constants.c:190
const int MENU_RADIAL_QUICKBAR
Определения constants.c:198
const int MENU_BOOK
Определения constants.c:192
const int MENU_INGAME
Определения constants.c:178
const int MENU_CHAT_INPUT
Определения constants.c:186
proto native void SetSoundVolume(float vol, float time)
proto native void SetSpeechExVolume(float vol, float time)
proto native void SetVOIPVolume(float vol, float time)
proto native void SetRadioVolume(float vol, float time)
proto native void SetMusicVolume(float vol, float time)
proto native bool IsCLIParam(string param)
Returns if command line argument is present.
const int CALL_CATEGORY_GAMEPLAY
Определения tools.c:10
void Pause()
Pause Timer, internal counter is not restarted, so timer can continue later. Can be unpaused via Cont...
Определения tools.c:239
void Continue()
Timer continue when it was paused.
Определения tools.c:247
const int CALL_CATEGORY_GUI
Определения tools.c:9
const int CALL_CATEGORY_SYSTEM
Определения tools.c:8
const int UA_NONE
Определения constants.c:460
const int IDC_MAIN_QUIT
Определения constants.c:144
proto native external Widget CreateWidgets(string layout, Widget parentWidget=NULL, bool immedUpdate=true)
Create widgets from *.layout file.
TypeID EventType
Определения EnWidgets.c:55