public void TestXmlPersistFromFile() { string file = @"d:\DavidPrac\Vývoje\0061146 Dílenské plánování D4\Zálohy\serial-Manufacturing.xml"; string serial = System.IO.File.ReadAllText(file, Encoding.UTF8); object result = Persist.Deserialize(serial); GuiData guiData = result as GuiData; }
public override void Draw(GameTime gameTime) { base.Draw(gameTime); PostProcessor.begin(); GuiData.startDraw(); GuiData.spriteBatch.Draw(Utils.white, Fullscreen, Color.Black); var dest = Utils.InsetRectangle(Fullscreen, 200); dest.Y = dest.Y + dest.Height / 2 - 200; dest.Height = 400; var destinationRectangle = new Rectangle(Fullscreen.X, dest.Y + 50, Fullscreen.Width, dest.Height - 148); GuiData.spriteBatch.Draw(Utils.white, destinationRectangle, Utils.AddativeRed * (0.5f + Utils.randm(0.1f))); var text = "HACKNET"; FlickeringTextEffect.DrawLinedFlickeringText(dest, text, 18f, 0.7f, GuiData.titlefont, null, Color.White, 6); dest.Y += 400; dest.Height = 120; FlickeringTextEffect.DrawFlickeringText(dest, Utils.FlipRandomChars("MORE SOON", 0.008), -8f, 0.7f, GuiData.titlefont, null, Color.Gray); FlickeringTextEffect.DrawFlickeringText(dest, Utils.FlipRandomChars("MORE SOON", 0.03), -8f, 0.7f, GuiData.titlefont, null, Utils.AddativeWhite * 0.15f); GuiData.endDraw(); PostProcessor.end(); }
public static float doVerticalScrollBar(int id, int xPos, int yPos, int drawWidth, int drawHeight, int contentHeight, float scroll) { if (drawHeight > contentHeight) { contentHeight = drawHeight; } var destinationRectangle = new Rectangle(xPos, yPos, drawWidth, drawHeight); if (destinationRectangle.Contains(GuiData.getMousePoint()) || GuiData.active == id) { GuiData.spriteBatch.Draw(Utils.white, destinationRectangle, Color.Gray * 0.1f); } var num1 = scroll; float num2 = contentHeight - drawHeight; var num3 = drawHeight / (float)contentHeight * drawHeight; var num4 = scroll / num2 * (drawHeight - num3); var num5 = DraggableRectangle.doDraggableRectangle(id, xPos, yPos + num4, drawWidth, (int)num3, drawWidth, Color.White, Color.Gray, true, false, xPos, yPos + drawHeight - num3, xPos, yPos).Y; if (Math.Abs(num5) > 0.100000001490116) { num1 = (float)((num4 + (double)num5) / (drawHeight - (double)num3)) * num2; } return(num1); }
public override void Input() { base.Input(); IsDragging = false; InBorder = false; if (IsFocused) { var mousePos = (Vec2)GuiData.getMousePos(); InBorder = IsInBorder(mousePos); if (!InBorder && !IsPressed && GuiData.isMouseLeftDown()) { OriginalClickPosition = mousePos - Rect.Position; ClickPositionOffset = OriginalClickPosition - Rect.Position; } if (IsPressed) { var movePos = new Vec2(MovedPosition); if (XBound != null) { movePos.X = mousePos.X - Rect.X - OriginalClickPosition.X; movePos.X = Math.Min(Math.Max(Rect.Y + movePos.X, XBound.Y), XBound.X) - Rect.X; } if (YBound != null) { movePos.Y = mousePos.Y - Rect.Y - OriginalClickPosition.Y; movePos.Y = Math.Min(Math.Max(Rect.Y + movePos.Y, YBound.Y), YBound.X) - Rect.Y; } MovedPosition = movePos; IsDragging = true; } GuiData.blockingInput |= IsFocused || IsPressed; } }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { Renderer.UseRenderTargets = false; FlatRedBallServices.InitializeFlatRedBall(this, graphics); this.IsFixedTimeStep = false; mFormMethods = new EditorObjects.FormMethods(); EditorData.Initialize(); LightManager.AddAmbientLight(Color.White); GuiData.Initialize(); IsMouseVisible = true; // Uncomment the following line and add your Screen's fully qualified name // if using Screens in your project. If not, or if you don't know what it means, // just ignore the following line for now. // For more information on Screens see the Screens wiki article on FlatRedBall.com. //Screens.ScreenManager.Start(typeof(AIEditor.Screens.TestScreen).FullName); foreach (string s in Environment.GetCommandLineArgs()) { ProcessCommandLineArgument(s); } base.Initialize(); }
internal static bool Draw(ref OptionsMenu __instance, GameTime gameTime) { if (!isInPathfinderMenu) { return(true); } PostProcessor.begin(); GuiData.startDraw(); PatternDrawer.draw(new Rectangle(0, 0, __instance.ScreenManager.GraphicsDevice.Viewport.Width, __instance.ScreenManager.GraphicsDevice.Viewport.Height), 0.5f, Color.Black, new Color(2, 2, 2), GuiData.spriteBatch); if (ReturnButton.Do()) { currentTabName = null; isInPathfinderMenu = false; GuiData.endDraw(); PostProcessor.end(); var saveEvent = new CustomOptionsSaveEvent(); EventManager <CustomOptionsSaveEvent> .InvokeAll(saveEvent); return(false); } var tabs = OptionsManager.Tabs; int tabX = 10; foreach (var tab in tabs.Values) { if (currentTabName == null) { currentTabName = tab.Name; } var active = currentTabName == tab.Name; // Display tab button if (Button.doButton(tab.ButtonID, tabX, 70, 128, 20, tab.Name, active ? Color.Green : Color.Gray)) { currentTabName = tab.Name; break; } tabX += 128 + 10; if (currentTabName != tab.Name) { continue; } // Display options int optX = 80, optY = 110; foreach (var option in tab.Options) { option.Draw(optX, optY); optY += 10 + option.SizeY; } } GuiData.endDraw(); PostProcessor.end(); return(false); }
public GameForm() : base() { this.DragEnter += new System.Windows.Forms.DragEventHandler(this.GameForm_DragDrop); this.Text = "SpriteEditor - untitled scene"; camera = new SpriteEditor.SEPositionedObjects.EditorCamera(FlatRedBallServices.GlobalContentManager); SpriteManager.Cameras[0] = camera; camera.DestinationRectangle = new Rectangle(0, 0, FlatRedBallServices.ClientWidth, FlatRedBallServices.ClientHeight); camera.FixAspectRatioYConstant(); if (this.IsDisposed) { return; } // this is a little different than what is normally done in the FRBTemplate; // instead of using the SpriteManager's regularly created Camera, make a new // EditorCamera and throw that in the SpriteManager's array. cursor = new SECursor(camera, this); //GuiManager.Initialize(camera, "genGfx/defaultText.tga", this, cursor); GuiManager.Cursors[0] = cursor; FlatRedBallServices.Update(null); SpriteEditorSettings.Initialize(); SpriteManager.MaxParticleCount = 10000; GameData.Initialize(); GuiData.Initialize(); GuiData.messages.Initialize(this); }
public static bool doHoldDownButton(int myID, int x, int y, int width, int height, string text, bool hasOutline, Color?outlineColor, Color?selectedColor) { wasPressedDown = false; wasReleased = false; if (!outlineColor.HasValue) { outlineColor = Color.White; } if (!selectedColor.HasValue) { selectedColor = GuiData.Default_Selected_Color; } var destinationRectangle = GuiData.tmpRect; destinationRectangle.X = x; destinationRectangle.Y = y; destinationRectangle.Width = width; destinationRectangle.Height = height; var flag = GuiData.isMouseLeftDown() && GuiData.active == myID; if (destinationRectangle.Contains(GuiData.getMousePoint())) { GuiData.hot = myID; if (GuiData.mouseWasPressed()) { wasPressedDown = true; } if (GuiData.isMouseLeftDown()) { GuiData.active = myID; flag = true; } } else { if (GuiData.hot == myID) { GuiData.hot = -1; } if (!GuiData.isMouseLeftDown() && GuiData.active == myID && GuiData.active == myID) { GuiData.active = -1; } } if (GuiData.mouseLeftUp()) { wasReleased = true; } GuiData.spriteBatch.Draw(Utils.white, destinationRectangle, GuiData.active == myID ? selectedColor.Value : (GuiData.hot == myID ? GuiData.Default_Lit_Backing_Color : GuiData.Default_Light_Backing_Color)); if (hasOutline) { RenderedRectangle.doRectangleOutline(x, y, width, height, 2, outlineColor); } return(flag); }
public static void Initialize() { SpriteManager.Camera.CameraCullMode = CameraCullMode.None; mEditorLogic = new EditorLogic(); GuiData.Initialize(); }
public override void Draw(GameTime gameTime) { try { float t = (float)gameTime.ElapsedGameTime.TotalSeconds; if (this.lastGameTime == null) { this.lastGameTime = gameTime; } PostProcessor.begin(); GuiData.startDraw(); try { Overlay onlyOverlay = null; foreach (Overlay overlay in this.overlays) { if (overlay.PreventsDrawing()) { onlyOverlay = overlay; break; } } if (onlyOverlay == null) { this.drawBackground(); this.drawModules(gameTime); SFX.Draw(GuiData.spriteBatch); foreach (Overlay overlay in this.overlays) { overlay.Draw(); } } else { onlyOverlay.Draw(); } } catch (System.Exception ex) { Utils.AppendToErrorFile(Utils.GenerateReportFromException(ex) + "\r\n\r\n"); } GuiData.endDraw(); PostProcessor.end(); GuiData.startDraw(); if (this.postFXDrawActions != null) { this.postFXDrawActions(); this.postFXDrawActions = null; } this.drawScanlines(); GuiData.endDraw(); } catch (System.Exception ex) { Utils.AppendToErrorFile(Utils.GenerateReportFromException(ex)); } }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { FlatRedBallServices.InitializeFlatRedBall(this, graphics); InitializeIoc(); this.TargetElapsedTime = TimeSpan.FromSeconds(1 / 30.0); mToolForm = new ToolForm(); mToolForm.Owner = (Form)(Form.FromHandle(FlatRedBallServices.WindowHandle)); mToolForm.ItemCollapsedOrExpanded += HandleToolFormItemCollapsedOrExpanded; Plugin.PluginManager.Initialize(); IsMouseVisible = true; IsFixedTimeStep = false; GuiData.Initialize(); RegisterAdditionalAssemblies(); AvailableAssetTypes.Self.Initialize(FileManager.RelativeDirectory); #region Set up resizing mFormMethods = new FormMethods(0, 0, 0, 0); #endregion SpriteManager.Camera.BackgroundColor = Color.Gray; FlatRedBall.Math.Geometry.Polygon.TolerateEmptyPolygons = true; ExposedVariableManager.Initialize(); try { RemotingServer.SetupPort(8686); RemotingServer.SetupInterface <FlatRedBall.Glue.SelectionInterface>(); RemotingServer.SetupInterface <RegisterInterface>(); } catch (Exception e) { System.Windows.Forms.MessageBox.Show("GlueView could not start, please make sure GlueView is not already running on your computer \n \n Exception: \n" + e.ToString()); FlatRedBall.FlatRedBallServices.Game.Exit(); } mToolForm.Show(); GluxManager.ContentManagerName = "GlueView"; EditorLogic.Initialize(); CommandLineManager.Self.ProcessCommandLineArgs(this.mToolForm); mainForm = Form.FromHandle(FlatRedBallServices.WindowHandle) as Form; mainForm.Resize += HandleResize; base.Initialize(); }
public static void LoadFontConfigForLocale(string locale, ContentManager content) { if (!GuiData.LocaleFontConfigs.ContainsKey(locale)) { GuiData.LocaleFontConfigs.Add(locale, LocaleFontLoader.LoadFontConfigSetForLocale(locale, "", content)); } GuiData.ActivateFontConfig(GuiData.ActiveFontConfig.name); GuiData.UITinyfont = GuiData.LocaleFontConfigs[locale][0].tinyFont; GuiData.UISmallfont = GuiData.LocaleFontConfigs[locale][0].smallFont; }
public static void MainMenuTextPatch() { if (bruhButton == null) { return; } GuiData.startDraw(); bruhButton.Do(); GuiData.endDraw(); }
public static void Activity() { mEditorLogic.Update(); // records changes for the current Sprite, or the current SpriteGrid GuiData.Update(); sesgMan.spriteGridArrayLogic(); UndoManager.EndOfFrameActivity(); }
public static bool onOptionsMenuDraw(OptionsMenu self, ref GameTime time) { var optionsMenuDrawEvent = new Event.OptionsMenuDrawEvent(self, time); optionsMenuDrawEvent.CallEvent(); if (optionsMenuDrawEvent.IsCancelled) { GuiData.endDraw(); PostProcessor.end(); return(true); } return(false); }
public static void drawMainMenu(PathfinderEvent pathfinderEvent) { DrawMainMenuEvent drawMainMenuEvent = (DrawMainMenuEvent)pathfinderEvent; if (mainMenuState != MainMenuState.PathfinderModList) { return; } drawMainMenuEvent.IsCancelled = true; GameScreen baseS = ((GameScreen)drawMainMenuEvent.MainMenuInstance); try { PostProcessor.begin(); baseS.ScreenManager.FadeBackBufferToBlack(255); GuiData.startDraw(); Rectangle dest = new Rectangle(0, 0, baseS.ScreenManager.GraphicsDevice.Viewport.Width, baseS.ScreenManager.GraphicsDevice.Viewport.Height); Rectangle destinationRectangle = new Rectangle(-20, -20, baseS.ScreenManager.GraphicsDevice.Viewport.Width + 40, baseS.ScreenManager.GraphicsDevice.Viewport.Height + 40); Rectangle dest2 = new Rectangle(dest.X + dest.Width / 4, dest.Height / 4, dest.Width / 2, dest.Height / 4); GuiData.spriteBatch.Draw(Utils.white, destinationRectangle, Color.Black); if (Settings.DrawHexBackground) { HexGridBackground hexBack = (HexGridBackground)drawMainMenuEvent.MainMenuInstance.GetType().GetField("hexBackground", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(drawMainMenuEvent.MainMenuInstance); hexBack.Draw(dest, GuiData.spriteBatch, Color.Transparent, Settings.lighterColorHexBackground ? new Color(20, 20, 20) : new Color(15, 15, 15, 0), HexGridBackground.ColoringAlgorithm.NegaitiveSinWash, 0f); } TextItem.DrawShadow = false; if (Button.doButton(15, 180, 650, 250, 28, "Return", new Color?(MainMenu.exitButtonColor))) { mainMenuState = MainMenuState.GameHandled; } TextItem.doFontLabel(new Vector2(125f, (float)50), "Loaded Pathfinder Mods", GuiData.font, new Color?(Color.White), 3.40282347E+38f, 3.40282347E+38f, false); float yPos = 120; foreach (string modIdentifier in Pathfinder.LoadedModIdentifiers) { TextItem.doFontLabel(new Vector2(200f, (float)yPos), modIdentifier, GuiData.smallfont, new Color?(Color.White), 3.40282347E+38f, 3.40282347E+38f, false); yPos += 30; } GuiData.endDraw(); PostProcessor.end(); baseS.ScreenManager.FadeBackBufferToBlack((int)(255 - baseS.TransitionAlpha)); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public static void Update() { GuiData.Update(); // Control camera if (InputManager.ReceivingInput == null) { InputManager.Keyboard.ControlPositionedObject(SpriteManager.Camera, 16); } EditorObjects.CameraMethods.MouseCameraControl(SpriteManager.Camera); UndoManager.EndOfFrameActivity(); }
// Hook location : MainMenu.Draw() public static bool onMainMenuDraw(MainMenu self, GameTime gameTime) { var drawMainMenuEvent = new Event.DrawMainMenuEvent(self, gameTime); drawMainMenuEvent.CallEvent(); if (drawMainMenuEvent.IsCancelled) { GuiData.endDraw(); PostProcessor.end(); self.ScreenManager.FadeBackBufferToBlack(255 - self.TransitionAlpha); return(true); } return(false); }
public static void doRectangle(int x, int y, int width, int height, Color?color, bool blocking) { RenderedRectangle.doRectangle(x, y, width, height, color); Rectangle tmpRect = GuiData.tmpRect; tmpRect.X = x; tmpRect.Y = y; tmpRect.Width = width; tmpRect.Height = height; if (!blocking || !tmpRect.Contains(GuiData.getMousePoint())) { return; } GuiData.blockingInput = true; }
public static void doRectangle(int x, int y, int width, int height, Color?color, bool blocking) { doRectangle(x, y, width, height, color); var rectangle = GuiData.tmpRect; rectangle.X = x; rectangle.Y = y; rectangle.Width = width; rectangle.Height = height; if (!blocking || !rectangle.Contains(GuiData.getMousePoint())) { return; } GuiData.blockingInput = true; }
public override void PostDrawStep() { base.PostDrawStep(); if (this.inputLocked) { GuiData.blockingInput = false; GuiData.blockingInput = this.guiInputLockStatus; Rectangle bounds = this.bounds; if (bounds.Contains(GuiData.getMousePoint())) { GuiData.spriteBatch.Draw(Utils.white, bounds, Color.Gray * 0.5f); Vector2 position = new Vector2((float)(bounds.X + bounds.Width / 2 - OnCoreModule.LockSprite.Width / 2), (float)(bounds.Y + bounds.Height / 2 - OnCoreModule.LockSprite.Height / 2)); GuiData.spriteBatch.Draw(OnCoreModule.LockSprite, position, Color.White); } } }
public static void Initialize() { // Create the mBoundsCamera before the GUI since the GUI will create a PropertyGrid for this object. mBoundsCamera = new Camera(FlatRedBallServices.GlobalContentManager); mBoundsCamera.DrawsWorld = false; mBoundsCamera.DrawsToScreen = false; // This needs to happen after the bounds camera is created, but before GuiData is initialized. mEditorLogic = new EditorLogic(); GuiData.Initialize(); // make resizable new EditorObjects.FormMethods(); }
public static Vector2 endPanel(int id, Vector2 scroll, Rectangle bounds, float maxScroll, bool onlyScrollWithMouseOver = false) { batches.Peek().End(); var renderTarget2D = targets.Pop(); GuiData.spriteBatch.GraphicsDevice.SetRenderTarget(targets.Peek()); targetPool.Add(renderTarget2D); batchPool.Add(batches.Pop()); GuiData.spriteBatch = batches.Peek(); GuiData.scrollOffset = offsetStack.Pop(); var rectangle1 = GuiData.tmpRect; rectangle1.X = (int)scroll.X; rectangle1.Y = (int)scroll.Y; rectangle1.Width = bounds.Width; rectangle1.Height = bounds.Height; try { GuiData.spriteBatch.Draw(renderTarget2D, bounds, rectangle1, Color.White); } catch (InvalidOperationException ex) { return(scroll); } if (!onlyScrollWithMouseOver || bounds.Contains(GuiData.getMousePoint())) { scroll.Y += GuiData.getMouseWheelScroll() * 20f; } scroll.Y = Math.Max(Math.Min(scroll.Y, maxScroll), 0.0f); var rectangle2 = GuiData.tmpRect; var num1 = 5f; var num2 = bounds.Height / maxScroll * bounds.Height; var num3 = bounds.Height - 4f; var num4 = scroll.Y / maxScroll * (bounds.Height - num2); rectangle2.Y = (int)(num4 - num2 / 2.0 + num2 / 2.0 + bounds.Y); rectangle2.X = (int)(bounds.X + bounds.Width - 1.5 * num1 - 2.0); rectangle2.Height = (int)num2; rectangle2.Width = (int)num1; scroll.Y = ScrollBar.doVerticalScrollBar(id, rectangle2.X, bounds.Y, rectangle2.Width, bounds.Height, renderTarget2D.Height, scroll.Y); scroll.Y = Math.Max(Math.Min(scroll.Y, maxScroll), 0.0f); return(scroll); }
public static bool doCheckBox(int myID, int x, int y, bool isChecked, Color?selectedColor) { if (!selectedColor.HasValue) { selectedColor = GuiData.Default_Selected_Color; } if (GuiData.hot == myID && GuiData.active == myID && GuiData.mouseLeftUp()) { isChecked = !isChecked; GuiData.active = -1; } RenderedRectangle.doRectangleOutline(x, y, 20, 20, 2, GuiData.hot == myID ? GuiData.Default_Lit_Backing_Color : GuiData.Default_Light_Backing_Color); RenderedRectangle.doRectangle(x + 4, y + 4, 12, 12, isChecked ? selectedColor : (GuiData.active == myID ? GuiData.Default_Unselected_Color : GuiData.Default_Backing_Color)); var rectangle = GuiData.tmpRect; rectangle.X = x; rectangle.Y = y; rectangle.Width = 20; rectangle.Height = 20; if (rectangle.Contains(GuiData.getMousePoint())) { GuiData.hot = myID; if (GuiData.isMouseLeftDown()) { GuiData.active = myID; } } else { if (GuiData.hot == myID) { GuiData.hot = -1; } if (GuiData.isMouseLeftDown() && GuiData.active == myID && GuiData.active == myID) { GuiData.active = -1; } } return(isChecked); }
public static Vector2 endPanel(int id, Vector2 scroll, Rectangle bounds, float maxScroll, bool onlyScrollWithMouseOver = false) { ScrollablePanel.batches.Peek().End(); RenderTarget2D renderTarget2D = ScrollablePanel.targets.Pop(); GuiData.spriteBatch.GraphicsDevice.SetRenderTarget(ScrollablePanel.targets.Peek()); ScrollablePanel.targetPool.Add(renderTarget2D); ScrollablePanel.batchPool.Add(ScrollablePanel.batches.Pop()); GuiData.spriteBatch = ScrollablePanel.batches.Peek(); GuiData.scrollOffset = ScrollablePanel.offsetStack.Pop(); Rectangle tmpRect1 = GuiData.tmpRect; tmpRect1.X = (int)scroll.X; tmpRect1.Y = (int)scroll.Y; tmpRect1.Width = bounds.Width; tmpRect1.Height = bounds.Height; try { GuiData.spriteBatch.Draw((Texture2D)renderTarget2D, bounds, new Rectangle?(tmpRect1), Color.White); } catch (InvalidOperationException ex) { return(scroll); } if (!onlyScrollWithMouseOver || bounds.Contains(GuiData.getMousePoint())) { scroll.Y += GuiData.getMouseWheelScroll() * 20f; } scroll.Y = Math.Max(Math.Min(scroll.Y, maxScroll), 0.0f); Rectangle tmpRect2 = GuiData.tmpRect; float num1 = 5f; float num2 = (float)bounds.Height / maxScroll * (float)bounds.Height; float num3 = (float)bounds.Height - 4f; float num4 = scroll.Y / maxScroll * ((float)bounds.Height - num2); tmpRect2.Y = (int)((double)num4 - (double)num2 / 2.0 + (double)num2 / 2.0 + (double)bounds.Y); tmpRect2.X = (int)((double)(bounds.X + bounds.Width) - 1.5 * (double)num1 - 2.0); tmpRect2.Height = (int)num2; tmpRect2.Width = (int)num1; scroll.Y = ScrollBar.doVerticalScrollBar(id, tmpRect2.X, bounds.Y, tmpRect2.Width, bounds.Height, renderTarget2D.Height, scroll.Y); scroll.Y = Math.Max(Math.Min(scroll.Y, maxScroll), 0.0f); return(scroll); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { FlatRedBallServices.InitializeFlatRedBall(this, _graphics); IsMouseVisible = true; GuiData.Initialize(); AvailableAssetTypes.Initialize(FileManager.RelativeDirectory + "Content/ContentTypes.csv"); #region Set up resizing Renderer.UseRenderTargets = false; #endregion try { RemotingServer.SetupPort(9426); RemotingServer.SetupInterface <SelectionInterface>(); RemotingServer.SetupInterface <RegisterInterface>(); } catch (Exception e) { System.Windows.Forms.MessageBox.Show(@"Level Editor could not start, please make sure Level Editor is not already running on your computer Exception: " + e); FlatRedBallServices.Game.Exit(); } GluxManager.ContentManagerName = "LevelEditor"; EditorLogic.Initialize(); base.Initialize(); }
public static bool doButton(int myID, int x, int y, int width, int height, string text, Color?selectedColor, Texture2D tex) { var flag = false; if (GuiData.hot == myID && !GuiData.blockingInput && GuiData.active == myID && (GuiData.mouseLeftUp() || GuiData.mouse.LeftButton == ButtonState.Released)) { flag = true; GuiData.active = -1; } var rectangle = GuiData.tmpRect; rectangle.X = x; rectangle.Y = y; rectangle.Width = width; rectangle.Height = height; if (rectangle.Contains(GuiData.getMousePoint()) && !GuiData.blockingInput) { GuiData.hot = myID; if (GuiData.isMouseLeftDown() && (!DisableIfAnotherIsActive || GuiData.active == -1)) { GuiData.active = myID; } } else { if (GuiData.hot == myID) { GuiData.hot = -1; } if (GuiData.isMouseLeftDown() && GuiData.active == myID && GuiData.active == myID) { GuiData.active = -1; } } drawModernButton(myID, x, y, width, height, text, selectedColor, tex); return(flag); }
public override bool Draw() { IsDragging = false; if (IsActive && !InBorder) { if (!IsHeldDown) { if (GuiData.mouseWasPressed()) { OriginalClickPosition = GuiData.getMousePos(); OriginalClickPosition.X -= X; OriginalClickPosition.Y -= Y; ClickPositionOffset = new Vector2(OriginalClickPosition.X - X, OriginalClickPosition.Y - Y); } } } if (IsHeldDown) { float mvx = MovedPosition.X, mvy = MovedPosition.Y; if (XBound.HasValue) { mvx = GuiData.mouse.X - X - OriginalClickPosition.X; mvx = Math.Min(Math.Max(Y + mvx, XBound.Value.Min), XBound.Value.Max) - X; } if (YBound.HasValue) { mvy = GuiData.mouse.Y - Y - OriginalClickPosition.Y; mvy = Math.Min(Math.Max(Y + mvy, YBound.Value.Min), YBound.Value.Max) - Y; } MovedPosition = new Vector2(mvx, mvy); IsDragging = true; } GuiData.blockingInput |= IsActive || IsHeldDown; base.Draw(); return(IsDragging); }
public static float doVerticalScrollBar(int id, int xPos, int yPos, int drawWidth, int drawHeight, int contentHeight, float scroll) { if (drawHeight > contentHeight) { contentHeight = drawHeight; } Rectangle destinationRectangle = new Rectangle(xPos, yPos, drawWidth, drawHeight); if (ScrollBar.AlwaysDrawUnderBar || destinationRectangle.Contains(GuiData.getMousePoint()) || GuiData.active == id) { GuiData.spriteBatch.Draw(Utils.white, destinationRectangle, Color.Gray * 0.1f); } float num1 = scroll; float num2 = (float)(contentHeight - drawHeight); float num3 = (float)drawHeight / (float)contentHeight * (float)drawHeight; float num4 = scroll / num2 * ((float)drawHeight - num3); float y = DraggableRectangle.doDraggableRectangle(id, (float)xPos, (float)yPos + num4, drawWidth, (int)num3, (float)drawWidth, new Color?(Color.White), new Color?(Color.Gray), true, false, (float)xPos, (float)(yPos + drawHeight) - num3, (float)xPos, (float)yPos).Y; if ((double)Math.Abs(y) > 0.100000001490116) { num1 = (float)(((double)num4 + (double)y) / ((double)drawHeight - (double)num3)) * num2; } return(num1); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { FlatRedBallServices.InitializeFlatRedBall(this, graphics); //SpriteManager.Camera.LightingEnabled = true; //SpriteManager.Camera.Lights.SetDefaultLighting(FlatRedBall.Graphics.Lighting.LightCollection.DefaultLightingSetup.Evening); FlatRedBall.Graphics.Lighting.LightManager.AddAmbientLight(Color.White); IsMouseVisible = true; GuiManager.IsUIEnabled = true; SpriteManager.Camera.CameraModelCullMode = FlatRedBall.Graphics.CameraModelCullMode.None; EditorData.Initialize(null); GuiData.Initialize(); ProcessCommandLineArguments(); // TODO: Set the name of the file that the user is editing. base.Initialize(); }
public PropertyWindow(GuiManager guiMan, InputManager inpMan, GameData gameData, GuiData guiData) : base(GuiManager.cursor) { #region engine data and GUI object references PropertyWindowMessages.guiData = guiData; PropertyWindowMessages.gameData = gameData; PropertyWindowMessages.guiMan = guiMan; PropertyWindowMessages.sprMan = gameData.sprMan; PropertyWindowMessages.propWindow = this; #endregion #region Initialize this and the WAVListBox sclX = 20; sclY = 20; SetPositionTL(20, 22.8f); mMoveBar = true; AddXButton(); mName = "Properties"; propertiesEditingListBox = this.AddWAVListBox(GuiManager.cursor); propertiesEditingListBox.sclX = 7; propertiesEditingListBox.sclY = 18.5f; propertiesEditingListBox.SetPositionTL(sclX-12.5f, sclY + -.1f); propertiesEditingListBox.scrollBarVisible = false; propertiesEditingListBox.onClick += new FrbGuiMessage(PropertyWindowMessages.propertiesEditingClick); GuiManager.AddWindow(this); #endregion #region textureGUI textureGUI = new WindowArray(); texturePath = AddTextDisplay(); texturePath.text = "Click button to set texture"; texturePath.SetPositionTL(propertiesEditingListBox.sclX * 2 + 1, 1.5f); textureGUI.Add(texturePath); textureOrAnimation = AddComboBox(); textureOrAnimation.sclX = 7; textureOrAnimation.AddItem("Single Texture"); textureOrAnimation.AddItem("Animation Chain"); textureOrAnimation.text = "Single Texture"; textureOrAnimation.SetPositionTL(propertiesEditingListBox.sclX * 2 + 8, 3.5f); textureOrAnimation.onItemClick += new FrbGuiMessage(PropertyWindowMessages.updateTextureOrAnimationButton); textureGUI.Add(textureOrAnimation); #region single texture GUI textureButton = AddButton(); textureButton.sclX = textureButton.sclY = 9; textureButton.SetPositionTL(propertiesEditingListBox.sclX * 2 + 10, 14.0f); textureButton.onClick += new FrbGuiMessage(PropertyWindowMessages.textureButtonClick); textureGUI.Add(textureButton); #endregion textureGUI.visible = false; propertiesEditingListBox.AddWindowArray("Texture", textureGUI); #endregion #region particlePropertiesGUI particlePropertiesGUI = new WindowArray(); float runningY = 4; emitterNameDisplay = this.AddTextDisplay(); emitterNameDisplay.text = "Name:"; emitterNameDisplay.SetPositionTL(15, runningY); particlePropertiesGUI.Add(emitterNameDisplay); emitterName = AddTextBox(); emitterName.sclX = 5; emitterName.SetPositionTL(26, runningY); emitterName.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.emitterNameTextBoxLoseFocus); particlePropertiesGUI.Add(emitterName); runningY += 3; #region x y z position xPos = AddTextDisplay(); xPos.text = "X Pos:"; xPos.SetPositionTL(15, runningY); particlePropertiesGUI.Add(xPos); xPosTextBox = AddTextBox(); xPosTextBox.sclX = 3; xPosTextBox.SetPositionTL(24, runningY); xPosTextBox.format = TextBox.FormatTypes.DECIMAL; xPosTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.xPosTextBoxLoseFocus); particlePropertiesGUI.Add(xPosTextBox); runningY += 2.5f; yPos = AddTextDisplay(); yPos.text = "Y Pos:"; yPos.SetPositionTL(15, runningY); particlePropertiesGUI.Add(yPos); yPosTextBox = AddTextBox(); yPosTextBox.sclX = 3; yPosTextBox.SetPositionTL(24, runningY); yPosTextBox.format = TextBox.FormatTypes.DECIMAL; yPosTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.yPosTextBoxLoseFocus); particlePropertiesGUI.Add(yPosTextBox); runningY += 2.5f; zPos = AddTextDisplay(); zPos.text = "Z Pos:"; zPos.SetPositionTL(15, runningY); particlePropertiesGUI.Add(zPos); zPosTextBox = AddTextBox(); zPosTextBox.sclX = 3; zPosTextBox.SetPositionTL(24, runningY); zPosTextBox.format = TextBox.FormatTypes.DECIMAL; zPosTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.zPosTextBoxLoseFocus); particlePropertiesGUI.Add(zPosTextBox); runningY += 3; #endregion #region sclX and sclXVelocity xScl = AddTextDisplay(); xScl.SetPositionTL(15, runningY); xScl.text = "X Scl:"; particlePropertiesGUI.Add(xScl); xSclTextBox = AddTextBox(); xSclTextBox.SetPositionTL(24f, runningY); xSclTextBox.sclX = 3; xSclTextBox.format = TextBox.FormatTypes.DECIMAL; xSclTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.xSclTextBoxLoseFocus); particlePropertiesGUI.Add(xSclTextBox); runningY += 2.5f; xSclVelocity = AddTextDisplay(); xSclVelocity.SetPositionTL(15, runningY); xSclVelocity.text = "X Scl Vel:"; particlePropertiesGUI.Add(xSclVelocity); xSclVelocityTextBox = AddTextBox(); xSclVelocityTextBox.SetPositionTL(24f, runningY); xSclVelocityTextBox.sclX = 3; xSclVelocityTextBox.format = TextBox.FormatTypes.DECIMAL; xSclVelocityTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.xSclVelocityTextBoxLoseFocus); particlePropertiesGUI.Add(xSclVelocityTextBox); runningY += 3; #endregion #region sclY and sclYVelocity yScl = AddTextDisplay(); yScl.SetPositionTL(15, runningY); yScl.text = "Y Scl:"; particlePropertiesGUI.Add(yScl); ySclTextBox = AddTextBox(); ySclTextBox.SetPositionTL(24f, runningY); ySclTextBox.sclX = 3; ySclTextBox.format = TextBox.FormatTypes.DECIMAL; ySclTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.ySclTextBoxLoseFocus); particlePropertiesGUI.Add(ySclTextBox); runningY += 2.5f; ySclVelocity = AddTextDisplay(); ySclVelocity.SetPositionTL(15, runningY); ySclVelocity.text = "Y Scl Vel:"; particlePropertiesGUI.Add(ySclVelocity); ySclVelocityTextBox = AddTextBox(); ySclVelocityTextBox.SetPositionTL(24f, runningY); ySclVelocityTextBox.sclX = 3; ySclVelocityTextBox.format = TextBox.FormatTypes.DECIMAL; ySclVelocityTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.ySclVelocityTextBoxLoseFocus); particlePropertiesGUI.Add(ySclVelocityTextBox); runningY += 3; #endregion #region rotZ and rotZVelocity rotZDisplay = AddTextDisplay(); rotZDisplay.SetPositionTL(15, runningY); rotZDisplay.text = "Z Rot:"; particlePropertiesGUI.Add(rotZDisplay); rotZFixedOrRange = AddComboBox(); rotZFixedOrRange.sclX = 3.5f; rotZFixedOrRange.AddItem("Fixed"); rotZFixedOrRange.AddItem("Range"); rotZFixedOrRange.text = "Fixed"; rotZFixedOrRange.SetPositionTL(24.5f, runningY); rotZFixedOrRange.onItemClick += new FrbGuiMessage(PropertyWindowMessages.updateRotZRange); rotZFixedOrRange.onItemClick += new FrbGuiMessage(PropertyWindowMessages.rotZFixedOrRangeItemClick); particlePropertiesGUI.Add(rotZFixedOrRange); rotZMinTextBox = AddTextBox(); rotZMinTextBox.SetPositionTL(30.5f, runningY); rotZMinTextBox.sclX = 2; rotZMinTextBox.format = TextBox.FormatTypes.DECIMAL; rotZMinTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.rotZMinTextBoxLoseFocus); particlePropertiesGUI.Add(rotZMinTextBox); rotZRangeGUI = new WindowArray(); rotZTo = AddTextDisplay(); rotZTo.SetPositionTL(32.0f, runningY); rotZTo.text = "to"; rotZRangeGUI.Add(rotZTo); rotZMaxTextBox = AddTextBox(); rotZMaxTextBox.SetPositionTL(36f, runningY); rotZMaxTextBox.sclX = 2; rotZMaxTextBox.format = TextBox.FormatTypes.DECIMAL; rotZMaxTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.rotZMaxTextBoxLoseFocus); rotZRangeGUI.Add(rotZMaxTextBox); rotZRangeGUI.visible = false; runningY += 2.5f; rotZVelocityDisplay = AddTextDisplay(); rotZVelocityDisplay.SetPositionTL(15, runningY); rotZVelocityDisplay.text = "Z Rot Vel:"; particlePropertiesGUI.Add(rotZVelocityDisplay); rotZVelocityFixedOrRange = AddComboBox(); rotZVelocityFixedOrRange.sclX = 3.5f; rotZVelocityFixedOrRange.AddItem("Fixed"); rotZVelocityFixedOrRange.AddItem("Range"); rotZVelocityFixedOrRange.text = "Fixed"; rotZVelocityFixedOrRange.SetPositionTL(24.5f, runningY); rotZVelocityFixedOrRange.onItemClick += new FrbGuiMessage(PropertyWindowMessages.updateRotZVelocityRange); rotZVelocityFixedOrRange.onItemClick += new FrbGuiMessage(PropertyWindowMessages.rotZVelocityFixedOrRangeItemClick); particlePropertiesGUI.Add(rotZVelocityFixedOrRange); rotZVelocityMinTextBox = AddTextBox(); rotZVelocityMinTextBox.SetPositionTL(30.5f, runningY); rotZVelocityMinTextBox.sclX = 2; rotZVelocityMinTextBox.format = TextBox.FormatTypes.DECIMAL; rotZVelocityMinTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.rotZVelocityMinTextBoxLoseFocus); particlePropertiesGUI.Add(rotZVelocityMinTextBox); rotZVelocityRangeGUI = new WindowArray(); rotZVelocityTo = AddTextDisplay(); rotZVelocityTo.SetPositionTL(32.0f, runningY); rotZVelocityTo.text = "to"; rotZVelocityRangeGUI.Add(rotZVelocityTo); rotZVelocityMaxTextBox = AddTextBox(); rotZVelocityMaxTextBox.SetPositionTL(36, runningY); rotZVelocityMaxTextBox.sclX = 2; rotZVelocityMaxTextBox.format = TextBox.FormatTypes.DECIMAL; rotZVelocityMaxTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.rotZVelocityMaxTextBoxLoseFocus); rotZVelocityRangeGUI.Add(rotZVelocityMaxTextBox); rotZVelocityRangeGUI.visible = false; runningY += 3; #endregion #region velocityLoss velocityLossPercentageRate = AddTextDisplay(); velocityLossPercentageRate.SetPositionTL(15, runningY); velocityLossPercentageRate.text = "Velocity Loss %:"; particlePropertiesGUI.Add(velocityLossPercentageRate); velocityLossTextBox = AddTextBox(); velocityLossTextBox.SetPositionTL(28, runningY); velocityLossTextBox.sclX = 2.5f; velocityLossTextBox.format = TextBox.FormatTypes.DECIMAL; velocityLossTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.velocityLossTextBoxLoseFocus); particlePropertiesGUI.Add(velocityLossTextBox); runningY += 3; #endregion #region removal event GUI removalEvent = AddTextDisplay(); removalEvent.text = "Removal Event:"; removalEvent.SetPositionTL(15, runningY); particlePropertiesGUI.Add(removalEvent); removalEventComboBox = AddComboBox(); removalEventComboBox.SetPositionTL(31, runningY); removalEventComboBox.sclX = 6f; removalEventComboBox.AddItem("Fade out"); removalEventComboBox.AddItem("Out of screen"); removalEventComboBox.AddItem("Timed"); removalEventComboBox.AddItem("None"); removalEventComboBox.text = "None"; removalEventComboBox.onItemClick += new FrbGuiMessage(PropertyWindowMessages.removalEventComboBoxItemClick); removalEventComboBox.onItemClick += new FrbGuiMessage(PropertyWindowMessages.updateLastingTimeGUI); particlePropertiesGUI.Add(removalEventComboBox); runningY += 3; lastingTimeGUI = new WindowArray(); lastingTime = AddTextDisplay(); lastingTime.text = "Seconds Lasting:"; lastingTime.SetPositionTL(15, runningY); lastingTimeGUI.Add(lastingTime); lastingTimeTextBox = AddTextBox(); lastingTimeTextBox.SetPositionTL(28, runningY); lastingTimeTextBox.sclX = 3; lastingTimeTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.lastingTimeTextBoxLoseFocus); lastingTimeGUI.Add(lastingTimeTextBox); lastingTimeTextBox.format = TextBox.FormatTypes.DECIMAL; lastingTimeGUI.visible = false; #endregion particlePropertiesGUI.visible = false; propertiesEditingListBox.AddWindowArray("Particle Prop.", particlePropertiesGUI); #endregion #region emissionAreaGUI emissionAreaGUI = new WindowArray(); runningY = 2; emissionAreaType = AddComboBox(); emissionAreaType.SetPositionTL(24, runningY); emissionAreaType.sclX = 8; emissionAreaType.AddItem("Point"); emissionAreaType.AddItem("Rectangle"); emissionAreaType.AddItem("Cube"); emissionAreaType.text = "Point"; emissionAreaType.onItemClick += new FrbGuiMessage(PropertyWindowMessages.updateEmissionAreaGUIVisibility); emissionAreaType.onItemClick += new FrbGuiMessage(PropertyWindowMessages.ChangeAreaEmissionType); emissionAreaGUI.Add(emissionAreaType); runningY += 2.5f; emissionAreaSclXTextDisplay = this.AddTextDisplay(); emissionAreaSclXTextDisplay.SetPositionTL(15, runningY); emissionAreaSclXTextDisplay.text = "Emission Area SclX:"; emissionAreaGUI.Add(emissionAreaSclXTextDisplay); emissionAreaSclX = AddUpDown(); emissionAreaSclX.sclX = 3f; emissionAreaSclX.SetPositionTL(30.2f, runningY); emissionAreaSclX.CurrentValue = 1; emissionAreaSclX.onGUIChange += new FrbGuiMessage(PropertyWindowMessages.EmissionAreaSclXChange); emissionAreaGUI.Add(emissionAreaSclX); runningY += 2; emissionAreaSclYTextDisplay = this.AddTextDisplay(); emissionAreaSclYTextDisplay.SetPositionTL(15, runningY); emissionAreaSclYTextDisplay.text = "Emission Area SclY:"; emissionAreaGUI.Add(emissionAreaSclYTextDisplay); emissionAreaSclY = AddUpDown(); emissionAreaSclY.sclX = 3f; emissionAreaSclY.SetPositionTL(30.2f, runningY); emissionAreaSclY.CurrentValue = 1; emissionAreaSclY.onGUIChange += new FrbGuiMessage(PropertyWindowMessages.EmissionAreaSclYChange); emissionAreaGUI.Add(emissionAreaSclY); runningY += 2; emissionAreaSclZTextDisplay = this.AddTextDisplay(); emissionAreaSclZTextDisplay.SetPositionTL(15, runningY); emissionAreaSclZTextDisplay.text = "Emission Area SclZ:"; emissionAreaGUI.Add(emissionAreaSclZTextDisplay); emissionAreaSclZ = AddUpDown(); emissionAreaSclZ.sclX = 3f; emissionAreaSclZ.SetPositionTL(30.2f, runningY); emissionAreaSclZ.CurrentValue = 1; emissionAreaSclZ.onGUIChange += new FrbGuiMessage(PropertyWindowMessages.EmissionAreaSclZChange); emissionAreaGUI.Add(emissionAreaSclZ); emissionAreaGUI.visible = false; propertiesEditingListBox.AddWindowArray("Emission Area", emissionAreaGUI); #endregion #region attachment props GUI relativePropertiesGUI = new WindowArray(); runningY = 4.5f; attachmentInformationTextDisplay = this.AddTextDisplay(); attachmentInformationTextDisplay.text = "Attached To: null"; attachmentInformationTextDisplay.SetPositionTL(15, runningY); relativePropertiesGUI.Add(attachmentInformationTextDisplay); runningY += 2.5f; relXDisplay = this.AddTextDisplay(); relXDisplay.text = "RelX:"; relXDisplay.SetPositionTL(15, runningY); relativePropertiesGUI.Add(relXDisplay); relXTextBox = this.AddTextBox(); relXTextBox.SetPositionTL(25, runningY); relXTextBox.sclX = 3; relXTextBox.format = TextBox.FormatTypes.DECIMAL; relXTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.RelXTextBoxLoseFocus); relativePropertiesGUI.Add(relXTextBox); runningY += 2.5f; relYDisplay = this.AddTextDisplay(); relYDisplay.text = "RelY:"; relYDisplay.SetPositionTL(15, runningY); relativePropertiesGUI.Add(relYDisplay); relYTextBox = this.AddTextBox(); relYTextBox.SetPositionTL(25, runningY); relYTextBox.sclX = 3; relYTextBox.format = TextBox.FormatTypes.DECIMAL; relYTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.RelYTextBoxLoseFocus); relativePropertiesGUI.Add(relYTextBox); runningY += 2.5f; relZDisplay = this.AddTextDisplay(); relZDisplay.text = "RelZ:"; relZDisplay.SetPositionTL(15, runningY); relativePropertiesGUI.Add(relZDisplay); relZTextBox = this.AddTextBox(); relZTextBox.SetPositionTL(25, runningY); relZTextBox.sclX = 3; relZTextBox.format = TextBox.FormatTypes.DECIMAL; relZTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.RelZTextBoxLoseFocus); relativePropertiesGUI.Add(relZTextBox); runningY += 2.5f; relRotZDisplay = this.AddTextDisplay(); relRotZDisplay.text = "RelRotZ:"; relRotZDisplay.SetPositionTL(15, runningY); relativePropertiesGUI.Add(relRotZDisplay); relRotZTextBox = this.AddTextBox(); relRotZTextBox.SetPositionTL(25, runningY); relRotZTextBox.sclX = 3; relRotZTextBox.format = TextBox.FormatTypes.DECIMAL; relativePropertiesGUI.Add(relRotZTextBox); runningY += 3.5f; considerParentVelocityToggleButton = this.AddToggleButton(); considerParentVelocityToggleButton.SetPositionTL(28, runningY); considerParentVelocityToggleButton.sclX = 9.4f; considerParentVelocityToggleButton.sclY = 1.3f; considerParentVelocityToggleButton.SetText("Consider Parent Velocity OFF", "Consider Parent Velocity ON"); considerParentVelocityToggleButton.onClick += new FrbGuiMessage(PropertyWindowMessages.ConsiderParentVelocityToggleButtonClick); relativePropertiesGUI.Add(considerParentVelocityToggleButton); relativePropertiesGUI.visible = false; propertiesEditingListBox.AddWindowArray("Relative Prop.", relativePropertiesGUI); #endregion #region sprite color operation window WindowArray colorOpWA = new WindowArray(); TextDisplay tempTextDisplay; tempTextDisplay = AddTextDisplay(); tempTextDisplay.text = "Color Op Type:"; tempTextDisplay.SetPositionTL(15, 4f); colorOpWA.Add(tempTextDisplay); #region color op types noColorOp = AddToggleButton(); noColorOp.sclX = 4f; noColorOp.sclY = 1f; noColorOp.SetPositionTL(19, 7f); noColorOp.text = "None"; noColorOp.Press(); noColorOp.SetOneAlwaysDown(true); noColorOp.onClick += new FrbGuiMessage(PropertyWindowMessages.noColorOpClick); colorOpWA.Add(noColorOp); addColorOp = AddToggleButton(); addColorOp.sclX = 4f; addColorOp.sclY = 1f; addColorOp.SetPositionTL(19, 9f); addColorOp.text = "Add"; addColorOp.onClick += new FrbGuiMessage(PropertyWindowMessages.addColorOpClick); noColorOp.AddToRadioGroup(addColorOp); colorOpWA.Add(addColorOp); addSignedColorOp = AddToggleButton(); addSignedColorOp.sclX = 4f; addSignedColorOp.sclY = 1f; addSignedColorOp.SetPositionTL(19, 11f); addSignedColorOp.text = "AddSigned"; addSignedColorOp.onClick += new FrbGuiMessage(PropertyWindowMessages.addSignedColorOpClick); noColorOp.AddToRadioGroup(addSignedColorOp); colorOpWA.Add(addSignedColorOp); modulateColorOp = AddToggleButton(); modulateColorOp.sclX = 4f; modulateColorOp.sclY = 1f; modulateColorOp.SetPositionTL(19, 13f); modulateColorOp.text = "Modulate"; modulateColorOp.onClick += new FrbGuiMessage(PropertyWindowMessages.modulateColorOpClick); noColorOp.AddToRadioGroup(modulateColorOp); colorOpWA.Add(modulateColorOp); subtractColorOp = AddToggleButton(); subtractColorOp.sclX = 4f; subtractColorOp.sclY = 1f; subtractColorOp.SetPositionTL(19, 15f); subtractColorOp.text = "Subtract"; subtractColorOp.onClick += new FrbGuiMessage(PropertyWindowMessages.subtractColorOpClick); noColorOp.AddToRadioGroup(subtractColorOp); colorOpWA.Add(subtractColorOp); #endregion #region RED updown tempTextDisplay = AddTextDisplay(); tempTextDisplay.text = "R:"; tempTextDisplay.SetPositionTL(25, 7f); colorOpWA.Add(tempTextDisplay); tintRed = AddUpDown(); tintRed.SetPositionTL(29.5f, 7); tintRed.maxValue = 255; tintRed.minValue = 0; tintRed.sclX = 3; tintRed.onGUIChange += new FrbGuiMessage(PropertyWindowMessages.tintRedChange); colorOpWA.Add(tintRed); tintRedRate = AddUpDown(); tintRedRate.SetPositionTL(36, 7); tintRedRate.sclX = 3; tintRedRate.onGUIChange += new FrbGuiMessage(PropertyWindowMessages.tintRedRateChange); colorOpWA.Add(tintRedRate); #endregion #region GREEN updown tempTextDisplay = AddTextDisplay(); tempTextDisplay.text = "G:"; tempTextDisplay.SetPositionTL(25, 10f); colorOpWA.Add(tempTextDisplay); tintGreen = AddUpDown(); tintGreen.SetPositionTL(29.5f, 10); tintGreen.maxValue = 255; tintGreen.minValue = 0; tintGreen.sclX = 3; tintGreen.onGUIChange += new FrbGuiMessage(PropertyWindowMessages.tintGreenChange); colorOpWA.Add(tintGreen); tintGreenRate = AddUpDown(); tintGreenRate.SetPositionTL(36, 10); tintGreenRate.sclX = 3; tintGreenRate.onGUIChange += new FrbGuiMessage(PropertyWindowMessages.tintGreenRateChange); colorOpWA.Add(tintGreenRate); #endregion #region BLUE updown tempTextDisplay = AddTextDisplay(); tempTextDisplay.text = "B:"; tempTextDisplay.SetPositionTL(25, 13f); colorOpWA.Add(tempTextDisplay); tintBlue = AddUpDown(); tintBlue.SetPositionTL(29.5f, 13); tintBlue.maxValue = 255; tintBlue.minValue = 0; tintBlue.sclX = 3; tintBlue.onGUIChange += new FrbGuiMessage(PropertyWindowMessages.tintBlueChange); colorOpWA.Add(tintBlue); tintBlueRate = AddUpDown(); tintBlueRate.SetPositionTL(36, 13); tintBlueRate.sclX = 3; tintBlueRate.onGUIChange += new FrbGuiMessage(PropertyWindowMessages.tintBlueRateChange); colorOpWA.Add(tintBlueRate); #endregion #region transparency tempTextDisplay = AddTextDisplay(); tempTextDisplay.text = "Blend Op Type:"; tempTextDisplay.SetPositionTL(15, 19); colorOpWA.Add(tempTextDisplay); fadeDisplay = AddTextDisplay(); fadeDisplay.SetPositionTL(23f, 21); fadeDisplay.text = "Fade:"; colorOpWA.Add(fadeDisplay); fadeUpDown = AddUpDown(); fadeUpDown.SetPositionTL(29.5f, 21); fadeUpDown.sclX = 3; fadeUpDown.minValue = 0; fadeUpDown.maxValue = 255; fadeUpDown.onGUIChange += new FrbGuiMessage(PropertyWindowMessages.fadeTextBoxLoseFocus); colorOpWA.Add(fadeUpDown); fadeRateUpDown = AddUpDown(); fadeRateUpDown.sclX = 3f; fadeRateUpDown.SetPositionTL(36, 21); fadeRateUpDown.onGUIChange += new FrbGuiMessage(PropertyWindowMessages.fadeRateTextBoxLoseFocus); colorOpWA.Add(fadeRateUpDown); regularBlend = AddToggleButton(); regularBlend.sclY = 1f; regularBlend.sclX = 3.5f; regularBlend.text = "Regular"; regularBlend.SetPositionTL(19, 21); regularBlend.SetOneAlwaysDown(true); regularBlend.onClick += new FrbGuiMessage(PropertyWindowMessages.regularBlendClick); colorOpWA.Add(regularBlend); additiveBlend = AddToggleButton(); additiveBlend.sclY = 1f; additiveBlend.sclX = 3.5f; additiveBlend.text = "Additive"; additiveBlend.SetPositionTL(19, 23); additiveBlend.onClick += new FrbGuiMessage(PropertyWindowMessages.additiveBlendClick); regularBlend.AddToRadioGroup(additiveBlend); colorOpWA.Add(additiveBlend); modulateBlend = AddToggleButton(); modulateBlend.sclX = 3.5f; modulateBlend.sclY = 1f; modulateBlend.text = "Modulate"; modulateBlend.SetPositionTL(19, 25); modulateBlend.onClick += new FrbGuiMessage(PropertyWindowMessages.modulateBlendClick); regularBlend.AddToRadioGroup(modulateBlend); colorOpWA.Add(modulateBlend); modulate2XBlend = AddToggleButton(); modulate2XBlend.sclX = 3.5f; modulate2XBlend.sclY = 1f; modulate2XBlend.text = "Modulate2X"; modulate2XBlend.SetPositionTL(19, 27); modulate2XBlend.onClick += new FrbGuiMessage(PropertyWindowMessages.modulate2XBlendClick); regularBlend.AddToRadioGroup(modulate2XBlend); colorOpWA.Add(modulate2XBlend); #endregion propertiesEditingListBox.AddWindowArray("Tint and fade", colorOpWA); colorOpWA.visible = false; #endregion #region initialVelocityGUI initialVelocityGUI = new WindowArray(); spreadStyle = AddTextDisplay(); spreadStyle.text = "Spread Style:"; spreadStyle.SetPositionTL(sclX-5, 4); initialVelocityGUI.Add(spreadStyle); spreadStyleComboBox = AddComboBox(); spreadStyleComboBox.AddItem("square"); spreadStyleComboBox.AddItem("circle"); spreadStyleComboBox.sclX = 8; spreadStyleComboBox.SetPositionTL(sclX+3.5f, 8f); spreadStyleComboBox.onItemClick += new FrbGuiMessage(PropertyWindowMessages.updateSpreadGUI); spreadStyleComboBox.onItemClick += new FrbGuiMessage(PropertyWindowMessages.spreadStyleComboBoxItemClick); initialVelocityGUI.Add(spreadStyleComboBox); initialVelocityGUI.visible = false; propertiesEditingListBox.AddWindowArray("Velocity", initialVelocityGUI); #region squareSpreadGUI squareSpreadGUI = new WindowArray(); #region xVelocity xVelocityText = AddTextDisplay(); xVelocityText.text = "X Vel.:"; xVelocityText.SetPositionTL(sclX-5, 13); squareSpreadGUI.Add(xVelocityText); xVelocityType = AddComboBox(); xVelocityType.SetPositionTL(sclX+3, 13); xVelocityType.sclX = 3.5f; xVelocityType.AddItem("Fixed"); xVelocityType.AddItem("Range"); xVelocityType.text = "Fixed"; xVelocityType.onItemClick += new FrbGuiMessage(PropertyWindowMessages.updateVelocityRangeGUI); xVelocityType.onItemClick += new FrbGuiMessage(PropertyWindowMessages.xVelocityTypeLoseFocus); squareSpreadGUI.Add(xVelocityType); xMinValue = AddTextBox(); xMinValue.sclX = 2; xMinValue.SetPositionTL(sclX+9, 13); xMinValue.format = TextBox.FormatTypes.DECIMAL; xMinValue.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.xMinValueLoseFocus); squareSpreadGUI.Add(xMinValue); xRangeGUI = new WindowArray(); xTo = AddTextDisplay(); xTo.text = "to"; xTo.SetPositionTL(sclX+11.5f, 13); xRangeGUI.Add(xTo); xMaxValue = AddTextBox(); xMaxValue.sclX = 2; xMaxValue.SetPositionTL(sclX+15.5f, 13); xMaxValue.format = TextBox.FormatTypes.DECIMAL; xMaxValue.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.xMaxValueLoseFocus); xRangeGUI.Add(xMaxValue); xRangeGUI.visible = false; #endregion #region yVelocity yVelocityType = AddComboBox(); yVelocityType.SetPositionTL(sclX+3, 16); yVelocityType.sclX = 3.5f; yVelocityType.AddItem("Fixed"); yVelocityType.AddItem("Range"); yVelocityType.text = "Fixed"; yVelocityType.onItemClick += new FrbGuiMessage(PropertyWindowMessages.updateVelocityRangeGUI); yVelocityType.onItemClick += new FrbGuiMessage(PropertyWindowMessages.yVelocityTypeLoseFocus); squareSpreadGUI.Add(yVelocityType); yMinValue = AddTextBox(); yMinValue.sclX = 2; yMinValue.SetPositionTL(sclX+9, 16); yMinValue.format = TextBox.FormatTypes.DECIMAL; yMinValue.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.yMinValueLoseFocus); squareSpreadGUI.Add(yMinValue); yRangeGUI = new WindowArray(); yTo = AddTextDisplay(); yTo.text = "to"; yTo.SetPositionTL(sclX+11.5f, 16); yRangeGUI.Add(yTo); yMaxValue = AddTextBox(); yMaxValue.sclX = 2; yMaxValue.SetPositionTL(sclX+15.5f, 16); yMaxValue.format = TextBox.FormatTypes.DECIMAL; yMaxValue.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.yMaxValueLoseFocus); yRangeGUI.Add(yMaxValue); yRangeGUI.visible = false; yVelocityText = AddTextDisplay(); yVelocityText.text = "Y Vel.:"; yVelocityText.SetPositionTL(sclX-5, 16); squareSpreadGUI.Add(yVelocityText); #endregion #region zVelocity zVelocityType = AddComboBox(); zVelocityType.SetPositionTL(sclX+3, 19); zVelocityType.sclX = 3.5f; zVelocityType.AddItem("Fixed"); zVelocityType.AddItem("Range"); zVelocityType.text = "Fixed"; zVelocityType.onItemClick += new FrbGuiMessage(PropertyWindowMessages.updateVelocityRangeGUI); zVelocityType.onItemClick += new FrbGuiMessage(PropertyWindowMessages.zVelocityTypeLoseFocus); squareSpreadGUI.Add(zVelocityType); zMinValue = AddTextBox(); zMinValue.sclX = 2; zMinValue.SetPositionTL(sclX+9, 19); zMinValue.format = TextBox.FormatTypes.DECIMAL; zMinValue.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.zMinValueLoseFocus); squareSpreadGUI.Add(zMinValue); zRangeGUI = new WindowArray(); zTo = AddTextDisplay(); zTo.text = "to"; zTo.SetPositionTL(sclX+11.5f, 19); zRangeGUI.Add(zTo); zMaxValue = AddTextBox(); zMaxValue.sclX = 2; zMaxValue.SetPositionTL(sclX+15.5f, 19); zMaxValue.format = TextBox.FormatTypes.DECIMAL; zMaxValue.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.zMaxValueLoseFocus); zRangeGUI.Add(zMaxValue); zVelocityText = AddTextDisplay(); zVelocityText.text = "Z Vel.:"; zVelocityText.SetPositionTL(sclX-5, 19); squareSpreadGUI.Add(zVelocityText); zRangeGUI.visible = false; #endregion squareSpreadGUI.visible = false; #endregion #region circleSpreadGUI circularSpreadGUI = new WindowArray(); outwardVelocity = AddTextDisplay(); outwardVelocity.text = "Outward Velocity:"; outwardVelocity.SetPositionTL(sclX-5, 13); circularSpreadGUI.Add(outwardVelocity); outwardVelocityRangeOrFixed = AddComboBox(); outwardVelocityRangeOrFixed.sclX = 4; outwardVelocityRangeOrFixed.AddItem("Fixed"); outwardVelocityRangeOrFixed.AddItem("Range"); outwardVelocityRangeOrFixed.SetPositionTL(sclX+9.5f, 13); outwardVelocityRangeOrFixed.onItemClick += new FrbGuiMessage(PropertyWindowMessages.updateCircularVelocityRangeGUI); outwardVelocityRangeOrFixed.onItemClick += new FrbGuiMessage(PropertyWindowMessages.outwardVelocityRangeOrFixedItemClicked); circularSpreadGUI.Add(outwardVelocityRangeOrFixed); outwardVelocityTextBox = AddTextBox(); outwardVelocityTextBox.SetPositionTL(sclX, 16); outwardVelocityTextBox.sclX = 2; outwardVelocityTextBox.format = TextBox.FormatTypes.DECIMAL; outwardVelocityTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.outwardVelocityTextBoxLoseFocus); circularSpreadGUI.Add(outwardVelocityTextBox); outwardVelocityRangeGUI = new WindowArray(); outwardVelocityTo = AddTextDisplay(); outwardVelocityTo.text = "to"; outwardVelocityTo.SetPositionTL(sclX+2.5f, 16); outwardVelocityRangeGUI.Add(outwardVelocityTo); outwardVelocityTextBoxMax = AddTextBox(); outwardVelocityTextBoxMax.sclX = 2; outwardVelocityTextBoxMax.format = TextBox.FormatTypes.DECIMAL; outwardVelocityTextBoxMax.SetPositionTL(sclX+6.5f, 16); outwardVelocityTextBoxMax.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.outwardVelocityTextBoxMaxLoseFocus); outwardVelocityRangeGUI.Add(outwardVelocityTextBoxMax); outwardVelocityRangeGUI.visible = false; wedgeOrFull = AddComboBox(); wedgeOrFull.sclX = 5; wedgeOrFull.AddItem("circle"); wedgeOrFull.AddItem("wedge"); wedgeOrFull.AddItem("sphere"); wedgeOrFull.text = "circle"; wedgeOrFull.SetPositionTL(sclX, 19); wedgeOrFull.onItemClick += new FrbGuiMessage(PropertyWindowMessages.updateWedgeOrFullGUI); wedgeOrFull.onItemClick += new FrbGuiMessage(PropertyWindowMessages.wedgeOrFullItemClick); circularSpreadGUI.Add(wedgeOrFull); circularSpreadGUI.visible = false; wedgeGUI = new WindowArray(); directionAngle = AddTextDisplay(); directionAngle.text = "Angle of Direction:"; directionAngle.SetPositionTL(sclX-5, 22); wedgeGUI.Add(directionAngle); directionAngleTextBox = AddTextBox(); directionAngleTextBox.SetPositionTL( sclX+9, 22); directionAngleTextBox.sclX = 2; directionAngleTextBox.format = TextBox.FormatTypes.DECIMAL; directionAngleTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.directionAngleTextBoxLoseFocus); wedgeGUI.Add(directionAngleTextBox); spreadAngle = AddTextDisplay(); spreadAngle.text = "Angle of Spread:"; spreadAngle.SetPositionTL(sclX-5, 25); wedgeGUI.Add(spreadAngle); spreadAngleTextBox = AddTextBox(); spreadAngleTextBox.SetPositionTL( sclX+9, 25); spreadAngleTextBox.sclX = 2; spreadAngleTextBox.format = TextBox.FormatTypes.DECIMAL; spreadAngleTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.spreadAngleTextBoxLoseFocus); wedgeGUI.Add(spreadAngleTextBox); wedgeGUI.visible = false; #endregion #endregion #region initialAccelerationGUI initialAccelerationGUI = new WindowArray(); xAccelerationRangeGUI = new WindowArray(); yAccelerationRangeGUI = new WindowArray(); zAccelerationRangeGUI = new WindowArray(); xAccelerationText = AddTextDisplay(); xAccelerationText.text = "X Acc.:"; xAccelerationText.SetPositionTL(sclX-5, 5); initialAccelerationGUI.Add(xAccelerationText); xAccelerationType = AddComboBox(); xAccelerationType.SetPositionTL(sclX+3, 5); xAccelerationType.sclX = 3.5f; xAccelerationType.AddItem("Fixed"); xAccelerationType.AddItem("Range"); xAccelerationType.text = "Fixed"; xAccelerationType.onItemClick += new FrbGuiMessage(PropertyWindowMessages.updateAccelerationRangeGUI); xAccelerationType.onItemClick += new FrbGuiMessage(PropertyWindowMessages.xAccelerationTypeSelectItem); initialAccelerationGUI.Add(xAccelerationType); xMinAccelerationValue = AddTextBox(); xMinAccelerationValue.sclX = 2; xMinAccelerationValue.SetPositionTL(sclX+9, 5); xMinAccelerationValue.format = TextBox.FormatTypes.DECIMAL; xMinAccelerationValue.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.xMinAccelerationValueLoseFocus); initialAccelerationGUI.Add(xMinAccelerationValue); xAccelerationTo = AddTextDisplay(); xAccelerationTo.text = "to"; xAccelerationTo.SetPositionTL(sclX+11.5f, 5); xAccelerationRangeGUI.Add(xAccelerationTo); xMaxAccelerationValue = AddTextBox(); xMaxAccelerationValue.sclX = 2; xMaxAccelerationValue.SetPositionTL(sclX+15.5f, 5); xMaxAccelerationValue.format = TextBox.FormatTypes.DECIMAL; xMaxAccelerationValue.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.xMaxAccelerationValueLoseFocus); xAccelerationRangeGUI.Add(xMaxAccelerationValue); xAccelerationRangeGUI.visible = false; yAccelerationType = AddComboBox(); yAccelerationType.SetPositionTL(sclX+3, 8); yAccelerationType.sclX = 3.5f; yAccelerationType.AddItem("Fixed"); yAccelerationType.AddItem("Range"); yAccelerationType.text = "Fixed"; yAccelerationType.onItemClick += new FrbGuiMessage(PropertyWindowMessages.updateAccelerationRangeGUI); yAccelerationType.onItemClick += new FrbGuiMessage(PropertyWindowMessages.yAccelerationTypeSelectItem); initialAccelerationGUI.Add(yAccelerationType); yMinAccelerationValue = AddTextBox(); yMinAccelerationValue.sclX = 2; yMinAccelerationValue.SetPositionTL(sclX+9, 8); yMinAccelerationValue.format = TextBox.FormatTypes.DECIMAL; yMinAccelerationValue.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.yMinAccelerationValueLoseFocus); initialAccelerationGUI.Add(yMinAccelerationValue); yAccelerationTo = AddTextDisplay(); yAccelerationTo.text = "to"; yAccelerationTo.SetPositionTL(sclX+11.5f, 8); yAccelerationRangeGUI.Add(yAccelerationTo); yMaxAccelerationValue = AddTextBox(); yMaxAccelerationValue.sclX = 2; yMaxAccelerationValue.SetPositionTL(sclX+15.5f, 8); yMaxAccelerationValue.format = TextBox.FormatTypes.DECIMAL; yMaxAccelerationValue.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.yMaxAccelerationValueLoseFocus); yAccelerationRangeGUI.Add(yMaxAccelerationValue); yAccelerationRangeGUI.visible = false; yAccelerationText = AddTextDisplay(); yAccelerationText.text = "Y Acc.:"; yAccelerationText.SetPositionTL(sclX-5, 8); initialAccelerationGUI.Add(yAccelerationText); zAccelerationType = AddComboBox(); zAccelerationType.SetPositionTL(sclX+3, 11); zAccelerationType.sclX = 3.5f; zAccelerationType.AddItem("Fixed"); zAccelerationType.AddItem("Range"); zAccelerationType.text = "Fixed"; zAccelerationType.onItemClick += new FrbGuiMessage(PropertyWindowMessages.updateAccelerationRangeGUI); zAccelerationType.onItemClick += new FrbGuiMessage(PropertyWindowMessages.zAccelerationTypeSelectItem); initialAccelerationGUI.Add(zAccelerationType); zMinAccelerationValue = AddTextBox(); zMinAccelerationValue.sclX = 2; zMinAccelerationValue.SetPositionTL(sclX+9, 11); zMinAccelerationValue.format = TextBox.FormatTypes.DECIMAL; zMinAccelerationValue.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.zMinAccelerationValueLoseFocus); initialAccelerationGUI.Add(zMinAccelerationValue); zAccelerationTo = AddTextDisplay(); zAccelerationTo.text = "to"; zAccelerationTo.SetPositionTL(sclX+11.5f, 11); zAccelerationRangeGUI.Add(zAccelerationTo); zMaxAccelerationValue = AddTextBox(); zMaxAccelerationValue.sclX = 2; zMaxAccelerationValue.SetPositionTL(sclX+15.5f, 11); zMaxAccelerationValue.format = TextBox.FormatTypes.DECIMAL; zMaxAccelerationValue.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.zMaxAccelerationValueLoseFocus); zAccelerationRangeGUI.Add(zMaxAccelerationValue); zAccelerationText = AddTextDisplay(); zAccelerationText.text = "Z Acc.:"; zAccelerationText.SetPositionTL(sclX-5, 11); initialAccelerationGUI.Add(zAccelerationText); zAccelerationRangeGUI.visible = false; initialAccelerationGUI.visible = false; propertiesEditingListBox.AddWindowArray("Acceleration", initialAccelerationGUI); #endregion #region emissionTimingGUI emissionTimingGUI = new WindowArray(); emissionEvent = AddTextDisplay(); emissionEvent.text = "Emission Event:"; emissionEvent.SetPositionTL(sclX-5, 6); emissionTimingGUI.Add(emissionEvent); emissionEventComboBox = AddComboBox(); emissionEventComboBox.sclX = 5; emissionEventComboBox.SetPositionTL(sclX+10, 6); emissionEventComboBox.AddItem("Call only"); emissionEventComboBox.AddItem("Timed"); emissionEventComboBox.text = "Call only"; emissionEventComboBox.onItemClick += new FrbGuiMessage(PropertyWindowMessages.updateTimingGUI); emissionEventComboBox.onItemClick += new FrbGuiMessage(PropertyWindowMessages.emissionEventComboBoxItemSelect); emissionTimingGUI.Add(emissionEventComboBox); timingGUI = new WindowArray(); onceEvery = AddTextDisplay(); onceEvery.SetPositionTL(sclX-5, 10); onceEvery.text = "Once every:"; timingGUI.Add(onceEvery); secondFrequencyTextBox = AddTextBox(); secondFrequencyTextBox.SetPositionTL(sclX+6, 10); secondFrequencyTextBox.sclX = 3.5f; secondFrequencyTextBox.format = TextBox.FormatTypes.DECIMAL; secondFrequencyTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.secondFrequencyTextBoxLoseFocus); timingGUI.Add(secondFrequencyTextBox); millisecondsDisplay = AddTextDisplay(); millisecondsDisplay.text = "ms."; millisecondsDisplay.SetPositionTL(sclX+10, 10); timingGUI.Add(millisecondsDisplay); numberPerEmissionDisplay = AddTextDisplay(); numberPerEmissionDisplay.text = "Number of particles per emission:"; numberPerEmissionDisplay.SetPositionTL(sclX-5, 13); emissionTimingGUI.Add(numberPerEmissionDisplay); numberPerEmissionTextBox = AddTextBox(); numberPerEmissionTextBox.sclX = 1.7f; numberPerEmissionTextBox.SetPositionTL(sclX+17, 13); numberPerEmissionTextBox.format = TextBox.FormatTypes.DECIMAL; numberPerEmissionTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.numberPerEmissionTextBoxLoseFocus); emissionTimingGUI.Add(numberPerEmissionTextBox); emissionTimingGUI.visible = false; timingGUI.visible = false; propertiesEditingListBox.AddWindowArray("Emission Timing", emissionTimingGUI); #endregion #region instruction GUI instructionGUI = new WindowArray(); instructionListBox = this.AddListBox(); instructionListBox.SetPositionTL(27f, 11); instructionListBox.sclX = 12f; instructionListBox.sclY = 10; instructionListBox.onHighlight += new FrbGuiMessage(PropertyWindowMessages.ListBoxSelectInstruction); instructionGUI.Add(instructionListBox); runningY = 22; addInstructionButton = this.AddButton(); addInstructionButton.text = "Add Instruction"; addInstructionButton.sclX = 6f; addInstructionButton.SetPositionTL(21f, runningY); addInstructionButton.onClick += new FrbGuiMessage(PropertyWindowMessages.AddInstructionButtonClick); instructionGUI.Add(addInstructionButton); deleteInstructionButton = this.AddButton(); deleteInstructionButton.text = "Delete Instruction"; deleteInstructionButton.sclX = 6f; deleteInstructionButton.SetPositionTL(33, runningY); instructionGUI.Add(deleteInstructionButton); runningY += 3; typeTextDisplay = this.AddTextDisplay(); typeTextDisplay.SetPositionTL(15, runningY); typeTextDisplay.text = "Type:"; instructionGUI.Add(typeTextDisplay); typeComboBox = this.AddComboBox(); typeComboBox.SetPositionTL(28, runningY); typeComboBox.sclX = 9.5f; typeComboBox.text = "<Select Instruction Type>"; typeComboBox.onItemClick += new FrbGuiMessage(PropertyWindowMessages.ChangeInstructionType); #region add the types in the combo box typeComboBox.AddItem("<Select Instruction Type>"); typeComboBox.AddItem("Emit"); typeComboBox.AddItem("Fade"); typeComboBox.AddItem("FadeRate"); typeComboBox.AddItem("X"); typeComboBox.AddItem("XVelocity"); typeComboBox.AddItem("XAcceleration"); typeComboBox.AddItem("Y"); typeComboBox.AddItem("YVelocity"); typeComboBox.AddItem("YAcceleration"); typeComboBox.AddItem("Z"); typeComboBox.AddItem("ZVelocity"); typeComboBox.AddItem("ZAcceleration"); #endregion instructionGUI.Add(typeComboBox); runningY += 2.5f; value1TextDisplay = this.AddTextDisplay(); value1TextDisplay.visible = false; value1TextDisplay.SetPositionTL(15, runningY); instructionGUI.Add(value1TextDisplay); value1Window = null; runningY += 2.5f; value2TextDisplay = this.AddTextDisplay(); value2TextDisplay.visible = false; value2TextDisplay.SetPositionTL(15, runningY); instructionGUI.Add(value2TextDisplay); value2Window = null; runningY += 2.5f; value3TextDisplay = this.AddTextDisplay(); value3TextDisplay.visible = false; value3TextDisplay.SetPositionTL(15, runningY); instructionGUI.Add(value3TextDisplay); value3Window = null; runningY += 2.5f; instructionTimeTextDisplay = this.AddTextDisplay(); instructionTimeTextDisplay.text = "Delay (ms):"; instructionTimeTextDisplay.SetPositionTL(15, runningY); instructionGUI.Add(instructionTimeTextDisplay); instructionTimeTextBox = this.AddTextBox(); instructionTimeTextBox.format = TextBox.FormatTypes.INTEGER; instructionTimeTextBox.sclX = 5; instructionTimeTextBox.SetPositionTL(30, runningY); instructionTimeTextBox.onLosingFocus += new FrbGuiMessage(PropertyWindowMessages.SetTimeToExecute); instructionGUI.Add(instructionTimeTextBox); runningY += 2.5f; cycleTimeTextDisplay = this.AddTextDisplay(); cycleTimeTextDisplay.text = "Cycle Time (ms):"; cycleTimeTextDisplay.SetPositionTL(15, runningY); instructionGUI.Add(cycleTimeTextDisplay); cycleTimeTextBox = this.AddTextBox(); cycleTimeTextBox.format = TextBox.FormatTypes.INTEGER; cycleTimeTextBox.sclX = 5; cycleTimeTextBox.SetPositionTL(30, runningY); instructionGUI.Add(cycleTimeTextBox); instructionGUI.visible = false; propertiesEditingListBox.AddWindowArray("Instructions", instructionGUI); #endregion }