added fonts to the command line

This commit is contained in:
Jack 2020-08-01 14:44:59 +01:00
parent 091db7315a
commit 63f9b32458

View file

@ -259,6 +259,15 @@ let commands = {
showCommandLine();
},
},
{
id: "changeFontFamily",
display: "Change font family...",
subgroup: true,
exec: () => {
currentCommands.push(commandsFonts);
showCommandLine();
},
},
{
id: "joinDiscord",
display: "Join the Discord server",
@ -706,6 +715,11 @@ $.getJSON("funbox/list.json", function (data) {
});
});
let commandsFonts = {
title: "Change font...",
list: [],
};
let fontsList;
$.getJSON("js/fonts.json", function (data) {
@ -715,16 +729,20 @@ $.getJSON("js/fonts.json", function (data) {
if (nameA > nameB) return 1;
return 0;
});
data.forEach((font) => {
commandsFonts.list.push({
id: "changeFont" + font.name.replace(/ /g, "_"),
display: font.name,
exec: () => {
setFontFamily(font.name);
},
});
});
});
let commandsThemes = {
title: "Change theme...",
list: [
{
id: "couldnotload",
display: "Could not load the themes list :(",
},
],
list: [],
};
let commandsLanguages = {