public override void onAction()
            {
                GuiEditorPrefsDlg GuiEditorPrefsDlg = "GuiEditorPrefsDlg";
                GuiCanvas         Canvas            = "Canvas";

                Canvas.popDialog(GuiEditorPrefsDlg);
            }
Esempio n. 2
0
        public static void DbgWatchDialogEdit()
        {
            GuiTextEditCtrl      EditWatchDialogValue = "EditWatchDialogValue";
            GuiTextListCtrl      DebuggerWatchView    = "DebuggerWatchView";
            DebuggerEditWatchDlg DebuggerEditWatchDlg = "DebuggerEditWatchDlg";
            TCPDebugger          TCPDebugger          = "TCPDebugger";
            GuiCanvas            Canvas = "Canvas";

            string newValue = EditWatchDialogValue.getValue();
            int    id       = DebuggerWatchView.getSelectedId();

            if (id >= 0)
            {
                string row  = DebuggerWatchView.getRowTextById(id);
                string expr = omni.Util.getField(row, 0);
                string assignment;
                if (newValue == "")
                {
                    assignment = expr + " = \"\"";
                }
                else
                {
                    assignment = expr + " = " + newValue;
                }
                TCPDebugger.send("EVAL " + id + " 0 " + assignment + "\r\n");
            }
            Canvas.popDialog(DebuggerEditWatchDlg);
        }
        //-----------------------------------------------------------------------------
        // Called when all datablocks have been transmitted.
        public void onEnterGame()
        {
            //TODO should this be pClient
            //GameConnection client = Sim.FindObject<GameConnection>(pClient);

            // Create a camera for the client.
            Camera theCamera = new Camera("TheCamera")
            {
                DataBlock = Sim.FindObjectByName <CameraData>("Observer")
            };

            theCamera.registerObject();
            theCamera.setTransform(new TransformF(new Point3F(0, 0, 2), new AngAxisF(1, 0, 0, 0)));

            // Cameras are not ghosted (sent across the network) by default; we need to
            // do it manually for the client that owns the camera or things will go south
            // quickly.
            theCamera.scopeToClient(this);
            // And let the client control the camera.
            setControlObject(theCamera);
            // Add the camera to the group of game objects so that it's cleaned up when
            // we close the game.
            SimGroup gameGroup = Sim.FindObject <SimGroup>("GameGroup");

            gameGroup.add(theCamera);
            // Activate HUD which allows us to see the game. This should technically be
            // a commandToClient, but since the client and server are on the same
            // machine...
            GuiCanvas canvas = Sim.FindObject <GuiCanvas>("Canvas");

            canvas.setContent(Sim.FindObject <GuiTSCtrl>("PlayGui"));
            Global.activateDirectInput();
        }
Esempio n. 4
0
        public static void ClientCmdGameEnd(string endgamepause)
        {
            audio.sfxStopAll("");


            if (GuiCanvas.EditorIsActive() || GuiCanvas.GuiEditorIsActive())
            {
                return;
            }
            // Copy the current scores from the player list into the
            // end game gui (bit of a hack for now).
            GuiTextListCtrl EndGameGuiList = "EndGameGuiList";

            EndGameGuiList.clear();

            GuiTextListCtrl PlayerListGuiList = "PlayerListGuiList";

            for (int i = 0; i < PlayerListGuiList.rowCount(); i++)
            {
                string text = PlayerListGuiList.getRowText(i);
                string id   = PlayerListGuiList.getRowId(i).AsString();
                EndGameGuiList.addRow(id.AsInt(), text, -1);
            }
            EndGameGuiList.sortNumerical(1, false);
            ((GuiCanvas)"Canvas").setContent("EndGameGui");

            if (endgamepause.AsInt() > 0)
            {
                omni.Util._schedule((endgamepause.AsInt() * 1000).AsString(), "0", "ShowLoading");
            }
        }
        public void loadDialog(GuiControl ctrl)
        {
            GuiCanvas       Canvas                    = "Canvas";
            GuiSliderCtrl   AlphaLevelSlider          = "AlphaLevelSlider";
            GuiSliderCtrl   MouseOverAlphaLevelSlider = "MouseOverAlphaLevelSlider";
            GuiTextEditCtrl AlphaLevelText            = "AlphaLevelText";
            GuiTextEditCtrl MouseOverAlphaLevelText   = "MouseOverAlphaLevelText";
            GuiTextEditCtrl AlphaFadeTimeText         = "AlphaFadeTimeText";

            this["ctrl"] = ctrl;
            this.checkAllowedDialogs();
            Canvas.pushDialog(this);

            if (this.ctrl["alpha"].AsBool())
            {
                this["oldAlphaValue"]     = ctrl.getAlphaValue().AsString();
                AlphaLevelSlider["value"] = this["oldAlphaValue"];
                AlphaLevelText["text"]    = this["oldAlphaValue"];
            }
            if (this.ctrl.mouseOverAlpha)
            {
                this["oldMouseOverAlphaValue"]     = ctrl.getMouseOverAlphaValue().AsString();
                MouseOverAlphaLevelSlider["value"] = this["oldMouseOverAlphaValue"];
                MouseOverAlphaLevelText["text"]    = this["oldMouseOverAlphaValue"];
            }
            if (this.ctrl.alphaFade)
            {
                this["oldAlphaFadeTime"]  = ctrl.getAlphaFadeTime().AsString();
                AlphaFadeTimeText["text"] = this["oldAlphaFadeTime"];
            }
        }
