Skip to content

Commit

Permalink
Importer fix: Stop separating level-99 charts, as it can cause subind…
Browse files Browse the repository at this point in the history
…exes to appear in situations where they shouldn't (e.g. deleting charts with offsets.pofs)
  • Loading branch information
afska committed Feb 6, 2024
1 parent 5f7bb6a commit 97bfb4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const HEURISTICS = {
};
const TAGS = ["pro", "new", "ucs", "hidden", "train", "sp", "quest", "another"];

module.exports = (metadata, charts, content, filePath) => {
module.exports = (metadata, charts) => {
// channel
if (metadata.channel === "UNKNOWN") {
if (GLOBAL_OPTIONS.mode === "auto") metadata.channel = "ORIGINAL";
Expand Down Expand Up @@ -55,23 +55,6 @@ module.exports = (metadata, charts, content, filePath) => {
checkLevelOrder(singleCharts);
}

// separate level 99 charts
const numberOf99Charts = _.sumBy(charts, (it) => it.header.level === 99);
if (numberOf99Charts > 10) throw new Error("too_many_level_99_charts");
if (numberOf99Charts > 1) {
let variantIndex = 1;
let updatedLevel = 99 - numberOf99Charts + 1;
for (let chart of charts) {
if (chart.header.level === 99) {
chart.header.level = updatedLevel;
chart.header.variant = VARIANTS[variantIndex];
chart.header.order = updatedLevel;
updatedLevel++;
variantIndex++;
}
}
}

// check limits
const singleCharts = charts.filter((it) => !it.header.isDouble);
const doubleCharts = charts.filter((it) => it.header.isDouble);
Expand Down
2 changes: 1 addition & 1 deletion src/scenes/SelectionScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ void SelectionScene::printNumericLevel(Chart* chart, s8 offsetY) {
}

auto numericLevel = getSelectedNumericLevel();
auto levelText = numericLevel >= 90 ? "??" : std::to_string(numericLevel);
auto levelText = numericLevel == 99 ? "??" : std::to_string(numericLevel);
if (levelText.size() == 1)
levelText = "0" + levelText;
SCENE_write(levelText, NUMERIC_LEVEL_ROW + offsetY);
Expand Down

0 comments on commit 97bfb4c

Please sign in to comment.