/// <summary>
        /// Event called when the map background has changed.
        /// </summary>
        private void OnBackgroundChange(IMapBackground background)
        {
            var highlightColor = background.Highlight;

            highlightColor.a = 0f;
            gradientEffect.Component.color1 = highlightColor;
            gradientEffect.Component.color2 = Color.black;
        }
 public void SetMode(Modes modo)
 {
     /* if (modo == Modes.TOPO)
      *   map = ozi_bg;
      * else */
     map = web_bg;
     map.SetMode(modo);
     this.Invalidate();
 }
 public IkarusMapControl()
 {
     home = new WayPoint("HOME", singleton.HomeLon, singleton.HomeLat);
     web_bg = new WebMapBackgrnd(this);
     //ozi_bg = new OziexplorerMapBackgrnd();
     map = web_bg;
     mensaje = null;
     SetCenter(home);
     InitializeComponent();
     this.DoubleBuffered = true;
 }
 public IkarusMapControl()
 {
     home   = new WayPoint("HOME", singleton.HomeLon, singleton.HomeLat);
     web_bg = new WebMapBackgrnd(this);
     //ozi_bg = new OziexplorerMapBackgrnd();
     map     = web_bg;
     mensaje = null;
     SetCenter(home);
     InitializeComponent();
     this.DoubleBuffered = true;
 }
Exemple #5
0
        /// <summary>
        /// Event called from cacher agent when the mapset background has been loaded.
        /// </summary>
        private void OnBackgroundLoaded(IMapBackground background)
        {
            if (Mapset == null)
            {
                return;
            }
            if (backgroundAgent.Key != Mapset.Maps[0])
            {
                LoadBackground();
                return;
            }

            // Set highlight color without affecting current alpha.
            SetHighlightColor(background.Highlight);

            // Assign thumbnail image.
            thumbImage.Texture = background.Image;
            if (background.Image != null)
            {
                thumbImage.FillTexture();
                StartAnimation();
            }
        }
        public void SetMode(Modes modo)
        {
           /* if (modo == Modes.TOPO)
                map = ozi_bg;
            else */
                map = web_bg;
            map.SetMode(modo);
            this.Invalidate();

        }
Exemple #7
0
 /// <summary>
 /// Event called on map instance change.
 /// </summary>
 private void OnMapBgChanged(IMapBackground background)
 {
     mapThumb.SetBackground(background);
 }
 /// <summary>
 /// Event called when the map background has changed.
 /// </summary>
 private void OnBackgroundChange(IMapBackground background)
 {
     imageDisplay.SetBackground(background);
 }
 public void MountBackground(IMapBackground background)
 {
 }
Exemple #10
0
        public MapSelection(IMusicCacher musicCacher,
                            IBackgroundCacher backgroundCacher,
                            IGameConfiguration gameConfiguration,
                            IMapsetConfiguration mapsetConfiguration,
                            IMapConfiguration mapConfiguration)
        {
            if (musicCacher == null)
            {
                throw new ArgumentNullException(nameof(musicCacher));
            }
            if (backgroundCacher == null)
            {
                throw new ArgumentNullException(nameof(backgroundCacher));
            }
            if (gameConfiguration == null)
            {
                throw new ArgumentNullException(nameof(gameConfiguration));
            }

            this.musicCacher         = musicCacher;
            this.backgroundCacher    = backgroundCacher;
            this.mapsetConfiguration = mapsetConfiguration;
            this.mapConfiguration    = mapConfiguration;

            // Initial background.
            bindableBackground.Value = emptyBackground = new MapBackground(null);

            // Setup music loader
            musicAgent = new CacherAgent <IMap, IMusicAudio>(musicCacher)
            {
                UseDelayedRemove = true,
                RemoveDelay      = 2f,
            };
            musicAgent.OnFinished += (music) =>
            {
                bindableMusic.Value = music;
            };

            // Setup background loader
            backgroundAgent = new CacherAgent <IMap, IMapBackground>(backgroundCacher)
            {
                UseDelayedRemove = true,
                RemoveDelay      = 2f,
            };
            backgroundAgent.OnFinished += (background) =>
            {
                bindableBackground.Value = background;
            };

            // Listen to game mode change event from config.
            gameConfiguration.OnLoad += delegate
            {
                // Retrieve initial game mode saved in config.
                currentMode = gameConfiguration.RulesetMode.Value;
            };
            gameConfiguration.RulesetMode.OnValueChanged += (newMode, oldMode) =>
            {
                // Only if change of mode
                if (oldMode != newMode)
                {
                    currentMode = newMode;
                    // Automatically change to variant playable for this new mode.
                    if (Map.Value != null)
                    {
                        SelectMap(Map.Value.OriginalMap.GetPlayable(newMode));
                    }
                }
            };
        }