aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emcc.c17
-rw-r--r--emcclib.js10
2 files changed, 18 insertions, 9 deletions
diff --git a/emcc.c b/emcc.c
index 2be46ff..3f009ef 100644
--- a/emcc.c
+++ b/emcc.c
@@ -974,14 +974,17 @@ int main(int argc, char **argv)
if (thegame.can_configure)
js_add_preset(0, "Custom", -1);
- have_presets_dropdown = true;
+ have_presets_dropdown = npresets > 0 || thegame.can_configure;
- /*
- * Now ensure the appropriate element of the presets menu
- * starts off selected, in case it isn't the first one in the
- * list (e.g. Slant).
- */
- select_appropriate_preset();
+ if (have_presets_dropdown)
+ /*
+ * Now ensure the appropriate element of the presets menu
+ * starts off selected, in case it isn't the first one in the
+ * list (e.g. Slant).
+ */
+ select_appropriate_preset();
+ else
+ js_remove_type_dropdown();
}
/*
diff --git a/emcclib.js b/emcclib.js
index 88ca4ac..f052312 100644
--- a/emcclib.js
+++ b/emcclib.js
@@ -45,7 +45,9 @@ mergeInto(LibraryManager.library, {
* provides neither presets nor configurability.
*/
js_remove_type_dropdown: function() {
- gametypelist.style.display = "none";
+ var gametypeitem = gametypelist.closest("li");
+ if (gametypeitem === null) return;
+ gametypeitem.parentNode.removeChild(gametypeitem);
},
/*
@@ -55,7 +57,11 @@ mergeInto(LibraryManager.library, {
* time if the game doesn't support an in-game solve function.
*/
js_remove_solve_button: function() {
- document.getElementById("solve").style.display = "none";
+ var solvebutton = document.getElementById("solve");
+ if (solvebutton === null) return;
+ var solveitem = solvebutton.closest("li");
+ if (solveitem === null) return;
+ solveitem.parentNode.removeChild(solveitem);
},
/*