Beispiel #1
0
        public static void initialize_CS()
        {
            ObjectCreator tch = new ObjectCreator("ShaderData", "AL_ShadowVisualizeShader");
            tch["DXVertexShaderFile"] = "shaders/common/guiMaterialV.hlsl";
            tch["DXPixelShaderFile"] = "shaders/common/lighting/advanced/dbgShadowVisualizeP.hlsl";

            tch["OGLVertexShaderFile"] = "shaders/common/gl/guiMaterialV.glsl";
            tch["OGLPixelShaderFile"] = "shaders/common/lighting/advanced/gl/dbgShadowVisualizeP.glsl";

            tch["pixVersion"] = 2.0;
            tch.Create();

            tch = new ObjectCreator("CustomMaterial", "AL_ShadowVisualizeMaterial");
            tch["shader"] = "AL_ShadowVisualizeShader";
            tch["stateBlock"] = "AL_DepthVisualizeState";

            tch["sampler[\"shadowMap\"]"] = "#AL_ShadowVizTexture";
            tch["sampler[\"depthViz\"]"] = "core/scripts/client/lighting/advanced/depthviz";

            tch["pixVersion"] = 2.0;
            tch.Create();

            SingletonCreator ts = new SingletonCreator("GuiControlProfile", "AL_ShadowLabelTextProfile");
            ts["fontColor"] = "0 0 0";
            ts["autoSizeWidth"] = true;
            ts["autoSizeHeight"] = true;
            ts["justify"] = "left";
            ts["fontSize"] = 14;
            ts.Create();
        }
Beispiel #2
0
        public override int onThrow(ShapeBase user, int amount)
        {
            if (amount == 0)
                amount = 1;

            if (this["maxInventory"] != string.Empty)
                {
                if (amount > this["maxInventory"].AsInt())
                    amount = this["maxInventory"].AsInt();
                }

            if (!amount.AsBool())
                return 0;

            user.decInventory(this, amount);
            //ShapeBaseShapeBaseDecInventory(player, datablock, amount);

            // Construct the actual object in the world, and add it to
            // the mission group so it's cleaned up when the mission is
            // done.  The object is given a random z rotation.
            ObjectCreator tch = new ObjectCreator("Item", string.Empty);
            tch["datablock"] = this;
            tch["rotation"] = "0 0 1 " + (new Random().Next(0, 360));
            tch["count"] = amount;

            Item item = tch.Create();

            ((SimSet) "MissionGroup").pushToBack(item);

            item.SchedulePop();

            return item;
        }
Beispiel #3
0
        public static void initializeRiverEditor()
        {
            Omni.self.Print(" % - Initializing River Editor");
            gui.RiverEditor.initialize();
            RiverEditorGui.initialize();
            RiverEditorToolbar.initialize();
            // Add ourselves to EditorGui, where all the other tools reside
            RiverEditorGui riverEditorGui = "RiverEditorGui";

            riverEditorGui.setVisible(false);

            RiverEditorToolbar oRiverEditorToolbar = "RiverEditorToolbar";

            oRiverEditorToolbar.setVisible(false);
            ((GuiWindowCollapseCtrl) "RiverEditorOptionsWindow").setVisible(false);
            GuiWindowCollapseCtrl RiverEditorTreeWindow = "RiverEditorTreeWindow";
            RiverEditorTreeWindow.setVisible(false);

            EditorGui EditorGui = "EditorGui";

            EditorGui.add("RiverEditorGui");
            EditorGui.add("RiverEditorToolbar");
            EditorGui.add("RiverEditorOptionsWindow");
            EditorGui.add("RiverEditorTreeWindow");

            ObjectCreator oRiverEditorPlugin = new ObjectCreator("ScriptObject", "RiverEditorPlugin", typeof (RiverEditorPlugin));
            oRiverEditorPlugin["editorGui"] = "RiverEditorGui";
            oRiverEditorPlugin.Create();

            RiverEditorPlugin RiverEditorPlugin = "RiverEditorPlugin";

            RiverEditorPlugin.initialize();
        }
        public void initialize()
        {
            ObjectCreator oc_Newobject3 = new ObjectCreator("SimSet", "ForestTools");

            ObjectCreator oc_Newobject2 = new ObjectCreator("ForestBrushTool");
            oc_Newobject2["internalName"] = "BrushTool";
            oc_Newobject2["toolTip"] = "Paint Tool";
            oc_Newobject2["buttonImage"] = "tools/forest/images/brushTool";

            oc_Newobject3["#Newobject2"] = oc_Newobject2;

            ObjectCreator oc_Newobject1 = new ObjectCreator("ForestSelectionTool");
            oc_Newobject1["internalName"] = "SelectionTool";
            oc_Newobject1["toolTip"] = "Selection Tool";
            oc_Newobject1["buttonImage"] = "tools/forest/images/selectionTool";
            oc_Newobject3["#Newobject1"] = oc_Newobject1;

            oc_Newobject3.Create();

            ActionMap map = new ObjectCreator("ActionMap").Create();
            map.bindCmd("keyboard", "1", "ForestEditorSelectModeBtn.performClick();", ""); // Select
            map.bindCmd("keyboard", "2", "ForestEditorMoveModeBtn.performClick();", ""); // Move
            map.bindCmd("keyboard", "3", "ForestEditorRotateModeBtn.performClick();", ""); // Rotate
            map.bindCmd("keyboard", "4", "ForestEditorScaleModeBtn.performClick();", ""); // Scale
            map.bindCmd("keyboard", "5", "ForestEditorPaintModeBtn.performClick();", ""); // Paint
            map.bindCmd("keyboard", "6", "ForestEditorEraseModeBtn.performClick();", ""); // Erase
            map.bindCmd("keyboard", "7", "ForestEditorEraseSelectedModeBtn.performClick();", ""); // EraseSelected   
            map.bindCmd("keyboard", "8", "ForestEditorDropToGroundModeBtn.performClick();", ""); // DropTheBeat
            //%map.bindCmd( keyboard, "backspace", "ForestEditorGui.onDeleteKey();", "" );
            //%map.bindCmd( keyboard, "delete", "ForestEditorGui.onDeleteKey();", "" );   
            this.map = map;
        }
