Пример #1
0
        private void AddControls()
        {
            ComboMenuCycle menuCycle = new ComboMenuCycle("DirectionFacing", "Direction Facing", new Point(50, 50), true, false, true);

            menuCycle.AddCycleObject(new CycleObject("West", 6));
            menuCycle.AddCycleObject(new CycleObject("North", 0));
            AddUiControl(menuCycle);

            menuCycle = new ComboMenuCycle("HousePieceRow", "House Piece Row", new Point(50, 150), true, false, true);
            for (int i = 0; i < 4; i++)
            {
                menuCycle.AddCycleObject(new CycleObject(i.ToString(), i));
            }
            AddUiControl(menuCycle);

            AddUiControl(new ButtonBlueLarge("New", new Point(80, 250), "New Building", Color.White));
            AddUiControl(new ButtonBlueLarge("Load", new Point(80, 350), "Load Building", Color.White));
            listBoxBuildings = new ListBox("ListBox", new Rectangle(380, 250, 400, 600), GraphicsManager.GetSpriteColour(7), Font.OpenSans16, containerCamera);

            foreach (CompressedBuilding building in buildingsBinary.buildingList)
            {
                string displayName = "Building " + building.id.ToString();

                if (building.isActive)
                {
                    listBoxBuildings.AddItem(new ListBoxObject(displayName, building, Color.White));
                }
                else
                {
                    listBoxBuildings.AddItem(new ListBoxObject(displayName, building, Color.Red));
                }
            }

            AddUiControl(listBoxBuildings);
        }
Пример #2
0
        private void AddButtons()
        {
            int            count = 0;
            ComboMenuCycle audio;

            foreach (VolumeType volumeType in (VolumeType[])Enum.GetValues(typeof(VolumeType)))
            {
                string name = volumeType.ToString();

                audio = new ComboMenuCycle(name, name, new Point(50, 60 + (count * 100)), false, true, true);

                for (int i = 0; i < 11; i++)
                {
                    float value = (float)i / 10f;
                    audio.AddCycleObject(new CycleObject(i.ToString(), value));

                    float currentVolume = AudioManager.GetVolume(volumeType);
                    if (currentVolume == value)
                    {
                        audio.SetLastIndex();
                    }
                }
                AddUiControl(audio);
                count++;
            }
        }
Пример #3
0
        private void AddButtons()
        {
            ComboMenuCycle menuCycle;

            AddUiControl(new ComboMenuTextBox("Seed", "Seed", "10", new Point(50, 60), false));

            menuCycle = new ComboMenuCycle("WorldSize", "World Size", new Point(50, 160), true, false, true);
            foreach (Point point in worldSizeList)
            {
                string displayName = point.X + " X " + point.Y;
                menuCycle.AddCycleObject(new CycleObject(displayName, point));
            }
            menuCycle.SetIndex(1);
            AddUiControl(menuCycle);

            menuCycle = new ComboMenuCycle("NumberOfTowns", "Number of Towns", new Point(50, 260), true, false, true);
            AddUiControl(menuCycle);
            menuCycle.AddCycleObject(new CycleObject("Maximum 3", (int)3));
            menuCycle.AddCycleObject(new CycleObject("Maximum 4", (int)4));
            menuCycle.AddCycleObject(new CycleObject("Maximum 5", (int)5));
            menuCycle.AddCycleObject(new CycleObject("Maximum 6", (int)6));
            menuCycle.AddCycleObject(new CycleObject("Maximum 8", (int)8));
            menuCycle.AddCycleObject(new CycleObject("Maximum 10", (int)10));
            menuCycle.AddCycleObject(new CycleObject("Maximum 12", (int)12));
            menuCycle.AddCycleObject(new CycleObject("Maximum 14", (int)14));
            menuCycle.AddCycleObject(new CycleObject("Maximum 16", (int)16));
            menuCycle.AddCycleObject(new CycleObject("Maximum 18", (int)18));
            menuCycle.AddCycleObject(new CycleObject("Maximum 20", (int)20));
            menuCycle.AddCycleObject(new CycleObject("Maximum 25", (int)25));
            menuCycle.AddCycleObject(new CycleObject("Maximum 30", (int)30));
            menuCycle.AddCycleObject(new CycleObject("Maximum 35", (int)35));
            menuCycle.AddCycleObject(new CycleObject("Maximum 40", (int)40));
            menuCycle.SetIndex(2);

            menuCycle = new ComboMenuCycle("MinTownRoads", "Minimum Town Streets", new Point(50, 360), true, false, true);
            AddUiControl(menuCycle);
            for (int i = 10; i < 201; i += 10)
            {
                menuCycle.AddCycleObject(new CycleObject(i.ToString(), i));
            }
            menuCycle.SetIndex(0);

            menuCycle = new ComboMenuCycle("MaxTownRoads", "Maximum Town Streets", new Point(50, 460), true, false, true);
            AddUiControl(menuCycle);
            for (int i = 40; i < 491; i += 20)
            {
                menuCycle.AddCycleObject(new CycleObject(i.ToString(), i));
            }
            menuCycle.SetIndex(0);

            AddUiControl(new ButtonBlueLarge("New", new Point(550, 600), "Create World", Color.White));
        }
