/// <summary>
 /// Constructs an RCObjectPlacementDisplay extension for the given map display control.
 /// </summary>
 /// <param name="extendedControl">The map display control to extend.</param>
 public RCObjectPlacementDisplay(RCMapDisplay extendedControl)
     : base(extendedControl)
 {
     this.objectPlacementMaskGreen = UIResourceManager.GetResource <UISprite>("RC.App.Sprites.ObjectPlacementMaskGreen");
     this.objectPlacementMaskRed   = UIResourceManager.GetResource <UISprite>("RC.App.Sprites.ObjectPlacementMaskRed");
     this.lastKnownMousePosition   = RCIntVector.Undefined;
 }
        /// <summary>
        /// Constructs an RCSelectionDisplay extension for the given map display control.
        /// </summary>
        /// <param name="extendedControl">The map display control to extend.</param>
        public RCSelectionDisplay(RCMapDisplay extendedControl)
            : base(extendedControl)
        {
            this.selectionIndicatorView = null;
            this.mapObjectDetailsView   = null;

            this.greenBrush        = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(RCColor.Green, new RCIntVector(1, 1), UIWorkspace.Instance.PixelScaling);
            this.yellowBrush       = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(RCColor.Yellow, new RCIntVector(1, 1), UIWorkspace.Instance.PixelScaling);
            this.redBrush          = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(RCColor.Red, new RCIntVector(1, 1), UIWorkspace.Instance.PixelScaling);
            this.lightGreenBrush   = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(RCColor.LightGreen, new RCIntVector(1, 1), UIWorkspace.Instance.PixelScaling);
            this.lightBlueBrush    = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(RCColor.LightBlue, new RCIntVector(1, 1), UIWorkspace.Instance.PixelScaling);
            this.lightMagentaBrush = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(RCColor.LightMagenta, new RCIntVector(1, 1), UIWorkspace.Instance.PixelScaling);
            this.greenBrush.Upload();
            this.yellowBrush.Upload();
            this.redBrush.Upload();
            this.lightGreenBrush.Upload();
            this.lightBlueBrush.Upload();
            this.lightMagentaBrush.Upload();

            this.hpConditionBrushes = new Dictionary <MapObjectConditionEnum, UISprite>
            {
                { MapObjectConditionEnum.Excellent, this.lightGreenBrush },
                { MapObjectConditionEnum.Moderate, this.yellowBrush },
                { MapObjectConditionEnum.Critical, this.redBrush },
            };
        }
Beispiel #3
0
        /// <summary>
        /// Constructs an RCMapWalkabilityDisplay extension for the given map display control.
        /// </summary>
        /// <param name="extendedControl">The map display control to extend.</param>
        public RCMapWalkabilityDisplay(RCMapDisplay extendedControl)
            : base(extendedControl)
        {
            this.mapTerrainView = null;

            this.greenBrush = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(RCColor.Green, new RCIntVector(1, 1), UIWorkspace.Instance.PixelScaling);
            this.greenBrush.Upload();
        }
