Bug - Fixed Mafia Button for Decorating Crimbo Shrub broken.

Boesbert

Member
When I go to change my Crimbo Shrub's decorating dialogue (either by using the box of old Crimbo decorations or going there via ChIT), then select a new decoration combination, and then choose the "Decorate" mafia button on top of the main pane (and not the vanilla "Decorate" button on the bottom), then the same decoration I already had before selecting a new one is chosen, my new selection is ignored, and the decoration change limit for the day is used up.

Tested this with r17441 and older versions, running on Chromium (Version 53.0.2785.143 Built on Ubuntu , running on Ubuntu 16.04 (64-bit)) as relay browser, usual relay scripts running are ChIT and Guide.

View attachment DEBUG_20161127.txt.zip
 

Veracity

Developer
Staff member
Yeah.

When we generate the stationary buttons from the choice options, we don't include any of the non-standard fields associated with that choice. Thus:

Code:
<input type="button" onClick="document.location.href='choice.php?whichchoice=999&option=1&pwd=xxx';void(0);" value="Decorate!">
Looking at the actual form on the page:

Code:
<form action=choice.php>
  <input type=hidden name=whichchoice value=999>
  <input type=hidden name=pwd value=xxx>
  <input type=hidden name=option value=1>
  <input type=radio name=topper value=1 >
  <input type=radio name=topper value=2 >
  <input type=radio name=topper value=3 checked>
  <input type=radio name=lights value=1 checked> Rainbow-Colored Lights -- <font color=blue><b>Deals prismatic damage</b></font><br>
  <input type=radio name=lights value=2 >
  <input type=radio name=lights value=3 >
  <input type=radio name=lights value=4 >
  <input type=radio name=lights value=5 >
  <input type=radio name=lights value=6 >
  <input type=radio name=garland value=1 >
  <input type=radio name=garland value=2 >
  <input type=radio name=garland value=3 checked>
  <input type=radio name=gift value=1 checked>
  <input type=radio name=gift value=2 >
  <input type=radio name=gift value=3 >
  <input type=submit class=button value='Decorate!'>
</form>
You can see the four radio buttons. Thus, the full URL to submit would be:

whichchoice=999&option=1&pwd&topper=3&lights=1&garland=4&gift=1

Radio button changes happen only in the browser and the browser submits the desired URL when you press the Decorate! button. There is no way I know to make the KoLmafia-generated button add the fields according to how the radio buttons are currently set. Maybe with Javascript?

The easiest solution would be not generate a Decorate! button for whichchoice=999
 

lostcalpolydude

Developer
Staff member
I'm not seeing a mafia-provided Decorate button, just the vanilla one. Is this with the old combat form?

Well, decided to check instead of just asking, and that appears to be the case (once I re-enabled relayAddsCustomCombat).
 
Top