Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_CleanSweepAreaSelectionButtonComponent.c
Go to the documentation of this file.
1 class SCR_CleanSweepAreaSelectionButtonComponent : ScriptedWidgetComponent
2 {
3  //------------------------------------------------------------------------------------------------
5  override bool OnClick(Widget w, int x, int y, int button)
6  {
7  Widget parent = w.GetParent();
8  if (!parent)
9  return false;
10 
11  CheckBoxWidget swapSidesBox = CheckBoxWidget.Cast(parent.FindAnyWidget("SwapSidesBox"));
12  XComboBoxWidget selectionBox = XComboBoxWidget.Cast(parent.FindAnyWidget("SelectionBox"));
13  if (!selectionBox)
14  return false;
15 
16  // Find local player controller
17  GenericEntity playerController = GetGame().GetPlayerController();
18  if (!playerController)
19  return false;
20 
21  SCR_CleanSweepNetworkComponent networkComponent = SCR_CleanSweepNetworkComponent.Cast(playerController.FindComponent(SCR_CleanSweepNetworkComponent));
22  if (!networkComponent)
23  {
24  Print("No clean sweep network component found. SCR_CleanSweepAreaSelectionButtonComponent.OnClick()");
25  return false;
26  }
27 
28  networkComponent.ChooseArea(selectionBox.GetCurrentItem(), swapSidesBox.IsChecked());
29 
30  return false;
31  }
32 }
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
GenericEntity
SCR_GenericBoxEntityClass GenericEntity
SCR_CleanSweepNetworkComponent
void SCR_CleanSweepNetworkComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_CleanSweepNetworkComponent.c:97
SCR_CleanSweepAreaSelectionButtonComponent
Definition: SCR_CleanSweepAreaSelectionButtonComponent.c:1