コード例 #1
0
        public override void Save(StreamWriter ioStream)
        {
            // first part, the SUBMENU
            Script.ScriptSection weWrite = new Script.ScriptSection();
            weWrite.SectionName = "SUBMENU " + MenuID;

            foreach (CreateItemEntry cie in SubItems)
            {
                weWrite.Add("ITEM", cie.MenuID.ToString());
            }

            foreach (CreateMenuEntry cme in SubMenus)
            {
                weWrite.Add("MENU", cme.MenuID.ToString());
            }

            weWrite.Save(ioStream);

            // second part, the MENUENTRY
            if (!isRoot)
            {
                Script.ScriptSection menuEntry = new Script.ScriptSection();
                menuEntry.SectionName = "MENUENTRY " + MenuID;

                menuEntry.Add("NAME", name);
                menuEntry.Add("ID", Conversion.ToHexString(targID));
                menuEntry.Add("COLOUR", Conversion.ToHexString(colour));
                menuEntry.Add("SUBMENU", MenuID.ToString());

                menuEntry.Save(ioStream);
            }

            foreach (CreateItemEntry cie2 in SubItems)
            {
                cie2.Save(ioStream);
            }

            foreach (CreateMenuEntry cme2 in SubMenus)
            {
                cme2.Save(ioStream);
            }
        }
コード例 #2
0
        public override void Save(StreamWriter ioStream)
        {
            // first part, the SUBMENU
            Script.ScriptSection weWrite = new Script.ScriptSection();
            weWrite.SectionName = "ITEM " + MenuID;

            weWrite.Add("NAME", name);
            weWrite.Add("ID", Conversion.ToHexString(targID));
            weWrite.Add("COLOUR", Conversion.ToHexString(colour));
            weWrite.Add("MINRANK", minRank.ToString());
            weWrite.Add("MAXRANK", maxRank.ToString());
            weWrite.Add("SOUND", Conversion.ToHexString(soundPlayed));
            weWrite.Add("ADDITEM", addItem);
            weWrite.Add("DELAY", delay.ToString());
            weWrite.Add("SPELL", spell.ToString());

            foreach (ResSkillReq rsr in SkillReqs)
            {
                weWrite.Add("SKILL", ((int)rsr.SkillNumber).ToString() + " " + rsr.MinSkill + " " + rsr.MaxSkill);
            }

            foreach (ResAmountPair rap in ResourceNeeded)
            {
                weWrite.Add("RESOURCE", Conversion.ToHexString(rap.ItemID) + " " + rap.AmountNeeded.ToString() + " " + rap.Colour.ToString());
            }

            weWrite.Save(ioStream);
        }