// Copyright (c) Pixel Crushers. All rights reserved.
using UnityEngine;
namespace PixelCrushers.DialogueSystem
{
///
/// Abstract response menu controls. Each GUI system implementation derives its own subclass
/// from this.
///
[System.Serializable]
public abstract class AbstractUIResponseMenuControls : AbstractUIControls
{
///
/// The response button alignment -- that is, whether to align them to the first or the
/// last button. Defaults to the first button.
///
public ResponseButtonAlignment buttonAlignment = ResponseButtonAlignment.ToFirst;
///
/// Specifies whether to show buttons that aren't assigned to any responses. If you're
/// using a "dialogue wheel," for example, you'll want to show unused buttons so the entire
/// wheel structure is visible.
///
public bool showUnusedButtons = false;
///
/// Gets the subtitle reminder controls.
///
///
/// The subtitle reminder controls.
///
public abstract AbstractUISubtitleControls subtitleReminderControls { get; }
///
/// Clears the response buttons.
///
protected abstract void ClearResponseButtons();
///
/// Sets the response buttons.
///
///
/// Responses.
///
///
/// Target that will receive OnClick events from the buttons.
///
protected abstract void SetResponseButtons(Response[] responses, Transform target);
///
/// Starts the timer.
///
///
/// Timeout duration in seconds.
///
public abstract void StartTimer(float timeout);
///
/// Shows the subtitle reminder and response buttons.
///
///
/// Subtitle reminder.
///
///
/// Responses.
///
///
/// Target that will receive OnClick events from the buttons.
///
public virtual void ShowResponses(Subtitle subtitle, Response[] responses, Transform target)
{
if ((responses != null) && (responses.Length > 0))
{
subtitleReminderControls.ShowSubtitle(subtitle);
ClearResponseButtons();
SetResponseButtons(responses, target);
Show();
}
else
{
Hide();
}
}
///
/// Sets the PC portrait name and sprite to use in the response menu.
///
/// Portrait sprite.
/// Portrait name.
public virtual void SetPCPortrait(Sprite sprite, string portraitName)
{
}
[System.Obsolete("Use SetPCPortrait(Sprite,string) instead.")]
public virtual void SetPCPortrait(Texture2D texture, string portraitName)
{
}
///
/// Sets the portrait sprite to use in the response menu if the named actor is the player.
///
/// Actor name in database.
/// Portrait sprite.
public virtual void SetActorPortraitSprite(string actorName, Sprite sprite)
{
}
[System.Obsolete("Use SetActorPortraitSprite instead.")]
public virtual void SetActorPortraitTexture(string actorName, Texture2D texture)
{
}
}
}