private void Apply(GumpButton b) { if (Codex == null || Codex.Deleted || !Codex.IsChildOf(User.Backpack)) { Close(); return; } var changed = false; if (User.RawStr != Str) { User.RawStr = Str; changed = true; } if (User.RawDex != Dex) { User.RawDex = Dex; changed = true; } if (User.RawInt != Int) { User.RawInt = Int; changed = true; } if (changed) { Codex.Consume(); } Close(); }
protected override bool OnBeforeSend() { return(base.OnBeforeSend() && Codex != null && !Codex.Deleted && Codex.IsChildOf(User.Backpack)); }