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 #3597

Closed
wants to merge 2 commits into from
Closed

Fs25 #3597

Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 6 additions & 4 deletions Courseplay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function Courseplay:showUserInformation(xmlFile, key)
self.MOD_NAME, self.currentVersion, lastLoadedVersion)

if showInfoDialog then
g_gui:showInfoDialog({
g_gui:showDialog({
text = string.format(g_i18n:getText("CP_infoText"), self.currentVersion)
})
if xmlFile then
Expand Down Expand Up @@ -133,8 +133,8 @@ function Courseplay:setupGui()
"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)
--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()
Expand All @@ -145,12 +145,14 @@ function Courseplay:setupGui()
--- we move it down one position.
local pos = g_modIsLoaded["FS22_precisionFarming"] and 4 or 3

--[[ TODO 25
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)
]]
self.infoTextsHud = CpHudInfoTexts()

g_currentMission.hud.ingameMap.drawFields = Utils.appendedFunction(g_currentMission.hud.ingameMap.drawFields, Courseplay.drawHudMap)
Expand Down Expand Up @@ -352,7 +354,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
14 changes: 7 additions & 7 deletions config/gui/CourseManagerFrame.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<GuiElement type="empty" profile="ingameMenuSettingsBox" id="mainBox">

<GuiElement type="empty" profile="ingameMenuPriceLeftColumn" id="leftColumn">
<GuiElement type="boxLayout" profile="ingameCalendarHeaderBox" id="tableHeaderBox" size="680px 104px">
<GuiElement type="boxLayout" profile="fs25_calendarHeaderBox" id="tableHeaderBox" size="680px 104px">
<GuiElement type="text" profile="ingameMenuPriceHeader" size="340px 104px" id="leftColumnHeader" />
</GuiElement>

<GuiElement type="smoothList" profile="ingameMenuPriceList" id="leftList" focusChangeTop="nil" focusChangeBottom="nil" selectedWithoutFocus="true">
<GuiElement type="listItem" profile="ingameMenuPriceListItem">
<GuiElement type="smoothList" profile="fs25_pricesPriceList" id="leftList" focusChangeTop="nil" focusChangeBottom="nil" selectedWithoutFocus="true">
<GuiElement type="listItem" profile="fs25_pricesPriceListItem">
<GuiElement type="bitmap" name="icon" profile="ingameMenuPriceGoodsIcon" />
<GuiElement type="text" name="title" profile="ingameMenuPriceItemTitle" />
</GuiElement>
Expand All @@ -26,13 +26,13 @@
</GuiElement>

<GuiElement type="empty" profile="ingameMenuPriceRightColumn" id="rightColumn">
<GuiElement type="boxLayout" profile="ingameCalendarHeaderBox" id="tableHeaderBox" size="680px 104px">
<GuiElement type="boxLayout" profile="fs25_calendarHeaderBox" id="tableHeaderBox" size="680px 104px">
<GuiElement type="text" profile="ingameMenuPriceHeader" size="330px 104px" id="rightColumnHeader" />
</GuiElement>

<GuiElement type="smoothList" profile="ingameMenuPriceList" id="rightList" focusChangeTop="nil" focusChangeBottom="nil">
<GuiElement type="listItem" profile="ingameMenuPriceListItem">
<GuiElement type="bitmap" name="icon" profile="ingameMenuPriceItemHotspot" />
<GuiElement type="smoothList" profile="fs25_pricesPriceList" id="rightList" focusChangeTop="nil" focusChangeBottom="nil">
<GuiElement type="listItem" profile="fs25_pricesPriceListItem">
<GuiElement type="bitmap" name="icon" profile="fs25_pricesPriceListItemHotspot" />
<GuiElement type="text" name="title" profile="ingameMenuPriceSellpointTitle" />
</GuiElement>
</GuiElement>
Expand Down
2 changes: 1 addition & 1 deletion modDesc.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<modDesc descVersion="80">
<modDesc descVersion="92">
<version>7.5.0.1</version>
<author><![CDATA[Courseplay.devTeam]]></author>
<title>
Expand Down
2 changes: 1 addition & 1 deletion scripts/Waypoint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function Waypoint:init(wp)
self.rev = self.rev or wp.gear and wp.gear == Gear.Backward
-- dynamically added/calculated properties
self.useTightTurnOffset = wp.useTightTurnOffset
self.turnControls = table.copy(wp.turnControls)
self.turnControls = table.clone(wp.turnControls)
self.dToNext = wp.dToNext
self.yRot = wp.yRot
--- Set, when generated for a multi tool course
Expand Down
4 changes: 2 additions & 2 deletions scripts/ai/controllers/ShovelController.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ ShovelController.POSITIONS = {
}
ShovelController.MAX_TRIGGER_HEIGHT = 8
ShovelController.MIN_TRIGGER_HEIGHT = 1
ShovelController.TRIGGER_HEIGHT_RAYCAST_COLLISION_MASK = CollisionFlag.STATIC_WORLD + CollisionFlag.STATIC_OBJECTS +
CollisionFlag.STATIC_OBJECT + CollisionFlag.VEHICLE
ShovelController.TRIGGER_HEIGHT_RAYCAST_COLLISION_MASK =
CollisionFlag.DEFAULT + CollisionFlag.STATIC_OBJECT + CollisionFlag.VEHICLE

function ShovelController:init(vehicle, implement, isConsoleCommand)
ImplementController.init(self, vehicle, implement)
Expand Down
14 changes: 7 additions & 7 deletions scripts/ai/jobs/CpAIJobCombineUnloader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ function CpAIJobCombineUnloader.new(isServer, customMt)
self.selectedFieldPlot:setVisible(false)
self.selectedFieldPlot:setBrightColor(true)

self.heapPlot = HeapPlot(g_currentMission.inGameMenu.ingameMap)
self.heapPlot:setVisible(false)
--TODO 25 self.heapPlot = HeapPlot(g_currentMission.inGameMenu.ingameMap)
--TODO 25 self.heapPlot:setVisible(false)
self.heapNode = CpUtil.createNode("siloNode", 0, 0, 0, nil)

--- Giants unload
Expand Down Expand Up @@ -138,7 +138,7 @@ end
--- Called when parameters change, scan field
function CpAIJobCombineUnloader:validate(farmId)
self.selectedFieldPlot:setVisible(false)
self.heapPlot:setVisible(false)
--TODO 25 self.heapPlot:setVisible(false)
local isValid, errorMessage = CpAIJob.validate(self, farmId)
if not isValid then
return isValid, errorMessage
Expand Down Expand Up @@ -220,9 +220,9 @@ function CpAIJobCombineUnloader:validate(farmId)
setTranslation(self.heapNode, x, 0, z)
setRotation(self.heapNode, 0, angle, 0)
local found, heapSilo = BunkerSiloManagerUtil.createHeapBunkerSilo(vehicle, self.heapNode, 0, self.maxHeapLength, -10)
if found then
self.heapPlot:setArea(heapSilo:getArea())
self.heapPlot:setVisible(true)
if found then
--TODO 25 self.heapPlot:setArea(heapSilo:getArea())
--TODO 25 self.heapPlot:setVisible(true)
end
end

Expand All @@ -233,7 +233,7 @@ function CpAIJobCombineUnloader:draw(map, isOverviewMap)
CpAIJob.draw(self, map, isOverviewMap)
if not isOverviewMap then
self.selectedFieldPlot:draw(map)
self.heapPlot:draw(map)
--TODO 25 self.heapPlot:draw(map)
end
end

Expand Down
28 changes: 14 additions & 14 deletions scripts/ai/jobs/CpAIJobSiloLoader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ CpAIJobSiloLoader.MAX_UNLOAD_TARGET_DISTANCE_FROM_SILO = 180
function CpAIJobSiloLoader.new(isServer, customMt)
local self = CpAIJob.new(isServer, customMt or AIJobCombineUnloaderCp_mt)

self.heapPlot = HeapPlot(g_currentMission.inGameMenu.ingameMap)
self.heapPlot:setVisible(false)
--TODO 25 self.heapPlot = HeapPlot(g_currentMission.inGameMenu.ingameMap)
--TODO 25 self.heapPlot:setVisible(false)

self.trailerAreaPlot = HeapPlot(g_currentMission.inGameMenu.ingameMap)
--TODO 25 self.trailerAreaPlot = HeapPlot(g_currentMission.inGameMenu.ingameMap)


self.heapNode = CpUtil.createNode("siloNode", 0, 0, 0, nil)
Expand Down Expand Up @@ -101,8 +101,8 @@ function CpAIJobSiloLoader:setValues()
if bunkerSilo then
self.bunkerSilo = bunkerSilo
elseif heapSilo then
self.heapPlot:setArea(heapSilo:getArea())
self.heapPlot:setVisible(true)
--TODO 25 self.heapPlot:setArea(heapSilo:getArea())
--TODO 25 self.heapPlot:setVisible(true)
self.heap = heapSilo
end
self.siloLoaderTask:setSiloAndHeap(self.bunkerSilo, self.heap)
Expand All @@ -112,8 +112,8 @@ end

--- Called when parameters change, scan field
function CpAIJobSiloLoader:validate(farmId)
self.heapPlot:setVisible(false)
self.trailerAreaPlot:setVisible(false)
--TODO 25 self.heapPlot:setVisible(false)
--TODO 25 self.trailerAreaPlot:setVisible(false)
self.heap = nil
self.bunkerSilo = nil
self.unloadStation = nil
Expand All @@ -136,8 +136,8 @@ function CpAIJobSiloLoader:validate(farmId)
if bunkerSilo then
self.bunkerSilo = bunkerSilo
elseif heapSilo then
self.heapPlot:setArea(heapSilo:getArea())
self.heapPlot:setVisible(true)
--TODO 25 self.heapPlot:setArea(heapSilo:getArea())
--TODO 25 self.heapPlot:setVisible(true)
self.heap = heapSilo
end
self.siloLoaderTask:setSiloAndHeap(self.bunkerSilo, self.heap)
Expand Down Expand Up @@ -175,9 +175,9 @@ function CpAIJobSiloLoader:validate(farmId)
else
local found, area, validDistanceToSilo = CpAIJobSiloLoader.getTrailerUnloadArea(
self.cpJobParameters.unloadPosition, self.bunkerSilo or self.heap)
if found then
self.trailerAreaPlot:setVisible(true)
self.trailerAreaPlot:setArea(area)
if found then
--TODO 25 self.trailerAreaPlot:setVisible(true)
--TODO 25 self.trailerAreaPlot:setArea(area)
end
if not validDistanceToSilo then
return false, g_i18n:getText("CP_error_unload_target_to_far_away_from_silo")
Expand Down Expand Up @@ -324,7 +324,7 @@ end
function CpAIJobSiloLoader:draw(map, isOverviewMap)
CpAIJob.draw(self, map, isOverviewMap)
if not isOverviewMap then
self.heapPlot:draw(map)
--TODO 25 self.heapPlot:draw(map)
g_bunkerSiloManager:drawSilos(map, self.bunkerSilo)
if self.cpJobParameters.unloadAt:getValue() == CpSiloLoaderJobParameters.UNLOAD_TRIGGER then
local fillTypes = self:getConvertedFillTypes()
Expand All @@ -335,7 +335,7 @@ function CpAIJobSiloLoader:draw(map, isOverviewMap)
g_triggerManager:drawDischargeableTriggers(map, self.unloadTrigger, fillTypes)
else
--- Drawing trailer area
self.trailerAreaPlot:draw(map)
--TODO 25 self.trailerAreaPlot:draw(map)
end
end
end
Expand Down
18 changes: 9 additions & 9 deletions scripts/ai/parameters/AIParameterSettingList.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ function AIParameterSettingList:init(data, vehicle, class)
if next(data.values) ~=nil then
--- The setting has values defined in the data, so we copy these here.
--- This saves the unmodified values in the data table.
self.values = table.copy(data.values)
self.texts = table.copy(data.texts)
self.values = table.clone(data.values)
self.texts = table.clone(data.texts)
elseif data.min ~= nil and data.max ~=nil then
--- The setting has a min and max value,
--- so we generate a series of float values and texts here.
Expand All @@ -25,17 +25,17 @@ function AIParameterSettingList:init(data, vehicle, class)
AIParameterSettingList.generateValues(self, self.data.values, self.data.texts,
data.min, data.max, data.incremental, data.unit, data.precision)
--- Same as above, make sure the values are copied.
self.values = table.copy(self.data.values)
self.values = table.clone(self.data.values)
if self.data.texts ~= nil then
self.texts = table.copy(self.data.texts)
self.texts = table.clone(self.data.texts)
end
data.textInputAllowed = true
elseif data.generateValuesFunction then
--- A generation function by the parent class is used
--- to enrich/create the setting values/texts.
self.data.values, self.data.texts = self:getCallback(data.generateValuesFunction)
self.values = table.copy(self.data.values)
self.texts = table.copy(self.data.texts)
self.values = table.clone(self.data.values)
self.texts = table.clone(self.data.texts)
self:validateTexts()
end
--- Text input is only allowed, when the settings values are numeric.
Expand All @@ -50,7 +50,7 @@ function AIParameterSettingList:init(data, vehicle, class)
--- Fallback text generation based on the numeric values and a optional given unit.
self.data.texts = {}
AIParameterSettingList.enrichTexts(self, self.data.texts, data.unit)
self.texts = table.copy(self.data.texts)
self.texts = table.clone(self.data.texts)
end
--- Lastly apply the default values here.
if data.default ~=nil then
Expand Down Expand Up @@ -474,8 +474,8 @@ end

--- Resets the disabled values back to the orignal value table
function AIParameterSettingList:resetValuesBackToSetupValues()
self.values = table.copy(self.data.values)
self.texts = table.copy(self.data.texts)
self.values = table.clone(self.data.values)
self.texts = table.clone(self.data.texts)
end

--- Gets a specific value.
Expand Down
2 changes: 1 addition & 1 deletion scripts/gui/CpAIFrameExtended.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function CpInGameMenuAIFrameExtended:onAIFrameLoadMapFinished()

CpInGameMenuAIFrameExtended.setupButtons(self)

self:registerControls({"multiTextOptionPrefab","subTitlePrefab","courseGeneratorLayoutElements",
self:exposeControlsAsFields({"multiTextOptionPrefab","subTitlePrefab","courseGeneratorLayoutElements",
"courseGeneratorLayout","courseGeneratorHeader","drawingCustomFieldHeader", "drawingCustomFieldSubHeader",
"courseGeneratorFrame", "createCpMultiOptionTemplate", "createCpTextTemplate"})

Expand Down
2 changes: 1 addition & 1 deletion scripts/gui/CpCourseManagerFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ local CpCourseManagerFrame_mt = Class(CpCourseManagerFrame, TabbedMenuFrameEleme

function CpCourseManagerFrame.new(courseStorage, target, custom_mt)
local self = TabbedMenuFrameElement.new(target, custom_mt or CpCourseManagerFrame_mt)
self:registerControls(CpCourseManagerFrame.CONTROLS)
self:exposeControlsAsFields(CpCourseManagerFrame.CONTROLS)
self.courseStorage = courseStorage
return self
end
Expand Down
4 changes: 2 additions & 2 deletions scripts/gui/CpGamePadHudScreen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ local CpGamePadHudScreen_mt = Class(CpGamePadHudScreen, ScreenElement)

function CpGamePadHudScreen.new(settings, target, custom_mt)
local self = ScreenElement.new(target, custom_mt or CpGamePadHudScreen_mt)
self:registerControls(CpGamePadHudScreen.CONTROLS)
self:exposeControlsAsFields(CpGamePadHudScreen.CONTROLS)
self.settings = settings
return self
end
Expand All @@ -39,7 +39,7 @@ function CpGamePadHudScreen:onGuiSetupFinished()

self.clearButton:unlinkElement()
FocusManager:removeElement(self.clearButton)
self.clearButton:setText(g_i18n:getText("CP_courseManager_clear_current_courses"))
-- TODO 25 (didn't we just remove this button above?) self.clearButton:setText(g_i18n:getText("CP_courseManager_clear_current_courses"))

self.backButton:unlinkElement()
FocusManager:removeElement(self.backButton)
Expand Down
2 changes: 1 addition & 1 deletion scripts/gui/CpGlobalSettingsFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ local CpGlobalSettingsFrame_mt = Class(CpGlobalSettingsFrame, TabbedMenuFrameEle

function CpGlobalSettingsFrame.new(target, custom_mt)
local self = TabbedMenuFrameElement.new(target, custom_mt or CpGlobalSettingsFrame_mt)
self:registerControls(CpGlobalSettingsFrame.CONTROLS)
self:exposeControlsAsFields(CpGlobalSettingsFrame.CONTROLS)
return self
end

Expand Down
2 changes: 1 addition & 1 deletion scripts/gui/CpGuiUtil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function CpGuiUtil.fixInGameMenuPage(frame, pageName, uvs, position, predicateFu
inGameMenu.controlIDs[v] = nil
end

inGameMenu:registerControls({pageName})
inGameMenu:exposeControlsAsFields({pageName})
inGameMenu[pageName] = frame
inGameMenu.pagingElement:addElement(inGameMenu[pageName])

Expand Down
2 changes: 1 addition & 1 deletion scripts/gui/CpVehicleSettingsFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ local CpVehicleSettingsFrame_mt = Class(CpVehicleSettingsFrame, TabbedMenuFrameE

function CpVehicleSettingsFrame.new(target, custom_mt)
local self = TabbedMenuFrameElement.new(target, custom_mt or CpVehicleSettingsFrame_mt)
self:registerControls(CpVehicleSettingsFrame.CONTROLS)
self:exposeControlsAsFields(CpVehicleSettingsFrame.CONTROLS)
return self
end

Expand Down
2 changes: 1 addition & 1 deletion scripts/gui/hud/CpBaseHud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ function CpBaseHud:init(vehicle)
--- Create start/stop button
local onOffBtnWidth, height = getNormalizedScreenValues(20, 20)
local onOffIndicatorOverlay = CpGuiUtil.createOverlay({onOffBtnWidth, height},
{g_baseUIFilename, GuiUtils.getUVs(MixerWagonHUDExtension.UV.RANGE_MARKER_ARROW)},
{g_baseUIFilename, GuiUtils.getUVs(self.uvs.streetDriveToSymbol)}, --TODO 25
self.OFF_COLOR,
self.alignments.bottomRight)
self.onOffButton = CpHudButtonElement.new(onOffIndicatorOverlay, self.baseHud)
Expand Down
6 changes: 4 additions & 2 deletions scripts/specializations/CpCourseGeneratorSettings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ function CpCourseGeneratorSettings:onLoad(savegame)
--- Register the spec: spec_cpCourseGeneratorSettings
self.spec_cpCourseGeneratorSettings = self["spec_" .. CpCourseGeneratorSettings.SPEC_NAME]
local spec = self.spec_cpCourseGeneratorSettings
spec.gui = g_currentMission.inGameMenu.pageAI
-- TODO 25
-- spec.gui = g_currentMission.inGameMenu.pageAI
--- Clones the generic settings to create different settings containers for each vehicle.
CpSettingsUtil.cloneSettingsTable(spec,CpCourseGeneratorSettings.settings,self,CpCourseGeneratorSettings)

Expand Down Expand Up @@ -246,7 +247,8 @@ end
---@param callbackStr string event to be raised
---@param setting AIParameterSettingList setting that raised the callback.
function CpCourseGeneratorSettings:raiseCallback(callbackStr, setting, ...)
SpecializationUtil.raiseEvent(self, callbackStr, setting, ...)
-- TODO 25 event is registered by the HUD which is now disabled
--TODO 25 SpecializationUtil.raiseEvent(self, callbackStr, setting, ...)
end

function CpCourseGeneratorSettings:raiseDirtyFlag(setting)
Expand Down
2 changes: 1 addition & 1 deletion scripts/specializations/CpCourseManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function CpCourseManager:onLoad(savegame)
--- Register the spec: spec_cpCourseManager
self.spec_cpCourseManager = self["spec_" .. CpCourseManager.SPEC_NAME]
local spec = self.spec_cpCourseManager
spec.coursePlot = CoursePlot(g_currentMission.inGameMenu.ingameMap)
-- TODO 25 spec.coursePlot = CoursePlot(g_currentMission.inGameMenu.ingameMap)

spec.courses = {}

Expand Down
Loading