void OnGamesItemSelect(object sender, MyGuiControlListboxItemEventArgs eventArgs) { if (eventArgs.RowIndex == 0) { //m_selectColumn = eventArgs.ItemIndex; //order items if (m_gameTableHeaders[eventArgs.ItemIndex] == m_orderByHeader) { m_orderAsc = !m_orderAsc; } else { m_orderAsc = true; m_orderByHeader = m_gameTableHeaders[eventArgs.ItemIndex]; } OrderGames(); RefreshGameList(); } else { m_selectedGameIndex = eventArgs.RowIndex - 1; m_selectRow = eventArgs.RowIndex; } }
static StringBuilder GetHeaderText(MyGameTableHeaderEnum headerType) { switch (headerType) { //case MyGameTableHeaderEnum.Ping: // return MyTextsWrapper.Get(MyTextsWrapperEnum.HeaderPing); case MyGameTableHeaderEnum.HostName: return(MyTextsWrapper.Get(MyTextsWrapperEnum.HeaderHostName)); case MyGameTableHeaderEnum.SectorName: return(MyTextsWrapper.Get(MyTextsWrapperEnum.HeaderSectorName)); case MyGameTableHeaderEnum.GameType: return(MyTextsWrapper.Get(MyTextsWrapperEnum.HeaderType)); case MyGameTableHeaderEnum.PlayerCount: return(MyTextsWrapper.Get(MyTextsWrapperEnum.HeaderPlayerCount)); //case MyGameTableHeaderEnum.JoinMode: // return new StringBuilder("JoinMode"); default: throw new ArgumentOutOfRangeException("headerType"); } }
void OnGamesItemSelect(object sender, MyGuiControlListboxItemEventArgs eventArgs) { if (eventArgs.RowIndex == 0) { //m_selectColumn = eventArgs.ItemIndex; //order items if (m_gameTableHeaders[eventArgs.ItemIndex] == m_orderByHeader) { m_orderAsc = !m_orderAsc; } else { m_orderAsc = true; m_orderByHeader = m_gameTableHeaders[eventArgs.ItemIndex]; } OrderGames(); RefreshGameList(); } else { m_selectedGameIndex = eventArgs.RowIndex - 1; m_selectRow = eventArgs.RowIndex; } }
static StringBuilder GetHeaderText(MyGameTableHeaderEnum headerType) { switch (headerType) { //case MyGameTableHeaderEnum.Ping: // return MyTextsWrapper.Get(MyTextsWrapperEnum.HeaderPing); case MyGameTableHeaderEnum.HostName: return MyTextsWrapper.Get(MyTextsWrapperEnum.HeaderHostName); case MyGameTableHeaderEnum.SectorName: return MyTextsWrapper.Get(MyTextsWrapperEnum.HeaderSectorName); case MyGameTableHeaderEnum.GameType: return MyTextsWrapper.Get(MyTextsWrapperEnum.HeaderType); case MyGameTableHeaderEnum.PlayerCount: return MyTextsWrapper.Get(MyTextsWrapperEnum.HeaderPlayerCount); //case MyGameTableHeaderEnum.JoinMode: // return new StringBuilder("JoinMode"); default: throw new ArgumentOutOfRangeException("headerType"); } }