Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CleanSweepAreaSelectionButtonComponent.c
Go to the documentation of this file.
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
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}
ArmaReforgerScripted GetGame()
Definition game.c:1398
void SCR_CleanSweepNetworkComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
void OnClick()
On click callback.
proto external Managed FindComponent(typename typeName)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.