private void PreItemShowHighlight(MChoise c, GButton bt) { if (!string.IsNullOrEmpty(c.choise.ContentHighlight)) { var b = c.text.IndexOf(c.choise.ContentHighlight); if (b >= 0) { var tf = bt.GetChild("title").asRichTextField; string raw = c.text; string replace = c.choise.ContentHighlight; raw = raw.Replace(replace, "[color=#000000][u]" + replace + "[/u][/color]"); tf.text = raw; } } }
private void RefreshItemShowHighlight(int idxChoise, int nextIdxChoise, MChoise c, GButton bt) { ScriptGui.MsgboxChoise.ETypeHighlight type = (ScriptGui.MsgboxChoise.ETypeHighlight)c.choise.TypeHighlight; bool isPick = idxChoise == nextIdxChoise; bool isRight = type == ScriptGui.MsgboxChoise.ETypeHighlight.Full_Green; if (isPick) { if (isRight) { bt.GetController("c1").SetSelectedPage("p_r"); } else { bt.GetController("c1").SetSelectedPage("p_w"); } } else { if (isRight) { bt.GetController("c1").SetSelectedPage("j_r"); } else { bt.GetController("c1").SetSelectedPage("j_w"); } } if (!isPick) { bt.text = c.text; } else if (!string.IsNullOrEmpty(c.choise.ContentHighlight)) { if (type == ScriptGui.MsgboxChoise.ETypeHighlight.Full_Green) { var b = c.text.IndexOf(c.choise.ContentHighlight); if (b >= 0) { var tf = bt.GetChild("title").asRichTextField; string raw = c.text; string replace = c.choise.ContentHighlight; raw = raw.Replace(replace, "[color=#4c9d5f][u]" + replace + "[/u][/color]"); tf.text = raw; } } else { var b = c.text.IndexOf(c.choise.ContentHighlight); if (b >= 0) { var tf = bt.GetChild("title").asRichTextField; string raw = c.text; string replace = c.choise.ContentHighlight; raw = raw.Replace(replace, "[color=#FF3300][u]" + replace + "[/u][/color]"); tf.text = raw; } } } bt.grayed = true; bt.selected = false; }