Beispiel #5
0
        public static void initializeDatablockEditor()
        {
            Omni.self.Print(" % Initializing Datablock Editor");
            gui.CodeBehind.DatablockEditor.initialize();
            DatablockEditorTreeWindow.initialize();
            DatablockEditorInspectorWindow.initialize();
            DatablockEditorCreatePrompt.initialize();

            // Add ourselves to EditorGui, where all the other tools reside
            DatablockEditorInspectorWindow oDatablockEditorInspectorWindow = "DatablockEditorInspectorWindow";

            oDatablockEditorInspectorWindow.setVisible(false);
            DatablockEditorTreeWindow oDatablockEditorTreeWindow = "DatablockEditorTreeWindow";
            oDatablockEditorTreeWindow.setVisible(false);
            EditorGui EditorGui = "EditorGui";
            EditorGui.add("DatablockEditorInspectorWindow");
            EditorGui.add("DatablockEditorTreeWindow");

            ObjectCreator o = new ObjectCreator("ScriptObject", "DatablockEditorPlugin", typeof (DatablockEditorPlugin));
            o["editorGui"] = "EWorldEditor";
            o.Create();
            DatablockEditorPlugin p = "DatablockEditorPlugin";

            p.initialize();
        }
        public override void onAdd()
        {
            this.createMenuBar();

            ObjectCreator oc = new ObjectCreator("GuiPanel");
            oc["internalName"] = "DocumentContainer";

            GuiPanel panel = oc.Create();

            this.setContent(panel);

            int xOffset = 20;
            int yOffset = 20;

            for (int i = 0; i < 10; i++)
                {
                ObjectCreator oc1 = new ObjectCreator("GuiWindowCtrl");
                oc["extent"] = "200 100";
                oc["position"] = xOffset + ' ' + yOffset;

                GuiWindowCtrl window = oc1.Create();
                panel.add(window);

                xOffset += 30;
                yOffset += 30;
                }
        }
