Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Update hud.lua (#7236)
Browse files Browse the repository at this point in the history
Multitool hud fix
  • Loading branch information
WM3x authored Jun 3, 2021
1 parent 16b2fed commit fa1d0c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ function courseplay.hud:updatePageContent(vehicle, page)

elseif entry.functionToCall == 'changeLaneNumber' then
vehicle.cp.hud.content.pages[page][line][1].text = courseplay:loc('COURSEPLAY_LANE_OFFSET');
if vehicle.cp.multiTools > 1 then
if vehicle.cp.courseGeneratorSettings.multiTools:get() > 1 then
self:enableButtonWithFunction(vehicle,page, 'changeLaneNumber')
if vehicle.cp.laneNumber == 0 then
vehicle.cp.hud.content.pages[page][line][2].text = ('%s'):format(courseplay:loc('COURSEPLAY_CENTER'));
Expand All @@ -832,7 +832,7 @@ function courseplay.hud:updatePageContent(vehicle, page)

elseif entry.functionToCall == 'changeLaneOffset' then
vehicle.cp.hud.content.pages[page][line][1].text = courseplay:loc('COURSEPLAY_LANE_OFFSET');
if vehicle.cp.multiTools == 1 then
if vehicle.cp.courseGeneratorSettings.multiTools:get() == 1 then
self:enableButtonWithFunction(vehicle,page, 'changeLaneOffset')
if vehicle.cp.laneOffset and vehicle.cp.laneOffset ~= 0 then
vehicle.cp.hud.content.pages[page][line][2].text = ('%.1f%s (%s)'):format(abs(vehicle.cp.laneOffset), courseplay:loc('COURSEPLAY_UNIT_METER'), courseplay:loc(vehicle.cp.laneOffset > 0 and 'COURSEPLAY_RIGHT' or 'COURSEPLAY_LEFT'));
Expand Down

0 comments on commit fa1d0c1

Please sign in to comment.