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