Skip to content

Commit

Permalink
v1.2.8.3
Browse files Browse the repository at this point in the history
- Force plow after root crop harvest (#123).
- Insta-ferment separate setting (#158)
  • Loading branch information
Mmtrx committed Oct 9, 2023
1 parent 5f5c73e commit fa0d9ef
Show file tree
Hide file tree
Showing 16 changed files with 96 additions and 20 deletions.
6 changes: 6 additions & 0 deletions betterContracts.lua
Expand Up @@ -62,6 +62,7 @@
-- Allow mowers/ swathers on harvest missions. Tweak plow reward (#137)
-- v1.2.8.1 17.08.2023 save NPC farmland owners to farmland.xml (#153).
-- v1.2.8.2 22.09.2023 support chaff mission. Insta-ferment only in debug mode (#158)
-- v1.2.8.3 10.10.2023 force plow after root crop harvest (#123). Insta-ferment separate setting (#158)
--=======================================================================================================
SC = {
FERTILIZER = 1, -- prices index
Expand Down Expand Up @@ -423,6 +424,8 @@ function BetterContracts:initialize()
self.initialized = false
self.config = {
debug = false, -- debug mode
ferment = false, -- allow insta-fermenting wrapped bales by player
forcePlow = false, -- force plow after root crop harvest
maxActive = 3, -- max active contracts
multReward = 1., -- general reward multiplier
multLease = 1., -- general lease cost multiplier
Expand Down Expand Up @@ -503,6 +506,9 @@ function BetterContracts:initialize()
-- to allow MOWER / SWATHER on harvest missions:
Utility.overwrittenFunction(HarvestMission, "new", harvestMissionNew)

-- to allow MOWER / SWATHER on harvest missions:
Utility.prependedFunction(HarvestMission, "completeField", harvestCompleteField)

-- to set missionBale for packed 240cm bales:
Utility.overwrittenFunction(Bale, "loadBaleAttributesFromXML", loadBaleAttributes)

Expand Down
6 changes: 5 additions & 1 deletion l10n/l10n_br.xml
Expand Up @@ -4,7 +4,7 @@
<!-- Keys -->
<text name = "input_MENU_EXTRA_3" text = "Melhores contratos: Detalhes Ligado/Desligado"/>
<text name = "input_BC_MTOGGLE" text = "BC: Toggle display of active farm contracts"/>
<text name = "bc_ferment" text = "Ferment Bale"/>
<text name = "bc_actionFerment" text = "Ferment Bale"/>
<!-- Gui Buttons -->
<text name="bc_hidden" text="Oculto: %d" />
<text name="bc_other" text="Outros" />
Expand Down Expand Up @@ -75,6 +75,10 @@
<text name="bc_maxActive_tooltip" text="Número máximo de contratos ativos simultaneamente." />
<text name="bc_refreshMP" text="Lista de contratos de permissões" />
<text name="bc_refreshMP_tooltip" text="Quem pode deletar/atualizar contratos em um jogo MP." />
<text name="bc_ferment" text="Insta-Fermenting" />
<text name="bc_ferment_tooltip" text="Allows player to insta-ferment a wrapped grass bale from the F1 menu." />
<text name="bc_forcePlow" text="Root Crop Plowing" />
<text name="bc_forcePlow_tooltip" text="Every harvest of corn/ potato/ sugarbeet requires subsequent plowing." />
<text name="bc_debug" text="Modo de depuração" />
<text name="bc_debug_tooltip" text="Imprime mensagens informativas no log, se ativo. Pode ajudar a encontrar bugs." />

Expand Down
6 changes: 5 additions & 1 deletion l10n/l10n_cs.xml
Expand Up @@ -4,7 +4,7 @@
<!-- Keys -->
<text name = "input_MENU_EXTRA_3" text = "更好的合同:开启/关闭详情"/>
<text name = "input_BC_MTOGGLE" text = "BC: Toggle display of active farm contracts"/>
<text name = "bc_ferment" text = "Ferment Bale"/>
<text name = "bc_actionFerment" text = "Ferment Bale"/>
<!-- Gui Buttons -->
<text name="bc_hidden" text="隐藏的:%d" />
<text name="bc_other" text="其他" />
Expand Down Expand Up @@ -76,6 +76,10 @@
<text name="bc_maxActive_tooltip" text="同时生效的合同的最大数量。" />
<text name="bc_refreshMP" text="合同权限列表" />
<text name="bc_refreshMP_tooltip" text="谁可以在多人游戏中删除/刷新合同。" />
<text name="bc_ferment" text="Insta-Fermenting" />
<text name="bc_ferment_tooltip" text="Allows player to insta-ferment a wrapped grass bale from the F1 menu." />
<text name="bc_forcePlow" text="Root Crop Plowing" />
<text name="bc_forcePlow_tooltip" text="Every harvest of corn/ potato/ sugarbeet requires subsequent plowing." />
<text name="bc_debug" text="Debug模式" />
<text name="bc_debug_tooltip" text="打印信息到日志。可以帮助寻找Bug。" />

Expand Down
6 changes: 5 additions & 1 deletion l10n/l10n_cz.xml
Expand Up @@ -4,7 +4,7 @@
<!-- Keys -->
<text name = "input_MENU_EXTRA_3" text = "Vylepšené zakázky: Detaily zap/vyp"/>
<text name = "input_BC_MTOGGLE" text = "BC: Přepnout zobrazení aktivních zakázek farmy"/>
<text name = "bc_ferment" text = "Kvašené balíky"/>
<text name = "bc_actionFerment" text = "Kvašené balíky"/>
<!-- Gui Buttons -->
<text name="bc_hidden" text="Skryté: %d" />
<text name="bc_other" text="Další" />
Expand Down Expand Up @@ -76,6 +76,10 @@
<text name="bc_maxActive_tooltip" text="Maximální počet současně aktivních zakázek." />
<text name="bc_refreshMP" text="Seznam práv pro zakázky" />
<text name="bc_refreshMP_tooltip" text="Kdo může mazat/obnovovat smlouvy ve hře MP." />
<text name="bc_ferment" text="Insta-Fermenting" />
<text name="bc_ferment_tooltip" text="Allows player to insta-ferment a wrapped grass bale from the F1 menu." />
<text name="bc_forcePlow" text="Root Crop Plowing" />
<text name="bc_forcePlow_tooltip" text="Every harvest of corn/ potato/ sugarbeet requires subsequent plowing." />
<text name="bc_debug" text="Vývojářský mód" />
<text name="bc_debug_tooltip" text="Vytiskne informační zprávy do protokolu, pokud je aktivní. Může pomoci najít chyby." />

Expand Down
6 changes: 5 additions & 1 deletion l10n/l10n_da.xml
Expand Up @@ -4,7 +4,7 @@
<!-- Keys -->
<text name = "input_MENU_EXTRA_3" text = "Better Contracts: Detaljer til/fra"/>
<text name = "input_BC_MTOGGLE" text = "BC: Skift visning af aktive gård kontrakter"/>
<text name = "bc_ferment" text = "Fermenter Balle"/>
<text name = "bc_actionFerment" text = "Fermenter Balle"/>
<!-- Gui Buttons -->
<text name="bc_hidden" text="Skjulte: %d" />
<text name="bc_other" text="Andre" />
Expand Down Expand Up @@ -79,6 +79,10 @@
<text name="bc_toDeliver_tooltip" text="Procent af den beregnet total udbytte du skal levere for at færdiggøre en høst kontrakt." />
<text name="bc_refreshMP" text="Kontrakt liste tilladelser" />
<text name="bc_refreshMP_tooltip" text="Hvem kan slette / opdatere kontrakter i et MP game." />
<text name="bc_ferment" text="Insta-Fermenting" />
<text name="bc_ferment_tooltip" text="Allows player to insta-ferment a wrapped grass bale from the F1 menu." />
<text name="bc_forcePlow" text="Root Crop Plowing" />
<text name="bc_forcePlow_tooltip" text="Every harvest of corn/ potato/ sugarbeet requires subsequent plowing." />
<text name="bc_debug" text="Debug Mode" />
<text name="bc_debug_tooltip" text="Printer info beskeder til log vis aaktiv. Kan hjælpe med at finde bugs." />

Expand Down
6 changes: 5 additions & 1 deletion l10n/l10n_de.xml
Expand Up @@ -4,7 +4,7 @@
<!-- Keys -->
<text name = "input_MENU_EXTRA_3" text = "BC: Details an/aus"/>
<text name = "input_BC_MTOGGLE" text = "BC: Anzeige aktiver Farm-Verträge an/aus"/>
<text name = "bc_ferment" text = "Ballen fermentieren"/>
<text name = "bc_actionFerment" text = "Ballen fermentieren"/>
<!-- Gui Buttons -->
<text name="bc_hidden" text="Ausgeblendet: %d" />
<text name="bc_other" text="Sonstige" />
Expand Down Expand Up @@ -79,6 +79,10 @@
<text name="bc_toDeliver_tooltip" text="Pozentsatz des theoretisch möglichen Ertrags, der zur Erfüllung eines Erntevertrags abgeliefert werden muss." />
<text name="bc_refreshMP" text="Berechtigung Vertragsliste" />
<text name="bc_refreshMP_tooltip" text="Wer in einem MP-Spiel Verträge löschen/ erzeugen darf" />
<text name="bc_ferment" text="Insta-Gären" />
<text name="bc_ferment_tooltip" text="Der Spieler kann einen gewickelten Grasballen sofort fertig gären (F1 menu)." />
<text name="bc_forcePlow" text="Wurzelfrüchte pflügen" />
<text name="bc_forcePlow_tooltip" text="Nach jeder Ernte von Mais/ Kartoffeln/ Rüben muss das Feld gepflügt werden." />
<text name="bc_debug" text="Debug Modus" />
<text name="bc_debug_tooltip" text="Wenn aktiviert, werden Info Meldungen in die Log-Datei geschrieben. Kann bei der Fehlersuche helfen." />

Expand Down
8 changes: 6 additions & 2 deletions l10n/l10n_en.xml
Expand Up @@ -4,7 +4,7 @@
<!-- Keys -->
<text name = "input_MENU_EXTRA_3" text = "Better Contracts: Details on/off"/>
<text name = "input_BC_MTOGGLE" text = "BC: Toggle display of active farm contracts"/>
<text name = "bc_ferment" text = "Ferment Bale"/>
<text name = "bc_actionFerment" text = "Ferment Bale"/>
<!-- Gui Buttons -->
<text name="bc_hidden" text="Hidden: %d" />
<text name="bc_other" text="Other" />
Expand Down Expand Up @@ -79,7 +79,11 @@
<text name="bc_toDeliver_tooltip" text="Percentage of the estimated total yield you must deliver to complete a harvest contract." />
<text name="bc_refreshMP" text="Permission contracts list" />
<text name="bc_refreshMP_tooltip" text="Who can delete / refresh contracts in an MP game." />
<text name="bc_debug" text="Debug Modus" />
<text name="bc_ferment" text="Insta-Fermenting" />
<text name="bc_ferment_tooltip" text="Allows player to insta-ferment a wrapped grass bale from the F1 menu." />
<text name="bc_forcePlow" text="Root Crop Plowing" />
<text name="bc_forcePlow_tooltip" text="Every harvest of corn/ potato/ sugarbeet requires subsequent plowing." />
<text name="bc_debug" text="Debug Mode" />
<text name="bc_debug_tooltip" text="Prints info messages to the log if active. Can help to find bugs." />

<text name="bc_lazyNPC" text="Lazy Farmers" />
Expand Down
6 changes: 5 additions & 1 deletion l10n/l10n_fr.xml
Expand Up @@ -4,7 +4,7 @@
<!-- Keys -->
<text name = "input_MENU_EXTRA_3" text = "Better Contracts: Sans/avec détails"/>
<text name = "input_BC_MTOGGLE" text = "BC: Toggle display of active farm contracts"/>
<text name = "bc_ferment" text = "Ferment Bale"/>
<text name = "bc_actionFerment" text = "Ferment Bale"/>
<!-- Gui Buttons -->
<text name="bc_hidden" text="Caché: %d" />
<text name="bc_other" text="L'autre" />
Expand Down Expand Up @@ -76,6 +76,10 @@
<text name="bc_maxActive_tooltip" text="Max number of concurrently active contracts." />
<text name="bc_refreshMP" text="Permission contracts list" />
<text name="bc_refreshMP_tooltip" text="Who can delete / refresh contracts in an MP game." />
<text name="bc_ferment" text="Insta-Fermenting" />
<text name="bc_ferment_tooltip" text="Allows player to insta-ferment a wrapped grass bale from the F1 menu." />
<text name="bc_forcePlow" text="Root Crop Plowing" />
<text name="bc_forcePlow_tooltip" text="Every harvest of corn/ potato/ sugarbeet requires subsequent plowing." />
<text name="bc_debug" text="Debug Modus" />
<text name="bc_debug_tooltip" text="Prints info messages to the log if active. Can help to find bugs." />

Expand Down
6 changes: 5 additions & 1 deletion l10n/l10n_it.xml
Expand Up @@ -3,7 +3,7 @@
<texts>
<!-- Keys -->
<text name = "input_MENU_EXTRA_3" text = "Better Contracts: Détails on/off"/>
<text name = "bc_ferment" text = "Ferment Bale"/>
<text name = "bc_actionFerment" text = "Ferment Bale"/>
<text name = "input_BC_MTOGGLE" text = "BC: Toggle display of active farm contracts"/>
<!-- Gui Buttons -->
<text name="bc_hidden" text="Hidden: %d" />
Expand Down Expand Up @@ -76,6 +76,10 @@
<text name="bc_maxActive_tooltip" text="Max number of concurrently active contracts." />
<text name="bc_refreshMP" text="Permission contracts list" />
<text name="bc_refreshMP_tooltip" text="Who can delete / refresh contracts in an MP game." />
<text name="bc_ferment" text="Insta-Fermenting" />
<text name="bc_ferment_tooltip" text="Allows player to insta-ferment a wrapped grass bale from the F1 menu." />
<text name="bc_forcePlow" text="Root Crop Plowing" />
<text name="bc_forcePlow_tooltip" text="Every harvest of corn/ potato/ sugarbeet requires subsequent plowing." />
<text name="bc_debug" text="Debug Modus" />
<text name="bc_debug_tooltip" text="Prints info messages to the log if active. Can help to find bugs." />

Expand Down
6 changes: 5 additions & 1 deletion l10n/l10n_jp.xml
Expand Up @@ -4,7 +4,7 @@
<!-- Keys -->
<text name = "input_MENU_EXTRA_3" text = "契約詳細表示切替"/>
<text name = "input_BC_MTOGGLE" text = "BC: Toggle display of active farm contracts"/>
<text name = "bc_ferment" text = "Ferment Bale"/>
<text name = "bc_actionFerment" text = "Ferment Bale"/>
<!-- Gui Buttons -->
<text name="bc_hidden" text="Hidden: %d" />
<text name="bc_other" text="Other" />
Expand Down Expand Up @@ -76,6 +76,10 @@
<text name="bc_maxActive_tooltip" text="Max number of concurrently active contracts." />
<text name="bc_refreshMP" text="Permission contracts list" />
<text name="bc_refreshMP_tooltip" text="Who can delete / refresh contracts in an MP game." />
<text name="bc_ferment" text="Insta-Fermenting" />
<text name="bc_ferment_tooltip" text="Allows player to insta-ferment a wrapped grass bale from the F1 menu." />
<text name="bc_forcePlow" text="Root Crop Plowing" />
<text name="bc_forcePlow_tooltip" text="Every harvest of corn/ potato/ sugarbeet requires subsequent plowing." />
<text name="bc_debug" text="Debug Modus" />
<text name="bc_debug_tooltip" text="Prints info messages to the log if active. Can help to find bugs." />

Expand Down
6 changes: 5 additions & 1 deletion l10n/l10n_pl.xml
Expand Up @@ -4,7 +4,7 @@
<!-- Keys -->
<text name="input_MENU_EXTRA_3" text="Better Contracts: Szczegóły wł./wył."/>
<text name="input_BC_MTOGGLE" text="BC: Przełącz wyświetlanie aktywnych kontraktów rolniczych"/>
<text name="bc_ferment" text="Fermentacja bel"/>
<text name="bc_actionFerment" text="Fermentacja bel"/>
<!-- Gui Buttons -->
<text name="bc_hidden" text="Ukrytych: %d" />
<text name="bc_other" text="Inny" />
Expand Down Expand Up @@ -76,6 +76,10 @@
<text name="bc_maxActive_tooltip" text="Maksymalna liczba jednocześnie aktywnych umów." />
<text name="bc_refreshMP" text="Lista umów do usunięcia/odświeżenia" />
<text name="bc_refreshMP_tooltip" text="Kto może usuwać/odświeżać umowy w grze wieloosobowej." />
<text name="bc_ferment" text="Insta-Fermenting" />
<text name="bc_ferment_tooltip" text="Allows player to insta-ferment a wrapped grass bale from the F1 menu." />
<text name="bc_forcePlow" text="Root Crop Plowing" />
<text name="bc_forcePlow_tooltip" text="Every harvest of corn/ potato/ sugarbeet requires subsequent plowing." />
<text name="bc_debug" text="Tryb debugowania" />
<text name="bc_debug_tooltip" text="Jeśli aktywny, wyświetla informacje debugowania w logach. Może pomóc w znalezieniu błędów." />

Expand Down
6 changes: 5 additions & 1 deletion l10n/l10n_ru.xml
Expand Up @@ -4,7 +4,7 @@
<!-- Keys -->
<text name = "input_MENU_EXTRA_3" text = "Better Contracts: Детали вкл./выкл."/>
<text name = "input_BC_MTOGGLE" text = "BC: Переключить отображение активных контрактов ферм"/>
<text name = "bc_ferment" text = "Ферментировать тюк"/>
<text name = "bc_actionFerment" text = "Ферментировать тюк"/>
<!-- Gui Buttons -->
<text name="bc_hidden" text="Скрыто: %d" />
<text name="bc_other" text="Другое" />
Expand Down Expand Up @@ -75,6 +75,10 @@
<text name="bc_maxActive_tooltip" text="Максимальное количество одновременно активных контрактов." />
<text name="bc_refreshMP" text="Управляющий контрактами в МП" />
<text name="bc_refreshMP_tooltip" text="Кто может удалять/обновлять контракты в сетевой игре." />
<text name="bc_ferment" text="Insta-Fermenting" />
<text name="bc_ferment_tooltip" text="Allows player to insta-ferment a wrapped grass bale from the F1 menu." />
<text name="bc_forcePlow" text="Root Crop Plowing" />
<text name="bc_forcePlow_tooltip" text="Every harvest of corn/ potato/ sugarbeet requires subsequent plowing." />
<text name="bc_debug" text="Режим отладки" />
<text name="bc_debug_tooltip" text="Информационные сообщения в журнале, если активировано. Может помочь найти ошибки." />

Expand Down
12 changes: 6 additions & 6 deletions modDesc.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<modDesc descVersion="75">
<modDesc descVersion="77">
<author>Mmtrx</author>
<version>1.2.8.2</version>
<version>1.2.8.3</version>
<title>
<en>Better Contracts</en>
</title>
Expand All @@ -24,9 +24,9 @@ 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.2
Changelog v1.2.8.3
- Force plow after root crop harvest (#123). Insta-ferment separate setting (#158)
- Save NPC farmland owners to farmland.xml (#153).
- Insta-ferment only in debug mode (#158)
- Support chaff mission
Changelog v1.2.8.0
Expand Down Expand Up @@ -117,9 +117,9 @@ 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.2
Changelog v1.2.8.3
- Wurzelfrüchte erfordern Pflügen (#123). Schnell-gären als separates Setting (#158)
- NPC Farmland-Besitzer speichern, damit nach Restart ein Feld noch den selben Besitzer hat (#153).
- Schnell-gären nur noch im debug mode (#158)
- Unterstützung für Häckselaufträge (FS22_ChaffMissions)
Changelog v1.2.8.0
Expand Down
11 changes: 11 additions & 0 deletions scripts/options.lua
Expand Up @@ -16,6 +16,7 @@
-- v1.2.7.2 12.02.2023 icon for roller missions. Don't show negative togos
-- v1.2.7.3 20.02.2023 double progress bar active contracts. Fix PnH BGA/ Maize+
-- v1.2.7.7 29.03.2023 add "off" values to hardMode settings
-- v1.2.8.3 10.10.2023 force plow after root crop harvest. Insta-ferment separate setting (#158)
--=======================================================================================================

--------------------- lazyNPC ---------------------------------------------------------------------------
Expand Down Expand Up @@ -569,3 +570,13 @@ function renderIcon(self, x, y, rot)
icon:render()
end
end

function harvestCompleteField(self)
-- prepended to HarvestMission:completeField()
if not BetterContracts.conf.forcePlow then return end

local ft = g_fruitTypeManager:getFruitTypeByIndex(self.field.fruitType)
if string.find("MAIZE POTATO SUGARBEET", ft.name) then
self.fieldPlowFactor = 0 -- force plowing after root crop harvest
end
end
15 changes: 15 additions & 0 deletions scripts/settings.lua
Expand Up @@ -9,6 +9,7 @@
-- v1.2.7.4 22.02.2023 increase range for "toDeliver". Add setting "toDeliverBale"
-- v1.2.7.7 29.03.2023 add "off" values to hardMode settings
-- v1.2.7.9 03.05.2023 more values discPerJob, discMaxJobs
-- v1.2.8.3 10.10.2023 force plow after root crop harvest. Insta-ferment separate setting (#158)
--=======================================================================================================
local function lazyNPCDisabled()
return not BetterContracts.config.lazyNPC
Expand Down Expand Up @@ -82,6 +83,20 @@ BCSettingsBySubtitle = {
isDisabledFunc = function()
return not g_currentMission.missionDynamicInfo.isMultiplayer end,
},
{name = "ferment",
values = {false, true},
texts = {"ui_off", "ui_on"},
default = 1,
title = "bc_ferment",
tooltip = "bc_ferment_tooltip",
},
{name = "forcePlow",
values = {false, true},
texts = {"ui_off", "ui_on"},
default = 1,
title = "bc_forcePlow",
tooltip = "bc_forcePlow_tooltip",
},
{name = "debug",
values = {false, true},
texts = {"ui_off", "ui_on"},
Expand Down
4 changes: 2 additions & 2 deletions scripts/userint.lua
Expand Up @@ -307,8 +307,8 @@ function BaleActivatable:getIsActivatable()
self.action = BC_Action.BC_CUT
return true
end
if BetterContracts.config.debug and self.bale:getIsFermenting() then
self.activateText = g_i18n:getText("bc_ferment")
if BetterContracts.config.ferment and self.bale:getIsFermenting() then
self.activateText = g_i18n:getText("bc_actionFerment")
self.action = BC_Action.BC_FERMENT
return true
end
Expand Down

0 comments on commit fa0d9ef

Please sign in to comment.