Manage game systems

This commit is contained in:
LeRatierBretonnien 2024-08-07 17:27:08 +02:00
parent 8be95c20bd
commit 534fcb04fb
15 changed files with 68 additions and 27 deletions

View File

@ -28,3 +28,6 @@
font-size: 12px;
text-align: center;
}
.select-fixed-width {
width: 100px;
}

View File

@ -21,6 +21,12 @@ rmss.difficulties = {
absurd: {key: "absurd", label:"Absurd (-70)", value: -70},
};
rmss.gameSystems = [
{key: "common", label:"Common"},
{key: "merp", label:"Middle Earth Role Playing (MERP)"},
{key: "rmfrp", label:"Rolemaster Fantasy Role Playing (RMFRP)"},
];
rmss.combatSituations = [
{key: "none", label:"None (0)", modifier: 0},
{key: "melee", label:"Melee environment (-20)", modifier: -20},

View File

@ -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);

View File

@ -208,7 +208,7 @@ export default class RMSSPlayerSheet extends ActorSheet {
context.spells = spells;
// Dump context to console
console.log(context);
console.log("ACTOR CONTEXT", context);
}

View File

@ -76,7 +76,7 @@ export default class RMSSSkillSheet extends ItemSheet {
if (this.item.isEmbedded) {
skillCategories = this.item.parent.items.filter(it => it.type == "skill_category");
}
console.log("CATEG", skillCategories);
//console.log("CATEG", skillCategories);
return (skillCategories);
}

View File

@ -1 +1 @@
MANIFEST-000060
MANIFEST-000068

View File

@ -1,8 +1,8 @@
2024/08/03-16:17:28.988843 7f2b120006c0 Recovering log #58
2024/08/03-16:17:29.000009 7f2b120006c0 Delete type=3 #56
2024/08/03-16:17:29.000149 7f2b120006c0 Delete type=0 #58
2024/08/03-16:40:12.660059 7f2b110006c0 Level-0 table #63: started
2024/08/03-16:40:12.660133 7f2b110006c0 Level-0 table #63: 0 bytes OK
2024/08/03-16:40:12.666773 7f2b110006c0 Delete type=0 #61
2024/08/03-16:40:12.677428 7f2b110006c0 Manual compaction at level-0 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end)
2024/08/03-16:40:12.689036 7f2b110006c0 Manual compaction at level-1 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end)
2024/08/07-17:16:18.797577 7f33982006c0 Recovering log #66
2024/08/07-17:16:18.808374 7f33982006c0 Delete type=3 #64
2024/08/07-17:16:18.808471 7f33982006c0 Delete type=0 #66
2024/08/07-17:26:53.698667 7f33978006c0 Level-0 table #71: started
2024/08/07-17:26:53.698733 7f33978006c0 Level-0 table #71: 0 bytes OK
2024/08/07-17:26:53.705983 7f33978006c0 Delete type=0 #69
2024/08/07-17:26:53.706219 7f33978006c0 Manual compaction at level-0 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end)
2024/08/07-17:26:53.706260 7f33978006c0 Manual compaction at level-1 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end)

View File

@ -1,8 +1,8 @@
2024/08/02-16:48:51.596152 7f2b120006c0 Recovering log #54
2024/08/02-16:48:51.607028 7f2b120006c0 Delete type=3 #52
2024/08/02-16:48:51.607119 7f2b120006c0 Delete type=0 #54
2024/08/02-17:06:25.130824 7f2b110006c0 Level-0 table #59: started
2024/08/02-17:06:25.130880 7f2b110006c0 Level-0 table #59: 0 bytes OK
2024/08/02-17:06:25.137382 7f2b110006c0 Delete type=0 #57
2024/08/02-17:06:25.160338 7f2b110006c0 Manual compaction at level-0 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end)
2024/08/02-17:06:25.160385 7f2b110006c0 Manual compaction at level-1 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end)
2024/08/07-16:51:16.599301 7f33996006c0 Recovering log #62
2024/08/07-16:51:16.610580 7f33996006c0 Delete type=3 #60
2024/08/07-16:51:16.610673 7f33996006c0 Delete type=0 #62
2024/08/07-17:16:03.322418 7f33978006c0 Level-0 table #67: started
2024/08/07-17:16:03.322491 7f33978006c0 Level-0 table #67: 0 bytes OK
2024/08/07-17:16:03.329046 7f33978006c0 Delete type=0 #65
2024/08/07-17:16:03.356030 7f33978006c0 Manual compaction at level-0 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end)
2024/08/07-17:16:03.395552 7f33978006c0 Manual compaction at level-1 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end)

Binary file not shown.

View File

@ -494,6 +494,9 @@
font-size: 12px;
text-align: center;
}
.select-fixed-width {
width: 100px;
}
.applicable-stats-grid-container {
display: grid;
grid-template-columns: [app-stat-1] 33% [app-stat-2] 33% [app-stat-3] 33%;

View File

@ -3,7 +3,7 @@
"title": "Rolemaster FRP System",
"description": "The Rolemaster FRP system for FoundryVTT.",
"manifest": "https://www.uberwald.me/gitea/public/fvtt-rolemaster-frp/raw/branch/develop/system.json",
"download": "https://www.uberwald.me/gitea/public/fvtt-rolemaster-frp/archive/v12.0.7.zip",
"download": "https://www.uberwald.me/gitea/public/fvtt-rolemaster-frp/archive/v12.0.8.zip",
"authors": [
{
"name": "Cynicide",
@ -14,7 +14,7 @@
"email": ""
}
],
"version": "12.0.7",
"version": "12.0.8",
"compatibility": {
"minimum": "12",
"verified": "12"

View File

@ -332,6 +332,7 @@
"skill_category": {
"templates": ["base"],
"applicable_stats": "None",
"game_system": "common",
"app_stat_1": "None",
"app_stat_2": "None",
"app_stat_3": "None",

View File

@ -4,11 +4,18 @@
<h1><input name="name" type="text" value="{{item.name}}" placeholder="{{ localize 'Name' }}"/></h1>
</header>
<div class="sheet-content">
<div class="flexrow">
<div>Rank Bonus Progression
<select name="system.bonus_progression" value="{{system.bonus_progression}}" itemid="{{ item._id }}">
<select class="select-fixed-width" name="system.bonus_progression" value="{{system.bonus_progression}}" itemid="{{ item._id }}">
{{selectOptions config.rankBonusProgressionList selected=system.bonus_progression valueAttr="key" labelAttr="label"}}
</select>
</div>
<div>Game system
<select class="select-fixed-width" name="system.game_system" value="{{system.game_system}}" itemid="{{ item._id }}">
{{selectOptions config.gameSystems selected=system.game_system valueAttr="key" labelAttr="label"}}
</select>
</div>
</div>
<div class="applicable-stats-grid-container">
<div>
Applicable Stat 1