示例#1
0
        private void Style(DesktopEx.FolderFlags flag, bool newValue)
        {
            var current = DesktopEx.Style(flag);

            _Style.Add(flag, current);

            if (current != newValue)
            {
                DesktopEx.Style(flag, newValue);
            }
        }
示例#2
0
        private void RestoreDesktop()
        {
            DesktopEx.Icons(_Mode, _IconSize);

            /* restore styles */
            foreach (var entry in _Style)
            {
                DesktopEx.Style(entry.Key, entry.Value);
            }

            Wallpaper.Restore();
        }
示例#3
0
        public void Create(string uniqueId, LevelParser.Cell cell = null)
        {
            string name = uniqueId;

            // null for Explorer and HUD elements
            if (cell != null)
            {
                switch (cell.Type)
                {
                case Identifier.PortalEntry:
                {
                    name = $"Folder_{name}";
                    GetComponent <Actor>().GetComponent <PortalEntry>().PortalExitKey = cell.MatchingPortalExitKey;
                    break;
                }

                case Identifier.MineEnemy:
                {
                    name = $"Minesweeper_{name}.exe";
                    break;
                }

                case Identifier.BatEnemy:
                {
                    name = $"Killer_{name}.bat";
                    break;
                }

                default:
                {
                    name = $"{cell.Type.ToName()}_{name}";
                    break;
                }
                }
            }

            if (Config.DisableIcons)
            {
                return;
            }
            if (_Directory != null)
            {
                throw new InvalidOperationException($"actor: {name}");
            }

            Cell               = cell;
            _Name              = name;
            _Directory         = DesktopEx.CreateDirectory(_Name);
            _Directory.Icon    = _Icon;
            _Directory.Tooltip = _Tooltip;
        }
示例#4
0
        private void SetupDesktop()
        {
            Wallpaper.Backup();

            Style(DesktopEx.FolderFlags.FWF_AUTOARRANGE, false);
            Style(DesktopEx.FolderFlags.FWF_SNAPTOGRID, false);

            DesktopEx.Icons(ref _Mode, ref _IconSize);
            var normalizedSize = new Vector2(1.0f, 1.0f) / (Config.StageSize + new Vector2Int(1, 1));
            var desktopSize    = Coordinates.NormalizedToDesktop_Size(normalizedSize);

            Debug.Log(Mathf.Min(desktopSize.x, desktopSize.y));
            DesktopEx.Icons(_Mode, Mathf.Min(desktopSize.x, desktopSize.y));
        }
示例#5
0
        public void Destroy()
        {
            if (_Directory == null)
            {
                return;
            }

            _Directory.DesktopPosition = new Vector2Int(-8192, -8192);
            bool result = DesktopEx.desktop_set_item_position2(_Directory.Name,
                                                               _Directory._Position.x, _Directory._Position.y);

            _Directory.Delete();
            _Directory = null;
        }
示例#6
0
        private void FixedUpdate()
        {
            DesktopEx.desktop_get_item_indices2();

            var copy = UpdateList.ToList();

            foreach (var entry in copy)
            {
                if (entry.IsCreated == false)
                {
                    continue;
                }
                bool result = DesktopEx.desktop_set_item_position2(entry.Name,
                                                                   entry._Position.x, entry._Position.y);

                if (result)
                {
                    UpdateList.Remove(entry);
                }
            }
        }
示例#7
0
 public static void Initialize()
 {
     Initialize(OnUnmanagedInfo, OnUnmanagedError);
     DesktopEx.desktop_initialize();
 }