Esempio n. 6
0
            public override void onClick(string SelectedidString)
            {
                MessageBoxSaveChangesDlg MessageBoxSaveChangesDlg = "MessageBoxSaveChangesDlg";
                GuiCanvas Canvas = "Canvas";

                Canvas.popDialog(MessageBoxSaveChangesDlg);
            }
        public override void onRightMouseDown(string item, string pts, string obj)
        {
            GuiCanvas Canvas = "Canvas";

            MenuBuilder popup;

            if (this.getSelectedItemsCount() > 1)
            {
                popup = this.contextMenuMultiSel;
                popup.showPopup(Canvas);
            }
            else if (obj.isObject())
            {
                popup = this.contextMenu;

                popup.checkItem(3, ((GuiControl)obj)["locked"].AsBool());
                popup.checkItem(4, (!((GuiControl)obj).isVisible()));

                popup.enableItem(6, ((GuiControl)obj).isContainer);
                popup.enableItem(7, (((GuiControl)obj).getCount() > 0));
                popup.enableItem(8, (((GuiControl)obj).getCount() > 0));

                popup["object"] = obj;
                popup.showPopup(Canvas);
            }
        }
Esempio n. 8
0
    public void Start()
    {
        var shinyBitsTransform = transform
            .FindChild("ShinyBits");

        CanDepositObject = transform.FindChild("CanDeposit").gameObject;

        foreach (Transform t in shinyBitsTransform)
        {
            ShinyBits.Add(t.gameObject);
        }

        UpdateShinyDisplay();

        _guiCanvas = GuiCanvas.Instance;

        foreach (var mileStone in ExecutedMilestones)
        {
            if (mileStone.Id != null)
            {
                var birdSpawn = FindObjectsOfType<BirdSpawn>().FirstOrDefault(b => b.Id == mileStone.Id);
                if (birdSpawn == null)
                {
                    Debug.LogError("Expected BirdSpawn With Id '" + mileStone.Amount + "'");
                    continue;
                }

                birdSpawn.SpawnBird();
            }
        }
    }
Esempio n. 9
0
        public static void Tree(SimObject obj)
        {
            InspectTreeView InspectTreeView = "InspectTreeView";
            GuiCanvas       Canvas          = "Canvas";

            Canvas.popDialog("simViewDlg");
            Canvas.pushDialog("simViewDlg", 20);
            InspectTreeView.open(obj);
        }
Esempio n. 10
0
        public void create()
        {
            GuiEditorNewGuiDialog GuiEditorNewGuiDialog = "GuiEditorNewGuiDialog";
            GuiCanvas             Canvas = "Canvas";

            GuiEditorNewGuiDialog.init("NewGui", "GuiControl");

            Canvas.pushDialog(GuiEditorNewGuiDialog);
        }
Esempio n. 11
0
        public static void hideCursor()
        {
            if (Globals.GetBool("cursorControlled"))
            {
                Global.lockMouse(true);
            }
            GuiCanvas canvas = Sim.FindObjectByName <GuiCanvas>("Canvas");

            canvas.cursorOff();
        }
