public InputWindow SelectInputWindow(AttrItem source, string name, string toEdit, MainWindow owner)
        {
            InputWindow window;

            switch (name)
            {
            case "bool":
                window = new Selector(toEdit, owner, SelectComboBox(name), "Input Bool");
                break;

            case "code":
                window = new CodeInput(toEdit, owner);
                break;

            case "userDefinedNode":
                window = new NodeDefInput(toEdit, owner, source);
                break;

            default:
                window = new SingleLineInput(toEdit, owner);
                break;
            }
            window.AppendTitle(source.AttrCap);
            return(window);
        }
        public static IInputWindow SelectInputWindow(AttrItem source, string name, string toEdit)
        {
            IInputWindow iw = windowGenerator.GetOrDefault(name, nullWindow)(source, toEdit);

            iw.AppendTitle(source.AttrCap);
            return(iw);
        }
        public BGMInput(string s, AttrItem item)
        {
            BGMInfo = item.Parent.parentWorkSpace.Meta.aggregatableMetas[(int)MetaType.BGMLoad].GetAllSimpleWithDifficulty("");

            InitializeComponent();

            BoxBGMData.ItemsSource = BGMInfo;

            Result        = s;
            codeText.Text = Result;
        }
Example #4
0
        public BossBGDefInput(string s, AttrItem item)
        {
            BossBGInfo = item.Parent.parentWorkSpace.Meta.aggregatableMetas[(int)MetaType.BossBG].GetAllSimpleWithDifficulty();

            InitializeComponent();

            BoxBossBGDefinitionData.ItemsSource = BossBGInfo;

            Result        = s;
            codeText.Text = Result;
        }
Example #5
0
        public BossDefInput(string s, MainWindow owner, AttrItem item)
        {
            difficulty = item.Parent.GetDifficulty();

            BulletInfo = item.Parent.parentWorkSpace.Meta.aggregatableMetas[(int)MetaType.Boss].GetAllSimpleWithDifficulty(difficulty);

            InitializeComponent();

            BoxBossDefinitionData.ItemsSource = BulletInfo;

            Result        = s;
            codeText.Text = Result;
        }
Example #6
0
        /// <summary>
        /// 将产品转换成界面需要的数据格式
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ProductItem GetProductById(object id)
        {
            ProductItem pinfo = new ProductItem();
            var         info  = GetSingle(new ProductInfoPara()
            {
                Id = int.Parse(id.ToString())
            });

            if (info != null)
            {
                pinfo.AdId = info.AdId;
                pinfo.Attr = new List <AttrItem>();

                pinfo.Desc  = info.Desc;
                pinfo.Name  = info.Name;
                pinfo.Id    = info.Id;
                pinfo.Price = info.Price;

                //格式:产品颜色=红色,绿色
                if (!string.IsNullOrEmpty(info.AttrText))
                {
                    var list = info.AttrText.Split(new char[] { '\r', '\t', '\n' });
                    foreach (var item in list)
                    {
                        if (!string.IsNullOrEmpty(item))
                        {
                            var nlist = item.Split('=');
                            if (nlist.Length >= 1)
                            {
                                AttrItem aitem = new AttrItem();
                                aitem.value = new List <string>();
                                aitem.name  = nlist[0];

                                if (!string.IsNullOrEmpty(nlist[1]))
                                {
                                    var tnlist = nlist[1].Split(new char[] { ',', ',' });
                                    for (int i = 0; i < tnlist.Length; i++)
                                    {
                                        aitem.value.Add(tnlist[i]);
                                    }
                                }

                                pinfo.Attr.Add(aitem);
                            }
                        }
                    }
                }
            }

            return(pinfo);
        }
Example #7
0
        public NodeDefInput(string s, AttrItem item)
        {
            difficulty = item.Parent.GetDifficulty();

            NodeDefModel = item.Parent.parentWorkSpace.Meta.aggregatableMetas[1].GetAllSimpleWithDifficulty(difficulty);

            InitializeComponent();

            Title = "Choose node";

            BoxNodeDefinitionData.ItemsSource = NodeDefModel;

            Result        = s;
            codeText.Text = Result;
        }
