public static void InvokeTemplateDeleted(TemplateProfile profile, Template template) { if (profile != null && !profile.Deleted && template != null && OnTemplateDeleted != null) { OnTemplateDeleted(profile, template); } }
public static void InvokeTemplateSelected(TemplateProfile profile, Template oldTemplate) { if (profile != null && !profile.Deleted && OnTemplateSelected != null) { OnTemplateSelected(profile, oldTemplate); } }
public static void InvokeProfileDeleted(TemplateProfile profile) { if (profile != null && profile.Deleted && OnProfileDeleted != null) { OnProfileDeleted(profile); } }
protected override void Compile() { if (Profile == null) { Profile = PvPTemplates.FetchProfile(User); } base.Compile(); }
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; }
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]); }
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]; } }
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); }