ALT Linux Bugzilla
– Attachment 2086 Details for
Bug 12306
Add Hagnk's-like equipment manager to Inventory panel
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
KoLmafia-11.1svn4174-alt-hagnks-like-equipment-manager.patch
KoLmafia-11.1svn4174-alt-hagnks-like-equipment-manager.patch (text/plain), 4.38 KB, created by
Sir Raorn
on 2007-07-11 19:05:43 MSD
(
hide
)
Description:
KoLmafia-11.1svn4174-alt-hagnks-like-equipment-manager.patch
Filename:
MIME Type:
Creator:
Sir Raorn
Created:
2007-07-11 19:05:43 MSD
Size:
4.38 KB
patch
obsolete
>diff --git a/KoLmafia/src/net/sourceforge/kolmafia/ItemManageFrame.java b/KoLmafia/src/net/sourceforge/kolmafia/ItemManageFrame.java >index dab5b33..a78dd73 100644 >--- a/KoLmafia/src/net/sourceforge/kolmafia/ItemManageFrame.java >+++ b/KoLmafia/src/net/sourceforge/kolmafia/ItemManageFrame.java >@@ -113,6 +113,7 @@ public class ItemManageFrame extends KoLFrame > this.addSeparator(); > > this.addPanel( "Inventory", new InventoryManagePanel( inventory, true ) ); >+ this.addPanel( " - Equipment", new EquipmentManagePanel( inventory, true ) ); > this.addPanel( " - Recent", new InventoryManagePanel( tally, true ) ); > this.addPanel( " - Closet", new InventoryManagePanel( closet, true ) ); > >@@ -948,6 +949,122 @@ public class ItemManageFrame extends KoLFrame > } > } > >+ private class EquipmentManagePanel extends ItemManagePanel >+ { >+ private JRadioButton [] equipmentFilters; >+ >+ public EquipmentManagePanel( LockableListModel elementModel ) >+ { this( elementModel, true ); >+ } >+ >+ public EquipmentManagePanel( LockableListModel elementModel, boolean addFilters ) >+ { >+ super( elementModel ); >+ >+ boolean isCloset = (elementModel == closet); >+ >+ this.setButtons( addFilters, new ActionListener [] { >+ >+ new ConsumeListener(), >+ new PutInClosetListener( isCloset ), >+ new AutoSellListener( isCloset, AutoSellRequest.AUTOSELL ), >+ new AutoSellListener( isCloset, AutoSellRequest.AUTOMALL ), >+ new PulverizeListener( isCloset ), >+ new PutOnDisplayListener( isCloset ), >+ new GiveToClanListener( isCloset ) >+ >+ } ); >+ >+ this.movers[ KoLCharacter.canInteract() ? 0 : 2 ].setSelected( true ); >+ } >+ >+ public void addFilters( boolean isCompact ) >+ { >+ ButtonGroup filterGroup = new ButtonGroup(); >+ JPanel filterPanel = new JPanel(); >+ this.equipmentFilters = new JRadioButton[7]; >+ this.equipmentFilters[0] = new JRadioButton( "weapons", true ); >+ this.equipmentFilters[1] = new JRadioButton( "offhand" ); >+ this.equipmentFilters[2] = new JRadioButton( "hats" ); >+ this.equipmentFilters[3] = new JRadioButton( "shirts" ); >+ this.equipmentFilters[4] = new JRadioButton( "pants" ); >+ this.equipmentFilters[5] = new JRadioButton( "accessories" ); >+ this.equipmentFilters[6] = new JRadioButton( "familiar" ); >+ >+ for ( int i = 0; i < 7; ++i ) >+ { >+ filterGroup.add( this.equipmentFilters[i] ); >+ filterPanel.add( this.equipmentFilters[i] ); >+ this.listenToRadioButton( this.equipmentFilters[i] ); >+ } >+ >+ this.northPanel.add( filterPanel, BorderLayout.CENTER ); >+ this.filterItems(); >+ } >+ >+ public FilterItemField getWordFilter() >+ { return new EquipmentFilterField(); >+ } >+ >+ private class EquipmentFilterField extends FilterItemField >+ { >+ public EquipmentFilterField() >+ { this.filter = new EquipmentFilter(); >+ } >+ >+ private class EquipmentFilter extends SimpleListFilter >+ { >+ public EquipmentFilter() >+ { super( EquipmentFilterField.this ); >+ } >+ >+ public boolean isVisible( Object element ) >+ { >+ boolean isVisibleWithFilter = true; >+ >+ switch ( TradeableItemDatabase.getConsumptionType( ((AdventureResult)element).getItemId() ) ) >+ { >+ case EQUIP_WEAPON: >+ isVisibleWithFilter = EquipmentManagePanel.this.equipmentFilters[0].isSelected(); >+ break; >+ >+ case EQUIP_OFFHAND: >+ isVisibleWithFilter = EquipmentManagePanel.this.equipmentFilters[1].isSelected(); >+ break; >+ >+ case EQUIP_HAT: >+ isVisibleWithFilter = EquipmentManagePanel.this.equipmentFilters[2].isSelected(); >+ break; >+ >+ case EQUIP_SHIRT: >+ isVisibleWithFilter = EquipmentManagePanel.this.equipmentFilters[3].isSelected(); >+ break; >+ >+ case EQUIP_PANTS: >+ isVisibleWithFilter = EquipmentManagePanel.this.equipmentFilters[4].isSelected(); >+ break; >+ >+ case EQUIP_ACCESSORY: >+ isVisibleWithFilter = EquipmentManagePanel.this.equipmentFilters[5].isSelected(); >+ break; >+ >+ case EQUIP_FAMILIAR: >+ isVisibleWithFilter = EquipmentManagePanel.this.equipmentFilters[6].isSelected(); >+ break; >+ >+ default: >+ return false; >+ } >+ >+ if ( !isVisibleWithFilter ) >+ return false; >+ >+ return super.isVisible( element ); >+ } >+ } >+ } >+ } >+ > private class HagnkEquipmentPanel extends HagnkStoragePanel > { > private FilterRadioButton [] equipmentFilters;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 12306
: 2086