예제 #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("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;

            System.Windows.Forms.DialogResult r;
            ActionListForm actionlistform;

            try
            {
                ActionExp[] exps = null;
                if (table["data"] != null)
                {
                    exps = (table["data"] as ActionData).ActionExpArray;
                }
                actionlistform = new ActionListForm(exps, table["event_data"] as GameEvent);
                actionlistform.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
                r = actionlistform.ShowDialog();
            }
            catch (LuaInterface.LuaException ex)
            {
                this.printInfo(ex.ToString());
                return(false);
            }

            if (r == System.Windows.Forms.DialogResult.OK)
            {
                this.data        = new ActionData(actionlistform.actionExpList);
                this.text        = actionlistform.actionExpListText;
                this.TooltipText = actionlistform.actionExpListText_Full;
                ScanConst(table);
                return(true);
            }
            return(false);
        }
예제 #2
0
파일: ActionEditor.cs 프로젝트: viticm/pap2
        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("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;

            System.Windows.Forms.DialogResult r;
            ActionListForm actionlistform;
            try
            {
                ActionExp[] exps = null;
                if (table["data"] != null)
                {
                    exps = (table["data"] as ActionData).ActionExpArray;                    
                }
                actionlistform = new ActionListForm(exps, table["event_data"] as GameEvent);
                actionlistform.StartPosition =  System.Windows.Forms.FormStartPosition.CenterParent;
                r = actionlistform.ShowDialog();
            }
            catch(LuaInterface.LuaException ex)
            {
                this.printInfo(ex.ToString());
                return false;
            }

            if( r == System.Windows.Forms.DialogResult.OK)
            {
                this.data = new ActionData(actionlistform.actionExpList);
                this.text = actionlistform.actionExpListText;
                this.TooltipText = actionlistform.actionExpListText_Full;
                ScanConst(table);
                return true;
            }
            return false;
        }