Fix Cut 2 Soul Pass #1 HUD/shader defects and expand Smoke GPU checks
This commit is contained in:
parent
05fcfecf91
commit
1d80571fb1
5 changed files with 216 additions and 29 deletions
|
|
@ -49,6 +49,7 @@ public partial class InventoryGridControl : Control
|
|||
private int _gridWidth;
|
||||
private int _gridHeight;
|
||||
private ChassisGrid? _grid;
|
||||
private ChassisSpec? _spec;
|
||||
private int _selectedCargoIndex = -1;
|
||||
private int _lastHitSequence = -1;
|
||||
|
||||
|
|
@ -205,10 +206,12 @@ public partial class InventoryGridControl : Control
|
|||
if (grid is null) throw new ArgumentNullException(nameof(grid));
|
||||
|
||||
bool gridIdentityChanged = !ReferenceEquals(_grid, grid)
|
||||
|| !ReferenceEquals(_spec, grid.Spec)
|
||||
|| _gridWidth != grid.Spec.Width
|
||||
|| _gridHeight != grid.Spec.Height;
|
||||
|
||||
_grid = grid;
|
||||
_spec = grid.Spec;
|
||||
_selectedCargoIndex = selectedCargoIndex;
|
||||
|
||||
if (gridIdentityChanged)
|
||||
|
|
@ -338,6 +341,7 @@ public partial class InventoryGridControl : Control
|
|||
}
|
||||
}
|
||||
_lastHitSequence = grid.HitSequence;
|
||||
bool hadHover = _hoveredCell.HasValue;
|
||||
_hoveredCell = null;
|
||||
|
||||
if (dimsChanged)
|
||||
|
|
@ -354,6 +358,11 @@ public partial class InventoryGridControl : Control
|
|||
|
||||
_material.SetShaderParameter("grid_size", new Vector2(w, h));
|
||||
_material.SetShaderParameter("thermal_mode", _thermalBlend);
|
||||
|
||||
if (hadHover)
|
||||
{
|
||||
HoverChanged?.Invoke(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
private void DetectHits(ChassisGrid grid)
|
||||
|
|
@ -398,9 +407,10 @@ public partial class InventoryGridControl : Control
|
|||
{
|
||||
if (!spec.IsActive(x, y))
|
||||
{
|
||||
_dataImage.SetPixel(x * 3 + 0, y, Colors.Transparent);
|
||||
_dataImage.SetPixel(x * 3 + 1, y, Colors.Transparent);
|
||||
_dataImage.SetPixel(x * 3 + 2, y, Colors.Transparent);
|
||||
var zero = new Color(0f, 0f, 0f, 0f);
|
||||
_dataImage.SetPixel(x * 3 + 0, y, zero);
|
||||
_dataImage.SetPixel(x * 3 + 1, y, zero);
|
||||
_dataImage.SetPixel(x * 3 + 2, y, zero);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue