Beispiel #1
0
        private void RebuildServoGroupsEditor(ShipConstruct ship = null)
        {
            if (ship == null)
            {
                ship = EditorLogic.fetch.ship;
            }

            ServoGroups = null;

            var groups   = new List <ControlGroup>();
            var groupMap = new Dictionary <string, int>();

            foreach (Part p in ship.Parts)
            {
                foreach (var servo in p.ToServos())
                {
                    if (!groupMap.ContainsKey(servo.Group.Name))
                    {
                        groups.Add(new ControlGroup(servo));
                        groupMap[servo.Group.Name] = groups.Count - 1;
                    }
                    else
                    {
                        ControlGroup g = groups[groupMap[servo.Group.Name]];
                        g.AddControl(servo);
                    }
                }
            }

            if (groups.Count > 0)
            {
                ServoGroups = groups;
            }
        }
Beispiel #2
0
        private void OnVesselChange(Vessel v)
        {
            Logger.Log(string.Format("[ServoController] vessel {0}", v.name));
            ServoGroups = null;

            var groups   = new List <ControlGroup>();
            var groupMap = new Dictionary <string, int>();

            foreach (var servo in v.ToServos())
            {
                if (!groupMap.ContainsKey(servo.Group.Name))
                {
                    groups.Add(new ControlGroup(servo));
                    groupMap[servo.Group.Name] = groups.Count - 1;
                }
                else
                {
                    ControlGroup g = groups[groupMap[servo.Group.Name]];
                    g.AddControl(servo);
                }
            }

            Logger.Log(string.Format("[ServoController] {0} groups", groups.Count));

            if (groups.Count > 0)
            {
                ServoGroups = groups;
            }

            foreach (var servo in v.ToServos())
            {
                servo.RawServo.SetupJoints();
            }
            Logger.Log("[ServoController] OnVesselChange finished successfully", Logger.Level.Debug);
        }
        private void SetControlGroups()
        {
            fromGroup = new ControlGroup(
                this,
                fromTypeComboBox,
                fromIdentLbl,
                fromIdentTxtBox,
                fromRwyLbl,
                fromRwyComboBox,
                sidLbl,
                sidComboBox,
                fromWptLbl,
                fromWptComboBox,
                true,
                procFilter,
                filterSidBtn);

            toGroup = new ControlGroup(
                this,
                toTypeComboBox,
                toIdentLbl,
                toIdentTxtBox,
                toRwyLbl,
                toRwyComboBox,
                starLbl,
                starComboBox,
                toWptLbl,
                toWptComboBox,
                false,
                procFilter,
                filterStarBtn);
        }
        public static ControlGroup BeginControlGroup(this HtmlHelper htmlHelper,
                                                     string controlGroupClass = DefaultControlGroupClass,
                                                     IDictionary <string, object> controlGroupHtmlAttributes = null)
        {
            var container = new ControlGroup(htmlHelper.ViewContext);

            //manipulate class, overriding default if necessary
            if (string.Equals(controlGroupClass, DefaultControlGroupClass, StringComparison.CurrentCultureIgnoreCase) &&
                !string.Equals(controlGroupClass, GetDefaultControlGroupClass(), StringComparison.CurrentCultureIgnoreCase))
            {
                //Set it to the overriden default
                controlGroupClass = GetDefaultControlGroupClass();
            }

            if (controlGroupHtmlAttributes == null)
            {
                controlGroupHtmlAttributes = new Dictionary <string, object>();
            }

            if (!controlGroupHtmlAttributes.ContainsKey(ControlGroupContainerAttribute))
            {
                controlGroupHtmlAttributes.Add(ControlGroupContainerAttribute, "true");
            }

            WriteStartTagWithClass(htmlHelper, container.Tag, controlGroupClass, controlGroupHtmlAttributes);
            return(container);
        }
        public void Refresh(SystemBase system)
        {
            if (system != null)
            {
                var cProj = new List <Controller>();
                // cProj = Project.CurrentProject.ControllerList.FindAll(x => x.ControlSystemID.Equals(system.Id));
                ModelDetail.Clear();
                ControlGroup _group = null;
                //if (cProj.Count <= 0)
                //{
                _group = Project.CurrentProject.ControlGroupList.Find(x => x.ControlSystemID.Equals(system.Id));
                if (_group != null)
                {
                    cProj = Project.CurrentProject.ControllerList.FindAll(x => x.ControlGroupID.Equals(_group.Id));
                }
                //  }

                foreach (var sys in cProj)
                {
                    ModelDetail.Add(new MaterialList
                    {
                        Model       = sys.Model,
                        Description = sys.Description,
                        Qty         = sys.Quantity
                    });
                }
            }
        }
        public static ICommand Create(string name, Control control, ControlGroup controlGroup, MidiController midiController, ILogger logger, IDeviceLocator deviceLocator)
        {
            lock (_controllerCommandsLock)
            {
                InitializeCommands();

                if (_controllerCommands.TryGetValue(control.Controller, out var commandInstance))
                {
                    return(commandInstance);
                }
                else
                {
                    if (_commands.TryGetValue(name, out var _commandType) ||
                        _commands.TryGetValue(name + "Command", out _commandType))
                    {
                        commandInstance = Activator.CreateInstance(_commandType) as ICommand;
                        if (commandInstance != null)
                        {
                            commandInstance.Initialize(control, controlGroup, midiController, logger, deviceLocator);
                        }
                        _controllerCommands.Add(control.Controller, commandInstance);
                        return(commandInstance);
                    }
                }
                return(null);
            }
        }
Beispiel #7
0
        private void AddToGroup(ControlGroup taskGroup, TaskView taskView)
        {
            if (taskGroup.Count == 0)
            {
                taskGroup.Add(taskView); // add if list is empty
            }
            else
            {
                for (int i = taskGroup.Count - 1; i >= 0; i--)
                {
                    TaskView tv = (TaskView)taskGroup[i];
                    if (tv.DueDate > taskView.DueDate)
                    {
                        continue;
                    }
                    else
                    {
                        taskGroup.Insert(i + 1, taskView); // add in the middle or end
                        return;
                    }
                }

                taskGroup.Insert(0, taskView); // add at the top after all controls are moved down using loop
            }
        }
Beispiel #8
0
        public override void DoPreSortLogic(EntitySystem Weapon, List <GameEntity> Targets, ArcenCharacterBuffer TracingBuffer, ArcenSimContext Context)
        {
            base.DoPreSortLogic(Weapon, Targets, TracingBuffer, Context);

            MyLowestSpeedMultiplier = (FInt)999;
            MyPrimaryUnitLocation   = ArcenPoint.ZeroZeroPoint;
            ControlGroup group = Weapon.ParentEntity.EntitySpecificOrders.ControlGroup;

            if (group != null)
            {
                for (int i = 0; i < group.EntityIDs.Count; i++)
                {
                    GameEntity entity = World_AIW2.Instance.GetEntityByID(group.EntityIDs[i]);
                    if (entity == null)
                    {
                        continue;
                    }
                    FInt thisMultiplier = entity.TypeData.Balance_Speed.SpeedMultiplier;
                    if (thisMultiplier <= FInt.Zero)
                    {
                        continue;
                    }
                    MyLowestSpeedMultiplier = Mat.Min(MyLowestSpeedMultiplier, thisMultiplier);
                }

                GameEntity primaryEntity = group.GetPrimaryEntity();
                if (primaryEntity != null)
                {
                    MyPrimaryUnitLocation = primaryEntity.WorldLocation;
                }
            }
        }
Beispiel #9
0
        public override void DoPreSortLogic(EntitySystem Weapon, List <GameEntity> Targets, ArcenCharacterBuffer TracingBuffer, ArcenSimContext Context)
        {
            base.DoPreSortLogic(Weapon, Targets, TracingBuffer, Context);

            ControlGroup myControlGroup = Weapon.ParentEntity.EntitySpecificOrders.ControlGroup;

            for (int i = 0; i < Targets.Count; i++)
            {
                GameEntity target = Targets[i];
                if (target.GetMatches(EntityRollupType.TractorSource) && myControlGroup != null)
                {
                    for (int j = 0; j < target.CurrentlyStrongestTractorSourceHittingThese.Count; j++)
                    {
                        GameEntity tractoredUnit = World_AIW2.Instance.GetEntityByID(target.CurrentlyStrongestTractorSourceHittingThese[j]);
                        if (myControlGroup != tractoredUnit.EntitySpecificOrders.ControlGroup)
                        {
                            continue;
                        }
                        ExternalData_GroupTargetSorting.Primitives data = target.Get_GroupTargetSorting_Primitives();
                        data.IsCurrentlyTractoringMembersOfMyControlGroup = true;
                        break;
                    }
                }
            }
        }
        public bool HandleMovementOrder(ControlGroup Group, ArcenPoint MoveOrderPoint, bool isQueuedCommand)
        {
            ArcenSparseLookup <GameEntity, ArcenPoint> entitiesToPlace;
            GameEntity     coreUnit;
            int            shieldCoverageRadiusOrEquivalent, paddingAroundEachUnit;
            ArcenRectangle firstUnitRect;

            UtilityFunctions_Formation.Helper_FindAndPlaceCoreUnit(Group, MoveOrderPoint, out entitiesToPlace, out coreUnit, out shieldCoverageRadiusOrEquivalent, out paddingAroundEachUnit, out firstUnitRect);

            List <GameEntity> foreZoneEntities, aftZoneEntities;

            UtilityFunctions_Formation.Helper_GetForeAndAftZoneEntities(entitiesToPlace, out foreZoneEntities, out aftZoneEntities);

            bool quadrantExpandsOnXAxis             = false;
            bool quadrantExpandsInPositiveDirection = false;
            int  quadrantMainAxisStart  = firstUnitRect.Top;
            int  quadrantOtherAxisStart = firstUnitRect.CenterX - shieldCoverageRadiusOrEquivalent;
            int  quadrantOtherAxisEnd   = firstUnitRect.CenterX + shieldCoverageRadiusOrEquivalent;

            Helper_DoPlacementWithinProjectedZone(foreZoneEntities, entitiesToPlace, isQueuedCommand, paddingAroundEachUnit,
                                                  quadrantExpandsOnXAxis, quadrantExpandsInPositiveDirection, quadrantMainAxisStart, quadrantOtherAxisStart, quadrantOtherAxisEnd);

            quadrantExpandsInPositiveDirection = true;
            quadrantMainAxisStart = firstUnitRect.Bottom;

            Helper_DoPlacementWithinProjectedZone(aftZoneEntities, entitiesToPlace, isQueuedCommand, paddingAroundEachUnit,
                                                  quadrantExpandsOnXAxis, quadrantExpandsInPositiveDirection, quadrantMainAxisStart, quadrantOtherAxisStart, quadrantOtherAxisEnd);

            UtilityFunctions_Formation.Helper_RotatePointsAccordingToAngleFromCoreUnit(MoveOrderPoint, isQueuedCommand, entitiesToPlace, coreUnit);

            UtilityFunctions_Formation.Helper_ActuallyIssueMoveOrders(isQueuedCommand, entitiesToPlace);

            return(true);
        }
Beispiel #11
0
        private void OnEditorShipModified(ShipConstruct ship)
        {
            ServoGroups = null;

            var groups   = new List <ControlGroup>();
            var groupMap = new Dictionary <string, int>();

            foreach (Part p in ship.Parts)
            {
                foreach (var servo in p.ToServos())
                {
                    if (!groupMap.ContainsKey(servo.Group.Name))
                    {
                        groups.Add(new ControlGroup(servo));
                        groupMap[servo.Group.Name] = groups.Count - 1;
                    }
                    else
                    {
                        ControlGroup g = groups[groupMap[servo.Group.Name]];
                        g.AddControl(servo);
                    }
                }
            }

            if (groups.Count > 0)
            {
                ServoGroups = groups;
            }

            partCounter = EditorLogic.fetch.ship.parts.Count == 1 ? 0 : EditorLogic.fetch.ship.parts.Count;
            Logger.Log("[ServoController] OnEditorShipModified finished successfully", Logger.Level.Debug);
        }
Beispiel #12
0
 public void SetParent(ControlGroup parentGroup)
 {
     if (ParentGroup == null)
     {
         ParentGroup = parentGroup;
         transform.parent = parentGroup.transform;
     }
 }
Beispiel #13
0
 public void Initialize(Control control, ControlGroup controlGroup, MidiController midiController, ILogger logger, IDeviceLocator deviceLocator)
 {
     _midiController    = midiController;
     this.Control       = control;
     this.Logger        = logger;
     this.ControlGroup  = controlGroup;
     this.DeviceLocator = deviceLocator;
 }
        protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);
            var ob = builder as MyObjectBuilder_ControllerSchemaDefinition;

            if (ob.CompatibleDeviceIds != null)
            {
                CompatibleDevices = new List <int>(ob.CompatibleDeviceIds.Count);
                byte[] tmpArr = new byte[4];
                foreach (var cont in ob.CompatibleDeviceIds)
                {
                    if (cont.Length < 8)
                    {
                        Debug.Assert(false, "Invalid device id");
                        continue;
                    }

                    if (TryGetByteArray(cont, 8, out tmpArr))
                    {
                        int packed = BitConverter.ToInt32(tmpArr, 0);
                        CompatibleDevices.Add(packed);
                    }
                    else
                    {
                        Debug.Assert(false, "Invalid device id");
                    }
                }
            }

            if (ob.Schemas != null)
            {
                Schemas = new Dictionary <string, List <ControlGroup> >(ob.Schemas.Count);
                foreach (var schema in ob.Schemas)
                {
                    Debug.Assert(!Schemas.ContainsKey(schema.SchemaName));
                    if (schema.ControlGroups != null)
                    {
                        var controlGroups = new List <ControlGroup>(schema.ControlGroups.Count);
                        Schemas[schema.SchemaName] = controlGroups;

                        foreach (var controlGroup in schema.ControlGroups)
                        {
                            var newControlGroup = new ControlGroup();
                            newControlGroup.Type = controlGroup.Type;
                            newControlGroup.Name = controlGroup.Name;
                            if (controlGroup.ControlDefs != null)
                            {
                                newControlGroup.ControlBinding = new Dictionary <string, MyControllerSchemaEnum>(controlGroup.ControlDefs.Count);
                                foreach (var def in controlGroup.ControlDefs)
                                {
                                    newControlGroup.ControlBinding[def.Type] = def.Control;
                                }
                            }
                        }
                    }
                }
            }
        }
        protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);
            var ob = builder as MyObjectBuilder_ControllerSchemaDefinition;

            if (ob.CompatibleDeviceIds != null)
            {
                CompatibleDevices = new List<int>(ob.CompatibleDeviceIds.Count);
                byte[] tmpArr = new byte[4];
                foreach (var cont in ob.CompatibleDeviceIds)
                {
                    if (cont.Length < 8)
                    {
                        Debug.Assert(false, "Invalid device id");
                        continue;
                    }

                    if (TryGetByteArray(cont, 8, out tmpArr))
                    {
                        int packed = BitConverter.ToInt32(tmpArr, 0);
                        CompatibleDevices.Add(packed);
                    }
                    else
                    {
                        Debug.Assert(false, "Invalid device id");
                    }       
                }
            }
            
            if (ob.Schemas != null)
            {
                Schemas = new Dictionary<string, List<ControlGroup>>(ob.Schemas.Count);
                foreach (var schema in ob.Schemas)
                {
                    Debug.Assert(!Schemas.ContainsKey(schema.SchemaName));
                    if (schema.ControlGroups != null)
                    {
                        var controlGroups = new List<ControlGroup>(schema.ControlGroups.Count);
                        Schemas[schema.SchemaName] = controlGroups;

                        foreach (var controlGroup in schema.ControlGroups)
                        {
                            var newControlGroup = new ControlGroup();
                            newControlGroup.Type = controlGroup.Type;
                            newControlGroup.Name = controlGroup.Name;
                            if (controlGroup.ControlDefs != null)
                            {
                                newControlGroup.ControlBinding = new Dictionary<string, MyControllerSchemaEnum>(controlGroup.ControlDefs.Count);
                                foreach (var def in controlGroup.ControlDefs)
                                {
                                    newControlGroup.ControlBinding[def.Type] = def.Control;
                                }
                            }
                        }
                    }
                }
            }
        }
Beispiel #16
0
    public void MakeControlGroup(ControlGroupTag cgTag, List <Unit> units)
    {
        //ControlGroup newGroup = new ControlGroup();
        ControlGroup newGroup = (ControlGroup)ScriptableObject.CreateInstance(typeof(ControlGroup));

        newGroup.AddUnits(units);
        newGroup.AddTag(cgTag);
        cgs.Add(newGroup);
    }
Beispiel #17
0
        public static ControlGroup BeginControlGroup(this HtmlHelper htmlHelper,
                                                     string controlGroupClass = DefaultControlGroupClass,
                                                     IDictionary <string, object> controlGroupHtmlAttributes = null)
        {
            var container = new ControlGroup(htmlHelper.ViewContext);

            WriteStartTagWithClass(htmlHelper, container.Tag, controlGroupClass, controlGroupHtmlAttributes);
            return(container);
        }
Beispiel #18
0
        public void MoveUp(TaskView tv)
        {
            DateTime updateDate = tv.DueDate.Subtract(TimeSpan.FromDays(1)); //new date for TaskView  (setting default value, used if nothing else works)

            TaskView prevTV = (TaskView)GetPreviousControl(tv, true);

            if (prevTV != null) //1- Move Down within a group
            {
                //1.1 Calculate due date 1 hour before previous
                DateTime previousDueDate = prevTV.MapNode.GetDueDate();
                updateDate = previousDueDate.Subtract(TimeSpan.FromHours(1));

                //1.2 Check if it falls between 'previous' and 'previous to previous'
                TaskView previousToPrevious = (TaskView)GetPreviousControl(prevTV, true);
                if (previousToPrevious != null)
                {
                    DateTime previousToPreviousDueDate = previousToPrevious.MapNode.GetDueDate();
                    if (updateDate < previousToPreviousDueDate)
                    {
                        updateDate = updateDate.Subtract(TimeSpan.FromTicks((previousToPreviousDueDate - previousDueDate).Ticks / 2));
                    }
                }

                //1.3 Check if calculated due date stays within the group
                if (!GetTaskGroup(tv).CanContain(updateDate))
                {
                    updateDate = GetTaskGroup(tv).StartTime;
                }
            }
            else //2- Move up to previous group
            {
                ControlGroup cg = GetPreviousControlGroup(GetControlGroup(tv));

                //2.1 Check if we are not in the first group
                if (cg != null)
                {
                    //2.1.1 set the default first due date of the group
                    updateDate = GetTaskGroup(cg).EndTime.Subtract(new TimeSpan(16, 59, 59));

                    //2.1.2 Check if due date is after the last existing item
                    if (cg.Count > 0 && ((TaskView)cg[cg.Count - 1]).DueDate >= updateDate)
                    {
                        updateDate = GetTaskGroup(cg).EndTime;
                    }

                    //2.1.3 Check if due date is after the orignal date
                    if (updateDate > tv.DueDate)
                    {
                        updateDate = GetTaskGroup(cg).StartTime.Date;
                    }
                }
            }

            //3- Update due date
            tv.MapNode.UpdateDueDate(updateDate);
        }
Beispiel #19
0
 public void AddButton(ControlGroup group)
 {
     GroupButton button = ObjectCreator.Instantiate(GroupButtonPrefab, "GroupButton").GetComponent<GroupButton>();
     button.GetComponent<RectTransform>().SetParent(GetComponent<RectTransform>(), false);
     button.SetControlGroup(group);
     group.SetGroupButton(button);
     button.GetComponent<Toggle>().group = GetComponent<ToggleGroup>();
     button.SetGroupColor(group.GroupColor);
     m_buttons.Add(button);
 }
            public override void OnUpdate()
            {
                WorldSide localSide = World_AIW2.Instance.GetLocalPlayerSide();

                if (localSide == null)
                {
                    return;
                }
                ArcenUI_ButtonSet      elementAsType    = (ArcenUI_ButtonSet)Element;
                Window_InGameRallyMenu windowController = (Window_InGameRallyMenu)Element.Window.Controller;

                if (windowController != null)
                {
                }                                   //prevent compiler warning

                if (windowController.NeedRefresh)
                {
                    windowController.NeedRefresh = false;
                    elementAsType.ClearButtons();

                    int x = 0;
                    for (int i = 0; i < localSide.ControlGroups.Count; i++)
                    {
                        ControlGroup controlGroup = localSide.ControlGroups[i];
                        if (controlGroup.EntityIDs.Count <= 0)
                        {
                            continue;
                        }
                        bItem   newButtonController = new bItem(controlGroup);
                        Vector2 offset;
                        offset.x = x * elementAsType.ButtonWidth;
                        offset.y = 0;
                        Vector2 size;
                        size.x = elementAsType.ButtonWidth;
                        size.y = elementAsType.ButtonHeight;
                        elementAsType.AddButton(newButtonController, size, offset);
                        x++;
                    }

                    {
                        bClear  newButtonController = new bClear();
                        Vector2 offset;
                        offset.x = 9 * elementAsType.ButtonWidth;
                        offset.y = 0;
                        Vector2 size;
                        size.x = elementAsType.ButtonWidth;
                        size.y = elementAsType.ButtonHeight;
                        elementAsType.AddButton(newButtonController, size, offset);
                    }

                    elementAsType.ActuallyPutItemsBackInPoolThatAreStillCleared();
                }
            }
Beispiel #21
0
        public static int AutoFitLabels(params Label[] labels)
        {
            ControlGroup cg         = new ControlGroup(labels);
            int          startWidth = cg.Width;

            foreach (Label label in labels)
            {
                DisplayHelper.AutoFitSystemLabel(label, 0, int.MaxValue);
            }

            return(cg.Width - startWidth);
        }
Beispiel #22
0
 public void AttachToGroup(ControlGroup group)
 {
     if (!m_finished)
     {
         GetComponent<GroupableObject>().SetParent(group);
         group.AddObject(GetComponent<GroupableObject>());
         if (group.IsMoving)
         {
             GetComponent<ObjectAnimationController>().Move();
         }
     }
 }
Beispiel #23
0
        public void Add(MapNode node)
        {
            DateTime     dateTime  = node.GetDueDate();
            ControlGroup ctrlGroup = GetApplicableGroup(dateTime);

            if (ctrlGroup != null)
            {
                ITaskGroup taskGroup = (ITaskGroup)ctrlGroup.Tag;
                TaskView   tv        = new TaskView(node, taskGroup.ShortDueDateString(dateTime), OnTaskViewEvent);
                AddToGroup(ctrlGroup, tv);
            }
        }
Beispiel #24
0
        public void Add(TaskView tv)
        {
            ControlGroup ctrlGroup = GetApplicableGroup(tv.DueDate);

            if (ctrlGroup != null)
            {
                ITaskGroup taskGroup = (ITaskGroup)ctrlGroup.Tag;
                tv.TaskDueOnText = taskGroup.ShortDueDateString(tv.DueDate);
                tv.RefreshTaskPath();
                tv.TaskTitle = tv.MapNode.Text;
                AddToGroup(ctrlGroup, tv);
            }
        }
            public override void GetTextToShow(ArcenDoubleCharacterBuffer buffer)
            {
                base.GetTextToShow(buffer);

                ControlGroup group = World_AIW2.Instance.GetControlGroupByID(World_AIW2.Instance.CurrentActiveSelectionControlGroupPrimaryKeyID);

                if (group != null && group.Formation == null)
                {
                    buffer.Add("*");
                }

                buffer.Add("None");
            }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            using (new AutoGrow(this, AnchorStyles.Right | AnchorStyles.Bottom, false))
            {
                // Fix up the Size group box
                using (new AutoGrow(groupBoxSize, AnchorStyles.Right, false))
                {
                    using (new AutoGrow(panelRowsAndColumns, AnchorStyles.Right, false))
                    {
                        DisplayHelper.AutoFitSystemLabel(labelRows, 0, int.MaxValue);
                        DisplayHelper.AutoFitSystemLabel(labelColumns, 0, int.MaxValue);
                        LayoutHelper.DistributeHorizontally(8, labelRows, numericTextBoxRows);
                        LayoutHelper.DistributeHorizontally(8, labelColumns, numericTextBoxColumns);
                        LayoutHelper.DistributeHorizontally(16,
                                                            new ControlGroup(labelRows, numericTextBoxRows),
                                                            new ControlGroup(labelColumns, numericTextBoxColumns));
                    }
                }

                // Fix up the Appearance group box
                using (new AutoGrow(groupBoxAppearance, AnchorStyles.Right | AnchorStyles.Bottom, false))
                {
                    DisplayHelper.AutoFitSystemCheckBox(checkBoxShowBorder, 0, int.MaxValue);
                    DisplayHelper.AutoFitSystemLabel(label1, 0, int.MaxValue);
                    DisplayHelper.AutoFitSystemLabel(label3, 0, int.MaxValue);
                    DisplayHelper.AutoFitSystemLabel(labelBorderPixels, 0, int.MaxValue);
                    DisplayHelper.AutoFitSystemLabel(labelPaddingPixels, 0, int.MaxValue);
                    DisplayHelper.AutoFitSystemLabel(labelSpacingPixels, 0, int.MaxValue);
                    LayoutHelper.DistributeHorizontally(
                        8,
                        new ControlGroup(checkBoxShowBorder, label1, label3),
                        new ControlGroup(numericTextBoxBorder, numericTextBoxCellPadding, numericTextBoxCellSpacing),
                        new ControlGroup(labelBorderPixels, labelPaddingPixels, labelSpacingPixels)
                        );
                }

                // Make the group boxes the same width
                int maxWidth = Math.Max(groupBoxAppearance.Width, groupBoxSize.Width);
                groupBoxAppearance.Width = maxWidth;
                groupBoxSize.Width       = maxWidth;
            }

            // Align the OK/Cancel
            ControlGroup okCancelGroup = new ControlGroup(buttonOK, buttonCancel);

            okCancelGroup.Left = groupBoxAppearance.Right - okCancelGroup.Width;
            LayoutHelper.FixupOKCancel(buttonOK, buttonCancel);
        }
Beispiel #27
0
        protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);
            MyObjectBuilder_ControllerSchemaDefinition definition = builder as MyObjectBuilder_ControllerSchemaDefinition;

            if (definition.CompatibleDeviceIds != null)
            {
                this.CompatibleDevices = new List <int>(definition.CompatibleDeviceIds.Count);
                byte[] arr = new byte[4];
                foreach (string str in definition.CompatibleDeviceIds)
                {
                    if (str.Length < 8)
                    {
                        continue;
                    }
                    if (this.TryGetByteArray(str, 8, out arr))
                    {
                        int item = BitConverter.ToInt32(arr, 0);
                        this.CompatibleDevices.Add(item);
                    }
                }
            }
            if (definition.Schemas != null)
            {
                this.Schemas = new Dictionary <string, List <ControlGroup> >(definition.Schemas.Count);
                foreach (MyObjectBuilder_ControllerSchemaDefinition.Schema schema in definition.Schemas)
                {
                    if (schema.ControlGroups != null)
                    {
                        List <ControlGroup> list = new List <ControlGroup>(schema.ControlGroups.Count);
                        this.Schemas[schema.SchemaName] = list;
                        foreach (MyObjectBuilder_ControllerSchemaDefinition.ControlGroup group in schema.ControlGroups)
                        {
                            ControlGroup group2 = new ControlGroup {
                                Type = group.Type,
                                Name = group.Name
                            };
                            if (group.ControlDefs != null)
                            {
                                group2.ControlBinding = new Dictionary <string, MyControllerSchemaEnum>(group.ControlDefs.Count);
                                foreach (MyObjectBuilder_ControllerSchemaDefinition.ControlDef def in group.ControlDefs)
                                {
                                    group2.ControlBinding[def.Type] = def.Control;
                                }
                            }
                        }
                    }
                }
            }
        }
Beispiel #28
0
        public static void AddServo(IServo servo)
        {
            if (!Instance)
            {
                return;
            }

            if (Instance.ServoGroups == null)
            {
                Instance.ServoGroups = new List <ControlGroup>();
            }

            if (Gui.ControlsGUI.IRGUI)
            {
                Gui.ControlsGUI.IRGUI.enabled = true;
            }

            ControlGroup controlGroup = null;

            if (!string.IsNullOrEmpty(servo.Group.Name))
            {
                foreach (ControlGroup cg in Instance.ServoGroups)
                {
                    if (servo.Group.Name == cg.Name)
                    {
                        controlGroup = cg;
                        break;
                    }
                }
                if (controlGroup == null)
                {
                    var newGroup = new ControlGroup(servo);
                    Instance.ServoGroups.Add(newGroup);
                    Logger.Log("[ServoController] AddServo adding new ControlGroup", Logger.Level.Debug);
                    return;
                }
            }
            if (controlGroup == null)
            {
                if (Instance.ServoGroups.Count < 1)
                {
                    Instance.ServoGroups.Add(new ControlGroup());
                }
                controlGroup = Instance.ServoGroups[Instance.ServoGroups.Count - 1];
            }

            controlGroup.AddControl(servo);

            Logger.Log("[ServoController] AddServo finished successfully", Logger.Level.Debug);
        }
Beispiel #29
0
            public override void GetTextToShow(ArcenDoubleCharacterBuffer buffer)
            {
                base.GetTextToShow(buffer);

                if (World_AIW2.Instance.CurrentActiveSelectionControlGroupPrimaryKeyID > 0)
                {
                    ControlGroup group = World_AIW2.Instance.GetControlGroupByID(World_AIW2.Instance.CurrentActiveSelectionControlGroupPrimaryKeyID);
                    if (group != null && group.TargetSorter == this.Item)
                    {
                        buffer.Add("*");
                    }
                }

                buffer.Add(this.Item.Name);
            }
Beispiel #30
0
        public ControlGroup GetApplicableGroup(DateTime dueDate)
        {
            for (int i = 0; i < this.ControlGroups.Count; i++)
            {
                ControlGroup ctrlGroup = this.ControlGroups[i];
                ITaskGroup   taskGroup = (ITaskGroup)ctrlGroup.Tag;
                if (taskGroup.CanContain(dueDate))
                {
                    return(ctrlGroup);
                }
            }

            // not found
            return(null);
        }
Beispiel #31
0
        private ControlGroup GetControlGroup(string controlName)
        {
            var controlGroupDef = _controllerDef.ControlGroups.FirstOrDefault(g => g.ControlNames.Contains(controlName));
            var controlGroup    = _userProfile.ControlGroups.FirstOrDefault(g => g.Name == controlGroupDef?.Name);

            if (controlGroupDef != null && controlGroup is null)
            {
                controlGroup = new ControlGroup()
                {
                    Name = controlGroupDef.Name
                };
                _userProfile.ControlGroups.Add(controlGroup);
            }
            return(controlGroup);
        }
Beispiel #32
0
        private void DoAutoWiring(bool isWiringNeeded, Project project, ControlSystem controlSystem)
        {
            controlSys = controlSystem;
            InitWiringNodes(_addflowWiring);
            ControlGroup        controlGroup = project.ControlGroupList.Find(c => c.ControlSystemID.Equals(controlSystem.Id));
            AutoWiringNodeGroup nodeGroup    = null;

            if (controlGroup != null)
            {
                nodeGroup = CreateWiringNodeStructure(controlGroup);

                _addflowWiring.AddNode(nodeGroup);
                float x = X_RowHeader;

                foreach (WiringNodeCentralControl nodeController in nodeGroup.ControllerListLevel1)
                {
                    AutoDrawController(nodeController, x);
                    x += X_OffsetStep;
                }
                x = X_RowHeader;
                foreach (WiringNodeCentralControl nodeController in nodeGroup.ControllerListLevel2)
                {
                    AutoDrawController(nodeController, x);
                    x += X_OffsetStep;
                }
                x = X_RowHeader;
                foreach (WiringNodeCentralControl nodeController in nodeGroup.ControllerListOthers)
                {
                    AutoDrawController(nodeController, x);
                    x += X_OffsetStep;
                }
                x = X_RowHeader;
                foreach (WiringNodeCentralControl nodeSystem in nodeGroup.SystemList)
                {
                    AutoDrawController(nodeSystem, x);
                    x += X_OffsetStep;
                }
                if (isWiringNeeded)
                {
                    DrawLinks(nodeGroup);
                    controlSystem.IsAutoWiringPerformed = true;
                }
                else
                {
                    controlSystem.IsAutoWiringPerformed = false;
                }
            }
        }
            public override MouseHandlingResult HandleClick()
            {
                ControlGroup group = World_AIW2.Instance.GetControlGroupByID(World_AIW2.Instance.CurrentActiveSelectionControlGroupPrimaryKeyID);

                if (group == null)
                {
                    return(MouseHandlingResult.PlayClickDeniedSound);
                }
                GameCommand command = GameCommand.Create(GameCommandType.SetGroupFormation);

                command.RelatedControlGroup = group;
                command.RelatedString       = string.Empty;
                World_AIW2.Instance.QueueGameCommand(command, true);

                return(MouseHandlingResult.None);
            }
        public virtual MvcHtmlString Build(TModel model, BootstrapFormType formType, bool renderButtons = true)
        {
            var  sb               = new StringBuilder(2000);
            var  formElements     = ExtractElementsToRender(model);
            var  groupsofElements = formElements.OrderBy(x => x.ControlSpecs.GroupName).GroupBy(x => x.ControlSpecs.GroupName);
            bool useLegend        = (formElements.Select(x => x.ControlSpecs.GroupName).Distinct().Count() > 1);

            var stringWriter = new StringWriter(sb);

            using (var textWriter = new NavHtmlTextWritter(stringWriter))
            {
                RenderHiddenFields(model, formElements, textWriter);

                foreach (var groupedElements in groupsofElements)
                {
                    var groupName = (!String.IsNullOrEmpty(groupedElements.Key)) ? groupedElements.Key : "General";

                    using (new ElementGroup(textWriter, groupName, useLegend))
                    {
                        var elementsToRender = groupedElements.Where(x => x.ControlSpecs.Control != ControlType.Hidden)
                                               .OrderBy(x => x.ControlSpecs.Order);

                        // loop over the attributes (ordered)..
                        foreach (var formElement in elementsToRender)
                        {
                            using (new ControlGroup(textWriter))
                            {
                                ControlGroup.RenderLabel(formType, formElement, textWriter);

                                using (new ControlContainer(textWriter))
                                {
                                    // Control
                                    RenderElement(textWriter, model, formElement);
                                }
                            }
                        }
                    }
                }

                if (renderButtons)
                {
                    RenderButtons(textWriter);
                }

                return(new MvcHtmlString(sb.ToString()));
            }
        }
Beispiel #35
0
        private void RenderChiefGearHudSounds()
        {
            try
            {
                int i = 0;

                chkMuteSounds = new HudCheckBox();
                chkMuteSounds.Text = "Mute Sound Effects";
                ChiefGearHudSounds.AddControl(chkMuteSounds, new Rectangle(8, 5, 115, 20));
                chkMuteSounds.Checked = mMainSettings.bGearTacticianEnabled;

                HudStaticText lblLandscapeHud = new HudStaticText();
                lblLandscapeHud.FontHeight = nmenuFontHeight;
                lblLandscapeHud.Text = "Gear Sense Sounds:";
                ChiefGearHudSounds.AddControl(lblLandscapeHud, new Rectangle(8, 30, 200, 16));

                ControlGroup cboTrophyLandscapeChoices = new ControlGroup();
                cboTrophyLandscape = new    HudCombo(cboTrophyLandscapeChoices);
                i = 0;
                foreach (Sounds s in SoundList)
                {
                    cboTrophyLandscape.AddItem(s.name, i);
                    i++;
                }
                cboTrophyLandscape.Current = 0;
                ChiefGearHudSounds.AddControl(cboTrophyLandscape, new Rectangle(5, 55, 125, 20));

                HudStaticText lblSound1 = new HudStaticText();
                lblSound1.FontHeight = nmenuFontHeight;
                lblSound1.Text = "Trophies";
                ChiefGearHudSounds.AddControl(lblSound1, new Rectangle(135, 55, 250, 16));

                ControlGroup cboMobLandscapeChoices = new ControlGroup();
                cboMobLandscape = new    HudCombo(cboMobLandscapeChoices);
                i = 0;
                foreach (Sounds s in SoundList)
                {
                    cboMobLandscape.AddItem(s.name, i);
                    i++;
                }
                cboMobLandscape.Current = 0;
                ChiefGearHudSounds.AddControl(cboMobLandscape, new Rectangle(5, 80, 125, 20));

                HudStaticText lblSound2 = new HudStaticText();
                lblSound2.FontHeight = nmenuFontHeight;
                lblSound2.Text = "Mobs";
                ChiefGearHudSounds.AddControl(lblSound2, new Rectangle(135, 80, 250, 16));

                ControlGroup cboPlayerLandscapeChoices = new ControlGroup();
                cboPlayerLandscape = new    HudCombo(cboPlayerLandscapeChoices);
                i = 0;
                foreach (Sounds s in SoundList)
                {
                    cboPlayerLandscape.AddItem(s.name, i);
                    i++;
                }
                cboPlayerLandscape.Current = 0;
                ChiefGearHudSounds.AddControl(cboPlayerLandscape, new Rectangle(5, 105, 125, 20));

                HudStaticText lblSound3 = new HudStaticText();
                lblSound3.FontHeight = nmenuFontHeight;
                lblSound3.Text = "Players";
                ChiefGearHudSounds.AddControl(lblSound3, new Rectangle(135, 105, 250, 16));

                HudStaticText lblCorpseHud = new HudStaticText();
                lblCorpseHud.FontHeight = nmenuFontHeight;
                lblCorpseHud.Text = "GearVisection Sounds:";
                ChiefGearHudSounds.AddControl(lblCorpseHud, new Rectangle(8, 140, 200, 16));

                ControlGroup cboCorpseRareChoices = new ControlGroup();
                cboCorpseRare = new HudCombo(cboCorpseRareChoices);
                i = 0;
                foreach (Sounds s in SoundList)
                {
                    cboCorpseRare.AddItem(s.name, i);
                    i++;
                }
                cboCorpseRare.Current = 0;
                ChiefGearHudSounds.AddControl(cboCorpseRare, new Rectangle(5, 165, 125, 20));

                HudStaticText lblSound4 = new HudStaticText();
                lblSound4.FontHeight = nmenuFontHeight;
                lblSound4.Text = "Corpse with Rare";
                ChiefGearHudSounds.AddControl(lblSound4, new Rectangle(135, 165, 250, 16));

                ControlGroup cboCorpseSelfKillChoices = new ControlGroup();
                cboCorpseSelfKill = new HudCombo(cboCorpseSelfKillChoices);
                i = 0;
                foreach (Sounds s in SoundList)
                {
                    cboCorpseSelfKill.AddItem(s.name, i);
                    i++;
                }
                cboCorpseSelfKill.Current = 0;
                ChiefGearHudSounds.AddControl(cboCorpseSelfKill, new Rectangle(5, 190, 125, 20));

                HudStaticText lblSound5 = new HudStaticText();
                lblSound5.FontHeight = nmenuFontHeight;
                lblSound5.Text = "Lootable Corpse";
                ChiefGearHudSounds.AddControl(lblSound5, new Rectangle(130, 190, 250, 16));

                ControlGroup cboCorpseFellowKillChoices = new ControlGroup();
                cboCorpseFellowKill = new HudCombo(cboCorpseFellowKillChoices);
                i = 0;
                foreach (Sounds s in SoundList)
                {
                    cboCorpseFellowKill.AddItem(s.name, i);
                    i++;
                }
                cboCorpseFellowKill.Current = 0;
                ChiefGearHudSounds.AddControl(cboCorpseFellowKill, new Rectangle(5, 215, 125, 20));

                HudStaticText lblSound6 = new HudStaticText();
                lblSound6.FontHeight = nmenuFontHeight;
                lblSound6.Text = "Lootable Corpse by Fellow";
                ChiefGearHudSounds.AddControl(lblSound6, new Rectangle(130, 215, 250, 16));

               ControlGroup cboDeadMeChoices = new ControlGroup();
                cboDeadMe = new    HudCombo(cboDeadMeChoices);
                i = 0;
                foreach (Sounds s in SoundList)
                {
                    cboDeadMe.AddItem(s.name, i);
                    i++;
                }
                cboDeadMe.Current = 0;
                ChiefGearHudSounds.AddControl(cboDeadMe, new Rectangle(5, 240, 125, 20));

                HudStaticText lblSound7 = new HudStaticText();
                lblSound7.FontHeight = nmenuFontHeight;
                lblSound7.Text = "Dead Me";
                ChiefGearHudSounds.AddControl(lblSound7, new Rectangle(130, 240, 250, 16));

               ControlGroup cboDeadPermittedChoices = new ControlGroup();
                cboDeadPermitted = new    HudCombo(cboDeadPermittedChoices);
                i = 0;
                foreach (Sounds s in SoundList)
                {
                    cboDeadPermitted.AddItem(s.name, i);
                    i++;
                }
                cboDeadPermitted.Current = 0;
                ChiefGearHudSounds.AddControl(cboDeadPermitted, new Rectangle(5, 265, 125, 20));

                HudStaticText lblSound8 = new HudStaticText();
                lblSound8.FontHeight = nmenuFontHeight;
                lblSound8.Text = "Recovery Corpse";
                ChiefGearHudSounds.AddControl(lblSound8, new Rectangle(130, 265, 250, 16));

                HudStaticText lblInspectorHud = new HudStaticText();
                lblInspectorHud.FontHeight = nmenuFontHeight;
                lblInspectorHud.Text = "GearInspector Sounds:";
                ChiefGearHudSounds.AddControl(lblInspectorHud, new Rectangle(8, 295, 200, 16));

                ControlGroup cboTrophyCorpseChoices = new ControlGroup();
                cboTrophyCorpse = new HudCombo(cboTrophyCorpseChoices);
                i = 0;
                foreach (Sounds s in SoundList)
                {
                    cboTrophyCorpse.AddItem(s.name, i);
                    i++;
                }
                cboTrophyCorpse.Current = 0;
                ChiefGearHudSounds.AddControl(cboTrophyCorpse, new Rectangle(5, 320, 125, 20));

                HudStaticText lblSound9 = new HudStaticText();
                lblSound9.FontHeight = nmenuFontHeight;
                lblSound9.Text = "Trophies";
                ChiefGearHudSounds.AddControl(lblSound9, new Rectangle(130, 320, 250, 16));

                ControlGroup cboRuleCorpseChoices = new ControlGroup();
                cboRuleCorpse = new    HudCombo(cboRuleCorpseChoices);
                i = 0;
                foreach (Sounds s in SoundList)
                {
                    cboRuleCorpse.AddItem(s.name, i);
                    i++;
                }
                cboRuleCorpse.Current = 0;
                ChiefGearHudSounds.AddControl(cboRuleCorpse, new Rectangle(5, 345, 125, 20));

                HudStaticText lblSound10 = new HudStaticText();
                lblSound10.FontHeight = nmenuFontHeight;
                lblSound10.Text = "Rule";
                ChiefGearHudSounds.AddControl(lblSound10, new Rectangle(130, 345, 250, 16));

                ControlGroup cboSalvageCorpseChoices = new ControlGroup();
                cboSalvageCorpse = new    HudCombo(cboSalvageCorpseChoices);
                i = 0;
                foreach (Sounds s in SoundList)
                {
                    cboSalvageCorpse.AddItem(s.name, i);
                    i++;
                }
                cboSalvageCorpse.Current = 0;
                ChiefGearHudSounds.AddControl(cboSalvageCorpse, new Rectangle(5, 370, 125, 20));

                HudStaticText lblSound11 = new HudStaticText();
                lblSound11.FontHeight = nmenuFontHeight;
                lblSound11.Text = "Salvage";
                ChiefGearHudSounds.AddControl(lblSound11, new Rectangle(130, 370, 250, 16));

                SubscribeChiefGearHudSounds();

            }
            catch (Exception ex) { LogError(ex); }
        }
Beispiel #36
0
        public ControlGroup GetNextControlGroup(ControlGroup taskGroup)
        {
            int row = tablePanelMain.GetRow(taskGroup) + 1;

            if (row < tablePanelMain.RowCount)
                return ControlGroups[row];
            else
                return null;
        }
Beispiel #37
0
 public static void ShowResults(string title, ControlGroup[] groups)
 {
     ShowHeader(title, groups.Count());
     foreach (ControlGroup group in groups) {
         Console.WriteLine("{0} {1}", group.GroupNumber, group.GroupDescription);
         Console.WriteLine();
         return; //Only show one row
     }
 }
Beispiel #38
0
        private void RenderInventoryHud()
        {
            try
            {
                if (InventoryHudView != null)
                {
                    DisposeInventoryHud();
                }

                InventoryHudView = new HudView("Gear", mGeneralSettings.GearWindowSettings.InventoryHudWidth, mGeneralSettings.GearWindowSettings.InventoryHudHeight, new ACImage(0x6AA5));
                InventoryHudView.UserAlphaChangeable = false;
                InventoryHudView.ShowInBar = false;
                InventoryHudView.UserResizeable = false;
                InventoryHudView.Visible = true;
                InventoryHudView.Ghosted = false;
                InventoryHudView.UserMinimizable = true;
                InventoryHudView.UserClickThroughable = false;
                InventoryHudTabView = new HudTabView();
                InventoryHudView.Controls.HeadControl = InventoryHudTabView;
                InventoryHudTabLayout = new HudFixedLayout();
                InventoryHudTabView.AddTab(InventoryHudTabLayout, "Inventory");
                InventoryHudView.LoadUserSettings();

                lblInventoryClass = new HudStaticText();
                lblInventoryClass.Text = "Class";
                ControlGroup InventoryClasses = new ControlGroup();
                cboInventoryClasses = new HudCombo(InventoryClasses);
                cboInventoryClasses.Change += (sender, index) => cboInventoryClasses_Change(sender, index);

                foreach (IDName info in tDataTable.ClassInvList)
                {
                    cboInventoryClasses.AddItem(info.name, info.ID);
                }
                lblSearchRules = new HudStaticText();
                lblSearchRules.Text = "Up to 3 names or spells. Use ';' to separate and '*' before name but not spells.";

                lblMyChoice = new HudStaticText();
                lblMyChoice.Text = "Search:";

                txtMyChoice = new HudTextBox();
                txtMyChoice.LostFocus += txtMyChoice_LostFocus;

                //Searches for Weapons and Essences

                lblWeapons = new HudStaticText();
                lblWeapons.Text = "Weapons/Essences";

                lblMelee = new HudStaticText();
                lblMelee.Text = "Mel:";
                ControlGroup WieldAttribTypes = new ControlGroup();
                cboWieldAttrib = new HudCombo(WieldAttribTypes);
                cboWieldAttrib.Change += (sender, index) => cboWieldAttrib_Change(sender, index);

                foreach (IDName info in tDataTable.MeleeTypeInvList)
                {
                    cboWieldAttrib.AddItem(info.name, info.ID);
                }

                lblDamage = new HudStaticText();
                lblDamage.Text = "Dam:";
                ControlGroup DamageTypes = new ControlGroup();
                cboDamageType = new HudCombo(DamageTypes);
                cboDamageType.Change += (sender, index) => cboDamageType_Change(sender, index);

                foreach (IDName info in tDataTable.ElementalInvList)
                {
                    cboDamageType.AddItem(info.name, info.ID);
                }

                lblWield = new HudStaticText();
                lblWield.Text = "Lev:";
                ControlGroup WieldLevels = new ControlGroup();
                cboLevel = new HudCombo(WieldLevels);
                cboLevel.Change += (sender, index) => cboLevel_Change(sender, index);

                foreach (IDName info in tDataTable.WeaponWieldInvList)
                {
                    cboLevel.AddItem(info.name, info.ID);
                }

                lblEmbues = new HudStaticText();
                lblEmbues.Text = "Emb:";
                ControlGroup EmbueChoices = new ControlGroup();
                cboEmbues = new HudCombo(EmbueChoices);

                cboEmbues.Change += (sender, index) => cboEmbues_Change(sender, index);

                foreach (IDName info in tDataTable.EmbueInvList)
                {
                    cboEmbues.AddItem(info.name, info.ID);
                }

                lblMastery = new HudStaticText();
                lblMastery.Text = "Mast:";
                ControlGroup MasteryChoices = new ControlGroup();
                cboMastery = new HudCombo(MasteryChoices);

                cboMastery.Change += (sender, index) => cboMastery_Change(sender, index);

                foreach (IDName info in tDataTable.MasteryIndex)
                {
                    cboMastery.AddItem(info.name, info.ID);
                }

                //Armor/Clothing/Jewelry Searches

                lblArmor = new HudStaticText();
                lblArmor.Text = "Armor/Clothing/Aetheria/Jewelry";

                lblSet = new HudStaticText();
                lblSet.Text = "Set:";
                ControlGroup SetChoices = new ControlGroup();
                cboArmorSet = new HudCombo(SetChoices);
                cboArmorSet.Change += (sender, index) => cboArmorSet_Change(sender, index);

                foreach (IDName info in tDataTable.ArmorSetsList)
                {
                    cboArmorSet.AddItem(info.name, info.ID);
                }

                lblArmorWield = new HudStaticText();
                lblArmorWield.Text = "Lev:";
                ControlGroup ArmorLevels = new ControlGroup();
                cboArmorLevel = new HudCombo(ArmorLevels);
                cboArmorLevel.Change += (sender, index) => cboArmorLevel_Change(sender, index);

                foreach (IDName info in tDataTable.ArmorLevelInvList)
                {
                    cboArmorLevel.AddItem(info.name, info.ID);
                }

                lblCovers = new HudStaticText();
                lblCovers.Text = "Cov:";
                ControlGroup CoverageChoices = new ControlGroup();
                cboCoverage = new HudCombo(CoverageChoices);
                cboCoverage.Change += (sender, index) => cboCoverage_Change(sender, index);

                foreach (IDName info in tDataTable.CoverageInvList)
                {
                    cboCoverage.AddItem(info.name, info.ID);
                }

                lblRatings = new HudStaticText();
                lblRatings.Text = "Rat:";
                ControlGroup RatingChoices = new ControlGroup();
                cboRatings = new HudCombo(RatingChoices);
                cboRatings.Change += (sender, index) => cboRatings_Change(sender, index);
                cboRatings.AddItem("None", 0);
                foreach (IDName info in tDataTable.RatingList)
                {
                    cboRatings.AddItem(info.name, info.ID);
                }

                //Search for Salvage

                lblSalvage = new HudStaticText();
                lblSalvage.Text = "Salvage";

                lblMaterial = new HudStaticText();
                lblMaterial.Text = "Mat:";
                ControlGroup MaterialChoices = new ControlGroup();
                cboMaterial = new HudCombo(MaterialChoices);
                cboMaterial.Change += (sender, index) => cboMaterial_Change(sender, index);

                foreach (IDName info in tDataTable.MaterialInvList)
                {
                    cboMaterial.AddItem(info.name, info.ID);
                }

                lblWork = new HudStaticText();
                lblWork.Text = "Work:";
                ControlGroup WorkChoices = new ControlGroup();
                cboSalvWork = new HudCombo(WorkChoices);
                cboSalvWork.Change += (sender, index) => cboSalvWork_Change(sender, index);

                foreach (IDName info in tDataTable.SalvageWorkInvList)
                {
                    cboSalvWork.AddItem(info.name, info.ID);
                }

                btnClrInv = new HudButton();
                btnClrInv.Text = "Clear List";
                btnClrInv.Hit += (sender, index) => btnClrInv_Hit(sender, index);

                btnLstInv = new HudButton();
                btnLstInv.Text = "Update Now!";
                btnLstInv.Hit += (sender, index) => btnLstInv_Hit(sender, index);

                lstHudInventory = new HudList();
                lstHudInventory.AddColumn(typeof(HudPictureBox), 20, null);
                lstHudInventory.AddColumn(typeof(HudStaticText), 150, null);//object
                lstHudInventory.AddColumn(typeof(HudStaticText), 100, null);//set
                lstHudInventory.AddColumn(typeof(HudStaticText), 75, null);//rating
                lstHudInventory.AddColumn(typeof(HudStaticText), 200, null);//toon holding
                lstHudInventory.AddColumn(typeof(HudStaticText), 1, null);

                lstHudInventory.Click += (sender, row, col) => lstHudInventory_Click(sender, row, col);

                InventoryHudTabLayout.AddControl(lblInventoryClass, new Rectangle(10, 15, 35, 16));
                InventoryHudTabLayout.AddControl(cboInventoryClasses, new Rectangle(50, 15, 100, 16));
                InventoryHudTabLayout.AddControl(lblSearchRules, new Rectangle(120, 0, 420, 16));
                InventoryHudTabLayout.AddControl(lblMyChoice, new Rectangle(155, 20, 50, 16));
                InventoryHudTabLayout.AddControl(txtMyChoice, new Rectangle(210, 20, 320, 16));
                InventoryHudTabLayout.AddControl(lblWeapons, new Rectangle(10, 40, 150, 20));
                InventoryHudTabLayout.AddControl(lblArmor, new Rectangle(160, 40, 210, 20));
                InventoryHudTabLayout.AddControl(lblSalvage, new Rectangle(400, 40, 150, 20));

                InventoryHudTabLayout.AddControl(lblMelee, new Rectangle(10, 60, 30, 16));
                InventoryHudTabLayout.AddControl(cboWieldAttrib, new Rectangle(50, 60, 100, 16));
                InventoryHudTabLayout.AddControl(lblSet, new Rectangle(160, 60, 30, 16));
                InventoryHudTabLayout.AddControl(cboArmorSet, new Rectangle(200, 60, 190, 16));
                InventoryHudTabLayout.AddControl(lblMaterial, new Rectangle(400, 60, 30, 16));
                InventoryHudTabLayout.AddControl(cboMaterial, new Rectangle(440, 60, 150, 16));
                InventoryHudTabLayout.AddControl(lblDamage, new Rectangle(10, 80, 30, 16));
                InventoryHudTabLayout.AddControl(cboDamageType, new Rectangle(50, 80, 100, 16));
                InventoryHudTabLayout.AddControl(lblArmorWield, new Rectangle(160, 80, 30, 16));
                InventoryHudTabLayout.AddControl(cboArmorLevel, new Rectangle(200, 80, 190, 16));
                InventoryHudTabLayout.AddControl(lblWork, new Rectangle(400, 80, 30, 16));
                InventoryHudTabLayout.AddControl(cboSalvWork, new Rectangle(440, 80, 100, 16));
                InventoryHudTabLayout.AddControl(lblWield, new Rectangle(10, 100, 30, 16));
                InventoryHudTabLayout.AddControl(cboLevel, new Rectangle(50, 100, 100, 16));
                InventoryHudTabLayout.AddControl(lblCovers, new Rectangle(160, 100, 30, 16));
                InventoryHudTabLayout.AddControl(cboCoverage, new Rectangle(200, 100, 190, 16));
                InventoryHudTabLayout.AddControl(lblRatings, new Rectangle(160, 120, 30, 16));
                InventoryHudTabLayout.AddControl(cboRatings, new Rectangle(200, 120, 100, 16));
                InventoryHudTabLayout.AddControl(lblEmbues, new Rectangle(10, 120, 30, 16));
                InventoryHudTabLayout.AddControl(cboEmbues, new Rectangle(50, 120, 100, 16));
                InventoryHudTabLayout.AddControl(lblMastery, new Rectangle(10, 140, 30, 16));
                InventoryHudTabLayout.AddControl(cboMastery, new Rectangle(50, 140, 100, 16));

                InventoryHudTabLayout.AddControl(btnLstInv, new Rectangle(410, 115, 100, 16));
                InventoryHudTabLayout.AddControl(btnClrInv, new Rectangle(410, 140, 100, 16));
                InventoryHudTabLayout.AddControl(lstHudInventory, new Rectangle(10, 160, 575, 330));

                lblInventoryPending = new HudStaticText();
                lblInventoryPending.Text = "Inventory Items Pending Id:";
                InventoryHudTabLayout.AddControl(lblInventoryPending, new Rectangle(10, mGeneralSettings.GearWindowSettings.InventoryHudHeight - 35, 150, 16));

                txtInventoryPending = new HudStaticText();
                txtInventoryPending.Text = String.Empty;
                InventoryHudTabLayout.AddControl(txtInventoryPending, new Rectangle(175, mGeneralSettings.GearWindowSettings.InventoryHudHeight - 35, 50, 16));

                InventoryHudView.VisibleChanged += InventoryHudView_VisibleChanged;

            }
            catch (Exception ex) { LogError(ex); }
            return;
        }
        public void SetControlGroup(Native.VirtualKey key, bool appendToGroup = false)
        {
            if (!Native.IsNumberKey(key)) return;
            if (appendToGroup)
            {
                SelectControlGroup(key, true);
            }

            var selection = Globals.ThisAddIn.Application.ActiveWindow.Selection;
            if (selection.Type != PpSelectionType.ppSelectionShapes) return;

            var shapes = new HashSet<int>(selection.ShapeRange.Cast<Shape>().Select(shape => shape.Id));
            var slideId = PowerPointCurrentPresentationInfo.CurrentSlide.ID;

            _controlGroups[key] = new ControlGroup(slideId, shapes);
        }
 public ControlGroupControlAdapter(ControlGroup c)
 {
     this.c = c;
 }
        private void RenderInspectorAdvancedTab()
        {
            try
            {
                chkAdvEnabled = new HudCheckBox();
                chkAdvEnabled.Text = "Enabled";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(chkAdvEnabled, new Rectangle(5, 5, 50, 16));

                lblAdvKey = new HudStaticText();
                lblAdvKey.Text = "Key Type";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(lblAdvKey, new Rectangle(5, 25, 100, 16));

                lblAdvKeyName = new HudStaticText();
                lblAdvKeyName.Text = "Key Name";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(lblAdvKeyName, new Rectangle(75, 25, 100, 16));

                lblAdvKeyComparison = new HudStaticText();
                lblAdvKeyComparison.Text = "Comparison";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(lblAdvKeyComparison, new Rectangle(235, 25, 100, 16));

                lblAdvKeyValue = new HudStaticText();
                lblAdvKeyValue.Text = "Key Value";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(lblAdvKeyValue, new Rectangle(380, 25, 100, 16));

                ControlGroup cboAdv1KeyTypeChoices = new ControlGroup();
                cboAdv1KeyType = new HudCombo(cboAdv1KeyTypeChoices);
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv1KeyType, new Rectangle(5, 45, 60, 20));

                ControlGroup cboAdv1KeyChoices = new ControlGroup();
                cboAdv1Key = new HudCombo(cboAdv1KeyChoices);
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv1Key, new Rectangle(75, 45, 150, 20));

                ControlGroup cboAdv1KeyCompareChoices = new ControlGroup();
                cboAdv1KeyCompare = new HudCombo(cboAdv1KeyCompareChoices);
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv1KeyCompare, new Rectangle(235, 45, 125, 20));

                txtAdv1KeyValue = new HudTextBox();
                txtAdv1KeyValue.Text = "";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(txtAdv1KeyValue, new Rectangle(380, 45, 75, 16));

                ControlGroup cboAdv1LinkChoices = new ControlGroup();
                cboAdv1Link = new HudCombo(cboAdv1LinkChoices);
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv1Link, new Rectangle(5, 65, 60, 20));

                ControlGroup cboAdv2KeyTypeChoices = new ControlGroup();
                cboAdv2KeyType = new HudCombo(cboAdv2KeyTypeChoices);
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv2KeyType, new Rectangle(5, 85, 60, 20));

                ControlGroup cboAdv2KeyChoices = new ControlGroup();
                cboAdv2Key = new HudCombo(cboAdv2KeyChoices);
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv2Key, new Rectangle(75, 85, 150, 20));

                ControlGroup cboAdv2KeyCompareChoices = new ControlGroup();
                cboAdv2KeyCompare = new HudCombo(cboAdv2KeyCompareChoices);
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv2KeyCompare, new Rectangle(235, 85, 125, 20));

                txtAdv2KeyValue = new HudTextBox();
                txtAdv2KeyValue.Text = "";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(txtAdv2KeyValue, new Rectangle(380, 85, 75, 16));

                ControlGroup cboAdv2LinkChoices = new ControlGroup();
                cboAdv2Link = new HudCombo(cboAdv2LinkChoices);
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv2Link, new Rectangle(5, 105, 60, 20));

                ControlGroup cboAdv3KeyTypeChoices = new ControlGroup();
                cboAdv3KeyType = new HudCombo(cboAdv3KeyTypeChoices);
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv3KeyType, new Rectangle(5, 125, 60, 20));

                ControlGroup cboAdv3KeyChoices = new ControlGroup();
                cboAdv3Key = new HudCombo(cboAdv3KeyChoices);
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv3Key, new Rectangle(75, 125, 150, 20));

                ControlGroup cboAdv3KeyCompareChoices = new ControlGroup();
                cboAdv3KeyCompare = new HudCombo(cboAdv3KeyCompareChoices);
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv3KeyCompare, new Rectangle(235, 125, 125, 20));

                txtAdv3KeyValue = new HudTextBox();
                txtAdv3KeyValue.Text = "";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(txtAdv3KeyValue, new Rectangle(380, 125, 75, 16));

                ControlGroup cboAdv3LinkChoices = new ControlGroup();
                cboAdv3Link = new HudCombo(cboAdv3LinkChoices);
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv3Link, new Rectangle(5, 145, 60, 20));

                ControlGroup cboAdv4KeyTypeChoices = new ControlGroup();
                cboAdv4KeyType = new HudCombo(cboAdv4KeyTypeChoices);;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv4KeyType, new Rectangle(5, 165, 60, 20));

                ControlGroup cboAdv4KeyChoices = new ControlGroup();
                cboAdv4Key = new HudCombo(cboAdv4KeyChoices);
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv4Key, new Rectangle(75, 165, 150, 20));

                ControlGroup cboAdv4KeyCompareChoices = new ControlGroup();
                cboAdv4KeyCompare = new HudCombo(cboAdv4KeyCompareChoices);
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv4KeyCompare, new Rectangle(235, 165, 125, 20));

                txtAdv4KeyValue = new HudTextBox();
                txtAdv4KeyValue.Text = "";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(txtAdv4KeyValue, new Rectangle(380, 165, 75, 16));

                ControlGroup cboAdv4LinkChoices = new ControlGroup();
                cboAdv4Link = new HudCombo(cboAdv4LinkChoices);
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv4Link, new Rectangle(5, 185, 60, 20));

                ControlGroup cboAdv5KeyTypeChoices = new ControlGroup();
                cboAdv5KeyType = new HudCombo(cboAdv5KeyTypeChoices);
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv5KeyType, new Rectangle(5, 205, 60, 20));

                ControlGroup cboAdv5KeyChoices = new ControlGroup();
                cboAdv5Key = new HudCombo(cboAdv5KeyChoices);
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv5Key, new Rectangle(75, 205, 150, 20));

                ControlGroup cboAdv5KeyCompareChoices = new ControlGroup();
                cboAdv5KeyCompare = new HudCombo(cboAdv5KeyCompareChoices);
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv5KeyCompare, new Rectangle(235, 205, 125, 20));

                txtAdv5KeyValue = new HudTextBox();
                txtAdv5KeyValue.Text = "";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(txtAdv5KeyValue, new Rectangle(380, 205, 75, 16));

                chkAdvEnabled.Change += chkAdvEnabled_Change;

                cboAdv1KeyType.Change += cboAdv1KeyType_Change;
                cboAdv1Key.Change += cboAdv1Key_Change;
                cboAdv1KeyCompare.Change += cboAdv1KeyCompare_Change;
                txtAdv1KeyValue.LostFocus += txtAdv1KeyValue_LostFocus;
                cboAdv1Link.Change += cboAdv1Link_Change;

                cboAdv2KeyType.Change += cboAdv2KeyType_Change;
                cboAdv2Key.Change += cboAdv2Key_Change;
                cboAdv2KeyCompare.Change += cboAdv2KeyCompare_Change;
                txtAdv2KeyValue.LostFocus += txtAdv2KeyValue_LostFocus;
                cboAdv2Link.Change += cboAdv2Link_Change;

                cboAdv3KeyType.Change += cboAdv3KeyType_Change;
                cboAdv3Key.Change += cboAdv3Key_Change;
                cboAdv3KeyCompare.Change += cboAdv3KeyCompare_Change;
                txtAdv3KeyValue.LostFocus += txtAdv3KeyValue_LostFocus;
                cboAdv3Link.Change += cboAdv3Link_Change;

                cboAdv4KeyType.Change += cboAdv4KeyType_Change;
                cboAdv4Key.Change += cboAdv4Key_Change;
                cboAdv4KeyCompare.Change += cboAdv4KeyCompare_Change;
                txtAdv4KeyValue.LostFocus += txtAdv4KeyValue_LostFocus;
                cboAdv4Link.Change += cboAdv4Link_Change;

                cboAdv5KeyType.Change += cboAdv5KeyType_Change;
                cboAdv5Key.Change += cboAdv5Key_Change;
                cboAdv5KeyCompare.Change += cboAdv5KeyCompare_Change;
                txtAdv5KeyValue.LostFocus += txtAdv5KeyValue_LostFocus;

            }catch(Exception ex){LogError(ex);}
        }
Beispiel #42
0
 public ITaskGroup GetTaskGroup(ControlGroup cg)
 {
     return (ITaskGroup)cg.Tag;
 }
Beispiel #43
0
        private TaskView FindTaskViewInGroup(ControlGroup taskGroup, MapNode node, DateTime dueDate)
        {
            for (int i = 0; i < taskGroup.Count; i++)
            {
                TaskView tv = (TaskView)taskGroup[i];
                if (tv.MapNode == node)
                {
                    return tv;
                }

                if (tv.DueDate > dueDate)
                {
                    break;
                }
            }

            return null;
        }
Beispiel #44
0
 public void SetControlGroup(ControlGroup group)
 {
     m_controlledGroup = group;
 }
