EventMinLogWidget.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System.Collections.Generic;
  2. using Core.Language;
  3. using Excel2Json;
  4. using Fort23.UTool;
  5. namespace Fort23.Mono
  6. {
  7. [UIBinding(prefab = "EventMinLogWidget")]
  8. public partial class EventMinLogWidget : UIComponent
  9. {
  10. private EventConfig eventConfig;
  11. private void Init()
  12. {
  13. }
  14. public override void AddEvent()
  15. {
  16. }
  17. public override void DelEvent()
  18. {
  19. }
  20. public override void AddButtonEvent()
  21. {
  22. }
  23. public void CustomInit(int id, AccountFileInfo.EventList eventList, List<int> places)
  24. {
  25. eventConfig = ConfigComponent.Instance.Get<EventConfig>(id);
  26. PlacesConfig placesConfig = ConfigComponent.Instance.Get<PlacesConfig>(eventConfig.placeID);
  27. Text_MapName.text = LanguageManager.Instance.Text(placesConfig.placeName);
  28. if (eventList == null)
  29. {
  30. Text_Name.text = "???";
  31. }
  32. else
  33. {
  34. Text_Name.text = LanguageManager.Instance.Text(eventConfig.EventName);
  35. }
  36. if (places.Count > 0)
  37. {
  38. if (places.Contains(eventConfig.placeID))
  39. {
  40. transform.RecoverColor();
  41. }
  42. else
  43. {
  44. transform.Gray();
  45. }
  46. }
  47. else
  48. {
  49. transform.RecoverColor();
  50. }
  51. }
  52. }
  53. }