Skip to content

Commit

Permalink
Small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
David committed Apr 19, 2024
1 parent f2a3b8d commit 8e39a63
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/gui/hud/CpBaseHud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -322,14 +322,14 @@ function CpBaseHud:init(vehicle)
local width, height = getNormalizedScreenValues(18, 18)
local imageFilename = Utils.getFilename('img/iconSprite.dds', g_Courseplay.BASE_DIRECTORY)
local clearCourseOverlay = CpGuiUtil.createOverlay({width, height},
{imageFilename, GuiUtils.getUVs(unpack(CpBaseHud.uvs.clearCourseSymbol))},
CpBaseHud.OFF_COLOR,
CpBaseHud.alignments.bottomRight)
self.clearCourseBtn = CpHudButtonElement.new(clearCourseOverlay, self)
{imageFilename, GuiUtils.getUVs(unpack(self.uvs.clearCourseSymbol))},
self.OFF_COLOR,
self.alignments.bottomRight)
self.clearCourseBtn = CpHudButtonElement.new(clearCourseOverlay, self.baseHud)
local x, y = unpack(lines[8].right)
x = x - 2*width - wMargin/2 - wMargin/4
self.clearCourseBtn:setPosition(x, y)
self.clearCourseBtn:setCallback("onClickPrimary", vehicle, function (vehicle)
self.clearCourseBtn:setCallback("onClickPrimary", self.vehicle, function (vehicle)
if vehicle:hasCpCourse() and not vehicle:getIsCpActive() then
vehicle:resetCpCoursesFromGui()
end
Expand Down

0 comments on commit 8e39a63

Please sign in to comment.