Linking the octo localization system to the dialogue system
This commit is contained in:
@@ -49,7 +49,6 @@ namespace Unheimlich.Handlers.DetectiveBoard
|
||||
DetectiveBoardManager.Instance.UnlockClue(_clueToUnlock);
|
||||
_hasUnlocked = true;
|
||||
|
||||
Debug.Log($"[ClueUnlockOnInteraction] Unlocked clue: {_clueToUnlock.Title} via interaction");
|
||||
}
|
||||
|
||||
if (_inspectableItem != null)
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ namespace Unheimlich.Interactions.FloatingWords
|
||||
|
||||
public string GetChoiceText()
|
||||
{
|
||||
return DialogueData?.ChoiceText ?? string.Empty;
|
||||
return DialogueData?.GetLocalizedChoiceText() ?? string.Empty;
|
||||
}
|
||||
|
||||
public DialogueNode GetNextNode()
|
||||
|
||||
@@ -2,12 +2,17 @@ using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using Unheimlich.Data.Dialogues;
|
||||
using Unheimlich.Gameplay.Player;
|
||||
using OctoCore.Localization;
|
||||
|
||||
namespace Unheimlich.Interactions.FloatingWords
|
||||
{
|
||||
public class ObjectDescriptionTrigger : MonoBehaviour
|
||||
{
|
||||
[Header("Description")]
|
||||
[Tooltip("Localized description text (recommended)")]
|
||||
[SerializeField] private OctoLocalizedTextData _descriptionTextLocalized;
|
||||
|
||||
[Tooltip("Fallback description text if localized version is not set")]
|
||||
[SerializeField] private string _descriptionText = "Mysterious Object";
|
||||
|
||||
[Header("Settings")]
|
||||
@@ -99,12 +104,16 @@ namespace Unheimlich.Interactions.FloatingWords
|
||||
ObjectDescriptionTriggerReference triggerRef = _wordsRotator.AddComponent<ObjectDescriptionTriggerReference>();
|
||||
triggerRef.Trigger = this;
|
||||
|
||||
string descText = _descriptionTextLocalized != null
|
||||
? OctoLocalization.GetLocalizedText(_descriptionTextLocalized)
|
||||
: _descriptionText;
|
||||
|
||||
List<DialogueChoiceData> dummyChoices = new List<DialogueChoiceData>();
|
||||
for (int i = 0; i < _settings.WordCount; i++)
|
||||
{
|
||||
dummyChoices.Add(new DialogueChoiceData
|
||||
{
|
||||
ChoiceText = _descriptionText,
|
||||
ChoiceText = _descriptionTextLocalized,
|
||||
NextNode = null
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user