using NewHorizons.External.Modules; using NewHorizons.External.Modules.Props; using NewHorizons.External.SerializableData; using NewHorizons.Handlers; using Newtonsoft.Json; namespace NewHorizons.External.Configs { [JsonObject] public class TitleScreenConfig { /// /// Colour of the text on the main menu /// public MColor menuTextTint; /// /// Ship log fact required for this title screen to appear. /// public string factRequiredForTitle; /// /// Persistent condition required for this title screen to appear. /// public string conditionRequiredForTitle; /// /// If set to true, NH generated planets will not show on the title screen. If false, this title screen has the same chance as other NH planet title screens to show. /// public bool disableNHPlanets = true; /// /// If set to true, this custom title screen will merge with all other custom title screens with shareTitleScreen set to true. If false, NH will randomly select between this and other valid title screens that are loaded. /// public bool shareTitleScreen = true; /// /// Customize the skybox for this title screen /// public SkyboxModule Skybox; /// /// The music audio that will play on the title screen. Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list. /// public string music; /// /// The ambience audio that will play on the title screen. Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list. /// public string ambience; /// /// Changes the speed the main menu planet and the skybox rotates. This is in degrees per second. /// public float rotationSpeed = 1; /// /// Edit properties of the main menu planet /// public MenuPlanetModule MenuPlanet; [JsonObject] public class MenuPlanetModule { /// /// Disables the renderers of the main menu planet and all objects on it (this is to improve compatibility with other mods that don't use the NH title screen json). /// public bool destroyMenuPlanet = false; /// /// Disables the renderers of objects at the provided paths /// public string[] removeChildren; /// /// A list of DetailInfos to populate the main menu planet with. /// public SimplifiedDetailInfo[] details; /// /// Changes the speed the main menu planet. This is in degrees per second. /// public float rotationSpeed = 2; } /// /// Extra data that may be used by extension mods /// public object extras; public bool KnowsFact() => string.IsNullOrEmpty(factRequiredForTitle) || ShipLogHandler.KnowsFact(factRequiredForTitle); public bool HasCondition() => string.IsNullOrEmpty(conditionRequiredForTitle) || PlayerData.GetPersistentCondition(conditionRequiredForTitle); } }