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 ppOptionsEnableSSAOonAction(coGuiControl thisobj) { PostFXManagersettingsEffectSetEnabled("PostFXManager", "SSAO", PostFXManagergetEnableResultFromControl("PostFXManager", thisobj)); }
public bool PostFXManagergetEnableResultFromControl(string thisobj, coGuiControl control) { return control.getValue().AsBool(); }
public void PlayerListGuiToggle(coGuiControl thisobj) { if (thisobj.isAwake()) (( coGuiCanvas)"Canvas").popDialog(thisobj); else ((coGuiCanvas)"Canvas").pushDialog(thisobj); }
public void QuickEditDropDownTextEditCtrlupdateFromChild(coGuiControl thisobj, string ctrl) { switch (console.GetVarString(ctrl + ".internalName")) { case "PopUpMenu": thisobj.findObjectByInternalName(console.Call(ctrl, "getText"), false); break; case "TextEdit": { string popup = thisobj.findObjectByInternalName("PopupMenu", false); console.Call(popup, "changeTextByID", new[] {console.Call(popup, "getSelected"), console.Call(ctrl, "getText")}); console.Call(thisobj, "onRenameItem"); } break; } }
public string AggregateControlgetValue(coGuiControl thisobj) { for (uint i = 0; i < thisobj.getCount(); i++) { string obj = thisobj.getObject(i); if (console.GetVarString(obj + ".internalName") != "") return console.Call(obj, "getValue"); } return ""; }
public void AggregateControlsetValue(coGuiControl thisobj, string val, string child) { for (uint i = 0; i < thisobj.getCount(); i++) { string obj = thisobj.getObject(i); if (obj == child) continue; if (console.GetVarString(obj + ".internalName") != "") setValueSafe(obj, val); } }
public void MessageHudEditEval(coGuiControl thisobj) { string text = Util.collapseEscape(thisobj.getValue().Trim()); coGuiControl MessageHud = "MessageHud"; if (text != "") { console.commandToServer(MessageHud["isTeamMsg"].AsBool() ? "teamMessageSent" : "messageSent", new[] {text}); } //MessageHud.call("close"); MessageHudClose(MessageHud); }
public void MessageHudEditOnEscape(coGuiControl thisobj) { MessageHudClose("MessageHud"); }
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(""); }