Esempio n. 12
0
	// Use this for initialization
	void Start ()
	{
	    _guiCanvas = GuiCanvas.Instance;

        GetComponent<MeshRenderer>().enabled = false;
        if (!CollectedList.Contains(Guid))
        {
            SpawnCollectable();
        }
	}
Esempio n. 13
0
    public void Start()
    {
        _guiCanvas = GuiCanvas.Instance;
        _talkingUi = _guiCanvas.TalkingUi;

        QMark = transform.FindChild("?").gameObject;
        QMark.SetActive(false);

        Lines = TextLoader.Instance.GetLinesById(TextId);
    }
        public void loadDialog(GuiControl ctrl)
        {
            GuiCanvas       Canvas       = "Canvas";
            GuiTextEditCtrl fontSizeText = "fontSizeText";

            this["ctrl"]        = ctrl;
            this["oldFontSize"] = ctrl.getControlFontSize().AsString();
            Canvas.pushDialog(this);
            fontSizeText.text = this["oldFontSize"];
        }
Esempio n. 15
0
        public void loadDialog(GuiWindowCtrl ctrl)
        {
            GuiCanvas       Canvas    = "Canvas";
            GuiTextEditCtrl TitleText = "TitleText";

            this.ctrl            = ctrl;
            this["oldTitleName"] = ctrl.getWindowTitle();
            Canvas.pushDialog(this);
            TitleText.text = this["oldTitleName"];
        }
        public void create()
        {
            ModuleDefinition ConsoleModule = new ModuleDefinition("Console");

            //Todo format should be optional
            ConsoleModule.Add(Engine.TamlRead("modules/GUIExample/1/gui/ExampleDialog.gui.taml", "xml"));
            GuiCanvas Canvas = new GuiCanvas("Canvas");

            //Todo layer should be optional
            Canvas.PushDialog(new GuiControl("ExampleDialog"), 0);
        }
        // Called when all datablocks from above have been transmitted.
        public void onDataBlocksDone(string sequence)
        {
            //closeSplashWindow();
            GuiCanvas canvas = Sim.FindObjectByName <GuiCanvas>("Canvas");

            canvas.showWindow();

            // Start sending ghosts to the client.
            activateGhosting();
            onEnterGame();
        }
Esempio n. 18
0
            public override void onClick(string SelectedidString)
            {
                MessageBoxSaveChangesDlg MessageBoxSaveChangesDlg = "MessageBoxSaveChangesDlg";
                GuiCanvas Canvas = "Canvas";

                if (MessageBoxSaveChangesDlg["SaveCallback"] != "")
                {
                    Util.eval(MessageBoxSaveChangesDlg["SaveCallback"] + "(" + MessageBoxSaveChangesDlg["Data"] + ");");
                }
                Canvas.popDialog(MessageBoxSaveChangesDlg);
            }
Esempio n. 19
0
        public static void DbgFileViewFind()
        {
            DebuggerFileView DebuggerFileView       = "DebuggerFileView";
            GuiTextEditCtrl  DebuggerFindStringText = "DebuggerFindStringText";
            GuiCanvas        Canvas          = "Canvas";
            DebuggerFindDlg  DebuggerFindDlg = "DebuggerFindDlg";

            string searchString = DebuggerFindStringText.getValue();

            DebuggerFileView.findString(searchString);

            Canvas.popDialog(DebuggerFindDlg);
        }
