Skip to content

Commit 5923c80

Browse files
Merge branch 'master' into fix-chat-msg-twice
2 parents d3ab82e + eb94ca3 commit 5923c80

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

[gameplay]/freeroam/fr_client.lua

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,7 +2123,9 @@ function onExitVehicle(vehicle,seat)
21232123
hideControls(wndMain, 'repair', 'flip', 'upgrades', 'color', 'paintjob', 'lightson', 'lightsoff')
21242124
closeWindow(wndUpgrades)
21252125
closeWindow(wndColor)
2126-
elseif vehicle and seat == 0 then
2126+
end
2127+
2128+
if vehicle and seat == 0 then
21272129
if source and g_PlayerData[source] then
21282130
setVehicleGhost(vehicle,hasDriverGhost(vehicle))
21292131
end
@@ -2243,11 +2245,21 @@ addEventHandler('onClientResourceStart', resourceRoot,
22432245
createWindow(wndMain)
22442246
hideAllWindows()
22452247
bindKey('f1', 'down', toggleFRWindow)
2248+
bindKey('f2', 'down', toggleMap)
22462249
guiCheckBoxSetSelected(getControl(wndMain, 'jetpack'), isPedWearingJetpack(localPlayer))
22472250
guiCheckBoxSetSelected(getControl(wndMain, 'falloff'), canPedBeKnockedOffBike(localPlayer))
22482251
end
22492252
)
22502253

2254+
addEventHandler('onClientResourceStart', root,
2255+
function(startedResource)
2256+
local editorResource, raceResource = getResourceFromName('editor'), getResourceFromName('race')
2257+
if (editorResource and raceResource and startedResource == raceResource) then
2258+
unbindKey('f2', 'down', toggleMap)
2259+
end
2260+
end
2261+
)
2262+
22512263
function showWelcomeMap()
22522264
createWindow(wndSpawnMap)
22532265
showCursor(true)
@@ -2267,7 +2279,6 @@ function toggleMap()
22672279
showCursor(true)
22682280
end
22692281
end
2270-
bindKey("f2", "down", toggleMap)
22712282

22722283
function toggleFRWindow()
22732284
if isWindowOpen(wndMain) then
@@ -2355,6 +2366,15 @@ addEventHandler('onClientResourceStop', resourceRoot,
23552366
end
23562367
)
23572368

2369+
addEventHandler('onClientResourceStop', root,
2370+
function(stoppingResource)
2371+
local editorResource, raceResource = getResourceFromName('editor'), getResourceFromName('race')
2372+
if (editorResource and raceResource and stoppingResource == raceResource) then
2373+
bindKey('f2', 'down', toggleMap)
2374+
end
2375+
end
2376+
)
2377+
23582378
function setVehicleGhost(sourceVehicle,value)
23592379

23602380
local vehicles = getElementsByType("vehicle")

0 commit comments

Comments
 (0)