public MetaContainer(BuildInformation buildInfo, TagEntry tag, TagHierarchy tags, ICacheFile cache, IStreamManager streamManager, IRTEProvider rteProvider, Trie stringIDTrie)
        {
            InitializeComponent();

            _tag = tag;
            _tags = tags;
            _buildInfo = buildInfo;
            _cache = cache;
            _streamManager = streamManager;
            _rteProvider = rteProvider;
            _stringIDTrie = stringIDTrie;

            tbMetaEditors.SelectedIndex = (int)Settings.halomapLastSelectedMetaEditor;

            // Create Meta Information Tab
            _metaInformation = new MetaInformation(_buildInfo, _tag, _cache);
            tabTagInfo.Content = _metaInformation;

            // Create Meta Editor Tab
            _metaEditor = new MetaEditor(_buildInfo, _tag, this, _tags, _cache, _streamManager, _rteProvider, _stringIDTrie)
                              {
                                  Padding = new Thickness(0)
                              };
            tabMetaEditor.Content = _metaEditor;

            // Create Plugin Editor Tab
            _pluginEditor = new PluginEditor(_buildInfo, _tag, this, _metaEditor);
            tabPluginEditor.Content = _pluginEditor;
        }
示例#2
0
        public PluginEditor(EngineDescription buildInfo, TagEntry tag, MetaContainer parent, MetaEditor sibling)
        {
            InitializeComponent();

            txtPlugin.TextArea.TextEntered += PluginTextEntered;

            _parent  = parent;
            _sibling = sibling;

            LoadSyntaxHighlighting();
            SetHighlightColor();
            LoadCodeCompletion();

            App.AssemblyStorage.AssemblySettings.PropertyChanged += Settings_SettingsChanged;

            string groupName = VariousFunctions.SterilizeTagGroupName(CharConstant.ToString(tag.RawTag.Group.Magic)).Trim();

            _pluginPath = string.Format("{0}\\{1}\\{2}.xml", VariousFunctions.GetApplicationLocation() + @"Plugins",
                                        buildInfo.Settings.GetSetting <string>("plugins"), groupName.Trim());

            if (buildInfo.Settings.PathExists("fallbackPlugins"))
            {
                _fallbackPluginPath = string.Format("{0}\\{1}\\{2}.xml", VariousFunctions.GetApplicationLocation() + @"Plugins",
                                                    buildInfo.Settings.GetSetting <string>("fallbackPlugins"), groupName.Trim());
            }
            LoadPlugin();
        }
        public PluginEditor(BuildInformation buildInfo, TagEntry tag, MetaContainer parent, MetaEditor sibling)
        {
            InitializeComponent();

            txtPlugin.TextArea.TextEntered += PluginTextEntered;

            _parent = parent;
            _sibling = sibling;

            LoadSyntaxHighlighting();
            LoadCodeCompletion();

            Settings.SettingsChanged += Settings_SettingsChanged;

            string className = VariousFunctions.SterilizeTagClassName(CharConstant.ToString(tag.RawTag.Class.Magic));
            _pluginPath = string.Format("{0}\\{1}\\{2}.xml", VariousFunctions.GetApplicationLocation() + @"Plugins", buildInfo.PluginFolder, className);
            LoadPlugin();
        }
示例#4
0
        public PluginEditor(EngineDescription buildInfo, TagEntry tag, MetaContainer parent, MetaEditor sibling)
        {
            InitializeComponent();

            txtPlugin.TextArea.TextEntered += PluginTextEntered;

            _parent = parent;
            _sibling = sibling;

            LoadSyntaxHighlighting();
            LoadCodeCompletion();

            App.AssemblyStorage.AssemblySettings.PropertyChanged += Settings_SettingsChanged;

            string className = VariousFunctions.SterilizeTagClassName(CharConstant.ToString(tag.RawTag.Class.Magic)).Trim();
            _pluginPath =
                string.Format("{0}\\{1}\\{2}.xml", VariousFunctions.GetApplicationLocation() + @"Plugins",
                    buildInfo.Settings.GetSetting<string>("plugins"), className.Trim());
            LoadPlugin();
        }
        public MetaContainer(BuildInformation buildInfo, TagEntry tag, TagHierarchy tags, ICacheFile cache, IStreamManager streamManager)
        {
            InitializeComponent();

            _tag = tag;
            _buildInfo = buildInfo;
            _cache = cache;

            tbMetaEditors.SelectedIndex = (int)Settings.halomapLastSelectedMetaEditor;

            // Create Meta Information Tab
            MetaInformation metaInformation = new MetaInformation(_buildInfo, _tag, _cache);
            tabTagInfo.Content = metaInformation;

            // Create Meta Editor Tab
            MetaEditor metaEditor = new MetaEditor(_buildInfo, _tag, tags, _cache, streamManager);
            tabMetaEditor.Content = metaEditor;

            // Create Plugin Editor Tab
            PluginEditor pluginEditor = new PluginEditor(_buildInfo, _tag, this, metaEditor);
            tabPluginEditor.Content = pluginEditor;
        }
