3 protected ref array<RplId> m_aSpawnPointIds = {};
4 protected bool m_bFocused;
6 override bool OnFocus(Widget w,
int x,
int y)
8 super.OnFocus(w, x, y);
14 override bool OnFocusLost(Widget w,
int x,
int y)
16 super.OnFocusLost(w, x, y);
22 int AddItem(
string item, RplId
id)
24 if (!
id.
IsValid() || m_aSpawnPointIds.Find(
id) > -1)
26 int i = AddItem(item);
27 m_aSpawnPointIds.Insert(
id);
33 override void RemoveItem(
int item,
bool last =
false)
35 super.RemoveItem(item, last);
37 if (m_aSpawnPointIds.IsIndexValid(item))
38 m_aSpawnPointIds.Remove(item);
41 override void ClearAll()
44 m_aSpawnPointIds.Clear();
47 RplId GetSpawnPointId(
int itemId)
49 if (m_aSpawnPointIds.IsEmpty())
50 return RplId.Invalid();
51 return m_aSpawnPointIds.Get(itemId);
54 int GetItemId(RplId
id)
56 return m_aSpawnPointIds.Find(
id);
61 return m_aSpawnPointIds.IsEmpty();
64 void SetItemName(
int id,
string name)
66 if (m_aElementNames.IsIndexValid(
id))
68 m_aElementNames[id] = name;
69 SetInitialState(
false);
73 array<SCR_SpawnPoint> GetSpawnPointsInList()
75 array<SCR_SpawnPoint> result = {};
76 foreach (RplId
id : m_aSpawnPointIds)
88 return m_bFocused &&
GetGame().GetInputManager().IsUsingMouseAndKeyboard();