using System.Collections.Generic; using Core.Language; using Excel2Json; using Fort23.UTool; namespace Fort23.Mono { [UIBinding(prefab = "EventMinLogWidget")] public partial class EventMinLogWidget : UIComponent { private EventConfig eventConfig; private void Init() { } public override void AddEvent() { } public override void DelEvent() { } public override void AddButtonEvent() { } public void CustomInit(int id, AccountFileInfo.EventList eventList, List places) { eventConfig = ConfigComponent.Instance.Get(id); if (eventConfig.SmallPlacesId != 0) { SmallPlacesConfig smallPlacesConfig = ConfigComponent.Instance.Get(eventConfig.SmallPlacesId); PlacesConfig placesConfig = ConfigComponent.Instance.Get(smallPlacesConfig.PlacesId); Text_MapName.text = $"{LanguageManager.Instance.Text(placesConfig.placeName)}-{LanguageManager.Instance.Text(smallPlacesConfig.placeName)}"; Text_MapName.gameObject.SetActive(true); } else if (eventConfig.placeID != 0) { PlacesConfig placesConfig = ConfigComponent.Instance.Get(eventConfig.placeID); Text_MapName.text = LanguageManager.Instance.Text(placesConfig.placeName); Text_MapName.gameObject.SetActive(true); } else { Text_MapName.gameObject.SetActive(false); } if (eventList == null) { Text_Name.text = "???"; } else { Text_Name.text = LanguageManager.Instance.Text(eventConfig.EventName); } if (places.Count > 0) { if (places.Contains(eventConfig.placeID)) { transform.RecoverColor(); } else { transform.Gray(); } } else { transform.RecoverColor(); } } } }