Skip to content

Commit

Permalink
Bring back M2/WMO checkbox on MV page
Browse files Browse the repository at this point in the history
  • Loading branch information
Marlamin committed Aug 31, 2024
1 parent 4efd34a commit 62f6072
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
14 changes: 13 additions & 1 deletion Controllers/ListfileController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,19 @@ public DataTablesResult DataTables(int draw, int start, int length)
data = []
};

var listfileResults = new Dictionary<int, string>(CASC.Listfile.Where(x => CASC.TypeMap["m2"].Contains(x.Key) || CASC.TypeMap["wmo"].Contains(x.Key)));
var showM2 = true;
if(Request.Query.TryGetValue("showM2", out var showM2String))
showM2 = bool.Parse(showM2String);

var showWMO = true;
if (Request.Query.TryGetValue("showWMO", out var showWMOString))
showWMO = bool.Parse(showWMOString);

//var showADT = true;
//if (Request.Query.TryGetValue("showADT", out var showADTString))
// showADT = bool.Parse(showADTString);

var listfileResults = new Dictionary<int, string>(CASC.Listfile.Where(x => (showM2 && CASC.TypeMap["m2"].Contains(x.Key)) || (showWMO && CASC.TypeMap["wmo"].Contains(x.Key))));

if (Request.Query.TryGetValue("search[value]", out var search) && !string.IsNullOrEmpty(search))
{
Expand Down
5 changes: 4 additions & 1 deletion wwwroot/js/modelviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,10 @@ function exportScene(){
"url": "/listfile/datatables",
"data": function ( d ) {
return $.extend( {}, d, {
"src": "mv"
"src": "mv",
//"showADT": $("#showADT").is(":checked"),
"showWMO": $("#showWMO").is(":checked"),
"showM2": $("#showM2").is(":checked")
} );
}
},
Expand Down
5 changes: 5 additions & 0 deletions wwwroot/mv/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
<div class="tab-content" id="mvTabs">
<div class="tab-pane fade show active" id="model" role="tabpanel" aria-labelledby="model-tab">
<div class='row'>
<div class='col-md-2' style='padding-right: 0px'>
<!--<label title='terrain files (makes search slower)' for='showADT'><input class='filterBox' type='checkbox' id='showADT'> ADT</label><br>-->
<label title='larger models (buildings, cities, dungeons, raids etc)' for='showWMO'><input class='filterBox' type='checkbox' id='showWMO' CHECKED> WMO</label><br>
<label title='smaller more complex models (creatures, foliage, props etc)' for='showM2'><input class='filterBox' type='checkbox' id='showM2' CHECKED> M2</label><br>
</div>
<div class='col-md-8'>
<div id='mvfiles_filter' class='dataTables_filter'>
<label>
Expand Down

0 comments on commit 62f6072

Please sign in to comment.