-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3703 from devsnd/promenu-0.11
promenu 0.11: Add options for natural scroll and disabling wrap-around
- Loading branch information
Showing
6 changed files
with
96 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
(function (back) { | ||
var _a, _b; | ||
var SETTINGS_FILE = "promenu.settings.json"; | ||
var storage = require("Storage"); | ||
var settings = (storage.readJSON(SETTINGS_FILE, true) || {}); | ||
(_a = settings.naturalScroll) !== null && _a !== void 0 ? _a : (settings.naturalScroll = false); | ||
(_b = settings.wrapAround) !== null && _b !== void 0 ? _b : (settings.wrapAround = true); | ||
var save = function () { | ||
storage.writeJSON(SETTINGS_FILE, settings); | ||
}; | ||
var menu = { | ||
"": { "title": "Promenu" }, | ||
"< Back": back, | ||
"Natural Scroll": { | ||
value: !!settings.naturalScroll, | ||
onchange: function (v) { | ||
settings.naturalScroll = v; | ||
save(); | ||
} | ||
}, | ||
"Wrap Around": { | ||
value: !!settings.wrapAround, | ||
onchange: function (v) { | ||
settings.wrapAround = v; | ||
save(); | ||
} | ||
} | ||
}; | ||
E.showMenu(menu); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
(back => { | ||
const SETTINGS_FILE = "promenu.settings.json"; | ||
|
||
const storage = require("Storage") | ||
const settings = (storage.readJSON(SETTINGS_FILE, true) || {}) as PromenuSettings; | ||
settings.naturalScroll ??= false; | ||
settings.wrapAround ??= true; | ||
|
||
const save = () => { | ||
storage.writeJSON(SETTINGS_FILE, settings); | ||
}; | ||
|
||
const menu: Menu = { | ||
"": { "title": "Promenu" }, | ||
"< Back": back, | ||
/*LANG*/"Natural Scroll": { | ||
value: !!settings.naturalScroll, | ||
onchange: (v: boolean) => { | ||
settings.naturalScroll = v; | ||
save(); | ||
} | ||
}, | ||
/*LANG*/"Wrap Around": { | ||
value: !!settings.wrapAround, | ||
onchange: (v: boolean) => { | ||
settings.wrapAround = v; | ||
save(); | ||
} | ||
} | ||
}; | ||
|
||
E.showMenu(menu); | ||
}) satisfies SettingsFunc |