Exemplo n.º 1
0
        public override float CellSize(ScrollViewCell cell)
        {
            BaseGenericCell genericCell = (BaseGenericCell)cell;
            float           offset      = LogConsoleSettings.GetTreeViewOffsetByLevel(level);
            bool            hasIcon     = !string.IsNullOrEmpty(icon);

            return(genericCell.GetPreferHeight(DisplayText, hasIcon, offset));
        }
Exemplo n.º 2
0
        public override ScrollViewCell CreateCell(RecycleScrollView scrollView, AssetConfig config, int cellIndex)
        {
            BaseCell cell = (BaseCell)scrollView.CreateCell(_cellIdentifier);

            cell.SetText(DisplayText);
            cell.SetHeaderOffset(LogConsoleSettings.GetTreeViewOffsetByLevel(level));
            cell.SetBackgroundColor(LogConsoleSettings.GetCellColor(cellIndex));
            _cellControl.UpdateData(cell);
            return(cell);
        }
        public override ScrollViewCell CreateCell(RecycleScrollView scrollView, AssetConfig config, int cellIndex)
        {
            BaseCheckboxCell cell = (BaseCheckboxCell)scrollView.CreateCell("CheckboxCell");

            cell.SetText(DisplayText);
            cell.SetHeaderOffset(LogConsoleSettings.GetTreeViewOffsetByLevel(level));
            cell.SetBackgroundColor(LogConsoleSettings.GetCellColor(cellIndex));
            cell.SetToggle(isOn);
            cell.OnValueChanged = OnValueChanged;
            return(cell);
        }
Exemplo n.º 4
0
        public override ScrollViewCell CreateCell(RecycleScrollView scrollView, AssetConfig config, int cellIndex)
        {
            BaseSliderCell cell = (BaseSliderCell)scrollView.CreateCell("SliderCell");

            cell.SetText(DisplayText);
            cell.SetHeaderOffset(LogConsoleSettings.GetTreeViewOffsetByLevel(level));
            cell.SetBackgroundColor(LogConsoleSettings.GetCellColor(cellIndex));
            cell.SetConfig(min, max, wholeNumbers);
            cell.SetValue(value);
            cell.OnValueChanged = OnValueChanged;
            return(cell);
        }
Exemplo n.º 5
0
        public override ScrollViewCell CreateCell(RecycleScrollView scrollView, AssetConfig config, int cellIndex)
        {
            BaseInputCell cell = (BaseInputCell)scrollView.CreateCell("InputCell");

            cell.SetText(DisplayText);
            cell.SetInput(value);
            cell.SetHeaderOffset(LogConsoleSettings.GetTreeViewOffsetByLevel(level));
            cell.SetBackgroundColor(LogConsoleSettings.GetCellColor(cellIndex));
            cell.SetIsNumeric(isNumeric);
            cell.SetReadonly(isReadonly);
            cell.OnValueChanged = OnValueChanged;
            return(cell);
        }
Exemplo n.º 6
0
        public override ScrollViewCell CreateCell(RecycleScrollView scrollView, AssetConfig config, int cellIndex)
        {
            BaseGenericCell cell = (BaseGenericCell)scrollView.CreateCell(CellIdentifier());

            cell.SetText(DisplayText);
            cell.SetHeaderOffset(LogConsoleSettings.GetTreeViewOffsetByLevel(level));
            cell.SetBackgroundColor(LogConsoleSettings.GetCellColor(cellIndex));

            AssetConfig.SpriteInfo spriteInfo = config.GetSpriteInfo(icon);
            if (spriteInfo != null)
            {
                cell.SetIcon(spriteInfo.sprite);
                cell.SetIconColor(iconColor != Color.white ? iconColor : spriteInfo.color);
            }
            else
            {
                cell.SetIcon(null);
            }


            return(cell);
        }
        public override ScrollViewCell CreateCell(RecycleScrollView scrollView, AssetConfig config, int cellIndex)
        {
            string          cellId = resizable ? "GenericResizableCell" : "GenericCell";
            BaseGenericCell cell   = (BaseGenericCell)scrollView.CreateCell(cellId);

            cell.SetText(DisplayText);
            cell.SetHeaderOffset(LogConsoleSettings.GetTreeViewOffsetByLevel(level));
            cell.SetBackgroundColor(LogConsoleSettings.GetCellColor(cellIndex));

            AssetConfig.SpriteInfo spriteInfo = config.GetSpriteInfo((isExpanded || string.IsNullOrEmpty(iconClose)) ? icon : iconClose);
            if (spriteInfo != null)
            {
                cell.SetIcon(spriteInfo.sprite);
                cell.SetIconColor(iconColor != Color.white ? iconColor : spriteInfo.color);
            }
            else
            {
                cell.SetIcon(null);
            }

            return(cell);
        }
Exemplo n.º 8
0
        void UpdateCell(ScrollViewCell cell)
        {
            BaseLogCell logCell = cell as BaseLogCell;
            LogInfo     logInfo = _filterLogInfos[logCell.info.index];

            AssetConfig.SpriteInfo iconConfig = _assetConfig.GetSpriteInfo(LogTypeToIconName(logInfo.type));
            logCell.SetIcon(iconConfig.sprite);
            logCell.SetIconColor(iconConfig.color);
            logCell.SetBackgroundColor(LogConsoleSettings.GetCellColor(logCell.info.index));

            _cachedText.Length = 0;

            if (LogConsoleSettings.Instance.showTimestamp)
            {
                _cachedText.Append(logInfo.time);
            }

            if (LogConsoleSettings.Instance.showLogChannel && logInfo.channelInfo != null)
            {
                _cachedText.Append(logInfo.channelInfo.nameWithColor);
                _cachedText.Append("  ");
            }

            _cachedText.Append(logInfo.shortMessage);
            logCell.SetText(_cachedText.ToString());

            if (LogFilter.Instance.IsCollapse)
            {
                logCell.SetCollapseEnable(true);
                logCell.SetCollapseNumber(logInfo.numInstance);
            }
            else
            {
                logCell.SetCollapseEnable(false);
            }
        }
Exemplo n.º 9
0
 public LogConsole(LogConsoleSettings setting)
 {
     ApplySettings(setting);
 }