Пример #4
0
        private void AddButtons()
        {
            ComboMenuCycle menu;

            //Uiscale
            menu = new ComboMenuCycle("Scale", "Interface Scale", new Point(50, 60), false, false, true);
            float startAmount = 0.5f;

            for (int i = 0; i < 31; i++)
            {
                float  amount       = startAmount + (float)i * 0.025f;
                float  displayValue = (amount * 100f);
                string displayName  = string.Format("{0:0.0}", displayValue) + "%";
                menu.AddCycleObject(new CycleObject(displayName, amount));
            }
            menu.SetIndexByFloat(DisplayController.uiScale);
            AddUiControl(menu);

            //Resolution
            menu = new ComboMenuCycle("Resolution", "Resolution", new Point(50, 160), true, false, true);
            foreach (Rectangle rectangle in DisplayController.resolutionList)
            {
                string displayName = rectangle.Width + " X " + rectangle.Height;
                menu.AddCycleObject(new CycleObject(displayName, rectangle));
            }
            menu.SetIndex(DisplayController.resolutionId);
            AddUiControl(menu);

            //Target Frame Rate
            menu = new ComboMenuCycle("TargetFrameRate", "Target Frame Rate", new Point(50, 260), true, false, true);
            menu.AddCycleObject(new CycleObject("Vertical Sync", (int)0));
            menu.AddCycleObject(new CycleObject("60", (int)60));
            menu.AddCycleObject(new CycleObject("75", (int)75));
            menu.AddCycleObject(new CycleObject("100", (int)100));
            menu.AddCycleObject(new CycleObject("120", (int)120));
            menu.AddCycleObject(new CycleObject("144", (int)144));
            menu.AddCycleObject(new CycleObject("165", (int)165));
            menu.AddCycleObject(new CycleObject("240", (int)240));
            menu.AddCycleObject(new CycleObject("Unlimited", (int)-1));
            menu.SetIndexByInt(DisplayController.targetFrameRate);
            AddUiControl(menu);

            //Vsync
            menu = new ComboMenuCycle("FullScreen", "Full Screen", new Point(50, 360), true, false, true);
            menu.AddCycleObject(new CycleObject("No", false));
            menu.AddCycleObject(new CycleObject("Yes", true));
            menu.SetIndexByBool(DisplayController.fullScreen);
            AddUiControl(menu);


            //Night Brightness
            menu = new ComboMenuCycle("NightBright", "Night Brightness", new Point(50, 460), true, false, true);

            menu.AddCycleObject(new CycleObject("0", 0f));
            menu.AddCycleObject(new CycleObject("1", 0.025f));
            menu.AddCycleObject(new CycleObject("2", 0.05f));
            menu.AddCycleObject(new CycleObject("3", 0.075f));
            menu.AddCycleObject(new CycleObject("4", 0.1f));
            menu.AddCycleObject(new CycleObject("5", 0.125f));
            menu.AddCycleObject(new CycleObject("6", 0.15f));
            menu.AddCycleObject(new CycleObject("7", 0.175f));
            menu.AddCycleObject(new CycleObject("8", 0.2f));
            menu.AddCycleObject(new CycleObject("9", 0.225f));
            menu.AddCycleObject(new CycleObject("10", 0.25f));
            menu.AddCycleObject(new CycleObject("11", 0.275f));
            menu.AddCycleObject(new CycleObject("12", 0.3f));

            menu.SetIndexByFloat(DisplayController.minNightBrightness);
            AddUiControl(menu);

            //Message Speed
            menu = new ComboMenuCycle("MessageSpeed", "Message Speed", new Point(50, 560), true, false, true);
            menu.AddCycleObject(new CycleObject("Super Slow", 0.4f));
            menu.AddCycleObject(new CycleObject("Slow", 0.7f));
            menu.AddCycleObject(new CycleObject("Normal", 1f));
            menu.AddCycleObject(new CycleObject("Fast", 1.3f));
            menu.AddCycleObject(new CycleObject("Very Fast", 1.7f));
            menu.AddCycleObject(new CycleObject("Super Fast", 2f));
            menu.AddCycleObject(new CycleObject("Crazy", 2.5f));
            menu.SetIndexByFloat(DisplayController.messageSpeed);
            AddUiControl(menu);
        }