Ejemplo n.º 1
0
        public override bool Open()
        {
            var filename = GetNameWithoutExtension();

            if (CheckFileMagic(file, CityAreasMagic))
            {
                CityAreaEditor editor = new CityAreaEditor(file);
                return(true);
            }
            else if (CheckFileMagic(file, CityShopsMagic))
            {
                CityShopEditor editor = new CityShopEditor(file);
                return(true);
            }
            else if (CheckFileMagic(file, ShopMenu2Magic))
            {
                ShopMenu2Editor editor = new ShopMenu2Editor(file);
                return(true);
            }
            else if (CheckFileMagic(file, SDSConfigMagic))
            {
                SdsConfigFile SDSConfigEditor = new SdsConfigFile();
                SDSConfigEditor.ReadFromFile(file);
                return(true);
            }
            else if (CheckFileMagic(file, TapIndicesMagic))
            {
                TAPIndices editor = new TAPIndices();
                editor.ReadFromFile(file);
                return(true);
            }
            else if (CheckFileMagic(file, StreamMapMagic))
            {
                StreamEditor editor = new StreamEditor(file);
                return(true);
            }
            else if (CheckFileMagic(file, CGameMagic))
            {
                CGameData data = new CGameData(file);
                return(true);
            }
            else
            {
                // Unsure on how we should handle this. For now we will just try and hope the loader works.
                SoundSectorLoader loader = new SoundSectorLoader(file);
            }

            return(false);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Updates only the contents of the media editor
        /// </summary>
        public void UpdateMediaComponent()
        {
            if (_ignoreUpdates)
            {
                return;
            }
            StreamEditor.SetViewingComponent(_selected.MediaConnection);

            // Show by default if no media connection
            if (_selected.MediaConnection == null)
            {
                ConverterEditor.Show();
                PollerEditor.Show();
                return;
            }

            // Change if converters are allowed to be changed
            if (!_selected.MediaConnection.UsesGenericConverters)
            {
                ConverterEditor.ClearChoice();
                ConverterEditor.Hide();
            }
            else
            {
                ConverterEditor.Show();
            }

            // Change if pollers are allowed to be changed
            if (!_selected.MediaConnection.UsesGenericPollers)
            {
                PollerEditor.ClearChoice();
                PollerEditor.Hide();
            }
            else
            {
                PollerEditor.Show();
            }
        }