Ejemplo n.º 1
0
        public ShadowPicker(Rectangle location, DockType dockType, CompressedBuilding compressedBuilding, EditorParams editorParams) : base(location, dockType, true)
        {
            this.editorParams       = editorParams;
            this.compressedBuilding = compressedBuilding;
            drawSpriteBack          = true;
            spriteBack = GraphicsManager.GetPreBuilt(Engine.ContentStorage.PrebuiltSprite.EditorPanelBackGrey);
            AddBorder(3, Resizing.NONE, 1);
            AddHeading(40, "Shadow Picker", GraphicsManager.GetSpriteFont(Font.OpenSans18), Color.White, false, false, false, false, true, GraphicsManager.GetSpriteColour(6));

            editStyleCombo = new ComboEditorCycleNoLabel("Side", "", new Point(5, 10), true, false, true);
            editStyleCombo.AddCycleObject(new CycleObject("Left Shadows", ShadowSide.LEFT));
            editStyleCombo.AddCycleObject(new CycleObject("Right Shadows", ShadowSide.RIGHT));
            AddUiControl(editStyleCombo);

            AddUiControl(new Label("Index", Font.OpenSans24Bold, Color.White, new Vector2(195, 320), true, ""));

            AddUiControl(new ButtonBlueMedium("Back", new Point(30, 360), "(Q) >", Color.White));
            AddUiControl(new ButtonBlueMedium("Next", new Point(210, 360), "(E) >", Color.White));
            SetSampleShadow();
        }
Ejemplo n.º 2
0
        private void AddControls()
        {
            AddUiControl(new ButtonBlueMedium("Save", new Point(435, 10), "SAVE", Color.White));
            AddUiControl(new Label("Building#", Font.OpenSans16, Color.White, new Vector2(50, 70), false, "Building #" + compressedBuilding.id.ToString()));
            AddUiControl(new Label("TileSet", Font.OpenSans16, Color.White, new Vector2(250, 70), false, "Tileset " + compressedBuilding.pieceRow));
            AddUiControl(new Label("Facing", Font.OpenSans16, Color.White, new Vector2(400, 70), false, "Facing " + compressedBuilding.GetBaseDirectionFacingString()));
            AddUiControl(new Label("Location", Font.OpenSans16, Color.Red, new Vector2(50, 20), false, ""));

            editStyleCombo   = new ComboEditorCycleNoLabel("Edit", "", new Point(100, 130), true, false, true);
            activeCombo      = new ComboEditorCycleNoLabel("Active", "", new Point(100, 195), true, false, true);
            widthCombo       = new ComboEditorCycleNoLabel("Width", "", new Point(100, 260), true, false, true);
            heightCombo      = new ComboEditorCycleNoLabel("Height", "", new Point(100, 325), true, false, true);
            hasFenceCombo    = new ComboEditorCycleNoLabel("HasFence", "", new Point(100, 390), true, false, true);
            snapCombo        = new ComboEditorCycleNoLabel("Snap", "", new Point(100, 455), true, false, true);
            elevationCombo   = new ComboEditorCycleNoLabel("Elevation", "", new Point(100, 520), true, false, true);
            inTileShiftCombo = new ComboEditorCycleNoLabel("InTileShift", "", new Point(100, 585), true, false, true);

            //EditStyle
            editStyleCombo.AddCycleObject(new CycleObject("Mode Buildings", EditingMode.Building));
            editStyleCombo.AddCycleObject(new CycleObject("Mode Shadows", EditingMode.Shadows));
            editStyleCombo.AddCycleObject(new CycleObject("Mode Objects", EditingMode.Objects));
            editStyleCombo.AddCycleObject(new CycleObject("Mode Driving", EditingMode.DrivingPicker));
            AddUiControl(editStyleCombo);

            //Active
            activeCombo.AddCycleObject(new CycleObject("Not Active", false));
            activeCombo.AddCycleObject(new CycleObject("Active", true));
            activeCombo.SetIndexByBool(compressedBuilding.isActive);
            AddUiControl(activeCombo);

            //Width & Height
            for (int i = 2; i < editorParams.overallSize; i += 2)
            {
                widthCombo.AddCycleObject(new CycleObject("Width " + i, i));
                heightCombo.AddCycleObject(new CycleObject("Height " + i, i));
            }
            widthCombo.SetIndexByInt(compressedBuilding.usingWidth);
            heightCombo.SetIndexByInt(compressedBuilding.usingHeight);
            AddUiControl(widthCombo);
            AddUiControl(heightCombo);

            //hasFenceCombo
            hasFenceCombo.AddCycleObject(new CycleObject("No Fence", false));
            hasFenceCombo.AddCycleObject(new CycleObject("Has Fence", true));
            hasFenceCombo.SetIndexByBool(compressedBuilding.hasFence);
            AddUiControl(hasFenceCombo);

            //SnapCombo
            int value = 1;

            for (int i = 1; i < 8; i++)
            {
                snapCombo.AddCycleObject(new CycleObject("Snap " + value, (float)value));
                value += value;
            }
            AddUiControl(snapCombo);

            //ElevationCombo
            for (int i = 0; i < 6; i++)
            {
                elevationCombo.AddCycleObject(new CycleObject("Floor Height " + i, i));
            }
            elevationCombo.SetIndexByInt(compressedBuilding.elevation);
            AddUiControl(elevationCombo);

            //inTileShiftCombo
            for (int i = 0; i < 17; i++)
            {
                inTileShiftCombo.AddCycleObject(new CycleObject("In Tile Shift " + i * 4, i * 4));
            }
            inTileShiftCombo.SetIndexByInt(compressedBuilding.inTileShift);
            AddUiControl(inTileShiftCombo);

            //ListBoxes
            AddUiControl(new Label("Label", Font.OpenSans18, Color.White, new Vector2(133, 720), true, "Available Colours"));
            AddUiControl(new Label("Label", Font.OpenSans18, Color.White, new Vector2(455, 720), true, "Using Colours"));
            AddUiControl(new ButtonCycleMenu("AddColor", new Point(270, 850), ">", Font.CarterOne13, Color.White));
            AddUiControl(new ButtonCycleMenu("RemoveColor", new Point(270, 950), "<", Font.CarterOne13, Color.White));
            colorGlobalList = new ListBox("ListBox", new Rectangle(10, 750, 250, 400), GraphicsManager.GetSpriteColour(7), Font.CarterOne14, containerCamera);
            foreach (ColorXML colorXML in availableColorsList)
            {
                AddAvailableColor(colorXML);
            }
            colorGlobalList.SetIndex(0);
            compressedBuilding.sampleColor = (ColorXML)colorGlobalList.GetSelectedObjectValue();
            AddUiControl(colorGlobalList);
            colorInList = new ListBox("ListBox", new Rectangle(330, 750, 250, 400), GraphicsManager.GetSpriteColour(7), Font.CarterOne14, containerCamera);
            foreach (ColorXML colorXML in compressedBuilding.availableColoursXMLList)
            {
                AddInColour(colorXML);
            }
            AddUiControl(colorInList);
        }