public TestWorkingBeatmap(BeatmapInfo skinBeatmapInfo, IResourceStore <byte[]> resourceStore, IBeatmap beatmap, Storyboard storyboard, IFrameBasedClock referenceClock, IStorageResourceProvider resources) : base(beatmap, storyboard, referenceClock, resources.AudioManager) { this.skinBeatmapInfo = skinBeatmapInfo; this.resourceStore = resourceStore; this.resources = resources; }
protected Skin(SkinInfo skin, IStorageResourceProvider resources) { SkinInfo = skin; // we may want to move this to some kind of async operation in the future. foreach (SkinnableTarget skinnableTarget in Enum.GetValues(typeof(SkinnableTarget))) { string filename = $"{skinnableTarget}.json"; // skininfo files may be null for default skin. var fileInfo = SkinInfo.Files?.FirstOrDefault(f => f.Filename == filename); if (fileInfo == null) { continue; } var bytes = resources?.Files.Get(fileInfo.FileInfo.StoragePath); if (bytes == null) { continue; } string jsonContent = Encoding.UTF8.GetString(bytes); var deserializedContent = JsonConvert.DeserializeObject <IEnumerable <SkinnableInfo> >(jsonContent); if (deserializedContent == null) { continue; } DrawableComponentInfo[skinnableTarget] = deserializedContent.ToArray(); } }
protected Skin(SkinInfo skin, IStorageResourceProvider resources, [CanBeNull] Stream configurationStream = null) { SkinInfo = skin.ToLive(); this.resources = resources; configurationStream ??= getConfigurationStream(); if (configurationStream != null) { // stream will be closed after use by LineBufferedReader. ParseConfigurationStream(configurationStream); } else { Configuration = new SkinConfiguration(); } // skininfo files may be null for default skin. SkinInfo.PerformRead(s => { // we may want to move this to some kind of async operation in the future. foreach (SkinnableTarget skinnableTarget in Enum.GetValues(typeof(SkinnableTarget))) { string filename = $"{skinnableTarget}.json"; // skininfo files may be null for default skin. var fileInfo = s.Files.FirstOrDefault(f => f.Filename == filename); if (fileInfo == null) { continue; } byte[] bytes = resources?.Files.Get(fileInfo.File.GetStoragePath()); if (bytes == null) { continue; } try { string jsonContent = Encoding.UTF8.GetString(bytes); var deserializedContent = JsonConvert.DeserializeObject <IEnumerable <SkinnableInfo> >(jsonContent); if (deserializedContent == null) { continue; } DrawableComponentInfo[skinnableTarget] = deserializedContent.ToArray(); } catch (Exception ex) { Logger.Error(ex, "Failed to load skin configuration."); } } }); }
public SkinModelManager(Storage storage, RealmAccess realm, IStorageResourceProvider skinResources) : base(storage, realm) { this.skinResources = skinResources; // can be removed 20220420. populateMissingHashes(); }
public SkinModelManager(Storage storage, RealmContextFactory contextFactory, GameHost host, IStorageResourceProvider skinResources) : base(storage, contextFactory) { this.skinResources = skinResources; // can be removed 20220420. populateMissingHashes(); }
public virtual Skin CreateInstance(IStorageResourceProvider resources) { var type = string.IsNullOrEmpty(InstantiationInfo) // handle the case of skins imported before InstantiationInfo was added. ? typeof(LegacySkin) : Type.GetType(InstantiationInfo).AsNonNull(); return((Skin)Activator.CreateInstance(type, this, resources)); }
public DefaultLegacySkin(SkinInfo skin, IStorageResourceProvider resources) : base(skin, new NamespacedResourceStore <byte[]>(resources.Resources, "Skins/Legacy"), resources, string.Empty) { Configuration.CustomColours["SliderBall"] = new Color4(2, 170, 255, 255); Configuration.AddComboColours( new Color4(255, 192, 0, 255), new Color4(0, 202, 0, 255), new Color4(18, 124, 255, 255), new Color4(242, 24, 57, 255) ); Configuration.LegacyVersion = 2.7m; }
public DefaultLegacySkin(IResourceStore <byte[]> storage, IStorageResourceProvider resources) : base(Info, storage, resources, string.Empty) { Configuration.CustomColours["SliderBall"] = new Color4(2, 170, 255, 255); Configuration.AddComboColours( new Color4(255, 192, 0, 255), new Color4(0, 202, 0, 255), new Color4(18, 124, 255, 255), new Color4(242, 24, 57, 255) ); Configuration.LegacyVersion = 2.7m; }
public DefaultLegacySkin(SkinInfo skin, IStorageResourceProvider resources) : base( skin, resources, // In the case of the actual default legacy skin (ie. the fallback one, which a user hasn't applied any modifications to) we want to use the game provided resources. skin.Protected ? new NamespacedResourceStore <byte[]>(resources.Resources, "Skins/Legacy") : null ) { Configuration.CustomColours["SliderBall"] = new Color4(2, 170, 255, 255); Configuration.CustomComboColours = new List <Color4> { new Color4(255, 192, 0, 255), new Color4(0, 202, 0, 255), new Color4(18, 124, 255, 255), new Color4(242, 24, 57, 255) }; Configuration.LegacyVersion = 2.7m; }
public DefaultLegacySkin(SkinInfo skin, IStorageResourceProvider resources) : base( skin, new NamespacedResourceStore <byte[]>(resources.Resources, "Skins/Legacy"), resources, // A default legacy skin may still have a skin.ini if it is modified by the user. // We must specify the stream directly as we are redirecting storage to the osu-resources location for other files. new LegacyDatabasedSkinResourceStore(skin, resources.Files).GetStream("skin.ini") ) { Configuration.CustomColours["SliderBall"] = new Color4(2, 170, 255, 255); Configuration.CustomComboColours = new List <Color4> { new Color4(255, 192, 0, 255), new Color4(0, 202, 0, 255), new Color4(18, 124, 255, 255), new Color4(242, 24, 57, 255) }; Configuration.LegacyVersion = 2.7m; }
public DefaultSkin(SkinInfo skin, IStorageResourceProvider resources) : base(skin, resources) { this.resources = resources; Configuration = new DefaultSkinConfiguration(); }
public DefaultSkin(IStorageResourceProvider resources) : this(SkinInfo.Default, resources) { }
/// <summary> /// Construct a new legacy skin instance. /// </summary> /// <param name="skin">The model for this skin.</param> /// <param name="storage">A storage for looking up files within this skin using user-facing filenames.</param> /// <param name="resources">Access to raw game resources.</param> /// <param name="configurationFilename">The user-facing filename of the configuration file to be parsed. Can accept an .osu or skin.ini file.</param> protected LegacySkin(SkinInfo skin, [CanBeNull] IResourceStore <byte[]> storage, [CanBeNull] IStorageResourceProvider resources, string configurationFilename) : this(skin, storage, resources, storage?.GetStream(configurationFilename)) { }
/// <summary> /// Construct a new legacy skin instance. /// </summary> /// <param name="skin">The model for this skin.</param> /// <param name="storage">A storage for looking up files within this skin using user-facing filenames.</param> /// <param name="resources">Access to raw game resources.</param> /// <param name="configurationStream">An optional stream containing the contents of a skin.ini file.</param> protected LegacySkin(SkinInfo skin, [CanBeNull] IResourceStore <byte[]> storage, [CanBeNull] IStorageResourceProvider resources, [CanBeNull] Stream configurationStream) : base(skin, resources, configurationStream) { if (storage != null) { var samples = resources?.AudioManager?.GetSampleStore(storage); if (samples != null) { samples.PlaybackConcurrency = OsuGameBase.SAMPLE_CONCURRENCY; } Samples = samples; Textures = new TextureStore(resources?.CreateTextureLoaderStore(storage)); (storage as ResourceStore <byte[]>)?.AddExtension("ogg"); } // todo: this shouldn't really be duplicated here (from ManiaLegacySkinTransformer). we need to come up with a better solution. hasKeyTexture = new Lazy <bool>(() => this.GetAnimation( lookupForMania <string>(new LegacyManiaSkinConfigurationLookup(4, LegacyManiaSkinConfigurationLookups.KeyImage, 0))?.Value ?? "mania-key1", true, true) != null); }
public LegacyBeatmapSkin(BeatmapInfo beatmap, IResourceStore <byte[]> storage, IStorageResourceProvider resources) : base(createSkinInfo(beatmap), new LegacySkinResourceStore <BeatmapSetFileInfo>(beatmap.BeatmapSet, storage), resources, beatmap.Path) { // Disallow default colours fallback on beatmap skins to allow using parent skin combo colours. (via SkinProvidingContainer) Configuration.AllowDefaultComboColoursFallback = false; }
public DefaultSkin(SkinInfo skin, IStorageResourceProvider resources) : base(skin, resources) { this.resources = resources; }
public DefaultSkin(IStorageResourceProvider resources) : this(CreateInfo(), resources) { }
public LegacySkin(SkinInfo skin, IStorageResourceProvider resources) : this(skin, new LegacySkinResourceStore <SkinFileInfo>(skin, resources.Files), resources, "skin.ini") { }
public TestSkin(string resourceName, IStorageResourceProvider resources) : base(DefaultLegacySkin.CreateInfo(), new TestResourceStore(resourceName), resources, "skin.ini") { }
public TestLegacySkin(SkinInfo skin, IResourceStore <byte[]> storage, IStorageResourceProvider resources, bool extrapolateAnimations) : base(skin, storage, resources, "skin.ini") { this.extrapolateAnimations = extrapolateAnimations; }
public LegacySkin(SkinInfo skin, IStorageResourceProvider resources) : this(skin, resources, null) { }
public DefaultLegacySkin(IStorageResourceProvider resources) : this(Info, resources) { }
public TestCustomSkinWorkingBeatmap(RulesetInfo ruleset, IStorageResourceProvider resources) : base(ruleset, null, resources.AudioManager) { this.resources = resources; }
public DefaultLegacySkin(IResourceStore <byte[]> storage, IStorageResourceProvider resources) : this(Info, storage, resources) { }