Beispiel #7
0
        public static void initializeDecalEditor()
        {
            Omni.self.Print(" % - Initializing Decal Editor");
            omni.sGlobal["$decalDataFile"] = "art/decals/managedDecalData.cs";
            gui.DecalEditorGui.initialize();

            // Add ourselves to EditorGui, where all the other tools reside
            DecalEditorGui DecalEditorGui = "DecalEditorGui";

            DecalEditorGui.setVisible(false);

            DecalEditorGui.DecalPreviewWindow DecalPreviewWindow = "DecalPreviewWindow";

            DecalPreviewWindow.setVisible(false);
            DecalEditorGui.DecalEditorWindow DecalEditorWindow = "DecalEditorWindow";
            DecalEditorWindow.setVisible(false);

            EditorGui EditorGui = "EditorGui";
            EditorGui.add(DecalEditorGui);
            EditorGui.add(DecalEditorWindow);
            EditorGui.add(DecalPreviewWindow);

            DecalEditorGui.DecalEditorTabBook DecalEditorTabBook = "DecalEditorTabBook";
            DecalEditorTabBook.selectPage(0);

            ObjectCreator oc = new ObjectCreator("ScriptObject", "DecalEditorPlugin", typeof (DecalEditorPlugin));
            oc["editorGui"] = "DecalEditorGui";
            oc.Create();

            DecalEditorPlugin DecalEditorPlugin = "DecalEditorPlugin";

            DecalEditorPlugin.initialize();
        }
        public static void initialize()
        {
            #region GameTSCtrl (HudlessPlayGui)        oc_Newobject1

            ObjectCreator oc_Newobject1 = new ObjectCreator("GameTSCtrl", "HudlessPlayGui", typeof (hudlessGui));
            oc_Newobject1["canSaveDynamicFields"] = "1";
            oc_Newobject1["isContainer"] = "1";
            oc_Newobject1["Profile"] = "GuiContentProfile";
            oc_Newobject1["HorizSizing"] = "right";
            oc_Newobject1["VertSizing"] = "bottom";
            oc_Newobject1["position"] = "0 0";
            oc_Newobject1["Extent"] = "1024 768";
            oc_Newobject1["MinExtent"] = "8 8";
            oc_Newobject1["canSave"] = "1";
            oc_Newobject1["Visible"] = "1";
            oc_Newobject1["tooltipprofile"] = "GuiToolTipProfile";
            oc_Newobject1["hovertime"] = "1000";
            oc_Newobject1["Margin"] = "0 0 0 0";
            oc_Newobject1["Padding"] = "0 0 0 0";
            oc_Newobject1["AnchorTop"] = "1";
            oc_Newobject1["AnchorBottom"] = "0";
            oc_Newobject1["AnchorLeft"] = "1";
            oc_Newobject1["AnchorRight"] = "0";
            oc_Newobject1["cameraZRot"] = "0";
            oc_Newobject1["forceFOV"] = "0";
            oc_Newobject1["Enabled"] = "1";
            oc_Newobject1["helpTag"] = "0";
            oc_Newobject1["noCursor"] = "1";

            #endregion

            oc_Newobject1.Create();
        }
        public override void onRightMouseUp(GuiControl ctrl)
        {
            int fontColorPos, backgroundColorPos, fillColorPos, fontSizePos, lockPos, winSettingsPos, setTitlePos, bitmapPos;
            GuiCanvas Canvas = "Canvas";

            ObjectCreator popupCreator = new ObjectCreator("PopupMenu", "", typeof (MenuBuilder));

            popupCreator["isPopup"] = true.AsString();

            popupCreator["object"] = "-1";

            MenuBuilder popup = popupCreator.Create();

            popup.removeAllItems();
            popup["object"] = ctrl;

            if (ctrl.getName() != "")
                popup.appendItem(ctrl.getName() + '\t' + "" + '\t' + "");
            else
                popup.appendItem(ctrl.getClassName() + '\t' + "" + '\t' + "");

            popup.enableItem(0, false);

            if (ctrl.lockControl)
                {
                lockPos = popup.appendItem("Locked" + '\t' + "" + '\t' + ctrl + ".setControlLock(!" + ctrl + ".getControlLock());");
                popup.checkItem(lockPos, ctrl.getControlLock());
                }

            if (ctrl.contextFontColor)
                fontColorPos = popup.appendItem("Font Color..." + '\t' + "" + '\t' + "getColorI(\"" + ctrl.controlFontColor.AsString() + "\", \"" + ctrl + ".setControlFontColor\", " + ctrl.getRoot() + ", \"" + ctrl + ".setControlFontColor\", \"" + ctrl + ".setControlFontColor\" );");

            if (ctrl.contextBackColor)
                backgroundColorPos = popup.appendItem("Background Color..." + '\t' + "" + '\t' + "IngameContext.transparentCheck(" + ctrl + ", \"backColor\");");

            if (ctrl.contextFillColor)
                fillColorPos = popup.appendItem("Fill Color..." + '\t' + "" + '\t' + "IngameContext.transparentCheck(" + ctrl + ", \"fillColor\");");

            if (ctrl.contextFontSize)
                fontSizePos = popup.appendItem("Font Size..." + '\t' + "" + '\t' + "ChangeFontSize.loadDialog(" + ctrl + ");");

            if (ctrl.windowSettings)
                winSettingsPos = popup.appendItem("Window Settings" + '\t' + "" + '\t' + "WindowSettings.loadDialog(" + ctrl + ");");

            if (ctrl.isMemberOfClass("GuiBitmapCtrl"))
                {
                if (((GuiControl) popup["object"])["setBitmap"].AsBool())
                    bitmapPos = popup.appendItem("Set Bitmap..." + '\t' + "" + '\t' + "getLoadFilename( \"All Image Files|*.png;*.jpeg;*.jpg;*.tga;*.jng;*.mng;*.gif;*.bmp;*.dds|png|*.png|jpeg|*.jpeg|jpg|*.jpg|tga|*.tga|jng|*.jng|mng|*.mng|gif|*.gif|bmp|*.bmp|dds|*.dds\"," + ctrl + "\".setBitmap\", \"\" );");
                }

            if (ctrl.isMemberOfClass("GuiWindowCtrl"))
                {
                if (((GuiControl) popup["object"])["setTitle"].AsBool())
                    setTitlePos = popup.appendItem("Set Title..." + '\t' + "" + '\t' + "SetTitle.loadDialog(" + ctrl + ");");
                }

            popup.showPopup(Canvas);
        }
