1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- 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<int> places)
- {
- eventConfig = ConfigComponent.Instance.Get<EventConfig>(id);
- if (eventConfig.SmallPlacesId != 0)
- {
- SmallPlacesConfig smallPlacesConfig = ConfigComponent.Instance.Get<SmallPlacesConfig>(eventConfig.SmallPlacesId);
- PlacesConfig placesConfig = ConfigComponent.Instance.Get<PlacesConfig>(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<PlacesConfig>(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();
- }
- }
- }
- }
|