﻿using JLGames.RocketDriver.Actions.Extensions;
using JLGames.RocketDriver.Actions.i18n;
using UnityEngine.UIElements;

namespace JLGames.RocketDriver.Editor.Windows.GettingStarted
{
    internal class InfoElement
    {
        private readonly Label m_Title;
        private readonly Label m_Content;

        public Label Title => m_Title;
        public Label Content => m_Content;

        public InfoElement(VisualElement infoNode)
        {
            m_Title = infoNode.GetElementByName<Label>("title");
            m_Content = infoNode.GetElementByName<Label>("content");
        }

        public void UpdateValues(II18NManager i18NManager)
        {
            if (null == m_Title || null == i18NManager) return;

            m_Title.text = i18NManager.GetValue("start.subtitle");
            m_Content.text = i18NManager.GetValue("start.content");
        }
    }
}