DayZ 1.28
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 #ifndef BULDOZER
196 #ifdef DIAG_DEVELOPER
197 if (!GetGame().IsMultiplayer())
198 {
199 // We will load the Effect areas on Default mission start
201 }
202 #endif
203 #endif
204 }
205
207 {
208 if ( !m_InventoryMenu )
209 {
210 m_InventoryMenu = InventoryMenu.Cast( GetUIManager().CreateScriptedMenu(MENU_INVENTORY, null) );
211 }
212 }
213
214 void TickScheduler(float timeslice)
215 {
216 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
217
218 if( player )
219 player.OnScheduledTick(timeslice);
220
221 if (g_Game.m_AutotestEnabled)
222 {
223 if (!AutotestRunner.IsDone())
224 {
227
228 AutotestRunner.Update(timeslice);
229 }
230 else
231 {
232 g_Game.RequestExit(0);
233 }
234 }
235 }
236
238 {
239 if( mute_list && mute_list.Count() > 0 )
240 {
241 ScriptRPC rpc = new ScriptRPC();
242 rpc.Write(mute_list);
243 rpc.Send(null, ERPCs.RPC_USER_SYNC_PERMISSIONS, true, null);
244 }
245 }
246
248 {
249 super.UpdateInputDevicesAvailability();
250
251 g_Game.GetInput().UpdateConnectedInputDeviceList();
252 g_Game.UpdateInputDeviceDisconnectWarning();
253 }
254
255 override void OnMissionFinish()
256 {
257 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
258
259 //Print("OnMissionFinish");
260 GetUIManager().HideDialog();
262
263 m_Chat.Destroy();
264 delete m_HudRootWidget;
265
266 if (m_DebugMonitor)
267 m_DebugMonitor.Hide();
268#ifndef FEATURE_CURSOR
269 g_Game.GetUIManager().ShowUICursor(false);
270#endif
273 g_Game.SetMissionState( DayZGame.MISSION_STATE_FINNISH );
274 }
275
276 override void OnUpdate(float timeslice)
277 {
278#ifdef DIAG_DEVELOPER
279 UpdateInputDeviceDiag();
280#endif
281
282#ifdef FEATURE_CURSOR
283 if (GetTimeStamp() == 0)
284 {
285 if (!g_Game.IsAppActive() || IsCLIParam("launchPaused"))
286 {
287 m_PauseQueued = true;
288 }
289 else
290 {
292 GetUIManager().ShowUICursor(false);
293 }
294 }
295#endif
296
297 if (m_PauseQueued && !IsPaused())
298 {
299 Pause();
300 }
301
302 Man player = GetGame().GetPlayer();
303 PlayerBase playerPB = PlayerBase.Cast(player);
304 TickScheduler(timeslice);
305 UpdateDummyScheduler();//for external entities
306 UIScriptedMenu menu = m_UIManager.GetMenu();
307 InventoryMenu inventory = InventoryMenu.Cast( m_UIManager.FindMenu(MENU_INVENTORY) );
308 NoteMenu note_menu = NoteMenu.Cast( m_UIManager.FindMenu(MENU_NOTE) );
309 GesturesMenu gestures_menu = GesturesMenu.Cast(m_UIManager.FindMenu(MENU_GESTURES));
310 RadialQuickbarMenu quickbar_menu = RadialQuickbarMenu.Cast(m_UIManager.FindMenu(MENU_RADIAL_QUICKBAR));
311 InspectMenuNew inspect = InspectMenuNew.Cast( m_UIManager.FindMenu(MENU_INSPECT) );
312 Input input = GetGame().GetInput();
313 ActionBase runningAction;
314 bool manualInputUnlockProcessed = false;
315
316 if ( playerPB )
317 {
318 #ifdef DIAG_DEVELOPER
319 if ( DiagMenu.GetBool(DiagMenuIDs.MISC_HOLOGRAM) )
320 {
321 DbgUI.Begin("Hologram Debug", 5, 5);
322 }
323 #endif
324
325 if ( playerPB.GetHologramLocal() )
326 {
327 playerPB.GetHologramLocal().UpdateHologram( timeslice );
328 }
329 #ifdef DIAG_DEVELOPER
330 else if ( DiagMenu.GetBool(DiagMenuIDs.MISC_HOLOGRAM) )
331 {
332 DbgUI.Text("No active Hologram");
333 }
334
335 if ( DiagMenu.GetBool(DiagMenuIDs.MISC_HOLOGRAM) )
336 {
337 DbgUI.End();
338 }
339 #endif
340
341 runningAction = playerPB.GetActionManager().GetRunningAction();
342 }
343
344#ifdef PLATFORM_CONSOLE
345 //'Special behaviour' for colliding VON distance input actions [CONSOLE ONLY]
346 if (GetUApi().GetInputByID(UAVoiceModifierHelper).LocalValue() && !menu)
347 {
348 GetUApi().GetInputByID(UAUIQuickbarRadialOpen).Lock();
349 GetUApi().GetInputByID(UAZoomInToggle).Lock();
350 GetUApi().GetInputByID(UAPersonView).Lock();
351 GetUApi().GetInputByID(UALeanLeft).Lock();
352 GetUApi().GetInputByID(UALeanRight).Lock();
353 }
354 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!)
355 {
356 GetUApi().GetInputByID(UAUIQuickbarRadialOpen).Unlock();
357 GetUApi().GetInputByID(UAZoomInToggle).Unlock();
358 GetUApi().GetInputByID(UAPersonView).Unlock();
359 if (playerPB && !playerPB.IsSprinting())
360 {
361 GetUApi().GetInputByID(UALeanLeft).Unlock();
362 GetUApi().GetInputByID(UALeanRight).Unlock();
363 }
364
365 manualInputUnlockProcessed = true;
366 }
367
368 //Radial quickbar
369 if (GetUApi().GetInputByID(UAUIQuickbarRadialOpen).LocalPress() && playerPB)
370 {
371 //open quickbar menu
372 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
373 {
374 if ( !GetUIManager().IsMenuOpen( MENU_RADIAL_QUICKBAR ) )
375 {
376 RadialQuickbarMenu.OpenMenu();
377 m_Hud.ShowHudUI( false );
378 }
379 }
380 }
381
382 bool b1 = RadialQuickbarMenu.GetItemToAssign() != null;
383 //close quickbar menu from world
384 if (GetUIManager().IsMenuOpen( MENU_RADIAL_QUICKBAR ) && (!RadialQuickbarMenu.GetMenuInstance().GetParentMenu() || RadialQuickbarMenu.GetMenuInstance().GetParentMenu() != inventory) && (GetUApi().GetInputByID(UAUIQuickbarRadialOpen).LocalRelease() || !GetUApi().GetInputByID(UAUIQuickbarRadialOpen).LocalValue()))
385 {
386 RadialQuickbarMenu.CloseMenu();
387 m_Hud.ShowHudUI( true );
388 }
389
390 //Radial Quickbar from inventory
391 if ((RadialQuickbarMenu.instance && RadialQuickbarMenu.GetMenuInstance().GetParentMenu() && RadialQuickbarMenu.GetMenuInstance().GetParentMenu() == inventory) && GetUApi().GetInputByID(UAUIQuickbarRadialInventoryOpen).LocalRelease())
392 {
393 //close radial quickbar menu
394 if (GetGame().GetUIManager().IsMenuOpen(MENU_RADIAL_QUICKBAR))
395 {
396 RadialQuickbarMenu.CloseMenu();
397 RadialQuickbarMenu.SetItemToAssign(NULL);
398
399 if (GetGame().GetUIManager().IsMenuOpen(MENU_INVENTORY))
400 {
401 AddActiveInputExcludes({"inventory"});
402 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
403 }
404 }
405 }
406
407 if (playerPB)
408 {
409 //Special behaviour for leaning [CONSOLE ONLY]
410 if (playerPB.IsRaised() || playerPB.IsInRasedProne())
411 {
412 GetUApi().GetInputByID(UALeanLeftGamepad).Unlock();
413 GetUApi().GetInputByID(UALeanRightGamepad).Unlock();
414
415 manualInputUnlockProcessed = true;
416 }
417 else if (!GetUApi().GetInputByID(UALeanLeftGamepad).IsLocked() || !GetUApi().GetInputByID(UALeanRightGamepad).IsLocked())
418 {
419 GetUApi().GetInputByID(UALeanLeftGamepad).Lock();
420 GetUApi().GetInputByID(UALeanRightGamepad).Lock();
421 }
422
423 //Special behaviour for freelook & zeroing [CONSOLE ONLY]
424 if (playerPB.IsRaised())
425 {
426 GetUApi().GetInputByID(UALookAround).Lock(); //disable freelook
427 GetUApi().GetInputByID(UALookAroundToggle).Lock(); //disable freelook
428
429 GetUApi().GetInputByID(UAZeroingUp).Unlock(); //enable zeroing
430 GetUApi().GetInputByID(UAZeroingDown).Unlock();
431
432 manualInputUnlockProcessed = true;
433 }
434 else if (GetUApi().GetInputByID(UALookAround).IsLocked() || GetUApi().GetInputByID(UALookAroundToggle).IsLocked())
435 {
436 GetUApi().GetInputByID(UALookAround).Unlock(); //enable freelook
437 GetUApi().GetInputByID(UALookAroundToggle).Unlock(); //enable freelook
438
439 GetUApi().GetInputByID(UAZeroingUp).Lock(); //disable zeroing
440 GetUApi().GetInputByID(UAZeroingDown).Lock();
441
442 manualInputUnlockProcessed = true;
443 }
444 }
445#endif
446
447 if (manualInputUnlockProcessed)
448 {
450 }
451
452 //Gestures
453 if ( GetUApi().GetInputByID(UAUIGesturesOpen).LocalPress() && playerPB)
454 {
455 //open gestures menu
456 if ( !playerPB.IsRaised() && (playerPB.GetActionManager().ActionPossibilityCheck(playerPB.m_MovementState.m_CommandTypeId) || playerPB.IsEmotePlaying()) && !playerPB.GetCommand_Vehicle() )
457 {
458 if (GesturesMenu.CanOpenMenu() && !GetUIManager().IsMenuOpen(MENU_GESTURES))
459 {
460 GesturesMenu.OpenMenu();
461 m_Hud.ShowHudUI(false);
462 }
463 }
464 }
465
466 if ( GetUApi().GetInputByID(UAUIGesturesOpen).LocalRelease() || GetUApi().GetInputByID(UAUIGesturesOpen).LocalValue() == 0 )
467 {
468 //close gestures menu
469 if ( GetUIManager().IsMenuOpen( MENU_GESTURES ) )
470 {
471 GesturesMenu.CloseMenu();
472 m_Hud.ShowHudUI( true );
473 }
474 }
475
476 if (player && m_LifeState == EPlayerStates.ALIVE && !player.IsUnconscious() )
477 {
478 // enables HUD on spawn
479 if (m_HudRootWidget)
480 {
481 m_HudRootWidget.Show(true);
482 }
483
484 #ifndef NO_GUI
485 // fade out black screen
486
487 if ( GetUIManager().ScreenFadeVisible() )
488 {
489 GetUIManager().ScreenFadeOut(0.5);
490 }
491
492 #endif
493
494 if (GetUApi().GetInputByID(UAGear).LocalPress())
495 {
496 if (!inventory && playerPB.CanManipulateInventory() && IsMapUnfoldActionRunning(runningAction))
497 {
499 menu = m_InventoryMenu;
500 }
501 else if (menu == inventory && m_InventoryMenu && m_InventoryMenu.IsOpened())
502 {
504 }
505 }
506
507 if (GetUApi().GetInputByID(UAUIMenu).LocalPress() && menu && inventory && menu == inventory)
508 {
510 }
511
512 #ifndef PLATFORM_CONSOLE
513 if (GetUApi().GetInputByID(UAChat).LocalPress() && input.IsEnabledMouseAndKeyboardEvenOnServer())
514 {
515 ChatInputMenu chat = ChatInputMenu.Cast( m_UIManager.FindMenu(MENU_CHAT) );
516 if ( menu == NULL )
517 {
518 ShowChat();
519 }
520 }
521 #endif
522
523 // voice level updated
525
526 if (GetUApi().GetInputByID(UAUIQuickbarToggle).LocalHold())
527 {
528 if (!m_QuickbarHold)
529 {
530 m_QuickbarHold = true;
531 m_Hud.ShowHudPlayer(m_Hud.GetHudVisibility().IsContextFlagActive(EHudContextFlags.HUD_HIDE));
532 }
533 }
534
535 if (GetUApi().GetInputByID(UAUIQuickbarToggle).LocalRelease())
536 {
537 if (!m_QuickbarHold)
538 {
539 m_Hud.ShowQuickbarPlayer(m_Hud.GetHudVisibility().IsContextFlagActive(EHudContextFlags.QUICKBAR_HIDE));
540 }
541 m_QuickbarHold = false;
542 }
543
544 if (GetUApi().GetInputByID(UAZeroingUp).LocalPress() || GetUApi().GetInputByID(UAZeroingDown).LocalPress() || GetUApi().GetInputByID(UAToggleWeapons).LocalPress())
545 {
546 m_Hud.ZeroingKeyPress();
547 }
548
549 if (menu == NULL)
550 {
551 m_ActionMenu.Refresh();
552
553 if (GetUApi().GetInputByID(UANextActionCategory).LocalPress())
554 {
555 m_ActionMenu.NextActionCategory();
556 }
557 else if (GetUApi().GetInputByID(UAPrevActionCategory).LocalPress())
558 {
559 m_ActionMenu.PrevActionCategory();
560 }
561 else if (GetUApi().GetInputByID(UANextAction).LocalPress())
562 {
563 m_ActionMenu.NextAction();
564 }
565 else if (GetUApi().GetInputByID(UAPrevAction).LocalPress())
566 {
567 m_ActionMenu.PrevAction();
568 }
569 }
570 else
571 {
572 m_ActionMenu.Hide();
573 }
574
575 //hologram rotation
576 if (menu == NULL && playerPB.IsPlacingLocal() && playerPB.GetHologramLocal().GetParentEntity().PlacementCanBeRotated())
577 {
578 if (GetUApi().GetInputByID(UANextAction).LocalRelease())
579 {
580 playerPB.GetHologramLocal().SubtractProjectionRotation(15);
581 }
582
583 if (GetUApi().GetInputByID(UAPrevAction).LocalRelease())
584 {
585 playerPB.GetHologramLocal().AddProjectionRotation(15);
586 }
587 }
588
590 {
591 if (GetUApi().GetInputByID(UAMapToggle).LocalPress() && !m_UIManager.GetMenu())
592 {
593 if (IsMapUnfoldActionRunning(runningAction))
594 {
596 }
597 }
598 }
599 }
600
601 // life state check
602 if (player)
603 {
604 int life_state = player.GetPlayerState();
605 m_LifeState = life_state;
606 }
607
608 if (menu && !menu.UseKeyboard() && menu.UseMouse())
609 {
610 int i;
611 for (i = 0; i < 5; i++)
612 {
616 }
617
618 for (i = 0; i < 6; i++)
619 {
621 }
622 }
623
624 if (!m_UIManager.IsDialogVisible())
625 {
626 if (menu)
627 {
628 if (menu == inspect)
629 {
630 if (GetUApi().GetInputByID(UAGear).LocalPress())
631 {
633 {
635 }
636 }
637 else if (GetUApi().GetInputByID(UAUIBack).LocalPress())
638 {
640 {
642 }
643 }
644 }
645 else if (menu == note_menu && (!IsInputExcludeActive("inventory") || !IsInputRestrictionActive(EInputRestrictors.INVENTORY)))
646 {
647 AddActiveInputExcludes({"inventory"});
648 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
649 }
650 else if (menu == gestures_menu && !gestures_menu.IsMenuClosing() && !IsInputExcludeActive("radialmenu"))
651 {
652 AddActiveInputExcludes({"radialmenu"});
653 GetUApi().GetInputByID(UAUIGesturesOpen).Unlock();
654 }
655 else if (menu == quickbar_menu && !quickbar_menu.IsMenuClosing() && !IsInputExcludeActive("radialmenu"))
656 {
657 AddActiveInputExcludes({"radialmenu"});
658 GetUApi().GetInputByID(UAUIQuickbarRadialOpen).Unlock();
659 }
660 else if (IsPaused())
661 {
662 InGameMenuXbox menu_xb = InGameMenuXbox.Cast(GetGame().GetUIManager().GetMenu());
663 if (!g_Game.GetUIManager().ScreenFadeVisible() && (!menu_xb || !menu_xb.IsOnlineOpen() && !menu_xb.FeedbackDialogVisible()))
664 {
665 if (GetUApi().GetInputByID(UAUIMenu).LocalPress())
666 {
667 Continue();
668 }
669 else if (GetUApi().GetInputByID(UAUIBack).LocalPress())
670 {
671 Continue();
672 }
673 }
674 else if (GetUApi().GetInputByID(UAUIBack).LocalPress())
675 {
676 if (menu_xb && menu_xb.IsOnlineOpen())
677 {
678 menu_xb.CloseOnline();
679 }
680 }
681 }
682 }
683 else if (GetUApi().GetInputByID(UAUIMenu).LocalPress())
684 {
685 if (IsMapUnfoldActionRunning(runningAction))
686 {
687 Pause();
688 }
689 }
690 }
691
693
695
696 if (!GetGame().IsMultiplayer())
697 m_WorldData.UpdateBaseEnvTemperature( timeslice );
698
699#ifdef DIAG_DEVELOPER
701#endif
703 {
706 }
707
708 super.OnUpdate( timeslice );
709 }
710
711 override void OnKeyPress(int key)
712 {
713 super.OnKeyPress(key);
714 m_Hud.KeyPress(key);
715 }
716
717 override void OnKeyRelease(int key)
718 {
719 super.OnKeyRelease(key);
720 }
721
722 override void OnEvent(EventType eventTypeId, Param params)
723 {
724 super.OnEvent(eventTypeId, params);
725 InventoryMenu menu;
726 Man player = GetGame().GetPlayer();
727
728 switch (eventTypeId)
729 {
731 ChatMessageEventParams chat_params = ChatMessageEventParams.Cast( params );
732 if (m_LifeState == EPlayerStates.ALIVE)
733 {
734 m_Chat.Add(chat_params);
735 }
736 break;
737
739 ChatChannelEventParams cc_params = ChatChannelEventParams.Cast( params );
740 ChatInputMenu chatMenu = ChatInputMenu.Cast( GetUIManager().FindMenu(MENU_CHAT_INPUT) );
741 if (chatMenu)
742 {
743 chatMenu.UpdateChannel();
744 }
745 else
746 {
747 m_ChatChannelText.SetText(ChatInputMenu.GetChannelName(cc_params.param1));
748 m_ChatChannelFadeTimer.FadeIn(m_ChatChannelArea, 0.5, true);
750 }
751 break;
752
753 case WindowsResizeEventTypeID:
755 m_Hud.OnResizeScreen();
756
757 break;
758
760 SetFreeCameraEventParams set_free_camera_event_params = SetFreeCameraEventParams.Cast( params );
761 PluginDeveloper plugin_developer = PluginDeveloper.Cast( GetPlugin(PluginDeveloper) );
762 plugin_developer.OnSetFreeCameraEvent( PlayerBase.Cast( player ), set_free_camera_event_params.param1 );
763 break;
765 NetworkInputBufferEventParams networkInputBufferParams = NetworkInputBufferEventParams.Cast(params);
766 if (networkInputBufferParams)
767 {
768 OnInputBufferEvent(networkInputBufferParams.param1);
769 }
770 break;
771 }
772 }
773
774 override void OnItemUsed(InventoryItem item, Man owner)
775 {
776 if (item && GetUIManager().GetMenu() == NULL)
777 {
778 if (item.IsInherited(ItemBook))
779 {
780 BookMenu bookMenu = BookMenu.Cast( GetUIManager().EnterScriptedMenu(MENU_BOOK, NULL) );
781 if (bookMenu)
782 {
783 bookMenu.ReadBook(item);
784 }
785 }
786 }
787 }
788
789#ifdef DEVELOPER
790 override void SetInputSuppression(bool state)
791 {
792 m_SuppressNextFrame = state;
793 }
794
795 override bool GetInputSuppression()
796 {
797 return m_SuppressNextFrame;
798 }
799#endif
800
802 override void PlayerControlEnable( bool bForceSupress )
803 {
804 super.PlayerControlEnable(bForceSupress);
805
806 if (m_ControlDisabledMode != -1)
807 {
808 switch (m_ControlDisabledMode)
809 {
811 {
812 RemoveActiveInputExcludes({"menu"},bForceSupress);
813 break;
814 }
816 {
817 RemoveActiveInputExcludes({"inventory"},bForceSupress);
818 RemoveActiveInputRestriction(EInputRestrictors.INVENTORY);
819 break;
820 }
822 {
823 RemoveActiveInputExcludes({"loopedactions"},bForceSupress);
824 RemoveActiveInputRestriction(EInputRestrictors.MAP);
825 break;
826 }
828 {
829 RemoveActiveInputExcludes({"radialmenu"},bForceSupress);
830 break;
831 }
833 {
834 RemoveActiveInputExcludes({"radialmenu"},bForceSupress);
835 break;
836 }
837 }
838
840
841 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
842 if (player)
843 {
844 HumanInputController hic = player.GetInputController();
845 hic.LimitsDisableSprint(false);
846 }
847 }
848 }
849
851 override void PlayerControlDisable(int mode)
852 {
853 super.PlayerControlDisable(mode);
854
855 switch (mode)
856 {
858 {
859 AddActiveInputExcludes({"menu"});
860 break;
861 }
863 {
864 AddActiveInputExcludes({"inventory"});
865 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
866 break;
867 }
869 {
870 AddActiveInputExcludes({"loopedactions"});
871 AddActiveInputRestriction(EInputRestrictors.MAP);
872 break;
873 }
875 {
876 AddActiveInputExcludes({"radialmenu"});
877 break;
878 }
880 {
881 AddActiveInputExcludes({"radialmenu"});
882 break;
883 }
884 default:
885 {
886 Debug.Log("Unknown controls disable mode");
887 return;
888 }
889 }
890
892
893 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
894 if ( player )
895 {
896 ItemBase item = player.GetItemInHands();
897 if (item && item.IsWeapon())
898 player.RequestResetADSSync();
899 }
900 }
901
903 override void RemoveActiveInputExcludes(array<string> excludes, bool bForceSupress = false)
904 {
905 super.RemoveActiveInputExcludes(excludes,bForceSupress);
906
907 if (excludes.Count() != 0)
908 {
909 bool changed = false;
910
912 {
913 foreach (string excl : excludes)
914 {
915 if (m_ActiveInputExcludeGroups.Find(excl) != -1)
916 {
917 m_ActiveInputExcludeGroups.RemoveItem(excl);
918 changed = true;
919 }
920 }
921
922 if (changed)
923 {
925 }
926 }
927
928 // supress control for next frame
929 GetUApi().SupressNextFrame(bForceSupress);
930 }
931 }
932
934 override void RemoveActiveInputRestriction(int restrictor)
935 {
936 //unique behaviour outside regular excludes
937 if (restrictor > -1)
938 {
939 switch (restrictor)
940 {
941 case EInputRestrictors.INVENTORY:
942 {
943 GetUApi().GetInputByID(UAWalkRunForced).ForceEnable(false); // force walk off!
944 break;
945 }
946 case EInputRestrictors.MAP:
947 {
948 GetUApi().GetInputByID(UAWalkRunForced).ForceEnable(false); // force walk off!
949 break;
950 }
951 }
952
953 if (m_ActiveInputRestrictions && m_ActiveInputRestrictions.Find(restrictor) != -1)
954 {
955 m_ActiveInputRestrictions.RemoveItem(restrictor);
956 }
957 }
958 }
959
961 override void AddActiveInputExcludes(array<string> excludes)
962 {
963 super.AddActiveInputExcludes(excludes);
964
965 if (excludes.Count() != 0)
966 {
967 bool changed = false;
969 {
971 }
972
973 foreach (string excl : excludes)
974 {
975 if (m_ActiveInputExcludeGroups.Find(excl) == -1)
976 {
977 m_ActiveInputExcludeGroups.Insert(excl);
978 changed = true;
979 }
980 }
981
982 if (changed)
983 {
985 #ifdef BULDOZER
987 #endif
988 }
989 }
990 }
991
993 override void AddActiveInputRestriction(int restrictor)
994 {
995 //unique behaviour outside regular excludes
996 if (restrictor > -1)
997 {
998 switch (restrictor)
999 {
1000 case EInputRestrictors.INVENTORY:
1001 {
1002 GetUApi().GetInputByID(UAWalkRunForced).ForceEnable(true); // force walk on!
1003 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
1004 if ( player )
1005 {
1006 ItemBase item = player.GetItemInHands();
1007 if (item && item.IsWeapon())
1008 player.RequestResetADSSync();
1009 }
1010 break;
1011 }
1012 case EInputRestrictors.MAP:
1013 {
1014 GetUApi().GetInputByID(UAWalkRunForced).ForceEnable(true); // force walk on!
1015 break;
1016 }
1017 }
1018
1020 {
1022 }
1023 if (m_ActiveInputRestrictions.Find(restrictor) == -1)
1024 {
1025 m_ActiveInputRestrictions.Insert(restrictor);
1026 }
1027 }
1028 }
1029
1031 override void RefreshExcludes()
1032 {
1034 }
1035
1037 protected void PerformRefreshExcludes()
1038 {
1040 {
1041 foreach (string excl : m_ActiveInputExcludeGroups)
1042 {
1043 GetUApi().ActivateExclude(excl);
1044 }
1045 }
1046
1048 }
1049
1051 override void EnableAllInputs(bool bForceSupress = false)
1052 {
1054
1056 {
1057 int count = m_ActiveInputRestrictions.Count();
1058 for (int i = 0; i < count; i++)
1059 {
1061 }
1062 m_ActiveInputRestrictions.Clear(); //redundant?
1063 }
1065 {
1067 }
1068
1069 GetUApi().UpdateControls(); //it is meant to happen instantly, does not wait for update to process
1070 GetUApi().SupressNextFrame(bForceSupress); // supress control for next frame
1071 }
1072
1074 override bool IsControlDisabled()
1075 {
1076 bool active = false;
1078 {
1079 active |= m_ActiveInputExcludeGroups.Count() > 0;
1080 }
1082 {
1083 active |= m_ActiveInputRestrictions.Count() > 0;
1084 }
1085 active |= m_ControlDisabledMode >= INPUT_EXCLUDE_ALL; //legacy stuff, Justin case
1086 return active;
1087 }
1088
1090 override bool IsInputExcludeActive(string exclude)
1091 {
1092 return m_ActiveInputExcludeGroups && m_ActiveInputExcludeGroups.Find(exclude) != -1;
1093 }
1094
1096 override bool IsInputRestrictionActive(int restriction)
1097 {
1098 return m_ActiveInputRestrictions && m_ActiveInputRestrictions.Find(restriction) != -1;
1099 }
1100
1103 {
1104 return m_ControlDisabledMode;
1105 }
1106
1108 {
1109 GetUIManager().CloseAll();
1110 }
1111
1112
1114 {
1115 if( GetUIManager() )
1116 {
1117 GetUIManager().HideDialog();
1118 GetUIManager().CloseAll();
1119 }
1120
1122
1123 if( m_Chat )
1124 m_Chat.Clear();
1125 }
1126
1127 void MoveHudForInventory( bool inv_open )
1128 {
1129 #ifdef PLATFORM_CONSOLE
1130 IngameHud hud = IngameHud.Cast( GetHud() );
1131 if( hud )
1132 {
1133 if( inv_open )
1134 {
1135 hud.GetHudPanelWidget().SetPos( 0, -0.055 );
1136 }
1137 else
1138 {
1139 hud.GetHudPanelWidget().SetPos( 0, 0 );
1140 }
1141 }
1142 #endif
1143 }
1144
1145 override void ShowInventory()
1146 {
1147 UIScriptedMenu menu = GetUIManager().GetMenu();
1148
1149 if ( !menu && GetGame().GetPlayer().GetHumanInventory().CanOpenInventory() && !GetGame().GetPlayer().IsInventorySoftLocked() )
1150 {
1151 if( !m_InventoryMenu )
1152 {
1153 InitInventory();
1154 }
1155
1156 if( !GetUIManager().FindMenu( MENU_INVENTORY ) )
1157 {
1158 GetUIManager().ShowScriptedMenu(m_InventoryMenu, null);
1159 PlayerBase.Cast(GetGame().GetPlayer()).OnInventoryMenuOpen();
1160 }
1161 AddActiveInputExcludes({"inventory"});
1162 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
1163 }
1164 }
1165
1166 override void HideInventory()
1167 {
1168 if (m_InventoryMenu)
1169 {
1170 GetUIManager().HideScriptedMenu(m_InventoryMenu);
1171 RemoveActiveInputExcludes({"inventory"},false);
1172 RemoveActiveInputRestriction(EInputRestrictors.INVENTORY);
1173 PlayerBase.Cast(GetGame().GetPlayer()).OnInventoryMenuClose();
1175 }
1176 }
1177
1179 {
1180 if (m_InventoryMenu)
1181 {
1182 if (!m_InventoryMenu.GetParentMenu() && GetUIManager().GetMenu() != m_InventoryMenu)
1183 {
1184 m_InventoryMenu.SetParentMenu(GetUIManager().GetMenu()); //hack; guarantees the 'm_pCurrentMenu' will be set to whatever is on top currently
1185 }
1186 m_InventoryMenu.Close();
1187 m_InventoryMenu = NULL;
1188 }
1189 }
1190
1191 override void ResetGUI()
1192 {
1194 InitInventory();
1195 }
1196
1197 override void ShowChat()
1198 {
1201 m_ChatChannelArea.Show(false);
1202 m_UIManager.EnterScriptedMenu(MENU_CHAT_INPUT, NULL);
1203
1204 int level = GetGame().GetVoiceLevel();
1206
1207 AddActiveInputExcludes({"menu"});
1208 }
1209
1210 override void HideChat()
1211 {
1212 RemoveActiveInputExcludes({"menu"},true);
1213 }
1214
1216 {
1217 if ( GetHud() )
1218 GetHud().ShowVehicleInfo();
1219 }
1220
1222 {
1223 if ( GetHud() )
1224 GetHud().HideVehicleInfo();
1225 }
1226
1227 override Hud GetHud()
1228 {
1229 return m_Hud;
1230 }
1231
1233 {
1234 return m_HudDebug;
1235 }
1236
1238 {
1239 if (GetHudDebug())
1240 GetHudDebug().RefreshCrosshairVisibility();
1241 }
1242
1244 {
1245 if (GetHudDebug())
1246 GetHudDebug().HideCrosshairVisibility();
1247 }
1248
1249 override bool IsPaused()
1250 {
1252 }
1253
1254 override void Pause()
1255 {
1256 if (IsPaused() || (GetGame().GetUIManager().GetMenu() && GetGame().GetUIManager().GetMenu().GetID() == MENU_INGAME))
1257 {
1258 return;
1259 }
1260
1261 m_PauseQueued = true;
1262
1263 if ( g_Game.IsClient() && g_Game.GetGameState() != DayZGameState.IN_GAME )
1264 {
1265 return;
1266 }
1267
1268 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
1269 if ( player && !player.IsPlayerLoaded() || IsPlayerRespawning() )
1270 {
1271 return;
1272 }
1273
1274 CloseAllMenus();
1275
1276 // open ingame menu
1277 UIScriptedMenu menu = GetUIManager().EnterScriptedMenu( MENU_INGAME, GetGame().GetUIManager().GetMenu() );
1278 if (!menu || !menu.IsVisible())
1279 {
1280 return;
1281 }
1282
1283 AddActiveInputExcludes({"menu"});
1284 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
1285
1286 m_PauseQueued = false;
1287 }
1288
1289 override void Continue()
1290 {
1292 if (menu)
1293 {
1294 int menu_id = menu.GetID();
1295 if (!IsPaused() || (menu_id != MENU_INGAME && menu_id != MENU_LOGOUT && menu_id != MENU_RESPAWN_DIALOGUE) || (m_Logout && m_Logout.layoutRoot.IsVisible()))
1296 {
1297 return;
1298 }
1299 }
1300
1301 RemoveActiveInputExcludes({"menu"},true);
1302 RemoveActiveInputRestriction(EInputRestrictors.INVENTORY);
1303 GetUIManager().CloseMenu(MENU_INGAME);
1304 }
1305
1306 override bool IsMissionGameplay()
1307 {
1308 return true;
1309 }
1310
1311 override void AbortMission()
1312 {
1313 #ifdef BULDOZER
1315 #else
1317 #endif
1318 }
1319
1320 override void CreateLogoutMenu(UIMenuPanel parent)
1321 {
1322 // prevent creating logout dialog if input buffer has reached server config maximumClientInputs limit.
1323 if (GetGame() && m_InputBufferFull)
1324 return;
1325
1326 // prevent creating the logout dialog if the in-game menu was closed before (DZ-23150)
1327 UIScriptedMenu menu = GetUIManager().GetMenu();
1328 if (menu && menu.GetID() != MENU_LOGOUT && menu.IsClosing())
1329 return;
1330
1331 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
1332 // do not show logout screen if player's dead
1333 if (!player || player.IsDamageDestroyed())
1334 {
1335 // exit the game immediately
1336 AbortMission();
1337 return;
1338 }
1339
1340 if (parent)
1341 {
1342 m_Logout = LogoutMenu.Cast(parent.EnterScriptedMenu(MENU_LOGOUT));
1343
1344 if (m_Logout)
1345 {
1346 m_Logout.SetLogoutTime();
1347 }
1348 }
1349 }
1350
1351 override void StartLogoutMenu(int time)
1352 {
1353 if (m_Logout)
1354 {
1355 if (time > 0)
1356 {
1357 // character will be deleted from server int "time" seconds
1358 m_Logout.SetTime(time);
1359 m_Logout.Show();
1360
1361 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(m_Logout.UpdateTime, 1000, true);
1362 }
1363 else
1364 {
1365 // no waiting time -> player is most likely dead
1366 m_Logout.Exit();
1367 }
1368 }
1369 }
1370
1371 override void CreateDebugMonitor()
1372 {
1373 if (!m_DebugMonitor)
1374 {
1376 m_DebugMonitor.Init();
1377 }
1378 else
1379 m_DebugMonitor.Show();
1380
1381 }
1382 override void HideDebugMonitor()
1383 {
1384 if (m_DebugMonitor)
1385 {
1386 m_DebugMonitor.Hide();
1387 }
1388 }
1389
1390 protected void HandleMapToggleByKeyboardShortcut(Man player)
1391 {
1393 if (um && !um.IsMenuOpen(MENU_MAP))
1394 {
1395 um.CloseAll();
1397 {
1398 um.EnterScriptedMenu(MENU_MAP, null);
1400 GetGame().GetMission().AddActiveInputRestriction(EInputRestrictors.MAP);
1401 }
1402 }
1403 }
1404
1405 protected bool IsMapUnfoldActionRunning(ActionBase pAction)
1406 {
1407 return !pAction || pAction.Type() != ActionUnfoldMap;
1408 }
1409
1410 /*void ChangeBleedingIndicatorVisibility(bool visible)
1411 {
1412 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
1413 if (player)
1414 {
1415 BleedingSourcesManagerRemote manager = player.GetBleedingManagerRemote();
1416 if (manager && manager.GetBleedingSourcesCount() > 0)
1417 {
1418 manager.ChangeBleedingIndicatorVisibility(visible);
1419 }
1420 }
1421 }*/
1422
1424 {
1425 if (!m_DebugMonitor) return;
1426
1427 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
1428 if (player)
1429 {
1430 DebugMonitorValues values = player.GetDebugMonitorValues();
1431 if (values)
1432 {
1433 m_DebugMonitor.SetHealth(values.GetHealth());
1434 m_DebugMonitor.SetBlood(values.GetBlood());
1435 m_DebugMonitor.SetLastDamage(values.GetLastDamage());
1436 m_DebugMonitor.SetPosition(MiscGameplayFunctions.TruncateVec(player.GetPosition(),1));
1437 }
1438 }
1439
1440 float currFPS = GetGame().GetAvgFPS(10); // Not using last, but average of last x to prevent jitter
1441 float minFPS, maxFPS, avgFPS;
1442 GetGame().GetFPSStats(minFPS, maxFPS, avgFPS);
1443 m_DebugMonitor.SetFramerate(currFPS, minFPS, maxFPS, avgFPS);
1444 }
1445
1446 void SetActionDownTime( int time_down )
1447 {
1448 m_ActionDownTime = time_down;
1449 }
1450
1451 void SetActionUpTime( int time_up )
1452 {
1453 m_ActionUpTime = time_up;
1454 }
1455
1457 {
1458 return m_ActionDownTime;
1459 }
1460
1462 {
1463 return m_ActionUpTime;
1464 }
1465
1467 {
1468 float hold_action_time = LocalReleaseTime() - LocalPressTime();
1469 return hold_action_time;
1470 }
1471
1473 {
1474#ifndef SERVER
1475 ShowHairDebugValues(DiagMenu.GetBool(DiagMenuIDs.MISC_HAIR_DISPLAY_DEBUG));
1476#endif
1477 }
1478
1479 void ShowHairDebugValues(bool state)
1480 {
1481#ifdef DIAG_DEVELOPER
1482 if ( state )
1483 {
1485
1486 int i = DiagMenu.GetValue(DiagMenuIDs.MISC_HAIR_LEVEL);
1487 bool bState = diagmenu.m_HairHidingStateMap.Get(i);
1488 string selectionState;
1489 if (!bState)
1490 selectionState = "Hidden";
1491 else
1492 selectionState = "Shown";
1493 string selectionName = diagmenu.m_HairSelectionArray.Get(i);
1494
1496 DbgUI.Begin("Hair Debug", 50, 150);
1497 DbgUI.Text("Current Hair Selection:" + selectionName);
1498 DbgUI.Text("State: " + selectionState);
1499
1500 DbgUI.End();
1502 }
1503 else
1504 {
1506 DbgUI.Begin("Hair Debug", 50, 50);
1507 DbgUI.End();
1509 }
1510#endif
1511 }
1512
1513 override void UpdateVoiceLevelWidgets(int level)
1514 {
1515 for ( int n = 0; n < m_VoiceLevelsWidgets.Count(); n++ )
1516 {
1517 int voiceKey = m_VoiceLevelsWidgets.GetKey(n);
1518 ImageWidget voiceWidget = m_VoiceLevelsWidgets.Get(n);
1519
1520 // stop fade timer since it will be refreshed
1521 WidgetFadeTimer timer = m_VoiceLevelTimers.Get(n);
1522 timer.Stop();
1523
1524 // show widgets according to the level
1525 if ( voiceKey <= level )
1526 {
1527 voiceWidget.SetAlpha(1.0); // reset from possible previous fade out
1528 voiceWidget.Show(true);
1529
1530 if ( !m_VoNActive && !GetUIManager().FindMenu(MENU_CHAT_INPUT) )
1531 timer.FadeOut(voiceWidget, 3.0);
1532 }
1533 else
1534 voiceWidget.Show(false);
1535 }
1536
1537 // fade out microphone icon when switching levels without von on
1538 if ( !m_VoNActive )
1539 {
1540 if ( !GetUIManager().FindMenu(MENU_CHAT_INPUT) )
1541 {
1542 m_MicrophoneIcon.SetAlpha(1.0);
1543 m_MicrophoneIcon.Show(true);
1544
1545 m_MicFadeTimer.FadeOut(m_MicrophoneIcon, 3.0);
1546 }
1547 }
1548 else
1549 {
1550 // stop mic icon fade timer when von is activated
1551 m_MicFadeTimer.Stop();
1552 }
1553 }
1554
1555 override ImageWidget GetMicrophoneIcon()
1556 {
1557 return m_MicrophoneIcon;
1558 }
1559
1560 override WidgetFadeTimer GetMicWidgetFadeTimer()
1561 {
1562 return m_MicFadeTimer;
1563 }
1564
1569
1574
1575 override bool IsVoNActive()
1576 {
1577 return m_VoNActive;
1578 }
1579
1580 override void SetVoNActive(bool active)
1581 {
1582 m_VoNActive = active;
1583 }
1584
1586 {
1587 for ( int n = 0; n < m_VoiceLevelsWidgets.Count(); n++ )
1588 {
1589 ImageWidget voiceWidget = m_VoiceLevelsWidgets.Get( n );
1590 voiceWidget.Show(false);
1591 }
1592 }
1593
1595 {
1596 return m_Note;
1597 };
1598
1599 override void SetNoteMenu(UIScriptedMenu menu)
1600 {
1601 m_Note = NoteMenu.Cast(menu);
1602 };
1603
1604 override void OnPlayerRespawned(Man player)
1605 {
1606 #ifdef DIAG_DEVELOPER
1607 if (m_HudDebug)
1608 m_HudDebug.RefreshByLocalProfile();
1609 #endif
1610
1611 PlayerBase playerBase = PlayerBase.Cast(player);
1612 if (playerBase)
1613 {
1614 GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(playerBase.ShowDeadScreen, false, 0);
1615 }
1616
1617 GetGame().GetSoundScene().SetSoundVolume(g_Game.m_volume_sound,1);
1618 GetGame().GetSoundScene().SetSpeechExVolume(g_Game.m_volume_speechEX,1);
1619 GetGame().GetSoundScene().SetMusicVolume(g_Game.m_volume_music,1);
1620 GetGame().GetSoundScene().SetVOIPVolume(g_Game.m_volume_VOIP,1);
1621 GetGame().GetSoundScene().SetRadioVolume(g_Game.m_volume_radio,1);
1622 }
1623
1624 override void SetPlayerRespawning(bool state)
1625 {
1626 m_PlayerRespawning = state;
1627 }
1628
1629 override bool IsPlayerRespawning()
1630 {
1631 return m_PlayerRespawning;
1632 }
1633
1635 {
1636 return m_ActiveRefresherLocations;
1637 }
1638
1639 override void SetRespawnModeClient(int mode)
1640 {
1641 m_RespawnModeClient = mode;
1642 }
1643
1645 {
1646 return m_RespawnModeClient;
1647 }
1648
1649 override GameplayEffectWidgets GetEffectWidgets()
1650 {
1651 return m_EffectWidgets;
1652 }
1653
1662
1663 protected void OnInputBufferEvent(bool state)
1664 {
1665 if (m_InputBufferFull != state)
1666 {
1667 m_InputBufferFull = state;
1669 {
1670 if (GetGame().GetUIManager().GetMenu() && GetGame().GetUIManager().GetMenu().GetID() == MENU_INVENTORY)
1671 {
1673 }
1674
1676
1679 }
1680 }
1681 }
1682
1683 protected void InputBufferCheck()
1684 {
1685 PlayerBase player;
1687 ActionBase action;
1688
1690 {
1691 if (m_ConnectionMenu && (!GetGame().GetPlayer().IsAlive() || GetGame().GetPlayer().IsUnconscious()))
1692 {
1693 m_ConnectionMenu.Close();
1694
1695 player = PlayerBase.Cast(GetGame().GetPlayer());
1696 if (!player)
1697 return;
1698
1699 amb = player.GetActionManager();
1700 if (!amb)
1701 return;
1702
1703 action = amb.GetRunningAction();
1704 if (action && amb.GetActionState(action) != UA_NONE)
1705 {
1706 amb.RequestInterruptAction();
1707 }
1708 return;
1709 }
1710
1711 if (!m_ConnectionMenu)
1712 {
1713 if (GetGame().GetUIManager().GetMenu() && GetGame().GetUIManager().GetMenu().GetID() == MENU_INVENTORY)
1714 {
1716 }
1717
1720 }
1721 }
1722 else
1723 {
1724 if (m_ConnectionMenu)
1725 {
1727 m_ConnectionMenu.Close();
1728
1729 player = PlayerBase.Cast(GetGame().GetPlayer());
1730 if (!player)
1731 return;
1732
1733 amb = player.GetActionManager();
1734 if (!amb)
1735 return;
1736
1737 action = amb.GetRunningAction();
1738 if (action && amb.GetActionState(action) != UA_NONE)
1739 {
1740 amb.RequestInterruptAction();
1741 }
1742 }
1743 }
1744 }
1745}
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:561
WorldData m_WorldData
Определения Environment.c:85
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.
Определения Global/game.c:892
proto native Input GetInput()
proto native Mission GetMission()
static bool GetUse3DMap()
Определения CfgGameplayHandler.c:392
static bool LoadData()
Определения CfgGameplayHandler.c:44
static bool GetMapIgnoreMapOwnership()
Определения CfgGameplayHandler.c:413
Определения 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.
Определения 3_Game/tools/Debug.c:122
Определения 3_Game/tools/Debug.c:2
Определения DebugMonitor.c:2
float GetHealth()
Определения DebugMonitorValues.c:69
float GetBlood()
Определения DebugMonitorValues.c:64
string GetLastDamage()
Определения DebugMonitorValues.c:74
Определения EnDebug.c:241
static void CreateZones()
Определения ContaminatedAreaLoader.c:6
Определения 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
EntityAI GetSelectedItem()
Определения ItemManager.c:85
static ItemManager GetInstance()
Определения ItemManager.c:282
Определения ItemManager.c:2
static bool IsLogsEnable()
Определения 3_Game/tools/Debug.c:628
Определения 3_Game/tools/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:1051
override void CreateDebugMonitor()
Определения missionGameplay.c:1371
override void PlayerControlEnable(bool bForceSupress)
Deprecated; removes last input exclude and associated controls restrictions.
Определения missionGameplay.c:802
HudDebug GetHudDebug()
Определения missionGameplay.c:1232
int m_LifeState
Определения missionGameplay.c:3
void InputBufferCheck()
Определения missionGameplay.c:1683
ref array< int > m_ActiveInputRestrictions
Определения missionGameplay.c:40
float GetHoldActionTime()
Определения missionGameplay.c:1466
override UIScriptedMenu GetNoteMenu()
Определения missionGameplay.c:1594
void SendMuteListToServer(map< string, bool > mute_list)
Определения missionGameplay.c:237
override void AddActiveInputExcludes(array< string > excludes)
Adds one or more exclude groups to disable and refreshes excludes.
Определения missionGameplay.c:961
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:276
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:903
void SetActionUpTime(int time_up)
Определения missionGameplay.c:1451
bool m_ControlDisabled
Определения missionGameplay.c:37
override map< int, ref WidgetFadeTimer > GetVoiceLevelTimers()
Определения missionGameplay.c:1570
override void OnPlayerRespawned(Man player)
Определения missionGameplay.c:1604
override void ShowInventory()
Определения missionGameplay.c:1145
void HideVehicleInfo()
Определения missionGameplay.c:1221
ref IngameHud m_Hud
Определения missionGameplay.c:14
override void PlayerControlDisable(int mode)
Deprecated; simple input restrictions.
Определения missionGameplay.c:851
void DestroyInventory()
Определения missionGameplay.c:1178
override void Continue()
Определения missionGameplay.c:1289
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:1090
int m_RespawnModeClient
Определения missionGameplay.c:44
override void StartLogoutMenu(int time)
Определения missionGameplay.c:1351
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:1074
int m_ActionUpTime
Определения missionGameplay.c:35
override map< int, ImageWidget > GetVoiceLevelWidgets()
Определения missionGameplay.c:1565
void DestroyAllMenus()
Определения missionGameplay.c:1113
bool m_InitOnce
Определения missionGameplay.c:36
UIManager m_UIManager
Определения missionGameplay.c:6
override ImageWidget GetMicrophoneIcon()
Определения missionGameplay.c:1555
override void SetNoteMenu(UIScriptedMenu menu)
Определения missionGameplay.c:1599
void TickScheduler(float timeslice)
Определения missionGameplay.c:214
override void HideDebugMonitor()
Определения missionGameplay.c:1382
override void ResetGUI()
Определения missionGameplay.c:1191
override void ShowChat()
Определения missionGameplay.c:1197
override void OnKeyRelease(int key)
Определения missionGameplay.c:717
void HandleMapToggleByKeyboardShortcut(Man player)
Определения missionGameplay.c:1390
override void HideCrosshairVisibility()
Определения missionGameplay.c:1243
override void RefreshCrosshairVisibility()
Определения missionGameplay.c:1237
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:1096
override void SetVoNActive(bool active)
Определения missionGameplay.c:1580
ref DebugMonitor m_DebugMonitor
Определения missionGameplay.c:17
void CloseAllMenus()
Определения missionGameplay.c:1107
override bool IsMissionGameplay()
Определения missionGameplay.c:1306
override void HideChat()
Определения missionGameplay.c:1210
override void OnEvent(EventType eventTypeId, Param params)
Определения missionGameplay.c:722
void ShowHairDebugValues(bool state)
Определения missionGameplay.c:1479
ref WidgetFadeTimer m_ChatChannelFadeTimer
Определения missionGameplay.c:25
override int GetControlDisabledMode()
(mostly)DEPRECATED; only set on the old 'PlayerControlDisable' method
Определения missionGameplay.c:1102
override bool IsPlayerRespawning()
Определения missionGameplay.c:1629
int LocalPressTime()
Определения missionGameplay.c:1456
Widget m_VoiceLevels
Определения missionGameplay.c:49
override void AbortMission()
Определения missionGameplay.c:1311
override Hud GetHud()
Определения missionGameplay.c:1227
ref WidgetFadeTimer m_MicFadeTimer
Определения missionGameplay.c:26
const int HOLD_LIMIT_TIME
Определения missionGameplay.c:33
void SetActionDownTime(int time_down)
Определения missionGameplay.c:1446
override void HideVoiceLevelWidgets()
Определения missionGameplay.c:1585
override bool IsVoNActive()
Определения missionGameplay.c:1575
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:711
TextWidget m_ChatChannelText
Определения missionGameplay.c:29
override void RefreshExcludes()
queues refresh of input excludes
Определения missionGameplay.c:1031
ScriptInvoker GetConnectivityInvoker()
Определения missionGameplay.c:1654
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:1644
void InitInventory()
Определения missionGameplay.c:206
UIScriptedMenu m_ConnectionMenu
Определения missionGameplay.c:54
override void AddActiveInputRestriction(int restrictor)
Adds one input restriction (specific behaviour oudside regular excludes, defined below)
Определения missionGameplay.c:993
override void HideInventory()
Определения missionGameplay.c:1166
int LocalReleaseTime()
Определения missionGameplay.c:1461
override void Pause()
Определения missionGameplay.c:1254
override void CreateLogoutMenu(UIMenuPanel parent)
Определения missionGameplay.c:1320
override GameplayEffectWidgets GetEffectWidgets()
Определения missionGameplay.c:1649
void OnInputBufferEvent(bool state)
Определения missionGameplay.c:1663
ref map< int, ref WidgetFadeTimer > m_VoiceLevelTimers
Определения missionGameplay.c:51
Widget m_ChatChannelArea
Определения missionGameplay.c:28
void MoveHudForInventory(bool inv_open)
Определения missionGameplay.c:1127
void UpdateDebugMonitor()
Определения missionGameplay.c:1423
override void OnMissionFinish()
Определения missionGameplay.c:255
bool m_ProcessInputExcludes
Определения missionGameplay.c:41
override void SetPlayerRespawning(bool state)
Определения missionGameplay.c:1624
void PerformRefreshExcludes()
applies queued excludes (0 == clear excludes)
Определения missionGameplay.c:1037
ref GameplayEffectWidgets m_EffectWidgets
Определения missionGameplay.c:22
override void RemoveActiveInputRestriction(int restrictor)
Removes one restriction (specific behaviour oudside regular excludes, defined below)
Определения missionGameplay.c:934
ref Chat m_Chat
Определения missionGameplay.c:12
override void OnMissionStart()
Определения missionGameplay.c:184
bool IsMapUnfoldActionRunning(ActionBase pAction)
Определения missionGameplay.c:1405
override bool IsPaused()
Определения missionGameplay.c:1249
void ShowVehicleInfo()
Определения missionGameplay.c:1215
void DisplayHairDebug()
Определения missionGameplay.c:1472
ref Timer m_ToggleHudTimer
Определения missionGameplay.c:32
override void SetRespawnModeClient(int mode)
Определения missionGameplay.c:1639
override WidgetFadeTimer GetMicWidgetFadeTimer()
Определения missionGameplay.c:1560
override void UpdateVoiceLevelWidgets(int level)
Определения missionGameplay.c:1513
NoteMenu m_Note
Определения missionGameplay.c:30
override void UpdateInputDevicesAvailability()
Определения missionGameplay.c:247
bool m_InputBufferFull
Определения missionGameplay.c:53
ref InventoryMenu m_InventoryMenu
Определения missionGameplay.c:11
override void OnItemUsed(InventoryItem item, Man owner)
Определения missionGameplay.c:774
override array< vector > GetActiveRefresherLocations()
Определения missionGameplay.c:1634
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
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:
Определения 2_GameLib/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
Определения 3_Game/constants.c:657
const int INPUT_EXCLUDE_ALL
Определения 3_Game/constants.c:654
const int INPUT_EXCLUDE_INVENTORY
Определения 3_Game/constants.c:655
const int INPUT_EXCLUDE_MAP
Определения 3_Game/constants.c:658
const int INPUT_EXCLUDE_MOUSE_ALL
Определения 3_Game/constants.c:656
const int INPUT_DEVICE_MOUSE
Определения 1_Core/constants.c:24
const int INPUT_ACTION_TYPE_DOUBLETAP
Определения 1_Core/constants.c:40
const int INPUT_DEVICE_MOUSE_AXIS
Определения 1_Core/constants.c:42
const int INPUT_ACTION_TYPE_DOWN_EVENT
Определения 1_Core/constants.c:33
const int MENU_LOGOUT
Определения 3_Game/constants.c:195
const int MENU_INSPECT
Определения 3_Game/constants.c:179
const int MENU_MAP
Определения 3_Game/constants.c:191
const int MENU_RESPAWN_DIALOGUE
Определения 3_Game/constants.c:209
const int MENU_GESTURES
Определения 3_Game/constants.c:194
const int MENU_CONNECTION_DIALOGUE
Определения 3_Game/constants.c:215
const int MENU_CHAT
Определения 3_Game/constants.c:175
const int MENU_INVENTORY
Определения 3_Game/constants.c:180
const int MENU_NOTE
Определения 3_Game/constants.c:190
const int MENU_RADIAL_QUICKBAR
Определения 3_Game/constants.c:198
const int MENU_BOOK
Определения 3_Game/constants.c:192
const int MENU_INGAME
Определения 3_Game/constants.c:178
const int MENU_CHAT_INPUT
Определения 3_Game/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
Определения 3_Game/tools/tools.c:10
void Pause()
Pause Timer, internal counter is not restarted, so timer can continue later. Can be unpaused via Cont...
Определения 3_Game/tools/tools.c:239
void Continue()
Timer continue when it was paused.
Определения 3_Game/tools/tools.c:247
const int CALL_CATEGORY_GUI
Определения 3_Game/tools/tools.c:9
const int CALL_CATEGORY_SYSTEM
Определения 3_Game/tools/tools.c:8
const int UA_NONE
Определения 3_Game/constants.c:462
const int IDC_MAIN_QUIT
Определения 3_Game/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