Beispiel #45
0
        private void RenderArmorSettingsTabLayout()
        {
            try
            {
                xdocGenArmor = XDocument.Load(genArmorFilename);

                List<XElement> names = new List<XElement>();
                 IEnumerable<XElement> prenames = xdocGenArmor.Element("Objs").Descendants("Obj");
                var lstsorted = from element in prenames
                                 orderby element.Element("ToonName").Value ascending

                                 select element;
                names.AddRange(lstsorted);

                ControlGroup myToonNames = new ControlGroup();
                cboToonArmorName = new HudCombo(myToonNames);

                cboToonArmorName.Change += (sender,index) => cboToonArmorName_Change(sender,index);
                btnInventoryArmor = new HudButton();
                btnInventoryArmor.Text = "Inventory Armor";
                btnInventoryArmor.Hit += (sender,index) => btnInventoryArmor_Hit(sender,index);

               lstAllToonName = new List<string>();
                try{
                    string name = "";
                    lstAllToonName.Add("None");
                    cboToonArmorName.AddItem("None", 0);
                     foreach (XElement el in names)
                    {
                        name = el.Element("ToonName").Value;
                        int i = 1;
                        if (!lstAllToonName.Contains(name))
                        {
                            try
                            {
                                lstAllToonName.Add(name);
                                cboToonArmorName.AddItem(name, i);
                                i++;
                            }
                            catch (Exception ex) { LogError(ex); }

                        }
                    }
               }
                catch (Exception ex) { LogError(ex); }

                lblToonSettingsNameInfo = new HudStaticText();
                lblToonSettingsNameInfo.FontHeight = nmenuFontHeight;
                lblToonSettingsNameInfo.Text = "Name of toon whose armor to be studied:";

                ArmorHudSettings.AddControl(btnInventoryArmor, new Rectangle(5, 30, 100, 20));

                ArmorHudSettings.AddControl(lblToonSettingsNameInfo,new Rectangle(5,100,300,16));

               ArmorHudSettings.AddControl(cboToonArmorName, new Rectangle(320, 100, 150, 16));

                ArmorSettingsTab = true;
                xdocGenArmor = null;
             }
            catch (Exception ex) { LogError(ex); }
        }
Beispiel #46
0
 public void SelectGroup(ControlGroup group)
 {
     SelectedGroup = group;
     SetSelectorPosition();
 }
Beispiel #47
0
 public void Free()
 {
     ParentGroup.FreeObject(this);
     ParentGroup = null;
     transform.parent = LevelController.Instance.transform;
 }
Beispiel #48
0
        private void RenderWorkersHudTab()
        {
            try
            {

                WorkersHudView.VisibleChanged += WorkersHudView_VisibleChanged;

                lblWorkers = new HudStaticText();
                lblWorkers.Text = "Workers";
                lblWorkerLevel = new HudStaticText();
                lblWorkerLevel.Text = "Level";
                lblWorkerBurden = new HudStaticText();
                lblWorkerBurden.Text = "Burden";
                lblWorkerPackSpace = new HudStaticText();
                lblWorkerPackSpace.Text = "Pack Space";

                ControlGroup Workers = new ControlGroup();
                cboWorkers = new HudCombo(Workers);
                MyWorkers = new List<string>();
                cboWorkers.Change += (sender, index) => cboWorkers_Change(sender, index);
                if (MyWorkers.Count == 0)
                {
                    var snames = cHarActors.GetCharacterNames().ToList().OrderBy(x => x);
                    MyWorkers.AddRange(snames);
                }
                for (int i = 0; i < MyWorkers.Count; i++) { cboWorkers.AddItem(MyWorkers[i], i); }

                //lblWorkingNow = new HudStaticText();
                //lblWorkingNow.Text = "Current Gear Worker: ";

                lstHudWorkers = new HudList();
                lstHudWorkers.AddColumn(typeof(HudStaticText), 100, null);//name
                lstHudWorkers.AddColumn(typeof(HudStaticText), 60, null);//level
                lstHudWorkers.AddColumn(typeof(HudStaticText), 60, null);//Available pack space
                lstHudWorkers.AddColumn(typeof(HudStaticText), 60, null);//Burden

                lstHudWorkers.Click += (sender, row, col) => lstHudWorkers_Click(sender, row, col);

                WorkersTabLayout.AddControl(cboWorkers, new Rectangle(60, 5, 100, 16));
                //WorkersTabLayout.AddControl(lblWorkingNow, new Rectangle(200, 5, 200, 16));
                WorkersTabLayout.AddControl(lblWorkers, new Rectangle(10, 25, 45, 16));
                WorkersTabLayout.AddControl(lblWorkerLevel, new Rectangle(120, 25, 45, 16));
                WorkersTabLayout.AddControl(lblWorkerPackSpace, new Rectangle(160, 25, 60, 16));
                WorkersTabLayout.AddControl(lblWorkerBurden, new Rectangle(250, 25, 45, 16));
                WorkersTabLayout.AddControl(lstHudWorkers, new Rectangle(10, 40, 300, 300));
                updateWorkersTabLayout();

            }
            catch (Exception ex) { LogError(ex); }
        }
Beispiel #49
0
        public ControlGroup GetPreviousControlGroup(ControlGroup taskGroup)
        {
            int row = tablePanelMain.GetRow(taskGroup) - 1;

            if (row > -1)
                return ControlGroups[row];
            else
                return null;
        }
Beispiel #50
0
        private void RenderArmorHudUpdateArmorTab()
        {
            try
            {
              //  SetUp Initial Information;
                toonArmorUpdateName = AetherCharacter.CharStats.Name;
                string toonArmorUpdateLevel = AetherCharacter.ChracterLevel.ToString();
                     lblToonArmorUpdateName = new HudStaticText();
                     lblToonArmorUpdateName.Text = toonArmorUpdateName;
                     lblToonArmorUpdateLevel = new HudStaticText();
                     lblToonArmorUpdateLevel.Text = "Level: " + toonArmorUpdateLevel;
                     ArmorUpdateHudTabLayout.AddControl(lblToonArmorUpdateName, new Rectangle(0, 0, 100, 20));
                     ArmorUpdateHudTabLayout.AddControl(lblToonArmorUpdateLevel, new Rectangle(100, 0, 100, 20));

                //set up list of online toon armor
                     ArmorUpdateHudList = new HudList();
                     ArmorUpdateHudListRow = new HudList.HudListRowAccessor();
                     ArmorUpdateHudTabLayout.AddControl(ArmorUpdateHudList, new Rectangle(0, 40, 985, 155));

                     ArmorUpdateHudList.AddColumn(typeof(HudStaticText), 150, null);//object
                     ArmorUpdateHudList.AddColumn(typeof(HudStaticText), 100, null);//set
                     ArmorUpdateHudList.AddColumn(typeof(HudStaticText), 75, null);//rating
                     ArmorUpdateHudList.AddColumn(typeof(HudStaticText), 200, null);//toonholding
                     ArmorUpdateHudList.AddColumn(typeof(HudStaticText), 450, null);//spells
                     ArmorUpdateHudList.AddColumn(typeof(HudStaticText), 1, null);

                    ArmorUpdateHudList.Click += (sender, row, col) => ArmorUpdateHudList_Click(sender, row, col);

                //set up list of armor available
                     ArmorAvailableHudList = new HudList();
                     ArmorAvailableHudListRow = new HudList.HudListRowAccessor();
                     ArmorUpdateHudTabLayout.AddControl(ArmorAvailableHudList, new Rectangle(0, 205, 985, 180));
                    ArmorAvailableHudList.AddColumn(typeof(HudPictureBox), 20, null);
                    ArmorAvailableHudList.AddColumn(typeof(HudStaticText), 150, null);
                    ArmorAvailableHudList.AddColumn(typeof(HudStaticText), 100, null);
                    ArmorAvailableHudList.AddColumn(typeof(HudStaticText), 75, null);
                    ArmorAvailableHudList.AddColumn(typeof(HudStaticText), 125, null);
                    ArmorAvailableHudList.AddColumn(typeof(HudStaticText), 450, null);
                    ArmorAvailableHudList.AddColumn(typeof(HudStaticText), 1, null);

                     ArmorAvailableHudList.Click += (sender, row, col) => ArmorAvailableHudList_Click(sender, row, col);

                    lblAvailableSearchRules = new HudStaticText();
                    lblAvailableSearchRules.Text = "Search on 1 to 3 choices in name or spells. Use ';' to separate.";

                     lblArmorAvailableCovers = new HudStaticText();
                     lblArmorAvailableCovers.Text = "Cov:";
                     ControlGroup CoverageChoices = new ControlGroup();
                     cboArmorAvailableCovers = new HudCombo(CoverageChoices);
                     cboArmorAvailableCovers.Change += (sender, index) => cboArmorAvailableCovers_Change(sender, index);

                     int i = 0;
                     foreach (IDName info in tDataTable.CoverageInvList)
                     {
                         cboArmorAvailableCovers.AddItem(info.name, i);
                         i++;
                     }

                     lblArmorAvailableSet = new HudStaticText();
                     lblArmorAvailableSet.Text = "Set:";
                     ControlGroup SetChoices = new ControlGroup();
                     cboArmorAvailableSet = new HudCombo(SetChoices);
                     cboArmorAvailableSet.Change += (sender, index) => cboArmorAvailableSet_Change(sender, index);

                     i = 0;
                     foreach (IDName info in tDataTable.ArmorSetsInvList)
                     {
                         cboArmorAvailableSet.AddItem(info.name, i);
                         i++;
                     }
                     lblArmorAvailableChoice = new HudStaticText();
                     lblArmorAvailableChoice.Text = "Search for:";
                     lblArmorAvailableClass = new HudStaticText();
                     lblArmorAvailableClass.Text = "Class:";
                     txtArmorAvailableChoice = new HudTextBox();
                     txtArmorAvailableChoice.LostFocus += txtArmorAvailableChoice_LostFocus;
                     ControlGroup SetClasses = new ControlGroup();
                     cboArmorAvailableClass = new HudCombo(SetClasses);
                     cboArmorAvailableClass.Change += (sender, index) => cboArmorAvailableClass_Change(sender, index);

                     string[] loadme = {"None","Armor","Clothing","Jewelry"};
                     int j = 0;
                     armorAvailableClassList = new List<IDName>();

                      foreach (string load in loadme)
                    {
                        IDName info = new IDName();
                        info.ID = j++;
                        info.name = load;
                        armorAvailableClassList.Add(info);
                        cboArmorAvailableClass.AddItem(info.name, info.ID);
                    }

                     btnClearListArmorAvailable = new HudButton();
                     btnClearListArmorAvailable.Text = "Clear List";
                     btnClearListArmorAvailable.Hit += (sender, index) => btnClearListArmorAvailable_Hit(sender, index);

                     btnListArmorAvailable = new HudButton();
                     btnListArmorAvailable.Text = "List Inventory";

                     btnListArmorAvailable.Hit += (sender, index) => btnListArmorAvailable_Hit(sender, index);

                     ArmorUpdateHudTabLayout.AddControl(lblArmorAvailableClass, new Rectangle(0, 395, 30, 18));
                     ArmorUpdateHudTabLayout.AddControl(cboArmorAvailableClass, new Rectangle(60, 395, 200, 18));
                     ArmorUpdateHudTabLayout.AddControl(lblArmorAvailableChoice, new Rectangle(300, 395, 80, 18));
                     ArmorUpdateHudTabLayout.AddControl(txtArmorAvailableChoice, new Rectangle(410, 395, 490, 18));
                     ArmorUpdateHudTabLayout.AddControl(lblArmorAvailableCovers, new Rectangle(0, 425, 30, 18));
                     ArmorUpdateHudTabLayout.AddControl(cboArmorAvailableCovers, new Rectangle(60, 425, 200, 18));
                     ArmorUpdateHudTabLayout.AddControl(lblArmorAvailableSet, new Rectangle(0, 455, 30, 18));
                     ArmorUpdateHudTabLayout.AddControl(cboArmorAvailableSet, new Rectangle(60, 455, 200, 18));
                     ArmorUpdateHudTabLayout.AddControl(lblAvailableSearchRules, new Rectangle(500, 425, 380, 18));
                     ArmorUpdateHudTabLayout.AddControl(btnListArmorAvailable, new Rectangle(330, 455, 100, 18));
                     ArmorUpdateHudTabLayout.AddControl(btnClearListArmorAvailable, new Rectangle(490, 455, 100, 18));

                     FillArmorUpdateHudList();

            }
            catch (Exception ex) { LogError(ex); }
        }
        private void RenderWorkersHud()
        {
            try
            {
                if (WorkersHudView != null)
                {
                    DisposeWorkersHud();
                }
                WorkersHudView = new HudView("GearWorkers", 400, 400, new ACImage(0x6AA5));
                WorkersHudView.UserAlphaChangeable = false;
                WorkersHudView.ShowInBar = false;
                WorkersHudView.Visible = true;
                WorkersHudView.Ghosted = false;
                WorkersHudView.UserMinimizable = true;
                WorkersHudView.UserClickThroughable = false;
                WorkersHudTabView = new HudTabView();
                WorkersHudView.Controls.HeadControl = WorkersHudTabView;
                WorkersHudTabLayout = new HudFixedLayout();
                WorkersHudTabView.AddTab(WorkersHudTabLayout, "Gear Workers");
                WorkersHudView.LoadUserSettings();

                lblWorkers = new HudStaticText();
                lblWorkers.Text = "Workers";
                ControlGroup Workers = new ControlGroup();
                cboWorkers = new HudCombo(Workers);

                cboWorkers.Change += (sender, index) => cboWorkers_Change(sender, index);
                var snames = cHarActors.GetCharacterNames().ToList().OrderBy(x => x);
                MyWorkers.AddRange(snames);
                for (int i = 0; i < MyWorkers.Count; i++) { cboWorkers.AddItem(MyWorkers[i], i); }

                lblWorkingNow = new HudStaticText();
                lblWorkingNow.Text = "Current Gear Worker: ";

                WorkersHudTabLayout.AddControl(lblWorkers, new Rectangle(10, 15, 45, 16));
                WorkersHudTabLayout.AddControl(cboWorkers, new Rectangle(60, 15, 100, 16));
                WorkersHudTabLayout.AddControl(lblWorkingNow, new Rectangle(200, 0, 200, 16));
            }
            catch (Exception ex) { LogError(ex); }
        }
Beispiel #52
0
        private void RenderWorkerSpecificsTab()
        {
            try
            {

                lstHudWorkerSpecifics = new HudList();
                lstHudWorkerSpecifics.AddColumn(typeof(HudStaticText), 150, null);//name
                lstHudWorkerSpecifics.AddColumn(typeof(HudStaticText), 40, null);//level
                //    lstHudWorkerSpecifics.AddColumn(typeof(HudStaticText), 200, null);//Item Missing

                lstHudWorkerSpecifics.Click += (sender, row, col) => lstHudWorkerSpecifics_Click(sender, row, col);
                lblMissingPortals = new HudStaticText();
                lblMissingPortals.Text = "Select Missing Portal";
                lblMissingTitles = new HudStaticText();
                lblMissingTitles.Text = "Select Missing Title";
                lblWorkerSpecificLevel = new HudStaticText();
                lblWorkerSpecificLevel.Text = "Select level of Worker";
                lblToonMissing = new HudStaticText();
                lblToonMissing.Text = "Worker lacks";
                lblToonSpecificLevel = new HudStaticText();
                lblToonSpecificLevel.Text = "Level";
                btnClrSpecifics = new HudButton();
                btnClrSpecifics.Text = "Clear List";
                btnClrSpecifics.Hit += (sender, index) => btnClrSpecifics_Hit(sender, index);

                ControlGroup PossPortals = new ControlGroup();
                cboPortals = new HudCombo(PossPortals);
                cboPortals.Change += (sender, index) => cboPortals_Change(sender, index);

                createPortalsList();
                foreach (IDName info in Portals) { cboPortals.AddItem(info.name, info.ID); }

                ControlGroup PossTitles = new ControlGroup();
                cboTitles = new HudCombo(PossTitles);
                cboTitles.Change += (sender, index) => cboTitles_Change(sender, index);
                createTitlesList();
                foreach (IDName info in Titles) { cboTitles.AddItem(info.name, info.ID); }

                ControlGroup Level = new ControlGroup();
                cboWorkerSpecificLevel = new HudCombo(Level);
                cboWorkerSpecificLevel.Change += (sender, index) => cboWorkerSpecificLevel_Change(sender, index);
                createSpecificLevelList();
                foreach (IDName info in SpecificLevels) { cboWorkerSpecificLevel.AddItem(info.name, info.ID); }

                WorkerSpecificsTabLayout.AddControl(lblMissingPortals, new Rectangle(5, 40, 150, 16));
                WorkerSpecificsTabLayout.AddControl(cboPortals, new Rectangle(160, 40, 180, 16));
                //WorkerSpecificsTabLayout.AddControl(lblMissingTitles, new Rectangle(5, 20, 150, 16));
                //WorkerSpecificsTabLayout.AddControl(cboTitles, new Rectangle(160, 20, 180, 16));
                WorkerSpecificsTabLayout.AddControl(lblWorkerSpecificLevel, new Rectangle(5, 5, 150, 16));
                WorkerSpecificsTabLayout.AddControl(cboWorkerSpecificLevel, new Rectangle(160, 5, 180, 16));
                WorkerSpecificsTabLayout.AddControl(btnClrSpecifics, new Rectangle(5, 60, 60, 16));
                WorkerSpecificsTabLayout.AddControl(lblToonMissing, new Rectangle(5, 80, 100, 16));
                WorkerSpecificsTabLayout.AddControl(lblToonSpecificLevel, new Rectangle(160, 80, 50, 16));

                WorkerSpecificsTabLayout.AddControl(lstHudWorkerSpecifics, new Rectangle(5, 100, 300, 300));
              //  UpdateWorkerSpecificsTab();

            }
            catch (Exception ex) { LogError(ex); }
        }
