private void _UpdateContoursInfo() { // Contours can change while the tool is not active (e.g. by changing a data layer's filter) // Check if tool is still active (could have been deactivated while creating analysis) if (isActive && allowInfoUpdate) { if (showContoursToggle.isOn && (contoursLayer.grids.Count > 0 || lockedContours != null)) { contoursLayer.FetchGridValues(); var sqm = ContourUtils.GetContoursSquareMeters(contoursLayer.Grid); // Show the stats FIRST to ensure proper UI colors InfoPanel.ShowStats(true); InfoPanel.UpdateEntry("CC", sqm); // Avoid doing multiple updates per frame (in case it's called outside of coroutine) nextUpdateFrame = Time.frameCount + 10; } else if (grids.Count > 0) { // Show the stats FIRST to ensure proper UI colors InfoPanel.ShowStats(true); InfoPanel.ClearEntry("CC"); } else { // Show the stats LAST to ensure proper UI colors InfoPanel.ClearEntry("CC"); InfoPanel.ShowStats(false); } } }
private void DeselectContour() { if (contoursLayer.SelectedContour > 0) { contoursLayer.DeselectContour(); if (isActive) { InfoPanel.ClearEntry("SC"); } } }