Beispiel #1
0
        public DialogueDisplayData GetDisplayData()
        {
            if (cachedDisplayData != null)
            {
                return(cachedDisplayData);
            }

            LuaRuntime.Instance.GetFunction("reset_text_need_interpolate").Call();

            var interpolatedDisplayNames = displayNames.ToDictionary(x => x.Key, x => InterpolateText(x.Value));
            var interpolatedDialogues    = dialogues.ToDictionary(x => x.Key, x => InterpolateText(x.Value));

            DialogueDisplayData displayData;

            if (LuaRuntime.Instance.GetFunction("get_text_need_interpolate").Invoke <bool>())
            {
                displayData = new DialogueDisplayData(interpolatedDisplayNames, interpolatedDialogues);
            }
            else
            {
                // Release references of interpolatedDisplayNames and interpolatedDialogues
                displayData       = new DialogueDisplayData(displayNames, dialogues);
                cachedDisplayData = displayData;
            }

            return(displayData);
        }
Beispiel #2
0
 public LogParam(DialogueDisplayData displayData, NodeHistoryEntry nodeHistoryEntry, int dialogueIndex,
                 IReadOnlyDictionary <string, VoiceEntry> voices, int logEntryIndex)
 {
     this.displayData      = displayData;
     this.nodeHistoryEntry = nodeHistoryEntry;
     this.dialogueIndex    = dialogueIndex;
     this.voices           = voices;
     this.logEntryIndex    = logEntryIndex;
 }
Beispiel #3
0
 public DialogueChangedData(string nodeName, int dialogueIndex, DialogueDisplayData displayData,
                            Dictionary <string, VoiceEntry> voicesForNextDialogue, bool hasBeenReached)
 {
     this.nodeName              = nodeName;
     this.dialogueIndex         = dialogueIndex;
     this.displayData           = displayData;
     this.voicesForNextDialogue = voicesForNextDialogue;
     this.hasBeenReached        = hasBeenReached;
 }
Beispiel #4
0
 /// <summary>
 /// Initialize the log entry prefab
 /// </summary>
 /// <param name="displayData"></param>
 /// <param name="onGoBackButtonClicked">The action to perform when the go back button clicked</param>
 /// <param name="onPlayVoiceButtonClicked">The action to perform when the play voice button clicked</param>
 /// <param name="logEntryIndex"></param>
 public void Init(DialogueDisplayData displayData, UnityAction <int> onGoBackButtonClicked,
                  UnityAction onPlayVoiceButtonClicked, int logEntryIndex)
 {
     InitReferences();
     this.logEntryIndex         = logEntryIndex;
     this.onGoBackButtonClicked = onGoBackButtonClicked;
     InitButton(goBackButton, OnGoBackButtonClicked);
     InitButton(playVoiceButton, onPlayVoiceButtonClicked);
     this.displayData = displayData;
     UpdateText();
 }
Beispiel #5
0
 public DialogueChangedData(NodeHistoryEntry nodeHistoryEntry, int dialogueIndex,
                            DialogueDisplayData displayData, IReadOnlyDictionary <string, VoiceEntry> voicesNextDialogue, bool isReached,
                            bool isReachedAnyHistory)
 {
     this.nodeHistoryEntry    = nodeHistoryEntry;
     this.dialogueIndex       = dialogueIndex;
     this.displayData         = displayData;
     this.voicesNextDialogue  = voicesNextDialogue;
     this.isReached           = isReached;
     this.isReachedAnyHistory = isReachedAnyHistory;
 }
 public void Init(DialogueDisplayData displayData, TextAlignmentOptions alignment, Color characterNameColor,
                  Color textColor, string materialName, DialogueEntryLayoutSetting layoutSetting, int textLeftExtraPadding)
 {
     InitReferences();
     this.displayData          = displayData;
     this.alignment            = alignment;
     this.characterNameColor   = characterNameColor;
     this.textColor            = textColor;
     this.materialName         = materialName;
     this.layoutSetting        = layoutSetting;
     this.textLeftExtraPadding = textLeftExtraPadding;
     UpdateText();
 }
Beispiel #7
0
        public DialogueEntryController AddEntry(DialogueDisplayData displayData, TextAlignmentOptions alignment,
                                                Color characterNameColor, Color textColor, string materialName, DialogueEntryLayoutSetting layoutSetting, int textLeftExtraPadding)
        {
            var dec        = prefabFactory.Get <DialogueEntryController>();
            var _transform = dec.transform;

            _transform.SetParent(transform);
            _transform.SetAsLastSibling();
            _transform.localPosition = Vector3.zero;
            _transform.localRotation = Quaternion.identity;
            _transform.localScale    = Vector3.one;
            _dialogueEntryControllers.Add(dec);
            dec.Init(displayData, alignment, characterNameColor, textColor, materialName,
                     layoutSetting, textLeftExtraPadding);
            return(dec);
        }
 public void Clear()
 {
     displayData = null;
 }