Esempio n. 20
0
        public static void GetEaseF(string currentEase, string callback, GuiCanvas root)
        {
            GuiEaseEditDlg GuiEaseEditDlg = "GuiEaseEditDlg";
            GuiCanvas      Canvas         = "Canvas";

            GuiEaseEditDlg.init(currentEase, callback);

            if (!root.isObject())
            {
                root = Canvas;
            }

            root.pushDialog(GuiEaseEditDlg);
        }
        // This function pushes the color picker dialog and returns to a callback the selected value
        public static void GetColorI(string currentColor, string callback, string root, string updateCallback,
                                     string cancelCallback)
        {
            GuiSwatchButtonCtrl oldColor         = "oldColor";
            GuiSwatchButtonCtrl myColor          = "myColor";
            GuiColorPickerCtrl  ColorRangeSelect = "ColorRangeSelect";
            GuiColorPickerCtrl  ColorBlendSelect = "ColorBlendSelect";
            GuiSliderCtrl       ColorAlphaSelect = "ColorAlphaSelect";
            GuiCanvas           Canvas           = "Canvas";
            GuiTextEditCtrl     Channel_A_Val    = "Channel_A_Val";
            ColorPickerDlg      ColorPickerDlg   = "ColorPickerDlg";

            omni.bGlobal["$ColorPickerSignal"]         = true;
            omni.sGlobal["$ColorPickerCallback"]       = callback;
            omni.sGlobal["$ColorPickerCancelCallback"] = cancelCallback;
            omni.sGlobal["$ColorPickerUpdateCallback"] = updateCallback;
            omni.iGlobal["$ColorCallbackType"]         = 1; // ColorI

            oldColor.color = ColorIntToFloat(currentColor).AsColorF();
            myColor.color  = ColorIntToFloat(currentColor).AsColorF();

            ColorRangeSelect.showReticle = true;
            ColorBlendSelect.showReticle = true;

            // Set the range according to int
            ColorAlphaSelect.range = "0 255".AsPoint2F();

            // Set the RGBA displays accordingly
            float red   = omni.Util.getWord(currentColor, 0).AsFloat() / 255;
            float green = omni.Util.getWord(currentColor, 1).AsFloat() / 255;
            float blue  = omni.Util.getWord(currentColor, 2).AsFloat() / 255;
            float alpha = omni.Util.getWord(currentColor, 3).AsFloat();

            // set the initial range blend to correct color, no alpha needed
            // this should also set the color blend select right now
            ColorRangeSelect.baseColor = (red.AsString() + " " + green.AsString() + " " + blue.AsString() + " " + "1.0").AsColorF();
            ColorRangeSelect.updateColor();

            if (!root.isObject())
            {
                root = Canvas;
            }

            ((GuiCanvas)root).pushDialog(ColorPickerDlg);

            // update the alpha value first
            ColorAlphaSelect.setValue(alpha.AsString());
            Channel_A_Val.setText(alpha.AsString());
        }
            public override void onAction()
            {
                GuiEditorPrefsDlg         GuiEditorPrefsDlg         = "GuiEditorPrefsDlg";
                GuiEditorPrefsDlgGridEdit GuiEditorPrefsDlgGridEdit = "GuiEditorPrefsDlgGridEdit";
                GuiCanvas Canvas = "Canvas";

                GuiEditorGui.GuiEditor GuiEditor = "GuiEditor";
                GuiEditor["snap2gridsize"] = GuiEditorPrefsDlgGridEdit.getValue();
                if (GuiEditor["snap2grid"].AsBool())
                {
                    GuiEditor.setSnapToGrid(GuiEditor["snap2gridsize"].AsUint());
                }

                Canvas.popDialog(GuiEditorPrefsDlg);
            }
        public void startGuiControlDrag(string className)
        {
            GuiCanvas Canvas = "Canvas";

            // Create a new control of the given class.

            GuiControl payload = Util.eval("return new " + className + "();");

            if (!payload.isObject())
            {
                return;
            }

            // this offset puts the cursor in the middle of the dragged object.
            int xOffset = Util.getWord(payload.extent.AsString(), 0).AsInt() / 2;
            int yOffset = Util.getWord(payload.extent.AsString(), 1).AsInt() / 2;

            // position where the drag will start, to prevent visible jumping.
            Point2I cursorpos = Canvas.getCursorPos();
            int     xPos      = Util.getWord(cursorpos.AsString(), 0).AsInt() - xOffset;
            int     yPos      = Util.getWord(cursorpos.AsString(), 1).AsInt() - yOffset;

            // Create drag&drop control.

            ObjectCreator oc = new ObjectCreator("GuiDragAndDropControl");

            oc["canSaveDynamicFields"] = "0";
            oc["Profile"]         = "ToolsGuiSolidDefaultProfile";
            oc["HorizSizing"]     = "right";
            oc["VertSizing"]      = "bottom";
            oc["Position"]        = xPos + ' ' + yPos;
            oc["extent"]          = payload.extent;
            oc["MinExtent"]       = "32 32";
            oc["canSave"]         = "1";
            oc["Visible"]         = "1";
            oc["hovertime"]       = "1000";
            oc["deleteOnMouseUp"] = true;
            oc["class"]           = "GuiDragAndDropControlType_GuiControl";

            GuiDragAndDropControl dragCtrl = oc.Create();

            dragCtrl.add(payload);
            ((SimSet)Canvas.getContent()).add(dragCtrl);

            // Start drag.

            dragCtrl.startDragging(xOffset, yOffset);
        }
        public static void TextPad(string text, string callback, GuiCanvas root)
        {
            ScriptEditorDlg   ScriptEditorDlg = "ScriptEditorDlg";
            GuiMLTextEditCtrl textpad         = ScriptEditorDlg.FOT("TextPad");
            GuiCanvas         Canvas          = "Canvas";

            textpad.setText(text);
            ScriptEditorDlg["callback"] = callback;

            if (!root.isObject())
            {
                root = Canvas;
            }

            root.pushDialog(ScriptEditorDlg);
        }
