--
-- By HmcrE
--

print("register fruit type: water");

local waterhudFile = Utils.getFilename("mods/Map_Fruits/waterHud.png", getUserProfileAppPath());
FruitUtil.registerFruitType("water", false, false, false, 0, 0.005, 1.01, 1, 1, waterhudFile);

local origLoadStatsFromXML = QuickPlayMenu.loadStatsFromXML;

QuickPlayMenu.loadStatsFromXML = function(self, baseXMLName, savegame)
    origLoadStatsFromXML(self, baseXMLName, savegame);
    for i = 1, FruitUtil.NUM_FRUITTYPES do
        if savegame.stats.farmSiloFruitAmount[i] == 0 then
            savegame.stats.farmSiloFruitAmount[i] = 15000;
		end;
        if savegame.stats.fruitPrices[i] == nil then
            savegame.stats.fruitPrices[i] = FruitUtil.fruitIndexToDesc[i].pricePerLiter;
        end;
        if savegame.stats.yesterdaysFruitPrices[i] == nil then
            savegame.stats.yesterdaysFruitPrices[i] = FruitUtil.fruitIndexToDesc[i].yesterdaysPrice;
        end;
    end;
end;




