Skip to content

Commit

Permalink
use current vehicle colour when opening colour picker
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnFlowerful committed Oct 17, 2016
1 parent 7de6f71 commit 62aabb9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions [gameplay]/freeroam/colorpicker/colorpicker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,16 @@ colorPicker = {
70, 15, "Color 1", true, false, colorPicker.GUI.selectWindow)

checkColor2 = guiCreateCheckBox(info.selectWindow.ra2X, info.selectWindow.ra2Y,
70, 15, "Color 2", true, false, colorPicker.GUI.selectWindow)
70, 15, "Color 2", false, false, colorPicker.GUI.selectWindow)

checkColor3 = guiCreateCheckBox(info.selectWindow.ra3X, info.selectWindow.ra3Y,
70, 15, "Color 3", true, false, colorPicker.GUI.selectWindow)
70, 15, "Color 3", false, false, colorPicker.GUI.selectWindow)

checkColor4 = guiCreateCheckBox(info.selectWindow.ra4X, info.selectWindow.ra4Y,
70, 15, "Color 4", true, false, colorPicker.GUI.selectWindow)
70, 15, "Color 4", false, false, colorPicker.GUI.selectWindow)

checkColor5 = guiCreateCheckBox(info.selectWindow.ra5X, info.selectWindow.ra5Y,
75, 15, "Headlights", true, false, colorPicker.GUI.selectWindow)
75, 15, "Headlights", false, false, colorPicker.GUI.selectWindow)

colorPicker.avoidRecursion = false
end,
Expand Down
6 changes: 6 additions & 0 deletions [gameplay]/freeroam/fr_client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1172,9 +1172,15 @@ end
addCommandHandler('color', setColorCommand)
addCommandHandler('cl', setColorCommand)

local first = true
function openColorPicker()
editingVehicle = getPedOccupiedVehicle(localPlayer)
if (editingVehicle) then
if first then
local r, g, b = getVehicleColor(editingVehicle, true)
colorPicker.setValue({r, g, b})
first = false
end
colorPicker.openSelect(colors)
end
end
Expand Down

0 comments on commit 62aabb9

Please sign in to comment.