Feature Named Choice Adventures

MadKingSoupII

New member
Is it possible to have the Choice Advs named or given some meaningful descriptor in the interface, rather than the current numbering system (e.g. "If it's Tiny, is it Still a Mansion?" and "Hot and Cold Running Rats" instead of "Typical Tavern 1" and "Typical Tavern 2"). There are a couple of areas where it's less than clear which choice adventure is being referred to in the KoLmafia interface, and although it's probably not going to totally ruin anybody's day, it just seems it'd make things a tiny bit easier to understand.

I know some of the adventure names are quite long, so maybe it'd be neater and just as easy to put this information as the first choice in the drop-down, perhaps equating to "show in browser". This would also let the choice adventures for a particular remain grouped as they are now.

NB: apologies to all if I'm Doing It Wrong. I expect this has been covered somewhere previously, but my searches came up empty so here we are.
 

Theraze

Active member
Alternatively, a preference to show the choice adventure number instead of the name could also provide this in a way where you can easily check it in the wiki and all of the names are roughly the same size.
 
I'm going to take a stab at this. There seem to be a variety of different tradeoffs here, all with different downsides, which of course is likely why no one's made any changes to the existing setup. :)

I can see two broad choices - either first, including the name of the adventure on the same line as a part of the label for that particular choice. I.e., where now you have:

Typical Tavern 1: [choices]

you'd have:

Typical Tavern - If it's Tiny, is it Still a Mansion?: [choices]

This is icky as these names will get pretty long, pretty quickly.

Alternatively, I can add a tooltip to the label so when you hover over it, it lists the adventure name. So, the interface would look the same at first glance, but as you mouse'd over the various adventures, you'd see "If it's Tiny, is it Still a Mansion?" or the like. Thoughts/prefs?

Separately, it seems like it would be useful to turn the labels into links, such that clicking on then would take you to the appropriate page in the wiki with the full adventure details. Maybe that + the tooltip?
 

Bale

Minion
Go with the tooltip. It's less cluttery.

Also, I think that it would not be terrible to have "Typical Tavern 1" replaced with "Typical Tavern 511" since that would be more helpful if someone wants to know the choice adventure number without having to look it up on the wiki. I need that info frequently.
 

Veracity

Developer
Staff member
Go with the tooltip. It's less cluttery.

Also, I think that it would not be terrible to have "Typical Tavern 1" replaced with "Typical Tavern 511"
Not bad. Do both. It makes it completely unambiguous what the choice adventure is - you not only see the number (which will not spur recognition in anybody), but you can get the actual encounter name when you hover. If it's still not clear, you can look at the choices and figure out which one it is - which is the only option you have today.
 
Okay, so it looks like there's three parts to this:

- part one (patch attached) - change the name to "Typical Tavern 511" (or the like), i.e., append the choice adventure number to the name. This was simple, but I'm concerned - from what I can tell, there are two places that uses ChoiceAdventure.getName(). First, swingui/panel/ChoiceOptionsPanel.java, which is expected, but also preferences/Preferences.java in printDefaults(). But, as far as I can tell, printDefaults is never called, so the fact that I'm changing the name won't cause any issues? Feedback is appreciated.

- part two - Add a tooltip to the label with the adventure name. This one's a bit more complex, because right now this isn't stored in the ChoiceAdventure structure, it's just in the comments. I plan on adding a new "adventure" attribute with the appropriate changes to return the adventure and create the ChoiceAdventure objects, and then have the panel create the tooltip.

- part three - Add a link to the wiki based on the adventure name. Easy once part two's done, I think. :)
 

Attachments

  • named_choice_part1.patch
    455 bytes · Views: 27
Alright! well, that was vastly more complicated than I expected, but there you go. So, I've got a working patch for this (see attached). The patch is definitely not ready for prime-time - there's a bunch of hacky bits just to get it working. But, given my serious lack of java experience, I figured it'd be good to post what I've done so far and see if I'm headed in the right direction or if (likely) I'm making some poor/ignorant choices and need to refine. Points so far:

- I haven't added in appropriate adventure names/tooltips/links for all the more custom adventures not built into the ChoiceManager, so those won't show up as links.
- The way I'm getting the links to look like links (adding dummy html to the label) it ends up rendering too long names on two lines instead of truncating with "...". Need to dig into that further.
- this one surprised me, btw - that you could add html to the label, but it wouldn't actually do anything. I hope that the hoops I had to jump through to make the links clickable were necessary, and I wasn't missing something obvious... :)
- Good news is, this should make it easier to add links to a bunch of other places. :)

Broadly, I:

- Changed ChoiceAdventure to include the adventure name as a part of the structure, and then move all the comments with the adventure name into the respective object creation calls.
- added a "URLLabel" class to the ActionVerifyPanel code (which presumably should be pulled out into it's own java file/class, but I wanted to get it working first) that does the right thing if it's passed a link.
- Changed ActionVerifyPanel to accept a url/tooltip for the VerifiableElements it's passed on creation.
- Created the glue bits in ChoiceOptionsPanel to get the adventure name from ChoiceManager and pass the right things to the ActionVerifyPanel to create the links.

Feedback welcome! this is an interesting adventure into java. Patch is of course against svn r10835, and builds/runs. I was going to also attach a jar for the curious who don't want to build from source, but that exceeded the upload size for the forum... If anyone wants that, let me know, and I'll find somewhere to post it.
 

Attachments

  • named_choice_part1-3.patch
    91.3 KB · Views: 28
Any chance one of the developer folk could take a look at this? I apologize for the impatience on my part, but the suspense is killing me. :)

Worst case, I'll take a stab at finishing this by moving the new URLLabel to it's own java file in the net/java/dev/spellcast/utilities/ library, and work on figuring out how to fix the label truncation issue (since I'm sure that won't be an acceptable tradeoff/bug). Finally, I can also go add a bunch of additional labels/links in to make sure all the choice adventures are linked appropriately. ah, well, I hope I'm not doing something incredibly stupid. thanks!
 

roippi

Developer
First look at the patch: compilation error in ChoiceManager.java (1896) where you try to call a constructor ChoiceAdventure(String, String, String, String[], String[]) which doesn't exist. There's a (String, String, String, String, String[], String[]) constructor if you were trying to do that.
 
First look at the patch: compilation error in ChoiceManager.java (1896) where you try to call a constructor ChoiceAdventure(String, String, String, String[], String[]) which doesn't exist. There's a (String, String, String, String, String[], String[]) constructor if you were trying to do that.

Sweet! thanks for taking a look. Problem was the new hidden temple adventures I added in a separate thread - I converted them over in the build I have running locally, but didn't reattach a patch that took that into account. My apologies. See attached version that builds/runs with r10889.
 

Attachments

  • named_choice_part1-3_v2.patch
    93.5 KB · Views: 21
Top