54 lines
2.2 KiB
C#
54 lines
2.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using TMPro;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.Localization;
|
|
|
|
public class RedableMenuItem : MonoBehaviour
|
|
{
|
|
[SerializeField] TextMeshProUGUI buttonDiaryDescriptionText;
|
|
|
|
[Header("Redable Item")]
|
|
[Tooltip("This is a title, so the entry can be saved")]
|
|
public string RedableItemName;
|
|
[Tooltip("What is the number of this entry, goes according to date")]
|
|
[SerializeField] int _entryID;
|
|
[Tooltip("Whose entry is that?")]
|
|
[SerializeField] string _entryType; //{Medea,Children,Daniel,Investigators}
|
|
[Tooltip("How much space does this text take?")]
|
|
[SerializeField] float redableItemScrollViewContentNewHeight;
|
|
[Tooltip("Redable Item Text")]
|
|
[TextArea(3/*min lines*/, 15/*max lines*/)]
|
|
[SerializeField] string _redableItemText; //here goes the text of the entry
|
|
public LocalizedString localizedRedableText;
|
|
[Tooltip("Players thoughts about the entry")]
|
|
[TextArea(3/*min lines*/, 5/*max lines*/)]
|
|
[SerializeField] string _playerThoughtsText;
|
|
|
|
void Start()
|
|
{
|
|
if (redableItemScrollViewContentNewHeight < 1080)
|
|
{
|
|
redableItemScrollViewContentNewHeight = 1080; //1080 is the default price of this in Unity
|
|
}
|
|
}
|
|
|
|
public void UpdateEntry()
|
|
{
|
|
buttonDiaryDescriptionText.text = RedableItemName;
|
|
}
|
|
|
|
public void DisplayRedableItemEntryOnClick()
|
|
{
|
|
//InventoryCollectablesMenuManager.GetInstance().diaryEntryTextScrollView.gameObject.SetActive(true);
|
|
InventoryCollectablesMenuManager.GetInstance().redableItemEntryText.text = localizedRedableText.GetLocalizedString();
|
|
InventoryCollectablesMenuManager.GetInstance().redableItemTextScrollView.sizeDelta = new Vector2(/*InventoryCollectablesMenuManager.GetInstance().diaryEntryTextScrollView.sizeDelta.x*/ 0f, redableItemScrollViewContentNewHeight);
|
|
InventoryCollectablesMenuManager.GetInstance().UpdateCollectableMenuStateByName("RedableItemMenu");
|
|
InventoryManager.GetInstance().GoToCollectablesMenuState();
|
|
InventoryCollectablesMenuManager.GetInstance().UpdateCollectablesMenu();
|
|
|
|
//ExaminableItemData.GetInstance().sentencesText.text = _playerThoughtsText;
|
|
}
|
|
}
|