-- rye
print("register fruit type: rye");
local ryehudFile = Utils.getFilename("mods/Birchwood_v2/map/huds/ryeHud.dds", getUserProfileAppPath());
--						        (string name, bool needsSeeding, bool allowsSeeding, bool useSeedingWidth, float directionSnapAngle, int minHarvestingGrowthState, int maxHarvestingGrowthState, int cutState, bool allowsPartialGrowthState, float pricePerLiter, float literPerSqm, float seedUsagePerSqm, bool partOfEconomy, string hudOverlayFilename, float4 fruitMapColor)
FruitUtil.registerFruitType("rye", g_i18n:getText("rye"), true, true, false, 0, 4, 6, 8, 0, 0.1, 1.5, 0.1, true, ryehudFile, {0.8, 0.1, 0.3, 1});	
FruitUtil.registerFruitTypeWindrow(FruitUtil.FRUITTYPE_RYE, "wheat_windrow", g_i18n:getText("straw"), 0.04, 3, true, "dataS2/missions/hud_fill_straw.png");	
	
local origSowingMachineLoad = SowingMachine.load;
local orig TrailerLoad =  Trailer.load;

SowingMachine.load = function (self, xmlFile)
	if origSowingMachineLoad ~= nil then
		origSowingMachineLoad(self, xmlFile);
	end;
	
	for k,v in pairs(self.seeds) do  
		fruitTypeDesc = FruitUtil.fruitTypes["wheat"];  -- selectedSeedFruitType = "wheat" etc.. 
		if v == fruitTypeDesc.index then
			table.insert(self.seeds, FruitUtil.fruitTypes["rye"].index);
		end;
	end;

	--[[
	self.seeds = {};
	local i = 1;
    for k, fruitType in pairs(FruitUtil.fruitTypes) do
        if fruitType.allowsSeeding then
            self.seeds[i] = fruitType.index;
			i = i + 1;
        end;
    end;	]]--
end;