Show / Hide Table of Contents

    Interface IDefaultInteractions

    Default interactions (when no specific interaction callback is subscribed) are defined here. This is where you define generic responses (like the famous "this doesn't work") that cover all of the interactions for which you didn't code a specific response.

    Inherited Members
    IInteractions.OnInteract(String)
    IInteractions.OnInventoryInteract(String)
    Namespace: AGS.API
    Assembly: AGS.API.dll
    Syntax
    public interface IDefaultInteractions : IInteractions

    Properties

    | Improve this Doc View Source

    OnInventoryCombination

    Called when two inventory items are combined and there is no combination event subscribed specifically for them. OnCombination(IInventoryItem)

    Declaration
    IEvent<InventoryCombinationEventArgs> OnInventoryCombination { get; }
    Property Value
    Type Description
    IEvent<InventoryCombinationEventArgs>

    The default combination event.

    Examples

    First, we subscribe to the event:

    cEgo.Inventory.OnDefaultCombination.Subscribe(onDefaultCombination);

    Then, we define the event (what do we do when the user tried to combine two random items?):

    private async Task onDefaultCombination(object sender, InventoryCombinationEventArgs args)
    {
        await cEgo.SayAsync($"I can't use {args.ActiveItem.Graphics.DisplayName} on {args.PassiveItem.Graphics.DisplayName}. It doesn't make sense!");
    }
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX