14 GetGame().GetBackendApi().GetClientLobby().Rooms(m_Rooms);
15 Print(
"OnSearchServers Success");
19 override void OnError(
int code,
int restCode,
int apiCode )
21 Print(
"OnSearchServers Error");
26 Print(
"OnSearchServers Timeout");
35 Print(
"OnJoinRoomSB Success");
37 override void OnError(
int code,
int restCode,
int apiCode )
39 Print(
"OnJoinRoomSB Error");
43 Print(
"OnJoinRoomSB Timeout");
54 protected ref array<SCR_ServerBrowserEntryComponent> m_aRoomEntries =
new array<SCR_ServerBrowserEntryComponent>;
57 protected ref array<Room> m_aRooms =
new array<Room>;
64 override void HandlerAttached(Widget w)
66 super.HandlerAttached(w);
71 override protected void SetupEntryBehavior(Widget entry)
73 super.SetupEntryBehavior(entry);
84 entryComp.GetOnFocus().Insert(OnRoomEntryFocus);
85 entryComp.m_OnClick.Insert(OnRoomEntryClick);
88 m_aRoomEntries.Insert(entryComp);
94 override protected void FillEntry(Widget w)
97 int id = m_aEntryWidgets.Find(w);
106 int iPos = m_iLastScrollPosition;
108 int roomId =
id + iPos;
109 if (roomId < m_aRooms.Count())
110 room = m_aRooms[
id + iPos];
113 roomEntry.SetRoomInfo(room);
116 w.SetVisible(room !=
null);
121 if (m_bAnimateListAppearing)
123 int delay = 100 / m_fAnimationAppearTime * id;
124 roomEntry.AnimateOpacity(delay, m_fAnimationAppearTime, 1, 0);
131 override protected void ClearServerList()
136 entry.GetOnFocus().Clear();
137 entry.GetOnFocusLost().Clear();
141 m_aRoomEntries.Clear();
144 super.ClearServerList();
152 void UpdateRooms(array<Room> rooms,
bool animated =
false)
160 m_iEntriesCount = rooms.Count();
161 GetGame().GetCallqueue().Remove(OpacityAnimation);
163 UpdateEntries(animated);
171 protected Room RoomByWidget(Widget w)
174 int id = m_aEntryWidgets.Find(w);
179 id += Math.Floor(m_fScrollPosition);
182 return m_aRoomEntries[id].GetRoomInfo();
196 Room room = serverEntry.GetRoomInfo();
199 m_OnEntryFocus.Invoke(room);
205 m_iFocusedEntryId = m_aRoomEntries.Find(entry) + Math.Floor(m_fScrollPosition);
209 array<SCR_ServerBrowserEntryComponent> GetRoomEntries() {
return m_aRoomEntries; }