Example #1
0
        public override bool EditData(System.Collections.Hashtable table)
        {
            BindDelegate();
            Trace.Assert(table != null);
            Trace.Assert(table.ContainsKey("data"));
            Trace.Assert(table.ContainsKey("event_data"));
            Trace.Assert(table.ContainsKey("prev_data"));
            Trace.Assert(table.ContainsKey("next_data"));
            Trace.Assert(table.ContainsKey("flowchart_name"));
            Trace.Assert(table.ContainsKey("map_name"));

            LuaManager.GetLuaManager().InitOther("flowchart_name", table["flowchart_name"].ToString());
            LuaManager.GetLuaManager().InitOther("map_name", table["map_name"].ToString());
            LuaManager.GetLuaManager().InitOther("client_dir", table["client_dir"].ToString());

            //初始化历史表
            CacheManager.GetCacheManager().Global_Args_Table = table["globe_args"] as Hashtable;

            Exp        exp;
            List <Exp> elist;

            if (table["data"] == null)
            {
                exp   = ExpManager.CreateUnknownExp();
                elist = new List <Exp>();
            }
            else
            {
                ConditionData cd    = table["data"] as ConditionData;
                object[]      olist = cd.datalist;
                exp   = olist[0] as Exp;
                elist = olist[1] as List <Exp>;
            }

            ConditionForm expform = new ConditionForm(exp, table["event_data"] as GameEvent, elist);

            //conForm.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            //ExpForm expform = new ExpForm(exp, table["event_data"] as GameEvent, true, null);
            expform.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            if (expform.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                //清空连接线
                Hashtable outlineList = (table["next_data"] as Hashtable);
                foreach (DataElement de in outlineList.Values)
                {
                    if (!elist.Contains(de.Data as Exp))
                    {
                        de.Data        = null;
                        de.Text        = "";
                        de.TooltipText = "";
                    }
                }

                ConditionData cd = new ConditionData();
                cd.datalist = new object[] { expform.ResultExp, expform.LineExpList };
                this.data   = cd;
                this.text   = expform.ResultExp.ToString();
                if (this.text.Length > 15)
                {
                    this.text = this.text.Substring(0, 13) + "...";
                }
                if (expform.ResultExp is ActionExp)
                {
                    this.TooltipText = (expform.ResultExp as ActionExp).strFullText;
                }
                ScanConst(table);
                return(true);
            }
            return(false);
        }
Example #2
0
        public override bool EditData(System.Collections.Hashtable table)
        {
            BindDelegate();
            Trace.Assert(table != null);
            Trace.Assert(table.ContainsKey("data"));
            Trace.Assert(table.ContainsKey("event_data"));
            Trace.Assert(table.ContainsKey("prev_data"));
            Trace.Assert(table.ContainsKey("next_data"));
            Trace.Assert(table.ContainsKey("flowchart_name"));
            Trace.Assert(table.ContainsKey("map_name"));

            LuaManager.GetLuaManager().InitOther("flowchart_name", table["flowchart_name"].ToString());
            LuaManager.GetLuaManager().InitOther("map_name", table["map_name"].ToString());
            LuaManager.GetLuaManager().InitOther("client_dir", table["client_dir"].ToString());

            //初始化历史表
            CacheManager.GetCacheManager().Global_Args_Table = table["globe_args"] as Hashtable;

            Exp exp;
            List<Exp> elist;
            if(table["data"] == null)
            {
                exp = ExpManager.CreateUnknownExp();
                elist = new List<Exp>();
            }
            else
            {
                ConditionData cd = table["data"] as ConditionData;
                object[] olist = cd.datalist;
                exp = olist[0] as Exp;
                elist = olist[1] as List<Exp>;
            }

            ConditionForm expform = new ConditionForm(exp, table["event_data"] as GameEvent, elist);
            //conForm.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            //ExpForm expform = new ExpForm(exp, table["event_data"] as GameEvent, true, null);
            expform.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            if (expform.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {

                //清空连接线
                Hashtable outlineList = (table["next_data"] as Hashtable);
                foreach (DataElement de in outlineList.Values)
                {
                    if (!elist.Contains(de.Data as Exp))
                    {
                        de.Data = null;
                        de.Text = "";
                        de.TooltipText = "";
                    }
                }

                ConditionData cd = new ConditionData();
                cd.datalist = new object[]{ expform.ResultExp, expform.LineExpList};
                this.data = cd;
                this.text = expform.ResultExp.ToString();
                if (this.text.Length > 15) this.text = this.text.Substring(0, 13) + "...";
                if (expform.ResultExp is ActionExp)
                    this.TooltipText = (expform.ResultExp as ActionExp).strFullText;
                ScanConst(table);
                return true;
            }
            return false;
        }