Esempio n. 1
0
        public ConstantTableForm(string funcName)
        {
            InitializeComponent();

            _funcName = funcName;

            function = Global.luaFile.FindFunction(_funcName);
        }
Esempio n. 2
0
        private void LoadFile(string fileName)
        {
            Global.fileName = fileName;
            Global.luaFile  = new LuaFile();
            Global.luaFile.LoadFile(fileName);

            curFunction = Global.luaFile.FunctionTree.Function;
            curFuncName = Global.GetFuncName(curFunction);

            Text = _title + " (" + fileName + ")";

            UpdateControls();
        }
Esempio n. 3
0
        private void UpdateControls()
        {
            listViewMain.Items.Clear();

            LuaFile.LuaFunction curFunction = Global.luaFile.FindFunction(curFuncName);

            for (int i = 0; i < curFunction.Code.Count; ++i)
            {
                LuaFile.Instruction curIns = curFunction.Code[i];

                string paramStr = GetParamString(curIns);

                string[]     curItemStr = { i.ToString(), curIns.Operation.ToString(), paramStr, curIns.GetOpMode().ToString(), "" };
                ListViewItem curItem    = new ListViewItem(curItemStr);

                listViewMain.Items.Add(curItem);
            }
        }
Esempio n. 4
0
        private void buttonFunctions_Click(object sender, EventArgs e)
        {
            if (Global.luaFile == null)
            {
                ErrorInfo.NoFileOpened();
                return;
            }

            FunctionListForm funcListForm = new FunctionListForm(buttonFunctions.Text == "Functions" ? "" : buttonFunctions.Text);

            funcListForm.ShowDialog();

            // function choosed
            if (funcListForm.Confirm == true)
            {
                curFuncName          = funcListForm.FuncName;
                buttonFunctions.Text = curFuncName;
                curFunction          = Global.luaFile.FindFunction(curFuncName);

                UpdateControls();
            }
        }
Esempio n. 5
0
 public static string GetFuncName(LuaFile.LuaFunction func)
 {
     return(func.Header.LineDefined.ToString() + "," + func.Header.LastLineDefined.ToString());
 }