Feature - Implemented "modernize" item manager tables

roippi

Developer
I like the food, booze, and spleen tabs on the item manager. I also think that the pulverize tab is totally acceptable for displaying the information that it needs to display.

Pretty much every other tab in the item manager that contains a table of items could use "modernization." i.e. grid layout, resizable and sortable columns. Compare with the store manager.

This would subsume this old freq, and probably some others.
 
Last edited:

Rinn

Developer
I'd also like to see more filters, so I can see just lists of combat items, potions, or quest items for example.
 

nworbetan

Member
One thing I think would make life easier is typing an item name into a field and having the resulting table show you how many you have in inventory, Hagnks, and your closet, your mall store, etc. Having dedicated tabs for inventory, Hangks, and the closet could be useful too, but the combined one is what I'd get the most use out of.
 

fronobulax

Developer
Staff member
One thing I think would make life easier is typing an item name into a field and having the resulting table show you how many you have in inventory, Hagnks, and your closet, your mall store, etc. Having dedicated tabs for inventory, Hangks, and the closet could be useful too, but the combined one is what I'd get the most use out of.

Use case? While it is nice to have a total picture, I find when playing I care more about immediate availability rather than anything else. I wonder if your needs might be better met by a script? There's code in ManageAlice that looks everywhere and counts. You might be able to loop over items and call the ManageAlice routine count and know more than you know now. NetWorth might also give you some ideas.
 

nworbetan

Member
I kind of think that "mafia's native interface currently lacks the ability to provide a total picture" is a pretty compelling argument in and of itself, but I don't mind elaborating. The interface that I'm imagining is largely the same as any of the current general/recent/closet/storage tabs, except with more (modernized) filters--including filters to show/hide whatever locations you want--and a quantity column dedicated to each location. If you wanted to do some action to an item in a specific location, you could select the field at the intersection of location X and item Y, then click the appropriate "do something" button. If you wanted to take all of your combat items and potions out of Hagnks and your closet, you'd choose the right filters that shows you the list of items you want, click the "select all in this column" buttons associated with the Hagnk's and closet columns, and click the "put in bag" button.

While playing in aftercore, "immediate availability" means: inventory, Hagnk's, closet, mall store, display case, and I may have missed one or more locations. Being able to see all of your items in all of your possible locations could only make the inventory manager easier to use, in my opinion.
 

nworbetan

Member
Yeah, I can imagine that the "select all in this column" button might be a bit more tedious than what you had in mind. But even the ability to do something to one item from one location would still be a welcome improvement if I didn't need to type the item name up to three different times to find where it is. Just sharing one text input field common to all the individual location tabs would be enough.

So anyway, what kind of info were you planning on putting into the new modernized columns? The item manager currently shows the item name, the autosell price, and the quantity. It looks like there's plenty of room for multiple quantity columns to me. Do you have anything in mind as far as putting different info there, or are you mostly wanting to give the current info a cleaner and more organized look?
 

fronobulax

Developer
Staff member
I kind of think that "mafia's native interface currently lacks the ability to provide a total picture" is a pretty compelling argument in and of itself, but I don't mind elaborating.

Just because something can be done does not mean that it should be done ;-)

FWIW we probably have similar OCD tendencies but approach things differently. For example, I manage my DC with scripts, empty Hagnks as soon as possible and only use the closet when I want to protect something from mafia. That said, I could make a case for a unified Item Manager that included or excluded locations based upon preferences and allowed for all kinds of filtering so there probably is a feature request we agree on ;-)
 

roippi

Developer
So anyway, what kind of info were you planning on putting into the new modernized columns? The item manager currently shows the item name, the autosell price, and the quantity. It looks like there's plenty of room for multiple quantity columns to me. Do you have anything in mind as far as putting different info there, or are you mostly wanting to give the current info a cleaner and more organized look?

My goals are no more lofty than to put the data into a table with those three columns. It is better to do a few things well than many things poorly.

Just the refactoring in order to use JTables is going to take probably upwards of a thousand lines of code. I want it to look and feel right, and those two things take a lot of time. Let's not bloat this freq so that I can never close it.
 

nworbetan

Member
Just because something can be done does not mean that it should be done ;-)

FWIW we probably have similar OCD tendencies but approach things differently. For example, I manage my DC with scripts, empty Hagnks as soon as possible and only use the closet when I want to protect something from mafia. That said, I could make a case for a unified Item Manager that included or excluded locations based upon preferences and allowed for all kinds of filtering so there probably is a feature request we agree on ;-)

Before the PVP revamp, I did the exact same thing as you: take everything from Hagnk's and treat the closet as off-limits. But now that I'm keeping most of my items in storage and the closet, I'm noticing that hey, the closet actually does a really good job of making items inaccessible. >_< I have a similar closet-related feature request in mind about the modifier maximizer, but I think it's simple enough that I might be able to tackle it myself if I find the time.

