Skip to content

Commit

Permalink
v1.2.8.8
Browse files Browse the repository at this point in the history
- add compat with FS22_KommunalServices
- minor gui enhancements
  • Loading branch information
Mmtrx committed Jul 30, 2024
1 parent 6d1bd20 commit f0ee646
Show file tree
Hide file tree
Showing 15 changed files with 71 additions and 18 deletions.
7 changes: 6 additions & 1 deletion betterContracts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
-- v1.2.8.7 02.12.2023 npc should not work before noon of first day in month (#187)
-- new setting "hardLimit": limit jobs per farm and month (#168)
-- new setting "multRewardMow" for baling contracts (#199)
-- v1.2.8.8 08.07.2024 compatibility with FS22_KommunalServices (#233)
--=======================================================================================================
SC = {
FERTILIZER = 1, -- prices index
Expand Down Expand Up @@ -177,6 +178,9 @@ function catMissionTypes(self)
addMapping("roll","helpLine_ImproveYield_Rolling", SC.SIMPLE) -- roller mission by tn4799
addMapping("lime","helpLine_ImproveYield_Liming", SC.SPREAD) -- lime mission by Mmtrx
addMapping("chaff","bc_jobType_chaff", SC.HARVEST) -- chaff mission by Mmtrx
if self.kommunal then
addMapping("kommunal","fieldJob_jobType_kommunal", SC.OTHER) -- kommunal mission by SMI modding
end
for _, missionType in pairs(g_missionManager.missionTypes) do
if self.typeToCat[missionType.typeId] == nil then
addMapping(missionType.name, SC.OTHER) -- default category for not registered mission types
Expand All @@ -197,6 +201,7 @@ function checkOtherMods(self)
FS22_TransportMissions = "transportMission",
FS22_LimeMission = "limeMission",
FS22_MaizePlus = "maizePlus",
FS22_KommunalServices = "kommunal",
}
for mod, switch in pairs(mods) do
if g_modIsLoaded[mod] then
Expand Down Expand Up @@ -510,8 +515,8 @@ function BetterContracts:initialize()
weed = 0.9,
lime = 0.9
}
catMissionTypes(self) -- init self.typeToCat[]
checkOtherMods(self)
catMissionTypes(self) -- init self.typeToCat[]
registerXML(self) -- register xml: self.xmlSchema

-- to show our ingame menu settings page when admin logs in:
Expand Down
4 changes: 3 additions & 1 deletion l10n/l10n_br.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
<text name="bc_discount" text=" (%d%% desconto)" />
<text name="bc_discValue" text="%s concede a você %d %% desconto para futuras compras de campo." />
<!-- Display texts -->
<text name="bc_mowed" text="Mowed:" />
<text name="bc_tomow" text="To mow:" />
<text name="bc_chaff" text="Cut %s" />
<text name="bc_jobType_chaff" text="Forage" />
<text name="bc_harvest" text="Colheita de:" />
<text name="bc_harvest" text="Colheita de %s:" />
<text name="bc_leased" text="Alugado " />
<text name="bc_enoughMissions" text="Sua fazenda já tem o número máximo de contratos." />
<text name="bc_monthlyLimit" text="Your farm has reached the maximum number of contracts for this month." />
Expand Down
4 changes: 3 additions & 1 deletion l10n/l10n_cs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
<text name="bc_detailsOn" text="开启详情" />

<!-- Display texts -->
<text name="bc_mowed" text="Mowed:" />
<text name="bc_tomow" text="To mow:" />
<text name="bc_chaff" text="Cut %s" />
<text name="bc_jobType_chaff" text="饲料" />
<text name="bc_harvest" text="收割" />
<text name="bc_harvest" text="收割 %s" />
<text name="bc_leased" text="/租借" />
<text name="bc_enoughMissions" text="你的农场承接的合同已达到最大数量。 " />
<text name="bc_jobsCompleted" text="完成的工作:%d" />
Expand Down
4 changes: 3 additions & 1 deletion l10n/l10n_cz.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
<text name="bc_discValue" text="%s vám poskytne %d %% slevu na budoucí nákupy polí." />

<!-- Display texts -->
<text name="bc_mowed" text="Mowed:" />
<text name="bc_tomow" text="To mow:" />
<text name="bc_chaff" text="Řezání %s" />
<text name="bc_jobType_chaff" text="Řezanka" />
<text name="bc_harvest" text="Skliz. " />
<text name="bc_harvest" text="Skliz. %s" />
<text name="bc_leased" text="/ Nájem " />
<text name="bc_enoughMissions" text="Vaše farma již má maximální počet zakázek." />
<text name="bc_monthlyLimit" text="Vaše farma dosáhla maximálního počtu zakázek pro tento měsíc." />
Expand Down
4 changes: 3 additions & 1 deletion l10n/l10n_da.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
<text name="bc_detailsOn" text="Detaljer til" />

<!-- Display texts -->
<text name="bc_mowed" text="Mowed:" />
<text name="bc_tomow" text="To mow:" />
<text name="bc_chaff" text="Cut %s" />
<text name="bc_jobType_chaff" text="Forage" />
<text name="bc_harvest" text="Høst. " />
<text name="bc_harvest" text="Høst. %s" />
<text name="bc_leased" text="/ Leaset " />
<text name="bc_enoughMissions" text="Din gård har allerede maximum af kontrakter." />
<text name="bc_jobsCompleted" text="Jobs færdige: %d" />
Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<text name="bc_detailsOn" text="Details an" />

<!-- Display texts -->
<text name="bc_mowed" text="Gemäht:" />
<text name="bc_tomow" text="Zu mähen:" />
<text name="bc_chaff" text="Häcksle %s" />
<text name="bc_jobType_chaff" text="Häckseln" />
<text name="bc_harvest" text="Ernte %s" />
Expand Down
4 changes: 3 additions & 1 deletion l10n/l10n_en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
<text name="bc_detailsOn" text="Details on" />

<!-- Display texts -->
<text name="bc_mowed" text="Mowed:" />
<text name="bc_tomow" text="To mow:" />
<text name="bc_chaff" text="Cut %s" />
<text name="bc_jobType_chaff" text="Forage" />
<text name="bc_harvest" text="Harv. " />
<text name="bc_harvest" text="Harv. %s" />
<text name="bc_leased" text="/ Leased " />
<text name="bc_enoughMissions" text="Your farm already has the maximum number of contracts." />
<text name="bc_jobsCompleted" text="Jobs completed: %d" />
Expand Down
4 changes: 3 additions & 1 deletion l10n/l10n_fr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
<text name="bc_discValue" text="%s grants you %d %% discount for future field purchases." />

<!-- Display texts -->
<text name="bc_mowed" text="Mowed:" />
<text name="bc_tomow" text="To mow:" />
<text name="bc_chaff" text="Hachez %s" />
<text name="bc_jobType_chaff" text="Hacheuse" />
<text name="bc_harvest" text="Réco. " />
<text name="bc_harvest" text="Réco. %s" />
<text name="bc_leased" text="/ Leased " />
<text name="bc_enoughMissions" text="Votre ferme a déjà maximum des contrats actifs." />
<text name="bc_monthlyLimit" text="Your farm has reached the maximum number of contracts for this month." />
Expand Down
4 changes: 3 additions & 1 deletion l10n/l10n_it.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
<text name="bc_discValue" text="%s grants you %d %% discount for future field purchases." />

<!-- Display texts -->
<text name="bc_mowed" text="Mowed:" />
<text name="bc_tomow" text="To mow:" />
<text name="bc_chaff" text="Cut %s" />
<text name="bc_jobType_chaff" text="Forage" />
<text name="bc_harvest" text="Harv. " />
<text name="bc_harvest" text="Harv. %s" />
<text name="bc_leased" text="/ Leased " />
<text name="bc_enoughMissions" text="Your farm already has the maximum number of contracts." />
<text name="bc_monthlyLimit" text="Your farm has reached the maximum number of contracts for this month." />
Expand Down
4 changes: 3 additions & 1 deletion l10n/l10n_jp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
<text name="bc_discValue" text="%s grants you %d %% discount for future field purchases." />

<!-- Display texts -->
<text name="bc_harvest" text="Harv. " />
<text name="bc_mowed" text="Mowed:" />
<text name="bc_tomow" text="To mow:" />
<text name="bc_harvest" text="Harv. %s" />
<text name="bc_leased" text="/ Leased " />
<text name="bc_enoughMissions" text="Your farm already has the maximum number of contracts." />
<text name="bc_monthlyLimit" text="Your farm has reached the maximum number of contracts for this month." />
Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_pl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<text name="bc_detailsOn" text="Szczegóły wł." />

<!-- Display texts -->
<text name="bc_mowed" text="Mowed:" />
<text name="bc_tomow" text="To mow:" />
<text name="bc_chaff" text="Zetnij %s" />
<text name="bc_jobType_chaff" text="Sieczka qq" />
<text name="bc_harvest" text="Zbiór %s" />
Expand Down
4 changes: 3 additions & 1 deletion l10n/l10n_ru.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
<text name="bc_detailsOn" text="Детали вкл." />

<!-- Display texts -->
<text name="bc_mowed" text="Mowed:" />
<text name="bc_tomow" text="To mow:" />
<text name="bc_chaff" text="Скосить %s" />
<text name="bc_jobType_chaff" text="Заготовка корма" />
<text name="bc_harvest" text="Собр. " />
<text name="bc_harvest" text="Собр. %s" />
<text name="bc_leased" text="/Аренд. техника " />
<text name="bc_enoughMissions" text="Ваша ферма уже имеет максимальное количество контрактов." />
<text name="bc_jobsCompleted" text="Выполненные контракты: %d" />
Expand Down
10 changes: 6 additions & 4 deletions modDesc.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<modDesc descVersion="79">
<modDesc descVersion="80">
<author>Mmtrx</author>
<version>1.2.8.7</version>
<version>1.2.8.8</version>
<title>
<en>Better Contracts</en>
</title>
Expand All @@ -24,7 +24,8 @@ Disclaimer: All values shown in details display are ESTIMATES. You should not ta
The mod keeps track of the amount of contracts you completed for each of the NPC farmers (number of completed jobs is displayed below the farmers image, if "Details" on). If you enable the optional discount mode or hard mode options (on the mods settings page), the amount of completed jobs influence gameplay.
Changelog v1.2.8.7
Changelog v1.2.8.8
- compatibility with FS22_KommunalServices (#233)
- lazy NPCs should not work before noon of first day in month (#187)
- new setting: limit jobs per farm and month (#168)
- add bcPrintVehicles console command
Expand Down Expand Up @@ -123,7 +124,8 @@ Warnung: Alle in der Detailanzeige angegebenen Werte sind GESCHÄTZT. Sie sollte
Die Mod merkt sich die Anzahl Verträge, die Sie für jeden der NPC Farmer abgeschlossen haben (die Zahl wird unter dem Bild des Farmers angezeigt, wenn "Details" an ist). Wenn der optionale Discount Modus oder der Hard Modus aktiviert wird, beeinflusst die Anzahl abgeschlossener Jobs das Spielgeschehen.
Changelog v1.2.8.7
Changelog v1.2.8.8
- Kompatibilität mit FS22_KommunalServices (#233)
- lazy NPCs fangen am ersten Tag des Monats erst mittags an zu arbeiten (#187)
- neue Einstellung: Maximalzahl der Verträge pro Farm und Monat (#168)
- bcPrintVehicles console command
Expand Down
28 changes: 24 additions & 4 deletions scripts/gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
-- v1.2.7.5 26.02.2023 display other farms active contracts (MP only)
-- v1.2.7.6 21.03.2023 format rewd values > 100.000 (issue #113)
-- v1.2.8.0 03.08.2023 Sort per NPC and contract value
-- v1.2.8.8 07.07.2024 compatibility with FS22_KommunalServices (#233)
--=======================================================================================================

--- Adds a new page to the in game menu.
Expand Down Expand Up @@ -112,8 +113,6 @@ function loadGuiFile(self, fname, parent, initial)
-- load gui from file, attach to parent, call initial func
if fileExists(fname) then
xmlFile = loadXMLFile("Temp", fname)
local fbox = self.frCon.farmerBox
-- load our "npcbox" as child of farmerBox:
g_gui:loadGuiRec(xmlFile, "GUI", parent, self.frCon)
initial(parent)
delete(xmlFile)
Expand Down Expand Up @@ -319,7 +318,19 @@ function detailsButtonCallback(inGameMenu)
local s, i = frCon.contractsList:getSelectedPath()
frCon:updateDetailContents(s, i)
end

--[[
function updateDetailContents(self, section, index)
-- appended to InGameMenuContractsFrame:updateDetailContents, to set npcbox invisible for finished contracts
local contract = nil
local sectionContracts = self.sectionContracts[section]
if sectionContracts ~= nil then
contract = sectionContracts.contracts[index]
end
if contract ~= nil and contract.finished then
BetterContracts.my.npcbox:setVisible(false)
end
end
]]
function makeCon(m)
local missionInfo = m:getData()
return {
Expand Down Expand Up @@ -648,14 +659,23 @@ function updateFarmersBox(frCon, field, npc)
self.my.line5:setText(g_i18n:getText("SC_price"))
self.my.price:setText(g_i18n:formatMoney(c.price))
return
elseif cat == SC.OTHER then -- platinum mission types
elseif cat == SC.OTHER then
-- platinum mission types
self.my.field:setText("")
self.my.line5:setText("")
self.my.price:setText("")
self.my.line4a:setText("")
self.my.valu4a:setText("")
self.my.line4b:setText("")
self.my.valu4b:setText("")
if m.type.name == "kommunal" then
self.my.line4b:setText(g_i18n:getText("bc_tomow"))
self.my.valu4b:setText(g_i18n:formatArea((m.area_tot - m.area_trimmed)/1000,3))
if cont.active then
self.my.line4a:setText(g_i18n:getText("bc_mowed"))
self.my.valu4a:setText(g_i18n:formatArea(m.area_trimmed/1000, 3))
end
end
return
end

Expand Down
4 changes: 4 additions & 0 deletions scripts/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ function updateDetails(self, section, index)
if contract == nil then return end
local mission = contract.mission

if contract.finished then
bc.my.npcbox:setVisible(false) -- remove our npcbox
end

-- hard Mode: vehicle lease cost also for canceled mission
if bc.config.hardMode and contract.finished and not mission.success then
local lease, penal = 0, 0
Expand Down

0 comments on commit f0ee646

Please sign in to comment.