Beispiel #10
0
 public static void initializeInGameEditor()
 {
     Omni.self.Print(" % - Initializing In-game GUI Editor");
     SetTitle.initialize();
     WindowSettings.initialize();
     ChangeFontSize.initialize();
     ObjectCreator oIngameContext = new ObjectCreator("GuiControl", "IngameContext, IngameGuiGroup", typeof (InGameContext));
     oIngameContext.Create();
 }
        public static string constructRSSHeadline(string headline, string link)
        {
            ObjectCreator oc = new ObjectCreator("ScriptObject", "", typeof (RSSHeadline));
            oc["_headline"] = headline;
            oc["_link"] = link;

            RSSHeadline ret = oc.Create();

            return ret;
        }
        public static void intialize()
        {
            //-----------------------------------------------------------------------------
            // Anim flag settings - must match material.h
            // These cannot be enumed through script becuase it cannot
            // handle the "|" operation for combining them together
            // ie. Scroll | Wave does not work.
            //-----------------------------------------------------------------------------
            omni.iGlobal["$scroll"] = 1;
            omni.iGlobal["$rotate"] = 2;
            omni.iGlobal["$wave"] = 4;
            omni.iGlobal["$scale"] = 8;
            omni.iGlobal["$sequence"] = 16;

            // Common stateblock definitions
            ObjectCreator oc = new ObjectCreator("GFXSamplerStateData", "SamplerClampLinear");
            oc["textureColorOp"] = "GFXTOPModulate";
            oc["addressModeU"] = "GFXAddressClamp";
            oc["addressModeV"] = "GFXAddressClamp";
            oc["addressModeW"] = "GFXAddressClamp";
            oc["magFilter"] = "GFXTextureFilterLinear";
            oc["minFilter"] = "GFXTextureFilterLinear";
            oc["mipFilter"] = "GFXTextureFilterLinear";
            oc.Create();

            oc = new ObjectCreator("GFXSamplerStateData", "SamplerClampPoint");
            oc["textureColorOp"] = "GFXTOPModulate";
            oc["addressModeU"] = "GFXAddressClamp";
            oc["addressModeV"] = "GFXAddressClamp";
            oc["addressModeW"] = "GFXAddressClamp";
            oc["magFilter"] = "GFXTextureFilterPoint";
            oc["minFilter"] = "GFXTextureFilterPoint";
            oc["mipFilter"] = "GFXTextureFilterPoint";
            oc.Create();

            oc = new ObjectCreator("GFXSamplerStateData", "SamplerWrapLinear");
            oc["textureColorOp"] = "GFXTOPModulate";
            oc["addressModeU"] = "GFXTextureAddressWrap";
            oc["addressModeV"] = "GFXTextureAddressWrap";
            oc["addressModeW"] = "GFXTextureAddressWrap";
            oc["magFilter"] = "GFXTextureFilterLinear";
            oc["minFilter"] = "GFXTextureFilterLinear";
            oc["mipFilter"] = "GFXTextureFilterLinear";
            oc.Create();

            oc = new ObjectCreator("GFXSamplerStateData", "SamplerWrapPoint");
            oc["textureColorOp"] = "GFXTOPModulate";
            oc["addressModeU"] = "GFXTextureAddressWrap";
            oc["addressModeV"] = "GFXTextureAddressWrap";
            oc["addressModeW"] = "GFXTextureAddressWrap";
            oc["magFilter"] = "GFXTextureFilterPoint";
            oc["minFilter"] = "GFXTextureFilterPoint";
            oc["mipFilter"] = "GFXTextureFilterPoint";
            oc.Create();
        }
Beispiel #13
0
        public static void initialize()
        {
            ObjectCreator tch = new ObjectCreator("ShaderData", "BlurDepthShader");
            tch["DXVertexShaderFile"] = "shaders/common/lighting/shadowMap/boxFilterV.hlsl";
            tch["DXPixelShaderFile"] = "shaders/common/lighting/shadowMap/boxFilterP.hlsl";

            tch["OGLVertexShaderFile"] = "shaders/common/lighting/shadowMap/gl/boxFilterV.glsl";
            tch["OGLPixelShaderFile"] = "shaders/common/lighting/shadowMap/gl/boxFilterP.glsl";
            tch["pixVersion"] = 2.0;
            tch.Create();
        }
        public string create(string treeView)
        {
            omni.Util.pushInstantGroup();
            ObjectCreator undoObject = new ObjectCreator("UndoScriptAction", "", typeof (UndoActionReparentObjects));
            //undoObject["class"] = "UndoActionReparentObjects";
            undoObject["numObjects"] = "0";
            undoObject["treeView"] = treeView;
            UndoActionReparentObjects action = undoObject.Create();
            omni.Util.popInstantGroup();

            return action;
        }
Beispiel #15
0
        public virtual SceneObject respawnTurret(SimDataBlock datablock, string classname, TransformF transform, string isstatic, string respawn)
        {
            ObjectCreator tch = new ObjectCreator(classname);
            tch["datablock"] = datablock;
            tch["static"] = isstatic;
            tch["respawn"] = respawn;

            SceneObject turret = tch.Create();

            turret.setTransform(transform);
            ((SimGroup) "MissionGroup").add(turret);
            return turret;
        }
        public override int onThrow(ShapeBase player, int amount)
        {
            if (amount == 0)
                amount = 1;

            if (this["maxInventory"] != string.Empty)
                {
                if (amount > this["maxInventory"].AsInt())
                    amount = this["maxInventory"].AsInt();
                }

            if (amount == 0)
                return 0;

            player.decInventory(this, amount);
            TransformF rot = new TransformF(player.getEulerRotation());

            ObjectCreator tc_obj = new ObjectCreator("AITurretShape", string.Empty);
            tc_obj["datablock"] = this.getName();
            tc_obj["rotation"] = "0 0 1 " + rot.mPositionZ;
            tc_obj["count"] = "1";
            tc_obj["sourceObject"] = player;
            tc_obj["client"] = player["client"];
            tc_obj["isAiControlled"] = true;

            AITurretShape obj = tc_obj.Create();
            ((SimSet) "MissionGroup").pushToBack(obj);

            //todo change to csharp
            obj.addToIgnoreList(player);

            GameConnection client = player["client"];
            if (client.isObject())
                {
                if (client["ownedTurrets"] == string.Empty)
                    client["ownedTurrets"] = new ObjectCreator("SimSet", string.Empty).Create().AsString();

                SimSet SimSet_id = client["ownedTurrets"];
                int countofitems = SimSet_id.getCount();
                for (uint i = 0; i < countofitems; i++)
                    {
                    AITurretShape turret = SimSet_id.getObject(i);
                    turret.addToIgnoreList(obj);
                    obj.addToIgnoreList(turret);
                    }
                SimSet_id.pushToBack(obj);
                }

            return obj;
        }