示例#6
0
        public MetaContainer(EngineDescription buildInfo, string cacheLocation, TagEntry tag, TagHierarchy tags, ICacheFile cache,
                             IStreamManager streamManager, IRTEProvider rteProvider, Trie stringIDTrie)
        {
            InitializeComponent();

            _cacheLocation = cacheLocation;
            _tag           = tag;
            _tags          = tags;
            _buildInfo     = buildInfo;
            _cache         = cache;
            _streamManager = streamManager;
            _rteProvider   = rteProvider;
            _stringIDTrie  = stringIDTrie;

            tbMetaEditors.SelectedIndex = (int)App.AssemblyStorage.AssemblySettings.HalomapLastSelectedMetaEditor;

            // Create Meta Information Tab
            //_metaInformation = new MetaInformation(_buildInfo, _tag, _cache);
            //tabTagInfo.Content = _metaInformation;
            if (App.AssemblyStorage.AssemblySettings.HalomapLastSelectedMetaEditor ==
                Settings.LastMetaEditorType.Info)
            {
                tbMetaEditors.SelectedIndex =
                    (int)Settings.LastMetaEditorType.MetaEditor;
            }


            // Create Meta Editor Tab
            _metaEditor           = new MetaEditor(_buildInfo, _tag, this, _tags, _cache, _streamManager, _rteProvider, _stringIDTrie);
            tabMetaEditor.Content = _metaEditor;

            // Create Plugin Editor Tab
            _pluginEditor           = new PluginEditor(_buildInfo, _tag, this, _metaEditor);
            tabPluginEditor.Content = _pluginEditor;

            // Create Raw Tabs

            #region Models

            //if (_cache.ResourceMetaLoader.SupportsRenderModels && _tag.RawTag.Group.Magic == CharConstant.FromString("mode"))
            //{
            //	tabSound.Visibility = Visibility.Visible;
            //	tabSound.Content = new SoundEditor(_tag, _cache, _streamManager);
            //}
            //else
            //{
            //	tabSound.Visibility = Visibility.Collapsed;
            //	if (App.AssemblyStorage.AssemblySettings.halomapLastSelectedMetaEditor == App.AssemblyStorage.AssemblySettings.LastMetaEditorType.Model)
            //		tbMetaEditors.SelectedIndex = (int)App.AssemblyStorage.AssemblySettings.LastMetaEditorType.MetaEditor;
            //}

            #endregion

            #region Sound

            //if (_cache.ResourceMetaLoader.SupportsSounds && _tag.RawTag.Group.Magic == CharConstant.FromString("snd!"))
            //{
            //	tabSoundEditor.Visibility = Visibility.Visible;
            //	tabSoundEditor.Content = new SoundEditor(_buildInfo, _cacheLocation, _tag, _cache, _streamManager);
            //}
            //else
            {
                tabSoundEditor.Visibility = Visibility.Collapsed;
                if (App.AssemblyStorage.AssemblySettings.HalomapLastSelectedMetaEditor ==
                    Settings.LastMetaEditorType.Sound)
                {
                    tbMetaEditors.SelectedIndex =
                        (int)Settings.LastMetaEditorType.MetaEditor;
                }
            }

            #endregion
        }
