EventMinLogWidget.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. if (eventConfig.SmallPlacesId != 0)
  27. {
  28. SmallPlacesConfig smallPlacesConfig = ConfigComponent.Instance.Get<SmallPlacesConfig>(eventConfig.SmallPlacesId);
  29. PlacesConfig placesConfig = ConfigComponent.Instance.Get<PlacesConfig>(smallPlacesConfig.PlacesId);
  30. Text_MapName.text = LanguageManager.Instance.Text(10302,
  31. LanguageManager.Instance.Text(placesConfig.placeName),
  32. LanguageManager.Instance.Text(smallPlacesConfig.placeName));
  33. Text_MapName.gameObject.SetActive(true);
  34. }
  35. else if (eventConfig.placeID != 0)
  36. {
  37. PlacesConfig placesConfig = ConfigComponent.Instance.Get<PlacesConfig>(eventConfig.placeID);
  38. Text_MapName.text = LanguageManager.Instance.Text(placesConfig.placeName);
  39. Text_MapName.gameObject.SetActive(true);
  40. }
  41. else
  42. {
  43. Text_MapName.gameObject.SetActive(false);
  44. }
  45. if (eventList == null)
  46. {
  47. Text_Name.text = "???";
  48. }
  49. else
  50. {
  51. Text_Name.text = LanguageManager.Instance.Text(eventConfig.EventName);
  52. }
  53. if (places.Count > 0)
  54. {
  55. if (places.Contains(eventConfig.placeID))
  56. {
  57. transform.RecoverColor();
  58. }
  59. else
  60. {
  61. transform.Gray();
  62. }
  63. }
  64. else
  65. {
  66. transform.RecoverColor();
  67. }
  68. }
  69. }
  70. }