private void CALL_EndEvent_button_Click(object sender, EventArgs e)
        {
            uint mapid = EventCondForm.GetMapID(this.ParentControls);

            this.CallEventAddr = EventCondForm.GetEndEvent(mapid);
            this.NeedFlag03    = true;
            this.Close();
        }
Beispiel #2
0
        void LoadCodes(EventTemplate et)
        {
            this.Codes = new List <EventScript.OneCode>();

            string fullfilename = Path.Combine(Program.BaseDirectory, "config", "data", et.Filename);

            if (!File.Exists(fullfilename))
            {
                return;
            }

            string XXXXXXXX = null;
            string YYYYYYYY = null;

            if (et.Filename.IndexOf("template_event_CALL_END_EVENT") >= 0)
            {
                XXXXXXXX = ToPointerToString(EventCondForm.GetEndEvent(this.MapID));
            }
            else if (et.Filename.IndexOf("template_event_PREPARATION") >= 0)
            {
                XXXXXXXX = ToPointerToString(EventCondForm.GetPlayerUnits(this.MapID));
                YYYYYYYY = ToPointerToString(EventCondForm.GetEnemyUnits(this.MapID));
            }
            else if (et.Filename.IndexOf("_COND_") >= 0)
            {
                uint labelX = GetUnuseLabelID(0x9000);
                XXXXXXXX = ToUShortToString(labelX);

                uint labelY = GetUnuseLabelID(labelX + 1);
                YYYYYYYY = ToUShortToString(labelY);
            }


            byte[] bin = EventScriptInnerControl.ConverteventTextToBin(fullfilename
                                                                       , EventScriptInnerControl.TermCode.NoTerm
                                                                       , XXXXXXXX, YYYYYYYY);
            uint addr  = 0;
            uint limit = (uint)bin.Length;

            while (addr < limit)
            {
                EventScript.OneCode code = Program.EventScript.DisAseemble(bin, addr);
                this.Codes.Add(code);
                addr += (uint)code.Script.Size;
            }
            this.SampleEventListbox.DummyAlloc(this.Codes.Count, 0);
        }