コード例 #1
0
        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");
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        public void onPhase3Progress(string progress)
        {
            coGuiControl LoadingProgress = "LoadingProgress";

            if (!LoadingProgress.isObject())
            {
                return;
            }
            LoadingProgress.setValue(progress);
            ((coGuiCanvas)"canvas").repaint(33);
        }
コード例 #4
0
        public void onPhase2Complete()
        {
            coGuiControl LoadingProgress = "LoadingProgress";

            if (!LoadingProgress.isObject())
            {
                return;
            }
            LoadingProgress.setValue("1");
            ((coGuiCanvas)"canvas").repaint(0);
        }
コード例 #5
0
        public void onMissionDownloadPhase3()
        {
            coGuiControl LoadingProgress = "LoadingProgress";

            if (!LoadingProgress.isObject())
            {
                return;
            }
            LoadingProgress.setValue("0");
            ((coGuiTextCtrl)"LoadingProgressTxt").setValue("LIGHTING MISSION");
            ((coGuiCanvas)"canvas").repaint(0);
        }
コード例 #6
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);
        }
コード例 #7
0
        public void onPhase3Complete()
        {
            coGuiControl LoadingProgress = "LoadingProgress";

            if (LoadingProgress.isObject())
            {
                ((coGuiTextCtrl)"LoadingProgressTxt").setValue("STARTING MISSION");
                LoadingProgress.setValue("1");
                ((coGuiCanvas)"canvas").repaint(0);
            }

            bGlobal["$lightingMission"] = false;
        }
コード例 #8
0
        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");
        }