Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fs25 #1

Merged
merged 175 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
175 commits
Select commit Hold shift + click to select a range
0d68848
chore: FS25 compatibility updates
Nov 12, 2024
ff4b28a
chore: FS25 compatibility updates
Nov 13, 2024
00379a0
Some more compability updates
schwiti6190 Nov 13, 2024
3d5e524
Some more error messages
schwiti6190 Nov 13, 2024
35d2701
Some more changes ..
schwiti6190 Nov 13, 2024
8ed8a80
chore: DevHelper works
Nov 13, 2024
22b9f52
refactor: replace g_currentMission.controlledVehicle
Nov 14, 2024
67c9bd7
Fixed hud
schwiti6190 Nov 15, 2024
17a3633
doc: update readme
Nov 16, 2024
5c886d0
WIP CP Menu
schwiti6190 Nov 16, 2024
4ca1d45
WIP Coursemanager Menü
schwiti6190 Nov 17, 2024
050c01f
Fixes raycastAll parameter swap ......
schwiti6190 Nov 17, 2024
1f8cb3a
The same fix for raycastClosest
schwiti6190 Nov 17, 2024
8f963e4
Reactivate commented code
schwiti6190 Nov 17, 2024
56ad465
Fixes g_currentMission.player changes
schwiti6190 Nov 17, 2024
e62395b
fix: waypoint clone
Nov 17, 2024
d45ea5b
fix: dummy coroutine
Nov 17, 2024
659b029
fix: MathUtil.clamp(), division by zero
Nov 17, 2024
0e845a9
fix: motor controller
Nov 17, 2024
72d9c0c
fix: onStateChange() workaround
Nov 18, 2024
a8090a8
feat: cpGenerateDefaultCourse console command
Nov 18, 2024
fb70f9a
fix: game exit crash
Nov 18, 2024
75ac238
fix: devhelper console command
Nov 19, 2024
df55b85
fix: island detection within the field boundary
Nov 19, 2024
c9a7ace
feat: save all fields with game field polygons
Nov 20, 2024
045d90d
feat: cpGenerateDefaultCourse uses the Giants field polygon
Nov 20, 2024
37965e0
fix: load assigned courses
Nov 21, 2024
ab76771
fix: mission field detection
Nov 21, 2024
d1e87b3
fix: missing coroutine workaround
Nov 21, 2024
f049013
fix: multi-stage pathfinder cleanup
Nov 22, 2024
730f10e
fix: use math.sign instead of MathUtil.sign
Nov 22, 2024
9ae95fc
fix: Replaced Vehicle.STATE_CHANGE_*
Nov 23, 2024
e40324e
fix: wait for lowering implements
Nov 23, 2024
5e0b5b9
fix: wait for unfolding
Nov 24, 2024
37842b0
doc: TODO in README
Nov 24, 2024
6f4c68c
Kleine Hud Anpassung
schwiti6190 Nov 24, 2024
c226143
fix: work start
Nov 24, 2024
8a9561b
fix: patch callstack
Nov 27, 2024
9ff8288
fix: harvester start
Nov 28, 2024
859c8a4
fix: pipe measurement
Nov 28, 2024
e677118
fix: combine headland turn
Nov 28, 2024
561a7ba
fix: another division by zero error
Nov 29, 2024
b5dddc3
fix: yet another division by zero error
Nov 29, 2024
5b3f40f
fix: collision log callstack
Nov 29, 2024
ab76970
fix: prepare for work on first waypoint
Nov 29, 2024
3e40442
fix: use our field scanner again
Nov 30, 2024
243d117
feat: keybind to generate course
Nov 30, 2024
b9e92eb
fix: division by zero
Nov 30, 2024
733b0fb
fix: division by zero
Nov 30, 2024
4685360
fix: division by zero
Nov 30, 2024
32b8d40
Disables CP jobs in the ai menu for now
schwiti6190 Nov 30, 2024
b230a81
Fixes the dialog abi changes ...
schwiti6190 Nov 30, 2024
da04c92
Small course manager gui adjustments and disabled course editor
schwiti6190 Nov 30, 2024
39841c6
Added nil checks
schwiti6190 Nov 30, 2024
2048d93
Disables the lane offet setting, while cp is active
schwiti6190 Dec 1, 2024
2d9ec4b
fix: multitool course loading
Dec 1, 2024
70705aa
WIP
schwiti6190 Dec 3, 2024
34ca1e2
Diff bug fixes ..
schwiti6190 Dec 3, 2024
e1d34bc
Some more fixes
schwiti6190 Dec 3, 2024
4f8febb
Some more fix
schwiti6190 Dec 4, 2024
07881fe
Some more fixes ..
schwiti6190 Dec 4, 2024
091278b
Multiple stupid bug fixes ...
schwiti6190 Dec 5, 2024
5381107
Updated translations
schwiti6190 Dec 6, 2024
68164ea
Divide by zero fix and vine generator settings added
schwiti6190 Dec 6, 2024
a23021f
Updated translations
schwiti6190 Dec 6, 2024
0464112
Fixes getIsMotorStarted()
schwiti6190 Dec 6, 2024
13852fa
Stupid map fix ..
schwiti6190 Dec 6, 2024
922e4ed
Added Building Collision Flag to the proximity sensor
schwiti6190 Dec 6, 2024
d75af2d
Added Collision flag building to pathfinder and veritcal proximity se…
schwiti6190 Dec 6, 2024
388d1f7
Added nil check for shovel mode
schwiti6190 Dec 6, 2024
ae93b9b
Merge pull request #2 from Courseplay/Gui-Additions
Tensuko Dec 6, 2024
5e88ddd
fix: self unload pipe position
Dec 6, 2024
d94eeaf
feat: do not open pipe when turning
Dec 6, 2024
ae41558
fix: do not wait for straw swath on headland
Dec 7, 2024
31d5eb3
fix: stupid pipe open logic error
Dec 7, 2024
057284a
feat: self unload pipe open
Dec 7, 2024
6ec85bd
Merge pull request #3 from Courseplay/pipeopen
Tensuko Dec 7, 2024
7cdc9d8
wip
Dec 7, 2024
d884fe5
fix: auto aim pipe detection for FS25
Dec 7, 2024
5394a6b
wip
Dec 8, 2024
197f524
add piros to config
Tensuko Dec 9, 2024
7896a2d
wip
Dec 9, 2024
1bdde1e
fix: callstack in shop while selecting other variant
Dec 9, 2024
114b54f
fix: callstack in shop while selecting other variant
Dec 9, 2024
98cf8b5
fix: apply tight turn offset to end of course
Dec 12, 2024
6810659
feat: rice field detection
Dec 13, 2024
2d8ec0e
feat: rice field detection
Dec 13, 2024
c730aab
feat: tight turn offset for articulated vehicles
Dec 13, 2024
d5141bf
Some more adjustments
schwiti6190 Dec 8, 2024
fe2699a
Some more adjustments
schwiti6190 Dec 8, 2024
8ac6379
Translation
Tensuko Dec 9, 2024
0321f3d
Updated translations
Tensuko Dec 9, 2024
d88162c
Help menu cosmetic....
Tensuko Dec 9, 2024
9be35ac
Fixes open vehicle menu short cut
schwiti6190 Dec 9, 2024
9bf49bd
fix: vine course generation typo
Dec 9, 2024
035396d
Added helpmenu and removed redundant xml gui profiles ...
schwiti6190 Dec 10, 2024
428daa2
Fixes job start button gui position
schwiti6190 Dec 10, 2024
62341b5
Added Helpmenu button to the hud
schwiti6190 Dec 10, 2024
35d4407
Small gui adjustment and another nil check for shovel positions
schwiti6190 Dec 12, 2024
44a43f4
InfoPanel Cosmetic
Tensuko Dec 12, 2024
68e4110
Fixes aspect ratio and uvs
schwiti6190 Dec 12, 2024
b771ee8
Some more gui fixes and improvements ..
schwiti6190 Dec 13, 2024
be74d3e
Goal symbol a little bit smaller
schwiti6190 Dec 13, 2024
86e1b0e
Merge pull request #6 from Courseplay/Gui-Additions
Tensuko Dec 13, 2024
b97b095
Only reset the discarge timer, if the filllevel is changing
schwiti6190 Dec 12, 2024
e6b3964
Increased wait for discharge timer
schwiti6190 Dec 12, 2024
800fadb
Bug fix
schwiti6190 Dec 13, 2024
256a7a2
helpmenu screenshots
Tensuko Dec 13, 2024
ee333db
Update VehicleConfigurations.xml
Tensuko Dec 13, 2024
e736e74
Merge pull request #5 from Courseplay/rice-fields
Tensuko Dec 13, 2024
727cdbf
WIP using new overlay manager for sprites
schwiti6190 Dec 14, 2024
174f6e7
feat: tight turn offset improvements
Dec 14, 2024
10ad0fa
fix: stupid nil error
Dec 14, 2024
8233f93
fix: another stupid typo
Dec 14, 2024
fe372c5
Tool configs adjusted
Tensuko Dec 14, 2024
f63a471
Added collision flag for rice field pumps
schwiti6190 Dec 15, 2024
abb9134
Integrated info hud view into the ai map
schwiti6190 Dec 15, 2024
634c1a4
Merge pull request #4 from Courseplay/turns-again
Tensuko Dec 15, 2024
d323f0e
Disabled course generator with no field work job creation and bug fixes
schwiti6190 Dec 15, 2024
238b1d7
fix: CpFieldUtil.detectFieldBoundary() everywhere
Dec 15, 2024
2e3fae7
fix: never tested alignment failure case
Dec 15, 2024
85a7776
Merge pull request #10 from Courseplay/Rice-water-pump-collision
Tensuko Dec 15, 2024
6f2bb80
Disabled custom field hotspots
schwiti6190 Dec 15, 2024
2b70e90
Merge pull request #9 from Courseplay/Gui-Additions
Tensuko Dec 15, 2024
d726cd8
feat: better headland turn
Dec 16, 2024
6871479
Added file system load check and custom field gui improvements
schwiti6190 Dec 16, 2024
cd552a0
Updated translations
schwiti6190 Dec 16, 2024
91a1769
fix: forgotten rename
Dec 16, 2024
847f991
Merge pull request #12 from Courseplay/headland-turn
Tensuko Dec 16, 2024
c36fd53
Added missing doc
schwiti6190 Dec 17, 2024
d96a659
Merge pull request #13 from Courseplay/Filesystem-adjustment
Tensuko Dec 17, 2024
01ca04d
modDesc
Tensuko Dec 18, 2024
a91ff9c
Help Menu changes
Tensuko Dec 18, 2024
27f7fc3
Updated translations
Tensuko Dec 18, 2024
a5cf2a9
Update BUG_REPORT_DE.yml
Tensuko Dec 18, 2024
5e3e20a
doc: English typos fixed
Dec 18, 2024
68345ba
Updated translations
pvaiko Dec 18, 2024
9f3a470
Might fix auto restart
schwiti6190 Dec 18, 2024
610daaf
Fixed info text hud position saving
schwiti6190 Dec 18, 2024
76e4924
Fixes hud movement save bug
schwiti6190 Dec 18, 2024
6741c3d
Stupid mistake ..
schwiti6190 Dec 18, 2024
b914c54
Merge pull request #17 from Courseplay/Gui-Additions
Tensuko Dec 18, 2024
401c3e1
Merge pull request #16 from Courseplay/Disable-autorestart-giants-fie…
Tensuko Dec 18, 2024
813787d
PR changes
Tensuko Dec 19, 2024
8997837
Updated translations
Tensuko Dec 19, 2024
7a4a123
Adds nil check to get current vehicle function
schwiti6190 Dec 20, 2024
420f705
Fixed hud keybind and removed controller gui setting for now
schwiti6190 Dec 20, 2024
8838f94
Update modDesc.xml
Tensuko Dec 21, 2024
508d9e9
Merge pull request #15 from Courseplay/help-menu-revisit
Tensuko Dec 21, 2024
951357d
Update modDesc.xml
Tensuko Dec 21, 2024
598a3bb
Hud open/close keybind always enabled.
schwiti6190 Dec 21, 2024
6bb7435
Merge pull request #18 from Courseplay/Gui-Additions
Tensuko Dec 21, 2024
638e663
Fixes master translation syntax..
schwiti6190 Dec 21, 2024
9e08ed8
Updated translations
schwiti6190 Dec 21, 2024
51100ac
small changes
Tensuko Dec 21, 2024
2bdcc84
Update modDesc.xml
Tensuko Dec 21, 2024
db03138
Some more adjustments
schwiti6190 Dec 21, 2024
667eaab
Fixes menu button position
schwiti6190 Dec 21, 2024
e9cbb77
ai status message bug fix and position adjustment
schwiti6190 Dec 21, 2024
69316ca
Merge pull request #19 from Courseplay/Gui-Additions
Tensuko Dec 21, 2024
0929577
Update modDesc.xml
Tensuko Dec 21, 2024
d5b8c71
Update MasterTranslations.xml
Tensuko Dec 21, 2024
9fc4445
Updated translations
Tensuko Dec 21, 2024
210f210
Merge pull request #14 from Courseplay/modDesc-description
Tensuko Dec 21, 2024
2d0e40f
Merge branch 'main' into fs25
Tensuko Dec 21, 2024
9c82df2
doc: README updated
Dec 21, 2024
951f299
doc: README updated
Dec 22, 2024
1cf3eeb
Moved strategies into new folder
schwiti6190 Dec 22, 2024
c969848
Renamed FilllevelManager to FillLevelUtil
schwiti6190 Dec 22, 2024
f982582
Moved ai util files into util sub folder
schwiti6190 Dec 22, 2024
86808ea
forgot workwidth util ..
schwiti6190 Dec 22, 2024
e24f80c
fix: Autodrive API
Dec 22, 2024
5e562fa
Changes from PR #21
Tensuko Dec 22, 2024
a23af14
Updated translations
Tensuko Dec 22, 2024
61e73e9
Merge pull request #20 from Courseplay/house-keeping
Tensuko Dec 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/BUG_REPORT_DE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ body:
attributes:
value: 'Danke, dass du dir Zeit nimmst, diesen Bugreport auszufüllen.

