public void PlayGuiOnWake(string thisobj) { // Turn off any shell sounds... // sfxStop( ... ); bGlobal["$enableDirectInput"] = true; Util._activateDirectInput(); coGuiCanvas canvas = "canvas"; // Message hud dialog coGuiControl MainChatHud = "MainChatHud"; if (MainChatHud.isObject()) { coGuiMessageVectorCtrl chatHud = "chatHud"; canvas.pushDialog(MainChatHud); chatHud.attach("HudMessageVector"); } // just update the action map here (( coActionMap)"moveMap").push(); // hack city - these controls are floating around and need to be clamped if (console.isFunction("refreshCenterTextCtrl")) { Util._schedule("0", "0", "refreshCenterTextCtrl"); } if (console.isFunction("refreshBottomTextCtrl")) { Util._schedule("0", "0", "refreshBottomTextCtrl"); } }
public void onMissionDownloadPhase1(string missionName, string musicTrack) { console.print("------------>onMissionDownloadPhase1('" + missionName + "', '" + musicTrack + "')"); // Load the post effect presets for this mission. string path = "levels/" + Util.fileBase(missionName) + console.GetVarString("$PostFXManager::fileExtension"); if (console.Call("isScriptFile", new[] { path }).AsBool()) { PostFXManagerloadPresetHandler(path); } else { PostFXManagersettingsApplyDefaultPreset("PostFXManager"); } // Close and clear the message hud (in case it's open) coGuiControl MessageHud = "MessageHud"; if (MessageHud.isObject()) { MessageHud.call("close"); } // Reset the loading progress controls: coGuiControl LoadingProgress = "LoadingProgress"; if (LoadingProgress.isObject()) { ((coGuiControl)"LoadingProgress").setValue("0"); ((coGuiTextCtrl)"LoadingProgressTxt").setValue("LOADING DATABLOCKS"); ((coGuiCanvas)"canvas").repaint(0); } }
public void _setShadowVizLight(string light, bool force) { coGuiControl AL_ShadowVizOverlayCtrl = "AL_ShadowVizOverlayCtrl"; if (!AL_ShadowVizOverlayCtrl.isAwake()) { return; } if (AL_ShadowVizOverlayCtrl.call("isLocked").AsBool() && !force) { return; } string sizeAndAspect = ""; if (console.isObject(light)) { string clientLight = serverToClientObject(light); //console.Call("serverToClientObject", new string[] { light }); sizeAndAspect = Util._setShadowVizLight(clientLight); } console.Call(AL_ShadowVizOverlayCtrl.findObjectByInternalName("MatCtrl", true), "setMaterial", new[] { "AL_ShadowVisualizeMaterial" }); string text = "ShadowViz"; if (console.isObject(light)) { text = text + ":" + sizeAndAspect.Split(' ')[0] + " x " + sizeAndAspect.Split(' ')[1]; } console.SetVar(AL_ShadowVizOverlayCtrl.findObjectByInternalName("WindowCtrl", true), text); }
public void TeamMessageHud(bool make) { if (make) { coGuiControl MessageHud = "MessageHud"; MessageHud["isTeamMsg"] = true.AsString(); MessageHudToggleState(MessageHud); } }
public void MessageHudToggleState(coGuiControl thisobj) { if (thisobj.isVisible()) { MessageHudClose(thisobj); } else { MessageHudOpen(thisobj); } }
public void showShadowVizForLight(string light) { coGuiControl AL_ShadowVizOverlayCtrl = "AL_ShadowVizOverlayCtrl"; if (!AL_ShadowVizOverlayCtrl.isAwake()) { ((coGuiCanvas)"Canvas").pushDialog(AL_ShadowVizOverlayCtrl, "100"); } _setShadowVizLight(light, true); }
public void onPhase3Progress(string progress) { coGuiControl LoadingProgress = "LoadingProgress"; if (!LoadingProgress.isObject()) { return; } LoadingProgress.setValue(progress); ((coGuiCanvas)"canvas").repaint(33); }
public void onPhase2Complete() { coGuiControl LoadingProgress = "LoadingProgress"; if (!LoadingProgress.isObject()) { return; } LoadingProgress.setValue("1"); ((coGuiCanvas)"canvas").repaint(0); }
public void PlayerListGuiToggle(coGuiControl thisobj) { if (thisobj.isAwake()) { (( coGuiCanvas)"Canvas").popDialog(thisobj); } else { ((coGuiCanvas)"Canvas").pushDialog(thisobj); } }
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 onMissionDownloadPhase3() { coGuiControl LoadingProgress = "LoadingProgress"; if (!LoadingProgress.isObject()) { return; } LoadingProgress.setValue("0"); ((coGuiTextCtrl)"LoadingProgressTxt").setValue("LIGHTING MISSION"); ((coGuiCanvas)"canvas").repaint(0); }
public void onFileChunkReceived(string filename, string ofs, string size) { coGuiControl LoadingProgress = "LoadingProgress"; if (!LoadingProgress.isObject()) { return; } LoadingProgress.setValue((ofs.AsDouble() / size.AsDouble()).ToString("0.0")); ((coGuiTextCtrl)"LoadingProgressTxt").setValue("Downloading " + filename + ".... "); ((coGuiCanvas)"canvas").repaint(0); }
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 onPhase3Complete() { coGuiControl LoadingProgress = "LoadingProgress"; if (LoadingProgress.isObject()) { ((coGuiTextCtrl)"LoadingProgressTxt").setValue("STARTING MISSION"); LoadingProgress.setValue("1"); ((coGuiCanvas)"canvas").repaint(0); } bGlobal["$lightingMission"] = false; }
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 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 toggleShadowViz() { coGuiControl AL_ShadowVizOverlayCtrl = "AL_ShadowVizOverlayCtrl"; if (AL_ShadowVizOverlayCtrl.isAwake()) { Util._setShadowVizLight("0"); ((coGuiCanvas)"Canvas").popDialog(AL_ShadowVizOverlayCtrl); } else { ((coGuiCanvas)"Canvas").pushDialog(AL_ShadowVizOverlayCtrl, "100"); _setShadowVizLight(console.Call("EWorldEditor", "getSelectedObject", new[] { "0" }), false); } }
public coGuiControl sfxGetActiveStateInGroup(coSimSet group) { for (uint i = 0; i < group.getCount(); i++) { coGuiControl obj = group.getObject(i); if (obj.isMemberOfClass("SFXState")) { continue; } if (obj.isActive()) { return(obj); } } return(""); }
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 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(""); }
public void ClientCmdSetDamageDirection(string direction) { coGuiControl DamageHUD = "DamageHUD"; if (!DamageHUD.isObject()) { return; } coGuiBitmapCtrl ctrl = DamageHUD.findObjectByInternalName("damage_" + direction, true); if (!ctrl.isObject()) { return; } Util._cancelAll(ctrl); ctrl.setVisible(true); ctrl.schedule("500", "setVisible", "false"); }
public void MessageHudEditOnEscape(coGuiControl thisobj) { MessageHudClose("MessageHud"); }
public void ppOptionsEnableDOFsonAction(coGuiControl thisobj) { PostFXManagersettingsEffectSetEnabled("PostFXManager", "DOF", PostFXManagergetEnableResultFromControl("PostFXManager", thisobj)); }
public bool PostFXManagergetEnableResultFromControl(string thisobj, coGuiControl control) { return(control.getValue().AsBool()); }