protected override GridRowInfo CheckRowCache(int rowHandle, int visibleIndex, int newY) //todoCache { if (!HasRowsCache) { return(null); } GridRowInfo res = null; if (IsExternalRow(rowHandle)) { return(null); } // res = CachedRows.FindRowByVisibleIndex(visibleIndex); //else res = RowsCache.FindExistingRow(rowHandle); if (res == null) { return(null); } if (res.Loaded != View.IsRowLoaded(rowHandle)) { return(null); } res.OffsetContent(0, newY - (res.Bounds.Bottom)); return(res); }
override protected void Initialize() { _details = CreateSetting(nameof(_details), Details.None); _equipmentToggle = CreateSetting(nameof(_equipmentToggle), false); _displayRelativeAttackSpeed = CreateSetting(nameof(_displayRelativeAttackSpeed), false); _normalizeImpactDisplay = CreateSetting(nameof(_normalizeImpactDisplay), false); _moveBarrierBelowProtection = CreateSetting(nameof(_moveBarrierBelowProtection), false); _hideNumericalDurability = CreateSetting(nameof(_hideNumericalDurability), false); _barsToggle = CreateSetting(nameof(_barsToggle), false); _durabilityTiedToMax = CreateSetting(nameof(_durabilityTiedToMax), false); _durabilityBarSize = CreateSetting(nameof(_durabilityBarSize), (100 / BAR_MAX_SIZE.x).Round(), IntRange(0, 100)); _freshnessTiedToLifespan = CreateSetting(nameof(_freshnessTiedToLifespan), false); _freshnessBarSize = CreateSetting(nameof(_freshnessBarSize), (100 / BAR_MAX_SIZE.x).Round(), IntRange(0, 100)); _barThickness = CreateSetting(nameof(_barThickness), (100 / BAR_MAX_SIZE.y).Round(), IntRange(0, 100)); _addBackgrounds = CreateSetting(nameof(_addBackgrounds), false); AddEventOnConfigClosed(() => SetBackgrounds(_addBackgrounds)); _rowsCache = new RowsCache(); }
protected override void CalcRowsDrawInfo() { if (AllowUpdateDetails) { EditFormBounds = Rectangle.Empty; } CalcDataRight(); ViewRects.EmptyRows = Rectangle.Empty; int bottom = ViewRects.Rows.Bottom; GridRow row = null; int visibleCount = RowsLoadInfo.ResultRows.Count; bool bottomPositionUpdated = false; ViewRects.RowsTotalHeight = 0; DevExpress.XtraGrid.Drawing.GridColumnInfoArgs lastColumnInfo = ColumnsInfo.LastColumnInfo; GridRowInfo lastRow = null; RowsCache.UpdateCache(RowsLoadInfo.ResultRows); for (int n = 0; n < visibleCount; n++) { row = RowsLoadInfo.ResultRows[n]; if (!bottomPositionUpdated && IView.IsPixelScrollingCore) { bottomPositionUpdated = CheckUpdateTopPositionCore(row, ref bottom); if (bottomPositionUpdated && lastRow != null && lastRow.ForcedRow) { if (lastRow.TotalBounds.Top < bottom) { lastRow.DrawMoreIcons = true; } } } GridRowInfo cached = CheckRowCache(row.RowHandle, row.VisibleIndex, bottom); GridRowInfo ri; GridRow nextRow = (n + 1 < visibleCount ? RowsLoadInfo.ResultRows[n + 1] : null); int rowLineHeight = -1; if (cached == null) { rowLineHeight = CalcRowHeight(GInfo.Graphics, row.RowHandle, row.VisibleIndex, row.Level); cached = CheckRowCacheReusable(row, bottom - rowLineHeight, rowLineHeight); } if (cached != null && row.RowHandle == View.FocusedRowHandle && View.IsEditFormVisible) { cached = null; } if (cached != null) { RowsCache.RemoveRow(cached); GridDataRowInfo cachedDataRow = cached as GridDataRowInfo; bool allowCachedRow = cachedDataRow == null || cachedDataRow.DetailBounds.IsEmpty; if (cachedDataRow != null && cachedDataRow.EditFormRow) { allowCachedRow = false; } if (allowCachedRow) { lastRow = ri = cached; bottom = ri.TotalBounds.Top; ri.ForcedRow = row.ForcedRow; ri.ForcedRowLight = row.ForcedRowLight; ri.DrawMoreIcons = !row.NextRowPrimaryChild && (row.ForcedRow || (ri.IsGroupRow && ri.IsGroupRowExpanded)); RowsInfo.AddRow(ri); if (bottom < ViewRects.Rows.Top) { break; } continue; } } lastRow = ri = CreateRowInfo(row); Rectangle rowBounds = ViewRects.Rows; rowBounds = ViewRects.Rows; rowBounds.Y = bottom; ri.RowLineHeight = rowLineHeight > 0 ? rowLineHeight : CalcRowHeight(GInfo.Graphics, ri.RowHandle, ri.VisibleIndex, ri.Level); rowBounds.Height = ri.RowLineHeight * GetRowLineCount(ri.RowHandle, ri.IsGroupRow); rowBounds.Y -= rowBounds.Height; ri.Bounds = rowBounds; rowBounds.Height = CalcTotalRowHeight(GInfo.Graphics, ri.RowLineHeight, ri.RowHandle, ri.VisibleIndex, ri.Level, ri.IsGroupRow ? (bool?)null : (bool?)true); ri.TotalBounds = rowBounds; if (IsExternalRowCore(ri.RowHandle)) { ri.Bounds = ri.TotalBounds; } CalcRowIndents(ri); ri.RowFooters.RowFooterCount = GetRowFooterCountEx(ri.RowHandle, ri.VisibleIndex, (ri.IsGroupRow ? (bool?)null : (bool?)true)); ri.RowFooters.RowFootersHeight = ri.RowFooters.RowFooterCount * GroupFooterHeight; CalcDataRow(ri as GridDataRowInfo, row, nextRow); CalcGroupRow(ri as GridGroupRowInfo, row, nextRow); CalcExternalRow(ri as GridExternalRowInfo, row, nextRow); //add rowSeparator bottom = ri.TotalBounds.Top; RowsInfo.AddRow(ri); if (bottom < ViewRects.Rows.Top) { break; } } //RemoveAnimatedItems(RowsCache.Rows); ViewRects.RowsTotalHeight = ViewRects.Rows.Bottom - bottom; if (bottom > ViewRects.Rows.Top) { Rectangle r = ViewRects.Rows; r.Y = ViewRects.Rows.Top; r.Height = bottom - ViewRects.Rows.Top; ViewRects.EmptyRows = r; } //CalcRowsMergeInfo(); //if(AllowUpdateDetails) { // CheckEditFormVisibility(); //} IView.ResetAllowUpdateRowIndexesCore(); }