public void MessageHudOpen(coGuiControl thisobj) { const int offset = 6; if (thisobj.isVisible()) return; string text = thisobj[thisobj + ".isTeamMsg"].AsBool() ? "TEAM:" : "GLOBAL:"; coGuiTextCtrl MessageHud_Text = "MessageHud_Text"; MessageHud_Text.setValue(text); coGuiBitmapBorderCtrl outerChatHud = "outerChatHud"; coGuiBitmapBorderCtrl MessageHud_Frame = "MessageHud_Frame"; //string windowPos = "0 " + outerChatHud["position"].Split(' ')[1] + (outerChatHud["extent"].Split(' ')[1].AsInt() + 1); Point2I windowPos = new Point2I(0, (outerChatHud.position.y + outerChatHud.extent.y + 1)); // string windowExt = outerChatHud["extent"].Split(' ')[0] + " " + MessageHud_Frame["extent"].Split(' ')[1]; Point2I windowExt = new Point2I(outerChatHud.extent.x, MessageHud_Frame.extent.y); //int textExtent = MessageHud_Text["extent"].Split(' ')[0].AsInt() + 14; int textExtent = MessageHud_Text.extent.x + 14; //int ctrlExtent = MessageHud_Frame["extent"].Split(' ')[0].AsInt(); int ctrlExtent = MessageHud_Frame.extent.x; ((coGuiCanvas)"Canvas").pushDialog(thisobj); MessageHud_Frame.position = windowPos; MessageHud_Frame.extent = windowExt; coGuiTextEditCtrl MessageHud_Edit = "MessageHud_Edit"; MessageHud_Edit.position.x = textExtent + offset; MessageHud_Edit.extent.x = (ctrlExtent - textExtent - (2*offset)); thisobj.setVisible(true); console.Call("deactivateKeyboard"); MessageHud_Edit.makeFirstResponder(true.AsString()); }
public void MessageHudToggleState(coGuiControl thisobj) { if (thisobj.isVisible()) MessageHudClose(thisobj); else MessageHudOpen(thisobj); }
public void MessageHudClose(coGuiControl thisobj) { if (!thisobj.isVisible()) return; (( coGuiCanvas)"Canvas").popDialog(thisobj); thisobj.setVisible(false); if (bGlobal["$enableDirectInput"]) console.Call("activateKeyboard"); (( coGuiTextEditCtrl)"MessageHud_Edit").setValue(""); }