public ModeProperties Convert()
 => new ModeProperties()
 {
     AudioState  = AudioState?.Convert() ?? new AudioState("event:/music/lvl1/main", "event:/env/amb/01_main"),
     Checkpoints = MapMeta.Convert(Checkpoints) ?? new CheckpointData[0],
     IgnoreLevelAudioLayerData = IgnoreLevelAudioLayerData,
     Inventory = MapMeta.GetInventory(Inventory) ?? PlayerInventory.Default,
     Path      = Path,
     PoemID    = PoemID
 };
Example #2
0
 public ModeProperties Convert()
 => new ModeProperties()
 {
     AudioState  = AudioState?.Convert() ?? new AudioState(SFX.music_city, SFX.env_amb_01_main),
     Checkpoints = MapMeta.Convert(Checkpoints),     // Can be null.
     IgnoreLevelAudioLayerData = IgnoreLevelAudioLayerData ?? false,
     Inventory = MapMeta.GetInventory(Inventory) ?? PlayerInventory.Default,
     Path      = Path,
     PoemID    = PoemID
 };
Example #3
0
 public ModeProperties Convert()
 => new ModeProperties()
 {
     AudioState  = AudioState?.Convert() ?? new AudioState(Sfxs.music_city, Sfxs.env_amb_01_main),
     Checkpoints = MapMeta.Convert(Checkpoints) ?? new CheckpointData[0],
     IgnoreLevelAudioLayerData = IgnoreLevelAudioLayerData,
     Inventory = MapMeta.GetInventory(Inventory) ?? PlayerInventory.Default,
     Path      = Path,
     PoemID    = PoemID
 };
Example #4
0
        public void ApplyTo(AreaData area, AreaMode mode)
        {
            area.GetMeta().Modes[(int)mode] = this;
            ModeProperties props            = area.Mode[(int)mode];

            if (props != null)
            {
                props.AudioState  = AudioState?.Convert() ?? props.AudioState;
                props.Checkpoints = MapMeta.Convert(Checkpoints) ?? props.Checkpoints;
                props.IgnoreLevelAudioLayerData = IgnoreLevelAudioLayerData ?? props.IgnoreLevelAudioLayerData;
                props.Inventory = MapMeta.GetInventory(Inventory) ?? props.Inventory;
                props.Path      = Path ?? props.Path;
                props.PoemID    = PoemID ?? props.PoemID;
            }
            else
            {
                props = Convert();
            }
            area.Mode[(int)mode] = props;
        }
 public CheckpointData Convert()
 => new CheckpointData(Level, Name, MapMeta.GetInventory(Inventory), Dreaming, AudioState?.Convert());
Example #6
0
 public CheckpointData Convert()
 => new CheckpointData(Level, Name, MapMeta.GetInventory(Inventory), Dreaming, AudioState?.Convert())
 {
     Flags    = new HashSet <string>(Flags ?? new string[0]),
     CoreMode = CoreMode
 };
