Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_CampaignUIMutePlayerComponent.c
Go to the documentation of this file.
1 class SCR_CampaignMutePlayerComponent : ScriptedWidgetComponent
2 {
3  protected int m_iPlayerID = -1;
4  protected bool m_bMuted = false;
5 
6  //------------------------------------------------------------------------------------------------
8  int GetPlayerID()
9  {
10  return m_iPlayerID;
11  }
12 
13  //------------------------------------------------------------------------------------------------
15  void SetPlayerID(int playerID)
16  {
17  m_iPlayerID = playerID;
18  }
19 
20  //------------------------------------------------------------------------------------------------
21  override bool OnClick(Widget w, int x, int y, int button)
22  {
23  PlayerController pController = GetGame().GetPlayerController();
24 
25  if (!pController)
26  return false;
27 
28  if (pController.GetPlayerBlockedState(m_iPlayerID) != PermissionState.ALLOWED)
29  {
30  pController.SetPlayerBlockedState(m_iPlayerID, false);
31  TextWidget.Cast(w.GetParent().FindAnyWidget("Text")).SetTextFormat("#AR-ButtonMutePlayer");
32  }
33  else
34  {
35  pController.SetPlayerBlockedState(m_iPlayerID, true);
36  TextWidget.Cast(w.GetParent().FindAnyWidget("Text")).SetTextFormat("#AR-ButtonUnmutePlayer");
37  }
38 
39  return false;
40  }
41 }
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
PermissionState
PermissionState
Definition: PermissionState.c:12
SCR_CampaignMutePlayerComponent
Definition: SCR_CampaignUIMutePlayerComponent.c:1
m_iPlayerID
SCR_EditorManagerCore m_iPlayerID