GE Lua Documentation

Press F to search!

getDiffFlavor

Definition


-- @/lua/ge/extensions/core/lapTimes.lua:109

-- Get color for time difference
local function getDiffFlavor(val)
  if val > 0 then
    return 'worse' -- Slower
  elseif val < 0 then
    return 'better' -- Faster
  else
    return 'same' -- Same
  end
end

Callers

@/lua/ge/extensions/core/lapTimes.lua
      diffToBestFormatted = diffToBest and M.formatTime(diffToBest, true) or nil,
      diffToPreviousFlavor = diffToPrevious and getDiffFlavor(diffToPrevious) or 'default',
      diffToBestFlavor = diffToBest and getDiffFlavor(diffToBest) or 'default'
      diffToPreviousFlavor = diffToPrevious and getDiffFlavor(diffToPrevious) or 'default',
      diffToBestFlavor = diffToBest and getDiffFlavor(diffToBest) or 'default'
    }
      diffToBestFormatted = segment.diffToBest and M.formatTime(segment.diffToBest, true) or nil,
      diffToPreviousFlavor = segment.diffToPrevious and getDiffFlavor(segment.diffToPrevious) or 'default',
      diffToBestFlavor = segment.diffToBest and getDiffFlavor(segment.diffToBest) or 'default'
      diffToPreviousFlavor = segment.diffToPrevious and getDiffFlavor(segment.diffToPrevious) or 'default',
      diffToBestFlavor = segment.diffToBest and getDiffFlavor(segment.diffToBest) or 'default'
    }
            diffToBestFormatted = segment.diffToBest and M.formatTime(segment.diffToBest, true) or nil,
            diffToPreviousFlavor = segment.diffToPrevious and getDiffFlavor(segment.diffToPrevious) or 'default',
            diffToBestFlavor = segment.diffToBest and getDiffFlavor(segment.diffToBest) or 'default'
            diffToPreviousFlavor = segment.diffToPrevious and getDiffFlavor(segment.diffToPrevious) or 'default',
            diffToBestFlavor = segment.diffToBest and getDiffFlavor(segment.diffToBest) or 'default'
          }
      diffToBestFormatted = diffToBest and M.formatTime(diffToBest, true) or nil,
      diffToPreviousFlavor = diffToPrevious and getDiffFlavor(diffToPrevious) or 'default',
      diffToBestFlavor = diffToBest and getDiffFlavor(diffToBest) or 'default'
      diffToPreviousFlavor = diffToPrevious and getDiffFlavor(diffToPrevious) or 'default',
      diffToBestFlavor = diffToBest and getDiffFlavor(diffToBest) or 'default'
    }
          diffToBestFormatted = segment.diffToBest and M.formatTime(segment.diffToBest, true) or nil,
          diffToPreviousFlavor = segment.diffToPrevious and getDiffFlavor(segment.diffToPrevious) or 'default',
          diffToBestFlavor = segment.diffToBest and getDiffFlavor(segment.diffToBest) or 'default'
          diffToPreviousFlavor = segment.diffToPrevious and getDiffFlavor(segment.diffToPrevious) or 'default',
          diffToBestFlavor = segment.diffToBest and getDiffFlavor(segment.diffToBest) or 'default'
        }