Пример #1
0
        public InventorySlotWidget()
        {
            base.Size = new Vector2(72f, 72f);
            WidgetsList children = Children;

            Widget[] array = new Widget[7];
            BevelledRectangleWidget obj = new BevelledRectangleWidget
            {
                BevelSize        = -2f,
                DirectionalLight = 0.15f,
                CenterColor      = Color.Transparent
            };
            BevelledRectangleWidget bevelledRectangleWidget = obj;

            m_rectangleWidget = obj;
            array[0]          = bevelledRectangleWidget;
            RectangleWidget obj2 = new RectangleWidget
            {
                FillColor    = Color.Transparent,
                OutlineColor = Color.Transparent
            };
            RectangleWidget rectangleWidget = obj2;

            m_highlightWidget = obj2;
            array[1]          = rectangleWidget;
            BlockIconWidget obj3 = new BlockIconWidget
            {
                HorizontalAlignment = WidgetAlignment.Center,
                VerticalAlignment   = WidgetAlignment.Center,
                Margin = new Vector2(2f, 2f)
            };
            BlockIconWidget blockIconWidget = obj3;

            m_blockIconWidget = obj3;
            array[2]          = blockIconWidget;
            LabelWidget obj4 = new LabelWidget
            {
                Font                = ContentManager.Get <BitmapFont>("Fonts/Pericles"),
                FontScale           = 1f,
                HorizontalAlignment = WidgetAlignment.Far,
                VerticalAlignment   = WidgetAlignment.Far,
                Margin              = new Vector2(6f, 2f)
            };
            LabelWidget labelWidget = obj4;

            m_countWidget = obj4;
            array[3]      = labelWidget;
            ValueBarWidget obj5 = new ValueBarWidget
            {
                LayoutDirection     = LayoutDirection.Vertical,
                HorizontalAlignment = WidgetAlignment.Near,
                VerticalAlignment   = WidgetAlignment.Far,
                BarsCount           = 3,
                FlipDirection       = true,
                LitBarColor         = new Color(32, 128, 0),
                UnlitBarColor       = new Color(24, 24, 24, 64),
                BarSize             = new Vector2(12f, 12f),
                BarSubtexture       = ContentManager.Get <Subtexture>("Textures/Atlas/ProgressBar"),
                Margin = new Vector2(4f, 4f)
            };
            ValueBarWidget valueBarWidget = obj5;

            m_healthBarWidget = obj5;
            array[4]          = valueBarWidget;
            StackPanelWidget obj6 = new StackPanelWidget
            {
                Direction           = LayoutDirection.Horizontal,
                HorizontalAlignment = WidgetAlignment.Far,
                Margin = new Vector2(3f, 3f)
            };
            WidgetsList     children2 = obj6.Children;
            RectangleWidget obj7      = new RectangleWidget
            {
                Subtexture   = ContentManager.Get <Subtexture>("Textures/Atlas/InteractiveItemOverlay"),
                Size         = new Vector2(13f, 14f),
                FillColor    = new Color(160, 160, 160),
                OutlineColor = Color.Transparent
            };

            rectangleWidget            = obj7;
            m_interactiveOverlayWidget = obj7;
            children2.Add(rectangleWidget);
            WidgetsList     children3 = obj6.Children;
            RectangleWidget obj8      = new RectangleWidget
            {
                Subtexture   = ContentManager.Get <Subtexture>("Textures/Atlas/EditItemOverlay"),
                Size         = new Vector2(12f, 14f),
                FillColor    = new Color(160, 160, 160),
                OutlineColor = Color.Transparent
            };

            rectangleWidget     = obj8;
            m_editOverlayWidget = obj8;
            children3.Add(rectangleWidget);
            WidgetsList     children4 = obj6.Children;
            RectangleWidget obj9      = new RectangleWidget
            {
                Subtexture   = ContentManager.Get <Subtexture>("Textures/Atlas/FoodItemOverlay"),
                Size         = new Vector2(11f, 14f),
                FillColor    = new Color(160, 160, 160),
                OutlineColor = Color.Transparent
            };

            rectangleWidget     = obj9;
            m_foodOverlayWidget = obj9;
            children4.Add(rectangleWidget);
            array[5] = obj6;
            LabelWidget obj10 = new LabelWidget
            {
                Text  = "Split",
                Font  = ContentManager.Get <BitmapFont>("Fonts/Pericles"),
                Color = new Color(255, 64, 0),
                HorizontalAlignment = WidgetAlignment.Near,
                VerticalAlignment   = WidgetAlignment.Near,
                Margin = new Vector2(2f, 0f)
            };

            labelWidget        = obj10;
            m_splitLabelWidget = obj10;
            array[6]           = labelWidget;
            children.Add(array);
        }
