public static void Postfix(ref bool __result, ref ScreenDialog __instance, ref CoreInputControlMapping mapping, ref IGameUIComponent triggeredUI, ref InputManager.Controls triggeredMappingID) { // Check if there's a custom input listener assigned to this dialog. If that is the case, invoke its // ApplyScreenInput. ICustomDialogInputListener listener = CustomUIManager.GetCustomDialogInputListener(__instance); if (listener != null) { __result = listener.ApplyScreenInput(mapping, triggeredUI, triggeredMappingID); } }
/// <summary> /// Assign a custom <c>ICustomDialogInputListener</c> to the specified <c>ScreenDialog</c>. /// </summary> /// <remarks> /// Each dialog can only have one associated listener. The listener method will be called /// before the main method and can stop the main method from executing if it returns <c>true</c>, /// Currently unused. /// </remarks> /// <param name="dialog">The key dialog.</param> /// <param name="listener">The assigned listener.</param> public static void SetCustomDialogInputListener(ScreenDialog dialog, ICustomDialogInputListener listener) { listeners.Add(dialog, listener); }