Beispiel #1
0
    private void SetIcon(GameObject gameObject, TileIcon tileIcon)
    {
        var iconInfo = TileIconsRepository.TileIconRendererDictionary[tileIcon];
        var texture  = Resources.Load("Tile/Icons/" + iconInfo.ResourceName);

        transform.localRotation = Quaternion.Euler(0, 0, iconInfo.Rotation);
        gameObject.GetComponentInChildren <Icon>().GetComponent <MeshRenderer>().material.SetTexture("_MainTex", texture as Texture2D);
    }
Beispiel #2
0
    private void SetIcon(GameObject gameObject, TileIcon tileIcon)
    {
        var iconInfo = TileIconsRepository.TileIconRendererDictionary[tileIcon];
        var texture  = Resources.Load("Level/Icons/" + iconInfo.ResourceName);
        var icon     = gameObject.GetComponentInChildren <Icon>();

        icon.transform.localRotation           = Quaternion.Euler(0, 0, iconInfo.Rotation);
        icon.GetComponent <RawImage>().texture = texture as Texture2D;
    }
Beispiel #3
0
        private void GenerateFullShortcut(
            string targetPath,
            string targetArguments,
            CustomShortcutType shortcutType,
            string basicShortcutIcon = null,
            string workingFolder     = null,
            WindowType windowType    = WindowType.ActiveAndDisplayed
            )
        {
            var shortcutName = txtShortcutName.Text.CleanInvalidFilenameChars();

            byte[] imageToUse;

            try
            {
                ValidateFields(shortcutName, targetPath, out imageToUse);
            }
            catch (ValidationFailureException)
            {
                return;
            }

            //build our new custom shortcut
            var customShortcut = new CustomShortcut(shortcutName, targetPath, targetArguments, shortcutType, windowType,
                                                    radShortcutLocation.PathSelection(), basicShortcutIcon, workingFolder);

            //If we didn't specify a shortcut icon path, make one
            if (string.IsNullOrWhiteSpace(basicShortcutIcon))
            {
                customShortcut.BuildCustomShortcut(pctCurrentIcon.Image);
            }
            else
            {
                customShortcut.BuildCustomShortcut();
            }


            //Iconify a TileIconifier shortcut for this with default settings
            var newShortcutItem = customShortcut.ShortcutItem;

            newShortcutItem.Properties.CurrentState.MediumImage.SetImage(imageToUse,
                                                                         ShortcutConstantsAndEnums.MediumShortcutDisplaySize);
            newShortcutItem.Properties.CurrentState.SmallImage.SetImage(imageToUse,
                                                                        ShortcutConstantsAndEnums.SmallShortcutDisplaySize);
            var iconify = new TileIcon(newShortcutItem);

            iconify.RunIconify();

            //confirm to the user the shortcut has been created
            MessageBox.Show(
                $"A shortcut for {shortcutName.QuoteWrap()} has been created in your start menu under TileIconify. The item will need to be pinned manually.",
                @"Shortcut created!", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Beispiel #4
0
        private static void BuildIconifiedTile(byte[] imageToUse, CustomShortcut customShortcut)
        {
            //Iconify a TileIconifier shortcut for this with default settings
            var newShortcutItem = customShortcut.ShortcutItem;

            newShortcutItem.Properties.CurrentState.MediumImage.SetImage(imageToUse,
                                                                         ShortcutConstantsAndEnums.MediumShortcutDisplaySize);
            newShortcutItem.Properties.CurrentState.SmallImage.SetImage(imageToUse,
                                                                        ShortcutConstantsAndEnums.SmallShortcutDisplaySize);
            var iconify = new TileIcon(newShortcutItem);

            iconify.RunIconify();
        }
Beispiel #5
0
 // builds tile yield icons
 private void BuildTileIcons()
 {
     lock (_lock_tileIconUpdate)
     {
         tileIcons = new TileIcon[client.Board.DimY][];
         for (int y = 0; y < tileIcons.Length; y++)
         {
             tileIcons[y] = new TileIcon[client.Board.DimX];
             for (int x = 0; x < tileIcons[y].Length; x++)
             {
                 tileIcons[y][x] = new TileIcon(client.Board.GetTile(x, y), this);
             }
         }
     }
 }
Beispiel #6
0
        private void btnRemove_Click(object sender, EventArgs e)
        {
            if (!iconifyPanel.DoValidation())
            {
                return;
            }

            if (MessageBox.Show(@"Are you sure you wish to remove iconification?", @"Confirm", MessageBoxButtons.YesNo,
                                MessageBoxIcon.Question) != DialogResult.Yes)
            {
                return;
            }

            TileIcon tileDeIconify = GenerateTileIcon();

            tileDeIconify.DeIconify();
            CurrentShortcutItem.Properties.ResetParameters();
            UpdateShortcut();
        }
Beispiel #7
0
 private void SetIconAndColor(GameObject gameObject, TileIcon tileIcon, Color color)
 {
     SetIcon(gameObject, tileIcon);
     SetColor(gameObject, color);
 }