Changeset 1248

Show
Ignore:
Timestamp:
1/19/2010 2:20:11 AM (2 months ago)
Author:
vessper
Message:

19/01/2010


- Prism: Multiple BPs can now be deleted from the BP Manager
- Prism: Deleting BPs will not alter the default sort order
- Prism: Modifying BPs will not alter the default sort order

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/EveHQ.Prism/Forms/frmPrism.vb

    r1247 r1248  
    55295529                                    newBPItem.Tag = BP.AssetID 
    55305530                                    clvBlueprints.Items.Add(newBPItem) 
    5531  
    55325531                                    newBPItem.SubItems(3).Text = BPData.TechLevel.ToString 
    5533                                     newBPItem.SubItems(4).Text = FormatNumber(BP.MELevel, 0) 
    5534                                     newBPItem.SubItems(5).Text = FormatNumber(BP.PELevel, 0) 
    5535                                     Select Case BP.BPType 
    5536                                         Case BPType.Unknown  ' Undetermined 
    5537                                             newBPItem.SubItems(1).Text = LocationName 
    5538                                             newBPItem.SubItems(2).Text = BP.LocationDetails 
    5539                                             newBPItem.SubItems(6).Text = "Unknown" 
    5540                                             newBPItem.SubItems(6).Tag = BP.Runs 
    5541                                             newBPItem.BackColor = Drawing.Color.LightGray 
    5542                                         Case BPType.BPO  ' BPO 
    5543                                             newBPItem.SubItems(1).Text = LocationName 
    5544                                             newBPItem.SubItems(2).Text = BP.LocationDetails 
    5545                                             newBPItem.SubItems(6).Text = "BPO" 
    5546                                             newBPItem.SubItems(6).Tag = 1000000 
    5547                                             newBPItem.BackColor = Drawing.Color.LightGreen 
    5548                                         Case BPType.BPC  ' BPC 
    5549                                             newBPItem.SubItems(1).Text = LocationName 
    5550                                             newBPItem.SubItems(2).Text = BP.LocationDetails 
    5551                                             newBPItem.SubItems(6).Text = FormatNumber(BP.Runs, 0) 
    5552                                             newBPItem.SubItems(6).Tag = BP.Runs 
    5553                                             newBPItem.BackColor = Drawing.Color.LightSteelBlue 
    5554                                         Case BPType.User 
    5555                                             newBPItem.SubItems(1).Text = owner & "'s Secret BP Stash" 
    5556                                             newBPItem.SubItems(2).Text = owner & "'s Secret BP Stash" 
    5557                                             newBPItem.SubItems(6).Text = "BPO" 
    5558                                             newBPItem.SubItems(6).Tag = 1000000 
    5559                                             newBPItem.BackColor = Drawing.Color.Yellow 
    5560                                     End Select 
    5561                                     newBPItem.SubItems(7).Text = [Enum].GetName(GetType(BPStatus), BP.Status) 
    5562                                     newBPItem.SubItems(7).Tag = BP.Status 
    5563                                     Select Case BP.Status 
    5564                                         Case BPStatus.Missing 
    5565                                             newBPItem.BackColor = Drawing.Color.LightCoral 
    5566                                         Case BPStatus.Exhausted 
    5567                                             newBPItem.BackColor = Drawing.Color.Orange 
    5568                                     End Select 
     5532                                    Call UpdateOwnerBPItem(owner, LocationName, BP, newBPItem) 
    55695533                                End If 
    55705534                            End If 
     
    55765540            clvBlueprints.EndUpdate() 
    55775541        End If 
     5542    End Sub 
     5543    Private Sub UpdateOwnerBPItem(ByVal Owner As String, ByVal LocationName As String, ByVal BP As BlueprintAsset, ByVal newBPItem As ContainerListViewItem) 
     5544        newBPItem.SubItems(4).Text = FormatNumber(BP.MELevel, 0) 
     5545        newBPItem.SubItems(5).Text = FormatNumber(BP.PELevel, 0) 
     5546        Select Case BP.BPType 
     5547            Case BPType.Unknown  ' Undetermined 
     5548                newBPItem.SubItems(1).Text = LocationName 
     5549                newBPItem.SubItems(2).Text = BP.LocationDetails 
     5550                newBPItem.SubItems(6).Text = "Unknown" 
     5551                newBPItem.SubItems(6).Tag = BP.Runs 
     5552                newBPItem.BackColor = Drawing.Color.LightGray 
     5553            Case BPType.BPO  ' BPO 
     5554                newBPItem.SubItems(1).Text = LocationName 
     5555                newBPItem.SubItems(2).Text = BP.LocationDetails 
     5556                newBPItem.SubItems(6).Text = "BPO" 
     5557                newBPItem.SubItems(6).Tag = 1000000 
     5558                newBPItem.BackColor = Drawing.Color.LightGreen 
     5559            Case BPType.BPC  ' BPC 
     5560                newBPItem.SubItems(1).Text = LocationName 
     5561                newBPItem.SubItems(2).Text = BP.LocationDetails 
     5562                newBPItem.SubItems(6).Text = FormatNumber(BP.Runs, 0) 
     5563                newBPItem.SubItems(6).Tag = BP.Runs 
     5564                newBPItem.BackColor = Drawing.Color.LightSteelBlue 
     5565            Case BPType.User 
     5566                newBPItem.SubItems(1).Text = Owner & "'s Secret BP Stash" 
     5567                newBPItem.SubItems(2).Text = Owner & "'s Secret BP Stash" 
     5568                newBPItem.SubItems(6).Text = "BPO" 
     5569                newBPItem.SubItems(6).Tag = 1000000 
     5570                newBPItem.BackColor = Drawing.Color.Yellow 
     5571        End Select 
     5572        newBPItem.SubItems(7).Text = [Enum].GetName(GetType(BPStatus), BP.Status) 
     5573        newBPItem.SubItems(7).Tag = BP.Status 
     5574        Select Case BP.Status 
     5575            Case BPStatus.Missing 
     5576                newBPItem.BackColor = Drawing.Color.LightCoral 
     5577            Case BPStatus.Exhausted 
     5578                newBPItem.BackColor = Drawing.Color.Orange 
     5579        End Select 
    55785580    End Sub 
    55795581 
     
    57565758                End If 
    57575759            End If 
    5758             End If 
     5760        End If 
    57595761    End Function 
    57605762    Private Sub GetAssetFromNode(ByVal loc As XmlNode, ByVal categories As ArrayList, ByVal groups As ArrayList, ByVal types As ArrayList, ByRef Assets As SortedList(Of String, BlueprintAsset), ByVal locationID As String, ByVal locationDetails As String, ByVal selPilot As EveHQ.Core.Pilot, ByVal IsCorp As Boolean) 
     
    58015803            ' Check child items if they exist 
    58025804            If item.ChildNodes.Count > 0 Then 
    5803                 Call GetAssetFromNode(item, categories, groups, types, Assets, locationID, flagname, selPilot, IsCorp) 
     5805                Call GetAssetFromNode(item, categories, groups, types, Assets, locationID, flagName, selPilot, IsCorp) 
    58045806            End If 
    58055807        Next 
     
    59655967        Else 
    59665968            mnuSendToBPCalc.Enabled = False 
    5967             mnuRemoveCustomBP.Enabled = False 
    5968         End If 
    5969             mnuAmendBPDetails.Enabled = chkShowOwnedBPs.Checked 
     5969            mnuRemoveCustomBP.Text = "Remove Blueprints (" & clvBlueprints.SelectedItems.Count.ToString & ")" 
     5970            mnuRemoveCustomBP.Enabled = True 
     5971        End If 
     5972        mnuAmendBPDetails.Enabled = chkShowOwnedBPs.Checked 
    59705973    End Sub 
    59715974 
     
    60116014        BPForm.AssetIDs = BPs 
    60126015        BPForm.ShowDialog() 
    6013         Call Me.UpdateBPList() 
     6016        ' Update the list using the details 
     6017        Dim BP As New BlueprintAsset 
     6018        Dim locationName As String = "" 
     6019        For Each selitem As ContainerListViewItem In clvBlueprints.SelectedItems 
     6020            BP = PlugInData.BlueprintAssets(BPForm.OwnerName).Item(selitem.Tag.ToString) 
     6021            LocationName = Me.GetLocationNameFromID(BP.LocationID) 
     6022            Call Me.UpdateOwnerBPItem(BPForm.OwnerName, locationName, BP, selitem) 
     6023        Next 
    60146024    End Sub 
    60156025 
     
    60336043    Private Sub mnuRemoveCustomBP_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuRemoveCustomBP.Click 
    60346044        ' Remove the custom BP from the assets 
    6035         Dim assetID As String = CStr(clvBlueprints.SelectedItems(0).Tag) 
    6036         Dim BPOwner As String = cboOwner.SelectedItem.ToString 
    6037         If PlugInData.BlueprintAssets(BPOwner).ContainsKey(assetID) = True Then 
    6038             PlugInData.BlueprintAssets(BPOwner).Remove(assetID) 
    6039             Call Me.UpdateBPList() 
     6045        If clvBlueprints.SelectedItems.Count > 0 Then 
     6046            Dim rBP As New ContainerListViewItem 
     6047            Dim cIDX As Integer = clvBlueprints.SelectedItems.Count - 1 
     6048            Do 
     6049                rBP = clvBlueprints.SelectedItems(cIDX) 
     6050                Dim assetID As String = CStr(rBP.Tag) 
     6051                Dim BPOwner As String = cboOwner.SelectedItem.ToString 
     6052                If PlugInData.BlueprintAssets(BPOwner).ContainsKey(assetID) = True Then 
     6053                    PlugInData.BlueprintAssets(BPOwner).Remove(assetID) 
     6054                    clvBlueprints.Items.Remove(rBP) 
     6055                    cIDX -= 1 
     6056                End If 
     6057            Loop Until cIDX = -1 
     6058            'Call Me.UpdateBPList() 
    60406059        End If 
    60416060    End Sub