Example #1
0
        private void Update()
        {
            if (Input.GetMouseButtonDown(0))
            {
                touchStartPiece = GetHoveredPiece();

                if (touchStartPiece == null)
                {
                    ClickedEmpty?.Invoke();
                }
            }
            else if (touchStartPiece != null)
            {
                Piece hovered = GetHoveredPiece();

                //If is on the same piece
                if (hovered == touchStartPiece)
                {
                    if (!Input.GetMouseButton(0))
                    {
                        //clicked
                        ClickedOnPiece?.Invoke(touchStartPiece);
                        touchStartPiece = null;
                    }
                }
                //If Dragged to another piece
                else if (hovered != null)
                {
                    Dragged?.Invoke(touchStartPiece, hovered);
                    touchStartPiece = null;
                }
            }
        }
Example #2
0
        protected void OnAction(InputAction.CallbackContext context)
        {
            var control = context.control;
            var device  = control.device;

            var isMouseInput = device is Mouse;
            var isPenInput   = !isMouseInput && device is Pen;

            // Read our current pointer values.
            var drag = context.ReadValue <PointerInput>();

            if (isMouseInput)
            {
                drag.InputId = PointerInputModule.kMouseLeftId;
            }
            else if (isPenInput)
            {
                drag.InputId = int.MinValue;
            }

            if (drag.Contact && !m_Dragging)
            {
                Pressed?.Invoke(drag, context.time);
                m_Dragging = true;
            }
            else if (drag.Contact && m_Dragging)
            {
                Dragged?.Invoke(drag, context.time);
            }
            else
            {
                Released?.Invoke(drag, context.time);
                m_Dragging = false;
            }
        }
Example #3
0
        /// <summary>
        /// Handler invoked on mouse moved event.
        /// </summary>
        /// <param name="x">X coordinate.</param>
        /// <param name="y">Y coordinate.</param>
        /// <param name="dx">X change.</param>
        /// <param name="dy">Y change.</param>
        protected override void OnMouseMoved(int x, int y, int dx, int dy)
        {
            if (null == m_Target)
            {
                return;
            }
            if (!m_Held)
            {
                return;
            }

            Point p = new Point(x - m_HoldPos.X, y - m_HoldPos.Y);

            // Translate to parent
            if (m_Target.Parent != null)
            {
                p = m_Target.Parent.CanvasPosToLocal(p);
            }

            //m_Target->SetPosition( p.x, p.y );
            m_Target.MoveTo(p.X, p.Y);
            if (Dragged != null)
            {
                Dragged.Invoke(this, EventArgs.Empty);
            }
        }
Example #4
0
 public override void dragged(IntVector2 position)
 {
     if (Dragged != null)
     {
         Dragged.Invoke(this, position);
     }
 }
Example #5
0
        private void OnCanvasMouseUp(object sender, MouseButtonEventArgs e)
        {
            _dragged = null;
            var mp = e.GetPosition(TheCanvas);
            var x  = mp.X;

            if (Math.Abs(_mouseDownX - x) < 10)
            {
                if (e.ChangedButton == MouseButton.Right)
                {
                    _manager.AddPoint(_space, (int)(x * 100 + Rnd()), (float)x);
                    DrawTree();
                }
            }
            if (_chosenEllipses.Count > 0)
            {
                _chosenEllipses.ForEach(el => el.Fill = Brushes.Moccasin);
            }

            Rectangle rect;

            if (TryFindSpacePointRectangle(mp, out rect))
            {
                OnSpacePointMouseUp(rect, rect.Tag as SpacePoint <int>, e);
            }
        }
Example #6
0
 void IEndDragHandler.OnEndDrag(PointerEventData _)
 {
     if (dragged)
     {
         Dragged?.Invoke();
         dragged = false;
     }
 }
Example #7
0
        /// <summary>
        /// Handler invoked on mouse moved event.
        /// </summary>
        /// <param name="x">X coordinate.</param>
        /// <param name="y">Y coordinate.</param>
        /// <param name="dx">X change.</param>
        /// <param name="dy">Y change.</param>
        protected override void onMouseMoved(int x, int y, int dx, int dy)
        {
            if (null == target) return;
            if (!held) return;

            Point p = new Point(x - holdPos.X, y - holdPos.Y);

            // Translate to parent
            if (target.Parent != null)
                p = target.Parent.CanvasPosToLocal(p);

            //m_Target->SetPosition( p.x, p.y );
            target.MoveTo(p.X, p.Y);
            if (Dragged != null)
                Dragged.Invoke(this, EventArgs.Empty);
        }
Example #8
0
 private void OnSpacePointMouseDown(Rectangle rect, SpacePoint <int> point, MouseButtonEventArgs e)
 {
     if (e.ChangedButton == MouseButton.Middle)
     {
         _manager.RemovePoint(point);
         DrawTree();
     }
     else if (e.ChangedButton == MouseButton.Left)
     {
         _dragged = new Dragged {
             Point = point, Rect = rect
         };
         return;
     }
     _dragged = null;
 }
Example #9
0
        private void OnDragged(PointerInput input, double time)
        {
            if (!activeGestures.TryGetValue(input.InputId, out var existingGesture))
            {
                // Probably caught by UI, or the input was otherwise lost
                return;
            }

            existingGesture.SubmitPoint(input.Position, time);

            if (IsValidSwipe(ref existingGesture))
            {
                PotentiallySwiped?.Invoke(new SwipeInput(existingGesture));
            }

            Dragged?.Invoke(new DragInput(existingGesture));

            DebugInfo(existingGesture);
        }
Example #10
0
        public void Update()
        {
            MouseState    mouse    = Mouse.GetState();
            KeyboardState keyboard = Keyboard.GetState();

            var underMouse = GetVoxelUnderMouse();
            // Keep track of whether a new voxel has been selected.
            bool newVoxel = underMouse.IsValid && underMouse != VoxelUnderMouse;

            if (!underMouse.IsValid)
            {
                return;
            }

            VoxelUnderMouse = underMouse;

            // Update the cursor light.
            World.CursorLightPos = underMouse.WorldPosition + new Vector3(0.5f, 0.5f, 0.5f);

            // Get the type of the voxel and display it to the player.
            if (Enabled && !underMouse.IsEmpty && underMouse.IsExplored)
            {
                string info = underMouse.Type.Name;

                // If it belongs to a room, display that information.
                if (World.PlayerFaction.RoomBuilder.IsInRoom(underMouse))
                {
                    Room room = World.PlayerFaction.RoomBuilder.GetMostLikelyRoom(underMouse);

                    if (room != null)
                    {
                        info += " (" + room.ID + ")";
                    }
                }
                World.ShowInfo(info);
            }

            // Do nothing if not enabled.
            if (!Enabled)
            {
                return;
            }

            bool altPressed = false;

            // If the left or right ALT keys are pressed, we can adjust the height of the selection
            // for building pits and tall walls using the mouse wheel.
            if (keyboard.IsKeyDown(Keys.LeftAlt) || keyboard.IsKeyDown(Keys.RightAlt))
            {
                var change = mouse.ScrollWheelValue - LastMouseWheel;
                BoxYOffset += (change) * 0.01f;
                int offset = (int)BoxYOffset;
                if (offset != PrevBoxYOffsetInt)
                {
                    DragSound.Play(World.CursorLightPos);
                    newVoxel = true;
                }
                PrevBoxYOffsetInt = offset;
                altPressed        = true;
            }
            else
            {
                PrevBoxYOffsetInt = 0;
            }
            LastMouseWheel = mouse.ScrollWheelValue;

            // Draw a box around the current voxel under the mouse.
            if (underMouse.IsValid)
            {
                BoundingBox box = underMouse.GetBoundingBox().Expand(0.05f);
                Drawer3D.DrawBox(box, CurrentColor, CurrentWidth, true);
            }

            // If the left mouse button is pressed, update the slection buffer.
            if (isLeftPressed)
            {
                // On release, select voxels.
                if (mouse.LeftButton == ButtonState.Released)
                {
                    ReleaseSound.Play(World.CursorLightPos);
                    isLeftPressed = false;
                    LeftReleasedCallback();
                    BoxYOffset        = 0;
                    PrevBoxYOffsetInt = 0;
                }
                // Otherwise, update the selection buffer
                else
                {
                    if (SelectionBuffer.Count == 0)
                    {
                        FirstVoxel = underMouse;
                        SelectionBuffer.Add(underMouse);
                    }
                    else
                    {
                        SelectionBuffer.Clear();
                        SelectionBuffer.Add(FirstVoxel);
                        SelectionBuffer.Add(underMouse);
                        BoundingBox buffer = GetSelectionBox();

                        // Update the selection box to account for offsets from mouse wheel.
                        if (BoxYOffset > 0)
                        {
                            buffer.Max.Y += (int)BoxYOffset;
                        }
                        else if (BoxYOffset < 0)
                        {
                            buffer.Min.Y += (int)BoxYOffset;
                        }

                        SelectionBuffer = Select(buffer, FirstVoxel.WorldPosition, underMouse.WorldPosition).ToList();

                        if (!altPressed && Brush != VoxelBrush.Stairs)
                        {
                            if (SelectionType == VoxelSelectionType.SelectFilled)
                            {
                                SelectionBuffer.RemoveAll(v =>
                                {
                                    if (v.Equals(underMouse))
                                    {
                                        return(false);
                                    }
                                    return(v.IsExplored && !VoxelHelpers.DoesVoxelHaveVisibleSurface(
                                               Chunks.ChunkData, v));
                                });
                            }
                        }

                        if (newVoxel)
                        {
                            DragSound.Play(World.CursorLightPos, SelectionBuffer.Count / 20.0f);
                            Dragged.Invoke(SelectionBuffer, InputManager.MouseButton.Left);
                        }
                    }
                }
            }
            // If the mouse was not previously pressed, but is now pressed, then notify us of that.
            else if (mouse.LeftButton == ButtonState.Pressed)
            {
                ClickSound.Play(World.CursorLightPos);;
                isLeftPressed     = true;
                BoxYOffset        = 0;
                PrevBoxYOffsetInt = 0;
            }

            // Case where the right mouse button is pressed (mirrors left mouse button)
            // TODO(Break this into a function)
            if (isRightPressed)
            {
                if (mouse.RightButton == ButtonState.Released)
                {
                    ReleaseSound.Play(World.CursorLightPos);
                    isRightPressed = false;
                    RightReleasedCallback();
                    BoxYOffset        = 0;
                    PrevBoxYOffsetInt = 0;
                }
                else
                {
                    if (SelectionBuffer.Count == 0)
                    {
                        SelectionBuffer.Add(underMouse);
                        FirstVoxel = underMouse;
                    }
                    else
                    {
                        SelectionBuffer.Clear();
                        SelectionBuffer.Add(FirstVoxel);
                        SelectionBuffer.Add(underMouse);
                        BoundingBox buffer = GetSelectionBox();
                        if (BoxYOffset > 0)
                        {
                            buffer.Max.Y += (int)BoxYOffset;
                        }
                        else if (BoxYOffset < 0)
                        {
                            buffer.Min.Y += (int)BoxYOffset;
                        }

                        SelectionBuffer = VoxelHelpers.EnumerateCoordinatesInBoundingBox(buffer)
                                          .Select(c => new VoxelHandle(Chunks.ChunkData, c))
                                          .Where(v => v.IsValid)
                                          .ToList();

                        if (newVoxel)
                        {
                            DragSound.Play(World.CursorLightPos, SelectionBuffer.Count / 20.0f);
                            Dragged.Invoke(SelectionBuffer, InputManager.MouseButton.Right);
                        }
                    }
                }
            }
            else if (mouse.RightButton == ButtonState.Pressed)
            {
                ClickSound.Play(World.CursorLightPos);
                RightPressedCallback();
                BoxYOffset     = 0;
                isRightPressed = true;
            }
        }
