Esempio n. 1
0
        /// Pauses the playback of active sound sources.
        ///
        /// @param %channels    An optional word list of channel indices or an empty
        /// string to pause sources on all channels.
        /// @param %pauseSet    An optional SimSet which is filled with the paused
        /// sources.  If not specified the global SFXPausedSet
        /// is used.
        ///
        /// @deprecated
        public static void sfxPause(List <int> channels = null, SimSet pauseSet = null)
        {
            // Did we get a set to populate?
            if (pauseSet == null)
            {
                pauseSet = SFXPausedSet;
            }

            SimSet SFXSourceSet = Sim.FindObjectByName <SimSet>("SFXSourceSet");

            int count = SFXSourceSet.getCount();

            for (uint i = 0; i < count; i++)
            {
                SFXSource source = SFXSourceSet.getObject(i).As <SFXSource>();

                int channel = sfxGroupToOldChannel(source.getGroup());
                if (channels != null && !channels.Contains(channel))
                {
                    continue;
                }

                source.pause();
                pauseSet.add(source);
            }
        }
        public void create()
        {
            GuiTextEditCtrl MeshName          = FOT("MeshName");
            GuiCheckBoxCtrl MeshMissionBounds = FOT("MeshMissionBounds");
            string          name = MeshName.getText();

            if (name == "" || Util.nameToID(name) > 0)
            {
                messageBox.MessageBoxOK("Error", "A NavMesh must have a unique name!");
                return;
            }

            NavMesh mesh = "0";

            SimSet MissionGroup = "MissionGroup";

            if (MeshMissionBounds.isStateOn())
            {
                if (!Util.isObject(MissionGroup))
                {
                    messageBox.MessageBoxOK("Error", "You must have a MissionGroup to use the mission bounds function.");
                    return;
                }
                // Get maximum extents of all objects.
                string  box   = MissionBoundsExtents(MissionGroup);
                Point3F pos   = Util.getBoxCenter(box.AsBox3F());
                string  scale = (Util.getWord(box, 3).AsInt() - Util.getWord(box, 0).AsInt()) / 2 + 5
                                + " " + (Util.getWord(box, 4).AsInt() - Util.getWord(box, 1).AsInt()) / 2 + 5
                                + " " + (Util.getWord(box, 5).AsInt() - Util.getWord(box, 2).AsInt()) / 2 + 5;

                var oc = new ObjectCreator("NavMesh", name);
                oc["position"] = pos;
                oc["scale"]    = scale;
                mesh           = oc.Create();
            }
            else
            {
                GuiTextEditCtrl MeshPosition = FOT("MeshPosition");
                GuiTextEditCtrl MeshScale    = FOT("MeshScale");

                var oc = new ObjectCreator("NavMesh", name);
                oc["position"] = MeshPosition.getText();
                oc["scale"]    = MeshScale.getText();
                mesh           = oc.Create();
            }
            MissionGroup.add(mesh);
            NavEditorGui NavEditorGui = "NavEditorGui";
            canvas       Canvas       = "Canvas";

            NavEditorGui.selectObject(mesh);

            Canvas.popDialog(this);
        }
Esempio n. 3
0
        public void quit()
        {
            GuiEditorGui GuiEditorGui = "GuiEditorGui";

            GuiEditorGui.GuiEditor GuiEditor = "GuiEditor";
            SimSet     GuiGroup = "GuiGroup";
            GuiCanvas  Canvas   = "Canvas";
            PostEffect MLAAFx   = "MLAAFx";

            this.close();
            GuiGroup.add(GuiEditorGui);
            // we must not delete a window while in its event handler, or we foul the event dispatch mechanism
            this.schedule("10", "delete");

            Canvas.setContent(GuiEditor["lastContent"]);
            bGlobal["$InGuiEditor"] = false;

            //Temp fix to disable MLAA when in GUI editor
            if (MLAAFx.isObject() && bGlobal["$MLAAFxGuiEditorTemp"])
            {
                MLAAFx.isEnabled = true;
                bGlobal["$MLAAFxGuiEditorTemp"] = false;
            }
        }