Example #1
0
        private void UpdateValetHud()
        {
            try
            {
                if(ButlerHudView == null){return;}

                ValetNameBox.Text = String.Empty;

                int scroll = 0;
                HudList.HudListRowAccessor ValetRow;

                scroll = ValetSlotsList.ScrollPosition;
                ValetSlotsList.ClearRows();
                foreach(IDName slot in tDataTable.SwapSlotList)
                {
                    ValetRow = ValetSlotsList.AddRow();
                    if(mCharacterSettings.ValetSlotsList.Contains(slot.ID)){((HudCheckBox)ValetRow[0]).Checked = true;}
                    else{((HudCheckBox)ValetRow[0]).Checked = false;}
                    ((HudStaticText)ValetRow[1]).Text = slot.name;
                    ((HudStaticText)ValetRow[2]).Text = slot.ID.ToString();
                }
                ValetSlotsList.ScrollPosition = scroll;

                if(mCharacterSettings.ValetSuitList.Count == 0)
                {
                    ValetSuitList.ClearRows();
                    ValetSuitPiecesList.ClearRows();
                    return;
                }

                if(mValetSuit == null)
                {
                    mValetSuit = mCharacterSettings.ValetSuitList.First();
                }

                scroll = ValetSuitList.ScrollPosition;
                ValetSuitList.ClearRows();
                foreach(ValetSuit vs in mCharacterSettings.ValetSuitList)
                {
                    ValetRow = ValetSuitList.AddRow();
                    ((HudPictureBox)ValetRow[0]).Image = vs.Icon + 0x6000000;
                    ((HudStaticText)ValetRow[1]).Text = vs.SuitName;
                    if(vs.TicketStub == mValetSuit.TicketStub) {((HudStaticText)ValetRow[1]).TextColor = Color.Gold;}
                    ((HudPictureBox)ValetRow[2]).Image = GearGraphics.RemoveCircle;
                    ((HudStaticText)ValetRow[3]).Text = vs.TicketStub.ToString();
                }

                ValetSuitList.ScrollPosition = scroll;

                scroll = ValetSuitPiecesList.ScrollPosition;
                ValetSuitPiecesList.ClearRows();

                foreach(ValetTicket vt in mValetSuit.SuitPieces.OrderBy(x => x.Priority))
                {
                    ValetRow = ValetSuitPiecesList.AddRow();
                    if(AetherObjects.Collection[vt.ItemId] != null)
                    {
                        ((HudPictureBox)ValetRow[0]).Image = AetherObjects.Collection[vt.ItemId].Icon + 0x6000000;
                        ((HudStaticText)ValetRow[1]).Text = vt.Priority.ToString();
                        ((HudStaticText)ValetRow[2]).Text = AetherObjects.Collection[vt.ItemId].Name;
                        if(vt.ItemId == Core.Actions.CurrentSelection){((HudStaticText)ValetRow[1]).TextColor = Color.Gold;}
                        ((HudPictureBox)ValetRow[3]).Image = GearGraphics.RemoveCircle;
                        ((HudStaticText)ValetRow[4]).Text = vt.ItemId.ToString();
                    }
                }

                ValetSuitPiecesList.ScrollPosition = scroll;
            }catch(Exception ex){LogError(ex);}
        }
Example #2
0
 private void ValetSuitList_Click(object sender, int row, int col)
 {
     try
     {
         HudList.HudListRowAccessor ValetRow = ValetSuitList[row];
         mValetSuit = mCharacterSettings.ValetSuitList.Find(x => x.TicketStub == Convert.ToInt32(((HudStaticText)ValetRow[3]).Text));
         if(col == 2)
         {
             mCharacterSettings.ValetSuitList.RemoveAll(x => x.TicketStub == Convert.ToInt32(((HudStaticText)ValetRow[3]).Text));
             if(mCharacterSettings.ValetSuitList.Count > 0 && !mCharacterSettings.ValetSuitList.Any(x => x.TicketStub == mValetSuit.TicketStub))
             {
                 mValetSuit = mCharacterSettings.ValetSuitList.First();
             }
             else
             {
                 mValetSuit = null;
             }
         }
         UpdateValetHud();
     }catch(Exception ex){LogError(ex);}
 }