示例#7
0
        public MetaContainer(EngineDescription buildInfo, TagEntry tag, TagHierarchy tags, ICacheFile cache,
			IStreamManager streamManager, IRTEProvider rteProvider, Trie stringIDTrie)
        {
            InitializeComponent();

            _tag = tag;
            _tags = tags;
            _buildInfo = buildInfo;
            _cache = cache;
            _streamManager = streamManager;
            _rteProvider = rteProvider;
            _stringIDTrie = stringIDTrie;

            tbMetaEditors.SelectedIndex = (int) App.AssemblyStorage.AssemblySettings.HalomapLastSelectedMetaEditor;

            // Create Meta Information Tab
            _metaInformation = new MetaInformation(_buildInfo, _tag, _cache);
            tabTagInfo.Content = _metaInformation;

            // Create Meta Editor Tab
            _metaEditor = new MetaEditor(_buildInfo, _tag, this, _tags, _cache, _streamManager, _rteProvider, _stringIDTrie)
            {
                Padding = new Thickness(0)
            };
            tabMetaEditor.Content = _metaEditor;

            // Create Plugin Editor Tab
            _pluginEditor = new PluginEditor(_buildInfo, _tag, this, _metaEditor);
            tabPluginEditor.Content = _pluginEditor;

            // Create Raw Tabs

            #region Models

            //if (_cache.ResourceMetaLoader.SupportsRenderModels && _tag.RawTag.Class.Magic == CharConstant.FromString("mode"))
            //{
            //	tabSound.Visibility = Visibility.Visible;
            //	tabSound.Content = new SoundEditor(_tag, _cache, _streamManager);
            //}
            //else
            //{
            //	tabSound.Visibility = Visibility.Collapsed;
            //	if (App.AssemblyStorage.AssemblySettings.halomapLastSelectedMetaEditor == App.AssemblyStorage.AssemblySettings.LastMetaEditorType.Model)
            //		tbMetaEditors.SelectedIndex = (int)App.AssemblyStorage.AssemblySettings.LastMetaEditorType.MetaEditor;
            //}

            #endregion

            #region BSP

            /*if (true && _tag.RawTag.Class.Magic == CharConstant.FromString("sbsp")) // add some manual check here akarias, since you code isn't in blamite
            {
                tabBspEditor.Visibility = Visibility.Visible;
                tabBspEditor.Content = new BspEditor(_tag, _cache, _streamManager);
            }
            else*/
            {
                tabBspEditor.Visibility = Visibility.Collapsed;
                if (App.AssemblyStorage.AssemblySettings.HalomapLastSelectedMetaEditor == Settings.LastMetaEditorType.Bsp)
                    tbMetaEditors.SelectedIndex = (int) Settings.LastMetaEditorType.MetaEditor;
            }

            #endregion

            #region Sound

            //if (_cache.ResourceMetaLoader.SupportsSounds && _tag.RawTag.Class.Magic == CharConstant.FromString("snd!"))
            //{
            //	tabSound.Visibility = Visibility.Visible;
            //	tabSound.Content = new SoundEditor(_tag, _cache, _streamManager);
            //}
            //else
            //{
            //	tabSound.Visibility = Visibility.Collapsed;
            //	if (App.AssemblyStorage.AssemblySettings.halomapLastSelectedMetaEditor == App.AssemblyStorage.AssemblySettings.LastMetaEditorType.Sound)
            //		tbMetaEditors.SelectedIndex = (int)App.AssemblyStorage.AssemblySettings.LastMetaEditorType.MetaEditor;
            //}

            #endregion
        }