Esempio n. 25
0
        public static void DbgWatchDialogAdd()
        {
            GuiTextEditCtrl  WatchDialogExpression = "WatchDialogExpression";
            GuiTextListCtrl  DebuggerWatchView     = "DebuggerWatchView";
            TCPDebugger      TCPDebugger           = "TCPDebugger";
            DebuggerWatchDlg DebuggerWatchDlg      = "DebuggerWatchDlg";
            GuiCanvas        Canvas = "Canvas";

            string expr = WatchDialogExpression.getValue();

            if (expr != "")
            {
                DebuggerWatchView.setRowById(omni.iGlobal["$DbgWatchSeq"], expr + "\t(unknown)");
                TCPDebugger.send("EVAL " + omni.iGlobal["$DbgWatchSeq"] + " 0 " + expr + "\r\n");
                omni.iGlobal["$DbgWatchSeq"]++;
            }
            Canvas.popDialog(DebuggerWatchDlg);
        }
Esempio n. 26
0
        public static void GE_OpenGUIFile()
        {
            GuiCanvas Canvas = "Canvas";

            string openFileName = omni.console.Call_Classname("GuiBuilder", "getOpenName");

            if (openFileName == "")
            {
                return;
            }

            // Make sure the file is valid.
            if ((!omni.Util.isFile(openFileName)) && (!omni.Util.isFile(openFileName + ".dso")))
            {
                return;
            }

            // Allow stomping objects while exec'ing the GUI file as we want to
            // pull the file's objects even if we have another version of the GUI
            // already loaded.

            string oldRedefineBehavior = omni.sGlobal["$Con::redefineBehavior"];

            omni.sGlobal["$Con::redefineBehavior"] = "replaceExisting";

            // Load up the level.
            SimObject guiContent = omni.Util.eval(openFileName);

            omni.sGlobal["$Con::redefineBehavior"] = oldRedefineBehavior;

            // The level file should have contained a scenegraph, which should now be in the instant
            // group. And, it should be the only thing in the group.
            //TODO
            if (!guiContent.isObject())
            {
                omni.Util.messageBox(omni.console.Call("getEngineName"),
                                     "You have loaded a Gui file that was created before this version.  It has been loaded but you must open it manually from the content list dropdown",
                                     "Ok", "Information");
                GuiEditorGui.GuiEditContent(Canvas.getContent().AsString());
                return;
            }

            GuiEditorGui.GuiEditContent(guiContent);
        }
Esempio n. 27
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();
        }
