Feature - Implemented display pulls remaining in maximizer when suggesting a pull

Once I realized you could make the maximizer pull items, I've been happily using that feature left and right - but was always concerned about the number of pulls I have remaining. So, patch attached - it adds the number of pulls you have remaining, like when maximizer suggests to buy items it lists the meat cost. The goal here is to continue to ensure that users know the consequences of hitting "equip all" and the like. I listed it as "x pulls, " instead of "x pulls remaining", as I figured the extra text wasn't adding much and would start causing the text to expand beyond the size of the window.

Patch is against r11495, builds/runs. I didn't test the unlimited part, as I'm not out of ronin. I also tried to get clever, and I suspect I'm doing ignorant things with the "getPullsRemainingString" bit - let me know if I should collapse this and just stick with having the logic in Maximizer.java. As a side effect, for example (which I did), you can now make the budget command a bit nicer. Also note it only does it for equipment, as (I don't think?) the maximizer will pull boosts.
 

Attachments

  • maximizer_list_pulls.patch
    2.4 KB · Views: 48

lostcalpolydude

Developer
Staff member
I listed it as "x pulls, " instead of "x pulls remaining", as I figured the extra text wasn't adding much and would start causing the text to expand beyond the size of the window.

It wouldn't surprise me to see someone ask why mafia thinks pulling something is going to cost 10 pulls. I haven't actually looked at the patch, but that seems like a possible thing that would pop up.
 

Catch-22

Active member
It wouldn't surprise me to see someone ask why mafia thinks pulling something is going to cost 10 pulls. I haven't actually looked at the patch, but that seems like a possible thing that would pop up.

I was kinda thinking the same thing.

Edit:
I suspect I'm doing ignorant things with the "getPullsRemainingString" bit.

Well, after looking at the patch, I have no comment on if this function should exist or not (I'll leave that up to the devs), but I figured I would point out that:

return "" + pullsRemaining;

is not the right way to return the string, you should do:

return String.valueOf(pullsRemaining);

instead. Hope this helps :)
 
Last edited:
It wouldn't surprise me to see someone ask why mafia thinks pulling something is going to cost 10 pulls. I haven't actually looked at the patch, but that seems like a possible thing that would pop up.

I was kinda thinking the same thing.

Edit:

Well, after looking at the patch, I have no comment on if this function should exist or not (I'll leave that up to the devs), but I figured I would point out that:

return "" + pullsRemaining;

is not the right way to return the string, you should do:

return String.valueOf(pullsRemaining);

instead. Hope this helps :)

Re: "remaining", shrug, easy change. It actually doesn't look as bad as I thought, given my extremely limited testing. Re the string return, thanks! I knew there was a better way to do it. v2 patch attached fixes both.
 

Attachments

  • maximizer_list_pulls_v2.patch
    2.4 KB · Views: 48

slyz

Developer
I don't play softcore, so I never felt the need for it, but maybe an important number like the number of pulls remaining should be shown on the main GUI's side pane? Under the "ML @ X" maybe?
 

Catch-22

Active member
I don't play softcore, so I never felt the need for it, but maybe an important number like the number of pulls remaining should be shown on the main GUI's side pane? Under the "ML @ X" maybe?

Actually, I was thinking this myself. There's a feature request asking for remaining PvP fites to show in the side panel too. In my mind, I was thinking we could have a section above the ML but below the familiar weight for both of these.

As I am writing this post though, I am thinking an even cooler feature would be a user scriptable section (below the familiar section), with some suggested defaults (being what we have there now).
 
Came out of ronin, found a problem with the patch where it didn't cover a set of pulls, so fixed that. Also validated that "unlimited pulls" properly shows up now.
 

Attachments

  • maximizer_list_pulls_v3.patch
    2.8 KB · Views: 53

Veracity

Developer
Staff member
I wanted something like this today, so I implemented it. I vaguely recalled it had been requested before, and here it is, almost 7 years ago. Sheesh.

I changed the label on the "pullable/buyable" radio button to include pulls left:

pullable/buyable (unlimited)
pullable/buyable (0 pulls left)
pullable/buyable (1 pull left)
pullable/buyable (14 pulls left)

It listens on the pulls remaining variable and updates when that changes.
I have not tried it in hardcore yet, since I just started a normal run - hence my interest in this feature. :)

I think the patch in this thread annotated each "pull & use" (etc.) line rather than having a single spot, as I did.

I like my approach better.

I suppose a super fancy approach would be to dynamically change the number of pulls left as you select/unselect each thing that requires a pull; that way you could see it counting down available pulls as you speculatively select a pullable thing, perhaps helping you decide which of the many set of possibilities you want, much as the "queue" feature for food/booze/spleen does.

I don't think I'll bother, unless what I just submitted proves to be inadequate for my needs.
 

Veracity

Developer
Staff member
Philosophical coding observation:

We have all sorts of clunky code that alerts users of data that changes by manually calling a method for each interested module. A number of years ago, we souped up our support for Listeners, and now lots of UI elements do what they should have done from the beginning (given the MVC pattern) and register a listener and update their UI element when the data changes. New UI elements simply register and the data source doesn't need to know a thing.

For example, the "Pulls" stuff on the lower right of the Storage panel of the Item Manager. Is handled by a "updatePullsRemaining" method - which is called by ConcoctionsDatabase - which ALSO fires a change on "(pullsremaining)".

So, for the feature I implemented here, I just listened on that name and it automatically worked. But the explicit method calls for things like that are annoying tech debt...
 
Top