Beispiel #4
0
 /// <summary>
 /// Constructs an RCSelectionBoxDisplay extension for the given map display control.
 /// </summary>
 /// <param name="extendedControl">The map display control to extend.</param>
 public RCSelectionBoxDisplay(RCMapDisplay extendedControl)
     : base(extendedControl)
 {
     this.selectionBoxPointer = UIResourceManager.GetResource <UIPointer>("RC.App.Pointers.SelectionBoxPointer");
     this.crosshairsPointer   = UIResourceManager.GetResource <UIPointer>("RC.App.Pointers.CrosshairsPointer");
     this.selectionBoxBrush   = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(RCColor.LightGreen, new RCIntVector(1, 1), UIWorkspace.Instance.PixelScaling);
     this.selectionBoxBrush.Upload();
 }
 /// <summary>
 /// Constructs an RCIsoTileHighlightDisplay extension for the given map display control.
 /// </summary>
 /// <param name="extendedControl">The map display control to extend.</param>
 public RCIsoTileHighlightDisplay(RCMapDisplay extendedControl)
     : base(extendedControl)
 {
     this.mapTerrainView           = null;
     this.highlightIsoTile         = false;
     this.isotileHighlightedSprite = UIResourceManager.GetResource <UISprite>("RC.MapEditor.Sprites.IsotileHighlighted");
     this.isotileNormalSprite      = UIResourceManager.GetResource <UISprite>("RC.MapEditor.Sprites.IsotileNormal");
     this.lastKnownMousePosition   = RCIntVector.Undefined;
 }
 /// <summary>
 /// Constructs an RCResourceAmountTooltip extension for the given map display control.
 /// </summary>
 /// <param name="extendedControl">The map display control to extend.</param>
 public RCResourceAmountTooltip(RCMapDisplay extendedControl)
     : base(extendedControl)
 {
     this.mapObjectDetailsView = null;
     this.objectID             = -1;
     this.drawPosition         = RCIntVector.Undefined;
     this.stringToRender       = new UIString("R:{0}", UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font5"), UIWorkspace.Instance.PixelScaling, RCColor.White);
     this.backgroundBrush      = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(RCColor.Black, new RCIntVector(1, this.stringToRender.Font.MinimumLineHeight), UIWorkspace.Instance.PixelScaling);
     this.backgroundBrush.Upload();
 }
        /// <summary>
        /// Constructs an RCFogOfWarDisplay extension for the given map display control.
        /// </summary>
        /// <param name="extendedControl">The map display control to extend.</param>
        public RCFogOfWarDisplay(RCMapDisplay extendedControl)
            : base(extendedControl)
        {
            this.fogOfWarView      = null;
            this.partialFowSprites = null;
            this.fullFowSprites    = null;

            /// Load the Fog Of War sprite palette.
            string    fowSpritePalettePath = System.IO.Path.Combine(FOW_SPRITEPALETTE_DIR, FOW_SPRITEPALETTE_FILE);
            XDocument fowSpritePaletteXml  = XDocument.Load(fowSpritePalettePath);

            this.fowSpritePalette = XmlHelper.LoadSpritePalette(fowSpritePaletteXml.Root, FOWTypeEnum.Full, FOW_SPRITEPALETTE_DIR);
        }
        /// <summary>
        /// Contructs an RCMapDisplayExtension instance.
        /// </summary>
        /// <param name="extendedControl">Reference to the extended control.</param>
        public RCMapDisplayExtension(RCMapDisplay extendedControl)
            : base(extendedControl.Position, new RCIntVector(extendedControl.Range.Width, extendedControl.Range.Height))
        {
            if (extendedControl == null)
            {
                throw new ArgumentNullException("extendedControl");
            }
            this.extendedControl        = extendedControl;
            this.extendedCtrlOpFinished = null;

            /// Propagate mouse events of this object to the extended object.
            this.extendedControl.MouseSensor.AttachTo(this.MouseSensor);
        }
Beispiel #9
0
 /// <summary>
 /// Constructs an RCSuggestionBoxDisplay extension for the given map display control.
 /// </summary>
 /// <param name="extendedControl">The map display control to extend.</param>
 public RCSuggestionBoxDisplay(RCMapDisplay extendedControl)
     : base(extendedControl)
 {
     this.suggestionBoxBrush = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(RCColor.LightGreen, new RCIntVector(1, 1), UIWorkspace.Instance.PixelScaling);
     this.suggestionBoxBrush.Upload();
 }
 /// <summary>
 /// Constructs an RCMapObjectDisplay extension for the given map display control.
 /// </summary>
 /// <param name="extendedControl">The map display control to extend.</param>
 public RCMapObjectDisplay(RCMapDisplay extendedControl)
     : base(extendedControl)
 {
     this.mapObjectView    = null;
     this.mapObjectSprites = new List <SpriteGroup>();
 }