Skip to content

Commit

Permalink
v1.2.8.0
Browse files Browse the repository at this point in the history
- Sort per NPC and contract value.
- Allow Göweil mission bales (#144)
- Allow mowers/ swathers on harvest missions. Tweak plow reward (#137)
  • Loading branch information
Mmtrx committed Aug 3, 2023
1 parent bb8051d commit a5920f6
Show file tree
Hide file tree
Showing 17 changed files with 157 additions and 65 deletions.
30 changes: 27 additions & 3 deletions betterContracts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
-- let player instant-ferment wrapped bales
-- v1.2.7.9 21.04.2023 Allow 240er PackedBales as mission bales, i.e. insta ferment.
-- Add 240er bales to Kuhn sw4014 wrapper
-- v1.2.8.0 03.08.2023 Sort per NPC and contract value. Allow Göweil mission bales.
-- Allow mowers/ swathers on harvest missions. Tweak plow reward (#137)
--=======================================================================================================
SC = {
FERTILIZER = 1, -- prices index
Expand Down Expand Up @@ -103,7 +105,7 @@ SC = {
valu6 = "valu6",
valu7 = "valu7",
sort = "sort",
sortcat = "sortcat",
sortcat = "sortcat", "sortrev", "sortnpc",
sortprof = "sortprof",
sortpmin = "sortpmin",
helpsort = "helpsort",
Expand Down Expand Up @@ -391,7 +393,7 @@ function initGui(self)
self.my[name] = self.frCon.contractBox:getDescendantById(name)
end
-- set callbacks for our 3 sort buttons
for _, name in ipairs({"sortcat", "sortprof", "sortpmin"}) do
for _, name in ipairs({"sortcat", "sortrev", "sortnpc", "sortprof", "sortpmin"}) do
self.my[name].onClickCallback = onClickSortButton
self.my[name].onHighlightCallback = onHighSortButton
self.my[name].onHighlightRemoveCallback = onRemoveSortButton
Expand Down Expand Up @@ -473,6 +475,8 @@ function BetterContracts:initialize()
self.lastSort = 0 -- last sorted status
self.buttons = {
{"sortcat", g_i18n:getText("SC_sortCat")}, -- {button id, help text}
{"sortrev", g_i18n:getText("SC_sortRev")},
{"sortnpc", g_i18n:getText("SC_sortNpc")},
{"sortprof", g_i18n:getText("SC_sortProf")},
{"sortpmin", g_i18n:getText("SC_sortpMin")}
}
Expand All @@ -490,11 +494,21 @@ function BetterContracts:initialize()

-- to show our ingame menu settings page when admin logs in:
Utility.appendedFunction(InGameMenuMultiplayerUsersFrame,"onAdminLoginSuccess",adminMP)

-- to allow forage wagon on bale missions:
Utility.overwrittenFunction(BaleMission, "new", baleMissionNew)
-- to allow MOWER / SWATHER on harvest missions:
Utility.overwrittenFunction(HarvestMission, "new", harvestMissionNew)

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

-- allow stationary baler to produce mission bales:
local pType = g_vehicleTypeManager:getTypeByName("pdlc_goeweilPack.balerStationary")
if pType ~= nil then
SpecializationUtil.registerOverwrittenFunction(pType, "createBale", self.createBale)
end

-- to count and save/load # of jobs per farm per NPC
Utility.appendedFunction(AbstractFieldMission,"finish",finish)
Utility.appendedFunction(FarmStats,"saveToXMLFile",saveToXML)
Expand Down Expand Up @@ -574,6 +588,9 @@ function BetterContracts:onMissionInitialize(baseDirectory, missionCollaborators
end

function BetterContracts:onSetMissionInfo(missionInfo, missionDynamicInfo)
PlowMission.REWARD_PER_HA = 2800 -- tweak plow reward (#137)

-- setup new / clear buttons for contracts page:
Utility.overwrittenFunction(g_currentMission.inGameMenu, "onClickMenuExtra1", onClickMenuExtra1)
Utility.overwrittenFunction(g_currentMission.inGameMenu, "onClickMenuExtra2", onClickMenuExtra2)
end
Expand Down Expand Up @@ -962,9 +979,16 @@ function adminMP(self)
BetterContracts.gameMenu:updatePages()
end
function baleMissionNew(isServer, superf, isClient, customMt )
-- allow forage wagons to collect grass/ hay, for baling/wrapping at stationary baler
local self = superf(isServer, isClient, customMt)
self.workAreaTypes[WorkAreaType.FORAGEWAGON] = true
self.workAreaTypes[WorkAreaType.CUTTER] = true
-- allow forage wagons to collect grass/ hay, for baling/wrapping at stationary baler
return self
end
function harvestMissionNew(isServer, superf, isClient, customMt )
-- allow mower/ swather to harvest swaths
local self = superf(isServer, isClient, customMt)
self.workAreaTypes[WorkAreaType.MOWER] = true
self.workAreaTypes[WorkAreaType.FORAGEWAGON] = true
return self
end
16 changes: 9 additions & 7 deletions gui/SCGui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@
<GuiElement type="text" profile="betterContractsRight" id="valu6" position="100px 75px" />
<GuiElement type="text" profile="betterContractsRight" id="valu7" position="100px 42px" />
<!-- Sort buttons -->
<GuiElement type="empty" id="sortbox" profile="SeeContSortbox" size="305px 45px" position="3px 0px" anchors="1 1 0 0" >
<GuiElement type="boxLayout" profile="ingameMenuMapFilterButtonBox" id="layout" size="120px 42px" position="0px -18px" >
<GuiElement type="button" profile="SeeContsortCat" id="sortcat" />
<GuiElement type="button" profile="SeeContsortProf" id="sortprof" />
<GuiElement type="button" profile="SeeContsortpMin" id="sortpmin" />
<GuiElement type="empty" id="sortbox" profile="BCSortbox" size="305px 45px" position="3px 0px" anchors="1 1 0 0" >
<GuiElement type="boxLayout" profile="ingameMenuMapFilterButtonBox" id="layout" size="200px 42px" position="0px -18px" >
<GuiElement type="button" profile="BCsortCat" id="sortcat" />
<GuiElement type="button" profile="BCsortRev" id="sortrev" />
<GuiElement type="button" profile="BCsortNpc" id="sortnpc" />
<GuiElement type="button" profile="BCsortProf" id="sortprof" />
<GuiElement type="button" profile="BCsortpMin" id="sortpmin" />
</GuiElement>
<GuiElement type="text" profile="betterContractsLeft" id="sort" position="5px 0px" text="$l10n_SC_sort" debugEnabled="false"/>
<GuiElement type="text" profile="betterContractsRight" id="helpsort" size="125px 40px" position="55px 0px" text="" debugEnabled="false"/>
<GuiElement type="text" profile="betterContractsLeft" id="sort" position="5px 18px" text="$l10n_SC_sort" debugEnabled="false"/>
<GuiElement type="text" profile="betterContractsLeft" id="helpsort" size="125px 40px" position="5px -2px" text="" debugEnabled="false"/>
</GuiElement>
</GuiElement>

Expand Down
22 changes: 15 additions & 7 deletions gui/guiProfiles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@
</Profile>

<!-- Sortbox Frame - - - - - - - - - - - - - - - - - - - - - -->
<Profile name="SeeContSortbox" extends="emptyPanel">
<Profile name="BCSortbox" extends="emptyPanel">
<Value name="hasFrame" value="true" />
<Value name="frameThickness" value="0 1px 1px 0dp" />
<Value name="frameTopColor" value="$preset_colorMainUI" />
<Value name="frameRightColor" value="$preset_colorMainUI" />
</Profile>
<!-- Sortbox Buttons - - - - - - - - - - - - - - - - - - - - - -->
<Profile name="SeeContsortCat" extends="buttonBase">
<Profile name="BCsortCat" extends="buttonBase">
<Value name="handleFocus" value="true" />
<Value name="size" value="39px 39px" />
<Value name="iconSize" value="40px 40px" />
Expand All @@ -80,16 +80,24 @@
<Value name="onHighlight" value="onHighlightCallback" />
<Value name="onHighlightRemove" value="onHighlightRemoveCallback" />
</Profile>
<Profile name="SeeContsortProf" extends="SeeContsortCat">
<Profile name="BCsortRev" extends="BCsortCat">
<Value name="iconUVs" value="384px 336px 48px 48px" />
</Profile>
<Profile name="BCsortNpc" extends="BCsortCat">
<Value name="iconUVs" value="336px 96px 48px 48px" />
</Profile>
<Profile name="BCsortProf" extends="BCsortCat">
<Value name="iconUVs" value="0px 288px 48px 48px" />
</Profile>
<Profile name="SeeContsortpMin" extends="SeeContsortCat">
<Profile name="BCsortpMin" extends="BCsortCat">
<Value name="iconUVs" value="768px 288px 48px 48px" />
</Profile>

<Profile name="SeeContactiveCat" extends="SeeContsortCat" with="buttonActive" />
<Profile name="SeeContactiveProf" extends="SeeContsortProf" with="buttonActive" />
<Profile name="SeeContactivepMin" extends="SeeContsortpMin" with="buttonActive" />
<Profile name="BCactiveCat" extends="BCsortCat" with="buttonActive" />
<Profile name="BCactiveRev" extends="BCsortRev" with="buttonActive" />
<Profile name="BCactiveNpc" extends="BCsortNpc" with="buttonActive" />
<Profile name="BCactiveProf" extends="BCsortProf" with="buttonActive" />
<Profile name="BCactivepMin" extends="BCsortpMin" with="buttonActive" />

<!-- Filterbox Buttons - - - - - - - - - - - - - - - - - - - - - -->
<Profile name="myFilterOptionPage" extends="emptyPanel" with="anchorMiddleLeft">
Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_br.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@

<!-- Sort button help text -->
<text name="SC_sortCat" text="Tipo de missão" />
<text name="SC_sortRev" text="revenue" />
<text name="SC_sortNpc" text="farmer" />
<text name="SC_sortProf" text="Lucro líquido" />
<text name="SC_sortpMin" text="Lucro por minuto" />

Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_cs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@

<!-- Sort button help text -->
<text name="SC_sortCat" text="任务类型" />
<text name="SC_sortRev" text="revenue" />
<text name="SC_sortNpc" text="farmer" />
<text name="SC_sortProf" text="净利润" />
<text name="SC_sortpMin" text="每分钟利润" />

Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_cz.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

<!-- Sort button help text -->
<text name="SC_sortCat" text="Typ mise" />
<text name="SC_sortRev" text="revenue" />
<text name="SC_sortNpc" text="farmer" />
<text name="SC_sortProf" text="Čistý zisk" />
<text name="SC_sortpMin" text="Zisk za minutu" />

Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_da.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@

<!-- Sort button help text -->
<text name="SC_sortCat" text="Kontrakt type" />
<text name="SC_sortRev" text="revenue" />
<text name="SC_sortNpc" text="farmer" />
<text name="SC_sortProf" text="netto profit" />
<text name="SC_sortpMin" text="profit per minut" />

Expand Down
4 changes: 3 additions & 1 deletion l10n/l10n_de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@

<!-- Sort button help text -->
<text name="SC_sortCat" text="Missionstyp" />
<text name="SC_sortRev" text="Vertragswert" />
<text name="SC_sortNpc" text="Auftraggeber" />
<text name="SC_sortProf" text="Nettoprofit" />
<text name="SC_sortpMin" text="Profit pro Minute" />
<text name="SC_sortpMin" text="Profit/min" />

<!-- progress bars -->
<text name="bc_progField" text="Fortschritt Feld" />
Expand Down
4 changes: 3 additions & 1 deletion l10n/l10n_en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@

<!-- Sort button help text -->
<text name="SC_sortCat" text="mission type" />
<text name="SC_sortRev" text="revenue" />
<text name="SC_sortNpc" text="farmer" />
<text name="SC_sortProf" text="net profit" />
<text name="SC_sortpMin" text="profit per minute" />
<text name="SC_sortpMin" text="profit/min" />

<!-- Settings Page -->
<text name="bc_settingsPage_title" text="Contract Settings" />
Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_fr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

<!-- Sort button help text -->
<text name="SC_sortCat" text="Type / champ" />
<text name="SC_sortRev" text="revenue" />
<text name="SC_sortNpc" text="farmer" />
<text name="SC_sortProf" text="Profit net" />
<text name="SC_sortpMin" text="Profit par minute" />

Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_it.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

<!-- Sort button help text -->
<text name="SC_sortCat" text="mission type/ fieldnumber" />
<text name="SC_sortRev" text="revenue" />
<text name="SC_sortNpc" text="farmer" />
<text name="SC_sortProf" text="net profit" />
<text name="SC_sortpMin" text="profit per minute" />

Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_jp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

<!-- Sort button help text -->
<text name="SC_sortCat" text="作業別" />
<text name="SC_sortRev" text="revenue" />
<text name="SC_sortNpc" text="farmer" />
<text name="SC_sortProf" text="純利益" />
<text name="SC_sortpMin" text="分利益" />

Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_pl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

<!-- Sort button help text -->
<text name="SC_sortCat" text="Typ kontraktu/Nr pola" />
<text name="SC_sortRev" text="revenue" />
<text name="SC_sortNpc" text="farmer" />
<text name="SC_sortProf" text="Zysk netto" />
<text name="SC_sortpMin" text="Zysk na minutę" />

Expand Down
2 changes: 2 additions & 0 deletions l10n/l10n_ru.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@

<!-- Sort button help text -->
<text name="SC_sortCat" text="Тип работ/№ поля" />
<text name="SC_sortRev" text="revenue" />
<text name="SC_sortNpc" text="farmer" />
<text name="SC_sortProf" text="Чистая прибыль" />
<text name="SC_sortpMin" text="Доход в мин." />

Expand Down
11 changes: 8 additions & 3 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="75">
<author>Mmtrx</author>
<version>1.2.7.9</version>
<version>1.2.8.0</version>
<title>
<en>Better Contracts</en>
</title>
Expand All @@ -24,7 +24,12 @@ 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.7.9
Changelog v1.2.8.0
- Tweak plow reward. Sort per NPC and contract value (#137)
- Allow mowers/ swathers on harvest missions (#137)
- Allow Göweil mission bales (#144)
Changelog v1.2.7.9
- Allow 240er PackedBales as mission bales, i.e. insta ferment (needs mod arcusin Multipack D14) (#131)
- Add 240er bales to Kuhn sw4014 wrapper
Expand Down Expand Up @@ -107,7 +112,7 @@ 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.7.9
Changelog v1.2.7.9
- Gepackte 240er Ballen können mit dem im Mod enthaltenen arcusin Multipack D14 nun auch bei Gras-Missionen verwendet werden (#131)
- Kuhn sw4014 Ballenwickler (im Mod) verarbeitet auch gepackte 240er Ballen
Expand Down
Loading

0 comments on commit a5920f6

Please sign in to comment.