Lese dir bitte zuerst unsere [Wiki Seite](https://github.com/Courseplay/Courseplay_FS22/wiki)
Lies dir bitte zuerst unsere [Wiki Seite](https://github.com/Courseplay/Courseplay_FS25/wiki)
durch, bevor du ein neues Issue erstellst!

'
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/BUG_REPORT_EN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ body:
attributes:
value: 'Thanks for taking the time to fill out this bug report!

Please make sure to read our [Wiki Page](https://github.com/Courseplay/Courseplay_FS22/wiki)
Please make sure to read our [Wiki Page](https://github.com/Courseplay/Courseplay_FS25/wiki)
before creating a new issue!

'
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/QUESTION_DE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ body:
attributes:
value: 'Bitte benutze diese Vorlage, um deine Frage zu stellen!

Lese dir bitte zuerst unsere [Wiki Seite](https://github.com/Courseplay/Courseplay_FS22/wiki)
Lese dir bitte zuerst unsere [Wiki Seite](https://github.com/Courseplay/Courseplay_FS25/wiki)
durch, bevor du ein neues Issue erstellst!

Unsere Hilfe aus dem Spiel, gibt es auch unter [Courseplay.dev]!(https://courseplay.github.io/Courseplay_FS22.github.io/),
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/QUESTION_EN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ body:
attributes:
value: 'Please use this template to ask your question!

Please make sure to read our [Wiki Page](https://github.com/Courseplay/Courseplay_FS22/wiki)
Please make sure to read our [Wiki Page](https://github.com/Courseplay/Courseplay_FS25/wiki)
before creating a new issue!

Our help pages from the game can also be found at [Courseplay.dev]!(https://courseplay.github.io/Courseplay_FS22.github.io/),
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/REQUEST_DE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ body:
attributes:
value: 'Danke, dass du dir Zeit nimmst, diesen Report auszufüllen.

Lese dir bitte zuerst unsere [Wiki Seite](https://github.com/Courseplay/Courseplay_FS22/wiki)
Lese dir bitte zuerst unsere [Wiki Seite](https://github.com/Courseplay/Courseplay_FS25/wiki)
durch, bevor du ein neues Issue erstellst!

'
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/REQUEST_EN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ body:
attributes:
value: 'Thanks for taking the time to fill out this report!

Please make sure to read our [Wiki Page](https://github.com/Courseplay/Courseplay_FS22/wiki)
Please make sure to read our [Wiki Page](https://github.com/Courseplay/Courseplay_FS25/wiki)
before creating a new issue!

'
Expand Down
83 changes: 28 additions & 55 deletions Courseplay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ Courseplay.baseXmlKey = "Courseplay"
Courseplay.xmlKey = Courseplay.baseXmlKey.."."

function Courseplay:init()
g_gui:loadProfiles( Utils.getFilename("config/gui/GUIProfiles.xml", Courseplay.BASE_DIRECTORY) )
---TODO_25
-- g_gui:loadProfiles( Utils.getFilename("config/gui/GUIProfiles.xml", Courseplay.BASE_DIRECTORY) )

--- Base cp folder
self.baseDir = getUserProfileAppPath() .. "modSettings/" .. Courseplay.MOD_NAME .. "/"
createFolder(self.baseDir)
--- Base cp folder
self.cpFilePath = self.baseDir.."courseplay.xml"

g_overlayManager:addTextureConfigFile(Utils.getFilename("img/iconSprite.xml", self.BASE_DIRECTORY), "cpIconSprite")
g_overlayManager:addTextureConfigFile(Utils.getFilename("img/ui_courseplay.xml", self.BASE_DIRECTORY), "cpUi")
end

function Courseplay:registerXmlSchema()
Expand All @@ -24,6 +28,7 @@ function Courseplay:registerXmlSchema()
self.globalSettings:registerXmlSchema(self.xmlSchema, self.xmlKey)
CpBaseHud.registerXmlSchema(self.xmlSchema, self.xmlKey)
CpHudInfoTexts.registerXmlSchema(self.xmlSchema, self.xmlKey)
CpInGameMenu.registerXmlSchema(self.xmlSchema, self.xmlKey)
end

--- Loads data not tied to a savegame.
Expand All @@ -32,8 +37,9 @@ function Courseplay:loadUserSettings()
if xmlFile then
self:showUserInformation(xmlFile, self.baseXmlKey)
self.globalSettings:loadFromXMLFile(xmlFile, self.xmlKey)
g_cpInGameMenu:loadFromXMLFile(xmlFile, self.xmlKey)
CpBaseHud.loadFromXmlFile(xmlFile, self.xmlKey)
CpHudInfoTexts.loadFromXmlFile(xmlFile, self.xmlKey)
self.infoTextsHud:loadFromXmlFile(xmlFile, self.xmlKey)
xmlFile:save()
xmlFile:delete()
else
Expand All @@ -47,10 +53,11 @@ function Courseplay:saveUserSettings()
if xmlFile then
self.globalSettings:saveUserSettingsToXmlFile(xmlFile, self.xmlKey)
CpBaseHud.saveToXmlFile(xmlFile, self.xmlKey)
CpHudInfoTexts.saveToXmlFile(xmlFile, self.xmlKey)
self.infoTextsHud:saveToXmlFile(xmlFile, self.xmlKey)
if self.currentVersion then
xmlFile:setValue(self.baseXmlKey.."#lastVersion", self.currentVersion)
xmlFile:setValue(self.baseXmlKey .. "#lastVersion", self.currentVersion)
end
g_cpInGameMenu:saveToXMLFile(xmlFile, self.xmlKey)
xmlFile:save()
xmlFile:delete()
end
Expand All @@ -74,9 +81,7 @@ function Courseplay:showUserInformation(xmlFile, key)
self.MOD_NAME, self.currentVersion, lastLoadedVersion)

if showInfoDialog then
g_gui:showInfoDialog({
text = string.format(g_i18n:getText("CP_infoText"), self.currentVersion)
})
InfoDialog.show(string.format(g_i18n:getText("CP_infoText"), self.currentVersion))
if xmlFile then
xmlFile:setValue(key.."#lastVersion", self.currentVersion)
end
Expand All @@ -92,27 +97,25 @@ end
function Courseplay:loadMap(filename)
self.globalSettings = CpGlobalSettings()
self:registerXmlSchema()
self:loadUserSettings()
--- Savegame infos here
CpUtil.info("Map loaded: %s, Savegame name: %s(%d)",
g_currentMission.missionInfo.mapId,
g_currentMission.missionInfo.savegameName,
g_currentMission.missionInfo.savegameIndex)
self:load()
self:setupGui()
self:loadUserSettings()
if g_currentMission.missionInfo.savegameDirectory ~= nil then
local saveGamePath = g_currentMission.missionInfo.savegameDirectory .."/"
local filePath = saveGamePath .. "Courseplay.xml"
self.xmlFile = XMLFile.load("cpXml", filePath , self.xmlSchema)
if self.xmlFile == nil then return end
self.globalSettings:loadFromXMLFile(self.xmlFile, g_Courseplay.xmlKey)
self.xmlFile:delete()

g_assignedCoursesManager:loadAssignedCourses(saveGamePath)
end

--- Ugly hack to get access to the global AutoDrive table, as this global is dependent on the auto drive folder name.
self.autoDrive = FS22_AutoDrive and FS22_AutoDrive.AutoDrive
self.autoDrive = FS25_AutoDrive and FS25_AutoDrive.AutoDrive
CpUtil.info("Auto drive found: %s", tostring(self.autoDrive~=nil))

g_courseEditor:load()
Expand All @@ -122,62 +125,32 @@ function Courseplay:deleteMap()
g_courseEditor:delete()
BufferedCourseDisplay.deleteBuffer()
g_signPrototypes:delete()
g_devHelper:delete()
g_consoleCommands:delete()
end

function Courseplay:setupGui()
local vehicleSettingsFrame = CpVehicleSettingsFrame.new()
local globalSettingsFrame = CpGlobalSettingsFrame.new()
local courseManagerFrame = CpCourseManagerFrame.new(self.courseStorage)
g_gui:loadGui(Utils.getFilename("config/gui/VehicleSettingsFrame.xml", Courseplay.BASE_DIRECTORY),
"CpVehicleSettingsFrame", vehicleSettingsFrame, true)
g_gui:loadGui(Utils.getFilename("config/gui/GlobalSettingsFrame.xml", Courseplay.BASE_DIRECTORY),
"CpGlobalSettingsFrame", globalSettingsFrame, true)
g_gui:loadGui(Utils.getFilename("config/gui/CourseManagerFrame.xml", Courseplay.BASE_DIRECTORY),
"CpCourseManagerFrame", courseManagerFrame, true)
local function predicateFunc()
-- Only allow the vehicle bound pages, when a vehicle with cp functionality is chosen/entered.
local vehicle = CpInGameMenuAIFrameExtended.getVehicle()
return vehicle ~= nil and vehicle.spec_cpAIWorker ~= nil
end

--- As precision farming decided to be moved in between the normal map and the ai map,
--- we move it down one position.
local pos = g_modIsLoaded["FS22_precisionFarming"] and 4 or 3

CpGuiUtil.fixInGameMenuPage(vehicleSettingsFrame, "pageCpVehicleSettings",
{896, 0, 128, 128}, pos + 1, predicateFunc)
CpGuiUtil.fixInGameMenuPage(globalSettingsFrame, "pageCpGlobalSettings",
{768, 0, 128, 128}, pos + 1, function () return true end)
CpGuiUtil.fixInGameMenuPage(courseManagerFrame, "pageCpCourseManager",
{256, 0, 128, 128}, pos + 1, predicateFunc)
CpInGameMenu.setupGui(self.courseStorage)
self.infoTextsHud = CpHudInfoTexts()

g_currentMission.hud.ingameMap.drawFields = Utils.appendedFunction(g_currentMission.hud.ingameMap.drawFields, Courseplay.drawHudMap)
-- TODO_25
-- g_currentMission.hud.ingameMap.drawFields = Utils.appendedFunction(g_currentMission.hud.ingameMap.drawFields, Courseplay.drawHudMap)

-- local page = g_gui.currentGui.target.pageSettings

-- local newPage = page.subCategoryPages[1].copy(page.subCategoryPages[1].parent)
-- self:fixGui()
end

--- Enables drawing onto the hud map.
function Courseplay.drawHudMap(map)
if g_Courseplay.globalSettings.drawOntoTheHudMap:getValue() then
local vehicle = g_currentMission.controlledVehicle
local vehicle = CpUtil.getCurrentVehicle()
if vehicle and vehicle:getIsEntered() and not g_gui:getIsGuiVisible() and vehicle.spec_cpAIWorker and not vehicle.spec_locomotive then
SpecializationUtil.raiseEvent(vehicle, "onCpDrawHudMap", map)
end
end
end

--- Adds cp help info to the in game help menu.
function Courseplay:loadMapDataHelpLineManager(superFunc, ...)
local ret = superFunc(self, ...)
if ret then
self:loadFromXML(Utils.getFilename("config/HelpMenu.xml", Courseplay.BASE_DIRECTORY))
return true
end
return false
end
HelpLineManager.loadMapData = Utils.overwrittenFunction( HelpLineManager.loadMapData, Courseplay.loadMapDataHelpLineManager)

--- Saves all global data, for example global settings.
function Courseplay.saveToXMLFile(missionInfo)
if missionInfo.isValid then
Expand Down Expand Up @@ -208,8 +181,9 @@ function Courseplay:update(dt)
local factor = 2*mapElement.terrainSize/2048
mapElement.zoomMax = mapElement.zoomMax * factor
end
setIngameMapFix(g_currentMission.inGameMenu.pageAI.ingameMap)
setIngameMapFix(g_currentMission.inGameMenu.pageMapOverview.ingameMap)
--- TODO_25
-- setIngameMapFix(g_currentMission.inGameMenu.pageAI.ingameMap)
-- setIngameMapFix(g_currentMission.inGameMenu.pageMapOverview.ingameMap)
end
end

Expand All @@ -234,7 +208,7 @@ end
---@param button number
function Courseplay:mouseEvent(posX, posY, isDown, isUp, button)
if not g_gui:getIsGuiVisible() then
local vehicle = g_currentMission.controlledVehicle
local vehicle = CpUtil.getCurrentVehicle()
local hud = vehicle and vehicle.getCpHud and vehicle:getCpHud()
if hud then
hud:mouseEvent(posX, posY, isDown, isUp, button)
Expand Down Expand Up @@ -276,7 +250,6 @@ function Courseplay:load()
CpAIMessages.register()
g_vineScanner:setup()
end

------------------------------------------------------------------------------------------------------------------------
-- Player action events
------------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -352,7 +325,7 @@ function Courseplay.register(typeManager)
CpAICombineUnloader.register(typeManager, typeName, typeEntry.specializations)
CpAISiloLoaderWorker.register(typeManager, typeName, typeEntry.specializations)
CpAIBunkerSiloWorker.register(typeManager, typeName, typeEntry.specializations)
CpGamePadHud.register(typeManager, typeName,typeEntry.specializations)
-- TODO 25 CpGamePadHud.register(typeManager, typeName,typeEntry.specializations)
CpHud.register(typeManager, typeName, typeEntry.specializations)
CpInfoTexts.register(typeManager, typeName, typeEntry.specializations)
CpShovelPositions.register(typeManager, typeName, typeEntry.specializations)
Expand Down
30 changes: 25 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,38 @@
# Courseplay Beta for Farming Simulator 2025

We are working on migrating Courseplay to Farming Simulator 2025.
We don't yet know how long it'll take, it depends on how much the Giants API changed,
when they make documentation and tools available, and of course, how much time we can spend on it.
<!-- [![Modhub release](https://img.shields.io/badge/Modhub%20Release-Modification-blue.svg)](https://www.farming-simulator.com/mod.php?mod_id=248390title=fs2022)-->
[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/Courseplay/Courseplay_FS25?include_prereleases&style=flat-square&label=Github+Release)](https://github.com/Courseplay/Courseplay_FS25/releases/latest)
[![GitHub Pre-Releases (by Asset)](https://img.shields.io/github/downloads-pre/Courseplay/Courseplay_FS25/latest/FS25_Courseplay.zip?style=flat-square)](https://github.com/Courseplay/Courseplay_FS25/releases/latest/download/FS25_Courseplay.zip)
[![GitHub issues](https://img.shields.io/github/issues/Courseplay/Courseplay_FS25?style=flat-square)](https://github.com/Courseplay/Courseplay_FS25/issues)

**[Download the latest developer version](https://github.com/Courseplay/Courseplay_FS25/releases/latest)** (the file FS25_Courseplay.zip).

<!-- **[Courseplay Website](https://courseplay.github.io/Courseplay_FS25.github.io/)** -->

We'll keep you updated on our progress here, please be patient.

This (and later, the Giants modhub) is the **only official source for Courseplay**,
if you see it anywhere else, it's a scam.

## Developer version

Please be aware you're using a developer version, which may and will contain errors, bugs, mistakes and unfinished code. Chances are you computer will explode when using it. Twice. If you have no idea what "beta", "alpha", or "developer" means and entails, steer clear. The Courseplay team will not take any responsibility for crop destroyed, savegames deleted or baby pandas killed.

You have been warned.

If you're still ok with this, please remember to post possible issues that you find in the developer version. That's the only way we can find sources of error and fix them.
Be as specific as possible:

* tell us the version number
* only use the vehicles necessary, not 10 other ones at a time
* which vehicles are involved, what is the intended action?
* Post! The! Log! to [Gist](https://gist.github.com/) or [PasteBin](http://pastebin.com/)
* For more details on how to post a proper bug report, visit our [Wiki](https://github.com/Courseplay/Courseplay_FS25/wiki)


## Help Us Out

We work long, hard, in our own free time at developing and improving Courseplay. If you like the project, show us your undying love:

[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=7PDM2P6HQ5D56&item_name=Promote+the+development+of+Courseplay&currency_code=EUR&source=url)

<a href="https://www.buymeacoffee.com/courseplay" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
<a href="https://www.buymeacoffee.com/courseplay" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
4 changes: 2 additions & 2 deletions config/CourseGeneratorSettingsSetup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Settings prefixText="CP_vehicle_courseGeneratorSetting_">
<!--Basic settings-->
<SettingSubTitle title="basic">
<Setting classType="AIParameterSettingList" name="workWidth" min="0.5" max="50" incremental="0.1" unit="2" setDefault="setAutomaticWorkWidthAndOffset" onChangeCallback="cpShowWorkWidth" isVisible="isWorkWidthSettingVisible"/>
<Setting classType="AIParameterSettingList" name="workWidth" min="0.5" max="55" incremental="0.1" unit="2" setDefault="setAutomaticWorkWidthAndOffset" onChangeCallback="cpShowWorkWidth" isVisible="isWorkWidthSettingVisible"/>
<Setting classType="AIParameterSettingList" name="multiTools" min="1" max="5" default="1" isExpertModeOnly="true"/>
<Setting classType="AIParameterBooleanSetting" name="useSameTurnWidth" isVisible="hasMoreThenOneVehicle" isExpertModeOnly="true"/>
<Setting classType="AIParameterSettingList" name="numberOfHeadlands" min="0" max="40"/>
Expand All @@ -24,7 +24,7 @@
<!-- Only active with one or more headlands -->
<!--Headland settings-->
<SettingSubTitle title="headland" isVisible="hasHeadlandsSelected">
<Setting classType="AIParameterBooleanSetting" name="sharpenCorners" defaultBool="false"/>
<Setting classType="AIParameterBooleanSetting" name="sharpenCorners" defaultBool="true"/>
<Setting classType="AIParameterSettingList" name="headlandsWithRoundCorners" min="0" max="50" default="1"/>
<Setting classType="AIParameterSettingList" name="turningRadius" min="5" max="12" setDefault="setDefaultTurningRadius"/>
<Setting classType="AIParameterBooleanSetting" name="headlandClockwise" defaultBool="true">
Expand Down
2 changes: 1 addition & 1 deletion config/GlobalSettingsSetup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<SettingSubTitle prefix="true" title="userSettings">
<!-- When enabled, then a few settings are invisible and return their default values. -->
<Setting classType="AIParameterBooleanSetting" name="expertModeActive" isUserSetting="true" defaultBool="false"/>
<Setting classType="AIParameterBooleanSetting" name="controllerHudSelected" isUserSetting="true" defaultBool="false" onChangeCallback="onHudSelectionChanged"/>
<!-- <Setting classType="AIParameterBooleanSetting" name="controllerHudSelected" isUserSetting="true" defaultBool="false" onChangeCallback="onHudSelectionChanged"/> -->
<Setting classType="AIParameterBooleanSetting" name="showsAllActiveCourses" isUserSetting="true" defaultBool="false" isExpertModeOnly="true"/>
<Setting classType="AIParameterBooleanSetting" name="drawOntoTheHudMap" isUserSetting="true" defaultBool="true"/>
<Setting classType="AIParameterBooleanSetting" name="showActionEventHelp" isUserSetting="true" defaultBool="false" onChangeCallback="onActionEventTextVisibilityChanged"/>
Expand Down
7 changes: 3 additions & 4 deletions config/HelpMenu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
<page title="$l10n_CP_help_page_extendedJobMenu_title">
<paragraph>
<text text="$l10n_CP_help_page_startJobMenuBase_text"/>
<image filename="img/helpmenu/startjobmenuhelp.dds" size="1024 1024" uvs="0px 0px 1020px 895px"/>
<image filename="img/helpmenu/startjobmenuhelp.dds" size="1024 1024" uvs="0px 0px 1024px 895px" aspectRatio="0.87"/>
</paragraph>
<paragraph>
<text text="$l10n_CP_help_page_startJobMenuFunctions_text"/>
</paragraph>
<paragraph>
<text text="$l10n_CP_help_page_readyJobMenuBase_text"/>
<image filename="img/helpmenu/readyjobmenuhelp.dds" size="1024 1024" uvs="0px 0px 765px 510px"/>
<image filename="img/helpmenu/readyjobmenuhelp.dds" size="1024 1024" uvs="0px 0px 765px 510px" aspectRatio="0.66"/>
</paragraph>
<paragraph>
<text text="$l10n_CP_help_page_readyJobMenuFunctions_text"/>
Expand Down Expand Up @@ -251,8 +251,7 @@
<!--Courseplay Info Panel-->
<page title="$l10n_CP_help_page_infoPanel_title">
<paragraph>
<text text="$l10n_CP_help_page_blank"/>
<image filename="img/helpmenu/infopanel.dds" size="1024 1024" uvs="0px 0px 765px 510px" aspectRatio="0.66"/>
<image filename="img/helpmenu/infopanel.dds" size="1024 1024" uvs="0px 0px 480px 130px" aspectRatio="0.27"/>
</paragraph>
<paragraph>
<text text="$l10n_CP_help_page_infoPanelBasic_text"/>
Expand Down
Loading
Loading