My goals are no more lofty than to put the data into a table with those three columns. It is better to do a few things well than many things poorly.

Just the refactoring in order to use JTables is going to take probably upwards of a thousand lines of code. I want it to look and feel right, and those two things take a lot of time. Let's not bloat this freq so that I can never close it.

Understood, agreed, and I apologize about mis-estimating the scope of your plans by an order of magnitude or so. If, while you're refactoring, you figure out a convenient way to let people always find the item they're looking for in the first place they look for it, that would be (even more) awesome.
 

roippi

Developer
Some updates for any interested parties, as this is going to be a particularly long development cycle:

First, stupid training wheels stuff. JTables need to be put into a JScrollPane or they won't display the header row. That alone probably cost me almost an hour of headache.

Next, I originally thought I was going to have to rewrite LockableListModel, the basis on which all of kol session data is stored. Screw that, I just used a lightweight adapter to go from ListModel -> TableModel. Cool beans, done.

I soon realized that the "easy" method of enabling column sorting -
Code:
this.setAutoCreateRowSorter(true)
..is a 1.6 method. Bah. Fortunately, we've already imported the library for doing the sorting in 1.5 and below. Took another hour or two to figure out how to implement that properly.

The biggest headache so far was figuring out how to implement my own comparator. Basically: columns sort fine when they're just strings, or just integers, but (no-sell) mixed with (37 meat) means you need to write your own comparator. Everybody's idea of a good time, I know. 84 hours later, I've made it here:

http://i63.photobucket.com/albums/h139/roippi/koltable1.jpg

Still TODO:
-rewrite all the ContextMenuListeners to work with JTable interface
-yes, all 12 of them
-and the mouseadapter. and the keyadapter
-I think it should work fine with the filter once I add one, but haven't tested that yet
-figure out how to pull in ListCellRendererFactory. Not sure how I'm going to do this yet. Notably: without this, nothing gets colorized.
-final polish: column sizing/font justification/etc

I plan on eventually committing this as a DEBUG option so that source-builders can have a first crack at it. After that, I'll tie it to a preference and probably make it opt-out. I know there's going to be someone who will prefer the old style JLists.
 

Bale

Minion
Cool! It's gonna be awesome!

You haven't even mentioned that you will need a search box and item type categorization also. ;)
(Or was that something I simply didn't properly understand?)


After that, I'll tie it to a preference and probably make it opt-out. I know there's going to be someone who will prefer the old style JLists.

Honestly, screw them. It wouldn't be the first time that Mafia's UI changed and left people needing to adapt.
 
Last edited:

fronobulax

Developer
Staff member
Before the PVP revamp, I did the exact same thing as you: take everything from Hagnk's and treat the closet as off-limits. But now that I'm keeping most of my items in storage and the closet, I'm noticing that hey, the closet actually does a really good job of making items inaccessible. >_< I have a similar closet-related feature request in mind about the modifier maximizer, but I think it's simple enough that I might be able to tackle it myself if I find the time.

Concerning the Maximizer, having it look at the Closet and DC has been proposed and rejected several times. Before you do too much work you might think through how using and "pulling" from those sources would be controlled and include that in either a FR or a request for someone to commit code for you.
 

Veracity

Developer
Staff member
It already looks at the closet. That is already well controlled by a preference.

The DC is another story. We have no such preference and I don't want there to be one.
 

Bale

Minion
There are sets of checkboxes over many item panes with labels like food, booze, equip, no-trade... It's nice to be able to select those sets of items. Are you planning a related mechanism?
 

roippi

Developer
Yes, I'm going to drop the replacement tables into those panels, no filtering functionality will be lost.
 

roippi

Developer
Thusly:

managertable1.JPG

I'm actually enjoying doing this particular rewrite. It's really coming along way faster than I thought it would be originally.

I think the way I'm going to roll this out is to first update the Restores panel. It's the simplest one to do. I've actually got it implemented everywhere locally (as the screenshot may evidence), but I'm trying to be fastidious with the bugsquashery.
 

fronobulax

Developer
Staff member
It already looks at the closet. That is already well controlled by a preference.

Duh. That's right. I am so used to treating the closet as safe storage (and manually moving stuff in and out) that I forgot the preference applied to the Maximizer.

Unlike veracity, I would not mind having the maximizer just look in the DC in a kind of read only fashion. Since I am obsessively collecting, I would not mind knowing that there is something in the DC that is better than what I am using but I absolutely do not want anything to autopull from the DC. Given that some user, somewhere is going to ask for an autopull from the DC if the Maximizer looks there, there is wisdom in not even looking there.
 
Top