Skip to content

Commit

Permalink
Add F5/F6 to swap between charts
Browse files Browse the repository at this point in the history
  • Loading branch information
tillvit committed Aug 30, 2024
1 parent db3488c commit 70cb8e8
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
34 changes: 34 additions & 0 deletions app/src/data/KeybindData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1423,4 +1423,38 @@ export const KEYBIND_DATA: { [key: string]: Keybind } = {
disabled: app => !app.chartManager.chartView,
callback: app => app.windowManager.openWindow(new NoteskinWindow(app)),
},
previousChart: {
label: "Previous chart",
combos: [{ key: "F5", mods: [] }],
disabled: app => !app.chartManager.chartView,
callback: app => {
if (!app.chartManager.loadedSM?.charts || !app.chartManager.loadedChart)
return
const charts =
app.chartManager.loadedSM?.charts[
app.chartManager.loadedChart.gameType.id
]
const curIndex = charts.indexOf(app.chartManager.loadedChart)
if (charts[curIndex - 1]) {
app.chartManager.loadChart(charts[curIndex - 1])
}
},
},
nextChart: {
label: "Next chart",
combos: [{ key: "F6", mods: [] }],
disabled: app => !app.chartManager.chartView,
callback: app => {
if (!app.chartManager.loadedSM?.charts || !app.chartManager.loadedChart)
return
const charts =
app.chartManager.loadedSM?.charts[
app.chartManager.loadedChart.gameType.id
]
const curIndex = charts.indexOf(app.chartManager.loadedChart)
if (charts[curIndex + 1]) {
app.chartManager.loadChart(charts[curIndex + 1])
}
},
},
}
11 changes: 11 additions & 0 deletions app/src/data/MenubarData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,17 @@ export const MENUBAR_DATA: { [key: string]: MenuMain } = {
{
type: "separator",
},
{
type: "selection",
id: "previousChart",
},
{
type: "selection",
id: "nextChart",
},
{
type: "separator",
},
{
type: "selection",
id: "songProperties",
Expand Down

0 comments on commit 70cb8e8

Please sign in to comment.