public override bool HandleEvent(OwnerGetInventoryActionsEvent E) { if (!QudUX.Concepts.Options.UI.EnableAutogetExclusions) { return(base.HandleEvent(E)); } bool wasDropped = E.Object.HasIntProperty("DroppedByPlayer"); if (wasDropped) { //temporarily remove property so it doesn't affect ShouldAutoget() logic E.Object.RemoveIntProperty("DroppedByPlayer"); } TemporarilyIgnoreQudUXSettings = true; bool isAutogetItem = E.Object.ShouldAutoget(); TemporarilyIgnoreQudUXSettings = false; if (wasDropped) { E.Object.SetIntProperty("DroppedByPlayer", 1); } if (isAutogetItem && E.Object.Understood()) { if (IsAutogetDisabledByQudUX(E.Object)) { E.AddAction("Re-enable auto-pickup for this item", "re-enable auto-pickup", CmdEnableAutoget, FireOnActor: true); } else { E.AddAction("Disable auto-pickup for this item", "disable auto-pickup", CmdDisableAutoget, FireOnActor: true); } } return(base.HandleEvent(E)); }
public override bool HandleEvent(OwnerGetInventoryActionsEvent E) { if ((E.Object.HasProperty("Hero") || E.Object.GetStringProperty("Role") == "Hero") && E.Object.HasPart(typeof(GivesRep))) { if (JournalAPI.GetMapNote(MakeSecretId(E.Object)) == null) { E.AddAction("Mark Legendary Location in Journal", "mark location in journal", CmdJournalMarkLegendary, FireOnActor: true, WorksAtDistance: true, WorksTelepathically: true); } else { E.AddAction("Remove Marked Legendary Location from Journal", "unmark location in journal", CmdJournalUnmarkLegendary, FireOnActor: true, WorksAtDistance: true, WorksTelepathically: true); } } return(base.HandleEvent(E)); }