Example #3
0
        private void ValetSuitPiecesList_Click(object sender, int row, int col)
        {
            try
            {
                HudList.HudListRowAccessor ValetRow = ValetSuitPiecesList[row];
                int ItemId = Convert.ToInt32(((HudStaticText)ValetRow[4]).Text);

                if(col == 0)
                {
                    Core.Actions.SelectItem(ItemId);
                }
                if(col == 1)
                {
                    int priorityindex = mValetSuit.SuitPieces.FindIndex(x => x.ItemId == ItemId);
                    mValetSuit.SuitPieces[priorityindex].Priority++;
                    if(mValetSuit.SuitPieces[priorityindex].Priority > 9)
                    {
                        mValetSuit.SuitPieces[priorityindex].Priority = 1;
                    }
                }
                if(col == 2)
                {
                    LootObject tLootObj = new LootObject(AetherObjects.Collection[ItemId]);
                    if(mGeneralSettings.GearInspectorSettings.GSStrings){HudToChat(tLootObj.GSReportString(),2);}
                    if(mGeneralSettings.GearInspectorSettings.AlincoStrings){HudToChat(tLootObj.LinkString(),2);}
                }
                if(col == 3)
                {
                    int RemoveIndex = mValetSuit.SuitPieces.FindIndex(x => x.ItemId == ItemId);
                    mValetSuit.SuitPieces.RemoveAt(RemoveIndex);

                    if(mValetSuit.SuitPieces.Count == 0)
                    {
                        mCharacterSettings.ValetSuitList.RemoveAll(x => x.TicketStub == mValetSuit.TicketStub);
                    }
                    if(mCharacterSettings.ValetSuitList.Count > 0)
                    {
                        mValetSuit = mCharacterSettings.ValetSuitList.First();
                    }
                    else
                    {
                        mValetSuit = null;
                    }
                }
                UpdateValetHud();

            }catch(Exception ex){LogError(ex);}
        }
Example #4
0
        private void ValetCreateSuit_Hit(object sender, System.EventArgs e)
        {
            try
            {
                if(ValetNameBox.Text == String.Empty)
                {
                    WriteToChat("The suit needs a name.  Put a name in the box.");
                    return;
                }

                if(Core.Actions.CurrentSelection == 0)
                {
                    WriteToChat("Select an item to use as the icon for the suit.");
                    return;
                }

                int nextsuitid = 0;

                for(int i = 0; i < mCharacterSettings.ValetSuitList.Count; i++)
                {
                    if(mCharacterSettings.ValetSuitList[i].TicketStub == nextsuitid)
                    {
                        nextsuitid = i + 1;
                    }
                }

                ValetSuit nValetSuit = new ValetSuit();
                nValetSuit.TicketStub = nextsuitid;
                nValetSuit.SuitName = ValetNameBox.Text;
                nValetSuit.Icon = AetherObjects.Collection[Core.Actions.CurrentSelection].Icon;

                List<AetherObject> SuitList = (from wo in AetherObjects.Inventory.Where(x => x.Values(ALongValueKeys.EquippedSlots) != 0)
                                  where mCharacterSettings.ValetSlotsList.Any(x => (x & wo.Values(ALongValueKeys.EquippedSlots)) == x)
                                  orderby wo.Name
                                  select wo).Distinct().ToList();

                foreach(AetherObject wo in SuitList)
                {
                    ValetTicket vt = new ValetTicket();
                    vt.ItemId = wo.Id;
                    vt.SlotId = (int)wo.Values(ALongValueKeys.EquippedSlots);
                    nValetSuit.SuitPieces.Add(vt);
                }

                foreach(int clearslot in mCharacterSettings.ValetSlotsList)
                {
                    nValetSuit.ClearSlotList.Add(clearslot);
                }

                mCharacterSettings.ValetSuitList.Add(nValetSuit);

                iLockerUpdate.bSubmitCharacterSettings = true;
                UpdateValetHud();

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