コード例 #1
0
 private void AggregateSkyTargetWorker(ref SkyTarget total, ref float lfTotal)
 {
     for (int i = 0; i < this.activeConditions.Count; i++)
     {
         GameCondition gameCondition = this.activeConditions[i];
         float         num           = gameCondition.SkyTargetLerpFactor();
         if (num > 0f)
         {
             if (lfTotal == 0f)
             {
                 total   = gameCondition.SkyTarget().Value;
                 lfTotal = num;
             }
             else
             {
                 lfTotal += num;
                 total    = SkyTarget.LerpDarken(total, gameCondition.SkyTarget().Value, num / lfTotal);
             }
         }
     }
     if (this.Parent != null)
     {
         this.Parent.AggregateSkyTargetWorker(ref total, ref lfTotal);
     }
 }
コード例 #2
0
        internal SkyTarget?AggregateSkyTarget()
        {
            SkyTarget value = default(SkyTarget);
            float     num   = 0f;

            this.AggregateSkyTargetWorker(ref value, ref num);
            if (num == 0f)
            {
                return(null);
            }
            return(new SkyTarget?(value));
        }
コード例 #3
0
        internal SkyTarget?AggregateSkyTarget(Map map)
        {
            SkyTarget value = default(SkyTarget);
            float     num   = 0f;

            this.AggregateSkyTargetWorker(ref value, ref num, map);
            SkyTarget?result;

            if (num == 0f)
            {
                result = null;
            }
            else
            {
                result = new SkyTarget?(value);
            }
            return(result);
        }
            public static void Postfix(ref SkyTarget __result)
            {
                if (!MLCOn)
                {
                    return;
                }

                float modifier = MinimalLightControl.Instance.MLCModifier / 10f;

                if (MinimalLightControl.Instance.MLCMode == MinimalLightControl.MLCModes.Darker)
                {
                    modifier = modifier * 0.75f + 0.25f;
                    if (ColorGetBrightness(__result.colors.sky) < modifier)
                    {
                        ColorChangeBrightness(ref __result.colors.sky, modifier, true);
                    }
                    // there is no need to change other values

                    /*
                     * if (ColorGetBrightness(__result.colors.shadow) < modifier)
                     *  ColorChangeBrightness(ref __result.colors.shadow, modifier, true);
                     * if (ColorGetBrightness(__result.colors.overlay) < modifier)
                     *  ColorChangeBrightness(ref __result.colors.overlay, modifier, true);
                     * //*/
                }
                else
                {
                    modifier = 1f - modifier /* * 0.75f */;
                    ColorChangeBrightness(ref __result.colors.sky, modifier);

                    /*
                     * ColorChangeBrightness(ref __result.colors.shadow, modifier);
                     * ColorChangeBrightness(ref __result.colors.overlay, modifier);
                     * //*/
                }
            }