Beispiel #17
0
        public static UInt32 Spawn(string name, TransformF spawnpoint)
            {
            ObjectCreator npcScriptObject = new ObjectCreator("AIPlayer", "", typeof(CustomDemoPlayer));
            npcScriptObject["dataBlock"] = "DemoPlayer";
            npcScriptObject["path"] = "";
            AIPlayer npc = npcScriptObject.Create();
            if (npc != 0)
                {
                ((SimSet)"MissionCleanup").pushToBack(npc);
                npc.setShapeName(name);
                npc.setTransform(spawnpoint);
                }

            return npc;
            }
        public void createNewParameter(string name)
        {
            ObjectCreator sfxCreator = new ObjectCreator("SFXParameter");
            sfxCreator["internalName"] = name;

            SFXParameter parameter = sfxCreator.Create();

            if (!parameter.isObject())
                return;

            parameter.setFilename(sGlobal["$SFX_PARAMETER_FILE"]);
            this.persistenceMgr.setDirty(parameter);
            this.persistenceMgr.saveDirty();

            this.addParameter(parameter);
        }
        public static string getLevelDisplayName(string levelFile)
        {
            ObjectCreator oc = new ObjectCreator("FileObject");

            FileObject file = oc.Create();

            string MissionInfoObject = "";

            if (file.openForRead(levelFile))
                {
                bool inInfoBlock = false;
                while (!file.isEOF())
                    {
                    string line = file.readLine();
                    line = line.Trim();

                    if (line == "new ScriptObject(MissionInfo) {")
                        inInfoBlock = true;
                    else if (line == "new LevelInfo(theLevelInfo) {")
                        inInfoBlock = true;
                    else if (inInfoBlock && line == "};")
                        {
                        inInfoBlock = false;
                        MissionInfoObject = MissionInfoObject + line;
                        break;
                        }

                    if (inInfoBlock)
                        MissionInfoObject = MissionInfoObject + line + " ";
                    }
                file.close();
                }
            MissionInfoObject = "%MissionInfoObject = " + MissionInfoObject + "; return %MissionInfoObject;";
            MissionInfoObject = omni.console.Eval(MissionInfoObject, true);

            file.delete();
            string name = "";
            if (((SimObject) MissionInfoObject)["LevelName"] != "")
                name = ((SimObject) MissionInfoObject)["LevelName"];
            else
                name = omni.Util.fileBase(levelFile);

            MissionInfoObject.delete();

            return name;
        }
Beispiel #20
0
        public static void initialize()
        {
            //-----------------------------------------------------------------------------
            // Message Hud
            //-----------------------------------------------------------------------------

            // chat hud sizes in lines
            omni.iGlobal["$outerChatLenY[1]"] = 4;
            omni.iGlobal["$outerChatLenY[2]"] = 9;
            omni.iGlobal["$outerChatLenY[3]"] = 13;
            omni.iGlobal["$LastHudTarget"] = 0;

            // Only play sound files that are <= 5000ms in length.
            omni.iGlobal["$MaxMessageWavLength"] = 5000;
            //new MessageVector(HudMessageVector);
            ObjectCreator oc = new ObjectCreator("MessageVector", "HudMessageVector");
            oc.Create();
        }
Beispiel #21
0
        public static void initializePhysicsTools()
        {
            Omni.self.Print(" % - Initializing Physics Tools");

            if (!omni.Util.physicsPluginPresent())
                {
                omni.Util._echo("No physics plugin exists.");
                return;
                }
            ActionMap globalactionmap = "globalactionmap";

            globalactionmap.bindCmd("keyboard", "alt t", "physicsToggleSimulation();", "");
            globalactionmap.bindCmd("keyboard", "alt r", "physicsRestoreState();", "");

            ObjectCreator o = new ObjectCreator("ScriptObject", "PhysicsEditorPlugin", typeof (PhysicsEditorPlugin));
            o["editorGui"] = "EWorldEditor";
            o.Create();
        }
 public override void onAdd(GameBase obj)
 {
     ShapeBase sb = (ShapeBase) obj;
     // Do standard cheetah init
     base.onAdd(obj);
     // Remove the turret from the roof
     sb.unmountImage(this.turretSlot);
     ObjectCreator ocplatform = new ObjectCreator("WalkableShape", "CarPlatform", typeof (CarPlatform));
     ocplatform["UseAutoAttach"] = 1;
     ocplatform["RayLength"] = 1.5f;
     ocplatform["shapeName"] = "art/shapes/rocks/boulder.dts";
     ocplatform["scale"] = "1 1 0.1";
     // Create our walkable platform
     CarPlatform platform = (CarPlatform) ocplatform.Create();
     sb["platform"] = platform;
     platform["car"] = sb;
     // Mount the platform to the Turret slot
     sb.mountImage(platform, this.turretSlot);
 }