Example #8
0
        public EditorObjDefInput(string s, MetaType type, AttrItem item)
        {
            difficulty = item.Parent.GetDifficulty();

            EditorObjInfo = item.Parent.parentWorkSpace.Meta.aggregatableMetas[(int)type].GetAllSimpleWithDifficulty(difficulty);

            InitializeComponent();

            Title = "Choose " + type.ToString();

            BoxEditorObjDefinitionData.ItemsSource = EditorObjInfo;

            Result        = s;
            codeText.Text = Result;
        }
 public PathInput(string s, string ext, AttrItem owner)
 {
     InitializeComponent();
     Result        = s;
     codeText.Text = Result;
     Extension     = ext;
     try
     {
         CurrentFilePath = System.IO.Path.GetDirectoryName(owner?.Parent?.parentWorkSpace?.DocPath);
     }
     catch (ArgumentException)
     {
         CurrentFilePath = "";
     }
     ButtonBrowse_Click(null, null);
 }
Example #10
0
        private static List <ProductItem> CreateProduct()
        {
            List <ProductItem> list = new List <ProductItem>();

            //包包产品
            ProductItem p1 = new ProductItem();

            p1.AdId  = 140;
            p1.Id    = 1;
            p1.Attr  = new List <AttrItem>();
            p1.Desc  = "XX鞋子特惠专卖";
            p1.Name  = "XX鞋子特惠专卖";
            p1.Price = 108;

            AttrItem a1 = new AttrItem();

            a1.name  = "颜色";
            a1.value = new List <string>();
            a1.value.Add("红色");
            a1.value.Add("绿色");
            a1.value.Add("蓝色");

            p1.Attr.Add(a1);

            AttrItem a2 = new AttrItem();

            a2.name  = "尺寸";
            a2.value = new List <string>();
            a2.value.Add("42码");
            a2.value.Add("43码");
            a2.value.Add("44码");
            p1.Attr.Add(a2);

            list.Add(p1);

            return(list);
        }
 /// <summary>
 /// Initializes <see cref="Command"/> by target <see cref="AttrItem"/>
 /// , original input and new input.
 /// </summary>
 /// <param name="toEdit">The target <see cref="AttrItem"/>.</param>
 /// <param name="original">The original input.</param>
 /// <param name="newStr">The new input.</param>
 public EditAttrCommand(AttrItem toEdit, string original, string newStr)
 {
     _ToEdit   = toEdit;
     Original  = original;
     NewString = newStr;
 }
        public InputWindow SelectInputWindow(AttrItem source, string name, string toEdit, MainWindow owner)
        {
            InputWindow window;

            switch (name)
            {
            case "bool":
                window = new Selector(toEdit, owner, SelectComboBox(name), "Input Bool");
                break;

            case "code":
                window = new CodeInput(toEdit, owner);
                break;

            case "position":
                window = new PositionInput(toEdit, owner);
                break;

            case "target":
                window = new Selector(toEdit, owner, SelectComboBox(name), "Input Target Object");
                break;

            case "imageFile":
                window = new PathInput(toEdit, "Image File (*.png;*.jpg;*.bmp)|*.png;*.jpg;*.bmp", owner);
                break;

            case "audioFile":
                window = new PathInput(toEdit, "Audio File (*.wav;*.ogg)|*.wav;*.ogg", owner);
                break;

            case "seFile":
                window = new PathInput(toEdit, "Sound Effect File (*.wav;*.ogg)|*.wav;*.ogg", owner);
                break;

            case "luaFile":
                window = new PathInput(toEdit, "Lua File (*.lua)|*.lua", owner);
                break;

            case "lstgesFile":
                window = new PathInput(toEdit, "LuaSTG Sharp File (*.lstges)|*.lstges", owner);
                break;

            case "SCName":
                window = new Selector(toEdit, owner, SelectComboBox(name), "Input Spell Card Name");
                break;

            case "blend":
                window = new Selector(toEdit, owner, SelectComboBox(name), "Input Blend Mode Type");
                break;

            case "event":
                window = new Selector(toEdit, owner, SelectComboBox(name), "Input Event Type");
                break;

            case "interpolation":
                window = new Selector(toEdit, owner, SelectComboBox(name), "Input Interpolation Type");
                break;

            case "modification":
                window = new Selector(toEdit, owner, SelectComboBox(name), "Input Modification Type");
                break;

            case "group":
                window = new Selector(toEdit, owner, SelectComboBox(name), "Input Group Type");
                break;

            case "layer":
                window = new Selector(toEdit, owner, SelectComboBox(name), "Input Layer");
                break;

            case "stageGroup":
                window = new Selector(toEdit, owner, SelectComboBox(name), "Input Stage Group");
                break;

            case "objDifficulty":
                window = new Selector(toEdit, owner, SelectComboBox(name), "Input Difficulty");
                break;

            case "difficulty":
                window = new Selector(toEdit, owner, SelectComboBox(name), "Input Difficulty Value");
                break;

            case "prop":
                window = new Selector(toEdit, owner, SelectComboBox(name), "Input Properties");
                break;

            case "directionMode":
                window = new Selector(toEdit, owner, SelectComboBox(name), "Input Direction Mode");
                break;

            case "bulletStyle":
                window = new BulletInput(toEdit, owner);
                break;

            case "laserStyle":
                window = new LaserInput(toEdit, owner);
                break;

            case "enemyStyle":
                window = new EnemyInput(toEdit, owner);
                break;

            case "userDefinedNode":
                window = new NodeDefInput(toEdit, owner, source);
                break;

            case "bulletDef":
                window = new EditorObjDefInput(toEdit, MetaType.Bullet, owner, source);
                break;

            case "objectDef":
                window = new EditorObjDefInput(toEdit, MetaType.Object, owner, source);
                break;

            case "laserDef":
                window = new EditorObjDefInput(toEdit, MetaType.Laser, owner, source);
                break;

            case "bentLaserDef":
                window = new EditorObjDefInput(toEdit, MetaType.BentLaser, owner, source);
                break;

            case "enemyDef":
                window = new EditorObjDefInput(toEdit, MetaType.Enemy, owner, source);
                break;

            case "taskDef":
                window = new EditorObjDefInput(toEdit, MetaType.Task, owner, source);
                break;

            case "bossDef":
                window = new EditorObjDefInput(toEdit, MetaType.Boss, owner, source);    //new BossDefInput(toEdit, owner, source);
                break;

            case "image":
                window = new ImageInput(toEdit, owner, source);
                break;

            case "BGM":
                window = new BGMInput(toEdit, owner, source);
                break;

            case "se":
                window = new SEInput(toEdit, owner, source);
                break;

            case "multilineText":
                window = new MultilineInput(toEdit);
                break;

            case "bulletParam":
                window = new EditorObjParamInput(source, MetaType.Bullet, toEdit, owner);
                break;

            case "objectParam":
                window = new EditorObjParamInput(source, MetaType.Object, toEdit, owner);
                break;

            case "laserParam":
                window = new EditorObjParamInput(source, MetaType.Laser, toEdit, owner);
                break;

            case "bentLaserParam":
                window = new EditorObjParamInput(source, MetaType.BentLaser, toEdit, owner);
                break;

            case "enemyParam":
                window = new EditorObjParamInput(source, MetaType.Enemy, toEdit, owner);
                break;

            case "taskParam":
                window = new EditorObjParamInput(source, MetaType.Task, toEdit, owner);
                break;

            case "color":
                window = new ColorInput(toEdit, owner);
                break;

            case "nullableColor":
                window = new ColorInput(toEdit, owner);
                break;

            case "ARGB":
                window = new ARGBInput(toEdit, owner);
                break;

            case "vector":
                window = new VectorInput(toEdit, owner);
                break;

            case "size":
                window = new SizeInput(toEdit, owner);
                break;

            case "scale":
            case "bossBG":
                window = new BossBGDefInput(toEdit, owner, source);
                break;

            //GUGUGU
            case "colrow":
            case "velocity":
            case "velocityPos":
            case "rotation":
            case "animinterval":
            case "rect":
            case "rectNonNegative":
            case "omega":
            default:
                window = new SingleLineInput(toEdit, owner);
                break;
            }
            window.AppendTitle(source.AttrCap);
            return(window);
        }