示例#8
0
        public MetaContainer(EngineDescription buildInfo, TagEntry tag, TagHierarchy tags, ICacheFile cache,
                             IStreamManager streamManager, IRTEProvider rteProvider, Trie stringIDTrie)
        {
            InitializeComponent();

            _tag           = tag;
            _tags          = tags;
            _buildInfo     = buildInfo;
            _cache         = cache;
            _streamManager = streamManager;
            _rteProvider   = rteProvider;
            _stringIDTrie  = stringIDTrie;

            tbMetaEditors.SelectedIndex = (int)App.AssemblyStorage.AssemblySettings.HalomapLastSelectedMetaEditor;

            // Create Meta Information Tab
            _metaInformation   = new MetaInformation(_buildInfo, _tag, _cache);
            tabTagInfo.Content = _metaInformation;

            // Create Meta Editor Tab
            _metaEditor = new MetaEditor(_buildInfo, _tag, this, _tags, _cache, _streamManager, _rteProvider, _stringIDTrie)
            {
                Padding = new Thickness(0)
            };
            tabMetaEditor.Content = _metaEditor;

            // Create Plugin Editor Tab
            _pluginEditor           = new PluginEditor(_buildInfo, _tag, this, _metaEditor);
            tabPluginEditor.Content = _pluginEditor;

            // Create Raw Tabs

            #region Models

            //if (_cache.ResourceMetaLoader.SupportsRenderModels && _tag.RawTag.Class.Magic == CharConstant.FromString("mode"))
            //{
            //	tabSound.Visibility = Visibility.Visible;
            //	tabSound.Content = new SoundEditor(_tag, _cache, _streamManager);
            //}
            //else
            //{
            //	tabSound.Visibility = Visibility.Collapsed;
            //	if (App.AssemblyStorage.AssemblySettings.halomapLastSelectedMetaEditor == App.AssemblyStorage.AssemblySettings.LastMetaEditorType.Model)
            //		tbMetaEditors.SelectedIndex = (int)App.AssemblyStorage.AssemblySettings.LastMetaEditorType.MetaEditor;
            //}

            #endregion

            #region BSP

            /*if (true && _tag.RawTag.Class.Magic == CharConstant.FromString("sbsp")) // add some manual check here akarias, since you code isn't in blamite
             * {
             *      tabBspEditor.Visibility = Visibility.Visible;
             *      tabBspEditor.Content = new BspEditor(_tag, _cache, _streamManager);
             * }
             * else*/
            {
                tabBspEditor.Visibility = Visibility.Collapsed;
                if (App.AssemblyStorage.AssemblySettings.HalomapLastSelectedMetaEditor == Settings.LastMetaEditorType.Bsp)
                {
                    tbMetaEditors.SelectedIndex = (int)Settings.LastMetaEditorType.MetaEditor;
                }
            }

            #endregion

            #region Sound

            //if (_cache.ResourceMetaLoader.SupportsSounds && _tag.RawTag.Class.Magic == CharConstant.FromString("snd!"))
            //{
            //	tabSound.Visibility = Visibility.Visible;
            //	tabSound.Content = new SoundEditor(_tag, _cache, _streamManager);
            //}
            //else
            //{
            //	tabSound.Visibility = Visibility.Collapsed;
            //	if (App.AssemblyStorage.AssemblySettings.halomapLastSelectedMetaEditor == App.AssemblyStorage.AssemblySettings.LastMetaEditorType.Sound)
            //		tbMetaEditors.SelectedIndex = (int)App.AssemblyStorage.AssemblySettings.LastMetaEditorType.MetaEditor;
            //}

            #endregion
        }
        public MetaContainer(EngineDescription buildInfo, string cacheLocation, TagEntry tag, TagHierarchy tags, ICacheFile cache,
                             IStreamManager streamManager, IRTEProvider rteProvider, Trie stringIDTrie)
        {
            InitializeComponent();

            _cacheLocation = cacheLocation;
            _tag           = tag;
            _tags          = tags;
            _buildInfo     = buildInfo;
            _cache         = cache;
            _streamManager = streamManager;
            _rteProvider   = rteProvider;
            _stringIDTrie  = stringIDTrie;

            tbMetaEditors.SelectedIndex = (int)App.AssemblyStorage.AssemblySettings.HalomapLastSelectedMetaEditor;

            // Create Meta Information Tab
            //_metaInformation = new MetaInformation(_buildInfo, _tag, _cache);
            //tabTagInfo.Content = _metaInformation;
            if (App.AssemblyStorage.AssemblySettings.HalomapLastSelectedMetaEditor ==
                Settings.LastMetaEditorType.Info)
            {
                tbMetaEditors.SelectedIndex =
                    (int)Settings.LastMetaEditorType.MetaEditor;
            }


            // Create Meta Editor Tab
            _metaEditor = new MetaEditor(_buildInfo, _tag, this, _tags, _cache, _streamManager, _rteProvider, _stringIDTrie)
            {
                Padding = new Thickness(0)
            };
            tabMetaEditor.Content = _metaEditor;

            // Create Plugin Editor Tab
            _pluginEditor           = new PluginEditor(_buildInfo, _tag, this, _metaEditor);
            tabPluginEditor.Content = _pluginEditor;

            // Create Raw Tabs

            #region Models

            //if (_cache.ResourceMetaLoader.SupportsRenderModels && _tag.RawTag.Class.Magic == CharConstant.FromString("mode"))
            //{
            //	tabSound.Visibility = Visibility.Visible;
            //	tabSound.Content = new SoundEditor(_tag, _cache, _streamManager);
            //}
            //else
            //{
            //	tabSound.Visibility = Visibility.Collapsed;
            //	if (App.AssemblyStorage.AssemblySettings.halomapLastSelectedMetaEditor == App.AssemblyStorage.AssemblySettings.LastMetaEditorType.Model)
            //		tbMetaEditors.SelectedIndex = (int)App.AssemblyStorage.AssemblySettings.LastMetaEditorType.MetaEditor;
            //}

            #endregion

            #region Sound

            if (_cache.ResourceMetaLoader.SupportsSounds && _tag.RawTag.Class.Magic == CharConstant.FromString("snd!"))
            {
                tabSoundEditor.Visibility = Visibility.Visible;
                tabSoundEditor.Content    = new SoundEditor(_buildInfo, _cacheLocation, _tag, _cache, _streamManager);
            }
            else
            {
                tabSoundEditor.Visibility = Visibility.Collapsed;
                if (App.AssemblyStorage.AssemblySettings.HalomapLastSelectedMetaEditor ==
                    Settings.LastMetaEditorType.Sound)
                {
                    tbMetaEditors.SelectedIndex =
                        (int)Settings.LastMetaEditorType.MetaEditor;
                }
            }

            #endregion

            // Load Info
            lblTagName.Text = tag.TagFileName != null
                                ? tag.TagFileName + "." + tag.ClassName
                                : "0x" + tag.RawTag.Index.Value.ToString("X");

            lblDatum.Text   = string.Format("Datum Index: {0}", tag.RawTag.Index);
            lblAddress.Text = string.Format("Memory Address: 0x{0:X8}", tag.RawTag.MetaLocation.AsPointer());
            lblOffset.Text  = string.Format("File Offset: 0x{0:X}", tag.RawTag.MetaLocation.AsOffset());
        }