Esempio n. 28
0
        public override void onMouseDragged()
        {
            GuiCanvas canvas = "canvas";

            ObjectCreator oc = new ObjectCreator("GuiControl");

            oc["profile"]           = "GuiCreatorIconButtonProfile";
            oc["position"]          = "0 0";
            oc["extent"]            = this.extent.x + " 5";
            oc["dragSourceControl"] = this;

            GuiControl payload = oc.Create();

            int xOffset = payload.extent.x / 2;
            int yOffset = payload.extent.y / 2;

            Point2I cursorPos = canvas.getCursorPos();

            int xPos = cursorPos.x - xOffset;
            int yPos = cursorPos.y - yOffset;

            // Create the drag control.

            oc = new ObjectCreator("GuiDragAndDropControl");
            oc["canSaveDynamicFields"] = "0";
            oc["Profile"]         = "EPainterDragDropProfile";
            oc["HorizSizing"]     = "right";
            oc["VertSizing"]      = "bottom";
            oc["Position"]        = xPos + " " + yPos;
            oc["extent"]          = payload.extent;
            oc["MinExtent"]       = "4 4";
            oc["canSave"]         = "1";
            oc["Visible"]         = "1";
            oc["hovertime"]       = "1000";
            oc["deleteOnMouseUp"] = true;

            GuiDragAndDropControl ctrl = oc.Create();

            ctrl.add(payload);

            ((GuiControl)canvas.getContent()).add(ctrl);
            ctrl.startDragging(xOffset, yOffset);
        }
        public override void onActivated()
        {
            EWorldEditor EWorldEditor = "EWorldEditor";

            ShapeEditor.ShapeEdShapeTreeView ShapeEdShapeTreeView = "ShapeEdShapeTreeView";
            ShapeEditor ShapeEditor = "ShapeEditor";

            ShapeEditor.ShapeEdShapeView ShapeEdShapeView = "ShapeEdShapeView";
            GuiCanvas Canvas = "Canvas";

            //Copyright Winterleaf Entertainment L.L.C. 2013
            this["isActive"] = true.AsString();
            //Copyright Winterleaf Entertainment L.L.C. 2013
            this.open("");

            // Try to start with the shape selected in the world editor
            int count = EWorldEditor.getSelectionSize();

            for (int i = 0; i < count; i++)
            {
                SimObject obj       = EWorldEditor.getSelectedObject(i);
                string    shapeFile = ShapeEditor.getObjectShapeFile(obj);
                if (shapeFile != "")
                {
                    if (!ShapeEditor.shape.isObject() || (ShapeEditor.shape["baseShape"] != shapeFile))
                    {
                        // Call the 'onSelect' method directly if the object is not in the
                        // MissionGroup tree (such as a Player or Projectile object).
                        ShapeEdShapeTreeView.clearSelection();
                        if (!ShapeEdShapeTreeView.selectItem(obj))
                        {
                            ShapeEdShapeTreeView.onSelect(obj, "");
                        }

                        // 'fitToShape' only works after the GUI has been rendered, so force a repaint first
                        Canvas.repaint(0);
                        ShapeEdShapeView.fitToShape();
                    }
                    break;
                }
            }
        }
Esempio n. 30
0
        // Deprecated when platform layers are all sufficient
        public static void checkSaveChangesOld(string data, string saveCallback, string dontSaveCallback)
        {
            MessageBoxSaveChangesDlg MessageBoxSaveChangesDlg = "MessageBoxSaveChangesDlg";
            GuiCanvas Canvas = "Canvas";

            // Sanity Check
            if (MessageBoxSaveChangesDlg.isAwake())
            {
                omni.Util._warn("Save Changes Dialog already Awake, NOT creating second instance.");
                return;
            }

            // Set Proper State
            MessageBoxSaveChangesDlg["SaveCallback"]     = saveCallback;
            MessageBoxSaveChangesDlg["DontSaveCallback"] = dontSaveCallback;
            MessageBoxSaveChangesDlg["Data"]             = data;

            // Show Dialog
            Canvas.pushDialog(MessageBoxSaveChangesDlg);
        }
Esempio n. 31
0
        public static void DbgConnect()
        {
            TCPDebugger        TCPDebugger             = "TCPDebugger";
            GuiTextEditCtrl    DebuggerConnectAddress  = "DebuggerConnectAddress";
            GuiTextEditCtrl    DebuggerConnectPort     = "DebuggerConnectPort";
            GuiTextEditCtrl    DebuggerConnectPassword = "******";
            DebuggerConnectDlg DebuggerConnectDlg      = "DebuggerConnectDlg";
            GuiCanvas          Canvas = "Canvas";

            string address  = DebuggerConnectAddress.getValue();
            string port     = DebuggerConnectPort.getValue();
            string password = DebuggerConnectPassword.getValue();

            if ((address != "") && (port != "") && (password != ""))
            {
                TCPDebugger.connect(address + ":" + port);
                TCPDebugger.schedule("5000", "send", password + "\r\n");
                TCPDebugger["password"] = password;
            }

            Canvas.popDialog(DebuggerConnectDlg);
        }
