Пример #1
0
        public static Theme GetThemeFromItemNoFlow(VisibleEntity Item)
        {
            Theme ItemTheme = ThemeConfig.Directory.ContainsKey(Item.Type()) ? ThemeConfig.Directory[Item.Type()] : null;

            if (ItemTheme == null)
            {
                ItemTheme = ThemeConfig.DefaultTheme;

                if (ItemTheme == null) // Cant draw..., maybe the next one will have a set theme...
                {
                    return(null);
                }
            }

            return(ItemTheme);
        }
Пример #2
0
        public Theme GetThemeFromItem(VisibleEntity Item)
        {
            Theme ItemTheme = ThemeConfig.Directory.ContainsKey(Item.Type()) ? ThemeConfig.Directory[Item.Type()] : null;

            if (ItemTheme == null)
            {
                ItemTheme = ThemeConfig.DefaultTheme;

                if (ItemTheme == null) // Cant draw..., maybe the next one will have a set theme...
                {
                    return(null);
                }
            }

            if (Item == FocusedItem)
            {
                if (ItemTheme.FocusedTheme == null && ThemeConfig.DefaultTheme.FocusedTheme != null)
                {
                    ItemTheme = ThemeConfig.DefaultTheme.FocusedTheme;
                }
                else if (ItemTheme.FocusedTheme != null)
                {
                    ItemTheme = ItemTheme.FocusedTheme;
                }
            }
            else if (Item == HoverItem)
            {
                if (ItemTheme.HoverTheme == null && ThemeConfig.DefaultTheme.HoverTheme != null)
                {
                    ItemTheme = ThemeConfig.DefaultTheme.HoverTheme;
                }
                else if (ItemTheme.HoverTheme != null)
                {
                    ItemTheme = ItemTheme.HoverTheme;
                }
            }

            return(ItemTheme);
        }