Manage game systems
This commit is contained in:
@ -8,8 +8,12 @@ export class RFRPUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async ready() {
|
||||
this.registerSettings();
|
||||
|
||||
this.gameSystem = game.settings.get("fvtt-rolemaster-frp", "game_system");
|
||||
|
||||
const skillCategories = await RFRPUtility.loadCompendium("fvtt-rolemaster-frp.skill_categories")
|
||||
this.skillCategories = skillCategories.map(i => i.toObject())
|
||||
this.skillCategories = skillCategories.map(i => i.toObject()).filter( i => i.system.game_system == "common" || i.system.game_system == this.gameSystem);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -17,6 +21,23 @@ export class RFRPUtility {
|
||||
return this.skillCategories
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static registerSettings() {
|
||||
game.settings.register("fvtt-rolemaster-frp", "game_system", {
|
||||
name: "Game System",
|
||||
hint: "List of Game Systems",
|
||||
scope: "world",
|
||||
default: "rmfrp",
|
||||
requiresReload: true,
|
||||
type: String,
|
||||
config: true,
|
||||
choices: {
|
||||
rmfrp: "Rolemaster Fantasy Role Playing (RMFRP)",
|
||||
merp: "Middle Earth Role Playing (MERP)"
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
static async loadCompendiumData(compendium) {
|
||||
const pack = game.packs.get(compendium);
|
||||
|
Reference in New Issue
Block a user