Beispiel #53
0
        private void RenderArmorUpdateTabLayout()
        {
            try
            {
               lblToonArmorUpdateName = new HudStaticText();
                lblToonArmorUpdateName.FontHeight = nmenuFontHeight;
                lblToonArmorUpdateName.Text = "";
                lblToonArmorUpdateLevel = new HudStaticText();
                lblToonArmorUpdateLevel.FontHeight = nmenuFontHeight;
                lblToonArmorUpdateMaster = new HudStaticText();
                lblToonArmorUpdateMaster.FontHeight = nmenuFontHeight;
                ArmorUpdateHudList = new HudList();
                ArmorUpdateHudListRow = new HudList.HudListRowAccessor();
                ArmorAvailableList = new HudList();
                ArmorAvailableListRow = new HudList.HudListRowAccessor();
                armorSelectFilename = currDir + @"\armorSelected.xml";
            //    WriteToChat("Height: " + ArmorHudFirstHeight + ", Width: " + ArmorHudWidth);

                ArmorUpdateHudTabLayout.AddControl(lblToonArmorUpdateName, new Rectangle(0, 0, 100, 50));
                //ArmorUpdateHudTabLayout.AddControl(lblToonArmorUpdateLevel, new Rectangle(120, 0, 40, 16));
                //ArmorUpdateHudTabLayout.AddControl(lblToonArmorUpdateMaster, new Rectangle(150, 0, 60, 16));
                ArmorUpdateHudTabLayout.AddControl(ArmorUpdateHudList, new Rectangle(0, 30, ArmorHudWidth, (ArmorHudHeight) / 3));

                //ArmorHudList.ControlHeight = Convert.ToInt32(.05*ArmorHudHeight);
                ArmorUpdateHudList.AddColumn(typeof(HudStaticText), Convert.ToInt32(.20 * ArmorHudWidth), null);
                ArmorUpdateHudList.AddColumn(typeof(HudStaticText), Convert.ToInt32(.15 * ArmorHudWidth), null);
                ArmorUpdateHudList.AddColumn(typeof(HudStaticText), Convert.ToInt32(.52 * ArmorHudWidth), null);

                ArmorUpdateHudList.Click += (sender, row, col) => ArmorUpdateHudList_Click(sender, row, col);
                ArmorUpdateHudTabLayout.AddControl(ArmorAvailableList, new Rectangle(0, (ArmorHudHeight)/3 + 50, ArmorHudWidth, (3*(ArmorHudHeight/8))));

                //ArmorHudList.ControlHeight = Convert.ToInt32(.08*ArmorHudHeight);
                ArmorAvailableList.AddColumn(typeof(HudStaticText), Convert.ToInt32(.15 * ArmorHudWidth), null);
                ArmorAvailableList.AddColumn(typeof(HudStaticText), Convert.ToInt32(.15 * ArmorHudWidth), null);
                ArmorAvailableList.AddColumn(typeof(HudStaticText), Convert.ToInt32(.10 * ArmorHudWidth), null);
                ArmorAvailableList.AddColumn(typeof(HudStaticText), Convert.ToInt32(.10 * ArmorHudWidth), null);
                ArmorAvailableList.AddColumn(typeof(HudStaticText), Convert.ToInt32(.52 * ArmorHudWidth), null);

                ArmorAvailableList.Click += (sender, row, col) => ArmorAvailableList_Click(sender, row, col);

                lblArmorUpdateCovers = new HudStaticText();
                lblArmorUpdateCovers.FontHeight = nmenuFontHeight;
                lblArmorUpdateCovers.Text = "Cov:";
                ControlGroup CoverageChoices = new ControlGroup();
                cboArmorUpdateCovers = new HudCombo(CoverageChoices);
                cboArmorUpdateCovers.Change += (sender, index) => cboArmorUpdateCovers_Change(sender, index);

                int i = 0;
                foreach (IDNameLoadable info in CoverageInvList)
                {
                    cboArmorUpdateCovers.AddItem(info.name, i);
                    i++;
                }

                lblArmorUpdateSet = new HudStaticText();
                lblArmorUpdateSet.FontHeight = nmenuFontHeight;
                lblArmorUpdateSet.Text = "Set:";
                ControlGroup SetChoices = new ControlGroup();
                cboArmorUpdateSet = new HudCombo(SetChoices);
                cboArmorUpdateSet.Change += (sender, index) => cboArmorUpdateSet_Change(sender, index);

                i = 0;
                foreach (IDNameLoadable info in ArmorSetsInvList)
                {
                    cboArmorUpdateSet.AddItem(info.name, i);
                    i++;
                }
                lblArmorUpdateChoice = new HudStaticText();
                lblArmorUpdateChoice.FontHeight = nmenuFontHeight;
                lblArmorUpdateChoice.Text = "Search spells:";
                lblArmorUpdateClass = new HudStaticText();
                lblArmorUpdateClass.Text = "Armor,Jewelry, or Clothing";
                txtArmorUpdateChoice = new HudTextBox();
                txtArmorUpdateClass = new HudTextBox();

                 btnClearListArmorAvailable = new HudButton();
                btnClearListArmorAvailable.Text = "Clear List";
                btnClearListArmorAvailable.Hit += (sender, index) => btnClearListArmorAvailable_Hit(sender, index);

                btnListArmorAvailable = new HudButton();
                btnListArmorAvailable.Text = "List Inventory";
                btnListArmorAvailable.Hit += (sender, index) => btnListArmorAvailable_Hit(sender, index);

                ArmorUpdateHudTabLayout.AddControl(lblArmorUpdateClass, new Rectangle(0, (5 * (ArmorHudHeight / 6)), ArmorHudWidth/6, 18));
                ArmorUpdateHudTabLayout.AddControl(txtArmorUpdateClass, new Rectangle(ArmorHudWidth / 6, (5 * (ArmorHudHeight / 6)), 60, 18));
                ArmorUpdateHudTabLayout.AddControl(lblArmorUpdateChoice, new Rectangle(ArmorHudWidth/6 + 80, (5 * (ArmorHudHeight / 6)), 80, 18));
                ArmorUpdateHudTabLayout.AddControl(txtArmorUpdateChoice, new Rectangle(ArmorHudWidth/3, (5*(ArmorHudHeight/6)), (ArmorHudWidth / 2), 18));
               ArmorUpdateHudTabLayout.AddControl(lblArmorUpdateCovers, new Rectangle(0, (5 * (ArmorHudHeight / 6)+30),(30), 18));
                ArmorUpdateHudTabLayout.AddControl(cboArmorUpdateCovers, new Rectangle(40, (5 * (ArmorHudHeight / 6)+30), 200, 18));
                ArmorUpdateHudTabLayout.AddControl(lblArmorUpdateSet, new Rectangle(ArmorHudWidth / 2, (5 * (ArmorHudHeight / 6)+30), (ArmorHudWidth / 2) + 30, 18));
                ArmorUpdateHudTabLayout.AddControl(cboArmorUpdateSet, new Rectangle((ArmorHudWidth / 2) + 30, (5 * (ArmorHudHeight / 6)+30), (ArmorHudWidth / 2) + 100, 18));
                ArmorUpdateHudTabLayout.AddControl(btnListArmorAvailable, new Rectangle(ArmorHudWidth/3, (5 * (ArmorHudHeight / 6)+60), 100, 18));
                ArmorUpdateHudTabLayout.AddControl(btnClearListArmorAvailable, new Rectangle(ArmorHudWidth / 2, (5 * (ArmorHudHeight / 6)+60), 100, 18));

                ArmorUpdateTab = true;
                   if (toonArmorName == "" || toonArmorName == "None") { toonArmorName = toonName; }
                    lblToonArmorUpdateName.Text = toonArmorName;
                    toonArmorUpdateName = toonArmorName;
                FillArmorUpdateHudList();

            }

            catch (Exception ex) { LogError(ex); }
        }
        private void RenderInspectorPropertiesTab()
        {
            try
            {
                HudStaticText lblWeapCat = new HudStaticText();
                lblWeapCat.Text = "Wield Skill";
                ChiefGearInspectPageMenuTabProperties.AddControl(lblWeapCat, new Rectangle(5, 5, 80, 16));

                ControlGroup WeaponAppliesToChoices = new ControlGroup();
                cboWeaponAppliesTo = new HudCombo(WeaponAppliesToChoices);
                for(int i = 0; i < tDataTable.WeaponTypeList.Count; i++)
                {
                    cboWeaponAppliesTo.AddItem(tDataTable.WeaponTypeList[i].name, tDataTable.WeaponTypeList[i].ID);
                }
                ChiefGearInspectPageMenuTabProperties.AddControl(cboWeaponAppliesTo, new Rectangle(5, 20, 125, 20));

                lblMastCat = new HudStaticText();
                lblMastCat.Text = "Mastery";
                ChiefGearInspectPageMenuTabProperties.AddControl(lblMastCat, new Rectangle(5, 45, 80, 20));

                ControlGroup MastCatChoices = new ControlGroup();
                cboMasteryType = new HudCombo(MastCatChoices);
                for(int i = 0; i < tDataTable.MasteryIndex.Count; i++)
                {
                    cboMasteryType.AddItem(tDataTable.MasteryIndex[i].name, tDataTable.MasteryIndex[i].ID);
                }
                ChiefGearInspectPageMenuTabProperties.AddControl(cboMasteryType, new Rectangle(5, 65, 125, 20));

                lblDamageTypes = new HudStaticText();
                lblDamageTypes.Text = "Damage Type:";
                ChiefGearInspectPageMenuTabProperties.AddControl(lblDamageTypes, new Rectangle(5, 90, 125, 16));

              	lstDamageTypes = new HudList();
              	lstDamageTypes.ControlHeight = 16;
                lstDamageTypes.AddColumn(typeof(HudCheckBox), 16, null);
                lstDamageTypes.AddColumn(typeof(HudStaticText), 110, null);
                lstDamageTypes.AddColumn(typeof(HudStaticText), 1, null);
                ChiefGearInspectPageMenuTabProperties.AddControl(lstDamageTypes, new Rectangle(5, 110, 125, 90));

                lblEnabled10025 = new HudStaticText();
                lblEnabled10025.Text = "Enabled";
                ChiefGearInspectPageMenuTabProperties.AddControl(lblEnabled10025, new Rectangle(5, 205, 40, 16));

                lblRuleReqSkill = new HudStaticText();
                lblRuleReqSkill.Text = "Skill Level";
                ChiefGearInspectPageMenuTabProperties.AddControl(lblRuleReqSkill, new Rectangle(55, 205, 75, 16));

                chkRuleWeaponsa = new HudCheckBox();
                chkRuleWeaponsa.Text = "";
                ChiefGearInspectPageMenuTabProperties.AddControl(chkRuleWeaponsa, new Rectangle(15, 225, 40, 16));
                chkRuleWeaponsa.Checked = true;

                txtRuleReqSkilla = new HudTextBox();
                txtRuleReqSkilla.Text = "355";
                ChiefGearInspectPageMenuTabProperties.AddControl(txtRuleReqSkilla, new Rectangle(55, 225, 75, 16));

                chkRuleWeaponsb = new HudCheckBox();
                chkRuleWeaponsb.Text = "";
                ChiefGearInspectPageMenuTabProperties.AddControl(chkRuleWeaponsb, new Rectangle(15, 245, 40, 16));
                chkRuleWeaponsb.Checked = true;

                txtRuleReqSkillb = new HudTextBox();
                txtRuleReqSkillb.Text = "375";
                ChiefGearInspectPageMenuTabProperties.AddControl(txtRuleReqSkillb, new Rectangle(55, 245, 75, 16));

                chkRuleWeaponsc = new HudCheckBox();
                chkRuleWeaponsc.Text = "";
                ChiefGearInspectPageMenuTabProperties.AddControl(chkRuleWeaponsc, new Rectangle(15, 265, 40, 16));
                chkRuleWeaponsc.Checked = true;

                txtRuleReqSkillc = new HudTextBox();
                txtRuleReqSkillc.Text = "385";
                ChiefGearInspectPageMenuTabProperties.AddControl(txtRuleReqSkillc, new Rectangle(55, 265, 75, 16));

                chkRuleWeaponsd = new HudCheckBox();
                chkRuleWeaponsd.Text = "";
                ChiefGearInspectPageMenuTabProperties.AddControl(chkRuleWeaponsd, new Rectangle(15, 285, 40, 16));
                chkRuleWeaponsd.Checked = false;

                txtRuleReqSkilld = new HudTextBox();
                txtRuleReqSkilld.Text = "";
                ChiefGearInspectPageMenuTabProperties.AddControl(txtRuleReqSkilld, new Rectangle(55, 285, 75, 16));

                lblSets = new HudStaticText();
                lblSets.Text = "Sets";
                ChiefGearInspectPageMenuTabProperties.AddControl(lblSets, new Rectangle(150, 5, 110, 16));

                lstRuleSets = new HudList();
                lstRuleSets.ControlHeight = 16;
                lstRuleSets.AddColumn(typeof(HudCheckBox), 16, null);
                lstRuleSets.AddColumn(typeof(HudStaticText), 195, null);
                lstRuleSets.AddColumn(typeof(HudStaticText), 1, null);
                ChiefGearInspectPageMenuTabProperties.AddControl(lstRuleSets, new Rectangle(150, 25, 200, 255));

                cboWeaponAppliesTo.Change += cboWeaponAppliesTo_Change;
                cboMasteryType.Change += cboMasteryType_Change;
                lstDamageTypes.Click += lstDamageTypes_Click;
                chkRuleWeaponsa.Change += chkRuleWeaponsa_Change;
                chkRuleWeaponsb.Change += chkRuleWeaponsb_Change;
                chkRuleWeaponsc.Change += chkRuleWeaponsc_Change;
                chkRuleWeaponsd.Change += chkRuleWeaponsd_Change;
                txtRuleReqSkilla.LostFocus += txtRuleReqSkilla_LostFocus;
                txtRuleReqSkillb.LostFocus += txtRuleReqSkillb_LostFocus;
                txtRuleReqSkillc.LostFocus += txtRuleReqSkillc_LostFocus;
                txtRuleReqSkilld.LostFocus += txtRuleReqSkilld_LostFocus;
                lstRuleSets.Click += lstRuleSets_Click;
            }catch(Exception ex){LogError(ex);}
        }
Beispiel #55
0
        private void AddToGroup(ControlGroup taskGroup, TaskView taskView)
        {
            if (taskGroup.Count == 0)
            {
                taskGroup.Add(taskView); // add if list is empty
            }
            else
            {
                for (int i = taskGroup.Count - 1; i >= 0; i--)
                {
                    TaskView tv = (TaskView)taskGroup[i];
                    if (tv.DueDate > taskView.DueDate)
                    {
                        continue;
                    }
                    else
                    {
                        taskGroup.Insert(i + 1, taskView); // add in the middle or end
                        return;
                    }
                }

                taskGroup.Insert(0, taskView); // add at the top after all controls are moved down using loop
            }
        }
