diff --git a/public/js/console.js b/public/js/console.js index 09eb6ff..47ea8f9 100644 --- a/public/js/console.js +++ b/public/js/console.js @@ -216,4 +216,33 @@ $(document).ready(function () { }; send_post_request('/api/setup-game', data); }); + + $('#game').on('change', function () { + var map_list = []; + + console.log(`reseting maps`); + + map_list.push("cs_italy"); + map_list.push("cs_office"); + map_list.push("de_ancient"); + map_list.push("de_anubis"); + map_list.push("de_assembly"); + map_list.push("de_dust2"); + map_list.push("de_inferno"); + map_list.push("de_memento"); + map_list.push("de_mills"); + map_list.push("de_mirage"); + map_list.push("de_nuke"); + map_list.push("de_overpass"); + map_list.push("de_thera"); + map_list.push("de_vertigo"); + + $('#map').empty(); + + for (var i = 0; i < map_list.length; i++) { + const opt = '' + $('#map').append(opt); + console.log(`adding ` + map_list[i]); + } + }) }); diff --git a/public/js/maps.js b/public/js/maps.js deleted file mode 100644 index 3b2fd33..0000000 --- a/public/js/maps.js +++ /dev/null @@ -1,32 +0,0 @@ -$(document).ready(function () { - var map_list = []; - - function update_maps() { - - console.log(`reseting maps`); - - map_list = []; - map_list.push("cs_italy"); - map_list.push("cs_office"); - map_list.push("de_ancient"); - map_list.push("de_anubis"); - map_list.push("de_assembly"); - map_list.push("de_dust2"); - map_list.push("de_inferno"); - map_list.push("de_memento"); - map_list.push("de_mills"); - map_list.push("de_mirage"); - map_list.push("de_nuke"); - map_list.push("de_overpass"); - map_list.push("de_thera"); - map_list.push("de_vertigo"); - - $('#map').empty(); - - for (var i = 0; i < map_list.length; i++) { - const opt = '' - $('#map').append(opt); - console.log(`adding ` + map_list[i]); - } - } -});