Exemple #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="type">数据类型</param>
        /// <param name="defValue">默认值</param>
        /// <param name="iRowUI">属性条目UI接口</param>
        /// <param name="isEnum">是否是枚举类型</param>
        /// <param name="mapEnum">枚举单选UI字典</param>
        public DataAttr(DataAttrGroup parent, string type = "int", string defValue = "", IAttrRow iRowUI = null,
			bool isEnum = false, Dictionary<string, ComboBoxItem> mapEnum = null)
        {
            m_parent = parent;
            m_iAttrRowUI = iRowUI;
            m_type = type;
            m_defValue = defValue;
            m_isEnum = isEnum;
            m_mapEnum = mapEnum;
            m_lstWeight = null;
        }
Exemple #2
0
        public SelParticle(IAttrRow iRowParticle)
        {
            s_pW = this;
            m_iRowParticle = iRowParticle;
            m_curParticle = null;

            InitializeComponent();

            this.Owner = MainWindow.s_pW;
            createViewDoc();
            refreshParticleTree();
        }
Exemple #3
0
        public SelImage(IAttrRow iRowImage)
        {
            s_pW = this;
            m_iRowImage = iRowImage;
            m_mapLocalRes = new Dictionary<string, TreeViewItem>();
            m_mapOtherRes = new Dictionary<string, TreeViewItem>();
            m_mapPngItem = new Dictionary<string, TreeViewItem>();
            InitializeComponent();
            this.Owner = MainWindow.s_pW;

            m_curTgaCtrl = null;
            m_curImg = null;
            ImageIndex.refreshImageIndex();
            refreshResMap();
            refreshResTree();
        }
Exemple #4
0
        public newSkin(IAttrRow iAttrRow)
        {
            s_pW = this;
            m_iAttrRow = iAttrRow;
            m_pathSkinGroup = m_iAttrRow.m_parent.m_xmlCtrl.m_openedFile.m_path;
            m_skinGroupShortName = "";
            m_skinName = null;
            InitializeComponent();
            this.Owner = MainWindow.s_pW;
            if (Project.Setting.s_skinPath != null && Project.Setting.s_skinPath != "" &&
                Directory.Exists(Project.Setting.s_skinPath))
            {
                DirectoryInfo skinDi = new DirectoryInfo(Project.Setting.s_skinPath);

                foreach(FileInfo fi in skinDi.GetFiles())
                {
                    ComboBoxItem cbiSkin = new ComboBoxItem();

                    cbiSkin.Content = System.IO.Path.GetFileNameWithoutExtension(fi.Name);
                    cbiSkin.ToolTip = fi.FullName;
                    cbiSkin.Selected += mx_groupCbi_Selected;
                    mx_groupCbBox.Items.Add(cbiSkin);
                }
            }

            object ret = XmlItemContextMenu.showTmplGroup("skin", mx_tmplCbBox, mx_tmplCbi_Selected, m_iAttrRow.m_parent.m_xe.Name + "_skinTmpl");

            if (mx_tmplCbBox.Items.Count > 0)
            {
                if (ret != null && ret is ComboBoxItem)
                {
                    ComboBoxItem cbiTmpl = (ComboBoxItem)ret;

                    cbiTmpl.IsSelected = true;
                }
                else
                {
                    if (mx_tmplCbBox.Items.GetItemAt(0) is ComboBoxItem)
                    {
                        ComboBoxItem cbiFirst = (ComboBoxItem)mx_tmplCbBox.Items.GetItemAt(0);

                        cbiFirst.IsSelected = true;
                    }
                }
            }
        }