Beispiel #56
0
        private void RenderChiefGearSoundsTab()
        {
            try
            {
                chkMuteSounds = new HudCheckBox();
                chkMuteSounds.Text = "Mute Sound Effects";
                ChiefGearHudSounds.AddControl(chkMuteSounds, new Rectangle(8, 5, 115, 20));

                lblLandscapeHud = new HudStaticText();
                lblLandscapeHud.Text = "Gear Sense Sounds:";
                ChiefGearHudSounds.AddControl(lblLandscapeHud, new Rectangle(8, 30, 200, 16));

                ControlGroup cboTrophyLandscapeChoices = new ControlGroup();
                cboTrophyLandscape = new HudCombo(cboTrophyLandscapeChoices);
                ChiefGearHudSounds.AddControl(cboTrophyLandscape, new Rectangle(5, 55, 125, 20));
                lblSound1 = new HudStaticText();
                lblSound1.Text = "Trophies";
                ChiefGearHudSounds.AddControl(lblSound1, new Rectangle(135, 55, 250, 16));
                ControlGroup cboMobLandscapeChoices = new ControlGroup();

                cboMobLandscape = new HudCombo(cboMobLandscapeChoices);
                ChiefGearHudSounds.AddControl(cboMobLandscape, new Rectangle(5, 80, 125, 20));
                lblSound2 = new HudStaticText();
                lblSound2.Text = "Mobs";
                ChiefGearHudSounds.AddControl(lblSound2, new Rectangle(135, 80, 250, 16));

                ControlGroup cboPlayerLandscapeChoices = new ControlGroup();
                cboPlayerLandscape = new HudCombo(cboPlayerLandscapeChoices);
                ChiefGearHudSounds.AddControl(cboPlayerLandscape, new Rectangle(5, 105, 125, 20));
                lblSound3 = new HudStaticText();
                lblSound3.Text = "Players";
                ChiefGearHudSounds.AddControl(lblSound3, new Rectangle(135, 105, 250, 16));

                lblCorpseHud = new HudStaticText();
                lblCorpseHud.Text = "GearVisection Sounds:";
                ChiefGearHudSounds.AddControl(lblCorpseHud, new Rectangle(8, 140, 200, 16));

                ControlGroup cboCorpseRareChoices = new ControlGroup();
                cboCorpseRare = new HudCombo(cboCorpseRareChoices);
                ChiefGearHudSounds.AddControl(cboCorpseRare, new Rectangle(5, 165, 125, 20));
                lblSound4 = new HudStaticText();
                lblSound4.Text = "Corpse with Rare";
                ChiefGearHudSounds.AddControl(lblSound4, new Rectangle(135, 165, 250, 16));

                ControlGroup cboCorpseSelfKillChoices = new ControlGroup();
                cboCorpseSelfKill = new HudCombo(cboCorpseSelfKillChoices);
                ChiefGearHudSounds.AddControl(cboCorpseSelfKill, new Rectangle(5, 190, 125, 20));

                lblSound5 = new HudStaticText();
                lblSound5.Text = "Lootable Corpse";
                ChiefGearHudSounds.AddControl(lblSound5, new Rectangle(130, 190, 250, 16));

                ControlGroup cboCorpseFellowKillChoices = new ControlGroup();
                cboCorpseFellowKill = new HudCombo(cboCorpseFellowKillChoices);
                ChiefGearHudSounds.AddControl(cboCorpseFellowKill, new Rectangle(5, 215, 125, 20));

                lblSound6 = new HudStaticText();
                lblSound6.Text = "Lootable Corpse by Fellow";
                ChiefGearHudSounds.AddControl(lblSound6, new Rectangle(130, 215, 250, 16));

                ControlGroup cboDeadMeChoices = new ControlGroup();
                cboDeadMe = new    HudCombo(cboDeadMeChoices);
                ChiefGearHudSounds.AddControl(cboDeadMe, new Rectangle(5, 240, 125, 20));

                lblSound7 = new HudStaticText();
                lblSound7.Text = "Dead Me";
                ChiefGearHudSounds.AddControl(lblSound7, new Rectangle(130, 240, 250, 16));

                ControlGroup cboDeadPermittedChoices = new ControlGroup();
                cboDeadPermitted = new HudCombo(cboDeadPermittedChoices);
                ChiefGearHudSounds.AddControl(cboDeadPermitted, new Rectangle(5, 265, 125, 20));

                lblSound8 = new HudStaticText();
                lblSound8.Text = "Recovery Corpse";
                ChiefGearHudSounds.AddControl(lblSound8, new Rectangle(130, 265, 250, 16));

                lblInspectorHud = new HudStaticText();
                lblInspectorHud.Text = "GearInspector Sounds:";
                ChiefGearHudSounds.AddControl(lblInspectorHud, new Rectangle(8, 295, 200, 16));

                ControlGroup cboTrophyCorpseChoices = new ControlGroup();
                cboTrophyCorpse = new HudCombo(cboTrophyCorpseChoices);
                ChiefGearHudSounds.AddControl(cboTrophyCorpse, new Rectangle(5, 320, 125, 20));

                lblSound9 = new HudStaticText();
                lblSound9.Text = "Trophies";
                ChiefGearHudSounds.AddControl(lblSound9, new Rectangle(130, 320, 250, 16));

                ControlGroup cboRuleCorpseChoices = new ControlGroup();
                cboRuleCorpse = new    HudCombo(cboRuleCorpseChoices);
                ChiefGearHudSounds.AddControl(cboRuleCorpse, new Rectangle(5, 345, 125, 20));

                lblSound10 = new HudStaticText();
                lblSound10.Text = "Rule";
                ChiefGearHudSounds.AddControl(lblSound10, new Rectangle(130, 345, 250, 16));

                ControlGroup cboSalvageCorpseChoices = new ControlGroup();
                cboSalvageCorpse = new    HudCombo(cboSalvageCorpseChoices);
                ChiefGearHudSounds.AddControl(cboSalvageCorpse, new Rectangle(5, 370, 125, 20));

                lblSound11 = new HudStaticText();
                lblSound11.Text = "Salvage";
                ChiefGearHudSounds.AddControl(lblSound11, new Rectangle(130, 370, 250, 16));

                for(int i = 0; i < SoundList.Count; i++)
                {
                    cboMobLandscape.AddItem(SoundList[i].name, i);
                    cboPlayerLandscape.AddItem(SoundList[i].name, i);
                    cboCorpseRare.AddItem(SoundList[i].name, i);
                    cboCorpseSelfKill.AddItem(SoundList[i].name, i);
                    cboCorpseFellowKill.AddItem(SoundList[i].name, i);
                    cboDeadMe.AddItem(SoundList[i].name, i);
                    cboDeadPermitted.AddItem(SoundList[i].name, i);
                    cboTrophyCorpse.AddItem(SoundList[i].name, i);
                    cboRuleCorpse.AddItem(SoundList[i].name, i);
                    cboSalvageCorpse.AddItem(SoundList[i].name, i);
                    cboTrophyLandscape.AddItem(SoundList[i].name, i);
                }

                chkMuteSounds.Change += chkMuteSounds_Change;
                cboTrophyLandscape.Change += cboTrophyLandscape_Change;
                cboMobLandscape.Change += cboMobLandscape_Change;
                cboPlayerLandscape.Change += cboPlayerLandscape_Change;
                cboCorpseRare.Change += cboCorpseRare_Change;
                cboCorpseSelfKill.Change += cboCorpseSelfKill_Change;
                cboCorpseFellowKill.Change += cboCorpseFellowKill_Change;
                cboDeadMe.Change += cboDeadMe_Change;
                cboDeadPermitted.Change += cboDeadPermitted_Change;
                cboTrophyCorpse.Change += cboTrophyCorpse_Change;
                cboRuleCorpse.Change += cboRuleCorpse_Change;
                cboSalvageCorpse.Change += cboSalvageCorpse_Change;

                UpdateSoundPanel();

            }catch(Exception ex){LogError(ex);}
        }
Beispiel #57
0
        private void RenderInventoryTabLayout()
        {
            try
            {
                lblInventoryClass = new HudStaticText();
                lblInventoryClass.FontHeight = nmenuFontHeight;
                lblInventoryClass.Text = "Class";
                ControlGroup InventoryClasses = new ControlGroup();
                cboInventoryClasses = new HudCombo(InventoryClasses);
                cboInventoryClasses.Change += (sender, index) => cboInventoryClasses_Change(sender, index);
                int i=0;
                foreach (IDNameLoadable info in ClassInvList)
                {
                    cboInventoryClasses.AddItem(info.name,i);
                    i++;
                }
                lblMyChoice = new HudStaticText();
                lblMyChoice.FontHeight = nmenuFontHeight;
                lblMyChoice.Text = "Search:";

                txtMyChoice = new HudTextBox();

                lblWeapons = new HudStaticText();
                lblWeapons.FontHeight = 11;
                lblWeapons.Text = "Weapons";
                lblWeapons.TextAlignment = VirindiViewService.WriteTextFormats.Center;
                lblArmor = new HudStaticText();
                lblArmor.FontHeight = 11;
                lblArmor.Text = "Armor/Clothing/Aetheria";
                lblArmor.TextAlignment = VirindiViewService.WriteTextFormats.Center;
                lblSalvage = new HudStaticText();
                lblSalvage.FontHeight = 11;
                lblSalvage.Text = "Salvage";
                lblSalvage.TextAlignment = VirindiViewService.WriteTextFormats.Center;
                lblMelee = new HudStaticText();
                lblMelee.FontHeight = nmenuFontHeight;
                lblMelee.Text = "Mel:";
                ControlGroup WieldAttribTypes = new ControlGroup();
                cboWieldAttrib = new HudCombo(WieldAttribTypes);
               cboWieldAttrib.Change += (sender, index) => cboWieldAttrib_Change(sender, index);

                i = 0;
                foreach (IDNameLoadable info in MeleeTypeInvList)
                {
                    cboWieldAttrib.AddItem(info.name, i);
                    i++;
                }

                lblSet = new HudStaticText();
                lblSet.FontHeight = nmenuFontHeight;
                lblSet.Text = "Set:";
                ControlGroup SetChoices = new ControlGroup();
                cboArmorSet = new HudCombo(SetChoices);
                cboArmorSet.Change += (sender, index) => cboArmorSet_Change(sender, index);

                i = 0;
                foreach (IDNameLoadable info in ArmorSetsInvList)
                {
                    cboArmorSet.AddItem(info.name, i);
                    i++;
                }

                lblMaterial = new HudStaticText();
                lblMaterial.FontHeight = nmenuFontHeight;
                lblMaterial.Text = "Mat:";
                ControlGroup MaterialChoices = new ControlGroup();
                cboMaterial = new HudCombo(MaterialChoices);
                cboMaterial.Change += (sender, index) => cboMaterial_Change(sender, index);

                i = 0;
                foreach (IDNameLoadable info in MaterialInvList)
                {
                    cboMaterial.AddItem(info.name, i);
                    i++;
                }

                lblDamage = new HudStaticText();
                lblDamage.FontHeight = nmenuFontHeight;
                lblDamage.Text = "Dam:";
                ControlGroup DamageTypes = new ControlGroup();
                cboDamageType = new HudCombo(DamageTypes);
                cboDamageType.Change += (sender, index) => cboDamageType_Change(sender, index);

                i = 0;
                foreach (IDNameLoadable info in ElementalInvList)
                {
                    cboDamageType.AddItem(info.name, i);
                    i++;
                }

                lblArmorWield = new HudStaticText();
                lblArmorWield.FontHeight = nmenuFontHeight;
                lblArmorWield.Text = "Lev:";
                ControlGroup ArmorLevels = new ControlGroup();
                cboArmorLevel = new HudCombo(ArmorLevels);
                cboArmorLevel.Change += (sender, index) => cboArmorLevel_Change(sender, index);

                i = 0;
                foreach (IDNameLoadable info in ArmorLevelInvList)
                {
                    cboArmorLevel.AddItem(info.name, i);
                    i++;
                }

                lblWork = new HudStaticText();
                lblWork.FontHeight = nmenuFontHeight;
                lblWork.Text = "Work:";
                ControlGroup WorkChoices = new ControlGroup();
                cboSalvWork = new HudCombo(WorkChoices);
                cboSalvWork.Change += (sender, index) => cboSalvWork_Change(sender, index);

                i = 0;
                foreach (IDNameLoadable info in SalvageWorkInvList)
                {
                    cboSalvWork.AddItem(info.name, i);
                    i++;
                }

                lblWield = new HudStaticText();
                lblWield.FontHeight = nmenuFontHeight;
                lblWield.Text = "Lev:";
                ControlGroup WieldLevels = new ControlGroup();
                cboLevel = new HudCombo(WieldLevels);
                cboLevel.Change += (sender, index) => cboLevel_Change(sender, index);

                i = 0;
                foreach (IDNameLoadable info in WeaponWieldInvList)
                {
                    cboLevel.AddItem(info.name, i);
                    i++;
                }

                lblCovers = new HudStaticText();
                lblCovers.FontHeight = nmenuFontHeight;
                lblCovers.Text = "Cov:";
                ControlGroup CoverageChoices = new ControlGroup();
                cboCoverage = new HudCombo(CoverageChoices);
                cboCoverage.Change += (sender, index) => cboCoverage_Change(sender, index);

                i = 0;
                foreach (IDNameLoadable info in CoverageInvList)
                {
                    cboCoverage.AddItem(info.name, i);
                    i++;
                }

                lblEmbues = new HudStaticText();
                lblEmbues.FontHeight = nmenuFontHeight;
                lblEmbues.Text = "Emb:";
                ControlGroup EmbueChoices = new ControlGroup();
                cboEmbues = new HudCombo(EmbueChoices);

                cboEmbues.Change += (sender, index) => cboEmbues_Change(sender, index);

                i = 0;
                foreach (IDNameLoadable info in EmbueInvList)
                {
                    cboEmbues.AddItem(info.name, i);
                    i++;
                }

                btnClrInv = new HudButton();
                btnClrInv.Text = "Clear List";
                btnClrInv.Hit += (sender, index) => btnClrInv_Hit(sender, index);

                btnLstInv = new HudButton();
                btnLstInv.Text = "List Inventory";
                btnLstInv.Hit += (sender, index) => btnLstInv_Hit(sender, index);
                try
                {
                    lstHudInventory = new HudList();
                    lstHudInventory.AddColumn(typeof(HudPictureBox), 20, null);
                    lstHudInventory.AddColumn(typeof(HudStaticText), Convert.ToInt32(.5 * nInventoryHudWidth), null);
                    lstHudInventory.AddColumn(typeof(HudStaticText), Convert.ToInt32(.44 * nInventoryHudWidth), null);
                    lstHudInventory.AddColumn(typeof(HudStaticText), Convert.ToInt32(.001 * nInventoryHudWidth), null);

                    lstHudInventory.Click += (sender, row, col) => lstHudInventory_Click(sender, row, col);
                }

                catch (Exception ex) { LogError(ex); }

                InventoryHudTabLayout.AddControl(lblInventoryClass, new Rectangle(10, 10, 30, 16));
                InventoryHudTabLayout.AddControl(cboInventoryClasses, new Rectangle(45, 10, 100, 16));
                InventoryHudTabLayout.AddControl(lblMyChoice, new Rectangle(155, 10, 100, 16));
                InventoryHudTabLayout.AddControl(txtMyChoice, new Rectangle(260, 10, 280, 16));
                InventoryHudTabLayout.AddControl(lblWeapons, new Rectangle(10,30,nInventoryHudWidth/3,20));
                InventoryHudTabLayout.AddControl(lblArmor, new Rectangle(nInventoryHudWidth/3, 30, nInventoryHudWidth / 3, 20));
                InventoryHudTabLayout.AddControl(lblSalvage, new Rectangle((2 * nInventoryHudWidth) / 3, 30, nInventoryHudWidth / 3, 20));

                InventoryHudTabLayout.AddControl(lblMelee, new Rectangle(10, 50, 25, 16));
                InventoryHudTabLayout.AddControl(cboWieldAttrib, new Rectangle(40, 50, 100, 16));
                InventoryHudTabLayout.AddControl(lblSet, new Rectangle(nInventoryHudWidth/3, 50, 25, 16));
                InventoryHudTabLayout.AddControl(cboArmorSet, new Rectangle(nInventoryHudWidth/ 3 + 30, 50, 150, 16));
                InventoryHudTabLayout.AddControl(lblMaterial, new Rectangle((2 * nInventoryHudWidth) / 3, 50, 25, 16));
                InventoryHudTabLayout.AddControl(cboMaterial, new Rectangle((2 * nInventoryHudWidth) / 3 + 30, 50, 150, 16));
                InventoryHudTabLayout.AddControl(lblDamage, new Rectangle(10, 70, 25, 16));
                InventoryHudTabLayout.AddControl(cboDamageType, new Rectangle(40, 70, 100, 16));
                InventoryHudTabLayout.AddControl(lblArmorWield, new Rectangle(nInventoryHudWidth / 3, 70, 25, 16));
                InventoryHudTabLayout.AddControl(cboArmorLevel, new Rectangle(nInventoryHudWidth / 3 + 30, 70, 100, 16));
                InventoryHudTabLayout.AddControl(lblWork, new Rectangle((2 * nInventoryHudWidth) / 3, 70, 25, 16));
                InventoryHudTabLayout.AddControl(cboSalvWork, new Rectangle((2 * nInventoryHudWidth) / 3 + 30, 70, 100, 16));
                InventoryHudTabLayout.AddControl(lblWield, new Rectangle(10, 90, 25, 16));
                InventoryHudTabLayout.AddControl(cboLevel, new Rectangle(40,90, 100, 16));
                InventoryHudTabLayout.AddControl(lblCovers, new Rectangle(nInventoryHudWidth / 3, 90, 25, 16));
                InventoryHudTabLayout.AddControl(cboCoverage, new Rectangle(nInventoryHudWidth / 3 + 30, 90, 100, 16));
                InventoryHudTabLayout.AddControl(lblEmbues, new Rectangle(10, 110, 25, 16));
                InventoryHudTabLayout.AddControl(cboEmbues, new Rectangle(40, 110, 100, 16));

                InventoryHudTabLayout.AddControl(btnLstInv, new Rectangle((2* nInventoryHudWidth)/3,100,100,16));
                InventoryHudTabLayout.AddControl(btnClrInv, new Rectangle((2 * nInventoryHudWidth) / 3, 120, 100, 16));
                InventoryHudTabLayout.AddControl(lstHudInventory, new Rectangle(10, 150, nInventoryHudWidth, nInventoryHudHeight - 155));

                bInventoryMainTab = true;

            }

            catch (Exception ex) { LogError(ex); }
        }
