TableCell TableView.IDataSource.CellForIdx(int row) { LevelListTableCell tableCell = _tableView.DequeueReusableCellForIdentifier("AvatarListCell") as LevelListTableCell; if (tableCell == null) { tableCell = Instantiate(_tableCellTemplate); // remove level type icons tableCell.transform.Find("LevelTypeIcon0").gameObject.SetActive(false); tableCell.transform.Find("LevelTypeIcon1").gameObject.SetActive(false); tableCell.transform.Find("LevelTypeIcon2").gameObject.SetActive(false); tableCell.reuseIdentifier = "AvatarListCell"; } var cellInfo = new AvatarCellInfo(); if (__AvatarLoadResults[row] != AvatarLoadResult.Completed) { cellInfo.name = System.IO.Path.GetFileName(AvatarList[row].FullPath) + " failed to load"; cellInfo.authorName = "Make sure it's not a duplicate avatar."; cellInfo.rawImageTexture = null; } else { try { cellInfo.name = __AvatarNames[row]; cellInfo.authorName = __AvatarAuthors[row]; cellInfo.rawImageTexture = __AvatarCovers[row] ? __AvatarCovers[row].texture : Texture2D.blackTexture; } catch (Exception e) { cellInfo.name = "If you see this yell at Assistant"; cellInfo.authorName = "because she f****d up"; cellInfo.rawImageTexture = Texture2D.blackTexture; Console.WriteLine(e); } } tableCell.SetPrivateField("_beatmapCharacteristicAlphas", new float[0]); tableCell.SetPrivateField("_beatmapCharacteristicImages", new UnityEngine.UI.Image[0]); tableCell.GetPrivateField <TextMeshProUGUI>("_songNameText").text = cellInfo.name; tableCell.GetPrivateField <TextMeshProUGUI>("_authorText").text = cellInfo?.authorName; tableCell.GetPrivateField <UnityEngine.UI.RawImage>("_coverRawImage").texture = cellInfo.rawImageTexture; return(tableCell); }
TableCell TableView.IDataSource.CellForIdx(int row) { LevelListTableCell tableCell = _tableView.DequeueReusableCellForIdentifier("AvatarListCell") as LevelListTableCell; if (tableCell == null) { tableCell = Instantiate(_tableCellTemplate); // remove level type icons tableCell.transform.Find("LevelTypeIcon0").gameObject.SetActive(false); tableCell.transform.Find("LevelTypeIcon1").gameObject.SetActive(false); tableCell.transform.Find("LevelTypeIcon2").gameObject.SetActive(false); tableCell.reuseIdentifier = "AvatarListCell"; } var cellInfo = new AvatarCellInfo(); if (__AvatarLoadResults[row] != AvatarLoadResult.Completed) { cellInfo.name = System.IO.Path.GetFileName(AvatarList[row].FullPath) + " failed to load"; cellInfo.authorName = "Make sure it's not a duplicate avatar."; cellInfo.coverImage = null; } else { try { cellInfo.name = __AvatarNames[row]; cellInfo.authorName = __AvatarAuthors[row]; cellInfo.coverImage = __AvatarCovers[row] ?? Sprite.Create(Texture2D.blackTexture, new Rect(), Vector2.zero); } catch (Exception e) { cellInfo.name = "If you see this yell at Assistant"; cellInfo.authorName = "because she f****d up"; cellInfo.coverImage = null; Console.WriteLine(e); } } tableCell.SetDataFromLevel(cellInfo); return(tableCell); }