private void OnGuiShowHighlight(int idxChoise, Rect r, GUIContent g_c, ScriptGui.MsgboxChoise choise) { ScriptGui.MsgboxChoise.ETypeHighlight type = (ScriptGui.MsgboxChoise.ETypeHighlight)choise.TypeHighlight; bool isPick = idxChoise == mNextIdxChoiseInHighlight; bool isRight = type == ScriptGui.MsgboxChoise.ETypeHighlight.Full_Green; if (isPick) { if (isRight) { AONGUI.Label(r, g_c, GUISkinIngame.customStyles[3]); AONGUI.DrawTexture(new Rect(r.x + r.width - 32, r.y + r.height - 32, 32, 32), GUISkinIngame.customStyles[3].hover.background); } else { if (type == ScriptGui.MsgboxChoise.ETypeHighlight.Words_Red && !string.IsNullOrEmpty(choise.ContentHighlight)) { var style = GUISkinIngame.customStyles[0]; var red = GUISkinIngame.customStyles[2]; var b = choise.Value.IndexOf(choise.ContentHighlight); if (b >= 0) { // var s1 = choise.Value.Substring(0, b); // var c1 = new GUIContent(s1); var p_sup = style.GetCursorPixelPosition(r, g_c, b); var s_sup = style.CalcSize(new GUIContent(choise.ContentHighlight)); AONGUI.Label(new Rect(p_sup.x - 5, p_sup.y - 2, s_sup.x, s_sup.y), "", red); // GUI.Label(r, g_c, style); } } AONGUI.Label(r, g_c, GUISkinIngame.customStyles[4]); AONGUI.DrawTexture(new Rect(r.x + r.width - 32, r.y + r.height - 32, 32, 32), GUISkinIngame.customStyles[4].hover.background); } } else { if (isRight) { AONGUI.Label(r, g_c, GUISkinIngame.customStyles[1]); } else { AONGUI.Label(r, g_c, GUISkinIngame.customStyles[5]); } } }
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; }