Пример #2
0
        public EditColorDialog(Color color, Action <Color?> handler)
        {
            WidgetsList  children = Children;
            CanvasWidget obj      = new CanvasWidget
            {
                Size = new Vector2(660f, 420f),
                HorizontalAlignment = WidgetAlignment.Center,
                VerticalAlignment   = WidgetAlignment.Center,
                Children            =
                {
                    (Widget) new RectangleWidget
                    {
                        FillColor        = new Color(0, 0, 0, 255),
                        OutlineColor     = new Color(128, 128, 128, 128),
                        OutlineThickness = 2f
                    }
                }
            };
            WidgetsList      children2 = obj.Children;
            StackPanelWidget obj2      = new StackPanelWidget
            {
                Direction           = LayoutDirection.Vertical,
                Margin              = new Vector2(15f),
                HorizontalAlignment = WidgetAlignment.Center,
                Children            =
                {
                    (Widget) new LabelWidget
                    {
                        Text = "Edit Color",
                        HorizontalAlignment = WidgetAlignment.Center
                    },
                    (Widget) new CanvasWidget
                    {
                        Size = new Vector2(0f, float.PositiveInfinity)
                    }
                }
            };
            WidgetsList      children3 = obj2.Children;
            StackPanelWidget obj3      = new StackPanelWidget
            {
                Direction = LayoutDirection.Horizontal
            };
            WidgetsList      children4 = obj3.Children;
            StackPanelWidget obj4      = new StackPanelWidget
            {
                Direction         = LayoutDirection.Vertical,
                VerticalAlignment = WidgetAlignment.Center
            };
            WidgetsList      children5 = obj4.Children;
            StackPanelWidget obj5      = new StackPanelWidget
            {
                Direction           = LayoutDirection.Horizontal,
                HorizontalAlignment = WidgetAlignment.Far,
                Margin   = new Vector2(0f, 10f),
                Children =
                {
                    (Widget) new LabelWidget
                    {
                        Text              = "Red:",
                        Color             = Color.Gray,
                        VerticalAlignment = WidgetAlignment.Center,
                        Font              = ContentManager.Get <BitmapFont>("Fonts/Pericles")
                    },
                    (Widget) new CanvasWidget
                    {
                        Size = new Vector2(10f, 0f)
                    }
                }
            };
            WidgetsList  children6 = obj5.Children;
            SliderWidget obj6      = new SliderWidget
            {
                Size           = new Vector2(300f, 50f),
                IsLabelVisible = false,
                MinValue       = 0f,
                MaxValue       = 255f,
                Granularity    = 1f,
                SoundName      = ""
            };
            SliderWidget widget = obj6;

            m_sliderR = obj6;
            children6.Add(widget);
            children5.Add(obj5);
            WidgetsList      children7 = obj4.Children;
            StackPanelWidget obj7      = new StackPanelWidget
            {
                Direction           = LayoutDirection.Horizontal,
                HorizontalAlignment = WidgetAlignment.Far,
                Margin   = new Vector2(0f, 10f),
                Children =
                {
                    (Widget) new LabelWidget
                    {
                        Text              = "Green:",
                        Color             = Color.Gray,
                        VerticalAlignment = WidgetAlignment.Center,
                        Font              = ContentManager.Get <BitmapFont>("Fonts/Pericles")
                    },
                    (Widget) new CanvasWidget
                    {
                        Size = new Vector2(10f, 0f)
                    }
                }
            };
            WidgetsList  children8 = obj7.Children;
            SliderWidget obj8      = new SliderWidget
            {
                Size           = new Vector2(300f, 50f),
                IsLabelVisible = false,
                MinValue       = 0f,
                MaxValue       = 255f,
                Granularity    = 1f,
                SoundName      = ""
            };

            widget    = obj8;
            m_sliderG = obj8;
            children8.Add(widget);
            children7.Add(obj7);
            WidgetsList      children9 = obj4.Children;
            StackPanelWidget obj9      = new StackPanelWidget
            {
                Direction           = LayoutDirection.Horizontal,
                HorizontalAlignment = WidgetAlignment.Far,
                Margin   = new Vector2(0f, 10f),
                Children =
                {
                    (Widget) new LabelWidget
                    {
                        Text              = "Blue:",
                        Color             = Color.Gray,
                        VerticalAlignment = WidgetAlignment.Center,
                        Font              = ContentManager.Get <BitmapFont>("Fonts/Pericles")
                    },
                    (Widget) new CanvasWidget
                    {
                        Size = new Vector2(10f, 0f)
                    }
                }
            };
            WidgetsList  children10 = obj9.Children;
            SliderWidget obj10      = new SliderWidget
            {
                Size           = new Vector2(300f, 50f),
                IsLabelVisible = false,
                MinValue       = 0f,
                MaxValue       = 255f,
                Granularity    = 1f,
                SoundName      = ""
            };

            widget    = obj10;
            m_sliderB = obj10;
            children10.Add(widget);
            children9.Add(obj9);
            children4.Add(obj4);
            obj3.Children.Add(new CanvasWidget
            {
                Size = new Vector2(20f, 0f)
            });
            WidgetsList          children11   = obj3.Children;
            CanvasWidget         canvasWidget = new CanvasWidget();
            WidgetsList          children12   = canvasWidget.Children;
            BevelledButtonWidget obj11        = new BevelledButtonWidget
            {
                Size                = new Vector2(200f, 240f),
                AmbientLight        = 1f,
                HorizontalAlignment = WidgetAlignment.Center,
                VerticalAlignment   = WidgetAlignment.Center
            };
            BevelledButtonWidget widget2 = obj11;

            m_rectangle = obj11;
            children12.Add(widget2);
            WidgetsList children13 = canvasWidget.Children;
            LabelWidget obj12      = new LabelWidget
            {
                HorizontalAlignment = WidgetAlignment.Center,
                VerticalAlignment   = WidgetAlignment.Center,
                Font = ContentManager.Get <BitmapFont>("Fonts/Pericles")
            };
            LabelWidget widget3 = obj12;

            m_label = obj12;
            children13.Add(widget3);
            children11.Add(canvasWidget);
            children3.Add(obj3);
            obj2.Children.Add(new CanvasWidget
            {
                Size = new Vector2(0f, float.PositiveInfinity)
            });
            WidgetsList      children14 = obj2.Children;
            StackPanelWidget obj13      = new StackPanelWidget
            {
                Direction           = LayoutDirection.Horizontal,
                HorizontalAlignment = WidgetAlignment.Center
            };
            WidgetsList          children15 = obj13.Children;
            BevelledButtonWidget obj14      = new BevelledButtonWidget
            {
                Size = new Vector2(160f, 60f),
                Text = LanguageControl.Get("Usual", "ok")
            };
            ButtonWidget widget4 = obj14;

            m_okButton = obj14;
            children15.Add(widget4);
            obj13.Children.Add(new CanvasWidget
            {
                Size = new Vector2(50f, 0f)
            });
            WidgetsList          children16 = obj13.Children;
            BevelledButtonWidget obj15      = new BevelledButtonWidget
            {
                Size = new Vector2(160f, 60f),
                Text = "Cancel"
            };

            widget4        = obj15;
            m_cancelButton = obj15;
            children16.Add(widget4);
            children14.Add(obj13);
            children2.Add(obj2);
            children.Add(obj);
            m_handler = handler;
            m_color   = color;
            UpdateControls();
        }