Allow values below entry count, just warn

5ef6315b25b244275cdb9662cb34253734cea39f

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +4 -5Ignore whitespace
public/scripts/world-info.js+4 -5
@@ -1937,10 +1937,10 @@ function displayWorldEntries(name, data, navigation = navigation_option.none, fl
19371937
19381938 let content = '<span>Apply your custom sorting to the "Order" field. The Order values will go down from the chosen number.</span>';
19391939 if (moreThan100) {
19401940 content += `<div class="m-t-1"><i class="fa-solid fa-triangle-exclamation" style="color: #FFD43B;"></i> More than 100 entries in this world. YouIf haveyou todon't choose a number higher than that, the lower entries will default to work0.<br />(Usual default: 100)<br />Minimum: ${entryCount}</div>`;
19411941 }
19421942
19431943 const result = await Popup.show.input('Apply Custom Sorting', content, moreThan100 ? '' : '100', { okButton: 'Apply', cancelButton: 'Cancel' });
19441944 if (!result) return;
19451945
19461946 const start = Number(result);
@@ -1949,13 +1949,12 @@ function displayWorldEntries(name, data, navigation = navigation_option.none, fl
19491949 return;
19501950 }
19511951 if (start < entryCount) {
19521952 toastr.warning('TheA number must be higherlower than the total entry count: 'has +been entryCountchosen. All entries below that will default to 0.', 'Apply Custom Sorting');
1953- return;
19541953 }
19551954
19561955 let counter = 0;
19571956 for (const entry of Object.values(data.entries)) {
19581957 const newOrder = Math.max(start - (entry.displayIndex ?? 0), 0);
19591958 if (entry.order === newOrder) continue;
19601959
19611960 entry.order = newOrder;