Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix checkpoints alpha #508

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion [editor]/edf/edf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ function edfGetElementDimension(element)
end

function edfGetElementAlpha(element)
return getElementAlpha(element) or tonumber(getElementData(element, "alpha")) or 255
return getElementAlpha(element) or tonumber(getElementData(element, "alpha")) or (getElementType(element) == 'checkpoint' and 128 or 255) -- 128 is checkpoint default max alpha
end

function edfSetElementDimension(element, dimension)
Expand Down
9 changes: 7 additions & 2 deletions [gamemodes]/[race]/race/race_client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1253,8 +1253,13 @@ function createCheckpoint(i)
local pos = checkpoint.position
local color = checkpoint.color or { 0, 0, 255 }
checkpoint.marker = createMarker(pos[1], pos[2], pos[3], checkpoint.type or 'checkpoint', checkpoint.size, color[1], color[2], color[3])
if (not checkpoint.type or checkpoint.type == 'checkpoint') and i == #g_Checkpoints then
setMarkerIcon(checkpoint.marker, 'finish')

if (not checkpoint.type or checkpoint.type == 'checkpoint') then
setElementAlpha(checkpoint.marker, 128) -- default checkpoint max alpha

if (i == #g_Checkpoints) then
setMarkerIcon(checkpoint.marker, 'finish')
end
end
if checkpoint.type == 'ring' and i < #g_Checkpoints then
setMarkerTarget(checkpoint.marker, unpack(g_Checkpoints[i+1].position))
Expand Down