コード例 #1
0
        public void SetOverlay(Enums.Overlay overlay)
        {
            //overlay = Enums.Overlay.None;
            if (Overlay != null) {
                Overlay.FreeResources();
            }
            switch (overlay) {
                case Enums.Overlay.Night: {
                        Overlay = new Graphics.Effects.Overlays.NightOverlay();
                    }
                    break;
                case Enums.Overlay.Dawn:
                    {
                        Overlay = new Graphics.Effects.Overlays.DawnOverlay();
                    }
                    break;
                case Enums.Overlay.Dusk:
                    {
                        Overlay = new Graphics.Effects.Overlays.DuskOverlay();
                    }
                    break;
                default:
                    if (Logic.Maps.MapHelper.ActiveMap.Indoors == false) {
                        switch (Globals.GameTime)
                        {
                            case (Enums.Time.Dawn): {
                                    SetOverlay(Enums.Overlay.Dawn);
                                }
                                break;
                            case (Enums.Time.Dusk):
                                {
                                    SetOverlay(Enums.Overlay.Dusk);
                                }
                                break;
                            case (Enums.Time.Night):
                                {
                                    SetOverlay(Enums.Overlay.Night);
                                }
                                break;
                            default:
                                {
                                    Overlay = null;
                                }
                                break;

                        }

                    } else {
                        Overlay = null;
                    }
                    break;
            }
        }
コード例 #2
0
        public void SetOverlay(Enums.Overlay overlay)
        {
            //overlay = Enums.Overlay.None;
            if (Overlay != null)
            {
                Overlay.FreeResources();
            }
            switch (overlay)
            {
            case Enums.Overlay.Night:
            {
                Overlay = new Graphics.Effects.Overlays.NightOverlay();
            }
            break;

            case Enums.Overlay.Dawn:
            {
                Overlay = new Graphics.Effects.Overlays.DawnOverlay();
            }
            break;

            case Enums.Overlay.Dusk:
            {
                Overlay = new Graphics.Effects.Overlays.DuskOverlay();
            }
            break;

            default:
                if (Logic.Maps.MapHelper.ActiveMap.Indoors == false)
                {
                    switch (Globals.GameTime)
                    {
                    case (Enums.Time.Dawn):
                    {
                        SetOverlay(Enums.Overlay.Dawn);
                    }
                    break;

                    case (Enums.Time.Dusk):
                    {
                        SetOverlay(Enums.Overlay.Dusk);
                    }
                    break;

                    case (Enums.Time.Night):
                    {
                        SetOverlay(Enums.Overlay.Night);
                    }
                    break;

                    default:
                    {
                        Overlay = null;
                    }
                    break;
                    }
                }
                else
                {
                    Overlay = null;
                }
                break;
            }
        }