Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_SpawnPointSpinBox.c
Go to the documentation of this file.
2{
3 protected ref array<RplId> m_aSpawnPointIds = {};
4 protected bool m_bFocused;
5
6 override bool OnFocus(Widget w, int x, int y)
7 {
8 super.OnFocus(w, x, y);
9 m_bFocused = true;
10
11 return false;
12 }
13
14 override bool OnFocusLost(Widget w, int x, int y)
15 {
16 super.OnFocusLost(w, x, y);
17 m_bFocused = false;
18
19 return false;
20 }
21
22 int AddItem(string item, RplId id)
23 {
24 if (!id.IsValid() || m_aSpawnPointIds.Find(id) > -1)
25 return -1;
26 int i = AddItem(item);
27 m_aSpawnPointIds.Insert(id);
29
30 return i;
31 }
32
33 override void RemoveItem(int item, bool last = false)
34 {
35 if (m_aSpawnPointIds.IsIndexValid(item))
36 m_aSpawnPointIds.Remove(item);
37
38 super.RemoveItem(item, true);
39 }
40
41 override void ClearAll()
42 {
43 super.ClearAll();
44 m_aSpawnPointIds.Clear();
45 }
46
48 {
49 if (m_aSpawnPointIds.IsEmpty())
50 return RplId.Invalid();
51 return m_aSpawnPointIds.Get(itemId);
52 }
53
55 {
56 return m_aSpawnPointIds.Find(id);
57 }
58
59 bool IsEmpty()
60 {
61 return m_aSpawnPointIds.IsEmpty();
62 }
63
64 void SetItemName(int id, string name)
65 {
66 if (m_aElementNames.IsIndexValid(id))
67 {
68 m_aElementNames[id] = name;
69 SetInitialState(false);
70 }
71 }
72
73 array<SCR_SpawnPoint> GetSpawnPointsInList()
74 {
75 array<SCR_SpawnPoint> result = {};
76 foreach (RplId id : m_aSpawnPointIds)
77 {
79 if (sp)
80 result.Insert(sp);
81 }
82
83 return result;
84 }
85
86 bool IsFocused()
87 {
88 return m_bFocused && GetGame().GetInputManager().IsUsingMouseAndKeyboard();
89 }
90};
AddonBuildInfoTool id
ArmaReforgerScripted GetGame()
Definition game.c:1398
Replication item identifier.
Definition RplId.c:14
Spawn point entity defines positions on which players can possibly spawn.
static SCR_SpawnPoint GetSpawnPointByRplId(RplId id)
void SetItemName(int id, string name)
int AddItem(string item, RplId id)
RplId GetSpawnPointId(int itemId)
override bool OnFocus(Widget w, int x, int y)
ref array< RplId > m_aSpawnPointIds
array< SCR_SpawnPoint > GetSpawnPointsInList()
override bool OnFocusLost(Widget w, int x, int y)
override void RemoveItem(int item, bool last=false)
void SetInitialState(bool invokeOnChanged=true)