コード例 #1
0
 public static void InvokeTemplateDeleted(TemplateProfile profile, Template template)
 {
     if (profile != null && !profile.Deleted && template != null && OnTemplateDeleted != null)
     {
         OnTemplateDeleted(profile, template);
     }
 }
コード例 #2
0
 public static void InvokeTemplateSelected(TemplateProfile profile, Template oldTemplate)
 {
     if (profile != null && !profile.Deleted && OnTemplateSelected != null)
     {
         OnTemplateSelected(profile, oldTemplate);
     }
 }
コード例 #3
0
 public static void InvokeProfileDeleted(TemplateProfile profile)
 {
     if (profile != null && profile.Deleted && OnProfileDeleted != null)
     {
         OnProfileDeleted(profile);
     }
 }
コード例 #4
0
        protected override void Compile()
        {
            if (Profile == null)
            {
                Profile = PvPTemplates.FetchProfile(User);
            }

            base.Compile();
        }
コード例 #5
0
        public TemplateManagerGump(PlayerMobile user, Gump parent = null, TemplateProfile profile = null)
            : base(user, parent, null, 100, emptyText: "No Templates to Display.", title: "Template Manager")
        {
            Profile = profile ?? PvPTemplates.FetchProfile(user);

            EntriesPerPage = 2;

            Modal          = true;
            ForceRecompile = true;
        }
コード例 #6
0
        public static TemplateProfile FetchProfile(PlayerMobile pm, bool replace = false)
        {
            if (pm == null)
            {
                return(null);
            }

            if (!Templates.ContainsKey(pm))
            {
                Templates.Add(pm, new TemplateProfile(pm));
            }
            else if (replace || Templates[pm] == null)
            {
                Templates[pm] = new TemplateProfile(pm);
            }

            return(Templates[pm]);
        }
コード例 #7
0
        public ManageTemplateGump(PlayerMobile user, Gump parent = null, TemplateProfile profile = null,
                                  Template edit = null)
            : base(user, parent, null, null, null, null, 7020)
        {
            Profile = profile ?? PvPTemplates.FetchProfile(user);

            Modal          = true;
            ForceRecompile = true;

            if (LockMode)
            {
                return;
            }

            if (edit == null || !Profile.Contains(edit))
            {
                Title = "Create Template";

                TemplateName  = "New Template";
                TemplateNotes = "Description/Notes";

                TemplateSkills = new SkillName[0];

                TemplateStr = TemplateDex = TemplateInt = 0;
            }
            else
            {
                Title = "Edit Template";

                Template = edit;

                TemplateName  = Template.Name;
                TemplateNotes = Template.Notes;

                TemplateSkills = Template.GetActiveSkills().ToArray();

                TemplateStr = Template.Stats[StatType.Str];
                TemplateDex = Template.Stats[StatType.Dex];
                TemplateInt = Template.Stats[StatType.Int];
            }
        }
コード例 #8
0
        private static bool DeserializeTemplates(GenericReader reader)
        {
            int version = reader.GetVersion();

            switch (version)
            {
            case 0:
            {
                reader.ReadBlockDictionary(
                    () =>
                    {
                        var key = reader.ReadMobile <PlayerMobile>();
                        var val = new TemplateProfile(reader);
                        return(new KeyValuePair <PlayerMobile, TemplateProfile>(key, val));
                    },
                    Templates);
            }
            break;
            }

            return(true);
        }