Esempio n. 1
0
        private static void OnDumpFinished(bool success, bool playerCancel, float progress)
        {
            //MelonLoader.MelonLogger.Log("Dump Finished");
            LiquidItem liquidItem = WaterButtons.currentLiquidItemShowing;
            float      lostLiters = liquidItem.m_LiquidLiters * progress;

            if (liquidItem.m_LiquidQuality == LiquidQuality.Potable)             // Potable water
            {
                WaterSupply potableWaterSupply = GameManager.GetInventoryComponent().GetPotableWaterSupply().m_WaterSupply;
                Water.ShowLostMessage(potableWaterSupply, "GAMEPLAY_WaterPotable", lostLiters);
            }
            else             // NonPotable water
            {
                WaterSupply nonPotableWaterSupply = GameManager.GetInventoryComponent().GetNonPotableWaterSupply().m_WaterSupply;
                Water.ShowLostMessage(nonPotableWaterSupply, "GAMEPLAY_WaterUnsafe", lostLiters);
            }

            // Remove water and adjust the water supply.
            liquidItem.m_LiquidLiters = Mathf.Max(liquidItem.m_LiquidLiters - lostLiters, 0);
            Water.AdjustWaterSupplyToWater();
        }