Skip to content

Commit

Permalink
Small gui adjustment and another nil check for shovel positions
Browse files Browse the repository at this point in the history
  • Loading branch information
schwiti6190 committed Dec 12, 2024
1 parent d579914 commit aa4df41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
18 changes: 6 additions & 12 deletions scripts/gui/hud/CpBaseHud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,7 @@ CpBaseHud.uvs = {
},
driveNowSymbol = {
{0, 768, 128, 128}
},
goalSymbol = GuiUtils.getUVs({
788,
30,
44,
44
}, AIPlaceableMarkerHotspot.FILE_RESOLUTION),

},
exitSymbol = {
{148, 184, 32, 32}, {256, 512}
},
Expand Down Expand Up @@ -352,15 +345,16 @@ function CpBaseHud:init(vehicle)
end)

--- Goal button.
local width, height = getNormalizedScreenValues(34, 34)
local width, height = getNormalizedScreenValues(30, 30)
local goalOverlay = CpGuiUtil.createOverlay({width, height},
{AIPlaceableMarkerHotspot.FILENAME, self.uvs.goalSymbol},
{"dataS/menu/gui.png", nil},
self.OFF_COLOR,
self.alignments.bottomRight)
self.alignments.bottomRight,
"gui.aiParameterPosition")

self.goalBtn = CpHudButtonElement.new(goalOverlay, self.baseHud)
local x, y = unpack(self.lines[7].right)
self.goalBtn:setPosition(x + self.wMargin/4, y - self.hMargin/4)
self.goalBtn:setPosition(x + self.wMargin/4, y - self.hMargin/3)
self.goalBtn:setCallback("onClickPrimary", vehicle, function (vehicle)
self:openCourseGeneratorGui(vehicle)
end)
Expand Down
2 changes: 1 addition & 1 deletion scripts/specializations/CpShovelPositions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ function CpShovelPositions:setShovelPosition(dt, shovelLimits, armLimits, height
end

local alpha, oldRotRelativeArmRot = 0, 0
if hasIntersection and i1y ~= nil then
if hasIntersection and i1y ~= nil and i1z ~= nil then
--- Controls the arm height
setTranslation(armProjectionNode, 0, i1y, i1z)
setTranslation(armToolRefNode, ax, ay, az)
Expand Down

0 comments on commit aa4df41

Please sign in to comment.