Example #11
0
        public EditorTerrainMaterialsUI()
        {
            Local  local  = Localization.read("/Editor/EditorTerrainMaterials.dat");
            Bundle bundle = Bundles.getBundle("/Bundles/Textures/Edit/Icons/EditorTerrainMaterials/EditorTerrainMaterials.unity3d");

            EditorTerrainMaterialsUI.container = new Sleek();
            EditorTerrainMaterialsUI.container.positionOffset_X = 10;
            EditorTerrainMaterialsUI.container.positionOffset_Y = 10;
            EditorTerrainMaterialsUI.container.positionScale_X  = 1f;
            EditorTerrainMaterialsUI.container.sizeOffset_X     = -20;
            EditorTerrainMaterialsUI.container.sizeOffset_Y     = -20;
            EditorTerrainMaterialsUI.container.sizeScale_X      = 1f;
            EditorTerrainMaterialsUI.container.sizeScale_Y      = 1f;
            EditorUI.window.add(EditorTerrainMaterialsUI.container);
            EditorTerrainMaterialsUI.active    = false;
            EditorTerrainMaterialsUI.wasOpened = false;
            if (LevelGround.materials == null)
            {
                return;
            }
            EditorTerrainMaterialsUI.materialScrollBox = new SleekScrollBox();
            EditorTerrainMaterialsUI.materialScrollBox.positionOffset_Y = 120;
            EditorTerrainMaterialsUI.materialScrollBox.positionOffset_X = -400;
            EditorTerrainMaterialsUI.materialScrollBox.positionScale_X  = 1f;
            EditorTerrainMaterialsUI.materialScrollBox.sizeOffset_X     = 400;
            EditorTerrainMaterialsUI.materialScrollBox.sizeOffset_Y     = -200;
            EditorTerrainMaterialsUI.materialScrollBox.sizeScale_Y      = 1f;
            EditorTerrainMaterialsUI.materialScrollBox.area             = new Rect(0f, 0f, 5f, (float)(LevelGround.materials.Length * 70 + 750));
            EditorTerrainMaterialsUI.container.add(EditorTerrainMaterialsUI.materialScrollBox);
            for (int i = 0; i < LevelGround.materials.Length; i++)
            {
                SleekImageTexture sleekImageTexture = new SleekImageTexture();
                sleekImageTexture.positionOffset_X = 200;
                sleekImageTexture.positionOffset_Y = i * 70;
                sleekImageTexture.sizeOffset_X     = 64;
                sleekImageTexture.sizeOffset_Y     = 64;
                sleekImageTexture.texture          = LevelGround.materials[i].prototype.texture;
                EditorTerrainMaterialsUI.materialScrollBox.add(sleekImageTexture);
                SleekButton sleekButton = new SleekButton();
                sleekButton.positionOffset_X = 70;
                sleekButton.sizeOffset_X     = 100;
                sleekButton.sizeOffset_Y     = 64;
                sleekButton.text             = i + " " + LevelGround.materials[i].prototype.texture.name;
                SleekButton sleekButton2 = sleekButton;
                if (EditorTerrainMaterialsUI.< > f__mg$cache0 == null)
                {
                    EditorTerrainMaterialsUI.< > f__mg$cache0 = new ClickedButton(EditorTerrainMaterialsUI.onClickedMaterialButton);
                }
                sleekButton2.onClickedButton = EditorTerrainMaterialsUI.< > f__mg$cache0;
                sleekImageTexture.add(sleekButton);
            }
            EditorTerrainMaterialsUI.overgrowthSlider = new SleekSlider();
            EditorTerrainMaterialsUI.overgrowthSlider.positionOffset_X = 200;
            EditorTerrainMaterialsUI.overgrowthSlider.positionOffset_Y = LevelGround.materials.Length * 70;
            EditorTerrainMaterialsUI.overgrowthSlider.sizeOffset_X     = 170;
            EditorTerrainMaterialsUI.overgrowthSlider.sizeOffset_Y     = 20;
            EditorTerrainMaterialsUI.overgrowthSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorTerrainMaterialsUI.overgrowthSlider.addLabel(local.format("OvergrowthSliderLabelText"), ESleekSide.LEFT);
            SleekSlider sleekSlider = EditorTerrainMaterialsUI.overgrowthSlider;

            if (EditorTerrainMaterialsUI.< > f__mg$cache1 == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cache1 = new Dragged(EditorTerrainMaterialsUI.onDraggedOvergrowthSlider);
            }
            sleekSlider.onDragged = EditorTerrainMaterialsUI.< > f__mg$cache1;
            EditorTerrainMaterialsUI.materialScrollBox.add(EditorTerrainMaterialsUI.overgrowthSlider);
            EditorTerrainMaterialsUI.chanceSlider = new SleekSlider();
            EditorTerrainMaterialsUI.chanceSlider.positionOffset_X = 200;
            EditorTerrainMaterialsUI.chanceSlider.positionOffset_Y = LevelGround.materials.Length * 70 + 30;
            EditorTerrainMaterialsUI.chanceSlider.sizeOffset_X     = 170;
            EditorTerrainMaterialsUI.chanceSlider.sizeOffset_Y     = 20;
            EditorTerrainMaterialsUI.chanceSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorTerrainMaterialsUI.chanceSlider.addLabel(local.format("ChanceSliderLabelText"), ESleekSide.LEFT);
            SleekSlider sleekSlider2 = EditorTerrainMaterialsUI.chanceSlider;

            if (EditorTerrainMaterialsUI.< > f__mg$cache2 == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cache2 = new Dragged(EditorTerrainMaterialsUI.onDraggedChanceSlider);
            }
            sleekSlider2.onDragged = EditorTerrainMaterialsUI.< > f__mg$cache2;
            EditorTerrainMaterialsUI.materialScrollBox.add(EditorTerrainMaterialsUI.chanceSlider);
            EditorTerrainMaterialsUI.steepnessSlider = new SleekSlider();
            EditorTerrainMaterialsUI.steepnessSlider.positionOffset_X = 200;
            EditorTerrainMaterialsUI.steepnessSlider.positionOffset_Y = LevelGround.materials.Length * 70 + 60;
            EditorTerrainMaterialsUI.steepnessSlider.sizeOffset_X     = 170;
            EditorTerrainMaterialsUI.steepnessSlider.sizeOffset_Y     = 20;
            EditorTerrainMaterialsUI.steepnessSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorTerrainMaterialsUI.steepnessSlider.addLabel(local.format("SteepnessFieldLabelText"), ESleekSide.LEFT);
            SleekSlider sleekSlider3 = EditorTerrainMaterialsUI.steepnessSlider;

            if (EditorTerrainMaterialsUI.< > f__mg$cache3 == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cache3 = new Dragged(EditorTerrainMaterialsUI.onDraggedSteepnessSlider);
            }
            sleekSlider3.onDragged = EditorTerrainMaterialsUI.< > f__mg$cache3;
            EditorTerrainMaterialsUI.materialScrollBox.add(EditorTerrainMaterialsUI.steepnessSlider);
            EditorTerrainMaterialsUI.transitionSlider = new SleekSlider();
            EditorTerrainMaterialsUI.transitionSlider.positionOffset_X = 200;
            EditorTerrainMaterialsUI.transitionSlider.positionOffset_Y = LevelGround.materials.Length * 70 + 90;
            EditorTerrainMaterialsUI.transitionSlider.sizeOffset_X     = 170;
            EditorTerrainMaterialsUI.transitionSlider.sizeOffset_Y     = 20;
            EditorTerrainMaterialsUI.transitionSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorTerrainMaterialsUI.transitionSlider.addLabel(local.format("TransitionSliderLabelText"), ESleekSide.LEFT);
            SleekSlider sleekSlider4 = EditorTerrainMaterialsUI.transitionSlider;

            if (EditorTerrainMaterialsUI.< > f__mg$cache4 == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cache4 = new Dragged(EditorTerrainMaterialsUI.onDraggedTransitionSlider);
            }
            sleekSlider4.onDragged = EditorTerrainMaterialsUI.< > f__mg$cache4;
            EditorTerrainMaterialsUI.materialScrollBox.add(EditorTerrainMaterialsUI.transitionSlider);
            EditorTerrainMaterialsUI.heightValue = new SleekValue();
            EditorTerrainMaterialsUI.heightValue.positionOffset_X = 200;
            EditorTerrainMaterialsUI.heightValue.positionOffset_Y = LevelGround.materials.Length * 70 + 120;
            EditorTerrainMaterialsUI.heightValue.sizeOffset_X     = 170;
            EditorTerrainMaterialsUI.heightValue.sizeOffset_Y     = 30;
            EditorTerrainMaterialsUI.heightValue.addLabel(local.format("HeightValueLabelText"), ESleekSide.LEFT);
            SleekValue sleekValue = EditorTerrainMaterialsUI.heightValue;

            if (EditorTerrainMaterialsUI.< > f__mg$cache5 == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cache5 = new Valued(EditorTerrainMaterialsUI.onValuedHeightValue);
            }
            sleekValue.onValued = EditorTerrainMaterialsUI.< > f__mg$cache5;
            EditorTerrainMaterialsUI.materialScrollBox.add(EditorTerrainMaterialsUI.heightValue);
            EditorTerrainMaterialsUI.grassy_0_Toggle = new SleekToggle();
            EditorTerrainMaterialsUI.grassy_0_Toggle.positionOffset_X = 200;
            EditorTerrainMaterialsUI.grassy_0_Toggle.positionOffset_Y = LevelGround.materials.Length * 70 + 160;
            EditorTerrainMaterialsUI.grassy_0_Toggle.sizeOffset_X     = 40;
            EditorTerrainMaterialsUI.grassy_0_Toggle.sizeOffset_Y     = 40;
            EditorTerrainMaterialsUI.grassy_0_Toggle.addLabel(local.format("Grassy_0_ToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle = EditorTerrainMaterialsUI.grassy_0_Toggle;

            if (EditorTerrainMaterialsUI.< > f__mg$cache6 == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cache6 = new Toggled(EditorTerrainMaterialsUI.onToggledGrassy_0_Toggle);
            }
            sleekToggle.onToggled = EditorTerrainMaterialsUI.< > f__mg$cache6;
            EditorTerrainMaterialsUI.materialScrollBox.add(EditorTerrainMaterialsUI.grassy_0_Toggle);
            EditorTerrainMaterialsUI.grassy_1_Toggle = new SleekToggle();
            EditorTerrainMaterialsUI.grassy_1_Toggle.positionOffset_X = 200;
            EditorTerrainMaterialsUI.grassy_1_Toggle.positionOffset_Y = LevelGround.materials.Length * 70 + 210;
            EditorTerrainMaterialsUI.grassy_1_Toggle.sizeOffset_X     = 40;
            EditorTerrainMaterialsUI.grassy_1_Toggle.sizeOffset_Y     = 40;
            EditorTerrainMaterialsUI.grassy_1_Toggle.addLabel(local.format("Grassy_1_ToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle2 = EditorTerrainMaterialsUI.grassy_1_Toggle;

            if (EditorTerrainMaterialsUI.< > f__mg$cache7 == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cache7 = new Toggled(EditorTerrainMaterialsUI.onToggledGrassy_1_Toggle);
            }
            sleekToggle2.onToggled = EditorTerrainMaterialsUI.< > f__mg$cache7;
            EditorTerrainMaterialsUI.materialScrollBox.add(EditorTerrainMaterialsUI.grassy_1_Toggle);
            EditorTerrainMaterialsUI.flowery_0_Toggle = new SleekToggle();
            EditorTerrainMaterialsUI.flowery_0_Toggle.positionOffset_X = 200;
            EditorTerrainMaterialsUI.flowery_0_Toggle.positionOffset_Y = LevelGround.materials.Length * 70 + 260;
            EditorTerrainMaterialsUI.flowery_0_Toggle.sizeOffset_X     = 40;
            EditorTerrainMaterialsUI.flowery_0_Toggle.sizeOffset_Y     = 40;
            EditorTerrainMaterialsUI.flowery_0_Toggle.addLabel(local.format("Flowery_0_ToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle3 = EditorTerrainMaterialsUI.flowery_0_Toggle;

            if (EditorTerrainMaterialsUI.< > f__mg$cache8 == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cache8 = new Toggled(EditorTerrainMaterialsUI.onToggledFlowery_0_Toggle);
            }
            sleekToggle3.onToggled = EditorTerrainMaterialsUI.< > f__mg$cache8;
            EditorTerrainMaterialsUI.materialScrollBox.add(EditorTerrainMaterialsUI.flowery_0_Toggle);
            EditorTerrainMaterialsUI.flowery_1_Toggle = new SleekToggle();
            EditorTerrainMaterialsUI.flowery_1_Toggle.positionOffset_X = 200;
            EditorTerrainMaterialsUI.flowery_1_Toggle.positionOffset_Y = LevelGround.materials.Length * 70 + 310;
            EditorTerrainMaterialsUI.flowery_1_Toggle.sizeOffset_X     = 40;
            EditorTerrainMaterialsUI.flowery_1_Toggle.sizeOffset_Y     = 40;
            EditorTerrainMaterialsUI.flowery_1_Toggle.addLabel(local.format("Flowery_1_ToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle4 = EditorTerrainMaterialsUI.flowery_1_Toggle;

            if (EditorTerrainMaterialsUI.< > f__mg$cache9 == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cache9 = new Toggled(EditorTerrainMaterialsUI.onToggledFlowery_1_Toggle);
            }
            sleekToggle4.onToggled = EditorTerrainMaterialsUI.< > f__mg$cache9;
            EditorTerrainMaterialsUI.materialScrollBox.add(EditorTerrainMaterialsUI.flowery_1_Toggle);
            EditorTerrainMaterialsUI.rockyToggle = new SleekToggle();
            EditorTerrainMaterialsUI.rockyToggle.positionOffset_X = 200;
            EditorTerrainMaterialsUI.rockyToggle.positionOffset_Y = LevelGround.materials.Length * 70 + 360;
            EditorTerrainMaterialsUI.rockyToggle.sizeOffset_X     = 40;
            EditorTerrainMaterialsUI.rockyToggle.sizeOffset_Y     = 40;
            EditorTerrainMaterialsUI.rockyToggle.addLabel(local.format("RockyToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle5 = EditorTerrainMaterialsUI.rockyToggle;

            if (EditorTerrainMaterialsUI.< > f__mg$cacheA == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cacheA = new Toggled(EditorTerrainMaterialsUI.onToggledRockyToggle);
            }
            sleekToggle5.onToggled = EditorTerrainMaterialsUI.< > f__mg$cacheA;
            EditorTerrainMaterialsUI.materialScrollBox.add(EditorTerrainMaterialsUI.rockyToggle);
            EditorTerrainMaterialsUI.roadToggle = new SleekToggle();
            EditorTerrainMaterialsUI.roadToggle.positionOffset_X = 200;
            EditorTerrainMaterialsUI.roadToggle.positionOffset_Y = LevelGround.materials.Length * 70 + 410;
            EditorTerrainMaterialsUI.roadToggle.sizeOffset_X     = 40;
            EditorTerrainMaterialsUI.roadToggle.sizeOffset_Y     = 40;
            EditorTerrainMaterialsUI.roadToggle.addLabel(local.format("RoadToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle6 = EditorTerrainMaterialsUI.roadToggle;

            if (EditorTerrainMaterialsUI.< > f__mg$cacheB == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cacheB = new Toggled(EditorTerrainMaterialsUI.onToggledRoadToggle);
            }
            sleekToggle6.onToggled = EditorTerrainMaterialsUI.< > f__mg$cacheB;
            EditorTerrainMaterialsUI.materialScrollBox.add(EditorTerrainMaterialsUI.roadToggle);
            EditorTerrainMaterialsUI.snowyToggle = new SleekToggle();
            EditorTerrainMaterialsUI.snowyToggle.positionOffset_X = 200;
            EditorTerrainMaterialsUI.snowyToggle.positionOffset_Y = LevelGround.materials.Length * 70 + 460;
            EditorTerrainMaterialsUI.snowyToggle.sizeOffset_X     = 40;
            EditorTerrainMaterialsUI.snowyToggle.sizeOffset_Y     = 40;
            EditorTerrainMaterialsUI.snowyToggle.addLabel(local.format("SnowyToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle7 = EditorTerrainMaterialsUI.snowyToggle;

            if (EditorTerrainMaterialsUI.< > f__mg$cacheC == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cacheC = new Toggled(EditorTerrainMaterialsUI.onToggledSnowyToggle);
            }
            sleekToggle7.onToggled = EditorTerrainMaterialsUI.< > f__mg$cacheC;
            EditorTerrainMaterialsUI.materialScrollBox.add(EditorTerrainMaterialsUI.snowyToggle);
            EditorTerrainMaterialsUI.foundationToggle = new SleekToggle();
            EditorTerrainMaterialsUI.foundationToggle.positionOffset_X = 200;
            EditorTerrainMaterialsUI.foundationToggle.positionOffset_Y = LevelGround.materials.Length * 70 + 510;
            EditorTerrainMaterialsUI.foundationToggle.sizeOffset_X     = 40;
            EditorTerrainMaterialsUI.foundationToggle.sizeOffset_Y     = 40;
            EditorTerrainMaterialsUI.foundationToggle.addLabel(local.format("FoundationToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle8 = EditorTerrainMaterialsUI.foundationToggle;

            if (EditorTerrainMaterialsUI.< > f__mg$cacheD == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cacheD = new Toggled(EditorTerrainMaterialsUI.onToggledFoundationToggle);
            }
            sleekToggle8.onToggled = EditorTerrainMaterialsUI.< > f__mg$cacheD;
            EditorTerrainMaterialsUI.materialScrollBox.add(EditorTerrainMaterialsUI.foundationToggle);
            EditorTerrainMaterialsUI.manualToggle = new SleekToggle();
            EditorTerrainMaterialsUI.manualToggle.positionOffset_X = 200;
            EditorTerrainMaterialsUI.manualToggle.positionOffset_Y = LevelGround.materials.Length * 70 + 560;
            EditorTerrainMaterialsUI.manualToggle.sizeOffset_X     = 40;
            EditorTerrainMaterialsUI.manualToggle.sizeOffset_Y     = 40;
            EditorTerrainMaterialsUI.manualToggle.addLabel(local.format("ManualToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle9 = EditorTerrainMaterialsUI.manualToggle;

            if (EditorTerrainMaterialsUI.< > f__mg$cacheE == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cacheE = new Toggled(EditorTerrainMaterialsUI.onToggledManualToggle);
            }
            sleekToggle9.onToggled = EditorTerrainMaterialsUI.< > f__mg$cacheE;
            EditorTerrainMaterialsUI.materialScrollBox.add(EditorTerrainMaterialsUI.manualToggle);
            EditorTerrainMaterialsUI.steepnessToggle = new SleekToggle();
            EditorTerrainMaterialsUI.steepnessToggle.positionOffset_X = 200;
            EditorTerrainMaterialsUI.steepnessToggle.positionOffset_Y = LevelGround.materials.Length * 70 + 610;
            EditorTerrainMaterialsUI.steepnessToggle.sizeOffset_X     = 40;
            EditorTerrainMaterialsUI.steepnessToggle.sizeOffset_Y     = 40;
            EditorTerrainMaterialsUI.steepnessToggle.addLabel(local.format("SteepnessToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle10 = EditorTerrainMaterialsUI.steepnessToggle;

            if (EditorTerrainMaterialsUI.< > f__mg$cacheF == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cacheF = new Toggled(EditorTerrainMaterialsUI.onToggledSteepnessToggle);
            }
            sleekToggle10.onToggled = EditorTerrainMaterialsUI.< > f__mg$cacheF;
            EditorTerrainMaterialsUI.materialScrollBox.add(EditorTerrainMaterialsUI.steepnessToggle);
            EditorTerrainMaterialsUI.heightToggle = new SleekToggle();
            EditorTerrainMaterialsUI.heightToggle.positionOffset_X = 200;
            EditorTerrainMaterialsUI.heightToggle.positionOffset_Y = LevelGround.materials.Length * 70 + 660;
            EditorTerrainMaterialsUI.heightToggle.sizeOffset_X     = 40;
            EditorTerrainMaterialsUI.heightToggle.sizeOffset_Y     = 40;
            EditorTerrainMaterialsUI.heightToggle.addLabel(local.format("HeightToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle11 = EditorTerrainMaterialsUI.heightToggle;

            if (EditorTerrainMaterialsUI.< > f__mg$cache10 == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cache10 = new Toggled(EditorTerrainMaterialsUI.onToggledHeightToggle);
            }
            sleekToggle11.onToggled = EditorTerrainMaterialsUI.< > f__mg$cache10;
            EditorTerrainMaterialsUI.materialScrollBox.add(EditorTerrainMaterialsUI.heightToggle);
            EditorTerrainMaterialsUI.footprintToggle = new SleekToggle();
            EditorTerrainMaterialsUI.footprintToggle.positionOffset_X = 200;
            EditorTerrainMaterialsUI.footprintToggle.positionOffset_Y = LevelGround.materials.Length * 70 + 710;
            EditorTerrainMaterialsUI.footprintToggle.sizeOffset_X     = 40;
            EditorTerrainMaterialsUI.footprintToggle.sizeOffset_Y     = 40;
            EditorTerrainMaterialsUI.footprintToggle.addLabel(local.format("FootprintToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle12 = EditorTerrainMaterialsUI.footprintToggle;

            if (EditorTerrainMaterialsUI.< > f__mg$cache11 == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cache11 = new Toggled(EditorTerrainMaterialsUI.onToggledFootprintToggle);
            }
            sleekToggle12.onToggled = EditorTerrainMaterialsUI.< > f__mg$cache11;
            EditorTerrainMaterialsUI.materialScrollBox.add(EditorTerrainMaterialsUI.footprintToggle);
            EditorTerrainMaterialsUI.selectedBox = new SleekBox();
            EditorTerrainMaterialsUI.selectedBox.positionOffset_X = -200;
            EditorTerrainMaterialsUI.selectedBox.positionOffset_Y = 80;
            EditorTerrainMaterialsUI.selectedBox.positionScale_X  = 1f;
            EditorTerrainMaterialsUI.selectedBox.sizeOffset_X     = 200;
            EditorTerrainMaterialsUI.selectedBox.sizeOffset_Y     = 30;
            EditorTerrainMaterialsUI.selectedBox.addLabel(local.format("SelectionBoxLabelText"), ESleekSide.LEFT);
            EditorTerrainMaterialsUI.container.add(EditorTerrainMaterialsUI.selectedBox);
            EditorTerrainMaterialsUI.updateSelection();
            EditorTerrainMaterialsUI.bakeGlobalMaterialsButton = new SleekButtonIcon((Texture2D)bundle.load("Materials"));
            EditorTerrainMaterialsUI.bakeGlobalMaterialsButton.positionOffset_X = -200;
            EditorTerrainMaterialsUI.bakeGlobalMaterialsButton.positionOffset_Y = -70;
            EditorTerrainMaterialsUI.bakeGlobalMaterialsButton.positionScale_X  = 1f;
            EditorTerrainMaterialsUI.bakeGlobalMaterialsButton.positionScale_Y  = 1f;
            EditorTerrainMaterialsUI.bakeGlobalMaterialsButton.sizeOffset_X     = 200;
            EditorTerrainMaterialsUI.bakeGlobalMaterialsButton.sizeOffset_Y     = 30;
            EditorTerrainMaterialsUI.bakeGlobalMaterialsButton.text             = local.format("BakeGlobalMaterialsButtonText");
            EditorTerrainMaterialsUI.bakeGlobalMaterialsButton.tooltip          = local.format("BakeGlobalMaterialsButtonTooltip");
            SleekButton sleekButton3 = EditorTerrainMaterialsUI.bakeGlobalMaterialsButton;

            if (EditorTerrainMaterialsUI.< > f__mg$cache12 == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cache12 = new ClickedButton(EditorTerrainMaterialsUI.onClickedBakeGlobalMaterialsButton);
            }
            sleekButton3.onClickedButton = EditorTerrainMaterialsUI.< > f__mg$cache12;
            EditorTerrainMaterialsUI.container.add(EditorTerrainMaterialsUI.bakeGlobalMaterialsButton);
            EditorTerrainMaterialsUI.bakeLocalMaterialsButton = new SleekButtonIcon((Texture2D)bundle.load("Materials"));
            EditorTerrainMaterialsUI.bakeLocalMaterialsButton.positionOffset_X = -200;
            EditorTerrainMaterialsUI.bakeLocalMaterialsButton.positionOffset_Y = -30;
            EditorTerrainMaterialsUI.bakeLocalMaterialsButton.positionScale_X  = 1f;
            EditorTerrainMaterialsUI.bakeLocalMaterialsButton.positionScale_Y  = 1f;
            EditorTerrainMaterialsUI.bakeLocalMaterialsButton.sizeOffset_X     = 200;
            EditorTerrainMaterialsUI.bakeLocalMaterialsButton.sizeOffset_Y     = 30;
            EditorTerrainMaterialsUI.bakeLocalMaterialsButton.text             = local.format("BakeLocalMaterialsButtonText");
            EditorTerrainMaterialsUI.bakeLocalMaterialsButton.tooltip          = local.format("BakeLocalMaterialsButtonTooltip");
            SleekButton sleekButton4 = EditorTerrainMaterialsUI.bakeLocalMaterialsButton;

            if (EditorTerrainMaterialsUI.< > f__mg$cache13 == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cache13 = new ClickedButton(EditorTerrainMaterialsUI.onClickedBakeLocalMaterialsButton);
            }
            sleekButton4.onClickedButton = EditorTerrainMaterialsUI.< > f__mg$cache13;
            EditorTerrainMaterialsUI.container.add(EditorTerrainMaterialsUI.bakeLocalMaterialsButton);
            EditorTerrainMaterialsUI.map2Button = new SleekButtonState(new GUIContent[]
            {
                new GUIContent(local.format("Map2ButtonText1")),
                new GUIContent(local.format("Map2ButtonText2"))
            });
            EditorTerrainMaterialsUI.map2Button.positionOffset_Y = -30;
            EditorTerrainMaterialsUI.map2Button.positionScale_Y  = 1f;
            EditorTerrainMaterialsUI.map2Button.sizeOffset_X     = 200;
            EditorTerrainMaterialsUI.map2Button.sizeOffset_Y     = 30;
            EditorTerrainMaterialsUI.map2Button.tooltip          = local.format("Map2ButtonTooltip");
            SleekButtonState sleekButtonState = EditorTerrainMaterialsUI.map2Button;

            if (EditorTerrainMaterialsUI.< > f__mg$cache14 == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cache14 = new SwappedState(EditorTerrainMaterialsUI.onSwappedMap2);
            }
            sleekButtonState.onSwappedState = EditorTerrainMaterialsUI.< > f__mg$cache14;
            EditorTerrainMaterialsUI.container.add(EditorTerrainMaterialsUI.map2Button);
            EditorTerrainMaterialsUI.sizeSlider = new SleekSlider();
            EditorTerrainMaterialsUI.sizeSlider.positionOffset_Y = -60;
            EditorTerrainMaterialsUI.sizeSlider.positionScale_Y  = 1f;
            EditorTerrainMaterialsUI.sizeSlider.sizeOffset_X     = 200;
            EditorTerrainMaterialsUI.sizeSlider.sizeOffset_Y     = 20;
            EditorTerrainMaterialsUI.sizeSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorTerrainMaterialsUI.sizeSlider.state            = (float)(EditorTerrainMaterials.brushSize - EditorTerrainMaterials.MIN_BRUSH_SIZE) / (float)EditorTerrainMaterials.MAX_BRUSH_SIZE;
            EditorTerrainMaterialsUI.sizeSlider.addLabel(local.format("SizeSliderLabelText"), ESleekSide.RIGHT);
            SleekSlider sleekSlider5 = EditorTerrainMaterialsUI.sizeSlider;

            if (EditorTerrainMaterialsUI.< > f__mg$cache15 == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cache15 = new Dragged(EditorTerrainMaterialsUI.onDraggedSizeSlider);
            }
            sleekSlider5.onDragged = EditorTerrainMaterialsUI.< > f__mg$cache15;
            EditorTerrainMaterialsUI.container.add(EditorTerrainMaterialsUI.sizeSlider);
            EditorTerrainMaterialsUI.noiseSlider = new SleekSlider();
            EditorTerrainMaterialsUI.noiseSlider.positionOffset_Y = -90;
            EditorTerrainMaterialsUI.noiseSlider.positionScale_Y  = 1f;
            EditorTerrainMaterialsUI.noiseSlider.sizeOffset_X     = 200;
            EditorTerrainMaterialsUI.noiseSlider.sizeOffset_Y     = 20;
            EditorTerrainMaterialsUI.noiseSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorTerrainMaterialsUI.noiseSlider.state            = EditorTerrainMaterials.brushNoise;
            EditorTerrainMaterialsUI.noiseSlider.addLabel(local.format("NoiseSliderLabelText"), ESleekSide.RIGHT);
            SleekSlider sleekSlider6 = EditorTerrainMaterialsUI.noiseSlider;

            if (EditorTerrainMaterialsUI.< > f__mg$cache16 == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cache16 = new Dragged(EditorTerrainMaterialsUI.onDraggedNoiseSlider);
            }
            sleekSlider6.onDragged = EditorTerrainMaterialsUI.< > f__mg$cache16;
            EditorTerrainMaterialsUI.container.add(EditorTerrainMaterialsUI.noiseSlider);
            EditorTerrainMaterialsUI.previewToggle = new SleekToggle();
            EditorTerrainMaterialsUI.previewToggle.positionOffset_Y = -140;
            EditorTerrainMaterialsUI.previewToggle.positionScale_Y  = 1f;
            EditorTerrainMaterialsUI.previewToggle.sizeOffset_X     = 40;
            EditorTerrainMaterialsUI.previewToggle.sizeOffset_Y     = 40;
            EditorTerrainMaterialsUI.previewToggle.addLabel(local.format("PreviewToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle13 = EditorTerrainMaterialsUI.previewToggle;

            if (EditorTerrainMaterialsUI.< > f__mg$cache17 == null)
            {
                EditorTerrainMaterialsUI.< > f__mg$cache17 = new Toggled(EditorTerrainMaterialsUI.onToggledPreviewToggle);
            }
            sleekToggle13.onToggled = EditorTerrainMaterialsUI.< > f__mg$cache17;
            EditorTerrainMaterialsUI.container.add(EditorTerrainMaterialsUI.previewToggle);
            bundle.unload();
        }
        // Token: 0x0600354E RID: 13646 RVA: 0x00163654 File Offset: 0x00161A54
        public EditorLevelPlayersUI()
        {
            Local  local  = Localization.read("/Editor/EditorLevelPlayers.dat");
            Bundle bundle = Bundles.getBundle("/Bundles/Textures/Edit/Icons/EditorLevelPlayers/EditorLevelPlayers.unity3d");

            EditorLevelPlayersUI.container = new Sleek();
            EditorLevelPlayersUI.container.positionOffset_X = 10;
            EditorLevelPlayersUI.container.positionOffset_Y = 10;
            EditorLevelPlayersUI.container.positionScale_X  = 1f;
            EditorLevelPlayersUI.container.sizeOffset_X     = -20;
            EditorLevelPlayersUI.container.sizeOffset_Y     = -20;
            EditorLevelPlayersUI.container.sizeScale_X      = 1f;
            EditorLevelPlayersUI.container.sizeScale_Y      = 1f;
            EditorUI.window.add(EditorLevelPlayersUI.container);
            EditorLevelPlayersUI.active    = false;
            EditorLevelPlayersUI.altToggle = new SleekToggle();
            EditorLevelPlayersUI.altToggle.positionOffset_Y = -180;
            EditorLevelPlayersUI.altToggle.positionScale_Y  = 1f;
            EditorLevelPlayersUI.altToggle.sizeOffset_X     = 40;
            EditorLevelPlayersUI.altToggle.sizeOffset_Y     = 40;
            EditorLevelPlayersUI.altToggle.state            = EditorSpawns.selectedAlt;
            EditorLevelPlayersUI.altToggle.addLabel(local.format("AltLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle = EditorLevelPlayersUI.altToggle;

            if (EditorLevelPlayersUI.< > f__mg$cache0 == null)
            {
                EditorLevelPlayersUI.< > f__mg$cache0 = new Toggled(EditorLevelPlayersUI.onToggledAltToggle);
            }
            sleekToggle.onToggled = EditorLevelPlayersUI.< > f__mg$cache0;
            EditorLevelPlayersUI.container.add(EditorLevelPlayersUI.altToggle);
            EditorLevelPlayersUI.radiusSlider = new SleekSlider();
            EditorLevelPlayersUI.radiusSlider.positionOffset_Y = -130;
            EditorLevelPlayersUI.radiusSlider.positionScale_Y  = 1f;
            EditorLevelPlayersUI.radiusSlider.sizeOffset_X     = 200;
            EditorLevelPlayersUI.radiusSlider.sizeOffset_Y     = 20;
            EditorLevelPlayersUI.radiusSlider.state            = (float)(EditorSpawns.radius - EditorSpawns.MIN_REMOVE_SIZE) / (float)EditorSpawns.MAX_REMOVE_SIZE;
            EditorLevelPlayersUI.radiusSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorLevelPlayersUI.radiusSlider.addLabel(local.format("RadiusSliderLabelText"), ESleekSide.RIGHT);
            SleekSlider sleekSlider = EditorLevelPlayersUI.radiusSlider;

            if (EditorLevelPlayersUI.< > f__mg$cache1 == null)
            {
                EditorLevelPlayersUI.< > f__mg$cache1 = new Dragged(EditorLevelPlayersUI.onDraggedRadiusSlider);
            }
            sleekSlider.onDragged = EditorLevelPlayersUI.< > f__mg$cache1;
            EditorLevelPlayersUI.container.add(EditorLevelPlayersUI.radiusSlider);
            EditorLevelPlayersUI.rotationSlider = new SleekSlider();
            EditorLevelPlayersUI.rotationSlider.positionOffset_Y = -100;
            EditorLevelPlayersUI.rotationSlider.positionScale_Y  = 1f;
            EditorLevelPlayersUI.rotationSlider.sizeOffset_X     = 200;
            EditorLevelPlayersUI.rotationSlider.sizeOffset_Y     = 20;
            EditorLevelPlayersUI.rotationSlider.state            = EditorSpawns.rotation / 360f;
            EditorLevelPlayersUI.rotationSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorLevelPlayersUI.rotationSlider.addLabel(local.format("RotationSliderLabelText"), ESleekSide.RIGHT);
            SleekSlider sleekSlider2 = EditorLevelPlayersUI.rotationSlider;

            if (EditorLevelPlayersUI.< > f__mg$cache2 == null)
            {
                EditorLevelPlayersUI.< > f__mg$cache2 = new Dragged(EditorLevelPlayersUI.onDraggedRotationSlider);
            }
            sleekSlider2.onDragged = EditorLevelPlayersUI.< > f__mg$cache2;
            EditorLevelPlayersUI.container.add(EditorLevelPlayersUI.rotationSlider);
            EditorLevelPlayersUI.addButton = new SleekButtonIcon((Texture2D)bundle.load("Add"));
            EditorLevelPlayersUI.addButton.positionOffset_Y = -70;
            EditorLevelPlayersUI.addButton.positionScale_Y  = 1f;
            EditorLevelPlayersUI.addButton.sizeOffset_X     = 200;
            EditorLevelPlayersUI.addButton.sizeOffset_Y     = 30;
            EditorLevelPlayersUI.addButton.text             = local.format("AddButtonText", new object[]
            {
                ControlsSettings.tool_0
            });
            EditorLevelPlayersUI.addButton.tooltip = local.format("AddButtonTooltip");
            SleekButton sleekButton = EditorLevelPlayersUI.addButton;

            if (EditorLevelPlayersUI.< > f__mg$cache3 == null)
            {
                EditorLevelPlayersUI.< > f__mg$cache3 = new ClickedButton(EditorLevelPlayersUI.onClickedAddButton);
            }
            sleekButton.onClickedButton = EditorLevelPlayersUI.< > f__mg$cache3;
            EditorLevelPlayersUI.container.add(EditorLevelPlayersUI.addButton);
            EditorLevelPlayersUI.removeButton = new SleekButtonIcon((Texture2D)bundle.load("Remove"));
            EditorLevelPlayersUI.removeButton.positionOffset_Y = -30;
            EditorLevelPlayersUI.removeButton.positionScale_Y  = 1f;
            EditorLevelPlayersUI.removeButton.sizeOffset_X     = 200;
            EditorLevelPlayersUI.removeButton.sizeOffset_Y     = 30;
            EditorLevelPlayersUI.removeButton.text             = local.format("RemoveButtonText", new object[]
            {
                ControlsSettings.tool_1
            });
            EditorLevelPlayersUI.removeButton.tooltip = local.format("RemoveButtonTooltip");
            SleekButton sleekButton2 = EditorLevelPlayersUI.removeButton;

            if (EditorLevelPlayersUI.< > f__mg$cache4 == null)
            {
                EditorLevelPlayersUI.< > f__mg$cache4 = new ClickedButton(EditorLevelPlayersUI.onClickedRemoveButton);
            }
            sleekButton2.onClickedButton = EditorLevelPlayersUI.< > f__mg$cache4;
            EditorLevelPlayersUI.container.add(EditorLevelPlayersUI.removeButton);
            bundle.unload();
        }
Example #13
0
        // Token: 0x060034B5 RID: 13493 RVA: 0x0015AD6C File Offset: 0x0015916C
        public EditorEnvironmentNavigationUI()
        {
            Local  local  = Localization.read("/Editor/EditorEnvironmentNavigation.dat");
            Bundle bundle = Bundles.getBundle("/Bundles/Textures/Edit/Icons/EditorEnvironmentNavigation/EditorEnvironmentNavigation.unity3d");

            EditorEnvironmentNavigationUI.container = new Sleek();
            EditorEnvironmentNavigationUI.container.positionOffset_X = 10;
            EditorEnvironmentNavigationUI.container.positionOffset_Y = 10;
            EditorEnvironmentNavigationUI.container.positionScale_X  = 1f;
            EditorEnvironmentNavigationUI.container.sizeOffset_X     = -20;
            EditorEnvironmentNavigationUI.container.sizeOffset_Y     = -20;
            EditorEnvironmentNavigationUI.container.sizeScale_X      = 1f;
            EditorEnvironmentNavigationUI.container.sizeScale_Y      = 1f;
            EditorUI.window.add(EditorEnvironmentNavigationUI.container);
            EditorEnvironmentNavigationUI.active      = false;
            EditorEnvironmentNavigationUI.widthSlider = new SleekSlider();
            EditorEnvironmentNavigationUI.widthSlider.positionOffset_X = -200;
            EditorEnvironmentNavigationUI.widthSlider.positionOffset_Y = 80;
            EditorEnvironmentNavigationUI.widthSlider.positionScale_X  = 1f;
            EditorEnvironmentNavigationUI.widthSlider.sizeOffset_X     = 200;
            EditorEnvironmentNavigationUI.widthSlider.sizeOffset_Y     = 20;
            EditorEnvironmentNavigationUI.widthSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorEnvironmentNavigationUI.widthSlider.addLabel(local.format("Width_Label"), ESleekSide.LEFT);
            SleekSlider sleekSlider = EditorEnvironmentNavigationUI.widthSlider;

            if (EditorEnvironmentNavigationUI.< > f__mg$cache0 == null)
            {
                EditorEnvironmentNavigationUI.< > f__mg$cache0 = new Dragged(EditorEnvironmentNavigationUI.onDraggedWidthSlider);
            }
            sleekSlider.onDragged = EditorEnvironmentNavigationUI.< > f__mg$cache0;
            EditorEnvironmentNavigationUI.container.add(EditorEnvironmentNavigationUI.widthSlider);
            EditorEnvironmentNavigationUI.widthSlider.isVisible         = false;
            EditorEnvironmentNavigationUI.heightSlider                  = new SleekSlider();
            EditorEnvironmentNavigationUI.heightSlider.positionOffset_X = -200;
            EditorEnvironmentNavigationUI.heightSlider.positionOffset_Y = 110;
            EditorEnvironmentNavigationUI.heightSlider.positionScale_X  = 1f;
            EditorEnvironmentNavigationUI.heightSlider.sizeOffset_X     = 200;
            EditorEnvironmentNavigationUI.heightSlider.sizeOffset_Y     = 20;
            EditorEnvironmentNavigationUI.heightSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorEnvironmentNavigationUI.heightSlider.addLabel(local.format("Height_Label"), ESleekSide.LEFT);
            SleekSlider sleekSlider2 = EditorEnvironmentNavigationUI.heightSlider;

            if (EditorEnvironmentNavigationUI.< > f__mg$cache1 == null)
            {
                EditorEnvironmentNavigationUI.< > f__mg$cache1 = new Dragged(EditorEnvironmentNavigationUI.onDraggedHeightSlider);
            }
            sleekSlider2.onDragged = EditorEnvironmentNavigationUI.< > f__mg$cache1;
            EditorEnvironmentNavigationUI.container.add(EditorEnvironmentNavigationUI.heightSlider);
            EditorEnvironmentNavigationUI.heightSlider.isVisible = false;
            EditorEnvironmentNavigationUI.navBox = new SleekBox();
            EditorEnvironmentNavigationUI.navBox.positionOffset_X = -200;
            EditorEnvironmentNavigationUI.navBox.positionOffset_Y = 140;
            EditorEnvironmentNavigationUI.navBox.positionScale_X  = 1f;
            EditorEnvironmentNavigationUI.navBox.sizeOffset_X     = 200;
            EditorEnvironmentNavigationUI.navBox.sizeOffset_Y     = 30;
            EditorEnvironmentNavigationUI.navBox.addLabel(local.format("Nav_Label"), ESleekSide.LEFT);
            EditorEnvironmentNavigationUI.container.add(EditorEnvironmentNavigationUI.navBox);
            EditorEnvironmentNavigationUI.navBox.isVisible    = false;
            EditorEnvironmentNavigationUI.difficultyGUIDField = new SleekField();
            EditorEnvironmentNavigationUI.difficultyGUIDField.positionOffset_X = -200;
            EditorEnvironmentNavigationUI.difficultyGUIDField.positionOffset_Y = 180;
            EditorEnvironmentNavigationUI.difficultyGUIDField.positionScale_X  = 1f;
            EditorEnvironmentNavigationUI.difficultyGUIDField.sizeOffset_X     = 200;
            EditorEnvironmentNavigationUI.difficultyGUIDField.sizeOffset_Y     = 30;
            EditorEnvironmentNavigationUI.difficultyGUIDField.maxLength        = 32;
            SleekField sleekField = EditorEnvironmentNavigationUI.difficultyGUIDField;

            if (EditorEnvironmentNavigationUI.< > f__mg$cache2 == null)
            {
                EditorEnvironmentNavigationUI.< > f__mg$cache2 = new Typed(EditorEnvironmentNavigationUI.onDifficultyGUIDFieldTyped);
            }
            sleekField.onTyped = EditorEnvironmentNavigationUI.< > f__mg$cache2;
            EditorEnvironmentNavigationUI.difficultyGUIDField.addLabel(local.format("Difficulty_GUID_Field_Label"), ESleekSide.LEFT);
            EditorEnvironmentNavigationUI.container.add(EditorEnvironmentNavigationUI.difficultyGUIDField);
            EditorEnvironmentNavigationUI.difficultyGUIDField.isVisible = false;
            EditorEnvironmentNavigationUI.maxZombiesField = new SleekByteField();
            EditorEnvironmentNavigationUI.maxZombiesField.positionOffset_X = -200;
            EditorEnvironmentNavigationUI.maxZombiesField.positionOffset_Y = 220;
            EditorEnvironmentNavigationUI.maxZombiesField.positionScale_X  = 1f;
            EditorEnvironmentNavigationUI.maxZombiesField.sizeOffset_X     = 200;
            EditorEnvironmentNavigationUI.maxZombiesField.sizeOffset_Y     = 30;
            SleekByteField sleekByteField = EditorEnvironmentNavigationUI.maxZombiesField;

            if (EditorEnvironmentNavigationUI.< > f__mg$cache3 == null)
            {
                EditorEnvironmentNavigationUI.< > f__mg$cache3 = new TypedByte(EditorEnvironmentNavigationUI.onMaxZombiesFieldTyped);
            }
            sleekByteField.onTypedByte = EditorEnvironmentNavigationUI.< > f__mg$cache3;
            EditorEnvironmentNavigationUI.maxZombiesField.addLabel(local.format("Max_Zombies_Field_Label"), ESleekSide.LEFT);
            EditorEnvironmentNavigationUI.container.add(EditorEnvironmentNavigationUI.maxZombiesField);
            EditorEnvironmentNavigationUI.maxZombiesField.isVisible           = false;
            EditorEnvironmentNavigationUI.spawnZombiesToggle                  = new SleekToggle();
            EditorEnvironmentNavigationUI.spawnZombiesToggle.positionOffset_X = -200;
            EditorEnvironmentNavigationUI.spawnZombiesToggle.positionOffset_Y = 260;
            EditorEnvironmentNavigationUI.spawnZombiesToggle.positionScale_X  = 1f;
            EditorEnvironmentNavigationUI.spawnZombiesToggle.sizeOffset_X     = 40;
            EditorEnvironmentNavigationUI.spawnZombiesToggle.sizeOffset_Y     = 40;
            SleekToggle sleekToggle = EditorEnvironmentNavigationUI.spawnZombiesToggle;

            if (EditorEnvironmentNavigationUI.< > f__mg$cache4 == null)
            {
                EditorEnvironmentNavigationUI.< > f__mg$cache4 = new Toggled(EditorEnvironmentNavigationUI.onToggledSpawnZombiesToggle);
            }
            sleekToggle.onToggled = EditorEnvironmentNavigationUI.< > f__mg$cache4;
            EditorEnvironmentNavigationUI.spawnZombiesToggle.addLabel(local.format("Spawn_Zombies_Toggle_Label"), ESleekSide.RIGHT);
            EditorEnvironmentNavigationUI.container.add(EditorEnvironmentNavigationUI.spawnZombiesToggle);
            EditorEnvironmentNavigationUI.spawnZombiesToggle.isVisible          = false;
            EditorEnvironmentNavigationUI.bakeNavigationButton                  = new SleekButtonIcon((Texture2D)bundle.load("Navigation"));
            EditorEnvironmentNavigationUI.bakeNavigationButton.positionOffset_X = -200;
            EditorEnvironmentNavigationUI.bakeNavigationButton.positionOffset_Y = -30;
            EditorEnvironmentNavigationUI.bakeNavigationButton.positionScale_X  = 1f;
            EditorEnvironmentNavigationUI.bakeNavigationButton.positionScale_Y  = 1f;
            EditorEnvironmentNavigationUI.bakeNavigationButton.sizeOffset_X     = 200;
            EditorEnvironmentNavigationUI.bakeNavigationButton.sizeOffset_Y     = 30;
            EditorEnvironmentNavigationUI.bakeNavigationButton.text             = local.format("Bake_Navigation");
            EditorEnvironmentNavigationUI.bakeNavigationButton.tooltip          = local.format("Bake_Navigation_Tooltip");
            SleekButton sleekButton = EditorEnvironmentNavigationUI.bakeNavigationButton;

            if (EditorEnvironmentNavigationUI.< > f__mg$cache5 == null)
            {
                EditorEnvironmentNavigationUI.< > f__mg$cache5 = new ClickedButton(EditorEnvironmentNavigationUI.onClickedBakeNavigationButton);
            }
            sleekButton.onClickedButton = EditorEnvironmentNavigationUI.< > f__mg$cache5;
            EditorEnvironmentNavigationUI.container.add(EditorEnvironmentNavigationUI.bakeNavigationButton);
            EditorEnvironmentNavigationUI.bakeNavigationButton.isVisible = false;
            bundle.unload();
        }
Example #14
0
        // Token: 0x0600358E RID: 13710 RVA: 0x001674AC File Offset: 0x001658AC
        public EditorTerrainDetailsUI()
        {
            Local  local  = Localization.read("/Editor/EditorTerrainDetails.dat");
            Bundle bundle = Bundles.getBundle("/Bundles/Textures/Edit/Icons/EditorTerrainDetails/EditorTerrainDetails.unity3d");

            EditorTerrainDetailsUI.container = new Sleek();
            EditorTerrainDetailsUI.container.positionOffset_X = 10;
            EditorTerrainDetailsUI.container.positionOffset_Y = 10;
            EditorTerrainDetailsUI.container.positionScale_X  = 1f;
            EditorTerrainDetailsUI.container.sizeOffset_X     = -20;
            EditorTerrainDetailsUI.container.sizeOffset_Y     = -20;
            EditorTerrainDetailsUI.container.sizeScale_X      = 1f;
            EditorTerrainDetailsUI.container.sizeScale_Y      = 1f;
            EditorUI.window.add(EditorTerrainDetailsUI.container);
            EditorTerrainDetailsUI.active = false;
            if (LevelGround.details == null)
            {
                return;
            }
            EditorTerrainDetailsUI.detailsScrollBox = new SleekScrollBox();
            EditorTerrainDetailsUI.detailsScrollBox.positionOffset_Y = 120;
            EditorTerrainDetailsUI.detailsScrollBox.positionOffset_X = -400;
            EditorTerrainDetailsUI.detailsScrollBox.positionScale_X  = 1f;
            EditorTerrainDetailsUI.detailsScrollBox.sizeOffset_X     = 400;
            EditorTerrainDetailsUI.detailsScrollBox.sizeOffset_Y     = -160;
            EditorTerrainDetailsUI.detailsScrollBox.sizeScale_Y      = 1f;
            EditorTerrainDetailsUI.detailsScrollBox.area             = new Rect(0f, 0f, 5f, (float)(LevelGround.details.Length * 70 + 400));
            EditorTerrainDetailsUI.container.add(EditorTerrainDetailsUI.detailsScrollBox);
            for (int i = 0; i < LevelGround.details.Length; i++)
            {
                GroundDetail      groundDetail      = LevelGround.details[i];
                SleekImageTexture sleekImageTexture = new SleekImageTexture();
                sleekImageTexture.positionOffset_X = 200;
                sleekImageTexture.positionOffset_Y = i * 70;
                sleekImageTexture.sizeOffset_X     = 64;
                sleekImageTexture.sizeOffset_Y     = 64;
                sleekImageTexture.texture          = groundDetail.prototype.prototypeTexture;
                EditorTerrainDetailsUI.detailsScrollBox.add(sleekImageTexture);
                SleekButton sleekButton = new SleekButton();
                sleekButton.sizeOffset_Y = 64;
                if (groundDetail.prototype.prototypeTexture != null)
                {
                    sleekButton.positionOffset_X = 70;
                    sleekButton.sizeOffset_X     = 100;
                    sleekButton.text             = LevelGround.details[i].prototype.prototypeTexture.name;
                }
                else
                {
                    sleekButton.sizeOffset_X = 170;
                    sleekButton.text         = LevelGround.details[i].prototype.prototype.name;
                }
                SleekButton sleekButton2 = sleekButton;
                if (EditorTerrainDetailsUI.< > f__mg$cache0 == null)
                {
                    EditorTerrainDetailsUI.< > f__mg$cache0 = new ClickedButton(EditorTerrainDetailsUI.onClickedDetailButton);
                }
                sleekButton2.onClickedButton = EditorTerrainDetailsUI.< > f__mg$cache0;
                sleekImageTexture.add(sleekButton);
            }
            EditorTerrainDetailsUI.densitySlider = new SleekSlider();
            EditorTerrainDetailsUI.densitySlider.positionOffset_X = 200;
            EditorTerrainDetailsUI.densitySlider.positionOffset_Y = LevelGround.details.Length * 70;
            EditorTerrainDetailsUI.densitySlider.sizeOffset_X     = 170;
            EditorTerrainDetailsUI.densitySlider.sizeOffset_Y     = 20;
            EditorTerrainDetailsUI.densitySlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorTerrainDetailsUI.densitySlider.addLabel(local.format("DensitySliderLabelText"), ESleekSide.LEFT);
            SleekSlider sleekSlider = EditorTerrainDetailsUI.densitySlider;

            if (EditorTerrainDetailsUI.< > f__mg$cache1 == null)
            {
                EditorTerrainDetailsUI.< > f__mg$cache1 = new Dragged(EditorTerrainDetailsUI.onDraggedDensitySlider);
            }
            sleekSlider.onDragged = EditorTerrainDetailsUI.< > f__mg$cache1;
            EditorTerrainDetailsUI.detailsScrollBox.add(EditorTerrainDetailsUI.densitySlider);
            EditorTerrainDetailsUI.chanceSlider = new SleekSlider();
            EditorTerrainDetailsUI.chanceSlider.positionOffset_X = 200;
            EditorTerrainDetailsUI.chanceSlider.positionOffset_Y = LevelGround.details.Length * 70 + 30;
            EditorTerrainDetailsUI.chanceSlider.sizeOffset_X     = 170;
            EditorTerrainDetailsUI.chanceSlider.sizeOffset_Y     = 20;
            EditorTerrainDetailsUI.chanceSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorTerrainDetailsUI.chanceSlider.addLabel(local.format("ChanceSliderLabelText"), ESleekSide.LEFT);
            SleekSlider sleekSlider2 = EditorTerrainDetailsUI.chanceSlider;

            if (EditorTerrainDetailsUI.< > f__mg$cache2 == null)
            {
                EditorTerrainDetailsUI.< > f__mg$cache2 = new Dragged(EditorTerrainDetailsUI.onDraggedChanceSlider);
            }
            sleekSlider2.onDragged = EditorTerrainDetailsUI.< > f__mg$cache2;
            EditorTerrainDetailsUI.detailsScrollBox.add(EditorTerrainDetailsUI.chanceSlider);
            EditorTerrainDetailsUI.grass_0_Toggle = new SleekToggle();
            EditorTerrainDetailsUI.grass_0_Toggle.positionOffset_X = 200;
            EditorTerrainDetailsUI.grass_0_Toggle.positionOffset_Y = LevelGround.details.Length * 70 + 60;
            EditorTerrainDetailsUI.grass_0_Toggle.sizeOffset_X     = 40;
            EditorTerrainDetailsUI.grass_0_Toggle.sizeOffset_Y     = 40;
            EditorTerrainDetailsUI.grass_0_Toggle.addLabel(local.format("Grass_0_ToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle = EditorTerrainDetailsUI.grass_0_Toggle;

            if (EditorTerrainDetailsUI.< > f__mg$cache3 == null)
            {
                EditorTerrainDetailsUI.< > f__mg$cache3 = new Toggled(EditorTerrainDetailsUI.onToggledGrass_0_Toggle);
            }
            sleekToggle.onToggled = EditorTerrainDetailsUI.< > f__mg$cache3;
            EditorTerrainDetailsUI.detailsScrollBox.add(EditorTerrainDetailsUI.grass_0_Toggle);
            EditorTerrainDetailsUI.grass_1_Toggle = new SleekToggle();
            EditorTerrainDetailsUI.grass_1_Toggle.positionOffset_X = 200;
            EditorTerrainDetailsUI.grass_1_Toggle.positionOffset_Y = LevelGround.details.Length * 70 + 110;
            EditorTerrainDetailsUI.grass_1_Toggle.sizeOffset_X     = 40;
            EditorTerrainDetailsUI.grass_1_Toggle.sizeOffset_Y     = 40;
            EditorTerrainDetailsUI.grass_1_Toggle.addLabel(local.format("Grass_1_ToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle2 = EditorTerrainDetailsUI.grass_1_Toggle;

            if (EditorTerrainDetailsUI.< > f__mg$cache4 == null)
            {
                EditorTerrainDetailsUI.< > f__mg$cache4 = new Toggled(EditorTerrainDetailsUI.onToggledGrass_1_Toggle);
            }
            sleekToggle2.onToggled = EditorTerrainDetailsUI.< > f__mg$cache4;
            EditorTerrainDetailsUI.detailsScrollBox.add(EditorTerrainDetailsUI.grass_1_Toggle);
            EditorTerrainDetailsUI.flower_0_Toggle = new SleekToggle();
            EditorTerrainDetailsUI.flower_0_Toggle.positionOffset_X = 200;
            EditorTerrainDetailsUI.flower_0_Toggle.positionOffset_Y = LevelGround.details.Length * 70 + 160;
            EditorTerrainDetailsUI.flower_0_Toggle.sizeOffset_X     = 40;
            EditorTerrainDetailsUI.flower_0_Toggle.sizeOffset_Y     = 40;
            EditorTerrainDetailsUI.flower_0_Toggle.addLabel(local.format("Flower_0_ToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle3 = EditorTerrainDetailsUI.flower_0_Toggle;

            if (EditorTerrainDetailsUI.< > f__mg$cache5 == null)
            {
                EditorTerrainDetailsUI.< > f__mg$cache5 = new Toggled(EditorTerrainDetailsUI.onToggledFlower_0_Toggle);
            }
            sleekToggle3.onToggled = EditorTerrainDetailsUI.< > f__mg$cache5;
            EditorTerrainDetailsUI.detailsScrollBox.add(EditorTerrainDetailsUI.flower_0_Toggle);
            EditorTerrainDetailsUI.flower_1_Toggle = new SleekToggle();
            EditorTerrainDetailsUI.flower_1_Toggle.positionOffset_X = 200;
            EditorTerrainDetailsUI.flower_1_Toggle.positionOffset_Y = LevelGround.details.Length * 70 + 210;
            EditorTerrainDetailsUI.flower_1_Toggle.sizeOffset_X     = 40;
            EditorTerrainDetailsUI.flower_1_Toggle.sizeOffset_Y     = 40;
            EditorTerrainDetailsUI.flower_1_Toggle.addLabel(local.format("Flower_0_ToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle4 = EditorTerrainDetailsUI.flower_1_Toggle;

            if (EditorTerrainDetailsUI.< > f__mg$cache6 == null)
            {
                EditorTerrainDetailsUI.< > f__mg$cache6 = new Toggled(EditorTerrainDetailsUI.onToggledFlower_1_Toggle);
            }
            sleekToggle4.onToggled = EditorTerrainDetailsUI.< > f__mg$cache6;
            EditorTerrainDetailsUI.detailsScrollBox.add(EditorTerrainDetailsUI.flower_1_Toggle);
            EditorTerrainDetailsUI.rockToggle = new SleekToggle();
            EditorTerrainDetailsUI.rockToggle.positionOffset_X = 200;
            EditorTerrainDetailsUI.rockToggle.positionOffset_Y = LevelGround.details.Length * 70 + 260;
            EditorTerrainDetailsUI.rockToggle.sizeOffset_X     = 40;
            EditorTerrainDetailsUI.rockToggle.sizeOffset_Y     = 40;
            EditorTerrainDetailsUI.rockToggle.addLabel(local.format("RockToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle5 = EditorTerrainDetailsUI.rockToggle;

            if (EditorTerrainDetailsUI.< > f__mg$cache7 == null)
            {
                EditorTerrainDetailsUI.< > f__mg$cache7 = new Toggled(EditorTerrainDetailsUI.onToggledRockToggle);
            }
            sleekToggle5.onToggled = EditorTerrainDetailsUI.< > f__mg$cache7;
            EditorTerrainDetailsUI.detailsScrollBox.add(EditorTerrainDetailsUI.rockToggle);
            EditorTerrainDetailsUI.roadToggle = new SleekToggle();
            EditorTerrainDetailsUI.roadToggle.positionOffset_X = 200;
            EditorTerrainDetailsUI.roadToggle.positionOffset_Y = LevelGround.details.Length * 70 + 310;
            EditorTerrainDetailsUI.roadToggle.sizeOffset_X     = 40;
            EditorTerrainDetailsUI.roadToggle.sizeOffset_Y     = 40;
            EditorTerrainDetailsUI.roadToggle.addLabel(local.format("RoadToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle6 = EditorTerrainDetailsUI.roadToggle;

            if (EditorTerrainDetailsUI.< > f__mg$cache8 == null)
            {
                EditorTerrainDetailsUI.< > f__mg$cache8 = new Toggled(EditorTerrainDetailsUI.onToggledRoadToggle);
            }
            sleekToggle6.onToggled = EditorTerrainDetailsUI.< > f__mg$cache8;
            EditorTerrainDetailsUI.detailsScrollBox.add(EditorTerrainDetailsUI.roadToggle);
            EditorTerrainDetailsUI.snowToggle = new SleekToggle();
            EditorTerrainDetailsUI.snowToggle.positionOffset_X = 200;
            EditorTerrainDetailsUI.snowToggle.positionOffset_Y = LevelGround.details.Length * 70 + 360;
            EditorTerrainDetailsUI.snowToggle.sizeOffset_X     = 40;
            EditorTerrainDetailsUI.snowToggle.sizeOffset_Y     = 40;
            EditorTerrainDetailsUI.snowToggle.addLabel(local.format("SnowToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle7 = EditorTerrainDetailsUI.snowToggle;

            if (EditorTerrainDetailsUI.< > f__mg$cache9 == null)
            {
                EditorTerrainDetailsUI.< > f__mg$cache9 = new Toggled(EditorTerrainDetailsUI.onToggledSnowToggle);
            }
            sleekToggle7.onToggled = EditorTerrainDetailsUI.< > f__mg$cache9;
            EditorTerrainDetailsUI.detailsScrollBox.add(EditorTerrainDetailsUI.snowToggle);
            EditorTerrainDetailsUI.selectedBox = new SleekBox();
            EditorTerrainDetailsUI.selectedBox.positionOffset_X = -200;
            EditorTerrainDetailsUI.selectedBox.positionOffset_Y = 80;
            EditorTerrainDetailsUI.selectedBox.positionScale_X  = 1f;
            EditorTerrainDetailsUI.selectedBox.sizeOffset_X     = 200;
            EditorTerrainDetailsUI.selectedBox.sizeOffset_Y     = 30;
            EditorTerrainDetailsUI.selectedBox.addLabel(local.format("SelectionBoxLabelText"), ESleekSide.LEFT);
            EditorTerrainDetailsUI.container.add(EditorTerrainDetailsUI.selectedBox);
            EditorTerrainDetailsUI.updateSelection();
            EditorTerrainDetailsUI.bakeDetailsButton = new SleekButtonIcon((Texture2D)bundle.load("Details"));
            EditorTerrainDetailsUI.bakeDetailsButton.positionOffset_X = -200;
            EditorTerrainDetailsUI.bakeDetailsButton.positionOffset_Y = -30;
            EditorTerrainDetailsUI.bakeDetailsButton.positionScale_X  = 1f;
            EditorTerrainDetailsUI.bakeDetailsButton.positionScale_Y  = 1f;
            EditorTerrainDetailsUI.bakeDetailsButton.sizeOffset_X     = 200;
            EditorTerrainDetailsUI.bakeDetailsButton.sizeOffset_Y     = 30;
            EditorTerrainDetailsUI.bakeDetailsButton.text             = local.format("BakeDetailsButtonText");
            EditorTerrainDetailsUI.bakeDetailsButton.tooltip          = local.format("BakeDetailsButtonTooltip");
            SleekButton sleekButton3 = EditorTerrainDetailsUI.bakeDetailsButton;

            if (EditorTerrainDetailsUI.< > f__mg$cacheA == null)
            {
                EditorTerrainDetailsUI.< > f__mg$cacheA = new ClickedButton(EditorTerrainDetailsUI.onClickedBakeDetailsButton);
            }
            sleekButton3.onClickedButton = EditorTerrainDetailsUI.< > f__mg$cacheA;
            EditorTerrainDetailsUI.container.add(EditorTerrainDetailsUI.bakeDetailsButton);
            bundle.unload();
        }
Example #15
0
        protected internal override void update(EventLayer eventLayer, bool allowProcessing, Clock clock)
        {
            var touches = eventLayer.EventManager.Touches;
            var fingers = touches.Fingers;

            if (fingers.Count == fingerCount)
            {
                Vector2 primaryFingerVec = new Vector2(fingers[0].PixelDeltaX, fingers[0].PixelDeltaY);
                float   primaryFingerLen = primaryFingerVec.length();
                Vector2 longestLengthVec = primaryFingerVec;
                float   longestLength    = primaryFingerLen;
                if (primaryFingerLen > 0)
                {
                    bool allVectorsSameDirection = true;
                    for (int i = 1; i < fingerCount && allVectorsSameDirection; ++i)
                    {
                        Vector2 testFingerVec = new Vector2(fingers[i].PixelDeltaX, fingers[i].PixelDeltaY);
                        float   testFingerLen = testFingerVec.length();
                        if (testFingerLen > 0)
                        {
                            float cosTheta = primaryFingerVec.dot(ref testFingerVec) / (primaryFingerLen * testFingerLen);
                            if (cosTheta > 0.5f)
                            {
                                if (testFingerLen > longestLength)
                                {
                                    longestLengthVec = testFingerVec;
                                    longestLength    = testFingerLen;
                                }
                            }
                            else
                            {
                                allVectorsSameDirection = false;
                            }
                        }
                    }
                    if (allVectorsSameDirection)
                    {
                        DeltaX    = longestLengthVec.x;
                        DeltaY    = longestLengthVec.y;
                        AbsoluteX = fingers[0].PixelX;
                        AbsoluteY = fingers[0].PixelY;

                        if (!gestureStarted)
                        {
                            cancelMomentum();

                            gestureStarted = true;
                            if (GestureStarted != null)
                            {
                                GestureStarted.Invoke(eventLayer, this);
                            }
                        }

                        didGesture = true;
                        averageSpeed[averageSpeedCursor] = longestLengthVec;
                        averageSpeedCursor++;
                        averageSpeedCursor %= averageSpeed.Length;

                        //Make sure to fire event last so momentum can be canceled if needed
                        if (Dragged != null)
                        {
                            Dragged.Invoke(eventLayer, this);
                        }
                    }
                }
                else if (gestureStarted)
                {
                    //If we have done the gesture once and the correct number of fingers are down, keep reporting that we did the gesture
                    didGesture = true;
                }
            }

            if (!didGesture)
            {
                if (gestureStarted)
                {
                    momentumStarted = true;
                    momentum        = new IntVector2(0, 0);
                    for (int i = 0; i < averageSpeed.Length; ++i)
                    {
                        momentum += averageSpeed[i];
                    }
                    momentum /= averageSpeed.Length;

                    momentumDirection = new Vector2(1.0f, 1.0f);
                    if (momentum.x < 0.0f)
                    {
                        momentum.x          = -momentum.x;
                        momentumDirection.x = -1.0f;
                    }
                    if (momentum.y < 0.0f)
                    {
                        momentum.y          = -momentum.y;
                        momentumDirection.y = -1.0f;
                    }
                    if (momentum.x < minimumMomentum)
                    {
                        momentum.x = 0.0f;
                    }
                    if (momentum.y < minimumMomentum)
                    {
                        momentum.y = 0.0f;
                    }
                    deceleration = momentum / decelerationTime;

                    //Important to fire event last so momentum can be canceled if needed
                    if (MomentumStarted != null)
                    {
                        MomentumStarted(eventLayer, this);
                    }
                }
                gestureStarted = false;

                if (momentum.length2() != 0.0f)
                {
                    momentum -= deceleration * clock.DeltaSeconds;
                    if (momentum.x < 0.0f)
                    {
                        momentum.x = 0.0f;
                    }
                    if (momentum.y <= 0.0f)
                    {
                        momentum.y = 0.0f;
                    }

                    Vector2 finalMomentum = momentum * momentumDirection;
                    DeltaX = finalMomentum.x;
                    DeltaY = finalMomentum.y;

                    if (Dragged != null)
                    {
                        Dragged.Invoke(eventLayer, this);
                    }
                }
                else if (momentumStarted)
                {
                    momentumStarted = false;
                    if (MomentumEnded != null)
                    {
                        MomentumEnded.Invoke(eventLayer, this);
                    }
                }
            }

            didGesture = false;
        }
        public EditorSpawnsZombiesUI()
        {
            EditorSpawnsZombiesUI.localization = Localization.read("/Editor/EditorSpawnsZombies.dat");
            Bundle bundle = Bundles.getBundle("/Bundles/Textures/Edit/Icons/EditorSpawnsZombies/EditorSpawnsZombies.unity3d");

            EditorSpawnsZombiesUI.container = new Sleek();
            EditorSpawnsZombiesUI.container.positionOffset_X = 10;
            EditorSpawnsZombiesUI.container.positionOffset_Y = 10;
            EditorSpawnsZombiesUI.container.positionScale_X  = 1f;
            EditorSpawnsZombiesUI.container.sizeOffset_X     = -20;
            EditorSpawnsZombiesUI.container.sizeOffset_Y     = -20;
            EditorSpawnsZombiesUI.container.sizeScale_X      = 1f;
            EditorSpawnsZombiesUI.container.sizeScale_Y      = 1f;
            EditorUI.window.add(EditorSpawnsZombiesUI.container);
            EditorSpawnsZombiesUI.active         = false;
            EditorSpawnsZombiesUI.tableScrollBox = new SleekScrollBox();
            EditorSpawnsZombiesUI.tableScrollBox.positionOffset_X = -470;
            EditorSpawnsZombiesUI.tableScrollBox.positionOffset_Y = 120;
            EditorSpawnsZombiesUI.tableScrollBox.positionScale_X  = 1f;
            EditorSpawnsZombiesUI.tableScrollBox.sizeOffset_X     = 470;
            EditorSpawnsZombiesUI.tableScrollBox.sizeOffset_Y     = 200;
            EditorSpawnsZombiesUI.container.add(EditorSpawnsZombiesUI.tableScrollBox);
            EditorSpawnsZombiesUI.tableNameField = new SleekField();
            EditorSpawnsZombiesUI.tableNameField.positionOffset_X = -230;
            EditorSpawnsZombiesUI.tableNameField.positionOffset_Y = 330;
            EditorSpawnsZombiesUI.tableNameField.positionScale_X  = 1f;
            EditorSpawnsZombiesUI.tableNameField.sizeOffset_X     = 230;
            EditorSpawnsZombiesUI.tableNameField.sizeOffset_Y     = 30;
            EditorSpawnsZombiesUI.tableNameField.maxLength        = 64;
            EditorSpawnsZombiesUI.tableNameField.addLabel(EditorSpawnsZombiesUI.localization.format("TableNameFieldLabelText"), ESleekSide.LEFT);
            SleekField sleekField = EditorSpawnsZombiesUI.tableNameField;
            Delegate   onTyped    = sleekField.onTyped;

            if (EditorSpawnsZombiesUI.< > f__mg$cache4 == null)
            {
                EditorSpawnsZombiesUI.< > f__mg$cache4 = new Typed(EditorSpawnsZombiesUI.onTypedNameField);
            }
            sleekField.onTyped = (Typed)Delegate.Combine(onTyped, EditorSpawnsZombiesUI.< > f__mg$cache4);
            EditorSpawnsZombiesUI.container.add(EditorSpawnsZombiesUI.tableNameField);
            EditorSpawnsZombiesUI.addTableButton = new SleekButtonIcon((Texture2D)bundle.load("Add"));
            EditorSpawnsZombiesUI.addTableButton.positionOffset_X = -230;
            EditorSpawnsZombiesUI.addTableButton.positionOffset_Y = 370;
            EditorSpawnsZombiesUI.addTableButton.positionScale_X  = 1f;
            EditorSpawnsZombiesUI.addTableButton.sizeOffset_X     = 110;
            EditorSpawnsZombiesUI.addTableButton.sizeOffset_Y     = 30;
            EditorSpawnsZombiesUI.addTableButton.text             = EditorSpawnsZombiesUI.localization.format("AddTableButtonText");
            EditorSpawnsZombiesUI.addTableButton.tooltip          = EditorSpawnsZombiesUI.localization.format("AddTableButtonTooltip");
            SleekButton sleekButton = EditorSpawnsZombiesUI.addTableButton;

            if (EditorSpawnsZombiesUI.< > f__mg$cache5 == null)
            {
                EditorSpawnsZombiesUI.< > f__mg$cache5 = new ClickedButton(EditorSpawnsZombiesUI.onClickedAddTableButton);
            }
            sleekButton.onClickedButton = EditorSpawnsZombiesUI.< > f__mg$cache5;
            EditorSpawnsZombiesUI.container.add(EditorSpawnsZombiesUI.addTableButton);
            EditorSpawnsZombiesUI.removeTableButton = new SleekButtonIcon((Texture2D)bundle.load("Remove"));
            EditorSpawnsZombiesUI.removeTableButton.positionOffset_X = -110;
            EditorSpawnsZombiesUI.removeTableButton.positionOffset_Y = 370;
            EditorSpawnsZombiesUI.removeTableButton.positionScale_X  = 1f;
            EditorSpawnsZombiesUI.removeTableButton.sizeOffset_X     = 110;
            EditorSpawnsZombiesUI.removeTableButton.sizeOffset_Y     = 30;
            EditorSpawnsZombiesUI.removeTableButton.text             = EditorSpawnsZombiesUI.localization.format("RemoveTableButtonText");
            EditorSpawnsZombiesUI.removeTableButton.tooltip          = EditorSpawnsZombiesUI.localization.format("RemoveTableButtonTooltip");
            SleekButton sleekButton2 = EditorSpawnsZombiesUI.removeTableButton;

            if (EditorSpawnsZombiesUI.< > f__mg$cache6 == null)
            {
                EditorSpawnsZombiesUI.< > f__mg$cache6 = new ClickedButton(EditorSpawnsZombiesUI.onClickedRemoveTableButton);
            }
            sleekButton2.onClickedButton = EditorSpawnsZombiesUI.< > f__mg$cache6;
            EditorSpawnsZombiesUI.container.add(EditorSpawnsZombiesUI.removeTableButton);
            EditorSpawnsZombiesUI.updateTables();
            EditorSpawnsZombiesUI.spawnsScrollBox = new SleekScrollBox();
            EditorSpawnsZombiesUI.spawnsScrollBox.positionOffset_X = -470;
            EditorSpawnsZombiesUI.spawnsScrollBox.positionOffset_Y = 410;
            EditorSpawnsZombiesUI.spawnsScrollBox.positionScale_X  = 1f;
            EditorSpawnsZombiesUI.spawnsScrollBox.sizeOffset_X     = 470;
            EditorSpawnsZombiesUI.spawnsScrollBox.sizeOffset_Y     = -410;
            EditorSpawnsZombiesUI.spawnsScrollBox.sizeScale_Y      = 1f;
            EditorSpawnsZombiesUI.spawnsScrollBox.area             = new Rect(0f, 0f, 5f, 1000f);
            EditorSpawnsZombiesUI.container.add(EditorSpawnsZombiesUI.spawnsScrollBox);
            EditorSpawnsZombiesUI.tableColorPicker = new SleekColorPicker();
            EditorSpawnsZombiesUI.tableColorPicker.positionOffset_X = 200;
            SleekColorPicker sleekColorPicker = EditorSpawnsZombiesUI.tableColorPicker;

            if (EditorSpawnsZombiesUI.< > f__mg$cache7 == null)
            {
                EditorSpawnsZombiesUI.< > f__mg$cache7 = new ColorPicked(EditorSpawnsZombiesUI.onZombieColorPicked);
            }
            sleekColorPicker.onColorPicked = EditorSpawnsZombiesUI.< > f__mg$cache7;
            EditorSpawnsZombiesUI.spawnsScrollBox.add(EditorSpawnsZombiesUI.tableColorPicker);
            EditorSpawnsZombiesUI.megaToggle = new SleekToggle();
            EditorSpawnsZombiesUI.megaToggle.positionOffset_X = 240;
            EditorSpawnsZombiesUI.megaToggle.positionOffset_Y = 130;
            EditorSpawnsZombiesUI.megaToggle.sizeOffset_X     = 40;
            EditorSpawnsZombiesUI.megaToggle.sizeOffset_Y     = 40;
            SleekToggle sleekToggle = EditorSpawnsZombiesUI.megaToggle;

            if (EditorSpawnsZombiesUI.< > f__mg$cache8 == null)
            {
                EditorSpawnsZombiesUI.< > f__mg$cache8 = new Toggled(EditorSpawnsZombiesUI.onToggledMegaToggle);
            }
            sleekToggle.onToggled = EditorSpawnsZombiesUI.< > f__mg$cache8;
            EditorSpawnsZombiesUI.megaToggle.addLabel(EditorSpawnsZombiesUI.localization.format("MegaToggleLabelText"), ESleekSide.LEFT);
            EditorSpawnsZombiesUI.spawnsScrollBox.add(EditorSpawnsZombiesUI.megaToggle);
            EditorSpawnsZombiesUI.healthField = new SleekUInt16Field();
            EditorSpawnsZombiesUI.healthField.positionOffset_X = 240;
            EditorSpawnsZombiesUI.healthField.positionOffset_Y = 180;
            EditorSpawnsZombiesUI.healthField.sizeOffset_X     = 200;
            EditorSpawnsZombiesUI.healthField.sizeOffset_Y     = 30;
            SleekUInt16Field sleekUInt16Field = EditorSpawnsZombiesUI.healthField;

            if (EditorSpawnsZombiesUI.< > f__mg$cache9 == null)
            {
                EditorSpawnsZombiesUI.< > f__mg$cache9 = new TypedUInt16(EditorSpawnsZombiesUI.onHealthFieldTyped);
            }
            sleekUInt16Field.onTypedUInt16 = EditorSpawnsZombiesUI.< > f__mg$cache9;
            EditorSpawnsZombiesUI.healthField.addLabel(EditorSpawnsZombiesUI.localization.format("HealthFieldLabelText"), ESleekSide.LEFT);
            EditorSpawnsZombiesUI.spawnsScrollBox.add(EditorSpawnsZombiesUI.healthField);
            EditorSpawnsZombiesUI.damageField = new SleekByteField();
            EditorSpawnsZombiesUI.damageField.positionOffset_X = 240;
            EditorSpawnsZombiesUI.damageField.positionOffset_Y = 220;
            EditorSpawnsZombiesUI.damageField.sizeOffset_X     = 200;
            EditorSpawnsZombiesUI.damageField.sizeOffset_Y     = 30;
            SleekByteField sleekByteField = EditorSpawnsZombiesUI.damageField;

            if (EditorSpawnsZombiesUI.< > f__mg$cacheA == null)
            {
                EditorSpawnsZombiesUI.< > f__mg$cacheA = new TypedByte(EditorSpawnsZombiesUI.onDamageFieldTyped);
            }
            sleekByteField.onTypedByte = EditorSpawnsZombiesUI.< > f__mg$cacheA;
            EditorSpawnsZombiesUI.damageField.addLabel(EditorSpawnsZombiesUI.localization.format("DamageFieldLabelText"), ESleekSide.LEFT);
            EditorSpawnsZombiesUI.spawnsScrollBox.add(EditorSpawnsZombiesUI.damageField);
            EditorSpawnsZombiesUI.lootIndexField = new SleekByteField();
            EditorSpawnsZombiesUI.lootIndexField.positionOffset_X = 240;
            EditorSpawnsZombiesUI.lootIndexField.positionOffset_Y = 260;
            EditorSpawnsZombiesUI.lootIndexField.sizeOffset_X     = 200;
            EditorSpawnsZombiesUI.lootIndexField.sizeOffset_Y     = 30;
            SleekByteField sleekByteField2 = EditorSpawnsZombiesUI.lootIndexField;

            if (EditorSpawnsZombiesUI.< > f__mg$cacheB == null)
            {
                EditorSpawnsZombiesUI.< > f__mg$cacheB = new TypedByte(EditorSpawnsZombiesUI.onLootIndexFieldTyped);
            }
            sleekByteField2.onTypedByte = EditorSpawnsZombiesUI.< > f__mg$cacheB;
            EditorSpawnsZombiesUI.lootIndexField.addLabel(EditorSpawnsZombiesUI.localization.format("LootIndexFieldLabelText"), ESleekSide.LEFT);
            EditorSpawnsZombiesUI.spawnsScrollBox.add(EditorSpawnsZombiesUI.lootIndexField);
            EditorSpawnsZombiesUI.lootIDField = new SleekUInt16Field();
            EditorSpawnsZombiesUI.lootIDField.positionOffset_X = 240;
            EditorSpawnsZombiesUI.lootIDField.positionOffset_Y = 300;
            EditorSpawnsZombiesUI.lootIDField.sizeOffset_X     = 200;
            EditorSpawnsZombiesUI.lootIDField.sizeOffset_Y     = 30;
            SleekUInt16Field sleekUInt16Field2 = EditorSpawnsZombiesUI.lootIDField;

            if (EditorSpawnsZombiesUI.< > f__mg$cacheC == null)
            {
                EditorSpawnsZombiesUI.< > f__mg$cacheC = new TypedUInt16(EditorSpawnsZombiesUI.onLootIDFieldTyped);
            }
            sleekUInt16Field2.onTypedUInt16 = EditorSpawnsZombiesUI.< > f__mg$cacheC;
            EditorSpawnsZombiesUI.lootIDField.addLabel(EditorSpawnsZombiesUI.localization.format("LootIDFieldLabelText"), ESleekSide.LEFT);
            EditorSpawnsZombiesUI.spawnsScrollBox.add(EditorSpawnsZombiesUI.lootIDField);
            EditorSpawnsZombiesUI.xpField = new SleekUInt32Field();
            EditorSpawnsZombiesUI.xpField.positionOffset_X = 240;
            EditorSpawnsZombiesUI.xpField.positionOffset_Y = 340;
            EditorSpawnsZombiesUI.xpField.sizeOffset_X     = 200;
            EditorSpawnsZombiesUI.xpField.sizeOffset_Y     = 30;
            SleekUInt32Field sleekUInt32Field = EditorSpawnsZombiesUI.xpField;

            if (EditorSpawnsZombiesUI.< > f__mg$cacheD == null)
            {
                EditorSpawnsZombiesUI.< > f__mg$cacheD = new TypedUInt32(EditorSpawnsZombiesUI.onXPFieldTyped);
            }
            sleekUInt32Field.onTypedUInt32 = EditorSpawnsZombiesUI.< > f__mg$cacheD;
            EditorSpawnsZombiesUI.xpField.addLabel(EditorSpawnsZombiesUI.localization.format("XPFieldLabelText"), ESleekSide.LEFT);
            EditorSpawnsZombiesUI.spawnsScrollBox.add(EditorSpawnsZombiesUI.xpField);
            EditorSpawnsZombiesUI.regenField = new SleekSingleField();
            EditorSpawnsZombiesUI.regenField.positionOffset_X = 240;
            EditorSpawnsZombiesUI.regenField.positionOffset_Y = 380;
            EditorSpawnsZombiesUI.regenField.sizeOffset_X     = 200;
            EditorSpawnsZombiesUI.regenField.sizeOffset_Y     = 30;
            SleekSingleField sleekSingleField = EditorSpawnsZombiesUI.regenField;

            if (EditorSpawnsZombiesUI.< > f__mg$cacheE == null)
            {
                EditorSpawnsZombiesUI.< > f__mg$cacheE = new TypedSingle(EditorSpawnsZombiesUI.onRegenFieldTyped);
            }
            sleekSingleField.onTypedSingle = EditorSpawnsZombiesUI.< > f__mg$cacheE;
            EditorSpawnsZombiesUI.regenField.addLabel(EditorSpawnsZombiesUI.localization.format("RegenFieldLabelText"), ESleekSide.LEFT);
            EditorSpawnsZombiesUI.spawnsScrollBox.add(EditorSpawnsZombiesUI.regenField);
            EditorSpawnsZombiesUI.difficultyGUIDField = new SleekField();
            EditorSpawnsZombiesUI.difficultyGUIDField.positionOffset_X = 240;
            EditorSpawnsZombiesUI.difficultyGUIDField.positionOffset_Y = 420;
            EditorSpawnsZombiesUI.difficultyGUIDField.sizeOffset_X     = 200;
            EditorSpawnsZombiesUI.difficultyGUIDField.sizeOffset_Y     = 30;
            EditorSpawnsZombiesUI.difficultyGUIDField.maxLength        = 32;
            SleekField sleekField2 = EditorSpawnsZombiesUI.difficultyGUIDField;

            if (EditorSpawnsZombiesUI.< > f__mg$cacheF == null)
            {
                EditorSpawnsZombiesUI.< > f__mg$cacheF = new Typed(EditorSpawnsZombiesUI.onDifficultyGUIDFieldTyped);
            }
            sleekField2.onTyped = EditorSpawnsZombiesUI.< > f__mg$cacheF;
            EditorSpawnsZombiesUI.difficultyGUIDField.addLabel(EditorSpawnsZombiesUI.localization.format("DifficultyGUIDFieldLabelText"), ESleekSide.LEFT);
            EditorSpawnsZombiesUI.spawnsScrollBox.add(EditorSpawnsZombiesUI.difficultyGUIDField);
            EditorSpawnsZombiesUI.itemIDField = new SleekUInt16Field();
            EditorSpawnsZombiesUI.itemIDField.positionOffset_X = 240;
            EditorSpawnsZombiesUI.itemIDField.sizeOffset_X     = 200;
            EditorSpawnsZombiesUI.itemIDField.sizeOffset_Y     = 30;
            EditorSpawnsZombiesUI.itemIDField.addLabel(EditorSpawnsZombiesUI.localization.format("ItemIDFieldLabelText"), ESleekSide.LEFT);
            EditorSpawnsZombiesUI.spawnsScrollBox.add(EditorSpawnsZombiesUI.itemIDField);
            EditorSpawnsZombiesUI.addItemButton = new SleekButtonIcon((Texture2D)bundle.load("Add"));
            EditorSpawnsZombiesUI.addItemButton.positionOffset_X = 240;
            EditorSpawnsZombiesUI.addItemButton.sizeOffset_X     = 95;
            EditorSpawnsZombiesUI.addItemButton.sizeOffset_Y     = 30;
            EditorSpawnsZombiesUI.addItemButton.text             = EditorSpawnsZombiesUI.localization.format("AddItemButtonText");
            EditorSpawnsZombiesUI.addItemButton.tooltip          = EditorSpawnsZombiesUI.localization.format("AddItemButtonTooltip");
            SleekButton sleekButton3 = EditorSpawnsZombiesUI.addItemButton;

            if (EditorSpawnsZombiesUI.< > f__mg$cache10 == null)
            {
                EditorSpawnsZombiesUI.< > f__mg$cache10 = new ClickedButton(EditorSpawnsZombiesUI.onClickedAddItemButton);
            }
            sleekButton3.onClickedButton = EditorSpawnsZombiesUI.< > f__mg$cache10;
            EditorSpawnsZombiesUI.spawnsScrollBox.add(EditorSpawnsZombiesUI.addItemButton);
            EditorSpawnsZombiesUI.removeItemButton = new SleekButtonIcon((Texture2D)bundle.load("Remove"));
            EditorSpawnsZombiesUI.removeItemButton.positionOffset_X = 345;
            EditorSpawnsZombiesUI.removeItemButton.sizeOffset_X     = 95;
            EditorSpawnsZombiesUI.removeItemButton.sizeOffset_Y     = 30;
            EditorSpawnsZombiesUI.removeItemButton.text             = EditorSpawnsZombiesUI.localization.format("RemoveItemButtonText");
            EditorSpawnsZombiesUI.removeItemButton.tooltip          = EditorSpawnsZombiesUI.localization.format("RemoveItemButtonTooltip");
            SleekButton sleekButton4 = EditorSpawnsZombiesUI.removeItemButton;

            if (EditorSpawnsZombiesUI.< > f__mg$cache11 == null)
            {
                EditorSpawnsZombiesUI.< > f__mg$cache11 = new ClickedButton(EditorSpawnsZombiesUI.onClickedRemoveItemButton);
            }
            sleekButton4.onClickedButton = EditorSpawnsZombiesUI.< > f__mg$cache11;
            EditorSpawnsZombiesUI.spawnsScrollBox.add(EditorSpawnsZombiesUI.removeItemButton);
            EditorSpawnsZombiesUI.selectedBox = new SleekBox();
            EditorSpawnsZombiesUI.selectedBox.positionOffset_X = -230;
            EditorSpawnsZombiesUI.selectedBox.positionOffset_Y = 80;
            EditorSpawnsZombiesUI.selectedBox.positionScale_X  = 1f;
            EditorSpawnsZombiesUI.selectedBox.sizeOffset_X     = 230;
            EditorSpawnsZombiesUI.selectedBox.sizeOffset_Y     = 30;
            EditorSpawnsZombiesUI.selectedBox.addLabel(EditorSpawnsZombiesUI.localization.format("SelectionBoxLabelText"), ESleekSide.LEFT);
            EditorSpawnsZombiesUI.container.add(EditorSpawnsZombiesUI.selectedBox);
            EditorSpawnsZombiesUI.updateSelection();
            EditorSpawnsZombiesUI.radiusSlider = new SleekSlider();
            EditorSpawnsZombiesUI.radiusSlider.positionOffset_Y = -100;
            EditorSpawnsZombiesUI.radiusSlider.positionScale_Y  = 1f;
            EditorSpawnsZombiesUI.radiusSlider.sizeOffset_X     = 200;
            EditorSpawnsZombiesUI.radiusSlider.sizeOffset_Y     = 20;
            EditorSpawnsZombiesUI.radiusSlider.state            = (float)(EditorSpawns.radius - EditorSpawns.MIN_REMOVE_SIZE) / (float)EditorSpawns.MAX_REMOVE_SIZE;
            EditorSpawnsZombiesUI.radiusSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorSpawnsZombiesUI.radiusSlider.addLabel(EditorSpawnsZombiesUI.localization.format("RadiusSliderLabelText"), ESleekSide.RIGHT);
            SleekSlider sleekSlider = EditorSpawnsZombiesUI.radiusSlider;

            if (EditorSpawnsZombiesUI.< > f__mg$cache12 == null)
            {
                EditorSpawnsZombiesUI.< > f__mg$cache12 = new Dragged(EditorSpawnsZombiesUI.onDraggedRadiusSlider);
            }
            sleekSlider.onDragged = EditorSpawnsZombiesUI.< > f__mg$cache12;
            EditorSpawnsZombiesUI.container.add(EditorSpawnsZombiesUI.radiusSlider);
            EditorSpawnsZombiesUI.addButton = new SleekButtonIcon((Texture2D)bundle.load("Add"));
            EditorSpawnsZombiesUI.addButton.positionOffset_Y = -70;
            EditorSpawnsZombiesUI.addButton.positionScale_Y  = 1f;
            EditorSpawnsZombiesUI.addButton.sizeOffset_X     = 200;
            EditorSpawnsZombiesUI.addButton.sizeOffset_Y     = 30;
            EditorSpawnsZombiesUI.addButton.text             = EditorSpawnsZombiesUI.localization.format("AddButtonText", new object[]
            {
                ControlsSettings.tool_0
            });
            EditorSpawnsZombiesUI.addButton.tooltip = EditorSpawnsZombiesUI.localization.format("AddButtonTooltip");
            SleekButton sleekButton5 = EditorSpawnsZombiesUI.addButton;

            if (EditorSpawnsZombiesUI.< > f__mg$cache13 == null)
            {
                EditorSpawnsZombiesUI.< > f__mg$cache13 = new ClickedButton(EditorSpawnsZombiesUI.onClickedAddButton);
            }
            sleekButton5.onClickedButton = EditorSpawnsZombiesUI.< > f__mg$cache13;
            EditorSpawnsZombiesUI.container.add(EditorSpawnsZombiesUI.addButton);
            EditorSpawnsZombiesUI.removeButton = new SleekButtonIcon((Texture2D)bundle.load("Remove"));
            EditorSpawnsZombiesUI.removeButton.positionOffset_Y = -30;
            EditorSpawnsZombiesUI.removeButton.positionScale_Y  = 1f;
            EditorSpawnsZombiesUI.removeButton.sizeOffset_X     = 200;
            EditorSpawnsZombiesUI.removeButton.sizeOffset_Y     = 30;
            EditorSpawnsZombiesUI.removeButton.text             = EditorSpawnsZombiesUI.localization.format("RemoveButtonText", new object[]
            {
                ControlsSettings.tool_1
            });
            EditorSpawnsZombiesUI.removeButton.tooltip = EditorSpawnsZombiesUI.localization.format("RemoveButtonTooltip");
            SleekButton sleekButton6 = EditorSpawnsZombiesUI.removeButton;

            if (EditorSpawnsZombiesUI.< > f__mg$cache14 == null)
            {
                EditorSpawnsZombiesUI.< > f__mg$cache14 = new ClickedButton(EditorSpawnsZombiesUI.onClickedRemoveButton);
            }
            sleekButton6.onClickedButton = EditorSpawnsZombiesUI.< > f__mg$cache14;
            EditorSpawnsZombiesUI.container.add(EditorSpawnsZombiesUI.removeButton);
            bundle.unload();
        }
 private void OnSpacePointMouseDown(Rectangle rect, SpacePoint<int> point, MouseButtonEventArgs e)
 {
     if (e.ChangedButton == MouseButton.Middle)
     {
         _manager.RemovePoint(point);
         DrawTree();
     }
     else if (e.ChangedButton == MouseButton.Left)
     {
         _dragged = new Dragged { Point = point, Rect = rect };
         return;
     }
     _dragged = null;
 }
        // Token: 0x0600355D RID: 13661 RVA: 0x00163FC4 File Offset: 0x001623C4
        public EditorSpawnsVehiclesUI()
        {
            Local  local  = Localization.read("/Editor/EditorSpawnsVehicles.dat");
            Bundle bundle = Bundles.getBundle("/Bundles/Textures/Edit/Icons/EditorSpawnsVehicles/EditorSpawnsVehicles.unity3d");

            EditorSpawnsVehiclesUI.container = new Sleek();
            EditorSpawnsVehiclesUI.container.positionOffset_X = 10;
            EditorSpawnsVehiclesUI.container.positionOffset_Y = 10;
            EditorSpawnsVehiclesUI.container.positionScale_X  = 1f;
            EditorSpawnsVehiclesUI.container.sizeOffset_X     = -20;
            EditorSpawnsVehiclesUI.container.sizeOffset_Y     = -20;
            EditorSpawnsVehiclesUI.container.sizeScale_X      = 1f;
            EditorSpawnsVehiclesUI.container.sizeScale_Y      = 1f;
            EditorUI.window.add(EditorSpawnsVehiclesUI.container);
            EditorSpawnsVehiclesUI.active         = false;
            EditorSpawnsVehiclesUI.tableScrollBox = new SleekScrollBox();
            EditorSpawnsVehiclesUI.tableScrollBox.positionOffset_X = -470;
            EditorSpawnsVehiclesUI.tableScrollBox.positionOffset_Y = 120;
            EditorSpawnsVehiclesUI.tableScrollBox.positionScale_X  = 1f;
            EditorSpawnsVehiclesUI.tableScrollBox.sizeOffset_X     = 470;
            EditorSpawnsVehiclesUI.tableScrollBox.sizeOffset_Y     = 200;
            EditorSpawnsVehiclesUI.container.add(EditorSpawnsVehiclesUI.tableScrollBox);
            EditorSpawnsVehiclesUI.tableNameField = new SleekField();
            EditorSpawnsVehiclesUI.tableNameField.positionOffset_X = -230;
            EditorSpawnsVehiclesUI.tableNameField.positionOffset_Y = 330;
            EditorSpawnsVehiclesUI.tableNameField.positionScale_X  = 1f;
            EditorSpawnsVehiclesUI.tableNameField.sizeOffset_X     = 230;
            EditorSpawnsVehiclesUI.tableNameField.sizeOffset_Y     = 30;
            EditorSpawnsVehiclesUI.tableNameField.maxLength        = 64;
            EditorSpawnsVehiclesUI.tableNameField.addLabel(local.format("TableNameFieldLabelText"), ESleekSide.LEFT);
            SleekField sleekField = EditorSpawnsVehiclesUI.tableNameField;
            Delegate   onTyped    = sleekField.onTyped;

            if (EditorSpawnsVehiclesUI.< > f__mg$cache4 == null)
            {
                EditorSpawnsVehiclesUI.< > f__mg$cache4 = new Typed(EditorSpawnsVehiclesUI.onTypedNameField);
            }
            sleekField.onTyped = (Typed)Delegate.Combine(onTyped, EditorSpawnsVehiclesUI.< > f__mg$cache4);
            EditorSpawnsVehiclesUI.container.add(EditorSpawnsVehiclesUI.tableNameField);
            EditorSpawnsVehiclesUI.addTableButton = new SleekButtonIcon((Texture2D)bundle.load("Add"));
            EditorSpawnsVehiclesUI.addTableButton.positionOffset_X = -230;
            EditorSpawnsVehiclesUI.addTableButton.positionOffset_Y = 370;
            EditorSpawnsVehiclesUI.addTableButton.positionScale_X  = 1f;
            EditorSpawnsVehiclesUI.addTableButton.sizeOffset_X     = 110;
            EditorSpawnsVehiclesUI.addTableButton.sizeOffset_Y     = 30;
            EditorSpawnsVehiclesUI.addTableButton.text             = local.format("AddTableButtonText");
            EditorSpawnsVehiclesUI.addTableButton.tooltip          = local.format("AddTableButtonTooltip");
            SleekButton sleekButton = EditorSpawnsVehiclesUI.addTableButton;

            if (EditorSpawnsVehiclesUI.< > f__mg$cache5 == null)
            {
                EditorSpawnsVehiclesUI.< > f__mg$cache5 = new ClickedButton(EditorSpawnsVehiclesUI.onClickedAddTableButton);
            }
            sleekButton.onClickedButton = EditorSpawnsVehiclesUI.< > f__mg$cache5;
            EditorSpawnsVehiclesUI.container.add(EditorSpawnsVehiclesUI.addTableButton);
            EditorSpawnsVehiclesUI.removeTableButton = new SleekButtonIcon((Texture2D)bundle.load("Remove"));
            EditorSpawnsVehiclesUI.removeTableButton.positionOffset_X = -110;
            EditorSpawnsVehiclesUI.removeTableButton.positionOffset_Y = 370;
            EditorSpawnsVehiclesUI.removeTableButton.positionScale_X  = 1f;
            EditorSpawnsVehiclesUI.removeTableButton.sizeOffset_X     = 110;
            EditorSpawnsVehiclesUI.removeTableButton.sizeOffset_Y     = 30;
            EditorSpawnsVehiclesUI.removeTableButton.text             = local.format("RemoveTableButtonText");
            EditorSpawnsVehiclesUI.removeTableButton.tooltip          = local.format("RemoveTableButtonTooltip");
            SleekButton sleekButton2 = EditorSpawnsVehiclesUI.removeTableButton;

            if (EditorSpawnsVehiclesUI.< > f__mg$cache6 == null)
            {
                EditorSpawnsVehiclesUI.< > f__mg$cache6 = new ClickedButton(EditorSpawnsVehiclesUI.onClickedRemoveTableButton);
            }
            sleekButton2.onClickedButton = EditorSpawnsVehiclesUI.< > f__mg$cache6;
            EditorSpawnsVehiclesUI.container.add(EditorSpawnsVehiclesUI.removeTableButton);
            EditorSpawnsVehiclesUI.updateTables();
            EditorSpawnsVehiclesUI.spawnsScrollBox = new SleekScrollBox();
            EditorSpawnsVehiclesUI.spawnsScrollBox.positionOffset_X = -470;
            EditorSpawnsVehiclesUI.spawnsScrollBox.positionOffset_Y = 410;
            EditorSpawnsVehiclesUI.spawnsScrollBox.positionScale_X  = 1f;
            EditorSpawnsVehiclesUI.spawnsScrollBox.sizeOffset_X     = 470;
            EditorSpawnsVehiclesUI.spawnsScrollBox.sizeOffset_Y     = -410;
            EditorSpawnsVehiclesUI.spawnsScrollBox.sizeScale_Y      = 1f;
            EditorSpawnsVehiclesUI.spawnsScrollBox.area             = new Rect(0f, 0f, 5f, 1000f);
            EditorSpawnsVehiclesUI.container.add(EditorSpawnsVehiclesUI.spawnsScrollBox);
            EditorSpawnsVehiclesUI.tableColorPicker = new SleekColorPicker();
            EditorSpawnsVehiclesUI.tableColorPicker.positionOffset_X = 200;
            SleekColorPicker sleekColorPicker = EditorSpawnsVehiclesUI.tableColorPicker;

            if (EditorSpawnsVehiclesUI.< > f__mg$cache7 == null)
            {
                EditorSpawnsVehiclesUI.< > f__mg$cache7 = new ColorPicked(EditorSpawnsVehiclesUI.onVehicleColorPicked);
            }
            sleekColorPicker.onColorPicked = EditorSpawnsVehiclesUI.< > f__mg$cache7;
            EditorSpawnsVehiclesUI.spawnsScrollBox.add(EditorSpawnsVehiclesUI.tableColorPicker);
            EditorSpawnsVehiclesUI.tableIDField = new SleekUInt16Field();
            EditorSpawnsVehiclesUI.tableIDField.positionOffset_X = 240;
            EditorSpawnsVehiclesUI.tableIDField.positionOffset_Y = 130;
            EditorSpawnsVehiclesUI.tableIDField.sizeOffset_X     = 200;
            EditorSpawnsVehiclesUI.tableIDField.sizeOffset_Y     = 30;
            SleekUInt16Field sleekUInt16Field = EditorSpawnsVehiclesUI.tableIDField;

            if (EditorSpawnsVehiclesUI.< > f__mg$cache8 == null)
            {
                EditorSpawnsVehiclesUI.< > f__mg$cache8 = new TypedUInt16(EditorSpawnsVehiclesUI.onTableIDFieldTyped);
            }
            sleekUInt16Field.onTypedUInt16 = EditorSpawnsVehiclesUI.< > f__mg$cache8;
            EditorSpawnsVehiclesUI.tableIDField.addLabel(local.format("TableIDFieldLabelText"), ESleekSide.LEFT);
            EditorSpawnsVehiclesUI.spawnsScrollBox.add(EditorSpawnsVehiclesUI.tableIDField);
            EditorSpawnsVehiclesUI.tierNameField = new SleekField();
            EditorSpawnsVehiclesUI.tierNameField.positionOffset_X = 240;
            EditorSpawnsVehiclesUI.tierNameField.sizeOffset_X     = 200;
            EditorSpawnsVehiclesUI.tierNameField.sizeOffset_Y     = 30;
            EditorSpawnsVehiclesUI.tierNameField.maxLength        = 64;
            EditorSpawnsVehiclesUI.tierNameField.addLabel(local.format("TierNameFieldLabelText"), ESleekSide.LEFT);
            SleekField sleekField2 = EditorSpawnsVehiclesUI.tierNameField;

            if (EditorSpawnsVehiclesUI.< > f__mg$cache9 == null)
            {
                EditorSpawnsVehiclesUI.< > f__mg$cache9 = new Typed(EditorSpawnsVehiclesUI.onTypedTierNameField);
            }
            sleekField2.onTyped = EditorSpawnsVehiclesUI.< > f__mg$cache9;
            EditorSpawnsVehiclesUI.spawnsScrollBox.add(EditorSpawnsVehiclesUI.tierNameField);
            EditorSpawnsVehiclesUI.addTierButton = new SleekButtonIcon((Texture2D)bundle.load("Add"));
            EditorSpawnsVehiclesUI.addTierButton.positionOffset_X = 240;
            EditorSpawnsVehiclesUI.addTierButton.sizeOffset_X     = 95;
            EditorSpawnsVehiclesUI.addTierButton.sizeOffset_Y     = 30;
            EditorSpawnsVehiclesUI.addTierButton.text             = local.format("AddTierButtonText");
            EditorSpawnsVehiclesUI.addTierButton.tooltip          = local.format("AddTierButtonTooltip");
            SleekButton sleekButton3 = EditorSpawnsVehiclesUI.addTierButton;

            if (EditorSpawnsVehiclesUI.< > f__mg$cacheA == null)
            {
                EditorSpawnsVehiclesUI.< > f__mg$cacheA = new ClickedButton(EditorSpawnsVehiclesUI.onClickedAddTierButton);
            }
            sleekButton3.onClickedButton = EditorSpawnsVehiclesUI.< > f__mg$cacheA;
            EditorSpawnsVehiclesUI.spawnsScrollBox.add(EditorSpawnsVehiclesUI.addTierButton);
            EditorSpawnsVehiclesUI.removeTierButton = new SleekButtonIcon((Texture2D)bundle.load("Remove"));
            EditorSpawnsVehiclesUI.removeTierButton.positionOffset_X = 345;
            EditorSpawnsVehiclesUI.removeTierButton.sizeOffset_X     = 95;
            EditorSpawnsVehiclesUI.removeTierButton.sizeOffset_Y     = 30;
            EditorSpawnsVehiclesUI.removeTierButton.text             = local.format("RemoveTierButtonText");
            EditorSpawnsVehiclesUI.removeTierButton.tooltip          = local.format("RemoveTierButtonTooltip");
            SleekButton sleekButton4 = EditorSpawnsVehiclesUI.removeTierButton;

            if (EditorSpawnsVehiclesUI.< > f__mg$cacheB == null)
            {
                EditorSpawnsVehiclesUI.< > f__mg$cacheB = new ClickedButton(EditorSpawnsVehiclesUI.onClickedRemoveTierButton);
            }
            sleekButton4.onClickedButton = EditorSpawnsVehiclesUI.< > f__mg$cacheB;
            EditorSpawnsVehiclesUI.spawnsScrollBox.add(EditorSpawnsVehiclesUI.removeTierButton);
            EditorSpawnsVehiclesUI.vehicleIDField = new SleekUInt16Field();
            EditorSpawnsVehiclesUI.vehicleIDField.positionOffset_X = 240;
            EditorSpawnsVehiclesUI.vehicleIDField.sizeOffset_X     = 200;
            EditorSpawnsVehiclesUI.vehicleIDField.sizeOffset_Y     = 30;
            EditorSpawnsVehiclesUI.vehicleIDField.addLabel(local.format("VehicleIDFieldLabelText"), ESleekSide.LEFT);
            EditorSpawnsVehiclesUI.spawnsScrollBox.add(EditorSpawnsVehiclesUI.vehicleIDField);
            EditorSpawnsVehiclesUI.addVehicleButton = new SleekButtonIcon((Texture2D)bundle.load("Add"));
            EditorSpawnsVehiclesUI.addVehicleButton.positionOffset_X = 240;
            EditorSpawnsVehiclesUI.addVehicleButton.sizeOffset_X     = 95;
            EditorSpawnsVehiclesUI.addVehicleButton.sizeOffset_Y     = 30;
            EditorSpawnsVehiclesUI.addVehicleButton.text             = local.format("AddVehicleButtonText");
            EditorSpawnsVehiclesUI.addVehicleButton.tooltip          = local.format("AddVehicleButtonTooltip");
            SleekButton sleekButton5 = EditorSpawnsVehiclesUI.addVehicleButton;

            if (EditorSpawnsVehiclesUI.< > f__mg$cacheC == null)
            {
                EditorSpawnsVehiclesUI.< > f__mg$cacheC = new ClickedButton(EditorSpawnsVehiclesUI.onClickedAddVehicleButton);
            }
            sleekButton5.onClickedButton = EditorSpawnsVehiclesUI.< > f__mg$cacheC;
            EditorSpawnsVehiclesUI.spawnsScrollBox.add(EditorSpawnsVehiclesUI.addVehicleButton);
            EditorSpawnsVehiclesUI.removeVehicleButton = new SleekButtonIcon((Texture2D)bundle.load("Remove"));
            EditorSpawnsVehiclesUI.removeVehicleButton.positionOffset_X = 345;
            EditorSpawnsVehiclesUI.removeVehicleButton.sizeOffset_X     = 95;
            EditorSpawnsVehiclesUI.removeVehicleButton.sizeOffset_Y     = 30;
            EditorSpawnsVehiclesUI.removeVehicleButton.text             = local.format("RemoveVehicleButtonText");
            EditorSpawnsVehiclesUI.removeVehicleButton.tooltip          = local.format("RemoveVehicleButtonTooltip");
            SleekButton sleekButton6 = EditorSpawnsVehiclesUI.removeVehicleButton;

            if (EditorSpawnsVehiclesUI.< > f__mg$cacheD == null)
            {
                EditorSpawnsVehiclesUI.< > f__mg$cacheD = new ClickedButton(EditorSpawnsVehiclesUI.onClickedRemoveVehicleButton);
            }
            sleekButton6.onClickedButton = EditorSpawnsVehiclesUI.< > f__mg$cacheD;
            EditorSpawnsVehiclesUI.spawnsScrollBox.add(EditorSpawnsVehiclesUI.removeVehicleButton);
            EditorSpawnsVehiclesUI.selectedBox = new SleekBox();
            EditorSpawnsVehiclesUI.selectedBox.positionOffset_X = -230;
            EditorSpawnsVehiclesUI.selectedBox.positionOffset_Y = 80;
            EditorSpawnsVehiclesUI.selectedBox.positionScale_X  = 1f;
            EditorSpawnsVehiclesUI.selectedBox.sizeOffset_X     = 230;
            EditorSpawnsVehiclesUI.selectedBox.sizeOffset_Y     = 30;
            EditorSpawnsVehiclesUI.selectedBox.addLabel(local.format("SelectionBoxLabelText"), ESleekSide.LEFT);
            EditorSpawnsVehiclesUI.container.add(EditorSpawnsVehiclesUI.selectedBox);
            EditorSpawnsVehiclesUI.updateSelection();
            EditorSpawnsVehiclesUI.radiusSlider = new SleekSlider();
            EditorSpawnsVehiclesUI.radiusSlider.positionOffset_Y = -130;
            EditorSpawnsVehiclesUI.radiusSlider.positionScale_Y  = 1f;
            EditorSpawnsVehiclesUI.radiusSlider.sizeOffset_X     = 200;
            EditorSpawnsVehiclesUI.radiusSlider.sizeOffset_Y     = 20;
            EditorSpawnsVehiclesUI.radiusSlider.state            = (float)(EditorSpawns.radius - EditorSpawns.MIN_REMOVE_SIZE) / (float)EditorSpawns.MAX_REMOVE_SIZE;
            EditorSpawnsVehiclesUI.radiusSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorSpawnsVehiclesUI.radiusSlider.addLabel(local.format("RadiusSliderLabelText"), ESleekSide.RIGHT);
            SleekSlider sleekSlider = EditorSpawnsVehiclesUI.radiusSlider;

            if (EditorSpawnsVehiclesUI.< > f__mg$cacheE == null)
            {
                EditorSpawnsVehiclesUI.< > f__mg$cacheE = new Dragged(EditorSpawnsVehiclesUI.onDraggedRadiusSlider);
            }
            sleekSlider.onDragged = EditorSpawnsVehiclesUI.< > f__mg$cacheE;
            EditorSpawnsVehiclesUI.container.add(EditorSpawnsVehiclesUI.radiusSlider);
            EditorSpawnsVehiclesUI.rotationSlider = new SleekSlider();
            EditorSpawnsVehiclesUI.rotationSlider.positionOffset_Y = -100;
            EditorSpawnsVehiclesUI.rotationSlider.positionScale_Y  = 1f;
            EditorSpawnsVehiclesUI.rotationSlider.sizeOffset_X     = 200;
            EditorSpawnsVehiclesUI.rotationSlider.sizeOffset_Y     = 20;
            EditorSpawnsVehiclesUI.rotationSlider.state            = EditorSpawns.rotation / 360f;
            EditorSpawnsVehiclesUI.rotationSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorSpawnsVehiclesUI.rotationSlider.addLabel(local.format("RotationSliderLabelText"), ESleekSide.RIGHT);
            SleekSlider sleekSlider2 = EditorSpawnsVehiclesUI.rotationSlider;

            if (EditorSpawnsVehiclesUI.< > f__mg$cacheF == null)
            {
                EditorSpawnsVehiclesUI.< > f__mg$cacheF = new Dragged(EditorSpawnsVehiclesUI.onDraggedRotationSlider);
            }
            sleekSlider2.onDragged = EditorSpawnsVehiclesUI.< > f__mg$cacheF;
            EditorSpawnsVehiclesUI.container.add(EditorSpawnsVehiclesUI.rotationSlider);
            EditorSpawnsVehiclesUI.addButton = new SleekButtonIcon((Texture2D)bundle.load("Add"));
            EditorSpawnsVehiclesUI.addButton.positionOffset_Y = -70;
            EditorSpawnsVehiclesUI.addButton.positionScale_Y  = 1f;
            EditorSpawnsVehiclesUI.addButton.sizeOffset_X     = 200;
            EditorSpawnsVehiclesUI.addButton.sizeOffset_Y     = 30;
            EditorSpawnsVehiclesUI.addButton.text             = local.format("AddButtonText", new object[]
            {
                ControlsSettings.tool_0
            });
            EditorSpawnsVehiclesUI.addButton.tooltip = local.format("AddButtonTooltip");
            SleekButton sleekButton7 = EditorSpawnsVehiclesUI.addButton;

            if (EditorSpawnsVehiclesUI.< > f__mg$cache10 == null)
            {
                EditorSpawnsVehiclesUI.< > f__mg$cache10 = new ClickedButton(EditorSpawnsVehiclesUI.onClickedAddButton);
            }
            sleekButton7.onClickedButton = EditorSpawnsVehiclesUI.< > f__mg$cache10;
            EditorSpawnsVehiclesUI.container.add(EditorSpawnsVehiclesUI.addButton);
            EditorSpawnsVehiclesUI.removeButton = new SleekButtonIcon((Texture2D)bundle.load("Remove"));
            EditorSpawnsVehiclesUI.removeButton.positionOffset_Y = -30;
            EditorSpawnsVehiclesUI.removeButton.positionScale_Y  = 1f;
            EditorSpawnsVehiclesUI.removeButton.sizeOffset_X     = 200;
            EditorSpawnsVehiclesUI.removeButton.sizeOffset_Y     = 30;
            EditorSpawnsVehiclesUI.removeButton.text             = local.format("RemoveButtonText", new object[]
            {
                ControlsSettings.tool_1
            });
            EditorSpawnsVehiclesUI.removeButton.tooltip = local.format("RemoveButtonTooltip");
            SleekButton sleekButton8 = EditorSpawnsVehiclesUI.removeButton;

            if (EditorSpawnsVehiclesUI.< > f__mg$cache11 == null)
            {
                EditorSpawnsVehiclesUI.< > f__mg$cache11 = new ClickedButton(EditorSpawnsVehiclesUI.onClickedRemoveButton);
            }
            sleekButton8.onClickedButton = EditorSpawnsVehiclesUI.< > f__mg$cache11;
            EditorSpawnsVehiclesUI.container.add(EditorSpawnsVehiclesUI.removeButton);
            bundle.unload();
        }
Example #19
0
        public MenuSurvivorsClothingUI()
        {
            MenuSurvivorsClothingUI.localization = Localization.read("/Menu/Survivors/MenuSurvivorsClothing.dat");
            if (MenuSurvivorsClothingUI.icons != null)
            {
                MenuSurvivorsClothingUI.icons.unload();
                MenuSurvivorsClothingUI.icons = null;
            }
            MenuSurvivorsClothingUI.icons     = Bundles.getBundle("/Bundles/Textures/Menu/Icons/Survivors/MenuSurvivorsClothing/MenuSurvivorsClothing.unity3d");
            MenuSurvivorsClothingUI.container = new Sleek();
            MenuSurvivorsClothingUI.container.positionOffset_X = 10;
            MenuSurvivorsClothingUI.container.positionOffset_Y = 10;
            MenuSurvivorsClothingUI.container.positionScale_Y  = 1f;
            MenuSurvivorsClothingUI.container.sizeOffset_X     = -20;
            MenuSurvivorsClothingUI.container.sizeOffset_Y     = -20;
            MenuSurvivorsClothingUI.container.sizeScale_X      = 1f;
            MenuSurvivorsClothingUI.container.sizeScale_Y      = 1f;
            MenuUI.container.add(MenuSurvivorsClothingUI.container);
            MenuSurvivorsClothingUI.active    = false;
            MenuSurvivorsClothingUI.page      = 0;
            MenuSurvivorsClothingUI.inventory = new Sleek();
            MenuSurvivorsClothingUI.inventory.positionOffset_Y = 40;
            MenuSurvivorsClothingUI.inventory.positionScale_X  = 0.5f;
            MenuSurvivorsClothingUI.inventory.sizeScale_X      = 0.5f;
            MenuSurvivorsClothingUI.inventory.sizeScale_Y      = 1f;
            MenuSurvivorsClothingUI.inventory.sizeOffset_Y     = -80;
            MenuSurvivorsClothingUI.inventory.constraint       = ESleekConstraint.XY;
            MenuSurvivorsClothingUI.container.add(MenuSurvivorsClothingUI.inventory);
            MenuSurvivorsClothingUI.packageButtons = new SleekInventory[25];
            for (int i = 0; i < MenuSurvivorsClothingUI.packageButtons.Length; i++)
            {
                SleekInventory sleekInventory = new SleekInventory();
                sleekInventory.positionOffset_X = 5;
                sleekInventory.positionOffset_Y = 5;
                sleekInventory.positionScale_X  = (float)(i % 5) * 0.2f;
                sleekInventory.positionScale_Y  = (float)Mathf.FloorToInt((float)i / 5f) * 0.2f;
                sleekInventory.sizeOffset_X     = -10;
                sleekInventory.sizeOffset_Y     = -10;
                sleekInventory.sizeScale_X      = 0.2f;
                sleekInventory.sizeScale_Y      = 0.2f;
                SleekInventory sleekInventory2 = sleekInventory;
                if (MenuSurvivorsClothingUI.< > f__mg$cache0 == null)
                {
                    MenuSurvivorsClothingUI.< > f__mg$cache0 = new ClickedInventory(MenuSurvivorsClothingUI.onClickedInventory);
                }
                sleekInventory2.onClickedInventory = MenuSurvivorsClothingUI.< > f__mg$cache0;
                MenuSurvivorsClothingUI.inventory.add(sleekInventory);
                MenuSurvivorsClothingUI.packageButtons[i] = sleekInventory;
            }
            MenuSurvivorsClothingUI.searchField = new SleekField();
            MenuSurvivorsClothingUI.searchField.positionOffset_X = 5;
            MenuSurvivorsClothingUI.searchField.positionOffset_Y = -35;
            MenuSurvivorsClothingUI.searchField.sizeOffset_X     = -120;
            MenuSurvivorsClothingUI.searchField.sizeOffset_Y     = 30;
            MenuSurvivorsClothingUI.searchField.sizeScale_X      = 1f;
            MenuSurvivorsClothingUI.searchField.hint             = MenuSurvivorsClothingUI.localization.format("Search_Field_Hint");
            MenuSurvivorsClothingUI.searchField.control          = "Search";
            SleekField sleekField = MenuSurvivorsClothingUI.searchField;
            Delegate   onEntered  = sleekField.onEntered;

            if (MenuSurvivorsClothingUI.< > f__mg$cache1 == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cache1 = new Entered(MenuSurvivorsClothingUI.onEnteredSearchField);
            }
            sleekField.onEntered = (Entered)Delegate.Combine(onEntered, MenuSurvivorsClothingUI.< > f__mg$cache1);
            MenuSurvivorsClothingUI.inventory.add(MenuSurvivorsClothingUI.searchField);
            MenuSurvivorsClothingUI.searchButton = new SleekButton();
            MenuSurvivorsClothingUI.searchButton.positionOffset_X = -105;
            MenuSurvivorsClothingUI.searchButton.positionOffset_Y = -35;
            MenuSurvivorsClothingUI.searchButton.positionScale_X  = 1f;
            MenuSurvivorsClothingUI.searchButton.sizeOffset_X     = 100;
            MenuSurvivorsClothingUI.searchButton.sizeOffset_Y     = 30;
            MenuSurvivorsClothingUI.searchButton.text             = MenuSurvivorsClothingUI.localization.format("Search");
            MenuSurvivorsClothingUI.searchButton.tooltip          = MenuSurvivorsClothingUI.localization.format("Search_Tooltip");
            SleekButton sleekButton = MenuSurvivorsClothingUI.searchButton;

            if (MenuSurvivorsClothingUI.< > f__mg$cache2 == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cache2 = new ClickedButton(MenuSurvivorsClothingUI.onClickedSearchButton);
            }
            sleekButton.onClickedButton = MenuSurvivorsClothingUI.< > f__mg$cache2;
            MenuSurvivorsClothingUI.inventory.add(MenuSurvivorsClothingUI.searchButton);
            MenuSurvivorsClothingUI.pageBox = new SleekBox();
            MenuSurvivorsClothingUI.pageBox.positionOffset_X = -145;
            MenuSurvivorsClothingUI.pageBox.positionOffset_Y = 5;
            MenuSurvivorsClothingUI.pageBox.positionScale_X  = 1f;
            MenuSurvivorsClothingUI.pageBox.positionScale_Y  = 1f;
            MenuSurvivorsClothingUI.pageBox.sizeOffset_X     = 100;
            MenuSurvivorsClothingUI.pageBox.sizeOffset_Y     = 30;
            MenuSurvivorsClothingUI.pageBox.fontSize         = 14;
            MenuSurvivorsClothingUI.inventory.add(MenuSurvivorsClothingUI.pageBox);
            MenuSurvivorsClothingUI.infoBox = new SleekBox();
            MenuSurvivorsClothingUI.infoBox.positionOffset_X = 5;
            MenuSurvivorsClothingUI.infoBox.positionOffset_Y = -25;
            MenuSurvivorsClothingUI.infoBox.positionScale_Y  = 0.5f;
            MenuSurvivorsClothingUI.infoBox.sizeScale_X      = 1f;
            MenuSurvivorsClothingUI.infoBox.sizeOffset_X     = -10;
            MenuSurvivorsClothingUI.infoBox.sizeOffset_Y     = 50;
            MenuSurvivorsClothingUI.infoBox.text             = MenuSurvivorsClothingUI.localization.format("No_Items");
            MenuSurvivorsClothingUI.infoBox.fontSize         = 14;
            MenuSurvivorsClothingUI.inventory.add(MenuSurvivorsClothingUI.infoBox);
            MenuSurvivorsClothingUI.infoBox.isVisible                   = !Provider.provider.economyService.isInventoryAvailable;
            MenuSurvivorsClothingUI.leftButton                          = new SleekButtonIcon((Texture2D)MenuSurvivorsClothingUI.icons.load("Left"));
            MenuSurvivorsClothingUI.leftButton.positionOffset_X         = -185;
            MenuSurvivorsClothingUI.leftButton.positionOffset_Y         = 5;
            MenuSurvivorsClothingUI.leftButton.positionScale_X          = 1f;
            MenuSurvivorsClothingUI.leftButton.positionScale_Y          = 1f;
            MenuSurvivorsClothingUI.leftButton.sizeOffset_X             = 30;
            MenuSurvivorsClothingUI.leftButton.sizeOffset_Y             = 30;
            MenuSurvivorsClothingUI.leftButton.tooltip                  = MenuSurvivorsClothingUI.localization.format("Left_Tooltip");
            MenuSurvivorsClothingUI.leftButton.iconImage.backgroundTint = ESleekTint.FOREGROUND;
            SleekButton sleekButton2 = MenuSurvivorsClothingUI.leftButton;

            if (MenuSurvivorsClothingUI.< > f__mg$cache3 == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cache3 = new ClickedButton(MenuSurvivorsClothingUI.onClickedLeftButton);
            }
            sleekButton2.onClickedButton = MenuSurvivorsClothingUI.< > f__mg$cache3;
            MenuSurvivorsClothingUI.inventory.add(MenuSurvivorsClothingUI.leftButton);
            MenuSurvivorsClothingUI.rightButton = new SleekButtonIcon((Texture2D)MenuSurvivorsClothingUI.icons.load("Right"));
            MenuSurvivorsClothingUI.rightButton.positionOffset_X         = -35;
            MenuSurvivorsClothingUI.rightButton.positionOffset_Y         = 5;
            MenuSurvivorsClothingUI.rightButton.positionScale_X          = 1f;
            MenuSurvivorsClothingUI.rightButton.positionScale_Y          = 1f;
            MenuSurvivorsClothingUI.rightButton.sizeOffset_X             = 30;
            MenuSurvivorsClothingUI.rightButton.sizeOffset_Y             = 30;
            MenuSurvivorsClothingUI.rightButton.tooltip                  = MenuSurvivorsClothingUI.localization.format("Right_Tooltip");
            MenuSurvivorsClothingUI.rightButton.iconImage.backgroundTint = ESleekTint.FOREGROUND;
            SleekButton sleekButton3 = MenuSurvivorsClothingUI.rightButton;

            if (MenuSurvivorsClothingUI.< > f__mg$cache4 == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cache4 = new ClickedButton(MenuSurvivorsClothingUI.onClickedRightButton);
            }
            sleekButton3.onClickedButton = MenuSurvivorsClothingUI.< > f__mg$cache4;
            MenuSurvivorsClothingUI.inventory.add(MenuSurvivorsClothingUI.rightButton);
            MenuSurvivorsClothingUI.refreshButton = new SleekButtonIcon((Texture2D)MenuSurvivorsClothingUI.icons.load("Refresh"));
            MenuSurvivorsClothingUI.refreshButton.positionOffset_X         = 5;
            MenuSurvivorsClothingUI.refreshButton.positionOffset_Y         = 5;
            MenuSurvivorsClothingUI.refreshButton.positionScale_Y          = 1f;
            MenuSurvivorsClothingUI.refreshButton.sizeOffset_X             = 30;
            MenuSurvivorsClothingUI.refreshButton.sizeOffset_Y             = 30;
            MenuSurvivorsClothingUI.refreshButton.tooltip                  = MenuSurvivorsClothingUI.localization.format("Refresh_Tooltip");
            MenuSurvivorsClothingUI.refreshButton.iconImage.backgroundTint = ESleekTint.FOREGROUND;
            SleekButton sleekButton4 = MenuSurvivorsClothingUI.refreshButton;

            if (MenuSurvivorsClothingUI.< > f__mg$cache5 == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cache5 = new ClickedButton(MenuSurvivorsClothingUI.onClickedRefreshButton);
            }
            sleekButton4.onClickedButton = MenuSurvivorsClothingUI.< > f__mg$cache5;
            MenuSurvivorsClothingUI.inventory.add(MenuSurvivorsClothingUI.refreshButton);
            MenuSurvivorsClothingUI.characterSlider = new SleekSlider();
            MenuSurvivorsClothingUI.characterSlider.positionOffset_X = 45;
            MenuSurvivorsClothingUI.characterSlider.positionOffset_Y = 10;
            MenuSurvivorsClothingUI.characterSlider.positionScale_Y  = 1f;
            MenuSurvivorsClothingUI.characterSlider.sizeOffset_X     = -240;
            MenuSurvivorsClothingUI.characterSlider.sizeOffset_Y     = 20;
            MenuSurvivorsClothingUI.characterSlider.sizeScale_X      = 1f;
            MenuSurvivorsClothingUI.characterSlider.orientation      = ESleekOrientation.HORIZONTAL;
            SleekSlider sleekSlider = MenuSurvivorsClothingUI.characterSlider;

            if (MenuSurvivorsClothingUI.< > f__mg$cache6 == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cache6 = new Dragged(MenuSurvivorsClothingUI.onDraggedCharacterSlider);
            }
            sleekSlider.onDragged = MenuSurvivorsClothingUI.< > f__mg$cache6;
            MenuSurvivorsClothingUI.inventory.add(MenuSurvivorsClothingUI.characterSlider);
            MenuSurvivorsClothingUI.backButton = new SleekButtonIcon((Texture2D)MenuDashboardUI.icons.load("Exit"));
            MenuSurvivorsClothingUI.backButton.positionOffset_Y = -50;
            MenuSurvivorsClothingUI.backButton.positionScale_Y  = 1f;
            MenuSurvivorsClothingUI.backButton.sizeOffset_X     = 200;
            MenuSurvivorsClothingUI.backButton.sizeOffset_Y     = 50;
            MenuSurvivorsClothingUI.backButton.text             = MenuDashboardUI.localization.format("BackButtonText");
            MenuSurvivorsClothingUI.backButton.tooltip          = MenuDashboardUI.localization.format("BackButtonTooltip");
            SleekButton sleekButton5 = MenuSurvivorsClothingUI.backButton;

            if (MenuSurvivorsClothingUI.< > f__mg$cache7 == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cache7 = new ClickedButton(MenuSurvivorsClothingUI.onClickedBackButton);
            }
            sleekButton5.onClickedButton = MenuSurvivorsClothingUI.< > f__mg$cache7;
            MenuSurvivorsClothingUI.backButton.fontSize = 14;
            MenuSurvivorsClothingUI.backButton.iconImage.backgroundTint = ESleekTint.FOREGROUND;
            MenuSurvivorsClothingUI.container.add(MenuSurvivorsClothingUI.backButton);
            MenuSurvivorsClothingUI.itemstoreButton = new SleekButton();
            MenuSurvivorsClothingUI.itemstoreButton.positionOffset_Y = -110;
            MenuSurvivorsClothingUI.itemstoreButton.positionScale_Y  = 1f;
            MenuSurvivorsClothingUI.itemstoreButton.sizeOffset_X     = 200;
            MenuSurvivorsClothingUI.itemstoreButton.sizeOffset_Y     = 50;
            MenuSurvivorsClothingUI.itemstoreButton.text             = MenuSurvivorsClothingUI.localization.format("Itemstore");
            MenuSurvivorsClothingUI.itemstoreButton.tooltip          = MenuSurvivorsClothingUI.localization.format("Itemstore_Tooltip");
            SleekButton sleekButton6 = MenuSurvivorsClothingUI.itemstoreButton;

            if (MenuSurvivorsClothingUI.< > f__mg$cache8 == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cache8 = new ClickedButton(MenuSurvivorsClothingUI.onClickedItemstoreButton);
            }
            sleekButton6.onClickedButton = MenuSurvivorsClothingUI.< > f__mg$cache8;
            MenuSurvivorsClothingUI.itemstoreButton.fontSize = 14;
            MenuSurvivorsClothingUI.container.add(MenuSurvivorsClothingUI.itemstoreButton);
            if (Provider.statusData.Stockpile.Has_New_Items)
            {
                SleekNew sleek = new SleekNew(false);
                MenuSurvivorsClothingUI.itemstoreButton.add(sleek);
            }
            if (Provider.statusData.Stockpile.Featured_Item != 0)
            {
                MenuSurvivorsClothingUI.featuredButton = new SleekButton();
                MenuSurvivorsClothingUI.featuredButton.positionOffset_Y = -170;
                MenuSurvivorsClothingUI.featuredButton.positionScale_Y  = 1f;
                MenuSurvivorsClothingUI.featuredButton.sizeOffset_X     = 200;
                MenuSurvivorsClothingUI.featuredButton.sizeOffset_Y     = 50;
                MenuSurvivorsClothingUI.featuredButton.text             = Provider.provider.economyService.getInventoryName(Provider.statusData.Stockpile.Featured_Item);
                MenuSurvivorsClothingUI.featuredButton.tooltip          = MenuSurvivorsClothingUI.localization.format("Featured_Tooltip");
                SleekButton sleekButton7 = MenuSurvivorsClothingUI.featuredButton;
                if (MenuSurvivorsClothingUI.< > f__mg$cache9 == null)
                {
                    MenuSurvivorsClothingUI.< > f__mg$cache9 = new ClickedButton(MenuSurvivorsClothingUI.onClickedFeaturedButton);
                }
                sleekButton7.onClickedButton = MenuSurvivorsClothingUI.< > f__mg$cache9;
                MenuSurvivorsClothingUI.featuredButton.foregroundTint  = ESleekTint.NONE;
                MenuSurvivorsClothingUI.featuredButton.foregroundColor = Provider.provider.economyService.getInventoryColor(Provider.statusData.Stockpile.Featured_Item);
                MenuSurvivorsClothingUI.featuredButton.fontSize        = 14;
                MenuSurvivorsClothingUI.container.add(MenuSurvivorsClothingUI.featuredButton);
                SleekNew sleek2 = new SleekNew(false);
                MenuSurvivorsClothingUI.featuredButton.add(sleek2);
            }
            if (!MenuSurvivorsClothingUI.hasLoaded)
            {
                TempSteamworksEconomy economyService = Provider.provider.economyService;
                Delegate onInventoryRefreshed        = economyService.onInventoryRefreshed;
                if (MenuSurvivorsClothingUI.< > f__mg$cacheA == null)
                {
                    MenuSurvivorsClothingUI.< > f__mg$cacheA = new TempSteamworksEconomy.InventoryRefreshed(MenuSurvivorsClothingUI.onInventoryRefreshed);
                }
                economyService.onInventoryRefreshed = (TempSteamworksEconomy.InventoryRefreshed)Delegate.Combine(onInventoryRefreshed, MenuSurvivorsClothingUI.< > f__mg$cacheA);
                TempSteamworksEconomy economyService2 = Provider.provider.economyService;
                Delegate onInventoryDropped           = economyService2.onInventoryDropped;
                if (MenuSurvivorsClothingUI.< > f__mg$cacheB == null)
                {
                    MenuSurvivorsClothingUI.< > f__mg$cacheB = new TempSteamworksEconomy.InventoryDropped(MenuSurvivorsClothingUI.onInventoryDropped);
                }
                economyService2.onInventoryDropped = (TempSteamworksEconomy.InventoryDropped)Delegate.Combine(onInventoryDropped, MenuSurvivorsClothingUI.< > f__mg$cacheB);
            }
            Delegate onCharacterUpdated = Characters.onCharacterUpdated;

            if (MenuSurvivorsClothingUI.< > f__mg$cacheC == null)
            {
                MenuSurvivorsClothingUI.< > f__mg$cacheC = new CharacterUpdated(MenuSurvivorsClothingUI.onCharacterUpdated);
            }
            Characters.onCharacterUpdated     = (CharacterUpdated)Delegate.Combine(onCharacterUpdated, MenuSurvivorsClothingUI.< > f__mg$cacheC);
            MenuSurvivorsClothingUI.hasLoaded = true;
            MenuSurvivorsClothingUI.updateFilter();
            MenuSurvivorsClothingUI.updatePage();
            new MenuSurvivorsClothingItemUI();
            new MenuSurvivorsClothingInspectUI();
            new MenuSurvivorsClothingDeleteUI();
            new MenuSurvivorsClothingBoxUI();
        }
        // Token: 0x060035C5 RID: 13765 RVA: 0x00169D8C File Offset: 0x0016818C
        public EditorTerrainResourcesUI()
        {
            Local  local  = Localization.read("/Editor/EditorTerrainResources.dat");
            Bundle bundle = Bundles.getBundle("/Bundles/Textures/Edit/Icons/EditorTerrainResources/EditorTerrainResources.unity3d");

            EditorTerrainResourcesUI.container = new Sleek();
            EditorTerrainResourcesUI.container.positionOffset_X = 10;
            EditorTerrainResourcesUI.container.positionOffset_Y = 10;
            EditorTerrainResourcesUI.container.positionScale_X  = 1f;
            EditorTerrainResourcesUI.container.sizeOffset_X     = -20;
            EditorTerrainResourcesUI.container.sizeOffset_Y     = -20;
            EditorTerrainResourcesUI.container.sizeScale_X      = 1f;
            EditorTerrainResourcesUI.container.sizeScale_Y      = 1f;
            EditorUI.window.add(EditorTerrainResourcesUI.container);
            EditorTerrainResourcesUI.active             = false;
            EditorTerrainResourcesUI.resourcesScrollBox = new SleekScrollBox();
            EditorTerrainResourcesUI.resourcesScrollBox.positionOffset_Y = 120;
            EditorTerrainResourcesUI.resourcesScrollBox.positionOffset_X = -400;
            EditorTerrainResourcesUI.resourcesScrollBox.positionScale_X  = 1f;
            EditorTerrainResourcesUI.resourcesScrollBox.sizeOffset_X     = 400;
            EditorTerrainResourcesUI.resourcesScrollBox.sizeOffset_Y     = -240;
            EditorTerrainResourcesUI.resourcesScrollBox.sizeScale_Y      = 1f;
            EditorTerrainResourcesUI.resourcesScrollBox.area             = new Rect(0f, 0f, 5f, (float)(LevelGround.resources.Length * 40 + 400));
            EditorTerrainResourcesUI.container.add(EditorTerrainResourcesUI.resourcesScrollBox);
            for (int i = 0; i < LevelGround.resources.Length; i++)
            {
                ResourceAsset resourceAsset = (ResourceAsset)Assets.find(EAssetType.RESOURCE, LevelGround.resources[i].id);
                SleekButton   sleekButton   = new SleekButton();
                sleekButton.positionOffset_X = 200;
                sleekButton.positionOffset_Y = i * 40;
                sleekButton.sizeOffset_X     = 170;
                sleekButton.sizeOffset_Y     = 30;
                if (resourceAsset != null)
                {
                    sleekButton.text = resourceAsset.resourceName;
                }
                SleekButton sleekButton2 = sleekButton;
                if (EditorTerrainResourcesUI.< > f__mg$cache0 == null)
                {
                    EditorTerrainResourcesUI.< > f__mg$cache0 = new ClickedButton(EditorTerrainResourcesUI.onClickedResourceButton);
                }
                sleekButton2.onClickedButton = EditorTerrainResourcesUI.< > f__mg$cache0;
                EditorTerrainResourcesUI.resourcesScrollBox.add(sleekButton);
            }
            EditorTerrainResourcesUI.densitySlider = new SleekSlider();
            EditorTerrainResourcesUI.densitySlider.positionOffset_X = 200;
            EditorTerrainResourcesUI.densitySlider.positionOffset_Y = LevelGround.resources.Length * 40;
            EditorTerrainResourcesUI.densitySlider.sizeOffset_X     = 170;
            EditorTerrainResourcesUI.densitySlider.sizeOffset_Y     = 20;
            EditorTerrainResourcesUI.densitySlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorTerrainResourcesUI.densitySlider.addLabel(local.format("DensitySliderLabelText"), ESleekSide.LEFT);
            SleekSlider sleekSlider = EditorTerrainResourcesUI.densitySlider;

            if (EditorTerrainResourcesUI.< > f__mg$cache1 == null)
            {
                EditorTerrainResourcesUI.< > f__mg$cache1 = new Dragged(EditorTerrainResourcesUI.onDraggedDensitySlider);
            }
            sleekSlider.onDragged = EditorTerrainResourcesUI.< > f__mg$cache1;
            EditorTerrainResourcesUI.resourcesScrollBox.add(EditorTerrainResourcesUI.densitySlider);
            EditorTerrainResourcesUI.chanceSlider = new SleekSlider();
            EditorTerrainResourcesUI.chanceSlider.positionOffset_X = 200;
            EditorTerrainResourcesUI.chanceSlider.positionOffset_Y = LevelGround.resources.Length * 40 + 30;
            EditorTerrainResourcesUI.chanceSlider.sizeOffset_X     = 170;
            EditorTerrainResourcesUI.chanceSlider.sizeOffset_Y     = 20;
            EditorTerrainResourcesUI.chanceSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorTerrainResourcesUI.chanceSlider.addLabel(local.format("ChanceSliderLabelText"), ESleekSide.LEFT);
            SleekSlider sleekSlider2 = EditorTerrainResourcesUI.chanceSlider;

            if (EditorTerrainResourcesUI.< > f__mg$cache2 == null)
            {
                EditorTerrainResourcesUI.< > f__mg$cache2 = new Dragged(EditorTerrainResourcesUI.onDraggedChanceSlider);
            }
            sleekSlider2.onDragged = EditorTerrainResourcesUI.< > f__mg$cache2;
            EditorTerrainResourcesUI.resourcesScrollBox.add(EditorTerrainResourcesUI.chanceSlider);
            EditorTerrainResourcesUI.tree_0_Toggle = new SleekToggle();
            EditorTerrainResourcesUI.tree_0_Toggle.positionOffset_X = 200;
            EditorTerrainResourcesUI.tree_0_Toggle.positionOffset_Y = LevelGround.resources.Length * 40 + 60;
            EditorTerrainResourcesUI.tree_0_Toggle.sizeOffset_X     = 40;
            EditorTerrainResourcesUI.tree_0_Toggle.sizeOffset_Y     = 40;
            EditorTerrainResourcesUI.tree_0_Toggle.addLabel(local.format("Tree_0_ToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle = EditorTerrainResourcesUI.tree_0_Toggle;

            if (EditorTerrainResourcesUI.< > f__mg$cache3 == null)
            {
                EditorTerrainResourcesUI.< > f__mg$cache3 = new Toggled(EditorTerrainResourcesUI.onToggledTree_0_Toggle);
            }
            sleekToggle.onToggled = EditorTerrainResourcesUI.< > f__mg$cache3;
            EditorTerrainResourcesUI.resourcesScrollBox.add(EditorTerrainResourcesUI.tree_0_Toggle);
            EditorTerrainResourcesUI.tree_1_Toggle = new SleekToggle();
            EditorTerrainResourcesUI.tree_1_Toggle.positionOffset_X = 200;
            EditorTerrainResourcesUI.tree_1_Toggle.positionOffset_Y = LevelGround.resources.Length * 40 + 110;
            EditorTerrainResourcesUI.tree_1_Toggle.sizeOffset_X     = 40;
            EditorTerrainResourcesUI.tree_1_Toggle.sizeOffset_Y     = 40;
            EditorTerrainResourcesUI.tree_1_Toggle.addLabel(local.format("Tree_1_ToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle2 = EditorTerrainResourcesUI.tree_1_Toggle;

            if (EditorTerrainResourcesUI.< > f__mg$cache4 == null)
            {
                EditorTerrainResourcesUI.< > f__mg$cache4 = new Toggled(EditorTerrainResourcesUI.onToggledTree_1_Toggle);
            }
            sleekToggle2.onToggled = EditorTerrainResourcesUI.< > f__mg$cache4;
            EditorTerrainResourcesUI.resourcesScrollBox.add(EditorTerrainResourcesUI.tree_1_Toggle);
            EditorTerrainResourcesUI.flower_0_Toggle = new SleekToggle();
            EditorTerrainResourcesUI.flower_0_Toggle.positionOffset_X = 200;
            EditorTerrainResourcesUI.flower_0_Toggle.positionOffset_Y = LevelGround.resources.Length * 40 + 160;
            EditorTerrainResourcesUI.flower_0_Toggle.sizeOffset_X     = 40;
            EditorTerrainResourcesUI.flower_0_Toggle.sizeOffset_Y     = 40;
            EditorTerrainResourcesUI.flower_0_Toggle.addLabel(local.format("Flower_0_ToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle3 = EditorTerrainResourcesUI.flower_0_Toggle;

            if (EditorTerrainResourcesUI.< > f__mg$cache5 == null)
            {
                EditorTerrainResourcesUI.< > f__mg$cache5 = new Toggled(EditorTerrainResourcesUI.onToggledFlower_0_Toggle);
            }
            sleekToggle3.onToggled = EditorTerrainResourcesUI.< > f__mg$cache5;
            EditorTerrainResourcesUI.resourcesScrollBox.add(EditorTerrainResourcesUI.flower_0_Toggle);
            EditorTerrainResourcesUI.flower_1_Toggle = new SleekToggle();
            EditorTerrainResourcesUI.flower_1_Toggle.positionOffset_X = 200;
            EditorTerrainResourcesUI.flower_1_Toggle.positionOffset_Y = LevelGround.resources.Length * 40 + 210;
            EditorTerrainResourcesUI.flower_1_Toggle.sizeOffset_X     = 40;
            EditorTerrainResourcesUI.flower_1_Toggle.sizeOffset_Y     = 40;
            EditorTerrainResourcesUI.flower_1_Toggle.addLabel(local.format("Flower_1_ToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle4 = EditorTerrainResourcesUI.flower_1_Toggle;

            if (EditorTerrainResourcesUI.< > f__mg$cache6 == null)
            {
                EditorTerrainResourcesUI.< > f__mg$cache6 = new Toggled(EditorTerrainResourcesUI.onToggledFlower_1_Toggle);
            }
            sleekToggle4.onToggled = EditorTerrainResourcesUI.< > f__mg$cache6;
            EditorTerrainResourcesUI.resourcesScrollBox.add(EditorTerrainResourcesUI.flower_1_Toggle);
            EditorTerrainResourcesUI.rockToggle = new SleekToggle();
            EditorTerrainResourcesUI.rockToggle.positionOffset_X = 200;
            EditorTerrainResourcesUI.rockToggle.positionOffset_Y = LevelGround.resources.Length * 40 + 260;
            EditorTerrainResourcesUI.rockToggle.sizeOffset_X     = 40;
            EditorTerrainResourcesUI.rockToggle.sizeOffset_Y     = 40;
            EditorTerrainResourcesUI.rockToggle.addLabel(local.format("RockToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle5 = EditorTerrainResourcesUI.rockToggle;

            if (EditorTerrainResourcesUI.< > f__mg$cache7 == null)
            {
                EditorTerrainResourcesUI.< > f__mg$cache7 = new Toggled(EditorTerrainResourcesUI.onToggledRockToggle);
            }
            sleekToggle5.onToggled = EditorTerrainResourcesUI.< > f__mg$cache7;
            EditorTerrainResourcesUI.resourcesScrollBox.add(EditorTerrainResourcesUI.rockToggle);
            EditorTerrainResourcesUI.roadToggle = new SleekToggle();
            EditorTerrainResourcesUI.roadToggle.positionOffset_X = 200;
            EditorTerrainResourcesUI.roadToggle.positionOffset_Y = LevelGround.resources.Length * 40 + 310;
            EditorTerrainResourcesUI.roadToggle.sizeOffset_X     = 40;
            EditorTerrainResourcesUI.roadToggle.sizeOffset_Y     = 40;
            EditorTerrainResourcesUI.roadToggle.addLabel(local.format("RoadToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle6 = EditorTerrainResourcesUI.roadToggle;

            if (EditorTerrainResourcesUI.< > f__mg$cache8 == null)
            {
                EditorTerrainResourcesUI.< > f__mg$cache8 = new Toggled(EditorTerrainResourcesUI.onToggledRoadToggle);
            }
            sleekToggle6.onToggled = EditorTerrainResourcesUI.< > f__mg$cache8;
            EditorTerrainResourcesUI.resourcesScrollBox.add(EditorTerrainResourcesUI.roadToggle);
            EditorTerrainResourcesUI.snowToggle = new SleekToggle();
            EditorTerrainResourcesUI.snowToggle.positionOffset_X = 200;
            EditorTerrainResourcesUI.snowToggle.positionOffset_Y = LevelGround.resources.Length * 40 + 360;
            EditorTerrainResourcesUI.snowToggle.sizeOffset_X     = 40;
            EditorTerrainResourcesUI.snowToggle.sizeOffset_Y     = 40;
            EditorTerrainResourcesUI.snowToggle.addLabel(local.format("SnowToggleLabelText"), ESleekSide.RIGHT);
            SleekToggle sleekToggle7 = EditorTerrainResourcesUI.snowToggle;

            if (EditorTerrainResourcesUI.< > f__mg$cache9 == null)
            {
                EditorTerrainResourcesUI.< > f__mg$cache9 = new Toggled(EditorTerrainResourcesUI.onToggledSnowToggle);
            }
            sleekToggle7.onToggled = EditorTerrainResourcesUI.< > f__mg$cache9;
            EditorTerrainResourcesUI.resourcesScrollBox.add(EditorTerrainResourcesUI.snowToggle);
            EditorTerrainResourcesUI.selectedBox = new SleekBox();
            EditorTerrainResourcesUI.selectedBox.positionOffset_X = -200;
            EditorTerrainResourcesUI.selectedBox.positionOffset_Y = 80;
            EditorTerrainResourcesUI.selectedBox.positionScale_X  = 1f;
            EditorTerrainResourcesUI.selectedBox.sizeOffset_X     = 200;
            EditorTerrainResourcesUI.selectedBox.sizeOffset_Y     = 30;
            EditorTerrainResourcesUI.selectedBox.addLabel(local.format("SelectionBoxLabelText"), ESleekSide.LEFT);
            EditorTerrainResourcesUI.container.add(EditorTerrainResourcesUI.selectedBox);
            EditorTerrainResourcesUI.updateSelection();
            EditorTerrainResourcesUI.bakeGlobalResourcesButton = new SleekButtonIcon((Texture2D)bundle.load("Resources"));
            EditorTerrainResourcesUI.bakeGlobalResourcesButton.positionOffset_X = -200;
            EditorTerrainResourcesUI.bakeGlobalResourcesButton.positionOffset_Y = -110;
            EditorTerrainResourcesUI.bakeGlobalResourcesButton.positionScale_X  = 1f;
            EditorTerrainResourcesUI.bakeGlobalResourcesButton.positionScale_Y  = 1f;
            EditorTerrainResourcesUI.bakeGlobalResourcesButton.sizeOffset_X     = 200;
            EditorTerrainResourcesUI.bakeGlobalResourcesButton.sizeOffset_Y     = 30;
            EditorTerrainResourcesUI.bakeGlobalResourcesButton.text             = local.format("BakeGlobalResourcesButtonText");
            EditorTerrainResourcesUI.bakeGlobalResourcesButton.tooltip          = local.format("BakeGlobalResourcesButtonTooltip");
            SleekButton sleekButton3 = EditorTerrainResourcesUI.bakeGlobalResourcesButton;

            if (EditorTerrainResourcesUI.< > f__mg$cacheA == null)
            {
                EditorTerrainResourcesUI.< > f__mg$cacheA = new ClickedButton(EditorTerrainResourcesUI.onClickedBakeGlobalResourcesButton);
            }
            sleekButton3.onClickedButton = EditorTerrainResourcesUI.< > f__mg$cacheA;
            EditorTerrainResourcesUI.container.add(EditorTerrainResourcesUI.bakeGlobalResourcesButton);
            EditorTerrainResourcesUI.bakeLocalResourcesButton = new SleekButtonIcon((Texture2D)bundle.load("Resources"));
            EditorTerrainResourcesUI.bakeLocalResourcesButton.positionOffset_X = -200;
            EditorTerrainResourcesUI.bakeLocalResourcesButton.positionOffset_Y = -70;
            EditorTerrainResourcesUI.bakeLocalResourcesButton.positionScale_X  = 1f;
            EditorTerrainResourcesUI.bakeLocalResourcesButton.positionScale_Y  = 1f;
            EditorTerrainResourcesUI.bakeLocalResourcesButton.sizeOffset_X     = 200;
            EditorTerrainResourcesUI.bakeLocalResourcesButton.sizeOffset_Y     = 30;
            EditorTerrainResourcesUI.bakeLocalResourcesButton.text             = local.format("BakeLocalResourcesButtonText");
            EditorTerrainResourcesUI.bakeLocalResourcesButton.tooltip          = local.format("BakeLocalResourcesButtonTooltip");
            SleekButton sleekButton4 = EditorTerrainResourcesUI.bakeLocalResourcesButton;

            if (EditorTerrainResourcesUI.< > f__mg$cacheB == null)
            {
                EditorTerrainResourcesUI.< > f__mg$cacheB = new ClickedButton(EditorTerrainResourcesUI.onClickedBakeLocalResourcesButton);
            }
            sleekButton4.onClickedButton = EditorTerrainResourcesUI.< > f__mg$cacheB;
            EditorTerrainResourcesUI.container.add(EditorTerrainResourcesUI.bakeLocalResourcesButton);
            EditorTerrainResourcesUI.bakeSkyboxResourcesButton = new SleekButtonIcon((Texture2D)bundle.load("Resources"));
            EditorTerrainResourcesUI.bakeSkyboxResourcesButton.positionOffset_X = -200;
            EditorTerrainResourcesUI.bakeSkyboxResourcesButton.positionOffset_Y = -30;
            EditorTerrainResourcesUI.bakeSkyboxResourcesButton.positionScale_X  = 1f;
            EditorTerrainResourcesUI.bakeSkyboxResourcesButton.positionScale_Y  = 1f;
            EditorTerrainResourcesUI.bakeSkyboxResourcesButton.sizeOffset_X     = 200;
            EditorTerrainResourcesUI.bakeSkyboxResourcesButton.sizeOffset_Y     = 30;
            EditorTerrainResourcesUI.bakeSkyboxResourcesButton.text             = local.format("BakeSkyboxResourcesButtonText");
            EditorTerrainResourcesUI.bakeSkyboxResourcesButton.tooltip          = local.format("BakeSkyboxResourcesButtonTooltip");
            SleekButton sleekButton5 = EditorTerrainResourcesUI.bakeSkyboxResourcesButton;

            if (EditorTerrainResourcesUI.< > f__mg$cacheC == null)
            {
                EditorTerrainResourcesUI.< > f__mg$cacheC = new ClickedButton(EditorTerrainResourcesUI.onClickedBakeSkyboxResourcesButton);
            }
            sleekButton5.onClickedButton = EditorTerrainResourcesUI.< > f__mg$cacheC;
            EditorTerrainResourcesUI.container.add(EditorTerrainResourcesUI.bakeSkyboxResourcesButton);
            EditorTerrainResourcesUI.radiusSlider = new SleekSlider();
            EditorTerrainResourcesUI.radiusSlider.positionOffset_Y = -100;
            EditorTerrainResourcesUI.radiusSlider.positionScale_Y  = 1f;
            EditorTerrainResourcesUI.radiusSlider.sizeOffset_X     = 200;
            EditorTerrainResourcesUI.radiusSlider.sizeOffset_Y     = 20;
            EditorTerrainResourcesUI.radiusSlider.state            = (float)(EditorSpawns.radius - EditorSpawns.MIN_REMOVE_SIZE) / (float)EditorSpawns.MAX_REMOVE_SIZE;
            EditorTerrainResourcesUI.radiusSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorTerrainResourcesUI.radiusSlider.addLabel(local.format("RadiusSliderLabelText"), ESleekSide.RIGHT);
            SleekSlider sleekSlider3 = EditorTerrainResourcesUI.radiusSlider;

            if (EditorTerrainResourcesUI.< > f__mg$cacheD == null)
            {
                EditorTerrainResourcesUI.< > f__mg$cacheD = new Dragged(EditorTerrainResourcesUI.onDraggedRadiusSlider);
            }
            sleekSlider3.onDragged = EditorTerrainResourcesUI.< > f__mg$cacheD;
            EditorTerrainResourcesUI.container.add(EditorTerrainResourcesUI.radiusSlider);
            EditorTerrainResourcesUI.addButton = new SleekButtonIcon((Texture2D)bundle.load("Add"));
            EditorTerrainResourcesUI.addButton.positionOffset_Y = -70;
            EditorTerrainResourcesUI.addButton.positionScale_Y  = 1f;
            EditorTerrainResourcesUI.addButton.sizeOffset_X     = 200;
            EditorTerrainResourcesUI.addButton.sizeOffset_Y     = 30;
            EditorTerrainResourcesUI.addButton.text             = local.format("AddButtonText", new object[]
            {
                ControlsSettings.tool_0
            });
            EditorTerrainResourcesUI.addButton.tooltip = local.format("AddButtonTooltip");
            SleekButton sleekButton6 = EditorTerrainResourcesUI.addButton;

            if (EditorTerrainResourcesUI.< > f__mg$cacheE == null)
            {
                EditorTerrainResourcesUI.< > f__mg$cacheE = new ClickedButton(EditorTerrainResourcesUI.onClickedAddButton);
            }
            sleekButton6.onClickedButton = EditorTerrainResourcesUI.< > f__mg$cacheE;
            EditorTerrainResourcesUI.container.add(EditorTerrainResourcesUI.addButton);
            EditorTerrainResourcesUI.removeButton = new SleekButtonIcon((Texture2D)bundle.load("Remove"));
            EditorTerrainResourcesUI.removeButton.positionOffset_Y = -30;
            EditorTerrainResourcesUI.removeButton.positionScale_Y  = 1f;
            EditorTerrainResourcesUI.removeButton.sizeOffset_X     = 200;
            EditorTerrainResourcesUI.removeButton.sizeOffset_Y     = 30;
            EditorTerrainResourcesUI.removeButton.text             = local.format("RemoveButtonText", new object[]
            {
                ControlsSettings.tool_1
            });
            EditorTerrainResourcesUI.removeButton.tooltip = local.format("RemoveButtonTooltip");
            SleekButton sleekButton7 = EditorTerrainResourcesUI.removeButton;

            if (EditorTerrainResourcesUI.< > f__mg$cacheF == null)
            {
                EditorTerrainResourcesUI.< > f__mg$cacheF = new ClickedButton(EditorTerrainResourcesUI.onClickedRemoveButton);
            }
            sleekButton7.onClickedButton = EditorTerrainResourcesUI.< > f__mg$cacheF;
            EditorTerrainResourcesUI.container.add(EditorTerrainResourcesUI.removeButton);
            bundle.unload();
        }
        // Token: 0x060037E0 RID: 14304 RVA: 0x0018C1E8 File Offset: 0x0018A5E8
        public PlayerBarricadeStereoUI()
        {
            PlayerBarricadeStereoUI.localization = Localization.read("/Player/PlayerBarricadeStereo.dat");
            PlayerBarricadeStereoUI.container    = new Sleek();
            PlayerBarricadeStereoUI.container.positionScale_Y  = 1f;
            PlayerBarricadeStereoUI.container.positionOffset_X = 10;
            PlayerBarricadeStereoUI.container.positionOffset_Y = 10;
            PlayerBarricadeStereoUI.container.sizeOffset_X     = -20;
            PlayerBarricadeStereoUI.container.sizeOffset_Y     = -20;
            PlayerBarricadeStereoUI.container.sizeScale_X      = 1f;
            PlayerBarricadeStereoUI.container.sizeScale_Y      = 1f;
            PlayerUI.container.add(PlayerBarricadeStereoUI.container);
            PlayerBarricadeStereoUI.active     = false;
            PlayerBarricadeStereoUI.stereo     = null;
            PlayerBarricadeStereoUI.stopButton = new SleekButton();
            PlayerBarricadeStereoUI.stopButton.positionOffset_X = -200;
            PlayerBarricadeStereoUI.stopButton.positionOffset_Y = 5;
            PlayerBarricadeStereoUI.stopButton.positionScale_X  = 0.5f;
            PlayerBarricadeStereoUI.stopButton.positionScale_Y  = 0.9f;
            PlayerBarricadeStereoUI.stopButton.sizeOffset_X     = 195;
            PlayerBarricadeStereoUI.stopButton.sizeOffset_Y     = 30;
            PlayerBarricadeStereoUI.stopButton.text             = PlayerBarricadeStereoUI.localization.format("Stop_Button");
            PlayerBarricadeStereoUI.stopButton.tooltip          = PlayerBarricadeStereoUI.localization.format("Stop_Button_Tooltip");
            SleekButton sleekButton = PlayerBarricadeStereoUI.stopButton;

            if (PlayerBarricadeStereoUI.< > f__mg$cache1 == null)
            {
                PlayerBarricadeStereoUI.< > f__mg$cache1 = new ClickedButton(PlayerBarricadeStereoUI.onClickedStopButton);
            }
            sleekButton.onClickedButton = PlayerBarricadeStereoUI.< > f__mg$cache1;
            PlayerBarricadeStereoUI.container.add(PlayerBarricadeStereoUI.stopButton);
            PlayerBarricadeStereoUI.closeButton = new SleekButton();
            PlayerBarricadeStereoUI.closeButton.positionOffset_X = 5;
            PlayerBarricadeStereoUI.closeButton.positionOffset_Y = 5;
            PlayerBarricadeStereoUI.closeButton.positionScale_X  = 0.5f;
            PlayerBarricadeStereoUI.closeButton.positionScale_Y  = 0.9f;
            PlayerBarricadeStereoUI.closeButton.sizeOffset_X     = 195;
            PlayerBarricadeStereoUI.closeButton.sizeOffset_Y     = 30;
            PlayerBarricadeStereoUI.closeButton.text             = PlayerBarricadeStereoUI.localization.format("Close_Button");
            PlayerBarricadeStereoUI.closeButton.tooltip          = PlayerBarricadeStereoUI.localization.format("Close_Button_Tooltip");
            SleekButton sleekButton2 = PlayerBarricadeStereoUI.closeButton;

            if (PlayerBarricadeStereoUI.< > f__mg$cache2 == null)
            {
                PlayerBarricadeStereoUI.< > f__mg$cache2 = new ClickedButton(PlayerBarricadeStereoUI.onClickedCloseButton);
            }
            sleekButton2.onClickedButton = PlayerBarricadeStereoUI.< > f__mg$cache2;
            PlayerBarricadeStereoUI.container.add(PlayerBarricadeStereoUI.closeButton);
            PlayerBarricadeStereoUI.volumeSlider = new SleekSlider();
            PlayerBarricadeStereoUI.volumeSlider.positionOffset_X = -200;
            PlayerBarricadeStereoUI.volumeSlider.positionOffset_Y = -25;
            PlayerBarricadeStereoUI.volumeSlider.positionScale_X  = 0.5f;
            PlayerBarricadeStereoUI.volumeSlider.positionScale_Y  = 0.1f;
            PlayerBarricadeStereoUI.volumeSlider.sizeOffset_X     = 250;
            PlayerBarricadeStereoUI.volumeSlider.sizeOffset_Y     = 20;
            PlayerBarricadeStereoUI.volumeSlider.orientation      = ESleekOrientation.HORIZONTAL;
            SleekSlider sleekSlider = PlayerBarricadeStereoUI.volumeSlider;

            if (PlayerBarricadeStereoUI.< > f__mg$cache3 == null)
            {
                PlayerBarricadeStereoUI.< > f__mg$cache3 = new Dragged(PlayerBarricadeStereoUI.onDraggedVolumeSlider);
            }
            sleekSlider.onDragged = PlayerBarricadeStereoUI.< > f__mg$cache3;
            PlayerBarricadeStereoUI.volumeSlider.addLabel(string.Empty, ESleekSide.RIGHT);
            PlayerBarricadeStereoUI.container.add(PlayerBarricadeStereoUI.volumeSlider);
            PlayerBarricadeStereoUI.songsBox = new SleekScrollBox();
            PlayerBarricadeStereoUI.songsBox.positionOffset_X = -200;
            PlayerBarricadeStereoUI.songsBox.positionScale_X  = 0.5f;
            PlayerBarricadeStereoUI.songsBox.positionScale_Y  = 0.1f;
            PlayerBarricadeStereoUI.songsBox.sizeOffset_X     = 400;
            PlayerBarricadeStereoUI.songsBox.sizeScale_Y      = 0.8f;
            PlayerBarricadeStereoUI.container.add(PlayerBarricadeStereoUI.songsBox);
        }
Example #22
0
        public void Update()
        {
            MouseState    mouse    = Mouse.GetState();
            KeyboardState keyboard = Keyboard.GetState();

            Voxel underMouse = GetVoxelUnderMouse();
            // Keep track of whether a new voxel has been selected.
            bool newVoxel = underMouse != null && !underMouse.Equals(VoxelUnderMouse);

            // If there is a voxel under the mouse...
            if (underMouse != null)
            {
                VoxelUnderMouse = underMouse;
                // Update the cursor light.
                PlayState.CursorLightPos = underMouse.Position + new Vector3(0.5f, 0.5f, 0.5f);

                // Get the type of the voxel and display it to the player.
                if (Enabled && !underMouse.IsEmpty && underMouse.IsExplored)
                {
                    string info = underMouse.TypeName;

                    // If it belongs to a room, display that information.
                    if (PlayState.PlayerFaction.RoomBuilder.IsInRoom(underMouse))
                    {
                        Room room = PlayState.PlayerFaction.RoomBuilder.GetMostLikelyRoom(underMouse);

                        if (room != null)
                        {
                            info += " (" + room.ID + ")";
                        }
                    }
                    PlayState.GUI.ToolTipManager.PopupInfo(info);
                }
            }

            // Do nothing if not enabled.
            if (!Enabled)
            {
                return;
            }
            bool altPressed = false;

            // If the left or right ALT keys are pressed, we can adjust the height of the selection
            // for building pits and tall walls using the mouse wheel.
            if (keyboard.IsKeyDown(Keys.LeftAlt) || keyboard.IsKeyDown(Keys.RightAlt))
            {
                BoxYOffset    += (mouse.ScrollWheelValue - LastMouseWheel) * 0.01f;
                LastMouseWheel = mouse.ScrollWheelValue;
                newVoxel       = true;
                altPressed     = true;
            }
            else
            {
                LastMouseWheel = mouse.ScrollWheelValue;
            }

            // Draw a box around the current voxel under the mouse.
            if (underMouse != null)
            {
                BoundingBox box = underMouse.GetBoundingBox().Expand(0.05f);
                Drawer3D.DrawBox(box, CurrentColor, CurrentWidth, true);
            }

            // If the left mouse button is pressed, update the slection buffer.
            if (isLeftPressed)
            {
                // On release, select voxels.
                if (mouse.LeftButton == ButtonState.Released)
                {
                    isLeftPressed = false;
                    LeftReleasedCallback();
                    BoxYOffset = 0;
                }
                // Otherwise, update the selection buffer
                else
                {
                    if (SelectionBuffer.Count == 0)
                    {
                        FirstVoxel = underMouse;
                        SelectionBuffer.Add(underMouse);
                    }
                    else
                    {
                        SelectionBuffer.Clear();
                        SelectionBuffer.Add(FirstVoxel);
                        SelectionBuffer.Add(underMouse);
                        BoundingBox buffer = GetSelectionBox();

                        // Update the selection box to account for offsets from mouse wheel.
                        if (BoxYOffset > 0)
                        {
                            buffer.Max.Y += BoxYOffset;
                        }
                        else if (BoxYOffset < 0)
                        {
                            buffer.Min.Y += BoxYOffset;
                        }

                        SelectionBuffer = Chunks.GetVoxelsIntersecting(buffer);

                        if (!altPressed)
                        {
                            SelectionBuffer.RemoveAll(
                                voxel =>
                                (!voxel.Equals(underMouse) && Chunks.ChunkData.IsVoxelOccluded(voxel)));
                        }

                        if (newVoxel)
                        {
                            Dragged.Invoke(SelectionBuffer, InputManager.MouseButton.Left);
                        }
                    }
                }
            }
            // If the mouse was not previously pressed, but is now pressed, then notify us of that.
            else if (mouse.LeftButton == ButtonState.Pressed)
            {
                LeftPressedCallback();
                isLeftPressed = true;
                BoxYOffset    = 0;
            }

            // Case where the right mouse button is pressed (mirrors left mouse button)
            // TODO(Break this into a function)
            if (isRightPressed)
            {
                if (mouse.RightButton == ButtonState.Released)
                {
                    isRightPressed = false;
                    RightReleasedCallback();
                    BoxYOffset = 0;
                }
                else
                {
                    if (SelectionBuffer.Count == 0)
                    {
                        SelectionBuffer.Add(underMouse);
                        FirstVoxel = underMouse;
                    }
                    else
                    {
                        SelectionBuffer.Clear();
                        SelectionBuffer.Add(FirstVoxel);
                        SelectionBuffer.Add(underMouse);
                        BoundingBox buffer = GetSelectionBox();
                        if (BoxYOffset > 0)
                        {
                            buffer.Max.Y += BoxYOffset;
                        }
                        else if (BoxYOffset < 0)
                        {
                            buffer.Min.Y += BoxYOffset;
                        }


                        SelectionBuffer = Chunks.GetVoxelsIntersecting(buffer);
                        if (!altPressed)
                        {
                            SelectionBuffer.RemoveAll(
                                voxel =>
                                (!voxel.Equals(underMouse) && Chunks.ChunkData.IsVoxelOccluded(voxel)));
                        }
                        if (newVoxel)
                        {
                            Dragged.Invoke(SelectionBuffer, InputManager.MouseButton.Right);
                        }
                    }
                }
            }
            else if (mouse.RightButton == ButtonState.Pressed)
            {
                RightPressedCallback();
                BoxYOffset     = 0;
                isRightPressed = true;
            }
        }
Example #23
0
        public MenuSurvivorsAppearanceUI()
        {
            MenuSurvivorsAppearanceUI.localization = Localization.read("/Menu/Survivors/MenuSurvivorsAppearance.dat");
            MenuSurvivorsAppearanceUI.container    = new Sleek();
            MenuSurvivorsAppearanceUI.container.positionOffset_X = 10;
            MenuSurvivorsAppearanceUI.container.positionOffset_Y = 10;
            MenuSurvivorsAppearanceUI.container.positionScale_Y  = 1f;
            MenuSurvivorsAppearanceUI.container.sizeOffset_X     = -20;
            MenuSurvivorsAppearanceUI.container.sizeOffset_Y     = -20;
            MenuSurvivorsAppearanceUI.container.sizeScale_X      = 1f;
            MenuSurvivorsAppearanceUI.container.sizeScale_Y      = 1f;
            MenuUI.container.add(MenuSurvivorsAppearanceUI.container);
            MenuSurvivorsAppearanceUI.active           = false;
            MenuSurvivorsAppearanceUI.customizationBox = new SleekScrollBox();
            MenuSurvivorsAppearanceUI.customizationBox.positionOffset_X = -140;
            MenuSurvivorsAppearanceUI.customizationBox.positionOffset_Y = 100;
            MenuSurvivorsAppearanceUI.customizationBox.positionScale_X  = 0.75f;
            MenuSurvivorsAppearanceUI.customizationBox.sizeOffset_X     = 270;
            MenuSurvivorsAppearanceUI.customizationBox.sizeOffset_Y     = -270;
            MenuSurvivorsAppearanceUI.customizationBox.sizeScale_Y      = 1f;
            MenuSurvivorsAppearanceUI.container.add(MenuSurvivorsAppearanceUI.customizationBox);
            MenuSurvivorsAppearanceUI.faceBox = new SleekBox();
            MenuSurvivorsAppearanceUI.faceBox.sizeOffset_X = 240;
            MenuSurvivorsAppearanceUI.faceBox.sizeOffset_Y = 30;
            MenuSurvivorsAppearanceUI.faceBox.text         = MenuSurvivorsAppearanceUI.localization.format("Face_Box");
            MenuSurvivorsAppearanceUI.faceBox.tooltip      = MenuSurvivorsAppearanceUI.localization.format("Face_Box_Tooltip");
            MenuSurvivorsAppearanceUI.customizationBox.add(MenuSurvivorsAppearanceUI.faceBox);
            MenuSurvivorsAppearanceUI.faceButtons = new SleekButton[(int)(Customization.FACES_FREE + Customization.FACES_PRO)];
            for (int i = 0; i < MenuSurvivorsAppearanceUI.faceButtons.Length; i++)
            {
                SleekButton sleekButton = new SleekButton();
                sleekButton.positionOffset_X = i % 5 * 50;
                sleekButton.positionOffset_Y = 40 + Mathf.FloorToInt((float)i / 5f) * 50;
                sleekButton.sizeOffset_X     = 40;
                sleekButton.sizeOffset_Y     = 40;
                MenuSurvivorsAppearanceUI.faceBox.add(sleekButton);
                SleekImageTexture sleekImageTexture = new SleekImageTexture();
                sleekImageTexture.positionOffset_X = 10;
                sleekImageTexture.positionOffset_Y = 10;
                sleekImageTexture.sizeOffset_X     = 20;
                sleekImageTexture.sizeOffset_Y     = 20;
                sleekImageTexture.texture          = (Texture2D)Resources.Load("Materials/Pixel");
                sleekButton.add(sleekImageTexture);
                sleekImageTexture.add(new SleekImageTexture
                {
                    positionOffset_X = 2,
                    positionOffset_Y = 2,
                    sizeOffset_X     = 16,
                    sizeOffset_Y     = 16,
                    texture          = (Texture2D)Resources.Load("Faces/" + i + "/Texture")
                });
                if (i >= (int)Customization.FACES_FREE)
                {
                    if (Provider.isPro)
                    {
                        SleekButton sleekButton2 = sleekButton;
                        if (MenuSurvivorsAppearanceUI.< > f__mg$cache0 == null)
                        {
                            MenuSurvivorsAppearanceUI.< > f__mg$cache0 = new ClickedButton(MenuSurvivorsAppearanceUI.onClickedFaceButton);
                        }
                        sleekButton2.onClickedButton = MenuSurvivorsAppearanceUI.< > f__mg$cache0;
                    }
                    else
                    {
                        sleekButton.backgroundColor = Palette.PRO;
                        Bundle bundle = Bundles.getBundle("/Bundles/Textures/Menu/Icons/Pro/Pro.unity3d");
                        sleekButton.add(new SleekImageTexture
                        {
                            positionOffset_X = -10,
                            positionOffset_Y = -10,
                            positionScale_X  = 0.5f,
                            positionScale_Y  = 0.5f,
                            sizeOffset_X     = 20,
                            sizeOffset_Y     = 20,
                            texture          = (Texture2D)bundle.load("Lock_Small")
                        });
                        bundle.unload();
                    }
                }
                else
                {
                    SleekButton sleekButton3 = sleekButton;
                    if (MenuSurvivorsAppearanceUI.< > f__mg$cache1 == null)
                    {
                        MenuSurvivorsAppearanceUI.< > f__mg$cache1 = new ClickedButton(MenuSurvivorsAppearanceUI.onClickedFaceButton);
                    }
                    sleekButton3.onClickedButton = MenuSurvivorsAppearanceUI.< > f__mg$cache1;
                }
                MenuSurvivorsAppearanceUI.faceButtons[i] = sleekButton;
            }
            MenuSurvivorsAppearanceUI.hairBox = new SleekBox();
            MenuSurvivorsAppearanceUI.hairBox.positionOffset_Y = 80 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.faceButtons.Length / 5f) * 50;
            MenuSurvivorsAppearanceUI.hairBox.sizeOffset_X     = 240;
            MenuSurvivorsAppearanceUI.hairBox.sizeOffset_Y     = 30;
            MenuSurvivorsAppearanceUI.hairBox.text             = MenuSurvivorsAppearanceUI.localization.format("Hair_Box");
            MenuSurvivorsAppearanceUI.hairBox.tooltip          = MenuSurvivorsAppearanceUI.localization.format("Hair_Box_Tooltip");
            MenuSurvivorsAppearanceUI.customizationBox.add(MenuSurvivorsAppearanceUI.hairBox);
            MenuSurvivorsAppearanceUI.hairButtons = new SleekButton[(int)(Customization.HAIRS_FREE + Customization.HAIRS_PRO)];
            for (int j = 0; j < MenuSurvivorsAppearanceUI.hairButtons.Length; j++)
            {
                SleekButton sleekButton4 = new SleekButton();
                sleekButton4.positionOffset_X = j % 5 * 50;
                sleekButton4.positionOffset_Y = 40 + Mathf.FloorToInt((float)j / 5f) * 50;
                sleekButton4.sizeOffset_X     = 40;
                sleekButton4.sizeOffset_Y     = 40;
                MenuSurvivorsAppearanceUI.hairBox.add(sleekButton4);
                sleekButton4.add(new SleekImageTexture
                {
                    positionOffset_X = 10,
                    positionOffset_Y = 10,
                    sizeOffset_X     = 20,
                    sizeOffset_Y     = 20,
                    texture          = (Texture2D)Resources.Load("Hairs/" + j + "/Texture")
                });
                if (j >= (int)Customization.HAIRS_FREE)
                {
                    if (Provider.isPro)
                    {
                        SleekButton sleekButton5 = sleekButton4;
                        if (MenuSurvivorsAppearanceUI.< > f__mg$cache2 == null)
                        {
                            MenuSurvivorsAppearanceUI.< > f__mg$cache2 = new ClickedButton(MenuSurvivorsAppearanceUI.onClickedHairButton);
                        }
                        sleekButton5.onClickedButton = MenuSurvivorsAppearanceUI.< > f__mg$cache2;
                    }
                    else
                    {
                        sleekButton4.backgroundColor = Palette.PRO;
                        Bundle bundle2 = Bundles.getBundle("/Bundles/Textures/Menu/Icons/Pro/Pro.unity3d");
                        sleekButton4.add(new SleekImageTexture
                        {
                            positionOffset_X = -10,
                            positionOffset_Y = -10,
                            positionScale_X  = 0.5f,
                            positionScale_Y  = 0.5f,
                            sizeOffset_X     = 20,
                            sizeOffset_Y     = 20,
                            texture          = (Texture2D)bundle2.load("Lock_Small")
                        });
                        bundle2.unload();
                    }
                }
                else
                {
                    SleekButton sleekButton6 = sleekButton4;
                    if (MenuSurvivorsAppearanceUI.< > f__mg$cache3 == null)
                    {
                        MenuSurvivorsAppearanceUI.< > f__mg$cache3 = new ClickedButton(MenuSurvivorsAppearanceUI.onClickedHairButton);
                    }
                    sleekButton6.onClickedButton = MenuSurvivorsAppearanceUI.< > f__mg$cache3;
                }
                MenuSurvivorsAppearanceUI.hairButtons[j] = sleekButton4;
            }
            MenuSurvivorsAppearanceUI.beardBox = new SleekBox();
            MenuSurvivorsAppearanceUI.beardBox.positionOffset_Y = 160 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.faceButtons.Length / 5f) * 50 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.hairButtons.Length / 5f) * 50;
            MenuSurvivorsAppearanceUI.beardBox.sizeOffset_X     = 240;
            MenuSurvivorsAppearanceUI.beardBox.sizeOffset_Y     = 30;
            MenuSurvivorsAppearanceUI.beardBox.text             = MenuSurvivorsAppearanceUI.localization.format("Beard_Box");
            MenuSurvivorsAppearanceUI.beardBox.tooltip          = MenuSurvivorsAppearanceUI.localization.format("Beard_Box_Tooltip");
            MenuSurvivorsAppearanceUI.customizationBox.add(MenuSurvivorsAppearanceUI.beardBox);
            MenuSurvivorsAppearanceUI.beardButtons = new SleekButton[(int)(Customization.BEARDS_FREE + Customization.BEARDS_PRO)];
            for (int k = 0; k < MenuSurvivorsAppearanceUI.beardButtons.Length; k++)
            {
                SleekButton sleekButton7 = new SleekButton();
                sleekButton7.positionOffset_X = k % 5 * 50;
                sleekButton7.positionOffset_Y = 40 + Mathf.FloorToInt((float)k / 5f) * 50;
                sleekButton7.sizeOffset_X     = 40;
                sleekButton7.sizeOffset_Y     = 40;
                MenuSurvivorsAppearanceUI.beardBox.add(sleekButton7);
                sleekButton7.add(new SleekImageTexture
                {
                    positionOffset_X = 10,
                    positionOffset_Y = 10,
                    sizeOffset_X     = 20,
                    sizeOffset_Y     = 20,
                    texture          = (Texture2D)Resources.Load("Beards/" + k + "/Texture")
                });
                if (k >= (int)Customization.BEARDS_FREE)
                {
                    if (Provider.isPro)
                    {
                        SleekButton sleekButton8 = sleekButton7;
                        if (MenuSurvivorsAppearanceUI.< > f__mg$cache4 == null)
                        {
                            MenuSurvivorsAppearanceUI.< > f__mg$cache4 = new ClickedButton(MenuSurvivorsAppearanceUI.onClickedBeardButton);
                        }
                        sleekButton8.onClickedButton = MenuSurvivorsAppearanceUI.< > f__mg$cache4;
                    }
                    else
                    {
                        sleekButton7.backgroundColor = Palette.PRO;
                        Bundle bundle3 = Bundles.getBundle("/Bundles/Textures/Menu/Icons/Pro/Pro.unity3d");
                        sleekButton7.add(new SleekImageTexture
                        {
                            positionOffset_X = -10,
                            positionOffset_Y = -10,
                            positionScale_X  = 0.5f,
                            positionScale_Y  = 0.5f,
                            sizeOffset_X     = 20,
                            sizeOffset_Y     = 20,
                            texture          = (Texture2D)bundle3.load("Lock_Small")
                        });
                        bundle3.unload();
                    }
                }
                else
                {
                    SleekButton sleekButton9 = sleekButton7;
                    if (MenuSurvivorsAppearanceUI.< > f__mg$cache5 == null)
                    {
                        MenuSurvivorsAppearanceUI.< > f__mg$cache5 = new ClickedButton(MenuSurvivorsAppearanceUI.onClickedBeardButton);
                    }
                    sleekButton9.onClickedButton = MenuSurvivorsAppearanceUI.< > f__mg$cache5;
                }
                MenuSurvivorsAppearanceUI.beardButtons[k] = sleekButton7;
            }
            MenuSurvivorsAppearanceUI.skinBox = new SleekBox();
            MenuSurvivorsAppearanceUI.skinBox.positionOffset_Y = 240 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.faceButtons.Length / 5f) * 50 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.hairButtons.Length / 5f) * 50 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.beardButtons.Length / 5f) * 50;
            MenuSurvivorsAppearanceUI.skinBox.sizeOffset_X     = 240;
            MenuSurvivorsAppearanceUI.skinBox.sizeOffset_Y     = 30;
            MenuSurvivorsAppearanceUI.skinBox.text             = MenuSurvivorsAppearanceUI.localization.format("Skin_Box");
            MenuSurvivorsAppearanceUI.skinBox.tooltip          = MenuSurvivorsAppearanceUI.localization.format("Skin_Box_Tooltip");
            MenuSurvivorsAppearanceUI.customizationBox.add(MenuSurvivorsAppearanceUI.skinBox);
            MenuSurvivorsAppearanceUI.skinButtons = new SleekButton[Customization.SKINS.Length];
            for (int l = 0; l < MenuSurvivorsAppearanceUI.skinButtons.Length; l++)
            {
                SleekButton sleekButton10 = new SleekButton();
                sleekButton10.positionOffset_X = l % 5 * 50;
                sleekButton10.positionOffset_Y = 40 + Mathf.FloorToInt((float)l / 5f) * 50;
                sleekButton10.sizeOffset_X     = 40;
                sleekButton10.sizeOffset_Y     = 40;
                SleekButton sleekButton11 = sleekButton10;
                if (MenuSurvivorsAppearanceUI.< > f__mg$cache6 == null)
                {
                    MenuSurvivorsAppearanceUI.< > f__mg$cache6 = new ClickedButton(MenuSurvivorsAppearanceUI.onClickedSkinButton);
                }
                sleekButton11.onClickedButton = MenuSurvivorsAppearanceUI.< > f__mg$cache6;
                MenuSurvivorsAppearanceUI.skinBox.add(sleekButton10);
                sleekButton10.add(new SleekImageTexture
                {
                    positionOffset_X = 10,
                    positionOffset_Y = 10,
                    sizeOffset_X     = 20,
                    sizeOffset_Y     = 20,
                    texture          = (Texture2D)Resources.Load("Materials/Pixel"),
                    backgroundColor  = Customization.SKINS[l]
                });
                MenuSurvivorsAppearanceUI.skinButtons[l] = sleekButton10;
            }
            MenuSurvivorsAppearanceUI.skinColorPicker = new SleekColorPicker();
            MenuSurvivorsAppearanceUI.skinColorPicker.positionOffset_Y = 280 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.faceButtons.Length / 5f) * 50 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.hairButtons.Length / 5f) * 50 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.beardButtons.Length / 5f) * 50 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.skinButtons.Length / 5f) * 50;
            MenuSurvivorsAppearanceUI.customizationBox.add(MenuSurvivorsAppearanceUI.skinColorPicker);
            if (Provider.isPro)
            {
                SleekColorPicker sleekColorPicker = MenuSurvivorsAppearanceUI.skinColorPicker;
                if (MenuSurvivorsAppearanceUI.< > f__mg$cache7 == null)
                {
                    MenuSurvivorsAppearanceUI.< > f__mg$cache7 = new ColorPicked(MenuSurvivorsAppearanceUI.onSkinColorPicked);
                }
                sleekColorPicker.onColorPicked = MenuSurvivorsAppearanceUI.< > f__mg$cache7;
            }
            else
            {
                Bundle            bundle4            = Bundles.getBundle("/Bundles/Textures/Menu/Icons/Pro/Pro.unity3d");
                SleekImageTexture sleekImageTexture2 = new SleekImageTexture();
                sleekImageTexture2.positionOffset_X = -40;
                sleekImageTexture2.positionOffset_Y = -40;
                sleekImageTexture2.positionScale_X  = 0.5f;
                sleekImageTexture2.positionScale_Y  = 0.5f;
                sleekImageTexture2.sizeOffset_X     = 80;
                sleekImageTexture2.sizeOffset_Y     = 80;
                sleekImageTexture2.texture          = (Texture2D)bundle4.load("Lock_Large");
                MenuSurvivorsAppearanceUI.skinColorPicker.add(sleekImageTexture2);
                bundle4.unload();
            }
            MenuSurvivorsAppearanceUI.colorBox = new SleekBox();
            MenuSurvivorsAppearanceUI.colorBox.positionOffset_Y = 440 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.faceButtons.Length / 5f) * 50 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.hairButtons.Length / 5f) * 50 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.beardButtons.Length / 5f) * 50 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.skinButtons.Length / 5f) * 50;
            MenuSurvivorsAppearanceUI.colorBox.sizeOffset_X     = 240;
            MenuSurvivorsAppearanceUI.colorBox.sizeOffset_Y     = 30;
            MenuSurvivorsAppearanceUI.colorBox.text             = MenuSurvivorsAppearanceUI.localization.format("Color_Box");
            MenuSurvivorsAppearanceUI.colorBox.tooltip          = MenuSurvivorsAppearanceUI.localization.format("Color_Box_Tooltip");
            MenuSurvivorsAppearanceUI.customizationBox.add(MenuSurvivorsAppearanceUI.colorBox);
            MenuSurvivorsAppearanceUI.colorButtons = new SleekButton[Customization.COLORS.Length];
            for (int m = 0; m < MenuSurvivorsAppearanceUI.colorButtons.Length; m++)
            {
                SleekButton sleekButton12 = new SleekButton();
                sleekButton12.positionOffset_X = m % 5 * 50;
                sleekButton12.positionOffset_Y = 40 + Mathf.FloorToInt((float)m / 5f) * 50;
                sleekButton12.sizeOffset_X     = 40;
                sleekButton12.sizeOffset_Y     = 40;
                SleekButton sleekButton13 = sleekButton12;
                if (MenuSurvivorsAppearanceUI.< > f__mg$cache8 == null)
                {
                    MenuSurvivorsAppearanceUI.< > f__mg$cache8 = new ClickedButton(MenuSurvivorsAppearanceUI.onClickedColorButton);
                }
                sleekButton13.onClickedButton = MenuSurvivorsAppearanceUI.< > f__mg$cache8;
                MenuSurvivorsAppearanceUI.colorBox.add(sleekButton12);
                sleekButton12.add(new SleekImageTexture
                {
                    positionOffset_X = 10,
                    positionOffset_Y = 10,
                    sizeOffset_X     = 20,
                    sizeOffset_Y     = 20,
                    texture          = (Texture2D)Resources.Load("Materials/Pixel"),
                    backgroundColor  = Customization.COLORS[m]
                });
                MenuSurvivorsAppearanceUI.colorButtons[m] = sleekButton12;
            }
            MenuSurvivorsAppearanceUI.colorColorPicker = new SleekColorPicker();
            MenuSurvivorsAppearanceUI.colorColorPicker.positionOffset_Y = 480 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.faceButtons.Length / 5f) * 50 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.hairButtons.Length / 5f) * 50 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.beardButtons.Length / 5f) * 50 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.skinButtons.Length / 5f) * 50 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.colorButtons.Length / 5f) * 50;
            MenuSurvivorsAppearanceUI.customizationBox.add(MenuSurvivorsAppearanceUI.colorColorPicker);
            if (Provider.isPro)
            {
                SleekColorPicker sleekColorPicker2 = MenuSurvivorsAppearanceUI.colorColorPicker;
                if (MenuSurvivorsAppearanceUI.< > f__mg$cache9 == null)
                {
                    MenuSurvivorsAppearanceUI.< > f__mg$cache9 = new ColorPicked(MenuSurvivorsAppearanceUI.onColorColorPicked);
                }
                sleekColorPicker2.onColorPicked = MenuSurvivorsAppearanceUI.< > f__mg$cache9;
            }
            else
            {
                Bundle            bundle5            = Bundles.getBundle("/Bundles/Textures/Menu/Icons/Pro/Pro.unity3d");
                SleekImageTexture sleekImageTexture3 = new SleekImageTexture();
                sleekImageTexture3.positionOffset_X = -40;
                sleekImageTexture3.positionOffset_Y = -40;
                sleekImageTexture3.positionScale_X  = 0.5f;
                sleekImageTexture3.positionScale_Y  = 0.5f;
                sleekImageTexture3.sizeOffset_X     = 80;
                sleekImageTexture3.sizeOffset_Y     = 80;
                sleekImageTexture3.texture          = (Texture2D)bundle5.load("Lock_Large");
                MenuSurvivorsAppearanceUI.colorColorPicker.add(sleekImageTexture3);
                bundle5.unload();
            }
            MenuSurvivorsAppearanceUI.customizationBox.area = new Rect(0f, 0f, 5f, (float)(600 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.faceButtons.Length / 5f) * 50 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.hairButtons.Length / 5f) * 50 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.beardButtons.Length / 5f) * 50 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.skinButtons.Length / 5f) * 50 + Mathf.CeilToInt((float)MenuSurvivorsAppearanceUI.colorButtons.Length / 5f) * 50));
            Delegate onCharacterUpdated = Characters.onCharacterUpdated;

            if (MenuSurvivorsAppearanceUI.< > f__mg$cacheA == null)
            {
                MenuSurvivorsAppearanceUI.< > f__mg$cacheA = new CharacterUpdated(MenuSurvivorsAppearanceUI.onCharacterUpdated);
            }
            Characters.onCharacterUpdated       = (CharacterUpdated)Delegate.Combine(onCharacterUpdated, MenuSurvivorsAppearanceUI.< > f__mg$cacheA);
            MenuSurvivorsAppearanceUI.handState = new SleekButtonState(new GUIContent[]
            {
                new GUIContent(MenuSurvivorsAppearanceUI.localization.format("Right")),
                new GUIContent(MenuSurvivorsAppearanceUI.localization.format("Left"))
            });
            MenuSurvivorsAppearanceUI.handState.positionOffset_X = -140;
            MenuSurvivorsAppearanceUI.handState.positionOffset_Y = -160;
            MenuSurvivorsAppearanceUI.handState.positionScale_X  = 0.75f;
            MenuSurvivorsAppearanceUI.handState.positionScale_Y  = 1f;
            MenuSurvivorsAppearanceUI.handState.sizeOffset_X     = 240;
            MenuSurvivorsAppearanceUI.handState.sizeOffset_Y     = 30;
            SleekButtonState sleekButtonState = MenuSurvivorsAppearanceUI.handState;

            if (MenuSurvivorsAppearanceUI.< > f__mg$cacheB == null)
            {
                MenuSurvivorsAppearanceUI.< > f__mg$cacheB = new SwappedState(MenuSurvivorsAppearanceUI.onSwappedHandState);
            }
            sleekButtonState.onSwappedState = MenuSurvivorsAppearanceUI.< > f__mg$cacheB;
            MenuSurvivorsAppearanceUI.container.add(MenuSurvivorsAppearanceUI.handState);
            MenuSurvivorsAppearanceUI.characterSlider = new SleekSlider();
            MenuSurvivorsAppearanceUI.characterSlider.positionOffset_X = -140;
            MenuSurvivorsAppearanceUI.characterSlider.positionOffset_Y = -120;
            MenuSurvivorsAppearanceUI.characterSlider.positionScale_X  = 0.75f;
            MenuSurvivorsAppearanceUI.characterSlider.positionScale_Y  = 1f;
            MenuSurvivorsAppearanceUI.characterSlider.sizeOffset_X     = 240;
            MenuSurvivorsAppearanceUI.characterSlider.sizeOffset_Y     = 20;
            MenuSurvivorsAppearanceUI.characterSlider.orientation      = ESleekOrientation.HORIZONTAL;
            SleekSlider sleekSlider = MenuSurvivorsAppearanceUI.characterSlider;

            if (MenuSurvivorsAppearanceUI.< > f__mg$cacheC == null)
            {
                MenuSurvivorsAppearanceUI.< > f__mg$cacheC = new Dragged(MenuSurvivorsAppearanceUI.onDraggedCharacterSlider);
            }
            sleekSlider.onDragged = MenuSurvivorsAppearanceUI.< > f__mg$cacheC;
            MenuSurvivorsAppearanceUI.container.add(MenuSurvivorsAppearanceUI.characterSlider);
            MenuSurvivorsAppearanceUI.backButton = new SleekButtonIcon((Texture2D)MenuDashboardUI.icons.load("Exit"));
            MenuSurvivorsAppearanceUI.backButton.positionOffset_Y = -50;
            MenuSurvivorsAppearanceUI.backButton.positionScale_Y  = 1f;
            MenuSurvivorsAppearanceUI.backButton.sizeOffset_X     = 200;
            MenuSurvivorsAppearanceUI.backButton.sizeOffset_Y     = 50;
            MenuSurvivorsAppearanceUI.backButton.text             = MenuDashboardUI.localization.format("BackButtonText");
            MenuSurvivorsAppearanceUI.backButton.tooltip          = MenuDashboardUI.localization.format("BackButtonTooltip");
            SleekButton sleekButton14 = MenuSurvivorsAppearanceUI.backButton;

            if (MenuSurvivorsAppearanceUI.< > f__mg$cacheD == null)
            {
                MenuSurvivorsAppearanceUI.< > f__mg$cacheD = new ClickedButton(MenuSurvivorsAppearanceUI.onClickedBackButton);
            }
            sleekButton14.onClickedButton = MenuSurvivorsAppearanceUI.< > f__mg$cacheD;
            MenuSurvivorsAppearanceUI.backButton.fontSize = 14;
            MenuSurvivorsAppearanceUI.backButton.iconImage.backgroundTint = ESleekTint.FOREGROUND;
            MenuSurvivorsAppearanceUI.container.add(MenuSurvivorsAppearanceUI.backButton);
        }
        void InitializeComponent()
        {
            _outterBox.SetLayoutCallback(OnLayout);

            _surfaceLayout = new ELayout(this);
            _surfaceLayout.Show();
            _surface = new CircleSurface(_surfaceLayout);

            _naviMenu = new CircleGenList(this, _surface)
            {
                Homogeneous     = true,
                BackgroundColor = ElmSharp.Color.Gray
            };
            _naviMenu.Show();

            _draggedUpCallback     = new SmartEvent(_naviMenu, "drag,start,up");
            _draggedUpCallback.On += (s, e) =>
            {
                if (_footer.TrackObject.IsVisible)
                {
                    Dragged?.Invoke(this, new DraggedEventArgs(DraggedState.EdgeBottom));
                }
                else
                {
                    Dragged?.Invoke(this, new DraggedEventArgs(DraggedState.Up));
                }
            };

            _draggedDownCallback     = new SmartEvent(_naviMenu, "drag,start,down");
            _draggedDownCallback.On += (s, e) =>
            {
                if (_header.TrackObject.IsVisible)
                {
                    Dragged?.Invoke(this, new DraggedEventArgs(DraggedState.EdgeTop));
                }
                else
                {
                    Dragged?.Invoke(this, new DraggedEventArgs(DraggedState.Down));
                }
            };

            _outterBox.PackEnd(_naviMenu);
            _outterBox.PackEnd(_surfaceLayout);

            _surfaceLayout.StackAbove(_naviMenu);

            _defaultClass = new GenItemClass("1icon_1text")
            {
                GetTextHandler = (obj, part) =>
                {
                    if (part == "elm.text")
                    {
                        return((obj as Item).Text);
                    }
                    return(null);
                },
                GetContentHandler = (obj, part) =>
                {
                    if (part == "elm.swallow.icon" && obj is Item menuItem && !string.IsNullOrEmpty(menuItem.Icon))
                    {
                        var icon = new ElmSharp.Image(Xamarin.Forms.Forms.NativeParent)
                        {
                            AlignmentX    = -1,
                            AlignmentY    = -1,
                            WeightX       = 1.0,
                            WeightY       = 1.0,
                            MinimumWidth  = _dafaultIconSize,
                            MinimumHeight = _dafaultIconSize,
                        };
                        icon.Show();
                        icon.Load(menuItem.Icon);
                        return(icon);
                    }
                    return(null);
                }
            };

            _naviMenu.ItemSelected += OnItemSelected;
        }

        void OnItemSelected(object sender, GenListItemEventArgs e)
        {
            ItemSelected?.Invoke(this, new SelectedItemChangedEventArgs((e.Item.Data as Item).Source, -1));
        }

        void OnLayout()
        {
            _surfaceLayout.Geometry = Geometry;
            _naviMenu.Geometry      = Geometry;
        }

        bool IsUpdated(List <List <Element> > items)
        {
            if (_itemCache == null)
            {
                return(true);
            }

            if (_itemCache.Count != items.Count)
            {
                return(true);
            }

            for (int i = 0; i < items.Count; i++)
            {
                if (_itemCache[i].Count != items[i].Count)
                {
                    return(true);
                }

                for (int j = 0; j < items[i].Count; j++)
                {
                    if (_itemCache[i][j] != items[i][j])
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
    }
        public EditorTerrainHeightUI()
        {
            Local  local  = Localization.read("/Editor/EditorTerrainHeight.dat");
            Bundle bundle = Bundles.getBundle("/Bundles/Textures/Edit/Icons/EditorTerrainHeight/EditorTerrainHeight.unity3d");

            EditorTerrainHeightUI.container = new Sleek();
            EditorTerrainHeightUI.container.positionOffset_X = 10;
            EditorTerrainHeightUI.container.positionOffset_Y = 10;
            EditorTerrainHeightUI.container.positionScale_X  = 1f;
            EditorTerrainHeightUI.container.sizeOffset_X     = -20;
            EditorTerrainHeightUI.container.sizeOffset_Y     = -20;
            EditorTerrainHeightUI.container.sizeScale_X      = 1f;
            EditorTerrainHeightUI.container.sizeScale_Y      = 1f;
            EditorUI.window.add(EditorTerrainHeightUI.container);
            EditorTerrainHeightUI.active         = false;
            EditorTerrainHeightUI.adjustUpButton = new SleekButtonIcon((Texture2D)bundle.load("Adjust_Up"));
            EditorTerrainHeightUI.adjustUpButton.positionOffset_Y = -190;
            EditorTerrainHeightUI.adjustUpButton.positionScale_Y  = 1f;
            EditorTerrainHeightUI.adjustUpButton.sizeOffset_X     = 200;
            EditorTerrainHeightUI.adjustUpButton.sizeOffset_Y     = 30;
            EditorTerrainHeightUI.adjustUpButton.text             = local.format("AdjustUpButtonText", new object[]
            {
                ControlsSettings.tool_0
            });
            EditorTerrainHeightUI.adjustUpButton.tooltip = local.format("AdjustUpButtonTooltip");
            SleekButton sleekButton = EditorTerrainHeightUI.adjustUpButton;

            if (EditorTerrainHeightUI.< > f__mg$cache0 == null)
            {
                EditorTerrainHeightUI.< > f__mg$cache0 = new ClickedButton(EditorTerrainHeightUI.onClickedAdjustUpButton);
            }
            sleekButton.onClickedButton = EditorTerrainHeightUI.< > f__mg$cache0;
            EditorTerrainHeightUI.container.add(EditorTerrainHeightUI.adjustUpButton);
            EditorTerrainHeightUI.adjustDownButton = new SleekButtonIcon((Texture2D)bundle.load("Adjust_Down"));
            EditorTerrainHeightUI.adjustDownButton.positionOffset_Y = -150;
            EditorTerrainHeightUI.adjustDownButton.positionScale_Y  = 1f;
            EditorTerrainHeightUI.adjustDownButton.sizeOffset_X     = 200;
            EditorTerrainHeightUI.adjustDownButton.sizeOffset_Y     = 30;
            EditorTerrainHeightUI.adjustDownButton.text             = local.format("AdjustDownButtonText", new object[]
            {
                ControlsSettings.tool_0
            });
            EditorTerrainHeightUI.adjustDownButton.tooltip = local.format("AdjustDownButtonTooltip");
            SleekButton sleekButton2 = EditorTerrainHeightUI.adjustDownButton;

            if (EditorTerrainHeightUI.< > f__mg$cache1 == null)
            {
                EditorTerrainHeightUI.< > f__mg$cache1 = new ClickedButton(EditorTerrainHeightUI.onClickedAdjustDownButton);
            }
            sleekButton2.onClickedButton = EditorTerrainHeightUI.< > f__mg$cache1;
            EditorTerrainHeightUI.container.add(EditorTerrainHeightUI.adjustDownButton);
            EditorTerrainHeightUI.smoothButton = new SleekButtonIcon((Texture2D)bundle.load("Smooth"));
            EditorTerrainHeightUI.smoothButton.positionOffset_Y = -110;
            EditorTerrainHeightUI.smoothButton.positionScale_Y  = 1f;
            EditorTerrainHeightUI.smoothButton.sizeOffset_X     = 200;
            EditorTerrainHeightUI.smoothButton.sizeOffset_Y     = 30;
            EditorTerrainHeightUI.smoothButton.text             = local.format("SmoothButtonText", new object[]
            {
                ControlsSettings.tool_1
            });
            EditorTerrainHeightUI.smoothButton.tooltip = local.format("SmoothButtonTooltip");
            SleekButton sleekButton3 = EditorTerrainHeightUI.smoothButton;

            if (EditorTerrainHeightUI.< > f__mg$cache2 == null)
            {
                EditorTerrainHeightUI.< > f__mg$cache2 = new ClickedButton(EditorTerrainHeightUI.onClickedSmoothButton);
            }
            sleekButton3.onClickedButton = EditorTerrainHeightUI.< > f__mg$cache2;
            EditorTerrainHeightUI.container.add(EditorTerrainHeightUI.smoothButton);
            EditorTerrainHeightUI.flattenButton = new SleekButtonIcon((Texture2D)bundle.load("Flatten"));
            EditorTerrainHeightUI.flattenButton.positionOffset_Y = -70;
            EditorTerrainHeightUI.flattenButton.positionScale_Y  = 1f;
            EditorTerrainHeightUI.flattenButton.sizeOffset_X     = 200;
            EditorTerrainHeightUI.flattenButton.sizeOffset_Y     = 30;
            EditorTerrainHeightUI.flattenButton.text             = local.format("FlattenButtonText", new object[]
            {
                ControlsSettings.tool_2
            });
            EditorTerrainHeightUI.flattenButton.tooltip = local.format("FlattenButtonTooltip");
            SleekButton sleekButton4 = EditorTerrainHeightUI.flattenButton;

            if (EditorTerrainHeightUI.< > f__mg$cache3 == null)
            {
                EditorTerrainHeightUI.< > f__mg$cache3 = new ClickedButton(EditorTerrainHeightUI.onClickedFlattenButton);
            }
            sleekButton4.onClickedButton = EditorTerrainHeightUI.< > f__mg$cache3;
            EditorTerrainHeightUI.container.add(EditorTerrainHeightUI.flattenButton);
            EditorTerrainHeightUI.map2Button = new SleekButtonState(new GUIContent[]
            {
                new GUIContent(local.format("Map2ButtonText1")),
                new GUIContent(local.format("Map2ButtonText2"))
            });
            EditorTerrainHeightUI.map2Button.positionOffset_Y = -30;
            EditorTerrainHeightUI.map2Button.positionScale_Y  = 1f;
            EditorTerrainHeightUI.map2Button.sizeOffset_X     = 200;
            EditorTerrainHeightUI.map2Button.sizeOffset_Y     = 30;
            EditorTerrainHeightUI.map2Button.tooltip          = local.format("Map2ButtonTooltip");
            SleekButtonState sleekButtonState = EditorTerrainHeightUI.map2Button;

            if (EditorTerrainHeightUI.< > f__mg$cache4 == null)
            {
                EditorTerrainHeightUI.< > f__mg$cache4 = new SwappedState(EditorTerrainHeightUI.onSwappedMap2);
            }
            sleekButtonState.onSwappedState = EditorTerrainHeightUI.< > f__mg$cache4;
            EditorTerrainHeightUI.container.add(EditorTerrainHeightUI.map2Button);
            EditorTerrainHeightUI.noiseSlider = new SleekSlider();
            EditorTerrainHeightUI.noiseSlider.positionOffset_Y = -320;
            EditorTerrainHeightUI.noiseSlider.positionScale_Y  = 1f;
            EditorTerrainHeightUI.noiseSlider.sizeOffset_X     = 200;
            EditorTerrainHeightUI.noiseSlider.sizeOffset_Y     = 20;
            EditorTerrainHeightUI.noiseSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorTerrainHeightUI.noiseSlider.state            = EditorTerrainHeight.brushNoise;
            EditorTerrainHeightUI.noiseSlider.addLabel(local.format("NoiseSliderLabelText"), ESleekSide.RIGHT);
            SleekSlider sleekSlider = EditorTerrainHeightUI.noiseSlider;

            if (EditorTerrainHeightUI.< > f__mg$cache5 == null)
            {
                EditorTerrainHeightUI.< > f__mg$cache5 = new Dragged(EditorTerrainHeightUI.onDraggedNoiseSlider);
            }
            sleekSlider.onDragged = EditorTerrainHeightUI.< > f__mg$cache5;
            EditorTerrainHeightUI.container.add(EditorTerrainHeightUI.noiseSlider);
            EditorTerrainHeightUI.sizeSlider = new SleekSlider();
            EditorTerrainHeightUI.sizeSlider.positionOffset_Y = -290;
            EditorTerrainHeightUI.sizeSlider.positionScale_Y  = 1f;
            EditorTerrainHeightUI.sizeSlider.sizeOffset_X     = 200;
            EditorTerrainHeightUI.sizeSlider.sizeOffset_Y     = 20;
            EditorTerrainHeightUI.sizeSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorTerrainHeightUI.sizeSlider.state            = (float)(EditorTerrainHeight.brushSize - EditorTerrainHeight.MIN_BRUSH_SIZE) / (float)EditorTerrainHeight.MAX_BRUSH_SIZE;
            EditorTerrainHeightUI.sizeSlider.addLabel(local.format("SizeSliderLabelText"), ESleekSide.RIGHT);
            SleekSlider sleekSlider2 = EditorTerrainHeightUI.sizeSlider;

            if (EditorTerrainHeightUI.< > f__mg$cache6 == null)
            {
                EditorTerrainHeightUI.< > f__mg$cache6 = new Dragged(EditorTerrainHeightUI.onDraggedSizeSlider);
            }
            sleekSlider2.onDragged = EditorTerrainHeightUI.< > f__mg$cache6;
            EditorTerrainHeightUI.container.add(EditorTerrainHeightUI.sizeSlider);
            EditorTerrainHeightUI.strengthSlider = new SleekSlider();
            EditorTerrainHeightUI.strengthSlider.positionOffset_Y = -260;
            EditorTerrainHeightUI.strengthSlider.positionScale_Y  = 1f;
            EditorTerrainHeightUI.strengthSlider.sizeOffset_X     = 200;
            EditorTerrainHeightUI.strengthSlider.sizeOffset_Y     = 20;
            EditorTerrainHeightUI.strengthSlider.orientation      = ESleekOrientation.HORIZONTAL;
            EditorTerrainHeightUI.strengthSlider.addLabel(local.format("StrengthSliderLabelText"), ESleekSide.RIGHT);
            EditorTerrainHeightUI.strengthSlider.state = EditorTerrainHeight.brushStrength;
            SleekSlider sleekSlider3 = EditorTerrainHeightUI.strengthSlider;

            if (EditorTerrainHeightUI.< > f__mg$cache7 == null)
            {
                EditorTerrainHeightUI.< > f__mg$cache7 = new Dragged(EditorTerrainHeightUI.onDraggedStrengthSlider);
            }
            sleekSlider3.onDragged = EditorTerrainHeightUI.< > f__mg$cache7;
            EditorTerrainHeightUI.container.add(EditorTerrainHeightUI.strengthSlider);
            EditorTerrainHeightUI.heightValue = new SleekValue();
            EditorTerrainHeightUI.heightValue.positionOffset_Y = -230;
            EditorTerrainHeightUI.heightValue.positionScale_Y  = 1f;
            EditorTerrainHeightUI.heightValue.sizeOffset_X     = 200;
            EditorTerrainHeightUI.heightValue.sizeOffset_Y     = 30;
            EditorTerrainHeightUI.heightValue.addLabel(local.format("HeightValueLabelText"), ESleekSide.RIGHT);
            EditorTerrainHeightUI.heightValue.state = EditorTerrainHeight.brushHeight;
            SleekValue sleekValue = EditorTerrainHeightUI.heightValue;

            if (EditorTerrainHeightUI.< > f__mg$cache8 == null)
            {
                EditorTerrainHeightUI.< > f__mg$cache8 = new Valued(EditorTerrainHeightUI.onValuedHeightValue);
            }
            sleekValue.onValued = EditorTerrainHeightUI.< > f__mg$cache8;
            EditorTerrainHeightUI.container.add(EditorTerrainHeightUI.heightValue);
            bundle.unload();
        }
 public static void updateSelection()
 {
     if ((int)EditorSpawns.selectedZombie < LevelZombies.tables.Count)
     {
         ZombieTable zombieTable = LevelZombies.tables[(int)EditorSpawns.selectedZombie];
         EditorSpawnsZombiesUI.selectedBox.text         = zombieTable.name;
         EditorSpawnsZombiesUI.tableNameField.text      = zombieTable.name;
         EditorSpawnsZombiesUI.tableColorPicker.state   = zombieTable.color;
         EditorSpawnsZombiesUI.megaToggle.state         = zombieTable.isMega;
         EditorSpawnsZombiesUI.healthField.state        = zombieTable.health;
         EditorSpawnsZombiesUI.damageField.state        = zombieTable.damage;
         EditorSpawnsZombiesUI.lootIndexField.state     = zombieTable.lootIndex;
         EditorSpawnsZombiesUI.lootIDField.state        = zombieTable.lootID;
         EditorSpawnsZombiesUI.xpField.state            = zombieTable.xp;
         EditorSpawnsZombiesUI.regenField.state         = zombieTable.regen;
         EditorSpawnsZombiesUI.difficultyGUIDField.text = zombieTable.difficultyGUID;
         if (EditorSpawnsZombiesUI.slotButtons != null)
         {
             for (int i = 0; i < EditorSpawnsZombiesUI.slotButtons.Length; i++)
             {
                 EditorSpawnsZombiesUI.spawnsScrollBox.remove(EditorSpawnsZombiesUI.slotButtons[i]);
             }
         }
         EditorSpawnsZombiesUI.slotButtons = new SleekButton[zombieTable.slots.Length];
         for (int j = 0; j < EditorSpawnsZombiesUI.slotButtons.Length; j++)
         {
             ZombieSlot  zombieSlot  = zombieTable.slots[j];
             SleekButton sleekButton = new SleekButton();
             sleekButton.positionOffset_X = 240;
             sleekButton.positionOffset_Y = 460 + j * 70;
             sleekButton.sizeOffset_X     = 200;
             sleekButton.sizeOffset_Y     = 30;
             sleekButton.text             = EditorSpawnsZombiesUI.localization.format("Slot_" + j);
             SleekButton sleekButton2 = sleekButton;
             if (EditorSpawnsZombiesUI.< > f__mg$cache1 == null)
             {
                 EditorSpawnsZombiesUI.< > f__mg$cache1 = new ClickedButton(EditorSpawnsZombiesUI.onClickedSlotButton);
             }
             sleekButton2.onClickedButton = EditorSpawnsZombiesUI.< > f__mg$cache1;
             EditorSpawnsZombiesUI.spawnsScrollBox.add(sleekButton);
             SleekSlider sleekSlider = new SleekSlider();
             sleekSlider.positionOffset_Y = 40;
             sleekSlider.sizeOffset_X     = 200;
             sleekSlider.sizeOffset_Y     = 20;
             sleekSlider.orientation      = ESleekOrientation.HORIZONTAL;
             sleekSlider.state            = zombieSlot.chance;
             sleekSlider.addLabel(Mathf.RoundToInt(zombieSlot.chance * 100f) + "%", ESleekSide.LEFT);
             SleekSlider sleekSlider2 = sleekSlider;
             if (EditorSpawnsZombiesUI.< > f__mg$cache2 == null)
             {
                 EditorSpawnsZombiesUI.< > f__mg$cache2 = new Dragged(EditorSpawnsZombiesUI.onDraggedChanceSlider);
             }
             sleekSlider2.onDragged = EditorSpawnsZombiesUI.< > f__mg$cache2;
             sleekButton.add(sleekSlider);
             EditorSpawnsZombiesUI.slotButtons[j] = sleekButton;
         }
         if (EditorSpawnsZombiesUI.clothButtons != null)
         {
             for (int k = 0; k < EditorSpawnsZombiesUI.clothButtons.Length; k++)
             {
                 EditorSpawnsZombiesUI.spawnsScrollBox.remove(EditorSpawnsZombiesUI.clothButtons[k]);
             }
         }
         if ((int)EditorSpawnsZombiesUI.selectedSlot < zombieTable.slots.Length)
         {
             EditorSpawnsZombiesUI.clothButtons = new SleekButton[zombieTable.slots[(int)EditorSpawnsZombiesUI.selectedSlot].table.Count];
             for (int l = 0; l < EditorSpawnsZombiesUI.clothButtons.Length; l++)
             {
                 SleekButton sleekButton3 = new SleekButton();
                 sleekButton3.positionOffset_X = 240;
                 sleekButton3.positionOffset_Y = 460 + EditorSpawnsZombiesUI.slotButtons.Length * 70 + l * 40;
                 sleekButton3.sizeOffset_X     = 200;
                 sleekButton3.sizeOffset_Y     = 30;
                 ItemAsset itemAsset = (ItemAsset)Assets.find(EAssetType.ITEM, zombieTable.slots[(int)EditorSpawnsZombiesUI.selectedSlot].table[l].item);
                 string    str       = "?";
                 if (itemAsset != null)
                 {
                     if (string.IsNullOrEmpty(itemAsset.itemName))
                     {
                         str = itemAsset.name;
                     }
                     else
                     {
                         str = itemAsset.itemName;
                     }
                 }
                 sleekButton3.text = zombieTable.slots[(int)EditorSpawnsZombiesUI.selectedSlot].table[l].item.ToString() + " " + str;
                 SleekButton sleekButton4 = sleekButton3;
                 if (EditorSpawnsZombiesUI.< > f__mg$cache3 == null)
                 {
                     EditorSpawnsZombiesUI.< > f__mg$cache3 = new ClickedButton(EditorSpawnsZombiesUI.onClickItemButton);
                 }
                 sleekButton4.onClickedButton = EditorSpawnsZombiesUI.< > f__mg$cache3;
                 EditorSpawnsZombiesUI.spawnsScrollBox.add(sleekButton3);
                 EditorSpawnsZombiesUI.clothButtons[l] = sleekButton3;
             }
         }
         else
         {
             EditorSpawnsZombiesUI.clothButtons = new SleekButton[0];
         }
         EditorSpawnsZombiesUI.itemIDField.positionOffset_Y      = 460 + EditorSpawnsZombiesUI.slotButtons.Length * 70 + EditorSpawnsZombiesUI.clothButtons.Length * 40;
         EditorSpawnsZombiesUI.addItemButton.positionOffset_Y    = 460 + EditorSpawnsZombiesUI.slotButtons.Length * 70 + EditorSpawnsZombiesUI.clothButtons.Length * 40 + 40;
         EditorSpawnsZombiesUI.removeItemButton.positionOffset_Y = 460 + EditorSpawnsZombiesUI.slotButtons.Length * 70 + EditorSpawnsZombiesUI.clothButtons.Length * 40 + 40;
         EditorSpawnsZombiesUI.spawnsScrollBox.area = new Rect(0f, 0f, 5f, (float)(460 + EditorSpawnsZombiesUI.slotButtons.Length * 70 + EditorSpawnsZombiesUI.clothButtons.Length * 40 + 70));
     }
     else
     {
         EditorSpawnsZombiesUI.selectedBox.text         = string.Empty;
         EditorSpawnsZombiesUI.tableNameField.text      = string.Empty;
         EditorSpawnsZombiesUI.tableColorPicker.state   = Color.white;
         EditorSpawnsZombiesUI.megaToggle.state         = false;
         EditorSpawnsZombiesUI.healthField.state        = 0;
         EditorSpawnsZombiesUI.damageField.state        = 0;
         EditorSpawnsZombiesUI.lootIndexField.state     = 0;
         EditorSpawnsZombiesUI.lootIDField.state        = 0;
         EditorSpawnsZombiesUI.xpField.state            = 0u;
         EditorSpawnsZombiesUI.regenField.state         = 0f;
         EditorSpawnsZombiesUI.difficultyGUIDField.text = string.Empty;
         if (EditorSpawnsZombiesUI.slotButtons != null)
         {
             for (int m = 0; m < EditorSpawnsZombiesUI.slotButtons.Length; m++)
             {
                 EditorSpawnsZombiesUI.spawnsScrollBox.remove(EditorSpawnsZombiesUI.slotButtons[m]);
             }
         }
         EditorSpawnsZombiesUI.slotButtons = null;
         if (EditorSpawnsZombiesUI.clothButtons != null)
         {
             for (int n = 0; n < EditorSpawnsZombiesUI.clothButtons.Length; n++)
             {
                 EditorSpawnsZombiesUI.spawnsScrollBox.remove(EditorSpawnsZombiesUI.clothButtons[n]);
             }
         }
         EditorSpawnsZombiesUI.clothButtons = null;
         EditorSpawnsZombiesUI.itemIDField.positionOffset_Y      = 460;
         EditorSpawnsZombiesUI.addItemButton.positionOffset_Y    = 500;
         EditorSpawnsZombiesUI.removeItemButton.positionOffset_Y = 500;
         EditorSpawnsZombiesUI.spawnsScrollBox.area = new Rect(0f, 0f, 5f, 530f);
     }
 }
Example #27
0
        public void Update()
        {
            MouseState    mouse    = Mouse.GetState();
            KeyboardState keyboard = Keyboard.GetState();

            Voxel underMouse = GetVoxelUnderMouse();
            bool  newVoxel   = underMouse != null && !underMouse.Equals(VoxelUnderMouse);

            if (underMouse != null)
            {
                VoxelUnderMouse          = underMouse;
                PlayState.CursorLightPos = underMouse.Position + new Vector3(0.5f, 0.5f, 0.5f);

                if (Enabled && underMouse.TypeName != "empty" && underMouse.IsExplored)
                {
                    string info = underMouse.TypeName;


                    if (PlayState.PlayerFaction.RoomBuilder.IsInRoom(underMouse))
                    {
                        Room room = PlayState.PlayerFaction.RoomBuilder.GetMostLikelyRoom(underMouse);

                        if (room != null)
                        {
                            info += " (" + room.ID + ")";
                        }
                    }
                    PlayState.GUI.ToolTipManager.PopupInfo(info);
                }
            }

            if (!Enabled)
            {
                return;
            }

            if (keyboard.IsKeyDown(Keys.LeftAlt) || keyboard.IsKeyDown(Keys.RightAlt))
            {
                BoxYOffset    += (float)(mouse.ScrollWheelValue - LastMouseWheel) * 0.01f;
                LastMouseWheel = mouse.ScrollWheelValue;
                newVoxel       = true;
            }
            else
            {
                LastMouseWheel = mouse.ScrollWheelValue;
            }


            if (underMouse != null)
            {
                BoundingBox box = underMouse.GetBoundingBox().Expand(0.05f);
                Drawer3D.DrawBox(box, CurrentColor, CurrentWidth, true);
            }

            if (isLeftPressed)
            {
                if (mouse.LeftButton == ButtonState.Released)
                {
                    isLeftPressed = false;
                    LeftReleasedCallback();
                    BoxYOffset = 0;
                }
                else
                {
                    if (SelectionBuffer.Count == 0)
                    {
                        FirstVoxel = underMouse;
                        SelectionBuffer.Add(underMouse);
                    }
                    else
                    {
                        SelectionBuffer.Clear();
                        SelectionBuffer.Add(FirstVoxel);
                        SelectionBuffer.Add(underMouse);
                        BoundingBox buffer = GetSelectionBox();


                        if (BoxYOffset > 0)
                        {
                            buffer.Max.Y += BoxYOffset;
                        }
                        else if (BoxYOffset < 0)
                        {
                            buffer.Min.Y += BoxYOffset;
                        }

                        SelectionBuffer = Chunks.GetVoxelsIntersecting(buffer);

                        if (newVoxel)
                        {
                            Dragged.Invoke(SelectionBuffer, InputManager.MouseButton.Left);
                        }
                    }
                }
            }
            else if (mouse.LeftButton == ButtonState.Pressed)
            {
                LeftPressedCallback();
                isLeftPressed = true;
                BoxYOffset    = 0;
            }


            if (isRightPressed)
            {
                if (mouse.RightButton == ButtonState.Released)
                {
                    isRightPressed = false;
                    RightReleasedCallback();
                    BoxYOffset = 0;
                }
                else
                {
                    if (SelectionBuffer.Count == 0)
                    {
                        SelectionBuffer.Add(underMouse);
                        FirstVoxel = underMouse;
                    }
                    else
                    {
                        SelectionBuffer.Clear();
                        SelectionBuffer.Add(FirstVoxel);
                        SelectionBuffer.Add(underMouse);
                        BoundingBox buffer = GetSelectionBox();
                        if (BoxYOffset > 0)
                        {
                            buffer.Max.Y += BoxYOffset;
                        }
                        else if (BoxYOffset < 0)
                        {
                            buffer.Min.Y += BoxYOffset;
                        }


                        SelectionBuffer = Chunks.GetVoxelsIntersecting(buffer);
                        if (newVoxel)
                        {
                            Dragged.Invoke(SelectionBuffer, InputManager.MouseButton.Right);
                        }
                    }
                }
            }
            else if (mouse.RightButton == ButtonState.Pressed)
            {
                RightPressedCallback();
                BoxYOffset     = 0;
                isRightPressed = true;
            }
        }
        public EditorEnvironmentNodesUI()
        {
            Local local = Localization.read("/Editor/EditorEnvironmentNodes.dat");

            EditorEnvironmentNodesUI.container = new Sleek();
            EditorEnvironmentNodesUI.container.positionOffset_X = 10;
            EditorEnvironmentNodesUI.container.positionOffset_Y = 10;
            EditorEnvironmentNodesUI.container.positionScale_X  = 1f;
            EditorEnvironmentNodesUI.container.sizeOffset_X     = -20;
            EditorEnvironmentNodesUI.container.sizeOffset_Y     = -20;
            EditorEnvironmentNodesUI.container.sizeScale_X      = 1f;
            EditorEnvironmentNodesUI.container.sizeScale_Y      = 1f;
            EditorUI.window.add(EditorEnvironmentNodesUI.container);
            EditorEnvironmentNodesUI.active    = false;
            EditorEnvironmentNodesUI.nameField = new SleekField();
            EditorEnvironmentNodesUI.nameField.positionOffset_X = -200;
            EditorEnvironmentNodesUI.nameField.positionOffset_Y = 80;
            EditorEnvironmentNodesUI.nameField.positionScale_X  = 1f;
            EditorEnvironmentNodesUI.nameField.sizeOffset_X     = 200;
            EditorEnvironmentNodesUI.nameField.sizeOffset_Y     = 30;
            EditorEnvironmentNodesUI.nameField.addLabel(local.format("Name_Label"), ESleekSide.LEFT);
            SleekField sleekField = EditorEnvironmentNodesUI.nameField;

            if (EditorEnvironmentNodesUI.< > f__mg$cache0 == null)
            {
                EditorEnvironmentNodesUI.< > f__mg$cache0 = new Typed(EditorEnvironmentNodesUI.onTypedNameField);
            }
            sleekField.onTyped = EditorEnvironmentNodesUI.< > f__mg$cache0;
            EditorEnvironmentNodesUI.nameField.maxLength = 32;
            EditorEnvironmentNodesUI.container.add(EditorEnvironmentNodesUI.nameField);
            EditorEnvironmentNodesUI.nameField.isVisible           = false;
            EditorEnvironmentNodesUI.radiusSlider                  = new SleekSlider();
            EditorEnvironmentNodesUI.radiusSlider.positionOffset_X = -200;
            EditorEnvironmentNodesUI.radiusSlider.positionOffset_Y = 80;
            EditorEnvironmentNodesUI.radiusSlider.positionScale_X  = 1f;
            EditorEnvironmentNodesUI.radiusSlider.sizeOffset_X     = 200;
            EditorEnvironmentNodesUI.radiusSlider.sizeOffset_Y     = 20;
            EditorEnvironmentNodesUI.radiusSlider.addLabel(local.format("Radius_Label"), ESleekSide.LEFT);
            EditorEnvironmentNodesUI.radiusSlider.orientation = ESleekOrientation.HORIZONTAL;
            SleekSlider sleekSlider = EditorEnvironmentNodesUI.radiusSlider;

            if (EditorEnvironmentNodesUI.< > f__mg$cache1 == null)
            {
                EditorEnvironmentNodesUI.< > f__mg$cache1 = new Dragged(EditorEnvironmentNodesUI.onDraggedRadiusSlider);
            }
            sleekSlider.onDragged = EditorEnvironmentNodesUI.< > f__mg$cache1;
            EditorEnvironmentNodesUI.container.add(EditorEnvironmentNodesUI.radiusSlider);
            EditorEnvironmentNodesUI.radiusSlider.isVisible      = false;
            EditorEnvironmentNodesUI.widthField                  = new SleekSingleField();
            EditorEnvironmentNodesUI.widthField.positionOffset_X = -200;
            EditorEnvironmentNodesUI.widthField.positionOffset_Y = 110;
            EditorEnvironmentNodesUI.widthField.positionScale_X  = 1f;
            EditorEnvironmentNodesUI.widthField.sizeOffset_X     = 200;
            EditorEnvironmentNodesUI.widthField.sizeOffset_Y     = 30;
            EditorEnvironmentNodesUI.widthField.addLabel(local.format("Width_Label"), ESleekSide.LEFT);
            SleekSingleField sleekSingleField = EditorEnvironmentNodesUI.widthField;

            if (EditorEnvironmentNodesUI.< > f__mg$cache2 == null)
            {
                EditorEnvironmentNodesUI.< > f__mg$cache2 = new TypedSingle(EditorEnvironmentNodesUI.onTypedWidthField);
            }
            sleekSingleField.onTypedSingle = EditorEnvironmentNodesUI.< > f__mg$cache2;
            EditorEnvironmentNodesUI.container.add(EditorEnvironmentNodesUI.widthField);
            EditorEnvironmentNodesUI.widthField.isVisible         = false;
            EditorEnvironmentNodesUI.heightField                  = new SleekSingleField();
            EditorEnvironmentNodesUI.heightField.positionOffset_X = -200;
            EditorEnvironmentNodesUI.heightField.positionOffset_Y = 150;
            EditorEnvironmentNodesUI.heightField.positionScale_X  = 1f;
            EditorEnvironmentNodesUI.heightField.sizeOffset_X     = 200;
            EditorEnvironmentNodesUI.heightField.sizeOffset_Y     = 30;
            EditorEnvironmentNodesUI.heightField.addLabel(local.format("Height_Label"), ESleekSide.LEFT);
            SleekSingleField sleekSingleField2 = EditorEnvironmentNodesUI.heightField;

            if (EditorEnvironmentNodesUI.< > f__mg$cache3 == null)
            {
                EditorEnvironmentNodesUI.< > f__mg$cache3 = new TypedSingle(EditorEnvironmentNodesUI.onTypedHeightField);
            }
            sleekSingleField2.onTypedSingle = EditorEnvironmentNodesUI.< > f__mg$cache3;
            EditorEnvironmentNodesUI.container.add(EditorEnvironmentNodesUI.heightField);
            EditorEnvironmentNodesUI.heightField.isVisible        = false;
            EditorEnvironmentNodesUI.lengthField                  = new SleekSingleField();
            EditorEnvironmentNodesUI.lengthField.positionOffset_X = -200;
            EditorEnvironmentNodesUI.lengthField.positionOffset_Y = 190;
            EditorEnvironmentNodesUI.lengthField.positionScale_X  = 1f;
            EditorEnvironmentNodesUI.lengthField.sizeOffset_X     = 200;
            EditorEnvironmentNodesUI.lengthField.sizeOffset_Y     = 30;
            EditorEnvironmentNodesUI.lengthField.addLabel(local.format("Length_Label"), ESleekSide.LEFT);
            SleekSingleField sleekSingleField3 = EditorEnvironmentNodesUI.lengthField;

            if (EditorEnvironmentNodesUI.< > f__mg$cache4 == null)
            {
                EditorEnvironmentNodesUI.< > f__mg$cache4 = new TypedSingle(EditorEnvironmentNodesUI.onTypedLengthField);
            }
            sleekSingleField3.onTypedSingle = EditorEnvironmentNodesUI.< > f__mg$cache4;
            EditorEnvironmentNodesUI.container.add(EditorEnvironmentNodesUI.lengthField);
            EditorEnvironmentNodesUI.lengthField.isVisible = false;
            EditorEnvironmentNodesUI.shapeButton           = new SleekButtonState(new GUIContent[]
            {
                new GUIContent(local.format("Sphere")),
                new GUIContent(local.format("Box"))
            });
            EditorEnvironmentNodesUI.shapeButton.positionOffset_X = -200;
            EditorEnvironmentNodesUI.shapeButton.positionOffset_Y = 230;
            EditorEnvironmentNodesUI.shapeButton.positionScale_X  = 1f;
            EditorEnvironmentNodesUI.shapeButton.sizeOffset_X     = 200;
            EditorEnvironmentNodesUI.shapeButton.sizeOffset_Y     = 30;
            EditorEnvironmentNodesUI.shapeButton.tooltip          = local.format("Shape_Tooltip");
            SleekButtonState sleekButtonState = EditorEnvironmentNodesUI.shapeButton;

            if (EditorEnvironmentNodesUI.< > f__mg$cache5 == null)
            {
                EditorEnvironmentNodesUI.< > f__mg$cache5 = new SwappedState(EditorEnvironmentNodesUI.onSwappedShape);
            }
            sleekButtonState.onSwappedState = EditorEnvironmentNodesUI.< > f__mg$cache5;
            EditorEnvironmentNodesUI.container.add(EditorEnvironmentNodesUI.shapeButton);
            EditorEnvironmentNodesUI.shapeButton.isVisible        = false;
            EditorEnvironmentNodesUI.itemIDField                  = new SleekUInt16Field();
            EditorEnvironmentNodesUI.itemIDField.positionOffset_X = -200;
            EditorEnvironmentNodesUI.itemIDField.positionOffset_Y = 110;
            EditorEnvironmentNodesUI.itemIDField.positionScale_X  = 1f;
            EditorEnvironmentNodesUI.itemIDField.sizeOffset_X     = 200;
            EditorEnvironmentNodesUI.itemIDField.sizeOffset_Y     = 30;
            EditorEnvironmentNodesUI.itemIDField.addLabel(local.format("Item_ID_Label"), ESleekSide.LEFT);
            SleekUInt16Field sleekUInt16Field = EditorEnvironmentNodesUI.itemIDField;

            if (EditorEnvironmentNodesUI.< > f__mg$cache6 == null)
            {
                EditorEnvironmentNodesUI.< > f__mg$cache6 = new TypedUInt16(EditorEnvironmentNodesUI.onTypedItemIDField);
            }
            sleekUInt16Field.onTypedUInt16 = EditorEnvironmentNodesUI.< > f__mg$cache6;
            EditorEnvironmentNodesUI.container.add(EditorEnvironmentNodesUI.itemIDField);
            EditorEnvironmentNodesUI.itemIDField.isVisible      = false;
            EditorEnvironmentNodesUI.costField                  = new SleekUInt32Field();
            EditorEnvironmentNodesUI.costField.positionOffset_X = -200;
            EditorEnvironmentNodesUI.costField.positionOffset_Y = 150;
            EditorEnvironmentNodesUI.costField.positionScale_X  = 1f;
            EditorEnvironmentNodesUI.costField.sizeOffset_X     = 200;
            EditorEnvironmentNodesUI.costField.sizeOffset_Y     = 30;
            EditorEnvironmentNodesUI.costField.addLabel(local.format("Cost_Label"), ESleekSide.LEFT);
            SleekUInt32Field sleekUInt32Field = EditorEnvironmentNodesUI.costField;

            if (EditorEnvironmentNodesUI.< > f__mg$cache7 == null)
            {
                EditorEnvironmentNodesUI.< > f__mg$cache7 = new TypedUInt32(EditorEnvironmentNodesUI.onTypedCostField);
            }
            sleekUInt32Field.onTypedUInt32 = EditorEnvironmentNodesUI.< > f__mg$cache7;
            EditorEnvironmentNodesUI.container.add(EditorEnvironmentNodesUI.costField);
            EditorEnvironmentNodesUI.costField.isVisible           = false;
            EditorEnvironmentNodesUI.heightToggle                  = new SleekToggle();
            EditorEnvironmentNodesUI.heightToggle.positionOffset_X = -40;
            EditorEnvironmentNodesUI.heightToggle.positionOffset_Y = 110;
            EditorEnvironmentNodesUI.heightToggle.positionScale_X  = 1f;
            EditorEnvironmentNodesUI.heightToggle.sizeOffset_X     = 40;
            EditorEnvironmentNodesUI.heightToggle.sizeOffset_Y     = 40;
            EditorEnvironmentNodesUI.heightToggle.addLabel(local.format("Height_Label"), ESleekSide.LEFT);
            SleekToggle sleekToggle = EditorEnvironmentNodesUI.heightToggle;

            if (EditorEnvironmentNodesUI.< > f__mg$cache8 == null)
            {
                EditorEnvironmentNodesUI.< > f__mg$cache8 = new Toggled(EditorEnvironmentNodesUI.onToggledHeightToggle);
            }
            sleekToggle.onToggled = EditorEnvironmentNodesUI.< > f__mg$cache8;
            EditorEnvironmentNodesUI.container.add(EditorEnvironmentNodesUI.heightToggle);
            EditorEnvironmentNodesUI.heightToggle.isVisible           = false;
            EditorEnvironmentNodesUI.noWeaponsToggle                  = new SleekToggle();
            EditorEnvironmentNodesUI.noWeaponsToggle.positionOffset_X = -40;
            EditorEnvironmentNodesUI.noWeaponsToggle.positionOffset_Y = 160;
            EditorEnvironmentNodesUI.noWeaponsToggle.positionScale_X  = 1f;
            EditorEnvironmentNodesUI.noWeaponsToggle.sizeOffset_X     = 40;
            EditorEnvironmentNodesUI.noWeaponsToggle.sizeOffset_Y     = 40;
            EditorEnvironmentNodesUI.noWeaponsToggle.addLabel(local.format("No_Weapons_Label"), ESleekSide.LEFT);
            SleekToggle sleekToggle2 = EditorEnvironmentNodesUI.noWeaponsToggle;

            if (EditorEnvironmentNodesUI.< > f__mg$cache9 == null)
            {
                EditorEnvironmentNodesUI.< > f__mg$cache9 = new Toggled(EditorEnvironmentNodesUI.onToggledNoWeaponsToggle);
            }
            sleekToggle2.onToggled = EditorEnvironmentNodesUI.< > f__mg$cache9;
            EditorEnvironmentNodesUI.container.add(EditorEnvironmentNodesUI.noWeaponsToggle);
            EditorEnvironmentNodesUI.noWeaponsToggle.isVisible           = false;
            EditorEnvironmentNodesUI.noBuildablesToggle                  = new SleekToggle();
            EditorEnvironmentNodesUI.noBuildablesToggle.positionOffset_X = -40;
            EditorEnvironmentNodesUI.noBuildablesToggle.positionOffset_Y = 210;
            EditorEnvironmentNodesUI.noBuildablesToggle.positionScale_X  = 1f;
            EditorEnvironmentNodesUI.noBuildablesToggle.sizeOffset_X     = 40;
            EditorEnvironmentNodesUI.noBuildablesToggle.sizeOffset_Y     = 40;
            EditorEnvironmentNodesUI.noBuildablesToggle.addLabel(local.format("No_Buildables_Label"), ESleekSide.LEFT);
            SleekToggle sleekToggle3 = EditorEnvironmentNodesUI.noBuildablesToggle;

            if (EditorEnvironmentNodesUI.< > f__mg$cacheA == null)
            {
                EditorEnvironmentNodesUI.< > f__mg$cacheA = new Toggled(EditorEnvironmentNodesUI.onToggledNoBuildablesToggle);
            }
            sleekToggle3.onToggled = EditorEnvironmentNodesUI.< > f__mg$cacheA;
            EditorEnvironmentNodesUI.container.add(EditorEnvironmentNodesUI.noBuildablesToggle);
            EditorEnvironmentNodesUI.noBuildablesToggle.isVisible = false;
            EditorEnvironmentNodesUI.spawnIDField = new SleekUInt16Field();
            EditorEnvironmentNodesUI.spawnIDField.positionOffset_X = -200;
            EditorEnvironmentNodesUI.spawnIDField.positionOffset_Y = 80;
            EditorEnvironmentNodesUI.spawnIDField.positionScale_X  = 1f;
            EditorEnvironmentNodesUI.spawnIDField.sizeOffset_X     = 200;
            EditorEnvironmentNodesUI.spawnIDField.sizeOffset_Y     = 30;
            EditorEnvironmentNodesUI.spawnIDField.addLabel(local.format("Spawn_ID_Label"), ESleekSide.LEFT);
            SleekUInt16Field sleekUInt16Field2 = EditorEnvironmentNodesUI.spawnIDField;

            if (EditorEnvironmentNodesUI.< > f__mg$cacheB == null)
            {
                EditorEnvironmentNodesUI.< > f__mg$cacheB = new TypedUInt16(EditorEnvironmentNodesUI.onTypedSpawnIDField);
            }
            sleekUInt16Field2.onTypedUInt16 = EditorEnvironmentNodesUI.< > f__mg$cacheB;
            EditorEnvironmentNodesUI.container.add(EditorEnvironmentNodesUI.spawnIDField);
            EditorEnvironmentNodesUI.spawnIDField.isVisible         = false;
            EditorEnvironmentNodesUI.effectIDField                  = new SleekUInt16Field();
            EditorEnvironmentNodesUI.effectIDField.positionOffset_X = -200;
            EditorEnvironmentNodesUI.effectIDField.positionOffset_Y = 270;
            EditorEnvironmentNodesUI.effectIDField.positionScale_X  = 1f;
            EditorEnvironmentNodesUI.effectIDField.sizeOffset_X     = 200;
            EditorEnvironmentNodesUI.effectIDField.sizeOffset_Y     = 30;
            EditorEnvironmentNodesUI.effectIDField.addLabel(local.format("Effect_ID_Label"), ESleekSide.LEFT);
            SleekUInt16Field sleekUInt16Field3 = EditorEnvironmentNodesUI.effectIDField;

            if (EditorEnvironmentNodesUI.< > f__mg$cacheC == null)
            {
                EditorEnvironmentNodesUI.< > f__mg$cacheC = new TypedUInt16(EditorEnvironmentNodesUI.onTypedEffectIDField);
            }
            sleekUInt16Field3.onTypedUInt16 = EditorEnvironmentNodesUI.< > f__mg$cacheC;
            EditorEnvironmentNodesUI.container.add(EditorEnvironmentNodesUI.effectIDField);
            EditorEnvironmentNodesUI.effectIDField.isVisible        = false;
            EditorEnvironmentNodesUI.noWaterToggle                  = new SleekToggle();
            EditorEnvironmentNodesUI.noWaterToggle.positionOffset_X = -40;
            EditorEnvironmentNodesUI.noWaterToggle.positionOffset_Y = 310;
            EditorEnvironmentNodesUI.noWaterToggle.positionScale_X  = 1f;
            EditorEnvironmentNodesUI.noWaterToggle.sizeOffset_X     = 40;
            EditorEnvironmentNodesUI.noWaterToggle.sizeOffset_Y     = 40;
            EditorEnvironmentNodesUI.noWaterToggle.addLabel(local.format("No_Water_Label"), ESleekSide.LEFT);
            SleekToggle sleekToggle4 = EditorEnvironmentNodesUI.noWaterToggle;

            if (EditorEnvironmentNodesUI.< > f__mg$cacheD == null)
            {
                EditorEnvironmentNodesUI.< > f__mg$cacheD = new Toggled(EditorEnvironmentNodesUI.onToggledNoWaterToggle);
            }
            sleekToggle4.onToggled = EditorEnvironmentNodesUI.< > f__mg$cacheD;
            EditorEnvironmentNodesUI.container.add(EditorEnvironmentNodesUI.noWaterToggle);
            EditorEnvironmentNodesUI.noWaterToggle.isVisible           = false;
            EditorEnvironmentNodesUI.noLightingToggle                  = new SleekToggle();
            EditorEnvironmentNodesUI.noLightingToggle.positionOffset_X = -40;
            EditorEnvironmentNodesUI.noLightingToggle.positionOffset_Y = 360;
            EditorEnvironmentNodesUI.noLightingToggle.positionScale_X  = 1f;
            EditorEnvironmentNodesUI.noLightingToggle.sizeOffset_X     = 40;
            EditorEnvironmentNodesUI.noLightingToggle.sizeOffset_Y     = 40;
            EditorEnvironmentNodesUI.noLightingToggle.addLabel(local.format("No_Lighting_Label"), ESleekSide.LEFT);
            SleekToggle sleekToggle5 = EditorEnvironmentNodesUI.noLightingToggle;

            if (EditorEnvironmentNodesUI.< > f__mg$cacheE == null)
            {
                EditorEnvironmentNodesUI.< > f__mg$cacheE = new Toggled(EditorEnvironmentNodesUI.onToggledNoLightingToggle);
            }
            sleekToggle5.onToggled = EditorEnvironmentNodesUI.< > f__mg$cacheE;
            EditorEnvironmentNodesUI.container.add(EditorEnvironmentNodesUI.noLightingToggle);
            EditorEnvironmentNodesUI.noLightingToggle.isVisible = false;
            EditorEnvironmentNodesUI.typeButton = new SleekButtonState(new GUIContent[]
            {
                new GUIContent(local.format("Location")),
                new GUIContent(local.format("Safezone")),
                new GUIContent(local.format("Purchase")),
                new GUIContent(local.format("Arena")),
                new GUIContent(local.format("Deadzone")),
                new GUIContent(local.format("Airdrop")),
                new GUIContent(local.format("Effect"))
            });
            EditorEnvironmentNodesUI.typeButton.positionOffset_Y = -30;
            EditorEnvironmentNodesUI.typeButton.positionScale_Y  = 1f;
            EditorEnvironmentNodesUI.typeButton.sizeOffset_X     = 200;
            EditorEnvironmentNodesUI.typeButton.sizeOffset_Y     = 30;
            EditorEnvironmentNodesUI.typeButton.tooltip          = local.format("Type_Tooltip");
            SleekButtonState sleekButtonState2 = EditorEnvironmentNodesUI.typeButton;

            if (EditorEnvironmentNodesUI.< > f__mg$cacheF == null)
            {
                EditorEnvironmentNodesUI.< > f__mg$cacheF = new SwappedState(EditorEnvironmentNodesUI.onSwappedType);
            }
            sleekButtonState2.onSwappedState = EditorEnvironmentNodesUI.< > f__mg$cacheF;
            EditorEnvironmentNodesUI.container.add(EditorEnvironmentNodesUI.typeButton);
        }
Example #29
0
        private void HandleMouseButton(ButtonState ButtonState, VoxelHandle underMouse, bool newVoxel, bool altPressed, ref bool ButtonPressed, InputManager.MouseButton Button)
        {
            // If the left mouse button is pressed, update the slection buffer.
            if (ButtonPressed)
            {
                // On release, select voxels.
                if (ButtonState == ButtonState.Released)
                {
                    ReleaseSound.Play(World.Renderer.CursorLightPos);
                    ButtonPressed = false;

                    if (SelectionBuffer.Count > 0)
                    {
                        var t = new List <VoxelHandle>(SelectionBuffer);
                        SelectionBuffer.Clear();
                        Selected.Invoke(t, Button);
                    }

                    BoxYOffset        = 0;
                    PrevBoxYOffsetInt = 0;
                }
                // Otherwise, update the selection buffer
                else
                {
                    if (SelectionBuffer.Count == 0)
                    {
                        FirstVoxel = underMouse;
                        SelectionBuffer.Add(underMouse);
                    }
                    else
                    {
                        SelectionBuffer.Clear();
                        SelectionBuffer.Add(FirstVoxel);
                        SelectionBuffer.Add(underMouse);
                        BoundingBox buffer = GetSelectionBox();

                        // Update the selection box to account for offsets from mouse wheel.
                        if (BoxYOffset > 0)
                        {
                            buffer.Max.Y = MathFunctions.Clamp(buffer.Max.Y + (int)BoxYOffset, 0, World.WorldSizeInVoxels.Y - 1);
                        }
                        else if (BoxYOffset < 0)
                        {
                            buffer.Min.Y = MathFunctions.Clamp(buffer.Min.Y - (int)BoxYOffset, 0, World.WorldSizeInVoxels.Y - 1);
                        }

                        SelectionBuffer = Select(buffer, FirstVoxel.WorldPosition, underMouse.WorldPosition).ToList();

                        if (!altPressed && Brush.CullUnseenVoxels && SelectionType == VoxelSelectionType.SelectFilled)
                        {
                            SelectionBuffer.RemoveAll(v =>
                            {
                                if (v.Equals(underMouse))
                                {
                                    return(false);
                                }
                                if (World.PersistentData.Designations.IsVoxelDesignation(v, DesignationType.Put))
                                {
                                    return(false);                                                                              // Treat put designations as solid.
                                }
                                return(!VoxelHelpers.DoesVoxelHaveVisibleSurface(World, v));
                            });
                        }

                        if (newVoxel)
                        {
                            DragSound.Play(World.Renderer.CursorLightPos, SelectionBuffer.Count / 20.0f);
                            Dragged.Invoke(SelectionBuffer, Button);
                        }
                    }
                }
            }
            // If the mouse was not previously pressed, but is now pressed, then notify us of that.
            else if (ButtonState == ButtonState.Pressed)
            {
                ClickSound.Play(World.Renderer.CursorLightPos);;
                ButtonPressed     = true;
                BoxYOffset        = 0;
                PrevBoxYOffsetInt = 0;
            }
        }
Example #30
0
        public MenuSurvivorsClothingInspectUI()
        {
            MenuSurvivorsClothingInspectUI.container = new Sleek();
            MenuSurvivorsClothingInspectUI.container.positionOffset_X = 10;
            MenuSurvivorsClothingInspectUI.container.positionOffset_Y = 10;
            MenuSurvivorsClothingInspectUI.container.positionScale_Y  = 1f;
            MenuSurvivorsClothingInspectUI.container.sizeOffset_X     = -20;
            MenuSurvivorsClothingInspectUI.container.sizeOffset_Y     = -20;
            MenuSurvivorsClothingInspectUI.container.sizeScale_X      = 1f;
            MenuSurvivorsClothingInspectUI.container.sizeScale_Y      = 1f;
            MenuUI.container.add(MenuSurvivorsClothingInspectUI.container);
            MenuSurvivorsClothingInspectUI.active    = false;
            MenuSurvivorsClothingInspectUI.inventory = new Sleek();
            MenuSurvivorsClothingInspectUI.inventory.positionScale_X  = 0.5f;
            MenuSurvivorsClothingInspectUI.inventory.positionOffset_Y = 10;
            MenuSurvivorsClothingInspectUI.inventory.sizeScale_X      = 0.5f;
            MenuSurvivorsClothingInspectUI.inventory.sizeScale_Y      = 1f;
            MenuSurvivorsClothingInspectUI.inventory.sizeOffset_Y     = -20;
            MenuSurvivorsClothingInspectUI.inventory.constraint       = ESleekConstraint.XY;
            MenuSurvivorsClothingInspectUI.container.add(MenuSurvivorsClothingInspectUI.inventory);
            MenuSurvivorsClothingInspectUI.image = new SleekInspect("RenderTextures/Item");
            MenuSurvivorsClothingInspectUI.image.positionScale_Y = 0.125f;
            MenuSurvivorsClothingInspectUI.image.sizeScale_X     = 1f;
            MenuSurvivorsClothingInspectUI.image.sizeScale_Y     = 0.75f;
            MenuSurvivorsClothingInspectUI.image.constraint      = ESleekConstraint.XY;
            MenuSurvivorsClothingInspectUI.inventory.add(MenuSurvivorsClothingInspectUI.image);
            MenuSurvivorsClothingInspectUI.slider = new SleekSlider();
            MenuSurvivorsClothingInspectUI.slider.positionOffset_Y = 10;
            MenuSurvivorsClothingInspectUI.slider.positionScale_Y  = 1f;
            MenuSurvivorsClothingInspectUI.slider.sizeOffset_Y     = 20;
            MenuSurvivorsClothingInspectUI.slider.sizeScale_X      = 1f;
            MenuSurvivorsClothingInspectUI.slider.orientation      = ESleekOrientation.HORIZONTAL;
            SleekSlider sleekSlider = MenuSurvivorsClothingInspectUI.slider;

            if (MenuSurvivorsClothingInspectUI.< > f__mg$cache0 == null)
            {
                MenuSurvivorsClothingInspectUI.< > f__mg$cache0 = new Dragged(MenuSurvivorsClothingInspectUI.onDraggedSlider);
            }
            sleekSlider.onDragged = MenuSurvivorsClothingInspectUI.< > f__mg$cache0;
            MenuSurvivorsClothingInspectUI.image.add(MenuSurvivorsClothingInspectUI.slider);
            MenuSurvivorsClothingInspectUI.inspect    = GameObject.Find("Inspect").transform;
            MenuSurvivorsClothingInspectUI.look       = MenuSurvivorsClothingInspectUI.inspect.GetComponent <ItemLook>();
            MenuSurvivorsClothingInspectUI.camera     = MenuSurvivorsClothingInspectUI.look.inspectCamera;
            MenuSurvivorsClothingInspectUI.backButton = new SleekButtonIcon((Texture2D)MenuDashboardUI.icons.load("Exit"));
            MenuSurvivorsClothingInspectUI.backButton.positionOffset_Y = -50;
            MenuSurvivorsClothingInspectUI.backButton.positionScale_Y  = 1f;
            MenuSurvivorsClothingInspectUI.backButton.sizeOffset_X     = 200;
            MenuSurvivorsClothingInspectUI.backButton.sizeOffset_Y     = 50;
            MenuSurvivorsClothingInspectUI.backButton.text             = MenuDashboardUI.localization.format("BackButtonText");
            MenuSurvivorsClothingInspectUI.backButton.tooltip          = MenuDashboardUI.localization.format("BackButtonTooltip");
            SleekButton sleekButton = MenuSurvivorsClothingInspectUI.backButton;

            if (MenuSurvivorsClothingInspectUI.< > f__mg$cache1 == null)
            {
                MenuSurvivorsClothingInspectUI.< > f__mg$cache1 = new ClickedButton(MenuSurvivorsClothingInspectUI.onClickedBackButton);
            }
            sleekButton.onClickedButton = MenuSurvivorsClothingInspectUI.< > f__mg$cache1;
            MenuSurvivorsClothingInspectUI.backButton.fontSize = 14;
            MenuSurvivorsClothingInspectUI.backButton.iconImage.backgroundTint = ESleekTint.FOREGROUND;
            MenuSurvivorsClothingInspectUI.container.add(MenuSurvivorsClothingInspectUI.backButton);
        }
 // Token: 0x06003561 RID: 13665 RVA: 0x00164CDC File Offset: 0x001630DC
 public static void updateSelection()
 {
     if ((int)EditorSpawns.selectedVehicle < LevelVehicles.tables.Count)
     {
         VehicleTable vehicleTable = LevelVehicles.tables[(int)EditorSpawns.selectedVehicle];
         EditorSpawnsVehiclesUI.selectedBox.text       = vehicleTable.name;
         EditorSpawnsVehiclesUI.tableNameField.text    = vehicleTable.name;
         EditorSpawnsVehiclesUI.tableIDField.state     = vehicleTable.tableID;
         EditorSpawnsVehiclesUI.tableColorPicker.state = vehicleTable.color;
         if (EditorSpawnsVehiclesUI.tierButtons != null)
         {
             for (int i = 0; i < EditorSpawnsVehiclesUI.tierButtons.Length; i++)
             {
                 EditorSpawnsVehiclesUI.spawnsScrollBox.remove(EditorSpawnsVehiclesUI.tierButtons[i]);
             }
         }
         EditorSpawnsVehiclesUI.tierButtons = new SleekButton[vehicleTable.tiers.Count];
         for (int j = 0; j < EditorSpawnsVehiclesUI.tierButtons.Length; j++)
         {
             VehicleTier vehicleTier = vehicleTable.tiers[j];
             SleekButton sleekButton = new SleekButton();
             sleekButton.positionOffset_X = 240;
             sleekButton.positionOffset_Y = 170 + j * 70;
             sleekButton.sizeOffset_X     = 200;
             sleekButton.sizeOffset_Y     = 30;
             sleekButton.text             = vehicleTier.name;
             SleekButton sleekButton2 = sleekButton;
             if (EditorSpawnsVehiclesUI.< > f__mg$cache1 == null)
             {
                 EditorSpawnsVehiclesUI.< > f__mg$cache1 = new ClickedButton(EditorSpawnsVehiclesUI.onClickedTierButton);
             }
             sleekButton2.onClickedButton = EditorSpawnsVehiclesUI.< > f__mg$cache1;
             EditorSpawnsVehiclesUI.spawnsScrollBox.add(sleekButton);
             SleekSlider sleekSlider = new SleekSlider();
             sleekSlider.positionOffset_Y = 40;
             sleekSlider.sizeOffset_X     = 200;
             sleekSlider.sizeOffset_Y     = 20;
             sleekSlider.orientation      = ESleekOrientation.HORIZONTAL;
             sleekSlider.state            = vehicleTier.chance;
             sleekSlider.addLabel(Mathf.RoundToInt(vehicleTier.chance * 100f) + "%", ESleekSide.LEFT);
             SleekSlider sleekSlider2 = sleekSlider;
             if (EditorSpawnsVehiclesUI.< > f__mg$cache2 == null)
             {
                 EditorSpawnsVehiclesUI.< > f__mg$cache2 = new Dragged(EditorSpawnsVehiclesUI.onDraggedChanceSlider);
             }
             sleekSlider2.onDragged = EditorSpawnsVehiclesUI.< > f__mg$cache2;
             sleekButton.add(sleekSlider);
             EditorSpawnsVehiclesUI.tierButtons[j] = sleekButton;
         }
         EditorSpawnsVehiclesUI.tierNameField.positionOffset_Y    = 170 + EditorSpawnsVehiclesUI.tierButtons.Length * 70;
         EditorSpawnsVehiclesUI.addTierButton.positionOffset_Y    = 170 + EditorSpawnsVehiclesUI.tierButtons.Length * 70 + 40;
         EditorSpawnsVehiclesUI.removeTierButton.positionOffset_Y = 170 + EditorSpawnsVehiclesUI.tierButtons.Length * 70 + 40;
         if (EditorSpawnsVehiclesUI.vehicleButtons != null)
         {
             for (int k = 0; k < EditorSpawnsVehiclesUI.vehicleButtons.Length; k++)
             {
                 EditorSpawnsVehiclesUI.spawnsScrollBox.remove(EditorSpawnsVehiclesUI.vehicleButtons[k]);
             }
         }
         if ((int)EditorSpawnsVehiclesUI.selectedTier < vehicleTable.tiers.Count)
         {
             EditorSpawnsVehiclesUI.tierNameField.text = vehicleTable.tiers[(int)EditorSpawnsVehiclesUI.selectedTier].name;
             EditorSpawnsVehiclesUI.vehicleButtons     = new SleekButton[vehicleTable.tiers[(int)EditorSpawnsVehiclesUI.selectedTier].table.Count];
             for (int l = 0; l < EditorSpawnsVehiclesUI.vehicleButtons.Length; l++)
             {
                 SleekButton sleekButton3 = new SleekButton();
                 sleekButton3.positionOffset_X = 240;
                 sleekButton3.positionOffset_Y = 170 + EditorSpawnsVehiclesUI.tierButtons.Length * 70 + 80 + l * 40;
                 sleekButton3.sizeOffset_X     = 200;
                 sleekButton3.sizeOffset_Y     = 30;
                 VehicleAsset vehicleAsset = (VehicleAsset)Assets.find(EAssetType.VEHICLE, vehicleTable.tiers[(int)EditorSpawnsVehiclesUI.selectedTier].table[l].vehicle);
                 string       str          = "?";
                 if (vehicleAsset != null)
                 {
                     if (string.IsNullOrEmpty(vehicleAsset.vehicleName))
                     {
                         str = vehicleAsset.name;
                     }
                     else
                     {
                         str = vehicleAsset.vehicleName;
                     }
                 }
                 sleekButton3.text = vehicleTable.tiers[(int)EditorSpawnsVehiclesUI.selectedTier].table[l].vehicle.ToString() + " " + str;
                 SleekButton sleekButton4 = sleekButton3;
                 if (EditorSpawnsVehiclesUI.< > f__mg$cache3 == null)
                 {
                     EditorSpawnsVehiclesUI.< > f__mg$cache3 = new ClickedButton(EditorSpawnsVehiclesUI.onClickVehicleButton);
                 }
                 sleekButton4.onClickedButton = EditorSpawnsVehiclesUI.< > f__mg$cache3;
                 EditorSpawnsVehiclesUI.spawnsScrollBox.add(sleekButton3);
                 EditorSpawnsVehiclesUI.vehicleButtons[l] = sleekButton3;
             }
         }
         else
         {
             EditorSpawnsVehiclesUI.tierNameField.text = string.Empty;
             EditorSpawnsVehiclesUI.vehicleButtons     = new SleekButton[0];
         }
         EditorSpawnsVehiclesUI.vehicleIDField.positionOffset_Y      = 170 + EditorSpawnsVehiclesUI.tierButtons.Length * 70 + 80 + EditorSpawnsVehiclesUI.vehicleButtons.Length * 40;
         EditorSpawnsVehiclesUI.addVehicleButton.positionOffset_Y    = 170 + EditorSpawnsVehiclesUI.tierButtons.Length * 70 + 80 + EditorSpawnsVehiclesUI.vehicleButtons.Length * 40 + 40;
         EditorSpawnsVehiclesUI.removeVehicleButton.positionOffset_Y = 170 + EditorSpawnsVehiclesUI.tierButtons.Length * 70 + 80 + EditorSpawnsVehiclesUI.vehicleButtons.Length * 40 + 40;
         EditorSpawnsVehiclesUI.spawnsScrollBox.area = new Rect(0f, 0f, 5f, (float)(170 + EditorSpawnsVehiclesUI.tierButtons.Length * 70 + 80 + EditorSpawnsVehiclesUI.vehicleButtons.Length * 40 + 70));
     }
     else
     {
         EditorSpawnsVehiclesUI.selectedBox.text       = string.Empty;
         EditorSpawnsVehiclesUI.tableNameField.text    = string.Empty;
         EditorSpawnsVehiclesUI.tableIDField.state     = 0;
         EditorSpawnsVehiclesUI.tableColorPicker.state = Color.white;
         if (EditorSpawnsVehiclesUI.tierButtons != null)
         {
             for (int m = 0; m < EditorSpawnsVehiclesUI.tierButtons.Length; m++)
             {
                 EditorSpawnsVehiclesUI.spawnsScrollBox.remove(EditorSpawnsVehiclesUI.tierButtons[m]);
             }
         }
         EditorSpawnsVehiclesUI.tierButtons                       = null;
         EditorSpawnsVehiclesUI.tierNameField.text                = string.Empty;
         EditorSpawnsVehiclesUI.tierNameField.positionOffset_Y    = 170;
         EditorSpawnsVehiclesUI.addTierButton.positionOffset_Y    = 210;
         EditorSpawnsVehiclesUI.removeTierButton.positionOffset_Y = 210;
         if (EditorSpawnsVehiclesUI.vehicleButtons != null)
         {
             for (int n = 0; n < EditorSpawnsVehiclesUI.vehicleButtons.Length; n++)
             {
                 EditorSpawnsVehiclesUI.spawnsScrollBox.remove(EditorSpawnsVehiclesUI.vehicleButtons[n]);
             }
         }
         EditorSpawnsVehiclesUI.vehicleButtons = null;
         EditorSpawnsVehiclesUI.vehicleIDField.positionOffset_Y      = 250;
         EditorSpawnsVehiclesUI.addVehicleButton.positionOffset_Y    = 290;
         EditorSpawnsVehiclesUI.removeVehicleButton.positionOffset_Y = 290;
         EditorSpawnsVehiclesUI.spawnsScrollBox.area = new Rect(0f, 0f, 5f, 320f);
     }
 }
        private void OnCanvasMouseUp(object sender, MouseButtonEventArgs e)
        {
            _dragged = null;
            var mp = e.GetPosition(TheCanvas);
            var x = mp.X;
            if (Math.Abs(_mouseDownX - x) < 10)
            {
                if (e.ChangedButton == MouseButton.Right)
                {
                    _manager.AddPoint(_space, (int)(x * 100 + Rnd()), (float)x);
                    DrawTree();
                }
            }
            if (_chosenEllipses.Count > 0)
            {
                _chosenEllipses.ForEach(el => el.Fill = Brushes.Moccasin);
            }

            Rectangle rect;
            if (TryFindSpacePointRectangle(mp, out rect))
            {
                OnSpacePointMouseUp(rect, rect.Tag as SpacePoint<int>, e);
            }
        }