Пример #1
0
        /// <summary>
        ///     Loads a spritesheet
        /// </summary>
        /// <param name="folder"></param>
        /// <param name="element"></param>
        /// <param name="shared">If the resource is shared between key modes.</param>
        /// <param name="rows"></param>
        /// <param name="columns"></param>
        /// <param name="extension"></param>
        /// <returns></returns>
        private List <Texture2D> LoadSpritesheet(SkinKeysFolder folder, string element, bool shared, int rows, int columns, string extension = ".png")
        {
            string resource;

            if (shared)
            {
                resource = $"Quaver.Resources/Textures/Skins/Shared/{folder.ToString()}/{element}";
            }
            else
            {
                resource = $"Quaver.Resources/Textures/Skins/{ConfigManager.DefaultSkin.Value.ToString()}/{folder.ToString()}" +
                           $"/{Mode.ToString()}/{GetResourcePath(element)}";
            }

            var folderName = shared ? folder.ToString() : $"/{ShortName}/{folder.ToString()}/";

            return(SkinStore.LoadSpritesheet(folderName, element, resource, rows, columns, extension));
        }
Пример #2
0
        /// <summary>
        ///     Loads an individual skin element.
        /// </summary>
        /// <param name="folder"></param>
        /// <param name="element"></param>
        /// <param name="shared">If the resource is shared between key modes.</param>
        /// <param name="extension"></param>
        /// <returns></returns>
        private Texture2D LoadTexture(SkinKeysFolder folder, string element, bool shared, string extension = ".png")
        {
            string resource;

            if (shared)
            {
                resource = $"Quaver.Resources/Textures/Skins/Shared/{folder.ToString()}/{element}.png";
            }
            else
            {
                resource = $"Quaver.Resources/Textures/Skins/{ConfigManager.DefaultSkin.Value.ToString()}/{folder.ToString()}" +
                           $"/{Mode.ToString()}/{GetResourcePath(element)}.png";
            }

            var folderName = shared ? folder.ToString() : $"/{ShortName}/{folder.ToString()}";

            return(SkinStore.LoadSingleTexture($"{SkinStore.Dir}/{folderName}/{element}", resource));
        }