Skip to content

Commit

Permalink
ai status message bug fix and position adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
schwiti6190 committed Dec 21, 2024
1 parent 667eaab commit e9cbb77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
5 changes: 4 additions & 1 deletion config/gui/pages/CourseGeneratorFrame.xml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
<Text profile="fs25_shopBalance" text="$l10n_ui_balance:" />
<Text profile="fs25_shopMoney" id="currentBalanceText" />
</BoxLayout> -->
<Text profile="fs25_ingameMenuAIStatusText" id="statusMessage" />
<Text profile="cpAIStatusText" id="statusMessage" />
</GuiElement>
<GuiElement profile="fs25_mapContextBoxContainer" newLayer="true">
<GuiElement profile="fs25_mapContextBox" id="contextBox">
Expand Down Expand Up @@ -317,5 +317,8 @@
<iconBgColor value="$preset_fs25_colorMainHighlight" />
<iconBgHighlightedColor value="$preset_fs25_colorMainHighlight" />
</Profile>
<Profile name="cpAIStatusText" extends="fs25_ingameMenuAIStatusText" with="anchorTopRight">
<position value="-300px 0px" />
</Profile>
</GUIProfiles>
</GUI>
11 changes: 5 additions & 6 deletions scripts/gui/pages/CpCourseGeneratorFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -310,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)
Expand Down Expand Up @@ -1236,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
Expand Down

0 comments on commit e9cbb77

Please sign in to comment.