12 protected SCR_PlayerControllerGroupComponent m_PlayerComponent;
16 protected bool m_bHasPrivilege;
19 override void OnMenuOpen()
23 m_PlayerComponent = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
24 if (!m_PlayerComponent)
27 if (m_PlayerComponent.GetSelectedGroupID() == -1)
34 m_CallbackGetPrivilege.m_OnResult.Insert(OnPrivilegeCallback);
35 GetGame().GetPlatformService().GetPrivilegeAsync(UserPrivilege.USER_GEN_CONTENT, m_CallbackGetPrivilege);
38 void OnPrivilegeCallback(UserPrivilege privilege, UserPrivilegeResult result)
45 m_PlayerGroup = m_GroupsManager.FindGroup(m_PlayerComponent.GetGroupID());
62 if (!m_GroupDescription)
65 if (result == UserPrivilegeResult.ALLOWED)
67 m_GroupName.SetEnabled(
true);
68 m_GroupName.SetValue(m_PlayerGroup.GetCustomName());
70 m_GroupDescription.SetEnabled(
true);
71 m_GroupDescription.SetValue(m_PlayerGroup.GetCustomDescription());
72 m_bHasPrivilege =
true;
76 m_GroupName.SetEnabled(
false);
77 m_GroupName.SetValue(WidgetManager.Translate(
"#AR-UserActionUnavailable"));
78 m_GroupDescription.SetEnabled(
false);
79 m_GroupDescription.SetValue(WidgetManager.Translate(
"#AR-UserActionUnavailable"));
80 m_bHasPrivilege =
false;
83 SetupGroupStatusCombo();
87 override void OnMenuUpdate(
float tDelta)
89 super.OnMenuUpdate(tDelta);
91 GetGame().GetInputManager().ActivateContext(
"InteractableDialogContext");
95 override protected void OnConfirm()
97 SCR_PlayerControllerGroupComponent groupController = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
105 GetGame().GetProfanityFilter().ReplaceProfanities(m_GroupDescription.GetValue(), outputDesc);
106 GetGame().GetProfanityFilter().ReplaceProfanities(m_GroupName.GetValue(), outputName);
108 int groupID = m_PlayerGroup.GetGroupID();
109 groupController.RequestSetCustomGroupDescription(groupID, outputDesc);
110 groupController.RequestSetCustomGroupName(groupID, outputName);
117 protected void SetupGroupStatusCombo()
119 m_GroupStatus.AddItem(
"#AR-Player_Groups_Public");
120 m_GroupStatus.AddItem(
"#AR-Player_Groups_Private");
122 m_GroupStatus.SetCurrentItem(m_PlayerGroup.IsPrivate());
123 m_GroupStatus.m_OnChanged.Insert(OnStatusChanged);
130 if (!m_PlayerComponent)
133 m_PlayerComponent.RequestPrivateGroupChange(m_PlayerComponent.GetPlayerID() ,
index);