MessagEditWindow.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class MessagEditWindow : BaseMaidPhotoWindow
  5. {
  6. public override void Awake()
  7. {
  8. base.Awake();
  9. EventDelegate.Add(this.NameInput.onChange, new EventDelegate.Callback(this.OnChangeValueName));
  10. EventDelegate.Add(this.TextInput.onChange, new EventDelegate.Callback(this.OnChangeValueText));
  11. this.VisibleCheckBox.onClick.Add(delegate(WFCheckBox check_box)
  12. {
  13. Dictionary<string, string> dictionary = base.GetWoldStoreData()["メッセージウィンドウ"];
  14. dictionary["visible"] = check_box.check.ToString();
  15. this.MessageViewer.SetActive(check_box.check);
  16. });
  17. this.UpdateChildren();
  18. }
  19. public override void Start()
  20. {
  21. base.Start();
  22. this.Init();
  23. }
  24. public void Init()
  25. {
  26. Dictionary<string, Dictionary<string, string>> woldStoreData = base.GetWoldStoreData();
  27. if (!woldStoreData.ContainsKey("メッセージウィンドウ"))
  28. {
  29. woldStoreData["メッセージウィンドウ"] = new Dictionary<string, string>();
  30. woldStoreData["メッセージウィンドウ"]["visible"] = false.ToString();
  31. woldStoreData["メッセージウィンドウ"]["name"] = string.Empty;
  32. woldStoreData["メッセージウィンドウ"]["text"] = string.Empty;
  33. }
  34. Dictionary<string, string> dictionary = woldStoreData["メッセージウィンドウ"];
  35. this.MessageViewer.SetActive(bool.Parse(dictionary["visible"]));
  36. this.VisibleCheckBox.check = bool.Parse(dictionary["visible"]);
  37. this.NameInput.value = dictionary["name"];
  38. this.TextInput.value = dictionary["text"];
  39. }
  40. public void OnChangeValueName()
  41. {
  42. this.NameLabel.text = this.NameInput.value;
  43. Dictionary<string, string> dictionary = base.GetWoldStoreData()["メッセージウィンドウ"];
  44. dictionary["name"] = this.NameLabel.text;
  45. }
  46. public void OnChangeValueText()
  47. {
  48. this.TextLabel.text = this.TextInput.value;
  49. Dictionary<string, string> dictionary = base.GetWoldStoreData()["メッセージウィンドウ"];
  50. dictionary["text"] = this.TextLabel.text;
  51. }
  52. public override void OnDeserializeEvent()
  53. {
  54. this.Init();
  55. }
  56. public new PhotoWindowManager mgr
  57. {
  58. get
  59. {
  60. return base.mgr;
  61. }
  62. }
  63. public WFCheckBox VisibleCheckBox;
  64. public UIInput NameInput;
  65. public UIInput TextInput;
  66. public GameObject MessageViewer;
  67. public UILabel NameLabel;
  68. public UILabel TextLabel;
  69. private UIWFTabPanel tab_panel_;
  70. private UIScrollView scroll_view_;
  71. }