11 public override bool ShowStyleMenu
20 public override void OnActivate()
22 string path = CorePath.coreWidget + base.config.id +
"/" +
"default.png";
23 string str = Lang.setting.dir +
"Widget/" + base.config.id +
"/";
24 string path2 = str +
"default.txt";
25 string path3 = str +
"siege.txt";
26 string path4 = str +
"shutup.txt";
27 if (File.Exists(path2))
29 this.linesDefault = IO.LoadTextArray(path2);
31 if (File.Exists(path3))
33 this.linesSiege = IO.LoadTextArray(path3);
35 if (File.Exists(path4))
37 this.linesShutup = IO.LoadTextArray(path4);
39 if (File.Exists(path))
41 this.image.texture = IO.LoadPNG(path, FilterMode.Point);
44 base.InvokeRepeating(
"_Update", 1f, 1f);
50 if (this.isShut && InputModuleEX.IsPointerOver(base.transform))
53 base.transform.position =
new Vector3((
float)
EMono.rnd(Screen.width), (
float)
EMono.rnd(Screen.height), 0f);
54 base.OnChangePosition();
72 string[] array = this.isSiege ? this.linesSiege : this.linesDefault;
77 string str = (
EMono.rnd(2) == 0) ?
"" : array.RandomItem<
string>();
87 public override void OnFlip()
89 this.image.transform.localScale =
new Vector3((
float)(this.flip ? 1 : -1), 1f, 1f);
93 public void Say(
string[] lines)
95 this.Say(lines.RandomItem<
string>());
99 public void Say(
string str)
101 Transform parent = this.text.transform.parent;
104 parent.SetActive(
false);
108 parent.SetActive(
true);
109 this.text.text = str;
110 base.ClampToScreenEnsured(parent, this.textPos);
112 this.nextSay = this.intervalSay +
EMono.rnd(this.intervalSay);
120 public override void OnSetContextMenu(UIContextMenu m)
122 m.AddToggle(
"shutup", this.isShut, delegate(
bool a)
125 base.config.annoyPlayer = this.isShut;
128 this.Say(this.linesShutup);
131 base.SetBaseContextMenu(m);
135 public RawImage image;
141 public int intervalSay;
144 public string[] linesDefault;
147 public string[] linesSiege;
150 public string[] linesShutup;
153 public Vector2 textPos;
156 private int nextSay = 2;
159 private bool first =
true;
162 private bool isSiege;