cff29546 / pzmap2dzi

A command-line tool to convert Project Zomboid map data into Deep Zoom format
MIT License
47 stars 15 forks source link

[Feature request] Toggle all modded maps #10

Closed xFeew closed 4 months ago

xFeew commented 4 months ago

Hi, I do have plenty of modded maps and toggling them all one by one every time is very time consuming. So, the solution is a button that toggles them all.

I added the following function:

let toggled = false;

function toggleAllModMaps(){
    let se = document.getElementById('map_selector');
    let ov = [...se.options].map(o => o.value);

    ov.forEach(x=>{toggled ? removeMap(x) : addMap(x)})

    toggled = !toggled;
}

It gets called by a simple buttton under the map: in UI_HTML

<button type="button" id="toggle_all_modded_maps" onClick="toggleAllModMaps()">Toggle maps</button>
cff29546 commented 4 months ago

I have added the load all maps button on the web ui.