Beispiel #58
0
        private void RenderChiefGearInspectPageMenuTabAdvanced()
        {
            try
            {
                int i = 0;

                chkAdvEnabled = new HudCheckBox();
                chkAdvEnabled.Text = "Enabled";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(chkAdvEnabled, new Rectangle(5, 5, 50, 16));
                chkAdvEnabled.Checked = false;

                HudStaticText lblAdvKey = new HudStaticText();
                //   lblChiefGearSwitch.FontHeight = nmenuFontHeight;
                lblAdvKey.Text = "Key Type";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(lblAdvKey, new Rectangle(5, 25, 100, 16));

                HudStaticText lblAdvKeyName = new HudStaticText();
                //   lblChiefGearSwitch.FontHeight = nmenuFontHeight;
                lblAdvKeyName.Text = "Key Name";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(lblAdvKeyName, new Rectangle(75, 25, 100, 16));

                HudStaticText lblAdvKeyComparison = new HudStaticText();
                //   lblChiefGearSwitch.FontHeight = nmenuFontHeight;
                lblAdvKeyComparison.Text = "Comparison";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(lblAdvKeyComparison, new Rectangle(275, 25, 100, 16));

                HudStaticText lblAdvKeyValue = new HudStaticText();
                //   lblChiefGearSwitch.FontHeight = nmenuFontHeight;
                lblAdvKeyValue.Text = "Key Value";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(lblAdvKeyValue, new Rectangle(380, 25, 100, 16));

                ControlGroup cboAdv1KeyTypeChoices = new ControlGroup();
                cboAdv1KeyType = new HudCombo(cboAdv1KeyTypeChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv1KeyType.AddItem(info.name, i);
                    i++;
                }
                cboAdv1KeyType.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv1KeyType, new Rectangle(5, 45, 60, 20));

                ControlGroup cboAdv1KeyChoices = new ControlGroup();
                cboAdv1Key = new HudCombo(cboAdv1KeyChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv1Key.AddItem(info.name, i);
                    i++;
                }
                cboAdv1Key.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv1Key, new Rectangle(75, 45, 175, 20));

                ControlGroup cboAdv1KeyCompareChoices = new ControlGroup();
                cboAdv1KeyCompare = new HudCombo(cboAdv1KeyCompareChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv1KeyCompare.AddItem(info.name, i);
                    i++;
                }
                cboAdv1Key.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv1KeyCompare, new Rectangle(275, 45, 75, 20));

                txtAdv1KeyValue = new HudTextBox();
                txtAdv1KeyValue.Text = "";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(txtAdv1KeyValue, new Rectangle(380, 45, 75, 16));

                ControlGroup cboAdv1LinkChoices = new ControlGroup();
                cboAdv1Link = new HudCombo(cboAdv1LinkChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv1Link.AddItem(info.name, i);
                    i++;
                }
                cboAdv1Link.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv1Link, new Rectangle(5, 65, 60, 20));

                //Second group of new advanced rule controls
                ControlGroup cboAdv2KeyTypeChoices = new ControlGroup();
                cboAdv2KeyType = new HudCombo(cboAdv2KeyTypeChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv2KeyType.AddItem(info.name, i);
                    i++;
                }
                cboAdv2KeyType.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv2KeyType, new Rectangle(5, 85, 60, 20));

                ControlGroup cboAdv2KeyChoices = new ControlGroup();
                cboAdv2Key = new HudCombo(cboAdv2KeyChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv2Key.AddItem(info.name, i);
                    i++;
                }
                cboAdv2Key.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv2Key, new Rectangle(75, 85, 175, 20));

                ControlGroup cboAdv2KeyCompareChoices = new ControlGroup();
                cboAdv2KeyCompare = new HudCombo(cboAdv2KeyCompareChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv2KeyCompare.AddItem(info.name, i);
                    i++;
                }
                cboAdv2Key.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv2KeyCompare, new Rectangle(275, 85, 75, 20));

                txtAdv2KeyValue = new HudTextBox();
                txtAdv2KeyValue.Text = "";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(txtAdv2KeyValue, new Rectangle(380, 85, 75, 16));

                ControlGroup cboAdv2LinkChoices = new ControlGroup();
                cboAdv2Link = new HudCombo(cboAdv2LinkChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv1Link.AddItem(info.name, i);
                    i++;
                }
                cboAdv2Link.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv2Link, new Rectangle(5, 105, 60, 20));

                //Third group of new advanced rule controls
                ControlGroup cboAdv3KeyTypeChoices = new ControlGroup();
                cboAdv3KeyType = new HudCombo(cboAdv3KeyTypeChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv3KeyType.AddItem(info.name, i);
                    i++;
                }
                cboAdv3KeyType.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv3KeyType, new Rectangle(5, 125, 60, 20));

                ControlGroup cboAdv3KeyChoices = new ControlGroup();
                cboAdv3Key = new HudCombo(cboAdv3KeyChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv3Key.AddItem(info.name, i);
                    i++;
                }
                cboAdv3Key.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv3Key, new Rectangle(75, 125, 175, 20));

                ControlGroup cboAdv3KeyCompareChoices = new ControlGroup();
                cboAdv3KeyCompare = new HudCombo(cboAdv3KeyCompareChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv3KeyCompare.AddItem(info.name, i);
                    i++;
                }
                cboAdv3Key.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv3KeyCompare, new Rectangle(275, 125, 75, 20));

                txtAdv3KeyValue = new HudTextBox();
                txtAdv3KeyValue.Text = "";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(txtAdv3KeyValue, new Rectangle(380, 125, 75, 16));

                ControlGroup cboAdv3LinkChoices = new ControlGroup();
                cboAdv3Link = new HudCombo(cboAdv3LinkChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv1Link.AddItem(info.name, i);
                    i++;
                }
                cboAdv3Link.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv3Link, new Rectangle(5, 145, 60, 20));

                //Fourth group of new advanced rule controls
                ControlGroup cboAdv4KeyTypeChoices = new ControlGroup();
                cboAdv4KeyType = new HudCombo(cboAdv4KeyTypeChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv4KeyType.AddItem(info.name, i);
                    i++;
                }
                cboAdv4KeyType.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv4KeyType, new Rectangle(5, 165, 60, 20));

                ControlGroup cboAdv4KeyChoices = new ControlGroup();
                cboAdv4Key = new HudCombo(cboAdv4KeyChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv4Key.AddItem(info.name, i);
                    i++;
                }
                cboAdv4Key.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv4Key, new Rectangle(75, 165, 175, 20));

                ControlGroup cboAdv4KeyCompareChoices = new ControlGroup();
                cboAdv4KeyCompare = new HudCombo(cboAdv4KeyCompareChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv4KeyCompare.AddItem(info.name, i);
                    i++;
                }
                cboAdv4Key.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv4KeyCompare, new Rectangle(275, 165, 75, 20));

                txtAdv4KeyValue = new HudTextBox();
                txtAdv4KeyValue.Text = "";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(txtAdv4KeyValue, new Rectangle(380, 165, 75, 16));

                ControlGroup cboAdv4LinkChoices = new ControlGroup();
                cboAdv4Link = new HudCombo(cboAdv4LinkChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv1Link.AddItem(info.name, i);
                    i++;
                }
                cboAdv4Link.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv4Link, new Rectangle(5, 185, 60, 20));

                //Fifth group of new advanced rule controls
                ControlGroup cboAdv5KeyTypeChoices = new ControlGroup();
                cboAdv5KeyType = new HudCombo(cboAdv5KeyTypeChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv5KeyType.AddItem(info.name, i);
                    i++;
                }
                cboAdv5KeyType.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv5KeyType, new Rectangle(5, 205, 60, 20));

                ControlGroup cboAdv5KeyChoices = new ControlGroup();
                cboAdv5Key = new HudCombo(cboAdv5KeyChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv5Key.AddItem(info.name, i);
                    i++;
                }
                cboAdv5Key.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv5Key, new Rectangle(75, 205, 175, 20));

                ControlGroup cboAdv5KeyCompareChoices = new ControlGroup();
                cboAdv5KeyCompare = new HudCombo(cboAdv5KeyCompareChoices);
                i = 0;
                cboList = new List<IDNameLoadable>();
                foreach (IDNameLoadable info in cboList)
                {
                    cboAdv5KeyCompare.AddItem(info.name, i);
                    i++;
                }
                cboAdv5Key.Current = 0;
                ChiefGearInspectPageMenuTabAdvanced.AddControl(cboAdv5KeyCompare, new Rectangle(275, 205, 75, 20));

                txtAdv5KeyValue = new HudTextBox();
                txtAdv5KeyValue.Text = "";
                ChiefGearInspectPageMenuTabAdvanced.AddControl(txtAdv5KeyValue, new Rectangle(380, 165, 75, 16));

             }
            catch (Exception ex) { LogError(ex); }
        }
Beispiel #59
0
        private void RenderChiefGearInspectPageMenuTabProperties()
        {
            try
            {
                if (ChiefGearInspectPageMenuTabProperties != null) { DisposeChiefGearInspectPageMenuTabProperties(); }
                int i = 0;

                //Controls for Wield Skill
                HudStaticText lblWeapCat = new HudStaticText();
                //   lblChiefGearSwitch.FontHeight = nmenuFontHeight;
                lblWeapCat.Text = "Wield Skill";
                ChiefGearInspectPageMenuTabProperties.AddControl(lblWeapCat, new Rectangle(5, 5, 80, 16));

                ControlGroup WeaponAppliesToChoices = new ControlGroup();
                cboWeaponAppliesTo = new HudCombo(WeaponAppliesToChoices);
                i = 0;
                foreach (IDNameLoadable info in WeaponTypeList)
                {
                    cboWeaponAppliesTo.AddItem(info.name, i);
                    i++;
                }
                cboWeaponAppliesTo.Current = 0;
                ChiefGearInspectPageMenuTabProperties.AddControl(cboWeaponAppliesTo, new Rectangle(5, 20, 125, 20));

                //Controls for mastery
                HudStaticText lblMastCat = new HudStaticText();
                //   lblChiefGearSwitch.FontHeight = nmenuFontHeight;
                lblMastCat.Text = "Mastery";
                ChiefGearInspectPageMenuTabProperties.AddControl(lblMastCat, new Rectangle(5, 45, 80, 20));

                ControlGroup MastCatChoices = new ControlGroup();
                cboMasteryType = new HudCombo(MastCatChoices);
                i = 0;
                foreach (IDNameLoadable info in MasteryIndex)
                {
                    cboMasteryType.AddItem(info.name, i);
                    i++;
                }
                cboMasteryType.Current = 0;
                ChiefGearInspectPageMenuTabProperties.AddControl(cboMasteryType, new Rectangle(5, 65, 125, 20));

                //Controls for Damage Type
                HudStaticText lblDamageTypes = new HudStaticText();
                //   lblChiefGearSwitch.FontHeight = nmenuFontHeight;
                lblDamageTypes.Text = "Damage Type:}";
                ChiefGearInspectPageMenuTabProperties.AddControl(lblDamageTypes, new Rectangle(5, 90, 125, 16));

                lstDamageTypes = new HudList();
                lstDamageTypesListRow = new HudList.HudListRowAccessor();

                ChiefGearInspectPageMenuTabProperties.AddControl(lstDamageTypes, new Rectangle(5, 110, 125, 90));
                lstDamageTypes.AddColumn(typeof(HudCheckBox), 5, null);
                lstDamageTypes.AddColumn(typeof(HudStaticText), 110, null);
                lstDamageTypes.AddColumn(typeof(HudStaticText), 1, null);

                HudStaticText lblEnabled10025 = new HudStaticText();
                //   lblChiefGearSwitch.FontHeight = nmenuFontHeight;
                lblEnabled10025.Text = "Enabled";
                ChiefGearInspectPageMenuTabProperties.AddControl(lblEnabled10025, new Rectangle(5, 205, 40, 16));

                HudStaticText lblRuleReqSkilla = new HudStaticText();
                //   lblChiefGearSwitch.FontHeight = nmenuFontHeight;
                lblRuleReqSkilla.Text = "SkillLevel";
                ChiefGearInspectPageMenuTabProperties.AddControl(lblRuleReqSkilla, new Rectangle(55, 205, 75, 16));

                chkRuleWeaponsa = new HudCheckBox();
                chkRuleWeaponsa.Text = "";
                ChiefGearInspectPageMenuTabProperties.AddControl(chkRuleWeaponsa, new Rectangle(15, 225, 40, 16));
                chkRuleWeaponsa.Checked = true;

                txtRuleReqSkilla = new HudTextBox();
                txtRuleReqSkilla.Text = "355";
                ChiefGearInspectPageMenuTabProperties.AddControl(txtRuleReqSkilla, new Rectangle(55, 225, 75, 16));

                chkRuleWeaponsb = new HudCheckBox();
                chkRuleWeaponsb.Text = "";
                ChiefGearInspectPageMenuTabProperties.AddControl(chkRuleWeaponsb, new Rectangle(15, 245, 40, 16));
                chkRuleWeaponsb.Checked = true;

                txtRuleReqSkillb = new HudTextBox();
                txtRuleReqSkillb.Text = "375";
                ChiefGearInspectPageMenuTabProperties.AddControl(txtRuleReqSkillb, new Rectangle(55, 245, 75, 16));

                chkRuleWeaponsc = new HudCheckBox();
                chkRuleWeaponsc.Text = "";
                ChiefGearInspectPageMenuTabProperties.AddControl(chkRuleWeaponsc, new Rectangle(15, 265, 40, 16));
                chkRuleWeaponsc.Checked = true;

                txtRuleReqSkillc = new HudTextBox();
                txtRuleReqSkillc.Text = "385";
                ChiefGearInspectPageMenuTabProperties.AddControl(txtRuleReqSkillc, new Rectangle(55, 265, 75, 16));

                chkRuleWeaponsd = new HudCheckBox();
                chkRuleWeaponsd.Text = "";
                ChiefGearInspectPageMenuTabProperties.AddControl(chkRuleWeaponsd, new Rectangle(15, 285, 40, 16));
                chkRuleWeaponsd.Checked = false;

                txtRuleReqSkilld = new HudTextBox();
                txtRuleReqSkilld.Text = "";
                ChiefGearInspectPageMenuTabProperties.AddControl(txtRuleReqSkilld, new Rectangle(55, 285, 75, 16));

                //Sets
                HudStaticText lblSets = new HudStaticText();
                //   lblChiefGearSwitch.FontHeight = nmenuFontHeight;
                lblSets.Text = "Sets";
                ChiefGearInspectPageMenuTabProperties.AddControl(lblSets, new Rectangle(150, 5, 110, 16));

                lstRuleSets = new HudList();
                lstRuleSetsListRow = new HudList.HudListRowAccessor();

                ChiefGearInspectPageMenuTabProperties.AddControl(lstRuleSets, new Rectangle(150, 25, 200, 255));
                lstRuleSets.AddColumn(typeof(HudCheckBox), 5, null);
                lstRuleSets.AddColumn(typeof(HudStaticText), 195, null);
                lstRuleSets.AddColumn(typeof(HudStaticText), 1, null);

                SubscribeChiefGearInspectPageMenuTabViewPageSearchRulePropertiesEvents();
            }
            catch (Exception ex) { LogError(ex); }
        }
        public static int AutoFitLabels(params Label[] labels)
        {
            ControlGroup cg = new ControlGroup(labels);
            int startWidth = cg.Width;

            foreach (Label label in labels)
                DisplayHelper.AutoFitSystemLabel(label, 0, int.MaxValue);

            return cg.Width - startWidth;
        }