diff --git a/config/gui/CourseGeneratorSettingsFrame.xml b/config/gui/CourseGeneratorSettingsFrame.xml
deleted file mode 100644
index 859e51974..000000000
--- a/config/gui/CourseGeneratorSettingsFrame.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/config/gui/VehicleSettingsFrame.xml b/config/gui/VehicleSettingsFrame.xml
deleted file mode 100644
index 9f0b3e4eb..000000000
--- a/config/gui/VehicleSettingsFrame.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/config/gui/pages/CourseGeneratorFrame.xml b/config/gui/pages/CourseGeneratorFrame.xml
index 8275fdfdc..8ad7572bf 100644
--- a/config/gui/pages/CourseGeneratorFrame.xml
+++ b/config/gui/pages/CourseGeneratorFrame.xml
@@ -98,11 +98,11 @@
+ onClick="onClickList" visible="true" position="0px -165px" handleFocus="false">
-
+
-
+
@@ -311,5 +311,14 @@
+
+
+
+
+
+
+
+
+
diff --git a/scripts/gui/CpInGameMenu.lua b/scripts/gui/CpInGameMenu.lua
index 6087f4d4a..ee8f70026 100644
--- a/scripts/gui/CpInGameMenu.lua
+++ b/scripts/gui/CpInGameMenu.lua
@@ -207,8 +207,6 @@ function CpInGameMenu:setupMenuButtonInfo()
local onButtonBackFunction = self.clickBackCallback
local onButtonPagePreviousFunction = self:makeSelfCallback(self.onPagePrevious)
local onButtonPageNextFunction = self:makeSelfCallback(self.onPageNext)
-
-
self.backButtonInfo = {
inputAction = InputAction.MENU_BACK,
text = g_i18n:getText(InGameMenu.L10N_SYMBOL.BUTTON_BACK),
@@ -222,7 +220,6 @@ function CpInGameMenu:setupMenuButtonInfo()
text = g_i18n:getText("ui_ingameMenuPrev"),
callback = self.onPagePrevious }
-
self.defaultMenuButtonInfo = {
self.backButtonInfo,
self.nextPageButtonInfo,
@@ -232,11 +229,11 @@ function CpInGameMenu:setupMenuButtonInfo()
self.defaultMenuButtonInfoByActions[InputAction.MENU_BACK] = self.defaultMenuButtonInfo[1]
self.defaultMenuButtonInfoByActions[InputAction.MENU_PAGE_NEXT] = self.defaultMenuButtonInfo[2]
self.defaultMenuButtonInfoByActions[InputAction.MENU_PAGE_PREV] = self.defaultMenuButtonInfo[3]
+
self.defaultButtonActionCallbacks = {
[InputAction.MENU_BACK] = onButtonBackFunction,
[InputAction.MENU_PAGE_NEXT] = onButtonPageNextFunction,
- [InputAction.MENU_PAGE_PREV] = onButtonPagePreviousFunction
- }
+ [InputAction.MENU_PAGE_PREV] = onButtonPagePreviousFunction}
end
-- Lines 399-424
@@ -258,31 +255,8 @@ function CpInGameMenu:reset()
end
--- Lines 529-556
function CpInGameMenu:onMenuOpened()
- -- if self.playerFarmId == FarmManager.SPECTATOR_FARM_ID then
- -- self:setSoundSuppressed(true)
-
- -- local farmsPageId = self.pagingElement:getPageIdByElement(self.pageMultiplayerFarms)
- -- local farmsPageIndex = self.pagingElement:getPageMappingIndex(farmsPageId)
-
- -- self.pageSelector:setState(farmsPageIndex, true)
- -- self:setSoundSuppressed(false)
- -- end
-
- -- if GS_IS_MOBILE_VERSION then
- -- g_currentMission:setManualPause(true)
- -- end
-
- -- if self.currentPage.dynamicMapImageLoading ~= nil then
- -- if not self.currentPage.dynamicMapImageLoading:getIsVisible() then
- -- self.messageCenter:publish(MessageType.GUI_INGAME_OPEN)
- -- else
- -- self.sendDelayedOpenMessage = true
- -- end
- -- else
- -- self.messageCenter:publish(MessageType.GUI_INGAME_OPEN)
- -- end
+
end
function CpInGameMenu:onButtonBack()
@@ -294,7 +268,6 @@ function CpInGameMenu:onButtonBack()
CpInGameMenu:superClass().onButtonBack(self)
end
--- Lines 559-578
function CpInGameMenu:onClose(element)
CpInGameMenu:superClass().onClose(self)
self:unlockCurrentVehicle()
@@ -305,30 +278,23 @@ function CpInGameMenu:onOpen()
self:lockCurrentVehicle(CpUtil.getCurrentVehicle())
end
--- Lines 650-699
function CpInGameMenu:update(dt)
CpInGameMenu:superClass().update(self, dt)
end
--- Lines 820-823
function CpInGameMenu:onClickMenu()
self:exitMenu()
return true
end
--- Lines 844-866
function CpInGameMenu:onPageChange(pageIndex, pageMappingIndex, element, skipTabVisualUpdate)
-
CpInGameMenu:superClass().onPageChange(self, pageIndex, pageMappingIndex, element, skipTabVisualUpdate)
-
- -- self.header:applyProfile(self:getTabBarProfile())
self:updateBackground()
end
--- Lines 869-873
function CpInGameMenu:getPageButtonInfo(page)
local buttonInfo = CpInGameMenu:superClass().getPageButtonInfo(self, page)
@@ -357,137 +323,4 @@ function CpInGameMenu:onCurrentVehicleChanged()
local index = self.pagingElement:getPageMappingIndexByElement(prevPage)
self.pagingTabList:setSelectedIndex(index, true, 0)
end
-end
-
-
-CpInGameMenu.TAB_UV = {
- MAP = {
- 0,
- 0,
- 65,
- 65
- },
- AI = {
- 910,
- 65,
- 65,
- 65
- },
- CALENDAR = {
- 65,
- 0,
- 65,
- 65
- },
- WEATHER = {
- 130,
- 0,
- 65,
- 65
- },
- PRICES = {
- 195,
- 0,
- 65,
- 65
- },
- VEHICLES = {
- 260,
- 0,
- 65,
- 65
- },
- FINANCES = {
- 325,
- 0,
- 65,
- 65
- },
- ANIMALS = {
- 390,
- 0,
- 65,
- 65
- },
- CONTRACTS = {
- 455,
- 0,
- 65,
- 65
- },
- PRODUCTION = {
- 520,
- 0,
- 65,
- 65
- },
- STATISTICS = {
- 585,
- 0,
- 65,
- 65
- },
- GAME_SETTINGS = {
- 650,
- 0,
- 65,
- 65
- },
- GENERAL_SETTINGS = {
- 715,
- 0,
- 65,
- 65
- },
- CONTROLS_SETTINGS = {
- 845,
- 0,
- 65,
- 65
- },
- TOUR = {
- 780,
- 130,
- 65,
- 65
- },
- HELP = {
- 0,
- 65,
- 65,
- 65
- },
- FARMS = {
- 260,
- 65,
- 65,
- 65
- },
- USERS = {
- 650,
- 65,
- 65,
- 65
- }
-}
-CpInGameMenu.L10N_SYMBOL = {
- END_WITHOUT_SAVING = "ui_endWithoutSaving",
- BUTTON_SAVE_GAME = "button_saveGame",
- BUTTON_RESTART = "button_restart",
- SAVE_OVERWRITE = "dialog_savegameOverwrite",
- TUTORIAL_NOT_SAVED = "ui_tutorialIsNotSaved",
- END_GAME = "ui_youWantToQuitGame",
- SAVING_CONTENT = "ui_savingContent",
- SAVE_NO_SPACE = "ui_savegameSaveNoSpace",
- SELECT_DEVICE = "dialog_savegameSelectDevice",
- MASTER_SERVER_CONNECTION_LOST = "ui_masterServerConnectionLost",
- BUTTON_CANCEL_GAME = "button_cancelGame",
- END_TUTORIAL = "ui_endTutorial",
- NOT_SAVED = "ui_savegameNotSaved",
- SAVE_NO_DEVICE = "ui_savegameSaveNoDevice",
- BUTTON_BACK = "button_back"
-}
-CpInGameMenu.PROFILES = {
- TAB_BAR_DARK = "uiCpInGameMenuHeaderDark",
- TAB_BAR_LIGHT = "uiCpInGameMenuHeader"
-}
+end
\ No newline at end of file
diff --git a/scripts/gui/pages/CpCourseGeneratorFrame.lua b/scripts/gui/pages/CpCourseGeneratorFrame.lua
index 81a981006..8b1f0b422 100644
--- a/scripts/gui/pages/CpCourseGeneratorFrame.lua
+++ b/scripts/gui/pages/CpCourseGeneratorFrame.lua
@@ -146,6 +146,16 @@ function CpCourseGeneratorFrame:initialize(menu)
self.onClickBackCallback = menu.clickBackCallback
self:initializeContextActions()
+ self.generateCourseMenuButton = {
+ ["inputAction"] = InputAction.MENU_EXTRA_1,
+ ["text"] = g_i18n:getText("button_blocklist"),
+ ["callback"] = function()
+ -- upvalues: (copy) p_u_39
+ p_u_39:onButtonUnBan()
+ end
+ }
+
+
self.booleanPrefab:unlinkElement()
FocusManager:removeElement(self.booleanPrefab)
self.multiTextPrefab:unlinkElement()
@@ -300,13 +310,16 @@ function CpCourseGeneratorFrame:onFrameOpen()
if aiMessage ~= nil and job ~= nil and g_localPlayer ~= nil then
if job.startedFarmId == g_localPlayer.farmId then
local text = aiMessage:getMessage(job)
- self:addStatusMessage(text)
+ local releaseMessage= g_infoTextManager:getInfoTextDataByAIMessage(aiMessage)
+ if g_Courseplay.globalSettings.infoTextHudActive:getValue() == g_Courseplay.globalSettings.DISABLED or
+ not releaseMessage then
+ self:addStatusMessage(text)
+ end
end
end
end, self)
g_messageCenter:subscribe(MessageType.AI_JOB_REMOVED, function(self, jobId)
self.activeWorkerList:reloadData()
-
-- InGameMenuMapUtil.hideContextBox(self.contextBox)
end, self)
g_messageCenter:subscribe(MessageType.CP_INFO_TEXT_CHANGED, function (menu)
@@ -493,6 +506,7 @@ function CpCourseGeneratorFrame:updateCourseGenerator(visible, vehicle)
end
function CpCourseGeneratorFrame:updateSubCategoryPages(state)
+ self.menuButtonInfo = table.clone(self.cpMenu.defaultMenuButtonInfo)
for i, _ in ipairs(self.subCategoryPages) do
self.subCategoryPages[i]:setVisible(false)
self.subCategoryTabs[i]:setSelected(false)
@@ -507,11 +521,22 @@ function CpCourseGeneratorFrame:updateSubCategoryPages(state)
layout:invalidateLayout()
self.settingsSlider:setDataElement(layout)
FocusManager:setFocus(self.subCategoryPages[state])
+ table.insert(self.menuButtonInfo, {
+ inputAction = InputAction.MENU_EXTRA_2,
+ text = g_i18n:getText("CP_ai_page_generate_course"),
+ callback = function ()
+ if self.currentJob then
+ CpUtil.try(self.currentJob.onClickGenerateFieldWorkCourse, self.currentJob)
+ self:updateSubCategoryPages(self.CATEGRORIES.IN_GAME_MAP)
+ end
+ end})
+
else
self.settingsSliderBox:setVisible(false)
self.ingameMap:setVisible(true)
self:openMap()
end
+ self:setMenuButtonInfoDirty()
end
function CpCourseGeneratorFrame:delete()
@@ -1027,6 +1052,12 @@ function CpCourseGeneratorFrame:getNumberOfItemsInSection(list, section)
if self.mode ~= self.AI_MODE_CREATE then
return 0
end
+ for _, index in pairs(self.contextActionMapping) do
+ local action = self.contextActions[index]
+ if action.isActive and action.action then
+ g_inputBinding:registerActionEvent(action.action, self, action.callback, false, true, false, true)
+ end
+ end
return #self.contextActionMapping
elseif list == self.infoTextList then
self.activeInfoTexts = g_infoTextManager:getActiveInfoTexts()
@@ -1075,6 +1106,7 @@ function CpCourseGeneratorFrame:populateCellForItemInSection(list, section, inde
elseif list == self.createJobButtonList then
local buttonInfo = self.contextActions[self.contextActionMapping[index]]
cell:getAttribute("text"):setText(buttonInfo.text)
+ cell:getAttribute("button"):setInputAction(buttonInfo.action)
cell.onClickCallback = buttonInfo.callback
elseif list == self.infoTextList then
cell:getAttribute("text"):setText(self.activeInfoTexts[index].text)
@@ -1207,10 +1239,6 @@ function CpCourseGeneratorFrame:generateJobTypes()
end
function CpCourseGeneratorFrame:addStatusMessage(message)
- if g_Courseplay.globalSettings.infoTextHudActive:getValue() > 0 then
- --- Status Meldung werden als info text angezeigt ..
- return
- end
table.insert(self.statusMessages, {
removeTime = g_time + 5000,
text = message
@@ -1250,6 +1278,7 @@ function CpCourseGeneratorFrame:initializeContextActions()
},
[self.CONTEXT_ACTIONS.START_JOB] = {
text = g_i18n:getText("button_startJob"),
+ action = InputAction.MENU_EXTRA_1,
callback = self.onStartCancelJob,
isActive = false
},
@@ -1260,6 +1289,7 @@ function CpCourseGeneratorFrame:initializeContextActions()
},
[self.CONTEXT_ACTIONS.GENERATE_COURSE] = {
text = g_i18n:getText("CP_ai_page_generate_course"),
+ action = InputAction.MENU_EXTRA_2,
callback = function()
if self.currentJob then
CpUtil.try(self.currentJob.onClickGenerateFieldWorkCourse, self.currentJob)
@@ -1286,6 +1316,11 @@ function CpCourseGeneratorFrame:updateContextActions()
self.contextActions[self.CONTEXT_ACTIONS.START_JOB].isActive = self:getCanStartJob()
self.contextActions[self.CONTEXT_ACTIONS.STOP_JOB].isActive = self:getCanCancelJob() and self.mode ~= self.AI_MODE_CREATE
self.contextActions[self.CONTEXT_ACTIONS.GENERATE_COURSE].isActive = self:getCanGenerateFieldWorkCourse()
+ for _, action in ipairs(self.contextActions) do
+ if action.action then
+ g_inputBinding:removeActionEventsByActionName(action.action)
+ end
+ end
self.contextButtonList:reloadData()
self.createJobButtonList:reloadData()
end
diff --git a/scripts/gui/pages/CpCourseManagerFrame.lua b/scripts/gui/pages/CpCourseManagerFrame.lua
index 419a98f20..d807c59a7 100644
--- a/scripts/gui/pages/CpCourseManagerFrame.lua
+++ b/scripts/gui/pages/CpCourseManagerFrame.lua
@@ -111,6 +111,7 @@ function CpCourseManagerFrame:getCurrentEntry()
end
function CpCourseManagerFrame:initialize(menu)
+ self.cpMenu = menu
--- Changes the input actions.
self.modeButton = {
profile = "buttonActivate",
@@ -483,14 +484,7 @@ function CpCourseManagerFrame:updateMenuButtons()
local title = string.format(g_i18n:getText(self.translations.title), vehicle:getName(), courseName)
self.categoryHeaderText:setText(title)
- self.menuButtonInfo = {
- {
- inputAction = InputAction.MENU_BACK,
- }
- }
- if self.courseStorage:getCanIterateBackwards() then
- self.menuButtonInfo[1].callback = function () self:onClickIterateBack() end
- end
+ self.menuButtonInfo = table.clone(self.cpMenu.defaultMenuButtonInfo)
if self.activateButton.callbackDisabled == nil or not self.activateButton.callbackDisabled(self) then
table.insert(self.menuButtonInfo, self.activateButton)
end
@@ -509,6 +503,14 @@ function CpCourseManagerFrame:updateMenuButtons()
--self.rightToggleBtn:setText(text)
end
+function CpCourseManagerFrame:onClickBack()
+ if self.courseStorage:getCanIterateBackwards() then
+ self:onClickIterateBack()
+ return true
+ end
+ return false
+end
+
---------------------------------------------------
--- Menu button click callbacks
---------------------------------------------------
diff --git a/scripts/specializations/CpHud.lua b/scripts/specializations/CpHud.lua
index 0c1d1736e..648052c9d 100644
--- a/scripts/specializations/CpHud.lua
+++ b/scripts/specializations/CpHud.lua
@@ -116,22 +116,21 @@ function CpHud:onRegisterActionEvents(isActiveForInput, isActiveForInputIgnoreSe
--- callback, triggerUp, triggerDown, triggerAlways, startActive,
--- callbackState, customIconName, ignoreCollisions, reportAnyDeviceCollision)
if self:getCpSettings().openHudWithMouse:getValue() then
- local _, actionEventId = self:addActionEvent(spec.actionEvents, InputAction.CP_TOGGLE_MOUSE, self,
- CpHud.actionEventMouse, false, true, false, true, nil, nil, true)
- g_inputBinding:setActionEventTextPriority(actionEventId, GS_PRIO_NORMAL)
- g_inputBinding:setActionEventText(actionEventId, spec.openCloseText)
- g_inputBinding:setActionEventTextVisibility(actionEventId,
- g_Courseplay.globalSettings.showActionEventHelp:getValue())
- end
- if self.isActiveForInputIgnoreSelectionIgnoreAI then
local _, actionEventId = self:addActionEvent(spec.actionEvents,
- InputAction.CP_OPEN_CLOSE_VEHICLE_SETTING_DISPLAY, self,
- CpHud.actionEventMouse, false, true, false, true, nil)
- g_inputBinding:setActionEventTextPriority(actionEventId, GS_PRIO_HIGH)
+ InputAction.CP_TOGGLE_MOUSE, self,
+ CpHud.actionEventMouse, false, true, false, true, nil, nil, true)
+ g_inputBinding:setActionEventTextPriority(actionEventId, GS_PRIO_NORMAL)
g_inputBinding:setActionEventText(actionEventId, spec.openCloseText)
g_inputBinding:setActionEventTextVisibility(actionEventId,
g_Courseplay.globalSettings.showActionEventHelp:getValue())
end
+ local _, actionEventId = self:addActionEvent(spec.actionEvents,
+ InputAction.CP_OPEN_CLOSE_VEHICLE_SETTING_DISPLAY, self,
+ CpHud.actionEventMouse, false, true, false, true, nil)
+ g_inputBinding:setActionEventTextPriority(actionEventId, GS_PRIO_HIGH)
+ g_inputBinding:setActionEventText(actionEventId, spec.openCloseText)
+ g_inputBinding:setActionEventTextVisibility(actionEventId,
+ g_Courseplay.globalSettings.showActionEventHelp:getValue())
end
end
end