DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
missionGameplay.c
Go to the documentation of this file.
1class MissionGameplay extends MissionBase
2{
5
7
9 ImageWidget m_MicrophoneIcon;
10
14 ref IngameHud m_Hud;
16 ref LogoutMenu m_Logout;
18
20
21 protected ref GameplayEffectWidgets m_EffectWidgets;
22
24 ref WidgetFadeTimer m_ChatChannelFadeTimer;
25 ref WidgetFadeTimer m_MicFadeTimer;
26
29 NoteMenu m_Note;
30
31 protected ref Timer m_ToggleHudTimer;
32 protected const int HOLD_LIMIT_TIME = 300; //ms
33 protected int m_ActionDownTime;
34 protected int m_ActionUpTime;
35 protected bool m_InitOnce;
36 protected bool m_ControlDisabled; //DEPRECATED; disabled mode stored below
37 protected int m_ControlDisabledMode;
38 protected ref array<string> m_ActiveInputExcludeGroups; //exclude groups defined in 'specific.xml' file
39 protected ref array<int> m_ActiveInputRestrictions; //additional scripted restrictions
40 protected bool m_ProcessInputExcludes;
41 protected bool m_QuickbarHold;
42 protected bool m_PlayerRespawning;
43 protected int m_RespawnModeClient; //for client-side usage
44 protected bool m_PauseQueued;
45
46 // von control info
47 protected bool m_VoNActive;
51
53 {
55 m_Initialized = false;
56 m_EffectWidgets = new GameplayEffectWidgets;
57 m_HudRootWidget = null;
58 m_Chat = new Chat;
59 m_ActionMenu = new ActionMenu;
60 m_LifeState = -1;
61 m_Hud = new IngameHud;
62 m_VoNActive = false;
63 m_PauseQueued = false;
64 m_ChatChannelFadeTimer = new WidgetFadeTimer;
65 m_MicFadeTimer = new WidgetFadeTimer;
66 m_ChatChannelHideTimer = new Timer(CALL_CATEGORY_GUI);
67 m_ToggleHudTimer = new Timer(CALL_CATEGORY_GUI);
68
69 m_ActiveRefresherLocations = new array<vector>;
71 }
72
74 {
76 //GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).Remove(this.UpdateDebugMonitor);
77 #ifndef NO_GUI
78 if (g_Game.GetUIManager() && g_Game.GetUIManager().ScreenFadeVisible())
79 {
80 g_Game.GetUIManager().ScreenFadeOut(0);
81 }
82 Continue();
83 #endif
84 }
85
87 {
88 return m_InventoryMenu;
89 }
90
91 override void OnInit()
92 {
93 super.OnInit();
94
95 if ( m_Initialized )
96 {
97 return;
98 }
99
100 #ifdef DEVELOPER
101 if (!GetGame().IsMultiplayer())//to make it work in single during development
102 {
104 }
105 #endif
106
107 PPEffects.Init(); //DEPRECATED, left in for legacy purposes only
109
110 m_UIManager = GetGame().GetUIManager();
111
112 m_Initialized = true;
113
114 // init hud ui
115 if ( !m_HudRootWidget )
116 {
117 m_HudRootWidget = GetGame().GetWorkspace().CreateWidgets("gui/layouts/day_z_hud.layout");
118
119 m_HudRootWidget.Show(false);
120
121 m_Chat.Init(m_HudRootWidget.FindAnyWidget("ChatFrameWidget"));
122
123 m_ActionMenu.Init( m_HudRootWidget.FindAnyWidget("ActionsPanel"), TextWidget.Cast( m_HudRootWidget.FindAnyWidget("DefaultActionWidget") ) );
124
125 m_Hud.Init( m_HudRootWidget.FindAnyWidget("HudPanel") );
126
127 // von enabled icon
128 m_MicrophoneIcon = ImageWidget.Cast( m_HudRootWidget.FindAnyWidget("mic") );
129 m_MicrophoneIcon.Show(false);
130
131 // von voice level
132 m_VoiceLevels = m_HudRootWidget.FindAnyWidget("VoiceLevelsPanel");
133 m_VoiceLevelsWidgets = new map<int, ImageWidget>; // [key] voice level
134 m_VoiceLevelTimers = new map<int,ref WidgetFadeTimer>; // [key] voice level
135
136 if ( m_VoiceLevels )
137 {
138 m_VoiceLevelsWidgets.Set(VoiceLevelWhisper, ImageWidget.Cast( m_VoiceLevels.FindAnyWidget("Whisper") ));
139 m_VoiceLevelsWidgets.Set(VoiceLevelTalk, ImageWidget.Cast( m_VoiceLevels.FindAnyWidget("Talk") ));
140 m_VoiceLevelsWidgets.Set(VoiceLevelShout, ImageWidget.Cast( m_VoiceLevels.FindAnyWidget("Shout") ));
141
142 m_VoiceLevelTimers.Set(VoiceLevelWhisper, new WidgetFadeTimer);
143 m_VoiceLevelTimers.Set(VoiceLevelTalk, new WidgetFadeTimer);
144 m_VoiceLevelTimers.Set(VoiceLevelShout, new WidgetFadeTimer);
145 }
146
148
149 // chat channel
150 m_ChatChannelArea = m_HudRootWidget.FindAnyWidget("ChatChannelPanel");
151 m_ChatChannelText = TextWidget.Cast( m_HudRootWidget.FindAnyWidget("ChatChannelText") );
152 }
153
154 // init hud ui
155 #ifdef DEVELOPER
156 m_HudDebug = new HudDebug;
157
158 if ( !m_HudDebug.IsInitialized() )
159 {
160 m_HudDebug.Init( GetGame().GetWorkspace().CreateWidgets("gui/layouts/debug/day_z_hud_debug.layout") );
161 PluginConfigDebugProfile.GetInstance().SetLogsEnabled(LogManager.IsLogsEnable());
162 }
163 #endif
164 }
165
167 {
168 return m_UIManager;
169 }
170
171 override void OnMissionStart()
172 {
173 g_Game.SetConnecting(false);
174 GetUIManager().ShowUICursor(false);
175 g_Game.SetMissionState( DayZGame.MISSION_STATE_GAME );
176
177 }
178
180 {
181 if ( !m_InventoryMenu )
182 {
183 m_InventoryMenu = InventoryMenu.Cast( GetUIManager().CreateScriptedMenu(MENU_INVENTORY, null) );
184 }
185 }
186
187 void TickScheduler(float timeslice)
188 {
189 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
190
191 if( player )
192 player.OnScheduledTick(timeslice);
193 }
194
196 {
197 if( mute_list && mute_list.Count() > 0 )
198 {
199 ScriptRPC rpc = new ScriptRPC();
200 rpc.Write(mute_list);
201 rpc.Send(null, ERPCs.RPC_USER_SYNC_PERMISSIONS, true, null);
202 }
203 }
204
206 {
207 super.UpdateInputDevicesAvailability();
208
209 g_Game.GetInput().UpdateConnectedInputDeviceList();
210 g_Game.UpdateInputDeviceDisconnectWarning();
211 }
212
213 override void OnMissionFinish()
214 {
215 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
216
217 //Print("OnMissionFinish");
220
221 m_Chat.Destroy();
222 delete m_HudRootWidget;
223
224 if (m_DebugMonitor)
225 m_DebugMonitor.Hide();
226 g_Game.GetUIManager().ShowUICursor(false);
229 g_Game.SetMissionState( DayZGame.MISSION_STATE_FINNISH );
230 }
231
232 override void OnUpdate(float timeslice)
233 {
234 super.OnUpdate(timeslice);
235
236#ifdef DIAG_DEVELOPER
237 UpdateInputDeviceDiag();
238#endif
239
240 Man player = GetGame().GetPlayer();
241 PlayerBase playerPB = PlayerBase.Cast(player);
242 TickScheduler(timeslice);
243 UpdateDummyScheduler();//for external entities
244 UIScriptedMenu menu = m_UIManager.GetMenu();
245 InventoryMenu inventory = InventoryMenu.Cast( m_UIManager.FindMenu(MENU_INVENTORY) );
246 NoteMenu note_menu = NoteMenu.Cast( m_UIManager.FindMenu(MENU_NOTE) );
247 GesturesMenu gestures_menu = GesturesMenu.Cast(m_UIManager.FindMenu(MENU_GESTURES));
248 RadialQuickbarMenu quickbar_menu = RadialQuickbarMenu.Cast(m_UIManager.FindMenu(MENU_RADIAL_QUICKBAR));
249 InspectMenuNew inspect = InspectMenuNew.Cast( m_UIManager.FindMenu(MENU_INSPECT) );
250 Input input = GetGame().GetInput();
251 ActionBase runningAction;
252
253 if ( playerPB )
254 {
255 #ifdef DIAG_DEVELOPER
256 if ( DiagMenu.GetBool(DiagMenuIDs.MISC_HOLOGRAM) )
257 {
258 DbgUI.Begin("Hologram Debug", 5, 5);
259 }
260 #endif
261
262 if ( playerPB.GetHologramLocal() )
263 {
264 playerPB.GetHologramLocal().UpdateHologram( timeslice );
265 }
266 #ifdef DIAG_DEVELOPER
267 else if ( DiagMenu.GetBool(DiagMenuIDs.MISC_HOLOGRAM) )
268 {
269 DbgUI.Text("No active Hologram");
270 }
271
272 if ( DiagMenu.GetBool(DiagMenuIDs.MISC_HOLOGRAM) )
273 {
274 DbgUI.End();
275 }
276 #endif
277
278 runningAction = playerPB.GetActionManager().GetRunningAction();
279 }
280
281#ifdef PLATFORM_CONSOLE
282 //'Special behaviour' for colliding VON distance input actions [CONSOLE ONLY]
283 if (GetUApi().GetInputByID(UAVoiceModifierHelper).LocalValue() && !menu)
284 {
285 GetUApi().GetInputByID(UAUIQuickbarRadialOpen).Lock();
286 GetUApi().GetInputByID(UAZoomInToggle).Lock();
287 GetUApi().GetInputByID(UAPersonView).Lock();
288 GetUApi().GetInputByID(UALeanLeft).Lock();
289 GetUApi().GetInputByID(UALeanRight).Lock();
290 }
291 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!)
292 {
293 GetUApi().GetInputByID(UAUIQuickbarRadialOpen).Unlock();
294 GetUApi().GetInputByID(UAZoomInToggle).Unlock();
295 GetUApi().GetInputByID(UAPersonView).Unlock();
296 GetUApi().GetInputByID(UALeanLeft).Unlock();
297 GetUApi().GetInputByID(UALeanRight).Unlock();
298
300 }
301
302 //Radial quickbar
303 if (GetUApi().GetInputByID(UAUIQuickbarRadialOpen).LocalPress())
304 {
305 //open quickbar menu
306 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
307 {
308 if ( !GetUIManager().IsMenuOpen( MENU_RADIAL_QUICKBAR ) )
309 {
310 RadialQuickbarMenu.OpenMenu();
311 m_Hud.ShowHudUI( false );
312 }
313 }
314 }
315
316 bool b1 = RadialQuickbarMenu.GetItemToAssign() != null;
317 //close quickbar menu from world
318 if (GetUIManager().IsMenuOpen( MENU_RADIAL_QUICKBAR ) && (!RadialQuickbarMenu.GetMenuInstance().GetParentMenu() || RadialQuickbarMenu.GetMenuInstance().GetParentMenu() != inventory) && (GetUApi().GetInputByID(UAUIQuickbarRadialOpen).LocalRelease() || !GetUApi().GetInputByID(UAUIQuickbarRadialOpen).LocalValue()))
319 {
320 RadialQuickbarMenu.CloseMenu();
321 m_Hud.ShowHudUI( true );
322 }
323
324 //Radial Quickbar from inventory
325 if ((RadialQuickbarMenu.instance && RadialQuickbarMenu.GetMenuInstance().GetParentMenu() && RadialQuickbarMenu.GetMenuInstance().GetParentMenu() == inventory) && GetUApi().GetInputByID(UAUIQuickbarRadialInventoryOpen).LocalRelease())
326 {
327 //close radial quickbar menu
328 if (GetGame().GetUIManager().IsMenuOpen(MENU_RADIAL_QUICKBAR))
329 {
330 RadialQuickbarMenu.CloseMenu();
331 RadialQuickbarMenu.SetItemToAssign( NULL );
332 AddActiveInputExcludes({"inventory"});
333 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
334 }
335 }
336
337 if (playerPB)
338 {
339 //Special behaviour for leaning [CONSOLE ONLY]
340 if (playerPB.IsRaised() || playerPB.IsInRasedProne())
341 {
342 GetUApi().GetInputByID(UALeanLeftGamepad).Unlock();
343 GetUApi().GetInputByID(UALeanRightGamepad).Unlock();
344 }
345 else
346 {
347 GetUApi().GetInputByID(UALeanLeftGamepad).Lock();
348 GetUApi().GetInputByID(UALeanRightGamepad).Lock();
349 }
350
351 //Special behaviour for freelook & zeroing [CONSOLE ONLY]
352 if (playerPB.IsRaised())
353 {
354 GetUApi().GetInputByID(UALookAround).Lock(); //disable freelook
355 GetUApi().GetInputByID(UALookAroundToggle).Lock(); //disable freelook
356
357 GetUApi().GetInputByID(UAZeroingUp).Unlock(); //enable zeroing
358 GetUApi().GetInputByID(UAZeroingDown).Unlock();
359 }
360 else
361 {
362 GetUApi().GetInputByID(UALookAround).Unlock(); //enable freelook
363 GetUApi().GetInputByID(UALookAroundToggle).Unlock(); //enable freelook
364
365 GetUApi().GetInputByID(UAZeroingUp).Lock(); //disable zeroing
366 GetUApi().GetInputByID(UAZeroingDown).Lock();
367 }
368 }
369#endif
370 //Gestures
371 if ( GetUApi().GetInputByID(UAUIGesturesOpen).LocalPress() )
372 {
373 //open gestures menu
374 if ( !playerPB.IsRaised() && (playerPB.GetActionManager().ActionPossibilityCheck(playerPB.m_MovementState.m_CommandTypeId) || playerPB.IsEmotePlaying()) && !playerPB.GetCommand_Vehicle() )
375 {
376 if ( !GetUIManager().IsMenuOpen( MENU_GESTURES ) )
377 {
378 GesturesMenu.OpenMenu();
379 m_Hud.ShowHudUI( false );
380 }
381 }
382 }
383
384 if ( GetUApi().GetInputByID(UAUIGesturesOpen).LocalRelease() || GetUApi().GetInputByID(UAUIGesturesOpen).LocalValue() == 0 )
385 {
386 //close gestures menu
387 if ( GetUIManager().IsMenuOpen( MENU_GESTURES ) )
388 {
389 GesturesMenu.CloseMenu();
390 m_Hud.ShowHudUI( true );
391 }
392 }
393
394 if (player && m_LifeState == EPlayerStates.ALIVE && !player.IsUnconscious() )
395 {
396 // enables HUD on spawn
397 if (m_HudRootWidget)
398 {
399 m_HudRootWidget.Show(true);
400 }
401
402 #ifndef NO_GUI
403 // fade out black screen
404
405 if ( GetUIManager().ScreenFadeVisible() )
406 {
408 }
409
410 #endif
411
412 if (GetUApi().GetInputByID(UAGear).LocalPress())
413 {
414 if (!inventory && playerPB.CanManipulateInventory() && IsMapUnfoldActionRunning(runningAction))
415 {
417 menu = m_InventoryMenu;
418 }
419 else if (menu == inventory)
420 {
422 }
423 }
424
425 if (GetUApi().GetInputByID(UAUIMenu).LocalPress() && menu && inventory && menu == inventory)
426 {
428 }
429
430 #ifndef PLATFORM_CONSOLE
431 if (GetUApi().GetInputByID(UAChat).LocalPress() && input.IsEnabledMouseAndKeyboardEvenOnServer())
432 {
433 ChatInputMenu chat = ChatInputMenu.Cast( m_UIManager.FindMenu(MENU_CHAT) );
434 if ( menu == NULL )
435 {
436 ShowChat();
437 }
438 }
439 #endif
440
441 // voice level updated
443
444 if (GetUApi().GetInputByID(UAUIQuickbarToggle).LocalHold())
445 {
446 if (!m_QuickbarHold)
447 {
448 m_QuickbarHold = true;
450 }
451 }
452
453 if (GetUApi().GetInputByID(UAUIQuickbarToggle).LocalRelease())
454 {
455 if (!m_QuickbarHold)
456 {
458 }
459 m_QuickbarHold = false;
460 }
461
462 if (GetUApi().GetInputByID(UAZeroingUp).LocalPress() || GetUApi().GetInputByID(UAZeroingDown).LocalPress() || GetUApi().GetInputByID(UAToggleWeapons).LocalPress())
463 {
465 }
466
467 if (menu == NULL)
468 {
469 m_ActionMenu.Refresh();
470
471 if (GetUApi().GetInputByID(UANextActionCategory).LocalPress())
472 {
473 m_ActionMenu.NextActionCategory();
474 }
475 else if (GetUApi().GetInputByID(UAPrevActionCategory).LocalPress())
476 {
477 m_ActionMenu.PrevActionCategory();
478 }
479 else if (GetUApi().GetInputByID(UANextAction).LocalPress())
480 {
481 m_ActionMenu.NextAction();
482 }
483 else if (GetUApi().GetInputByID(UAPrevAction).LocalPress())
484 {
485 m_ActionMenu.PrevAction();
486 }
487 }
488 else
489 {
490 m_ActionMenu.Hide();
491 }
492
493 //hologram rotation
494 if (menu == NULL && playerPB.IsPlacingLocal() && playerPB.GetHologramLocal().GetParentEntity().PlacementCanBeRotated())
495 {
496 if (GetUApi().GetInputByID(UANextAction).LocalRelease())
497 {
498 playerPB.GetHologramLocal().SubtractProjectionRotation(15);
499 }
500
501 if (GetUApi().GetInputByID(UAPrevAction).LocalRelease())
502 {
503 playerPB.GetHologramLocal().AddProjectionRotation(15);
504 }
505 }
506
508 {
509 if (GetUApi().GetInputByID(UAMapToggle).LocalPress() && !m_UIManager.GetMenu())
510 {
511 if (IsMapUnfoldActionRunning(runningAction))
512 {
514 }
515 }
516 }
517 }
518
519 // life state check
520 if (player)
521 {
522 int life_state = player.GetPlayerState();
523
524 // life state changed
525 if (m_LifeState != life_state)
526 {
527 m_LifeState = life_state;
528
529 if (m_LifeState != EPlayerStates.ALIVE)
530 {
532 }
533 }
534 }
535
536 if (menu && !menu.UseKeyboard() && menu.UseMouse())
537 {
538 int i;
539 for (i = 0; i < 5; i++)
540 {
544 }
545
546 for (i = 0; i < 6; i++)
547 {
549 }
550 }
551
552 if (!m_UIManager.IsDialogVisible())
553 {
554 if (menu)
555 {
556 if (menu == inspect)
557 {
558 if (GetUApi().GetInputByID(UAGear).LocalPress())
559 {
561 {
563 }
564 }
565 else if (GetUApi().GetInputByID(UAUIBack).LocalPress())
566 {
568 {
570 }
571 }
572 }
573 else if (menu == note_menu && (!IsInputExcludeActive("inventory") || !IsInputRestrictionActive(EInputRestrictors.INVENTORY)))
574 {
575 AddActiveInputExcludes({"inventory"});
576 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
577 }
578 else if (menu == gestures_menu && !gestures_menu.IsMenuClosing() && !IsInputExcludeActive("radialmenu"))
579 {
580 AddActiveInputExcludes({"radialmenu"});
581 GetUApi().GetInputByID(UAUIGesturesOpen).Unlock();
582 }
583 else if (menu == quickbar_menu && !quickbar_menu.IsMenuClosing() && !IsInputExcludeActive("radialmenu"))
584 {
585 AddActiveInputExcludes({"radialmenu"});
586 GetUApi().GetInputByID(UAUIQuickbarRadialOpen).Unlock();
587 }
588 else if (IsPaused())
589 {
590 InGameMenuXbox menu_xb = InGameMenuXbox.Cast(GetGame().GetUIManager().GetMenu());
591 if (!g_Game.GetUIManager().ScreenFadeVisible() && (!menu_xb || !menu_xb.IsOnlineOpen()))
592 {
593 if (GetUApi().GetInputByID(UAUIMenu).LocalPress())
594 {
595 Continue();
596 }
597 else if (GetUApi().GetInputByID(UAUIBack).LocalPress())
598 {
599 Continue();
600 }
601 }
602 else if (GetUApi().GetInputByID(UAUIBack).LocalPress())
603 {
604 if (menu_xb && menu_xb.IsOnlineOpen())
605 {
606 menu_xb.CloseOnline();
607 }
608 }
609 }
610 }
611 else if (GetUApi().GetInputByID(UAUIMenu).LocalPress())
612 {
613 if (IsMapUnfoldActionRunning(runningAction))
614 {
615 Pause();
616 }
617 }
618 }
619
621
623
624 if (!GetGame().IsMultiplayer())
625 m_WorldData.UpdateBaseEnvTemperature( timeslice );
626
627#ifdef DIAG_DEVELOPER
629#endif
630 if (m_ProcessInputExcludes)
631 {
633 m_ProcessInputExcludes = false;
634 }
635
636 super.OnUpdate( timeslice );
637 }
638
639 override void OnKeyPress(int key)
640 {
641 super.OnKeyPress(key);
642 m_Hud.KeyPress(key);
643 }
644
645 override void OnKeyRelease(int key)
646 {
647 super.OnKeyRelease(key);
648 }
649
650 override void OnEvent(EventType eventTypeId, Param params)
651 {
652 super.OnEvent(eventTypeId, params);
653 InventoryMenu menu;
654 Man player = GetGame().GetPlayer();
655
656 switch (eventTypeId)
657 {
659 ChatMessageEventParams chat_params = ChatMessageEventParams.Cast( params );
660 if (m_LifeState == EPlayerStates.ALIVE)
661 {
662 m_Chat.Add(chat_params);
663 }
664 break;
665
667 ChatChannelEventParams cc_params = ChatChannelEventParams.Cast( params );
668 ChatInputMenu chatMenu = ChatInputMenu.Cast( GetUIManager().FindMenu(MENU_CHAT_INPUT) );
669 if (chatMenu)
670 {
671 chatMenu.UpdateChannel();
672 }
673 else
674 {
675 m_ChatChannelText.SetText(ChatInputMenu.GetChannelName(cc_params.param1));
676 m_ChatChannelFadeTimer.FadeIn(m_ChatChannelArea, 0.5, true);
677 m_ChatChannelHideTimer.Run(2, m_ChatChannelFadeTimer, "FadeOut", new Param3<Widget, float, bool>(m_ChatChannelArea, 0.5, true));
678 }
679 break;
680
681 case WindowsResizeEventTypeID:
684
685 break;
686
688 SetFreeCameraEventParams set_free_camera_event_params = SetFreeCameraEventParams.Cast( params );
689 PluginDeveloper plugin_developer = PluginDeveloper.Cast( GetPlugin(PluginDeveloper) );
690 plugin_developer.OnSetFreeCameraEvent( PlayerBase.Cast( player ), set_free_camera_event_params.param1 );
691 break;
692 }
693 }
694
695 override void OnItemUsed(InventoryItem item, Man owner)
696 {
697 if (item && GetUIManager().GetMenu() == NULL)
698 {
699 if (item.IsInherited(ItemBook))
700 {
701 BookMenu bookMenu = BookMenu.Cast( GetUIManager().EnterScriptedMenu(MENU_BOOK, NULL) );
702 if (bookMenu)
703 {
704 bookMenu.ReadBook(item);
705 }
706 }
707 }
708 }
709
710#ifdef DEVELOPER
711 override void SetInputSuppression(bool state)
712 {
713 m_SuppressNextFrame = state;
714 }
715
716 override bool GetInputSuppression()
717 {
718 return m_SuppressNextFrame;
719 }
720#endif
721
723 override void PlayerControlEnable( bool bForceSupress )
724 {
725 super.PlayerControlEnable(bForceSupress);
726
727 if (m_ControlDisabledMode != -1)
728 {
729 switch (m_ControlDisabledMode)
730 {
732 {
733 RemoveActiveInputExcludes({"menu"},bForceSupress);
734 break;
735 }
737 {
738 RemoveActiveInputExcludes({"inventory"},bForceSupress);
739 RemoveActiveInputRestriction(EInputRestrictors.INVENTORY);
740 break;
741 }
743 {
744 RemoveActiveInputExcludes({"loopedactions"},bForceSupress);
745 RemoveActiveInputRestriction(EInputRestrictors.MAP);
746 break;
747 }
749 {
750 RemoveActiveInputExcludes({"radialmenu"},bForceSupress);
751 break;
752 }
754 {
755 RemoveActiveInputExcludes({"radialmenu"},bForceSupress);
756 break;
757 }
758 }
759
760 m_ControlDisabledMode = -1;
761
762 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
763 if (player)
764 {
765 HumanInputController hic = player.GetInputController();
766 hic.LimitsDisableSprint(false);
767 }
768 }
769 }
770
772 override void PlayerControlDisable(int mode)
773 {
774 super.PlayerControlDisable(mode);
775
776 switch (mode)
777 {
779 {
780 AddActiveInputExcludes({"menu"});
781 break;
782 }
784 {
785 AddActiveInputExcludes({"inventory"});
786 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
787 break;
788 }
790 {
791 AddActiveInputExcludes({"loopedactions"});
792 AddActiveInputRestriction(EInputRestrictors.MAP);
793 break;
794 }
796 {
797 AddActiveInputExcludes({"radialmenu"});
798 break;
799 }
801 {
802 AddActiveInputExcludes({"radialmenu"});
803 break;
804 }
805 default:
806 {
807 Debug.Log("Unknown controls disable mode");
808 return;
809 }
810 }
811
812 m_ControlDisabledMode = mode;
813
814 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
815 if ( player )
816 {
817 ItemBase item = player.GetItemInHands();
818 if (item && item.IsWeapon())
819 player.RequestResetADSSync();
820 }
821 }
822
824 override void RemoveActiveInputExcludes(array<string> excludes, bool bForceSupress = false)
825 {
826 super.RemoveActiveInputExcludes(excludes,bForceSupress);
827
828 if (excludes.Count() != 0)
829 {
830 bool changed = false;
831
832 if (m_ActiveInputExcludeGroups)
833 {
834 for (int i = 0; i < excludes.Count(); i++)
835 {
836 if (m_ActiveInputExcludeGroups.Find(excludes[i]) != -1)
837 {
838 m_ActiveInputExcludeGroups.RemoveItem(excludes[i]);
839 changed = true;
840 }
841 }
842
843 if (changed)
844 {
846 }
847 }
848
849 // supress control for next frame
850 GetUApi().SupressNextFrame(bForceSupress);
851 }
852 }
853
855 override void RemoveActiveInputRestriction(int restrictor)
856 {
857 //unique behaviour outside regular excludes
858 if (restrictor > -1)
859 {
860 switch (restrictor)
861 {
862 case EInputRestrictors.INVENTORY:
863 {
864 GetUApi().GetInputByID(UAWalkRunForced).ForceEnable(false); // force walk off!
865 break;
866 }
867 case EInputRestrictors.MAP:
868 {
869 GetUApi().GetInputByID(UAWalkRunForced).ForceEnable(false); // force walk off!
870 break;
871 }
872 }
873
874 if (m_ActiveInputRestrictions && m_ActiveInputRestrictions.Find(restrictor) != -1)
875 {
876 m_ActiveInputRestrictions.RemoveItem(restrictor);
877 }
878 }
879 }
880
882 override void AddActiveInputExcludes(array<string> excludes)
883 {
884 super.AddActiveInputExcludes(excludes);
885
886 if (excludes.Count() != 0)
887 {
888 bool changed = false;
889 if (!m_ActiveInputExcludeGroups)
890 {
891 m_ActiveInputExcludeGroups = new array<string>;
892 }
893
894 for (int i = 0; i < excludes.Count(); i++)
895 {
896 if (m_ActiveInputExcludeGroups.Find(excludes[i]) == -1)
897 {
898 m_ActiveInputExcludeGroups.Insert(excludes[i]);
899 changed = true;
900 }
901 }
902
903 if (changed)
904 {
906 #ifdef BULDOZER
908 #endif
909 }
910 }
911 }
912
914 override void AddActiveInputRestriction(int restrictor)
915 {
916 //unique behaviour outside regular excludes
917 if (restrictor > -1)
918 {
919 switch (restrictor)
920 {
921 case EInputRestrictors.INVENTORY:
922 {
923 GetUApi().GetInputByID(UAWalkRunForced).ForceEnable(true); // force walk on!
924 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
925 if ( player )
926 {
927 ItemBase item = player.GetItemInHands();
928 if (item && item.IsWeapon())
929 player.RequestResetADSSync();
930 }
931 break;
932 }
933 case EInputRestrictors.MAP:
934 {
935 GetUApi().GetInputByID(UAWalkRunForced).ForceEnable(true); // force walk on!
936 break;
937 }
938 }
939
940 if (!m_ActiveInputRestrictions)
941 {
942 m_ActiveInputRestrictions = new array<int>;
943 }
944 if (m_ActiveInputRestrictions.Find(restrictor) == -1)
945 {
946 m_ActiveInputRestrictions.Insert(restrictor);
947 }
948 }
949 }
950
952 override void RefreshExcludes()
953 {
954 m_ProcessInputExcludes = true;
955 }
956
958 protected void PerformRefreshExcludes()
959 {
960 if (m_ActiveInputExcludeGroups)
961 {
962 for (int i = 0; i < m_ActiveInputExcludeGroups.Count(); i++)
963 {
964 GetUApi().ActivateExclude(m_ActiveInputExcludeGroups[i]);
965 }
966 }
967
969 }
970
972 override void EnableAllInputs(bool bForceSupress = false)
973 {
974 m_ControlDisabledMode = -1;
975
976 if (m_ActiveInputRestrictions)
977 {
978 int count = m_ActiveInputRestrictions.Count();
979 for (int i = 0; i < count; i++)
980 {
981 RemoveActiveInputRestriction(m_ActiveInputRestrictions[0]);
982 }
983 m_ActiveInputRestrictions.Clear(); //redundant?
984 }
985 if (m_ActiveInputExcludeGroups)
986 {
987 m_ActiveInputExcludeGroups.Clear();
988 }
989
991 // supress control for next frame
992 GetUApi().SupressNextFrame(bForceSupress);
993 }
994
996 override bool IsControlDisabled()
997 {
998 bool active = false;
999 if (m_ActiveInputExcludeGroups)
1000 {
1001 active |= m_ActiveInputExcludeGroups.Count() > 0;
1002 }
1003 if (m_ActiveInputRestrictions)
1004 {
1005 active |= m_ActiveInputRestrictions.Count() > 0;
1006 }
1007 active |= m_ControlDisabledMode >= INPUT_EXCLUDE_ALL; //legacy stuff, Justin case
1008 return active;
1009 }
1010
1012 override bool IsInputExcludeActive(string exclude)
1013 {
1014 return m_ActiveInputExcludeGroups && m_ActiveInputExcludeGroups.Find(exclude) != -1;
1015 }
1016
1018 override bool IsInputRestrictionActive(int restriction)
1019 {
1020 return m_ActiveInputRestrictions && m_ActiveInputRestrictions.Find(restriction) != -1;
1021 }
1022
1025 {
1026 return m_ControlDisabledMode;
1027 }
1028
1030 {
1032 }
1033
1034
1036 {
1037 if( GetUIManager() )
1038 {
1041 }
1042
1044
1045 if( m_Chat )
1046 m_Chat.Clear();
1047 }
1048
1049 void MoveHudForInventory( bool inv_open )
1050 {
1051 #ifdef PLATFORM_CONSOLE
1052 IngameHud hud = IngameHud.Cast( GetHud() );
1053 if( hud )
1054 {
1055 if( inv_open )
1056 {
1057 hud.GetHudPanelWidget().SetPos( 0, -0.055 );
1058 }
1059 else
1060 {
1061 hud.GetHudPanelWidget().SetPos( 0, 0 );
1062 }
1063 }
1064 #endif
1065 }
1066
1067 override void ShowInventory()
1068 {
1070
1071 if ( !menu && GetGame().GetPlayer().GetHumanInventory().CanOpenInventory() && !GetGame().GetPlayer().IsInventorySoftLocked() )
1072 {
1073 if( !m_InventoryMenu )
1074 {
1075 InitInventory();
1076 }
1077
1078 if( !GetUIManager().FindMenu( MENU_INVENTORY ) )
1079 {
1080 GetUIManager().ShowScriptedMenu(m_InventoryMenu, null);
1081 PlayerBase.Cast(GetGame().GetPlayer()).OnInventoryMenuOpen();
1082 }
1083 AddActiveInputExcludes({"inventory"});
1084 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
1085 }
1086 }
1087
1088 override void HideInventory()
1089 {
1090 if ( m_InventoryMenu )
1091 {
1092 GetUIManager().HideScriptedMenu(m_InventoryMenu);
1093 RemoveActiveInputExcludes({"inventory"},false);
1094 RemoveActiveInputRestriction(EInputRestrictors.INVENTORY);
1095 PlayerBase.Cast(GetGame().GetPlayer()).OnInventoryMenuClose();
1097 }
1098 }
1099
1101 {
1102 if ( m_InventoryMenu )
1103 {
1104 if (!m_InventoryMenu.GetParentMenu() && GetUIManager().GetMenu() != m_InventoryMenu)
1105 {
1106 m_InventoryMenu.SetParentMenu(GetUIManager().GetMenu()); //hack; guarantees the 'm_pCurrentMenu' will be set to whatever is on top currently
1107 }
1108 m_InventoryMenu.Close();
1109 m_InventoryMenu = NULL;
1110 }
1111 }
1112
1113 override void ResetGUI()
1114 {
1116 InitInventory();
1117 }
1118
1119 override void ShowChat()
1120 {
1121 m_ChatChannelHideTimer.Stop();
1122 m_ChatChannelFadeTimer.Stop();
1123 m_ChatChannelArea.Show(false);
1124 m_UIManager.EnterScriptedMenu(MENU_CHAT_INPUT, NULL);
1125
1126 int level = GetGame().GetVoiceLevel();
1128
1129 AddActiveInputExcludes({"menu"});
1130 }
1131
1132 override void HideChat()
1133 {
1134 RemoveActiveInputExcludes({"menu"},true);
1135 }
1136
1138 {
1139 if ( GetHud() )
1141 }
1142
1144 {
1145 if ( GetHud() )
1147 }
1148
1149 override Hud GetHud()
1150 {
1151 return m_Hud;
1152 }
1153
1155 {
1156 return m_HudDebug;
1157 }
1158
1160 {
1161 if (GetHudDebug())
1162 GetHudDebug().RefreshCrosshairVisibility();
1163 }
1164
1166 {
1167 if (GetHudDebug())
1168 GetHudDebug().HideCrosshairVisibility();
1169 }
1170
1171 override bool IsPaused()
1172 {
1174 }
1175
1176 override void Pause()
1177 {
1178 if (IsPaused() || (GetGame().GetUIManager().GetMenu() && GetGame().GetUIManager().GetMenu().GetID() == MENU_INGAME))
1179 {
1180 return;
1181 }
1182
1183 if ( g_Game.IsClient() && g_Game.GetGameState() != DayZGameState.IN_GAME )
1184 {
1185 return;
1186 }
1187
1188 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
1189 if ( player && !player.IsPlayerLoaded() || IsPlayerRespawning() )
1190 {
1191 return;
1192 }
1193
1194 m_PauseQueued = true;
1195
1196 CloseAllMenus();
1197
1198 // open ingame menu
1200 AddActiveInputExcludes({"menu"});
1201 AddActiveInputRestriction(EInputRestrictors.INVENTORY);
1202 }
1203
1204 override void Continue()
1205 {
1207 if (!menu)
1208 return;
1209
1210 int menu_id = menu.GetID();
1211 if ( !IsPaused() || ( menu_id != MENU_INGAME && menu_id != MENU_LOGOUT && menu_id != MENU_RESPAWN_DIALOGUE ) || ( m_Logout && m_Logout.layoutRoot.IsVisible() ) )
1212 {
1213 return;
1214 }
1215
1216 m_PauseQueued = false;
1217 RemoveActiveInputExcludes({"menu"},true);
1218 RemoveActiveInputRestriction(EInputRestrictors.INVENTORY);
1220 }
1221
1222 override bool IsMissionGameplay()
1223 {
1224 return true;
1225 }
1226
1227 override void AbortMission()
1228 {
1229 #ifdef BULDOZER
1231 #else
1233 #endif
1234 }
1235
1236 override void CreateLogoutMenu(UIMenuPanel parent)
1237 {
1238 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
1239
1240 // do not show logout screen if player's dead
1241 if (!player || player.IsDamageDestroyed())
1242 {
1243 // exit the game immediately
1244 AbortMission();
1245 return;
1246 }
1247
1248 if (parent)
1249 {
1250 m_Logout = LogoutMenu.Cast(parent.EnterScriptedMenu(MENU_LOGOUT));
1251
1252 if (m_Logout)
1253 {
1254 m_Logout.SetLogoutTime();
1255 }
1256 }
1257 }
1258
1259 override void StartLogoutMenu(int time)
1260 {
1261 if (m_Logout)
1262 {
1263 if (time > 0)
1264 {
1265 // character will be deleted from server int "time" seconds
1266 m_Logout.SetTime(time);
1267 m_Logout.Show();
1268
1269 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(m_Logout.UpdateTime, 1000, true);
1270 }
1271 else
1272 {
1273 // no waiting time -> player is most likely dead
1274 m_Logout.Exit();
1275 }
1276 }
1277 }
1278
1279 override void CreateDebugMonitor()
1280 {
1281 if (!m_DebugMonitor)
1282 {
1283 m_DebugMonitor = new DebugMonitor();
1284 m_DebugMonitor.Init();
1285 }
1286 }
1287
1288 protected void HandleMapToggleByKeyboardShortcut(Man player)
1289 {
1291 if (um && !um.IsMenuOpen(MENU_MAP))
1292 {
1293 um.CloseAll();
1295 {
1296 um.EnterScriptedMenu(MENU_MAP, null);
1298 }
1299 else
1300 {
1301 GetGame().GetMission().AddActiveInputExcludes({"loopedactions"});
1302 }
1303
1304 GetGame().GetMission().AddActiveInputRestriction(EInputRestrictors.MAP);
1305 }
1306 }
1307
1308 protected bool IsMapUnfoldActionRunning(ActionBase pAction)
1309 {
1310 return !pAction || pAction.Type() != ActionUnfoldMap;
1311 }
1312
1313 /*void ChangeBleedingIndicatorVisibility(bool visible)
1314 {
1315 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
1316 if (player)
1317 {
1318 BleedingSourcesManagerRemote manager = player.GetBleedingManagerRemote();
1319 if (manager && manager.GetBleedingSourcesCount() > 0)
1320 {
1321 manager.ChangeBleedingIndicatorVisibility(visible);
1322 }
1323 }
1324 }*/
1325
1327 {
1328 if (!m_DebugMonitor) return;
1329
1330 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
1331 if (player)
1332 {
1333 DebugMonitorValues values = player.GetDebugMonitorValues();
1334 if (values)
1335 {
1336 m_DebugMonitor.SetHealth(values.GetHealth());
1337 m_DebugMonitor.SetBlood(values.GetBlood());
1338 m_DebugMonitor.SetLastDamage(values.GetLastDamage());
1339 m_DebugMonitor.SetPosition(MiscGameplayFunctions.TruncateVec(player.GetPosition(),1));
1340 }
1341 }
1342 }
1343
1344 void SetActionDownTime( int time_down )
1345 {
1346 m_ActionDownTime = time_down;
1347 }
1348
1349 void SetActionUpTime( int time_up )
1350 {
1351 m_ActionUpTime = time_up;
1352 }
1353
1355 {
1356 return m_ActionDownTime;
1357 }
1358
1360 {
1361 return m_ActionUpTime;
1362 }
1363
1365 {
1366 float hold_action_time = LocalReleaseTime() - LocalPressTime();
1367 return hold_action_time;
1368 }
1369
1371 {
1372#ifndef SERVER
1373 ShowHairDebugValues(DiagMenu.GetBool(DiagMenuIDs.MISC_HAIR_DISPLAY_DEBUG));
1374#endif
1375 }
1376
1377 void ShowHairDebugValues(bool state)
1378 {
1379#ifdef DIAG_DEVELOPER
1380 if ( state )
1381 {
1383
1384 int i = DiagMenu.GetValue(DiagMenuIDs.MISC_HAIR_LEVEL);
1385 bool bState = diagmenu.m_HairHidingStateMap.Get(i);
1386 string selectionState;
1387 if (!bState)
1388 selectionState = "Hidden";
1389 else
1390 selectionState = "Shown";
1391 string selectionName = diagmenu.m_HairSelectionArray.Get(i);
1392
1394 DbgUI.Begin("Hair Debug", 50, 150);
1395 DbgUI.Text("Current Hair Selection:" + selectionName);
1396 DbgUI.Text("State: " + selectionState);
1397
1398 DbgUI.End();
1400 }
1401 else
1402 {
1404 DbgUI.Begin("Hair Debug", 50, 50);
1405 DbgUI.End();
1407 }
1408#endif
1409 }
1410
1411 override void UpdateVoiceLevelWidgets(int level)
1412 {
1413 for ( int n = 0; n < m_VoiceLevelsWidgets.Count(); n++ )
1414 {
1415 int voiceKey = m_VoiceLevelsWidgets.GetKey(n);
1416 ImageWidget voiceWidget = m_VoiceLevelsWidgets.Get(n);
1417
1418 // stop fade timer since it will be refreshed
1419 WidgetFadeTimer timer = m_VoiceLevelTimers.Get(n);
1420 timer.Stop();
1421
1422 // show widgets according to the level
1423 if ( voiceKey <= level )
1424 {
1425 voiceWidget.SetAlpha(1.0); // reset from possible previous fade out
1426 voiceWidget.Show(true);
1427
1428 if ( !m_VoNActive && !GetUIManager().FindMenu(MENU_CHAT_INPUT) )
1429 timer.FadeOut(voiceWidget, 3.0);
1430 }
1431 else
1432 voiceWidget.Show(false);
1433 }
1434
1435 // fade out microphone icon when switching levels without von on
1436 if ( !m_VoNActive )
1437 {
1438 if ( !GetUIManager().FindMenu(MENU_CHAT_INPUT) )
1439 {
1440 m_MicrophoneIcon.SetAlpha(1.0);
1441 m_MicrophoneIcon.Show(true);
1442
1443 m_MicFadeTimer.FadeOut(m_MicrophoneIcon, 3.0);
1444 }
1445 }
1446 else
1447 {
1448 // stop mic icon fade timer when von is activated
1449 m_MicFadeTimer.Stop();
1450 }
1451 }
1452
1453 override ImageWidget GetMicrophoneIcon()
1454 {
1455 return m_MicrophoneIcon;
1456 }
1457
1458 override WidgetFadeTimer GetMicWidgetFadeTimer()
1459 {
1460 return m_MicFadeTimer;
1461 }
1462
1464 {
1465 return m_VoiceLevelsWidgets;
1466 }
1467
1469 {
1470 return m_VoiceLevelTimers;
1471 }
1472
1473 override bool IsVoNActive()
1474 {
1475 return m_VoNActive;
1476 }
1477
1478 override void SetVoNActive(bool active)
1479 {
1480 m_VoNActive = active;
1481 }
1482
1484 {
1485 for ( int n = 0; n < m_VoiceLevelsWidgets.Count(); n++ )
1486 {
1487 ImageWidget voiceWidget = m_VoiceLevelsWidgets.Get( n );
1488 voiceWidget.Show(false);
1489 }
1490 }
1491
1493 {
1494 return m_Note;
1495 };
1496
1497 override void SetNoteMenu(UIScriptedMenu menu)
1498 {
1499 m_Note = NoteMenu.Cast(menu);
1500 };
1501
1502 override void OnPlayerRespawned(Man player)
1503 {
1504 #ifdef DIAG_DEVELOPER
1505 if (m_HudDebug)
1506 m_HudDebug.RefreshByLocalProfile();
1507 #endif
1508
1509 PlayerBase playerBase = PlayerBase.Cast(player);
1510 if (playerBase)
1511 {
1512 GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(playerBase.ShowDeadScreen, false, 0);
1513 }
1514
1515 GetGame().GetSoundScene().SetSoundVolume(g_Game.m_volume_sound,1);
1516 GetGame().GetSoundScene().SetSpeechExVolume(g_Game.m_volume_speechEX,1);
1517 GetGame().GetSoundScene().SetMusicVolume(g_Game.m_volume_music,1);
1518 GetGame().GetSoundScene().SetVOIPVolume(g_Game.m_volume_VOIP,1);
1519 GetGame().GetSoundScene().SetRadioVolume(g_Game.m_volume_radio,1);
1520 }
1521
1522 override void SetPlayerRespawning(bool state)
1523 {
1524 m_PlayerRespawning = state;
1525 }
1526
1527 override bool IsPlayerRespawning()
1528 {
1529 return m_PlayerRespawning;
1530 }
1531
1533 {
1534 return m_ActiveRefresherLocations;
1535 }
1536
1537 override void SetRespawnModeClient(int mode)
1538 {
1539 m_RespawnModeClient = mode;
1540 }
1541
1543 {
1544 return m_RespawnModeClient;
1545 }
1546
1547 override GameplayEffectWidgets GetEffectWidgets()
1548 {
1549 return m_EffectWidgets;
1550 }
1551
1553 {
1554 if (!m_OnConnectivityChanged)
1555 {
1556 m_OnConnectivityChanged = new ScriptInvoker();
1557 }
1559 }
1560}
void ActionBase()
Definition ActionBase.c:73
ActionUnfoldMapCB ActionBaseCB ActionUnfoldMap()
DayZGame g_Game
Definition DayZGame.c:3654
Hud m_Hud
DiagMenuIDs
Definition EDiagMenuIDs.c:2
EPlayerStates
ERPCs
Definition ERPCs.c:2
int GetID()
Get the ID registered in SEffectManager.
Definition Effect.c:525
void HudDebug()
Definition HudDebug.c:104
void InventoryMenu()
PlayerBase GetPlayer()
PPERequesterCategory
PluginBase GetPlugin(typename plugin_type)
proto native UAInputAPI GetUApi()
protected bool m_Initialized
proto native Mission GetMission()
proto native Input GetInput()
proto native AbstractSoundScene GetSoundScene()
proto native DayZPlayer GetPlayer()
override ScriptCallQueue GetCallQueue(int call_category)
Definition DayZGame.c:1153
proto native UIManager GetUIManager()
proto native WorkspaceWidget GetWorkspace()
proto native int GetVoiceLevel(Object player=null)
Get voice level of VoN (on both client and server) (VoiceLevelWhisper = 0, VoiceLevelNormal = 1,...
static bool GetMapIgnoreMapOwnership()
Definition Chat.c:15
Definition DbgUI.c:60
Definition Debug.c:14
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.
Definition Debug.c:133
void ZeroingKeyPress()
Definition IngameHud.c:758
bool KeyPress(int key)
Definition IngameHud.c:753
void ShowHudUI(bool show)
void HideVehicleInfo()
void ShowQuickbarPlayer(bool show)
void ShowVehicleInfo()
void ShowHudPlayer(bool show)
bool IsHideHudPlayer()
Definition IngameHud.c:1103
void Init(Widget hud_panel_widget)
Definition gameplay.c:626
bool IsHideQuickbarPlayer()
Definition IngameHud.c:1098
void OnResizeScreen()
proto native void LimitsDisableSprint(bool pDisable)
this disables sprint
Definition input.c:11
proto native void DisableKey(int key)
Disable key until end of frame.
proto native bool IsEnabledMouseAndKeyboardEvenOnServer()
EntityAI GetSelectedItem()
Definition ItemManager.c:82
static ItemManager GetInstance()
static bool IsLogsEnable()
Definition Debug.c:580
static void Init()
void DestroyInventory()
float GetHoldActionTime()
override void OnInit()
override void OnPlayerRespawned(Man player)
protected bool m_ControlDisabled
override void PlayerControlEnable(bool bForceSupress)
Deprecated; removes last input exclude and associated controls restrictions.
ref HudDebug m_HudDebug
protected bool IsMapUnfoldActionRunning(ActionBase pAction)
override int GetControlDisabledMode()
(mostly)DEPRECATED; only set on the old 'PlayerControlDisable' method
override bool IsPaused()
TextWidget m_ChatChannelText
override void UpdateInputDevicesAvailability()
protected int m_ActionUpTime
ref IngameHud m_Hud
ref DebugMonitor m_DebugMonitor
ref WidgetFadeTimer m_MicFadeTimer
UIManager GetUIManager()
override void HideInventory()
void SendMuteListToServer(map< string, bool > mute_list)
protected int m_ControlDisabledMode
protected bool m_PlayerRespawning
override void OnMissionStart()
override void OnKeyRelease(int key)
override void SetNoteMenu(UIScriptedMenu menu)
override bool IsInputRestrictionActive(int restriction)
Returns true if the particular 'restriction' (those govern special behaviour outside regular input ex...
override void EnableAllInputs(bool bForceSupress=false)
Removes all active input excludes and restrictions.
override void OnKeyPress(int key)
void MoveHudForInventory(bool inv_open)
Widget m_ChatChannelArea
override void AddActiveInputExcludes(array< string > excludes)
Adds one or more exclude groups to disable and refreshes excludes.
protected ref array< int > m_ActiveInputRestrictions
override bool IsPlayerRespawning()
override array< vector > GetActiveRefresherLocations()
override void ResetGUI()
Widget m_HudRootWidget
ref ActionMenu m_ActionMenu
protected void PerformRefreshExcludes()
applies queued excludes (0 == clear excludes)
override int GetRespawnModeClient()
override void SetRespawnModeClient(int mode)
void SetActionUpTime(int time_up)
override void ShowInventory()
protected ref array< string > m_ActiveInputExcludeGroups
override WidgetFadeTimer GetMicWidgetFadeTimer()
override bool IsVoNActive()
override void Continue()
override void AddActiveInputRestriction(int restrictor)
Adds one input restriction (specific behaviour oudside regular excludes, defined below)
protected bool m_InitOnce
ref LogoutMenu m_Logout
protected bool m_ProcessInputExcludes
override void SetVoNActive(bool active)
override void HideChat()
void SetActionDownTime(int time_down)
override UIScriptedMenu GetNoteMenu()
void UpdateDebugMonitor()
override void OnEvent(EventType eventTypeId, Param params)
protected ref map< int, ImageWidget > m_VoiceLevelsWidgets
protected int m_ActionDownTime
override void RemoveActiveInputRestriction(int restrictor)
Removes one restriction (specific behaviour oudside regular excludes, defined below)
override void OnUpdate(float timeslice)
override void CreateLogoutMenu(UIMenuPanel parent)
void DisplayHairDebug()
override void ShowChat()
protected ref Timer m_ToggleHudTimer
override void OnMissionFinish()
override Hud GetHud()
override void UpdateVoiceLevelWidgets(int level)
override bool IsControlDisabled()
returns if ANY exclude groups, restriction (or deprecated disable, if applicable) is active
void ~MissionGameplay()
override ImageWidget GetMicrophoneIcon()
HudDebug GetHudDebug()
protected UIManager m_UIManager
override void Pause()
override void SetPlayerRespawning(bool state)
override void RefreshExcludes()
queues refresh of input excludes
protected ref ScriptInvoker m_OnConnectivityChanged
override map< int, ImageWidget > GetVoiceLevelWidgets()
void TickScheduler(float timeslice)
override bool IsInputExcludeActive(string exclude)
Returns true if the particular input exclude group had been activated via script and is active.
ref Timer m_ChatChannelHideTimer
override void RefreshCrosshairVisibility()
protected int m_RespawnModeClient
override void RemoveActiveInputExcludes(array< string > excludes, bool bForceSupress=false)
Removes one or more exclude groups and refreshes excludes.
protected bool m_QuickbarHold
ref Chat m_Chat
protected ref map< int, ref WidgetFadeTimer > m_VoiceLevelTimers
protected Widget m_VoiceLevels
NoteMenu m_Note
void MissionGameplay()
InventoryMenu GetInventory()
protected ref GameplayEffectWidgets m_EffectWidgets
override bool IsMissionGameplay()
override void HideCrosshairVisibility()
override void PlayerControlDisable(int mode)
Deprecated; simple input restrictions.
void ShowHairDebugValues(bool state)
ref InventoryMenu m_InventoryMenu
override map< int, ref WidgetFadeTimer > GetVoiceLevelTimers()
override GameplayEffectWidgets GetEffectWidgets()
override void StartLogoutMenu(int time)
ref WidgetFadeTimer m_ChatChannelFadeTimer
override void AbortMission()
ScriptInvoker GetConnectivityInvoker()
override void HideVoiceLevelWidgets()
ImageWidget m_MicrophoneIcon
override void CreateDebugMonitor()
protected void HandleMapToggleByKeyboardShortcut(Man player)
override void OnItemUsed(InventoryItem item, Man owner)
protected bool m_PauseQueued
protected bool m_VoNActive
void AddActiveInputRestriction(int restrictor)
void AddActiveInputExcludes(array< string > excludes)
Static component of PPE manager, used to hold the instance.
Definition PPEManager.c:3
static PPEManager GetPPEManager()
Returns the manager instance singleton.
Definition PPEManager.c:27
Deprecated; 'PPEManager' used instead.
Definition PPEffects.c:3
static void Init()
Definition PPEffects.c:52
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
Manager class for managing Effect (EffectParticle, EffectSound)
static ref ScriptInvoker Event_OnFrameUpdate
Static invoker for the SEffectManager.Event_OnFrameUpdate called form MissionGameplay....
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 ...
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 ...
ScriptInvoker Class provide list of callbacks usage:
Definition 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...
proto bool Write(void value_out)
static void RegisterEvents()
Definition SyncEvents.c:3
proto native void SupressNextFrame(bool bForce)
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 UpdateControls()
proto native void ActivateExclude(string sExcludeName)
proto native void Lock()
proto native void Unlock()
proto native void ForceEnable(bool bEnable)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
Definition UIManager.c:161
bool CloseMenu(int id)
Close menu with specific ID (see MenuID)
Definition UIManager.c:119
proto native bool IsDialogVisible()
void ShowUICursor(bool visible)
Definition UIManager.c:246
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.
proto native void HideScriptedMenu(UIScriptedMenu menu)
bool CloseAll()
Close all opened menus.
Definition UIManager.c:80
proto native void HideDialog()
proto native UIScriptedMenu ShowScriptedMenu(UIScriptedMenu menu, UIMenuPanel parent)
bool IsMenuOpen(int id)
Returns true if menu with specific ID is opened (see MenuID)
Definition UIManager.c:155
proto native void ScreenFadeOut(float duration)
Part of main menu hierarchy to create custom menus from script.
proto native UIScriptedMenu EnterScriptedMenu(int id)
Create & open menu with specific id (see MenuID) and set this menu as its parent.
override bool UseKeyboard()
override bool UseMouse()
static void SpawnAllTriggerCarriers()
void HandleInput(Input inp)
Manager class which handles Voice-over-network functionality while player is connected to a server.
Definition VONManager.c:301
static VONManagerBase GetInstance()
Main way to access VONManager functionality from script.
Definition VONManager.c:308
static VicinityItemManager GetInstance()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
const EventType SetFreeCameraEventTypeID
params: SetFreeCameraEventParams
Definition gameplay.c:552
Param4< int, string, string, string > ChatMessageEventParams
channel, from, text, color config class
Definition gameplay.c:396
Param1< int > ChatChannelEventParams
Definition gameplay.c:397
const EventType ChatChannelEventTypeID
params: ChatChannelEventParams
Definition gameplay.c:488
proto native CGame GetGame()
Param1< FreeDebugCamera > SetFreeCameraEventParams
Camera.
Definition gameplay.c:444
const EventType ChatMessageEventTypeID
params: ChatMessageEventParams
Definition gameplay.c:486
static proto native void Begin(string windowTitle, float x=0, float y=0)
static proto void BeginCleanupScope()
static proto native void Text(string label)
static proto native void EndCleanupScope()
static proto native void End()
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
Definition constants.c:593
const int INPUT_EXCLUDE_ALL
Definition constants.c:590
const int INPUT_EXCLUDE_INVENTORY
Definition constants.c:591
const int INPUT_EXCLUDE_MAP
Definition constants.c:594
const int INPUT_EXCLUDE_MOUSE_ALL
Definition constants.c:592
const int INPUT_DEVICE_MOUSE
Definition constants.c:24
const int INPUT_ACTION_TYPE_DOUBLETAP
Definition constants.c:40
const int INPUT_DEVICE_MOUSE_AXIS
Definition constants.c:42
const int INPUT_ACTION_TYPE_DOWN_EVENT
Definition constants.c:33
const int MENU_LOGOUT
Definition constants.c:173
const int MENU_INSPECT
Definition constants.c:157
const int MENU_MAP
Definition constants.c:169
const int MENU_RESPAWN_DIALOGUE
Definition constants.c:187
const int MENU_GESTURES
Definition constants.c:172
const int MENU_CHAT
Definition constants.c:153
const int MENU_INVENTORY
Definition constants.c:158
const int MENU_NOTE
Definition constants.c:168
const int MENU_RADIAL_QUICKBAR
Definition constants.c:176
const int MENU_BOOK
Definition constants.c:170
const int MENU_INGAME
Definition constants.c:156
const int MENU_CHAT_INPUT
Definition constants.c:164
const int CALL_CATEGORY_GUI
Definition tools.c:9
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8
const int IDC_MAIN_QUIT
Definition constants.c:124
proto native external Widget CreateWidgets(string layout, Widget parentWidget=NULL, bool immedUpdate=true)
Create widgets from *.layout file.
TypeID EventType
Definition EnWidgets.c:54