Example #7
0
        public void ApplyTo(AreaData area)
        {
            if (!string.IsNullOrEmpty(Icon) && GFX.Gui.Has(Icon))
            {
                area.Icon = Icon;
            }

            if (Interlude != null)
            {
                area.Interlude = Interlude.Value;
            }

            if (CassetteCheckpointIndex != null)
            {
                area.CassetteCheckpointIndex = CassetteCheckpointIndex.Value;
            }

            if (!string.IsNullOrEmpty(TitleBaseColor))
            {
                area.TitleBaseColor = Calc.HexToColor(TitleBaseColor);
            }
            if (!string.IsNullOrEmpty(TitleAccentColor))
            {
                area.TitleAccentColor = Calc.HexToColor(TitleAccentColor);
            }
            if (!string.IsNullOrEmpty(TitleTextColor))
            {
                area.TitleTextColor = Calc.HexToColor(TitleTextColor);
            }

            if (IntroType != null)
            {
                area.IntroType = IntroType.Value;
            }

            if (Dreaming != null)
            {
                area.Dreaming = Dreaming.Value;
            }

            if (!string.IsNullOrEmpty(ColorGrade))
            {
                area.ColorGrade = ColorGrade;
            }

            if (!string.IsNullOrEmpty(Wipe))
            {
                Type            type = Assembly.GetEntryAssembly().GetType(Wipe);
                ConstructorInfo ctor = type?.GetConstructor(new Type[] { typeof(Scene), typeof(bool), typeof(Action) });
                if (type != null && ctor != null)
                {
                    area.Wipe = (scene, wipeIn, onComplete) => ctor.Invoke(new object[] { scene, wipeIn, onComplete });
                }
            }

            if (DarknessAlpha != null)
            {
                area.DarknessAlpha = DarknessAlpha.Value;
            }
            if (BloomBase != null)
            {
                area.BloomBase = BloomBase.Value;
            }
            if (BloomStrength != null)
            {
                area.BloomStrength = BloomStrength.Value;
            }

            if (!string.IsNullOrEmpty(Jumpthru))
            {
                area.Jumpthru = Jumpthru;
            }

            if (CoreMode != null)
            {
                area.CoreMode = CoreMode.Value;
            }

            if (!string.IsNullOrEmpty(CassetteNoteColor))
            {
                area.CassseteNoteColor = Calc.HexToColor(CassetteNoteColor);
            }
            if (!string.IsNullOrEmpty(CassetteSong))
            {
                area.CassetteSong = CassetteSong;
            }

            area.MountainIdle   = Mountain?.Idle?.Convert() ?? area.MountainIdle;
            area.MountainSelect = Mountain?.Select?.Convert() ?? area.MountainSelect;
            area.MountainZoom   = Mountain?.Zoom?.Convert() ?? area.MountainZoom;
            area.MountainCursor = Mountain?.Cursor?.ToVector3() ?? area.MountainCursor;
            area.MountainState  = Mountain?.State ?? area.MountainState;

            ModeProperties[] modes = area.Mode;
            area.Mode = Convert(Modes) ?? modes;
            if (modes != null)
            {
                for (int i = 0; i < area.Mode.Length && i < modes.Length; i++)
                {
                    if (area.Mode[i] == null)
                    {
                        area.Mode[i] = modes[i];
                    }
                }
            }

            MapMeta meta = area.GetMeta();

            if (meta == null)
            {
                area.SetMeta(this);
            }
            else
            {
                if (!string.IsNullOrEmpty(Parent))
                {
                    meta.Parent = Parent;
                }

                if (!string.IsNullOrEmpty(PostcardSoundID))
                {
                    meta.PostcardSoundID = PostcardSoundID;
                }

                if (!string.IsNullOrEmpty(ForegroundTiles))
                {
                    meta.ForegroundTiles = ForegroundTiles;
                }

                if (!string.IsNullOrEmpty(BackgroundTiles))
                {
                    meta.BackgroundTiles = BackgroundTiles;
                }

                if (!string.IsNullOrEmpty(AnimatedTiles))
                {
                    meta.AnimatedTiles = AnimatedTiles;
                }

                if (!string.IsNullOrEmpty(Sprites))
                {
                    meta.Sprites = Sprites;
                }

                if (!string.IsNullOrEmpty(Portraits))
                {
                    meta.Portraits = Portraits;
                }

                if (OverrideASideMeta != null)
                {
                    meta.OverrideASideMeta = OverrideASideMeta;
                }

                if ((Modes?.Length ?? 0) != 0 && Modes.Any(mode => mode != null))
                {
                    meta.Modes = Modes;
                }

                if (Mountain != null)
                {
                    meta.Mountain = Mountain;
                }

                if (CompleteScreen != null)
                {
                    meta.CompleteScreen = CompleteScreen;
                }

                if (LoadingVignetteScreen != null)
                {
                    meta.LoadingVignetteScreen = LoadingVignetteScreen;
                }

                if (LoadingVignetteText != null)
                {
                    meta.LoadingVignetteText = LoadingVignetteText;
                }

                if (CassetteModifier != null)
                {
                    meta.CassetteModifier = CassetteModifier;
                }
            }
        }