예제 #1
0
            public static DropDownComponent Read(BinaryReader br)
            {
                DropDownComponent ret = new DropDownComponent();

                ret.Data = br.ReadStructures <UInt32>(2).ToArray();
                return(ret);
            }
        protected override void IntitalizeControls()
        {
            myType = new DropDownComponent(new Point(Location.X, Location.Y + 10), new Size(150, 13), "Type");
            myType.AddSelectedIndexChangeEvent(this.PanelDataChanged);
            myType.AddSelectedIndexChangeEvent(this.TypeChanged);
            myType.BindToPanel(this);
            myType.Show();

            myValue = new NumericTextComponent(new Point(Location.X, Location.Y + 40), new Size(100, 13), "Value");
            myValue.AddTextChangeEvent(this.PanelDataChanged);
            myValue.BindToPanel(this);
            myValue.Show();

            myTime = new NumericTextComponent(new Point(Location.X + 100, Location.Y + 40), new Size(100, 13), "Time");
            myTime.AddTextChangeEvent(this.PanelDataChanged);
            myTime.BindToPanel(this);
            myTime.Show();

            myWeaponUpgrade = new NumericTextComponent(new Point(Location.X, Location.Y + 40), new Size(200, 13), "Upgrade", false);
            myWeaponUpgrade.AddTextChangeEvent(this.PanelDataChanged);
            myWeaponUpgrade.BindToPanel(this);
            myWeaponUpgrade.Hide();

            myWeaponID = new NumericTextComponent(new Point(Location.X + 200, Location.Y + 40), new Size(70, 13), "ID");
            myWeaponID.AddTextChangeEvent(this.PanelDataChanged);
            myWeaponID.BindToPanel(this);
            myWeaponID.Hide();

            myType.AddItem("WeaponUpgrade");
            myType.AddItem("firerate");
            myType.AddItem("healthkit");
            myType.AddItem("homing");
            myType.AddItem("shield");
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ListPage"/> class.
        /// </summary>
        /// <param name="basePage">The base page.</param>
        /// <param name="pageObjectFactory">The page object factory.</param>
        /// <param name="driver">The driver.</param>
        /// <param name="pageSettings">The page settings.</param>
        public ListPage(IBasePage basePage,
                        IPageObjectFactory pageObjectFactory,
                        IWebDriver driver,
                        PageSettings pageSettings)
            : base(driver,
                   new Uri(pageSettings.BaseUrl, "Admin/Customer/List"))
        {
            this.basePage          = basePage;
            this.pageObjectFactory = pageObjectFactory;

            CustomerRoles = new KMultiSelectComponent <IListPage>(
                By.CssSelector("#SelectedCustomerRoleIds"),
                WrappedDriver,
                new KMultiSelectConfiguration(),
                this);

            CustomersGrid = new KGridComponent <IListPage>(
                new BaseKendoConfiguration(),
                By.CssSelector("#customers-grid"),
                pageObjectFactory,
                WrappedDriver,
                this);

            ExportDropDownComponent = new DropDownComponent(
                By.CssSelector(".btn-group"),
                WrappedDriver);
        }
예제 #4
0
        internal ModOptionsPage(ModSettings controller, int x, int y, int width, int height) : base(x, y, width, height, false)
        {
            this.controller = controller;

            var modChoices = new List <string>();

            for (int i = 0; i < this.controller.ModOptionsList.Count; i++)
            {
                // Create mod page and add it, hide it initially
                this.Sheets.Add(new ModSheet(this.controller.ModOptionsList[i], (int)(this.xPositionOnScreen + Game1.pixelZoom * 15), (int)(this.yPositionOnScreen + Game1.pixelZoom * 55), this.width - (Game1.pixelZoom * 15), this.height - Game1.pixelZoom * 65));
                this.Sheets[i].visible = false;

                // Add names to mod selector dropdown
                modChoices.Add(this.controller.ModOptionsList[i].modManifest.Name);
            }

            modSelected         = new DropDownComponent(modChoices, "", (int)Game1.smallFont.MeasureString("Stardew Configuration Menu Framework").X, (int)(this.xPositionOnScreen + Game1.pixelZoom * 15), (int)(this.yPositionOnScreen + Game1.pixelZoom * 30));
            modSelected.visible = true;
            if (Sheets.Count > 0)
            {
                Sheets[modSelected.SelectionIndex].visible = true;
            }

            AddListeners();
        }
        public IDropDownComponent <TProperty> DropDownFor <TProperty, TData>(Expression <Func <TViewModel, TProperty> > property, TViewModel entity, IEnumerable <TData> items, Func <TProperty, string> propertyValueFunc, Func <TData, string> itemValueFunc, Func <TData, string> itemTextFunc, Func <TData, object> itemHtmlAttributes)
        {
            var dropDown = new DropDownComponent <TViewModel, TProperty, TData>(items, propertyValueFunc, itemValueFunc, itemTextFunc, itemHtmlAttributes);

            InitializeComponent(dropDown, entity, property);

            return(dropDown);
        }
예제 #6
0
        protected override void IntitalizeControls()
        {
            myComponents = new DropDownComponent(new Point(Location.X, Location.Y + 10), new Size(245, 13), "Component");
            myComponents.BindToPanel(this);
            myComponents.Show();

            myAddButton.Text     = "Add";
            myAddButton.Location = new Point(Location.X + 250, Location.Y + 10);
            myAddButton.Size     = new Size(40, 20);
            myAddButton.Click   += new EventHandler(AddButton_Click);
            myAddButton.Show();

            this.Controls.Add(myAddButton);
        }
        protected override void IntitalizeControls()
        {
            mySpeed = new MinMaxComponent(new Point(Location.X, Location.Y + 10), new Size(Size.Width, 13), "Speed");
            mySpeed.AddTextChangeEvent(this.PanelDataChanged);
            mySpeed.BindToPanel(this);
            mySpeed.Show();

            myTimeToNextDecision = new MinMaxComponent(new Point(Location.X, Location.Y + 30), new Size(Size.Width, 13), "TimeToNextDecision");
            myTimeToNextDecision.AddTextChangeEvent(this.PanelDataChanged);
            myTimeToNextDecision.BindToPanel(this);
            myTimeToNextDecision.Show();

            myFollowEntity = new NumericTextComponent(new Point(Location.X, Location.Y + 50), new Size(275, 13), "Follow Entity", false);
            myFollowEntity.AddTextChangeEvent(this.PanelDataChanged);
            myFollowEntity.BindToPanel(this);
            myFollowEntity.Show();

            myAIMode = new DropDownComponent(new Point(Location.X, Location.Y + 70), new Size(150, 13), "AIMode");
            myAIMode.AddSelectedIndexChangeEvent(this.PanelDataChanged);
            myAIMode.BindToPanel(this);
            myAIMode.Show();

            myAiTurnRate = new NumericTextComponent(new Point(Location.X, Location.Y + 100), new Size(275, 13), "AITurnRate");
            myAiTurnRate.AddTextChangeEvent(this.PanelDataChanged);
            myAiTurnRate.BindToPanel(this);
            myAiTurnRate.Show();

            myAvoidanceLabel.Text     = "Avoidance";
            myAvoidanceLabel.Location = new Point(Location.X, Location.Y + 120);
            myAvoidanceLabel.Size     = new Size(100, 13);
            myAvoidanceLabel.Show();
            this.Controls.Add(myAvoidanceLabel);

            myAvoidanceDistance = new NumericTextComponent(new Point(Location.X, Location.Y + 140), new Size(150, 13), "Distance");
            myAvoidanceDistance.AddTextChangeEvent(this.PanelDataChanged);
            myAvoidanceDistance.BindToPanel(this);
            myAvoidanceDistance.Show();


            myAvoidanceOffset = new Vector3Component(new Point(Location.X, Location.Y + 160), new Size(275, 13), "Offset");
            myAvoidanceOffset.AddTextChangeEvent(this.PanelDataChanged);
            myAvoidanceOffset.BindToPanel(this);
            myAvoidanceOffset.Show();

            myAIMode.AddItem("Keep Distance");
            myAIMode.AddItem("Escape then return");
            myAIMode.AddItem("Kamikaze");
        }
        protected override void IntitalizeControls()
        {
            myWeaponReader.LoadWeapons("Data/Script/LI_list_weapon.xml");
            myWeaponReader.LoadBullets("Data/Script/LI_list_projectile.xml");

            myWeaponTypes = new DropDownComponent(new Point(Location.X, Location.Y + 10), new Size(245, 10), "Weapon");
            myWeaponTypes.GetDropDown().SelectedIndexChanged += new EventHandler(WeaponDropDown_SelectIndex_Changed);
            myWeaponTypes.BindToPanel(this);
            myWeaponTypes.Show();

            myWeaponDataStats = new WeaponDataComponent(new Point(Location.X, Location.Y + 40), new Size(245, 13));
            myWeaponDataStats.BindToPanel(this);
            myWeaponDataStats.Show();

            myBulletTypes = new DropDownComponent(new Point(Location.X, Location.Y + 130), new Size(245, 10), "Bullet");
            myBulletTypes.GetDropDown().SelectedIndexChanged += new EventHandler(BulletDropDown_SelectIndex_Changed);
            myBulletTypes.BindToPanel(this);
            myBulletTypes.Show();

            myBulletDataStats = new BulletDataComponent(new Point(Location.X, Location.Y + 160), new Size(245, 13));
            myBulletDataStats.BindToPanel(this);
            myBulletDataStats.Show();

            myLoadedWeapons = myWeaponReader.GetWeaponData();
            for (int i = 0; i < myLoadedWeapons.Count; ++i)
            {
                myWeaponTypes.AddItem(myLoadedWeapons[i].myType);
            }

            myLoadedBullets = myWeaponReader.GetBulletData();
            for (int i = 0; i < myLoadedBullets.Count; ++i)
            {
                myBulletTypes.AddItem(myLoadedBullets[i].myType);
            }

            mySaveButton.Text     = "Save";
            mySaveButton.Location = new Point(Location.X, Location.Y + 230);
            mySaveButton.Size     = new Size(100, 20);
            mySaveButton.Click   += new EventHandler(this.SaveButton_Click);
            mySaveButton.Show();
            this.Controls.Add(mySaveButton);
        }