Bug - Fixed Store Manager does not update potential earnings

Veracity

Developer
Staff member
The Store manager shows your "potential earnings" in the title bar.

When you reprice items, it does not update this; you have to close and reopen the frame to see the new value.
 

lostcalpolydude

Developer
Staff member
Looks like that value is just a single number, only meant to be updated when the whole store is refreshed (since it used to be that there was no way to not see the whole store anyway). That will be nontrivial to change.

It also ignores any item priced over 50m, an arbitrary value that I suppose made sense when Mr. A prices were 4m but could at least be changed. That part is easy to change, or remove...
 
Ignoring some items for being too high priced to sell is logical enough. Items at max price aren't genuine attempts at being sold at that price, they're "I haven't bothered to set a price yet". An item that can actually be sold for 999,999,999 Meat will be sold in /trade or somewhere, where there's no caps getting in the way.

So the question is, where does the line go? 50M is clearly too low.
I guess you could only ignore max-price items. 999,999,998 isn't a genuine price either, for the same reasons, but it's not default anything, so probably nobody will have a problem with that behavior even so.
 

Veracity

Developer
Staff member
Revision 17669 recalculates the potential earnings from our model of what is in your store every time you update the prices in the store.

If you don't use ajax to submit the price change, you get the whole inventory, complete with massive amounts of cruft - 559,695 characters of response for my store with 8 items in it.

If you do use ajax, you get a little bit of java script and JSON showing only the items that actually changed prices. 590 characters for my store with one price change.

An advantage of the former is that if the quantity of any item changed - i.e., somebody bought one since the last time the window changed - we would see that.

Turns out we didn't parse that table, so, did not update the count. The only thing we did parse was the JSON, which appears with or without ajax.

I made it parse the full table, if you don't have ajax, and the JSON if you do have ajax.

I also made it request the ajax version from the StoreManager; I think making KoL send us a 600 character response is better than forcing it to send a half million character response.

And in either case, having updated prices and maybe quantities, I made the StoreManager recalculate the potential earnings from its model and update the title in the frame. (Which you will not see if you have the Store Manager as a tab, which might be why I seem to be the only one who was bothered by this. :) )
 

Veracity

Developer
Staff member
Revision 17670 puts the magic number - 50,000,000 - into a constant: REALISTIC_PRICE_THRESHOLD.

That allows us to easily change the magic number, should we decide to do so.
 
Top