Beispiel #23
0
        public static void initializeRoadEditor()
        {
            Omni.self.Print(" % Initializing Road and Path Editor");

            //exec( "./roadEditor.cs" );
            //RoadEditor_initialize();
            roadEditor.initialize();

            //exec( "./roadEditorGui.gui" );
            //RoadEditorGui_initialize();
            RoadEditorGui.initialize();

            //exec( "./roadEditorToolbar.gui");
            //RoadEditorToolbar_initialize();
            RoadEditorToolbar.initialize();

            //exec( "./roadEditorGui.cs" );

            // Add ourselves to EditorGui, where all the other tools reside
            RoadEditorGui roadEditorGui = "RoadEditorGui";
            RoadEditorToolbar roadEditorToolbar = "RoadEditorToolbar";

            roadEditorGui.setVisible(false);
            roadEditorToolbar.setVisible(false);

            ((GuiWindowCollapseCtrl) "RoadEditorOptionsWindow").setVisible(false);
            ((GuiWindowCollapseCtrl) "RoadEditorTreeWindow").setVisible(false);

            EditorGui EditorGui = "EditorGui";

            EditorGui.add("RoadEditorGui");
            EditorGui.add("RoadEditorToolbar");
            EditorGui.add("RoadEditorOptionsWindow");
            EditorGui.add("RoadEditorTreeWindow");

            ObjectCreator oRoadEditorPlugin = new ObjectCreator("ScriptObject", "RoadEditorPlugin", typeof (RoadEditorPlugin));
            oRoadEditorPlugin["editorGui"] = "RoadEditorGui";
            oRoadEditorPlugin.Create();

            RoadEditorPlugin RoadEditorPlugin = "RoadEditorPlugin";
            RoadEditorPlugin.initialize();
        }
        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);
        }
Beispiel #25
0
        public static void initialize()
        {
            if (omni.sGlobal["$platform"] == "macos")
                {
                ObjectCreator oc = new ObjectCreator("GuiCursor", "DefaultCursor");

                oc["hotSpot"] = "4 4";
                oc["renderOffset"] = "0 0";
                oc["bitmapName"] = "~/art/gui/images/macCursor";
                oc.Create();
                }
            else
                {
                ObjectCreator oc = new ObjectCreator("GuiCursor", "DefaultCursor");
                oc["hotSpot"] = "1 1";
                oc["renderOffset"] = "0 0";
                oc["bitmapName"] = "~/art/gui/images/defaultCursor";
                oc.Create();
                }
        }
Beispiel #26
0
        public static void initializeParticleEditor()
        {
            Omni.self.Print(" % - Initializing Particle Editor");
            gui.ParticleEditor.initialize();
            ParticleEmitterEditor.initialize();
            ParticleParticleEditor.initialize();
            GuiWindowCollapseCtrl pe_Window = "PE_Window";

            pe_Window.setVisible(false);
            EditorGui EditorGui = "EditorGui";
            EditorGui.add("PE_Window");

            ObjectCreator oParticleEditorPlugin = new ObjectCreator("ScriptObject", "ParticleEditorPlugin", typeof (ParticleEditorPlugin));
            oParticleEditorPlugin["editorGui"] = "EWorldEditor";
            oParticleEditorPlugin.Create();

            ParticleEditorPlugin ParticleEditorPlugin = "ParticleEditorPlugin";

            ParticleEditorPlugin.initialize();
        }
        public override void onMouseDragged()
        {
            GuiCanvas Canvas = "Canvas";

            GuiSwatchButtonCtrl payload = new ObjectCreator("GuiSwatchButtonCtrl").Create();
            payload.assignFieldsFrom(this);
            payload.position = "0 0 ".AsPoint2I();
            payload["dragSourceControl"] = this;

            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.

            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"] = "4 4";
            oc["canSave"] = "1";
            oc["Visible"] = "1";
            oc["hovertime"] = "1000";
            oc["deleteOnMouseUp"] = true;
            oc["class"] = "GuiDragAndDropControlType_ColorSwatch";

            GuiDragAndDropControl ctrl = oc.Create();

            ctrl.add(payload);

            // Start drag.

            ((SimSet) Canvas.getContent()).add(ctrl);
            ctrl.startDragging(xOffset, yOffset);
        }
        public static uint initialize()
        {
            #region GuiControl (TerrainPainterPalette,EditorGuiGroup)        oc_Newobject1

            ObjectCreator oc_Newobject1 = new ObjectCreator("GuiControl", "TerrainPainterPalette,EditorGuiGroup");
            oc_Newobject1["canSaveDynamicFields"] = "0";
            oc_Newobject1["Enabled"] = "1";
            oc_Newobject1["isContainer"] = "1";
            oc_Newobject1["Profile"] = "ToolsGuiDefaultProfile";
            oc_Newobject1["HorizSizing"] = "right";
            oc_Newobject1["VertSizing"] = "bottom";
            oc_Newobject1["Position"] = "0 0";
            oc_Newobject1["Extent"] = "1024 768";
            oc_Newobject1["MinExtent"] = "8 2";
            oc_Newobject1["canSave"] = "1";
            oc_Newobject1["Visible"] = "1";
            oc_Newobject1["hovertime"] = "1000";

            #endregion

            return oc_Newobject1.Create();
        }
