- // Create a _second_ element called 'Custom', which is
- // hidden.
- //
- // Hiding this element (that is, setting it display:none)
- // has the effect of making it not show up when the
- // drop-down list is actually opened, but still show up
- // when the item is selected.
- //
- // So what happens is that there's one element marked
- // 'Custom' that the _user_ selects, but a second one to
- // which we reset the dropdown after the config box
- // returns (if we don't then turn out to select a
- // different preset anyway). The point is that if the user
- // has 'Custom' selected, but then wants to customise
- // their settings a second time, we still get an onchange
- // event when they select the Custom option again, which
- // we wouldn't get if the browser thought it was already
- // the selected one. But here, it's _not_ the selected
- // option already; its invisible evil twin is selected.
+ // The option we've just created is the one for inventing
+ // a new custom setup.
+ gametypenewcustom = option;
+ option.value = -1;
+
+ // Now create another element called 'Custom', which will
+ // be auto-selected by us to indicate the custom settings
+ // you've previously selected. However, we don't add it to
+ // the game type selector; it will only appear when the
+ // user actually has custom settings selected.