Skip to content

Commit 22dea90

Browse files
committed
Fix for #843 and another fix for the soil sampler ...
1 parent cec1989 commit 22dea90

2 files changed

Lines changed: 32 additions & 6 deletions

File tree

scripts/CpUtil.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,5 @@ function CpUtil.removeEventListenersBySpecialization(vehicle, specClass)
504504
end
505505

506506
function CpUtil.getSoilSamplerSpecName()
507-
if g_precisionFarming ~= nil then
508-
return "spec_" .. g_precisionFarming.MOD_NAME .. ".soilSampler"
509-
end
507+
return "spec_FS25_precisionFarming.soilSampler"
510508
end

scripts/gui/CustomFieldHotspot.lua

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,35 @@ CustomFieldHotspot.CATEGORY = 200
55
CustomFieldHotspot.SLICE_ID = "gui.ingameMap_other"
66
CustomFieldHotspot.NAME = "CP_customFieldManager_hotspotName"
77
CustomFieldHotspot.COLOR = {0.61049, 0.56471, 0.00303, 1}
8-
local CustomFieldHotspot_mt = Class(CustomFieldHotspot, FarmlandHotspot)
8+
local CustomFieldHotspot_mt = Class(CustomFieldHotspot, MapHotspot)
99

1010
function CustomFieldHotspot.new(customMt)
11-
local self = FarmlandHotspot.new(customMt or CustomFieldHotspot_mt)
11+
local self = MapHotspot.new(customMt or CustomFieldHotspot_mt)
12+
self.width, self.height = getNormalizedScreenValues(60, 60)
13+
self.icon = g_overlayManager:createOverlay("mapHotspots.miniMapField", 0, 0, self.width, self.height)
14+
self.icon:setColor(unpack(HUD.COLOR.BACKGROUND_DARK))
15+
self.clickArea = MapHotspot.getClickCircle(0.667)
1216
self.lastName = ""
17+
local _
18+
_, self.textSize = getNormalizedScreenValues(0, 16)
19+
self.textColor = { 1, 1, 1 }
20+
self.textColorDisabled = {
21+
0.89627,
22+
0.92158,
23+
0.81485,
24+
0.5
25+
}
26+
_, self.textOffsetY = getNormalizedScreenValues(0, 2)
27+
self.disabled = false
28+
self.isFirstRendering = true
29+
self.name = ""
30+
31+
self.setFarmland = FarmlandHotspot.setFarmland
32+
self.getFarmland = FarmlandHotspot.getFarmland
33+
self.setOwnerFarmId = FarmlandHotspot.setOwnerFarmId
34+
self.setDisabled = FarmlandHotspot.setDisabled
35+
self.updateColors = FarmlandHotspot.updateColors
36+
1337
return self
1438
end
1539

@@ -22,7 +46,7 @@ function CustomFieldHotspot:render(x, y, rotation, small)
2246
self.icon:setDimension(width + self.width)
2347
end
2448
self.lastName = name
25-
CustomFieldHotspot:superClass().render(self, x, y, rotation, small)
49+
FarmlandHotspot.render(self, x, y, rotation, small)
2650
end
2751

2852
function CustomFieldHotspot:setScale(scale)
@@ -33,6 +57,10 @@ function CustomFieldHotspot:getCategory()
3357
return CustomFieldHotspot.CATEGORY
3458
end
3559

60+
function CustomFieldHotspot:getSortingValue()
61+
return math.huge
62+
end
63+
3664
---@param field CustomField
3765
function CustomFieldHotspot:setField(field)
3866
self.field = field

0 commit comments

Comments
 (0)