Beispiel #29
0
        public static void initializeMissionAreaEditor()
        {
            Omni.self.Print(" % - Initializing Mission Area Editor");

            //exec( "./missionAreaEditor.ed.cs" );
            //MissionAreaEditor_initialize();
            gui.MissionAreaEditor.initialize();
            //exec( "./missionAreaEditorGui.ed.gui" );
            //MissionAreaEditorGui_initialize();
            MissionAreaEditorGui.initialize();
            //exec( "./missionAreaEditorGui.ed.cs" );

            // Add ourselves to EditorGui, where all the other tools reside
            MissionAreaEditorGui oMissionAreaEditorGui = "MissionAreaEditorGui";

            oMissionAreaEditorGui.setVisible(false);

            GuiWindowCollapseCtrl MissionAreaEditorTerrainWindow = "MissionAreaEditorTerrainWindow";

            MissionAreaEditorTerrainWindow.setVisible(false);

            GuiWindowCollapseCtrl MissionAreaEditorPropertiesWindow = "MissionAreaEditorPropertiesWindow";
            MissionAreaEditorPropertiesWindow.setVisible(false);

            EditorGui EditorGui = "EditorGui";

            EditorGui.add("MissionAreaEditorGui");
            EditorGui.add("MissionAreaEditorTerrainWindow");
            EditorGui.add("MissionAreaEditorPropertiesWindow");

            ObjectCreator ocMissionAreaEditorPlugin = new ObjectCreator("ScriptObject", "MissionAreaEditorPlugin", typeof (MissionAreaEditorPlugin));
            ocMissionAreaEditorPlugin["editorGui"] = "MissionAreaEditorGui";
            ocMissionAreaEditorPlugin.Create();

            MissionAreaEditorPlugin oMissionAreaEditorPlugin = "MissionAreaEditorPlugin";

            oMissionAreaEditorPlugin.initialize();
        }
        public static void initialize()
        {
            #region GuiControl (CBObjectRenameCtrl)        oc_Newobject6

            ObjectCreator oc_Newobject6 = new ObjectCreator("GuiControl", "CBObjectRenameCtrl", typeof (CBObjectRenameCtrl));
            oc_Newobject6["position"] = "0 0";
            oc_Newobject6["extent"] = "1024 768";
            oc_Newobject6["minExtent"] = "8 2";
            oc_Newobject6["horizSizing"] = "right";
            oc_Newobject6["vertSizing"] = "bottom";
            oc_Newobject6["profile"] = "GuiDefaultProfile";
            oc_Newobject6["visible"] = "1";
            oc_Newobject6["active"] = "1";
            oc_Newobject6["tooltipProfile"] = "GuiToolTipProfile";
            oc_Newobject6["hovertime"] = "1000";
            oc_Newobject6["isContainer"] = "1";
            oc_Newobject6["canSave"] = "1";
            oc_Newobject6["canSaveDynamicFields"] = "1";

            #region GuiWindowCtrl ()        oc_Newobject5

            ObjectCreator oc_Newobject5 = new ObjectCreator("GuiWindowCtrl", "");
            oc_Newobject5["text"] = "Rename object";
            oc_Newobject5["resizeWidth"] = "1";
            oc_Newobject5["resizeHeight"] = "1";
            oc_Newobject5["canMove"] = "1";
            oc_Newobject5["canClose"] = "1";
            oc_Newobject5["canMinimize"] = "1";
            oc_Newobject5["canMaximize"] = "1";
            oc_Newobject5["canCollapse"] = "0";
            oc_Newobject5["closeCommand"] = "Canvas.popDialog($ThisControl.getParent());";
            oc_Newobject5["edgeSnap"] = "1";
            oc_Newobject5["setTitle"] = "0";
            oc_Newobject5["ShowTitle"] = "1";
            oc_Newobject5["AllowPopWindow"] = "0";
            oc_Newobject5["isInPopup"] = "0";
            oc_Newobject5["LastWindowPosition"] = "0 0";
            oc_Newobject5["margin"] = "0 0 0 0";
            oc_Newobject5["padding"] = "0 0 0 0";
            oc_Newobject5["anchorTop"] = "1";
            oc_Newobject5["anchorBottom"] = "0";
            oc_Newobject5["anchorLeft"] = "1";
            oc_Newobject5["anchorRight"] = "0";
            oc_Newobject5["position"] = "381 263";
            oc_Newobject5["extent"] = "216 113";
            oc_Newobject5["minExtent"] = "8 2";
            oc_Newobject5["horizSizing"] = "center";
            oc_Newobject5["vertSizing"] = "center";
            oc_Newobject5["profile"] = "GuiWindowProfile";
            oc_Newobject5["visible"] = "1";
            oc_Newobject5["active"] = "1";
            oc_Newobject5["tooltipProfile"] = "GuiToolTipProfile";
            oc_Newobject5["hovertime"] = "1000";
            oc_Newobject5["isContainer"] = "1";
            oc_Newobject5["canSave"] = "1";
            oc_Newobject5["canSaveDynamicFields"] = "0";

            #region GuiTextEditCtrl ()        oc_Newobject1

            ObjectCreator oc_Newobject1 = new ObjectCreator("GuiTextEditCtrl", "");
            oc_Newobject1["internalName"] = "textEdit";
            oc_Newobject1["historySize"] = "1";
            oc_Newobject1["tabComplete"] = "0";
            oc_Newobject1["sinkAllKeyEvents"] = "0";
            oc_Newobject1["password"] = "******";
            oc_Newobject1["passwordMask"] = "*";
            oc_Newobject1["maxLength"] = "1024";
            oc_Newobject1["margin"] = "0 0 0 0";
            oc_Newobject1["padding"] = "0 0 0 0";
            oc_Newobject1["anchorTop"] = "1";
            oc_Newobject1["anchorBottom"] = "0";
            oc_Newobject1["anchorLeft"] = "1";
            oc_Newobject1["anchorRight"] = "0";
            oc_Newobject1["position"] = "84 39";
            oc_Newobject1["extent"] = "93 18";
            oc_Newobject1["minExtent"] = "8 2";
            oc_Newobject1["horizSizing"] = "right";
            oc_Newobject1["vertSizing"] = "bottom";
            oc_Newobject1["profile"] = "GuiTextEditProfile";
            oc_Newobject1["visible"] = "1";
            oc_Newobject1["active"] = "1";
            oc_Newobject1["tooltipProfile"] = "GuiToolTipProfile";
            oc_Newobject1["hovertime"] = "1000";
            oc_Newobject1["isContainer"] = "1";
            oc_Newobject1["canSave"] = "1";
            oc_Newobject1["canSaveDynamicFields"] = "0";

            #endregion

            oc_Newobject5["#Newobject1"] = oc_Newobject1;

            #region GuiButtonCtrl (CBOkButton)        oc_Newobject2

            ObjectCreator oc_Newobject2 = new ObjectCreator("GuiButtonCtrl", "CBOkButton");
            oc_Newobject2["text"] = "OK";
            oc_Newobject2["groupNum"] = "-1";
            oc_Newobject2["buttonType"] = "PushButton";
            oc_Newobject2["useMouseEvents"] = "0";
            oc_Newobject2["position"] = "15 76";
            oc_Newobject2["extent"] = "73 20";
            oc_Newobject2["minExtent"] = "8 2";
            oc_Newobject2["horizSizing"] = "right";
            oc_Newobject2["vertSizing"] = "bottom";
            oc_Newobject2["profile"] = "GuiButtonProfile";
            oc_Newobject2["visible"] = "1";
            oc_Newobject2["active"] = "1";
            oc_Newobject2["tooltipProfile"] = "GuiToolTipProfile";
            oc_Newobject2["hovertime"] = "1000";
            oc_Newobject2["isContainer"] = "0";
            oc_Newobject2["canSave"] = "1";
            oc_Newobject2["canSaveDynamicFields"] = "0";
            oc_Newobject2["command"] = "CBObjectRenameCtrl.onOKClicked();";

            #endregion

            oc_Newobject5["#Newobject2"] = oc_Newobject2;

            #region GuiButtonCtrl ()        oc_Newobject3

            ObjectCreator oc_Newobject3 = new ObjectCreator("GuiButtonCtrl", "");
            oc_Newobject3["text"] = "Cancel";
            oc_Newobject3["groupNum"] = "-1";
            oc_Newobject3["buttonType"] = "PushButton";
            oc_Newobject3["useMouseEvents"] = "0";
            oc_Newobject3["position"] = "114 76";
            oc_Newobject3["extent"] = "73 20";
            oc_Newobject3["minExtent"] = "8 2";
            oc_Newobject3["horizSizing"] = "right";
            oc_Newobject3["vertSizing"] = "bottom";
            oc_Newobject3["profile"] = "GuiButtonProfile";
            oc_Newobject3["visible"] = "1";
            oc_Newobject3["active"] = "1";
            oc_Newobject3["tooltipProfile"] = "GuiToolTipProfile";
            oc_Newobject3["hovertime"] = "1000";
            oc_Newobject3["isContainer"] = "0";
            oc_Newobject3["canSave"] = "1";
            oc_Newobject3["canSaveDynamicFields"] = "0";
            oc_Newobject3["command"] = "CBObjectRenameCtrl.onCancelClicked();";

            #endregion

            oc_Newobject5["#Newobject3"] = oc_Newobject3;

            #region GuiTextCtrl ()        oc_Newobject4

            ObjectCreator oc_Newobject4 = new ObjectCreator("GuiTextCtrl", "");
            oc_Newobject4["text"] = "Name";
            oc_Newobject4["maxLength"] = "1024";
            oc_Newobject4["margin"] = "0 0 0 0";
            oc_Newobject4["padding"] = "0 0 0 0";
            oc_Newobject4["anchorTop"] = "1";
            oc_Newobject4["anchorBottom"] = "0";
            oc_Newobject4["anchorLeft"] = "1";
            oc_Newobject4["anchorRight"] = "0";
            oc_Newobject4["position"] = "46 42";
            oc_Newobject4["extent"] = "29 13";
            oc_Newobject4["minExtent"] = "8 2";
            oc_Newobject4["horizSizing"] = "right";
            oc_Newobject4["vertSizing"] = "bottom";
            oc_Newobject4["profile"] = "GuiTextProfile";
            oc_Newobject4["visible"] = "1";
            oc_Newobject4["active"] = "1";
            oc_Newobject4["tooltipProfile"] = "GuiToolTipProfile";
            oc_Newobject4["hovertime"] = "1000";
            oc_Newobject4["isContainer"] = "1";
            oc_Newobject4["canSave"] = "1";
            oc_Newobject4["canSaveDynamicFields"] = "0";

            #endregion

            oc_Newobject5["#Newobject4"] = oc_Newobject4;

            #endregion

            oc_Newobject6["#Newobject5"] = oc_Newobject5;

            #endregion

            oc_Newobject6.Create();
        }