예제 #1
0
        void ParamSrc_Focused(object sender, EventArgs e)
        {
            EventScript.OneCode code;
            int selectID;
            int argindex;

            if (!Get_Select_ParamSrc_Object(sender, out code, out selectID, out argindex))
            {
                return;
            }

            EventScript.Arg arg   = code.Script.Args[argindex];
            uint            value = EventScriptForm.GetValueOneScriptEditSetTables(ScriptEditSetTables[selectID], arg);

            if (arg.Type == EventScript.ArgType.MAPX || arg.Type == EventScript.ArgType.MAPY)
            {
                NumericUpDown xObj;
                NumericUpDown yObj;
                if (arg.Type == EventScript.ArgType.MAPX)
                {
                    xObj = (NumericUpDown)sender;
                    yObj = ScriptEditSetTables[selectID + 1].ParamSrc;
                }
                else
                {
                    xObj = ScriptEditSetTables[selectID - 1].ParamSrc;
                    yObj = (NumericUpDown)sender;
                }
                bool updateLock = false;

                Func <int, int, int> movecallback = (int x, int y) =>
                {
                    if (updateLock)
                    {
                        return(0);
                    }
                    updateLock = true;

                    U.ForceUpdate(xObj, x);
                    U.ForceUpdate(yObj, y);

                    updateLock = false;
                    return(0);
                };
            }
        }
예제 #2
0
        private void ParamLabel_Clicked(object sender, EventArgs e)
        {
            EventScript.OneCode code;
            int selectID;
            int argindex;

            if (!Get_Select_ParamSrc_Object(sender, out code, out selectID, out argindex))
            {
                return;
            }

            NumericUpDown src_object = ScriptEditSetTables[selectID].ParamSrc;

            EventScript.Arg arg   = code.Script.Args[argindex];
            uint            value = EventScriptForm.GetValueOneScriptEditSetTables(ScriptEditSetTables[selectID], arg);

            if (arg.Type == EventScript.ArgType.POINTER_TEXT)
            {
                CStringForm f = (CStringForm)InputFormRef.JumpForm <CStringForm>();
                f.Init(src_object);
            }
            else if (arg.Type == EventScript.ArgType.POINTER_PROCS)
            {
                ProcsScriptForm f = (ProcsScriptForm)InputFormRef.JumpForm <ProcsScriptForm>(U.NOT_FOUND);
                f.JumpTo(value);
            }
            else if (arg.Type == EventScript.ArgType.POINTER_ASM)
            {
                DisASMForm f = (DisASMForm)InputFormRef.JumpForm <DisASMForm>(U.NOT_FOUND);
                f.JumpTo(DisassemblerTrumb.ProgramAddrToPlain(value));
            }
            else if (arg.Type == EventScript.ArgType.POINTER_AIUNIT)
            {
                AIUnitsForm f = (AIUnitsForm)InputFormRef.JumpFormLow <AIUnitsForm>();
                f.JumpTo(value);
                f.ShowDialog();
                U.SetActiveControl(src_object);
                U.ForceUpdate(src_object, f.GetBaseAddress());
            }
        }