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 #535: Map key bind interferes with race editor help #573

Merged
merged 1 commit into from
Nov 12, 2024
Merged
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
20 changes: 19 additions & 1 deletion [gameplay]/freeroam/fr_client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2243,11 +2243,21 @@ addEventHandler('onClientResourceStart', resourceRoot,
createWindow(wndMain)
hideAllWindows()
bindKey('f1', 'down', toggleFRWindow)
bindKey('f2', 'down', toggleMap)
guiCheckBoxSetSelected(getControl(wndMain, 'jetpack'), isPedWearingJetpack(localPlayer))
guiCheckBoxSetSelected(getControl(wndMain, 'falloff'), canPedBeKnockedOffBike(localPlayer))
end
)

addEventHandler('onClientResourceStart', root,
function(startedResource)
local editorResource, raceResource = getResourceFromName('editor'), getResourceFromName('race')
if (editorResource and raceResource and startedResource == raceResource) then
unbindKey('f2', 'down', toggleMap)
end
end
)

function showWelcomeMap()
createWindow(wndSpawnMap)
showCursor(true)
Expand All @@ -2267,7 +2277,6 @@ function toggleMap()
showCursor(true)
end
end
bindKey("f2", "down", toggleMap)

function toggleFRWindow()
if isWindowOpen(wndMain) then
Expand Down Expand Up @@ -2355,6 +2364,15 @@ addEventHandler('onClientResourceStop', resourceRoot,
end
)

addEventHandler('onClientResourceStop', root,
function(stoppingResource)
local editorResource, raceResource = getResourceFromName('editor'), getResourceFromName('race')
if (editorResource and raceResource and stoppingResource == raceResource) then
bindKey('f2', 'down', toggleMap)
end
end
)

function setVehicleGhost(sourceVehicle,value)

local vehicles = getElementsByType("vehicle")
Expand Down