Example #1
0
        public static void updateEditorLightingProgress()
        {
            GuiProgressBitmapCtrl RelightProgress = "RelightProgress";

            RelightProgress.setValue(omni.sGlobal["$SceneLighting::lightingProgress"]);
            if (omni.bGlobal["$lightingMission"])
            {
                omni.iGlobal["$lightingProgressThread"] = omni.Util._schedule("1", "0", "updateEditorLightingProgress");
            }
        }
Example #2
0
        public static void onMissionDownloadProgress(float progress)
        {
            if (!Global.isObject("LoadingProgress"))
            {
                return;
            }

            GuiProgressBitmapCtrl LoadingProgress = Sim.FindObject <GuiProgressBitmapCtrl>("LoadingProgress");

            LoadingProgress.setValue(progress.ToString());
            Canvas.GameCanvas.repaint(33);
        }
Example #3
0
        public static void onMissionDownloadPhase(string phase)
        {
            if (!Global.isObject("LoadingProgress"))
            {
                return;
            }

            GuiProgressBitmapCtrl LoadingProgress    = Sim.FindObject <GuiProgressBitmapCtrl>("LoadingProgress");
            GuiTextCtrl           LoadingProgressTxt = Sim.FindObject <GuiTextCtrl>("LoadingProgressTxt");

            LoadingProgress.setValue("0");
            LoadingProgressTxt.setValue(phase);
            Canvas.GameCanvas.repaint();
        }
Example #4
0
        public void lightScene(string callback, bool forceAlways)
        {
            GuiControl            RelightStatus   = "RelightStatus";
            GuiProgressBitmapCtrl RelightProgress = "RelightProgress";
            GuiCanvas             Canvas          = "Canvas";

            if (bGlobal["$lightingMission"])
            {
                return;
            }

            bGlobal["$lightingMission"] = true;
            sGlobal["$RelightCallback"] = callback;
            RelightStatus.visible       = true;
            RelightProgress.setValue("0");
            Canvas.repaint(0);
            omni.Util.lightScene("EditorLightingComplete", forceAlways.AsString());
            updateEditorLightingProgress();
        }
Example #5
0
        public static void onPhaseComplete(string text = null)
        {
            if (!Global.isObject("LoadingProgress"))
            {
                return;
            }

            GuiTextCtrl LoadingProgressTxt = Sim.FindObject <GuiTextCtrl>("LoadingProgressTxt");

            if (!string.IsNullOrEmpty(text))
            {
                LoadingProgressTxt.setValue(text);
            }


            GuiProgressBitmapCtrl LoadingProgress = Sim.FindObject <GuiProgressBitmapCtrl>("LoadingProgress");

            LoadingProgress.setValue("1");
            Canvas.GameCanvas.repaint();
        }
Example #6
0
        public static void JoinGame(uint serverIndex)
        {
            GuiProgressBitmapCtrl LoadingProgress    = Sim.FindObject <GuiProgressBitmapCtrl>("LoadingProgress");
            GuiTextCtrl           LoadingProgressTxt = Sim.FindObject <GuiTextCtrl>("LoadingProgressTxt");

            // The server info index is stored in the row along with the
            // rest of displayed info.
            if (Global.setServerInfo(serverIndex))
            {
                Core.Canvas.GameCanvas.setContent("LoadingGui");
                LoadingProgress.setValue("1");
                LoadingProgressTxt.setValue("WAITING FOR SERVER");
                Core.Canvas.GameCanvas.repaint();

                GameConnection ServerConnection = new GameConnection("ServerConnection", true);
                ServerConnection.setConnectArgs(Globals.GetString("pref::Player::Name"));
                ServerConnection.setJoinPassword(Globals.GetString("Client::Password"));
                ServerConnection.connect(Globals.GetString("ServerInfo::Address"));
            }
        }
Example #7
0
        public static void StartGame(string mission = null, string hostingType = null)
        {
            if (string.IsNullOrEmpty(mission))
            {
                GuiTextListCtrl CL_levelList = Sim.FindObject <GuiTextListCtrl>("CL_levelList");
                int             id           = CL_levelList.getSelectedId();
                mission = Global.getField(CL_levelList.getRowTextById(id), 1);
                // Alternatively:
                //error("Cannot start a level with no level selected!");
            }

            string serverType = hostingType;

            if (string.IsNullOrEmpty(hostingType))
            {
                if (Globals.GetBool("pref::HostMultiPlayer"))
                {
                    serverType = "MultiPlayer";
                }
                else
                {
                    serverType = "SinglePlayer";
                }
            }

            // Show the loading screen immediately.
            if (Global.isObject("LoadingGui"))
            {
                Core.Canvas.GameCanvas.setContent("LoadingGui");
                GuiProgressBitmapCtrl LoadingProgress    = Sim.FindObject <GuiProgressBitmapCtrl>("LoadingProgress");
                GuiTextCtrl           LoadingProgressTxt = Sim.FindObject <GuiTextCtrl>("LoadingProgressTxt");
                LoadingProgress.setValue("1");
                LoadingProgressTxt.setValue("LOADING MISSION FILE");
                Core.Canvas.GameCanvas.repaint();
            }

            Server.Server.createAndConnectToLocalServer(serverType, mission);
        }