Exemple #5
0
        public SelSkin(string path, string xmlData, IAttrRow iRowSkin)
        {
            s_pW = this;
            m_isInitPath = false;
            m_path = path;
            m_iRowSkin = iRowSkin;
            m_curSkin = null;
            InitializeComponent();

            m_docView = new XmlDocument();
            XmlElement xeRoot = m_docView.CreateElement("BoloUI");
            XmlElement xePanel = m_docView.CreateElement("panel");

            xePanel.SetAttribute("w", "960");
            xePanel.SetAttribute("h", "540");
            xePanel.SetAttribute("dock", "4");
            xePanel.InnerXml = xmlData;
            m_testCtrl = (XmlElement)xePanel.FirstChild;
            string attrW = m_testCtrl.GetAttribute("w");
            string attrH = m_testCtrl.GetAttribute("h");
            string attrText = m_testCtrl.GetAttribute("text");
            m_testCtrl.RemoveAllAttributes();
            m_testCtrl.SetAttribute("baseID", "selSkinTestCtrl");
            if (attrW == "")
            {
                attrW = "300";
            }
            if (attrH == "")
            {
                attrH = "200";
            }
            if (attrText == "")
            {
                attrText = "测试Test123";
            }
            m_testCtrl.SetAttribute("w", attrW);
            m_testCtrl.SetAttribute("h", attrH);
            m_testCtrl.SetAttribute("text", attrText);
            m_docView.AppendChild(xeRoot);
            #region 显示皮肤树
            OpenedFile fileDef;
            if(MainWindow.s_pW.m_mapOpenedFiles.TryGetValue(m_path, out fileDef))
            {
                if(fileDef != null && fileDef.m_frame != null && fileDef.m_frame is XmlControl)
                {
                    XmlControl xmlCtrl = (XmlControl)fileDef.m_frame;
                    Dictionary<string, string> mapLocalGroup = new Dictionary<string,string>();

                    if(xmlCtrl.m_xmlDoc != null && xmlCtrl.m_xmlDoc.DocumentElement.Name == "BoloUI")
                    {
                        XmlDocument xmlDoc = xmlCtrl.m_xmlDoc;
                        foreach(XmlNode xn in xmlDoc.DocumentElement.ChildNodes)
                        {
                            if(xn.NodeType == XmlNodeType.Element)
                            {
                                XmlElement xe = (XmlElement)xn;

                                switch(xe.Name)
                                {
                                    case "skingroup":
                                        {
                                            #region 本地皮肤组
                                            string groupName = xe.GetAttribute("Name");
                                            string tmp;

                                            if (!mapLocalGroup.TryGetValue(groupName, out tmp))
                                            {
                                                mapLocalGroup.Add(groupName, "");
                                            }
                                            addItemByGroupName(groupName, mx_localGroup);
                                            #endregion
                                        }
                                        break;
                                    case "publicskin":
                                    case "skin":
                                        {
                                            #region 本地皮肤
                                            string skinName = xe.GetAttribute("Name");

                                            if(skinName != "")
                                            {
                                                TreeViewItem skinItem = new TreeViewItem();

                                                skinItem.Header = skinName;
                                                skinItem.ToolTip = m_path;
                                                skinItem.Selected += skinItem_Selected;

                                                mx_localSkin.Items.Add(skinItem);

                                                XmlElement xeSkin = m_docView.CreateElement(xe.Name);
                                                xeSkin.SetAttribute("Name", skinName);
                                                xeSkin.InnerXml = xe.InnerXml;
                                                xeRoot.AppendChild(xeSkin);
                                            }
                                            #endregion
                                        }
                                        break;
                                    default:
                                        break;
                                }
                            }
                        }

                        #region 未包含的皮肤组
                        DirectoryInfo di = new DirectoryInfo(Project.Setting.s_projPath + "\\skin\\");
                        FileInfo[] arrFi = di.GetFiles("*.xml");

                        foreach(FileInfo fi in arrFi)
                        {
                            string groupName = System.IO.Path.GetFileNameWithoutExtension(fi.Name);
                            string tmp;

                            if (!mapLocalGroup.TryGetValue(groupName, out tmp))
                            {
                                addItemByGroupName(groupName, mx_otherGroup);
                            }

                            XmlElement xeGroup = m_docView.CreateElement("skingroup");
                            xeGroup.SetAttribute("Name", groupName);
                            xeRoot.AppendChild(xeGroup);
                        }
                        #endregion
                    }
                }
            }
            #endregion

            xeRoot.AppendChild(xePanel);

            this.Owner = MainWindow.s_pW;
        }