Esempio n. 32
0
        public static void DbgBreakConditionSet()
        {
            DebuggerBreakConditionDlg DebuggerBreakConditionDlg = "DebuggerBreakConditionDlg";
            DebuggerBreakPoints       DebuggerBreakPoints       = "DebuggerBreakPoints";
            GuiTextEditCtrl           BreakCondition            = "BreakCondition";
            GuiTextEditCtrl           BreakPassCount            = "BreakPassCount";
            GuiTextEditCtrl           BreakClear = "BreakClear";
            GuiCanvas Canvas = "Canvas";

            // Read the condition.
            string condition = BreakCondition.getValue();
            string passct    = BreakPassCount.getValue();
            string clear     = BreakClear.getValue();

            if (condition == "")
            {
                condition = "true";
            }
            if (passct == "")
            {
                passct = "0";
            }
            if (clear == "")
            {
                clear = "false";
            }

            // Set the condition.
            int id = DebuggerBreakPoints.getSelectedId();

            if (id != -1)
            {
                string bkp = DebuggerBreakPoints.getRowTextById(id);
                DbgSetBreakPoint(omni.Util.getField(bkp, 1), omni.Util.getField(bkp, 0).AsUInt(), clear.AsBool(), passct,
                                 condition);
            }

            Canvas.popDialog(DebuggerBreakConditionDlg);
        }
Esempio n. 33
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;
            }
        }
Esempio n. 34
0
    public void Start()
    {
        _guiCanvas = GuiCanvas.Instance;
        _talkingUi = _guiCanvas.TalkingUi;

        _animator = GetComponentInChildren<Animator>();

        _birdProps = BirdPropsService.Instance.GetBirdPropsById(TextId);

        if (_birdProps != null)
        {
            if (_birdProps.AnimatorController != null)
            {
                _animator.runtimeAnimatorController = _birdProps.AnimatorController;
            }

            _animator.CrossFade(_birdProps.DefaultAnim, 0f);
        }
        else
        {
            _birdProps = new BirdProps("Idle", true, null);
        }

        QMark = transform.FindChild("?").gameObject;
        QMark.SetActive(false);

        Directions = DirectionService.Instance.GetDirectionsById(TextId);

        _animator.CrossFade(_birdProps.DefaultAnim, 0f);
        _animator.transform.localScale = 
                _animator.transform.localScale.SetX(_birdProps.FaceLeft ? 1 : -1);


        if (State.Instance.LevelEntrance == LevelEntrance.BeachRival && TextId == "Rival")
        {
            var lossDialog = new List<Direction>
            {
                new Line("Winson \"Collecto\"", "Woof. Erm, Chirp. Not the best dancing I've seen."),
                new Line("Winson \"Collecto\"", "We can go again any time. You may need to practice.")
            };

            var perfectDialog = new List<Direction>
            {
                new Line("Winson \"Collecto\"", "Wow. Just wow. I am very impressed."),
                new Line("Winson \"Collecto\"", "So, about your prize. It's the most prized and valuable thing to my name."),
                new Line("Winson \"Collecto\"", "It's... my respect. You have my respect. Good job guy."),
                new Line("Winson \"Collecto\"", "We can go again any time.")
            };

            var okDialog = new List<Direction>
            {
                new Line("Winson \"Collecto\"", "Pretty good. Not perfect, but pretty good."),
                new Line("Winson \"Collecto\"", "You're an ok bird."),
                new Line("Winson \"Collecto\"", "We can go again any time, if you'd like.")
            };


            Directions = new List<Direction>
            {
                new Line("Winson \"Collecto\"", "Wow. Just wow. I am very impressed."),
                new Line("Winson \"Collecto\"", "So, about your prize. It's the most prized and valuable thing to my name."),
                new Line("Winson \"Collecto\"", "It's... my respect. You have my respect. Good job guy."),
                new Line("Winson \"Collecto\"", "We can go again any time.")
            };

            if (State.Instance.FailedBeats <= 5 
                && State.Instance.FailedBeats > 2)
            {
                Directions = okDialog;
            }
            else if (State.Instance.FailedBeats <= 2)
            {
                Directions = perfectDialog;
            }
            else
            {
                Directions = lossDialog;
            }

            _animator.CrossFade("Talk", 0f);
            StartCoroutine(StartSequence(() =>
            {
                Directions = DirectionService.Instance.GetDirectionsById(TextId);
                FindObjectOfType<Control>().Disabled = false;
                _animator.CrossFade("Idle", 0f);
            }));
        }
    }