private async void InitializeTile(PreviewTile tile)
        {
            try
            {
                tile.DisplayName = ViewModel.Class.Name;

                if (ViewModel.Settings.CustomColor != null)
                {
                    tile.VisualElements.BackgroundColor = ColorTools.GetColor(ViewModel.Settings.CustomColor);
                }
                else
                {
                    tile.VisualElements.BackgroundColor = ColorTools.GetColor(ViewModel.Class.Color);
                }

                tile.VisualElements.ShowNameOnSquare150x150Logo = true;
                tile.VisualElements.Square44x44Logo             = new Uri("ms-appx:///Assets/Square44x44Logo.png");
                tile.VisualElements.Square71x71Logo             = new Uri("ms-appx:///Assets/Square71x71Logo.png");
                tile.VisualElements.Square150x150Logo           = new Uri("ms-appx:///Assets/Square150x150Logo.png");
                tile.VisualElements.Square310x310Logo           = new Uri("ms-appx:///Assets/Square310x310Logo.png");
                tile.VisualElements.Wide310x150Logo             = new Uri("ms-appx:///Assets/Wide310x150Logo.png");

                await tile.UpdateAsync();
            }

            catch (Exception ex)
            {
                TelemetryExtension.Current?.TrackException(ex);
            }
        }
Example #2
0
    // Use this for initialization
    void Start()
    {
        _t                = GetComponent <Transform>();
        _pathPreview      = new List <PreviewTile>();
        _selectedMirrored = Player.MirrorDefault;
        _previewTile      = Instantiate(PreviewTile, _t);
        _c                = Player.Color;
        _c.a              = 0.7f;
        _previewTile.Paint(_c);
        selectedTile = 0;
        maxTiles     = 0;

        GameController.OnRoundTimeOut.AddListener(PlaceUnit);           // attempt to place unit at end of round
    }
Example #3
0
        private void SetPreviewTile(MetaTileMap metaTilemap, Vector3Int position, LayerTile tile)
        {
            if (tile is ObjectTile)
            {
                if (previewTile == null)
                {
                    previewTile = CreateInstance <PreviewTile>();
                }

                previewTile.ReferenceTile = tile;
                tile = previewTile;

                position.z++; // to draw the object over already existing stuff
            }

            metaTilemap.SetPreviewTile(position, tile, brush.cells[0].matrix);
        }
        private async void InitializeTile(PreviewTile tile)
        {
            try
            {
                tile.DisplayName = "Quick Add";

                tile.VisualElements.ShowNameOnSquare150x150Logo = true;
                tile.VisualElements.Square44x44Logo             = new Uri("ms-appx:///Assets/Square44x44Logo.png");
                tile.VisualElements.Square71x71Logo             = new Uri("ms-appx:///Assets/QuickAddTile/Square71x71Logo.png");
                tile.VisualElements.Square150x150Logo           = new Uri("ms-appx:///Assets/QuickAddTile/Square150x150Logo.png");

                await tile.UpdateAsync();
            }

            catch (Exception ex)
            {
                TelemetryExtension.Current?.TrackException(ex);
            }
        }
        private async void InitializeTile(PreviewTile tile)
        {
            try
            {
                tile.DisplayName = "Power Planner";
                tile.VisualElements.BackgroundColor             = (Color)Resources["SystemColorHighlightColor"];
                tile.VisualElements.ShowNameOnSquare150x150Logo = true;
                tile.VisualElements.Square44x44Logo             = new Uri("ms-appx:///Assets/Square44x44Logo.png");
                tile.VisualElements.Square71x71Logo             = new Uri("ms-appx:///Assets/Square71x71Logo.png");
                tile.VisualElements.Square150x150Logo           = new Uri("ms-appx:///Assets/Square150x150Logo.png");
                tile.VisualElements.Square310x310Logo           = new Uri("ms-appx:///Assets/Square310x310Logo.png");
                tile.VisualElements.Wide310x150Logo             = new Uri("ms-appx:///Assets/Wide310x150Logo.png");

                await tile.UpdateAsync();
            }

            catch (Exception ex)
            {
                TelemetryExtension.Current?.TrackException(ex);
            }
        }
        private void Initialize()
        {
            // Generate the tile notification content
            _tileContent = GenerateTileContent();

            // Generate the toast notification content
            _toastContent = GenerateToastContent();

            // Prepare and update the preview tiles
            var previewTiles = new PreviewTile[] { PreviewTileSmall, PreviewTileMedium, PreviewTileWide, PreviewTileLarge };

            foreach (var tile in previewTiles)
            {
                tile.DisplayName = "WeatherSample";
                tile.VisualElements.BackgroundColor             = Constants.ApplicationBackgroundColor;
                tile.VisualElements.ShowNameOnSquare150x150Logo = true;
                tile.VisualElements.ShowNameOnSquare310x310Logo = true;
                tile.VisualElements.ShowNameOnWide310x150Logo   = true;
                tile.VisualElements.Square44x44Logo             = Constants.Square44x44Logo;
                tile.VisualElements.Square150x150Logo           = Constants.Square150x150Logo;
                tile.VisualElements.Wide310x150Logo             = Constants.Wide310x150Logo;
                tile.VisualElements.Square310x310Logo           = Constants.Square310x310Logo;
                var dontWait = tile.UpdateAsync(); // Commit changes (no need to await)

                tile.CreateTileUpdater().Update(new TileNotification(_tileContent.GetXml()));
            }

            // Prepare and update preview toast
            PreviewToastWeather.Properties = new PreviewToastProperties()
            {
                BackgroundColor = Constants.ApplicationBackgroundColor,
                DisplayName     = Constants.ApplicationDisplayName,
                Square44x44Logo = Constants.Square44x44Logo
            };
            PreviewToastWeather.Initialize(_toastContent.GetXml());
        }
Example #7
0
        private void Initialize()
        {
            // Generate the tile notification content
            _tileContent = GenerateTileContent("MasterHip", "Assets/Photos/Owl.jpg");

            // Prepare and update the preview tiles
            var previewTiles = new PreviewTile[] { MediumPreviewTile, WidePreviewTile, LargePreviewTile };

            foreach (var tile in previewTiles)
            {
                tile.DisplayName = "Xbox";
                tile.VisualElements.BackgroundColor             = Constants.ApplicationBackgroundColor;
                tile.VisualElements.ShowNameOnSquare150x150Logo = true;
                tile.VisualElements.ShowNameOnSquare310x310Logo = true;
                tile.VisualElements.ShowNameOnWide310x150Logo   = true;
                tile.VisualElements.Square44x44Logo             = Constants.Square44x44Logo;
                tile.VisualElements.Square150x150Logo           = Constants.Square150x150Logo;
                tile.VisualElements.Wide310x150Logo             = Constants.Wide310x150Logo;
                tile.VisualElements.Square310x310Logo           = Constants.Square310x310Logo;
                _ = tile.UpdateAsync(); // Commit changes (no need to await)

                tile.CreateTileUpdater().Update(new TileNotification(_tileContent.GetXml()));
            }
        }
Example #8
0
 // Methods
 public PreviewTileView(PreviewTile tile)
 {
     this._tile = tile;
 }