Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
de884cbd22 | |||
8b37e16915 | |||
46d991fb65 | |||
5ca0362773 | |||
f777131374 | |||
c11f7d23a8 | |||
98e6b70b1b | |||
6597334682 | |||
534fcb04fb | |||
8be95c20bd | |||
cba4394a37 |
@ -46,3 +46,8 @@
|
||||
border-bottom: 1px solid;
|
||||
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
|
||||
}
|
||||
|
||||
.skills-name-left-align {
|
||||
text-align: left;
|
||||
padding-left: 2px;
|
||||
}
|
@ -28,3 +28,6 @@
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
.select-fixed-width {
|
||||
width: 100px;
|
||||
}
|
@ -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},
|
||||
@ -31,6 +37,7 @@ rmss.rankBonusProgressionList = [
|
||||
{key: "standard", label:"Standard"},
|
||||
{key: "limited", label:"Limited"},
|
||||
{key: "combined", label:"Combined"},
|
||||
{key: "race", label:"Linked to Race"},
|
||||
]
|
||||
|
||||
rmss.lightOrDarknessModifiers = [
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { RFRPUtility } from "../rfrp-utility.js";
|
||||
|
||||
export class RMSSItem extends Item {
|
||||
|
||||
/** @override */
|
||||
@ -100,21 +102,13 @@ export class RMSSItem extends Item {
|
||||
}
|
||||
|
||||
calculateSelectedSkillCategoryBonus(itemData) {
|
||||
if (this.isEmbedded === null) {
|
||||
console.log(`rmss | item.js | Skill ${this.name} has no owner. Not calculating Skill Category bonus`);
|
||||
}
|
||||
else
|
||||
{
|
||||
const items = this.parent?.items;
|
||||
console.log(`rmss | item.js | Skill ${this.name} has owner, calculating skill category bonus.`);
|
||||
if (items) {
|
||||
for (const item of items) {
|
||||
if (item.type === "skill_category" && item._id === itemData.system.category) {
|
||||
console.log(`rmss | item.js | Calculating Skill Category bonus for skill: ${this.name}`);
|
||||
this.system.category_bonus = item.system.total_bonus;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Find the relevant skill category
|
||||
let skillC = this.parent?.items || RFRPUtility.getSkillCategories();
|
||||
if (skillC) {
|
||||
let item = skillC.find(it => it.type == "skill_category" && it.name.toLowerCase() == itemData.system.category.toLowerCase());
|
||||
this.system.category_bonus = item.system.total_bonus;
|
||||
} else {
|
||||
ui.notifications.warn("No Skill Categories found. Please create a Skill Category.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
197
module/rfrp-utility.js
Normal file
197
module/rfrp-utility.js
Normal file
@ -0,0 +1,197 @@
|
||||
/* -------------------------------------------- */
|
||||
export class RFRPUtility {
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async init() {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
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()).filter( i => i.system.game_system == "common" || i.system.game_system == this.gameSystem);
|
||||
// Sort skill categories by name
|
||||
this.skillCategories.sort((a, b) => a.name.localeCompare(b.name));
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getSkillCategories() {
|
||||
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);
|
||||
return await pack?.getDocuments() ?? [];
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async loadCompendium(compendium, filter = item => true) {
|
||||
let compendiumData = await RFRPUtility.loadCompendiumData(compendium);
|
||||
return compendiumData.filter(filter);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static removeChatMessageId(messageId) {
|
||||
if (messageId) {
|
||||
game.messages.get(messageId)?.delete();
|
||||
}
|
||||
}
|
||||
|
||||
static findChatMessageId(current) {
|
||||
return RFRPUtility.getChatMessageId(HeritiersUtility.findChatMessage(current));
|
||||
}
|
||||
|
||||
static getChatMessageId(node) {
|
||||
return node?.attributes.getNamedItem('data-message-id')?.value;
|
||||
}
|
||||
|
||||
static findChatMessage(current) {
|
||||
return RFRPUtility.findNodeMatching(current, it => it.classList.contains('chat-message') && it.attributes.getNamedItem('data-message-id'))
|
||||
}
|
||||
|
||||
static findNodeMatching(current, predicate) {
|
||||
if (current) {
|
||||
if (predicate(current)) {
|
||||
return current;
|
||||
}
|
||||
return RFRPUtility.findNodeMatching(current.parentElement, predicate);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getUsers(filter) {
|
||||
return game.users.filter(filter).map(user => user._id);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getWhisperRecipients(rollMode, name) {
|
||||
switch (rollMode) {
|
||||
case "blindroll": return this.getUsers(user => user.isGM);
|
||||
case "gmroll": return this.getWhisperRecipientsAndGMs(name);
|
||||
case "selfroll": return [game.user.id];
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
static getWhisperRecipientsAndGMs(name) {
|
||||
let recep1 = ChatMessage.getWhisperRecipients(name) || [];
|
||||
return recep1.concat(ChatMessage.getWhisperRecipients('GM'));
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static blindMessageToGM(chatOptions) {
|
||||
let chatGM = foundry.utils.duplicate(chatOptions);
|
||||
chatGM.whisper = this.getUsers(user => user.isGM);
|
||||
chatGM.content = "Blinde message of " + game.user.name + "<br>" + chatOptions.content;
|
||||
console.log("blindMessageToGM", chatGM);
|
||||
game.socket.emit("system.fvtt-rolemaster-frp", { msg: "msg_gm_chat_message", data: chatGM });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async searchItem(dataItem) {
|
||||
let item
|
||||
if (dataItem.pack) {
|
||||
let id = dataItem.id || dataItem._id
|
||||
let items = await this.loadCompendium(dataItem.pack, item => item.id == id)
|
||||
item = items[0] || undefined
|
||||
} else {
|
||||
item = game.items.get(dataItem.id)
|
||||
}
|
||||
return item
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static loadHandlebarsTemplates() {
|
||||
const templatePaths = [
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-stats.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-fixed-info.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-armor-info.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-resistance.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-race-stat-fixed-info.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-role-traits.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-background-info.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-skill-categories.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-skills.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-fav-skills.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-items.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-weapons.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-money.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-skill-categories.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-skills.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-armor.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-herbs.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-spells.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-fav-spells.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-fav-items.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/apps/app_skill_category_importer.html"
|
||||
];
|
||||
return loadTemplates(templatePaths);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static loadHandlebarsHelpers() {
|
||||
|
||||
// Handlebars Helpers
|
||||
Handlebars.registerHelper('count', function (list) {
|
||||
return list.length;
|
||||
})
|
||||
Handlebars.registerHelper('includes', function (array, val) {
|
||||
return array.includes(val);
|
||||
})
|
||||
Handlebars.registerHelper('upper', function (text) {
|
||||
return text.toUpperCase();
|
||||
})
|
||||
Handlebars.registerHelper('lower', function (text) {
|
||||
return text.toLowerCase()
|
||||
})
|
||||
Handlebars.registerHelper('upperFirst', function (text) {
|
||||
if (typeof text !== 'string') return text
|
||||
return text.charAt(0).toUpperCase() + text.slice(1)
|
||||
})
|
||||
Handlebars.registerHelper('notEmpty', function (list) {
|
||||
return list.length > 0;
|
||||
})
|
||||
Handlebars.registerHelper('mul', function (a, b) {
|
||||
return parseInt(a) * parseInt(b);
|
||||
})
|
||||
Handlebars.registerHelper("switch", function (value, options) {
|
||||
this.switch_value = value;
|
||||
return options.fn(this);
|
||||
});
|
||||
Handlebars.registerHelper("case", function (value, options) {
|
||||
if (value === this.switch_value) {
|
||||
return options.fn(this);
|
||||
}
|
||||
});
|
||||
// Handle v12 removal of this helper
|
||||
Handlebars.registerHelper('select', function (selected, options) {
|
||||
const escapedValue = RegExp.escape(Handlebars.escapeExpression(selected));
|
||||
const rgx = new RegExp(' value=[\"\']' + escapedValue + '[\"\']');
|
||||
const html = options.fn(this);
|
||||
return html.replace(rgx, "$& selected");
|
||||
});
|
||||
}
|
||||
}
|
@ -171,7 +171,7 @@ export default class RMSSPlayerSheet extends ActorSheet {
|
||||
for (let s of skillcat) {
|
||||
s.skills = [];
|
||||
for (let sk of playerskill) {
|
||||
if (sk.system.category === s._id) {
|
||||
if (sk.system.category.toLowerCase() === s.name.toLowerCase()) {
|
||||
s.skills.push(sk);
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
|
||||
@ -251,7 +251,9 @@ export default class RMSSPlayerSheet extends ActorSheet {
|
||||
|
||||
let selectOptions = {};
|
||||
for (const pack of game.packs) {
|
||||
selectOptions[pack.metadata.id] = pack.metadata.label;
|
||||
if (pack.metadata.type === "Item") {
|
||||
selectOptions[pack.metadata.id] = pack.metadata.label;
|
||||
}
|
||||
}
|
||||
new game.rmss.applications.RMSSToolsSCImporter(selectOptions, this.actor).render(true);
|
||||
});
|
||||
|
@ -27,23 +27,27 @@ export default class RMSSToolsSCImporter extends FormApplication {
|
||||
}
|
||||
|
||||
async _updateObject(event, formData) {
|
||||
console.log("Deleting Old Skill Categories.");
|
||||
//console.log("Update ", event, formData);
|
||||
let itemType = event.submitter.value;
|
||||
let toDelete = [];
|
||||
for (const item of this.character.items) {
|
||||
if (item.type === "skill_category") {
|
||||
item.delete();
|
||||
if (item.type === itemType) {
|
||||
toDelete.push(item.id);
|
||||
}
|
||||
}
|
||||
this.character.deleteEmbeddedDocuments("Item", toDelete);
|
||||
|
||||
const pack = game.packs.get(formData.selectOptions);
|
||||
let comp = (itemType == "skill") ? formData.selectOptionsSkills : formData.selectOptionsCategories;
|
||||
const pack = game.packs.get(comp);
|
||||
const skillCategoryData = await pack.getIndex();
|
||||
|
||||
console.log("Importing New Skill Categories.");
|
||||
console.log("Importing New Skills/Skill Categories.");
|
||||
|
||||
for (const sc of skillCategoryData) {
|
||||
const newitem = await pack.getDocument(sc._id);
|
||||
|
||||
let newDocuments = [];
|
||||
if (newitem.type === "skill_category") {
|
||||
if (newitem.type === itemType) {
|
||||
console.log(newitem);
|
||||
newDocuments.push(newitem);
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { RFRPUtility } from "../../rfrp-utility.js";
|
||||
|
||||
// Our Item Sheet extends the default
|
||||
export default class RMSSSkillSheet extends ItemSheet {
|
||||
|
||||
@ -70,21 +72,20 @@ export default class RMSSSkillSheet extends ItemSheet {
|
||||
// If this Skill is owned then we will return a list of Skill Categories and allow them to choose
|
||||
// Otherwise we'll just return 'Skill has no owner'
|
||||
prepareSkillCategoryValues() {
|
||||
let skillNoOwner = { None: "Skill Has No Owner" };
|
||||
|
||||
if (!this.item.isEmbedded) {
|
||||
return (skillNoOwner);
|
||||
} else {
|
||||
const skillCategories = this.item.parent.getOwnedItemsByType("skill_category");
|
||||
return (skillCategories);
|
||||
let skillCategories = RFRPUtility.getSkillCategories();
|
||||
if (this.item.isEmbedded) {
|
||||
skillCategories = this.item.parent.items.filter(it => it.type == "skill_category");
|
||||
}
|
||||
//console.log("CATEG", skillCategories);
|
||||
return (skillCategories);
|
||||
}
|
||||
|
||||
// Determine which Skill Category is selected and test that it is in the current list of categories.
|
||||
// If it isn't set it to None.
|
||||
prepareSelectedSkillCategory(ownedSkillCategories, selectedSkillCategory) {
|
||||
let defaultSelectedCategory = "None";
|
||||
if (Object.keys(ownedSkillCategories).includes(selectedSkillCategory)) {
|
||||
let skillC = ownedSkillCategories.find(it => it.name.toLowerCase() == selectedSkillCategory.toLowerCase());
|
||||
if (skillC) {
|
||||
return (selectedSkillCategory);
|
||||
} else {
|
||||
return (defaultSelectedCategory);
|
||||
@ -95,18 +96,14 @@ export default class RMSSSkillSheet extends ItemSheet {
|
||||
// Iterate through the owned skill categories and if one of them matches the item id of currently
|
||||
// selected skill category then set the Skill Category Bonus field to the Total Bonus field of the Skill Category
|
||||
prepareSelectedSkillCategoryBonus(selected_skillcat) {
|
||||
if (this.item.isEmbedded === null) {
|
||||
console.log("Skill has no owner");
|
||||
}
|
||||
else {
|
||||
const items = this.object.parent.items;
|
||||
|
||||
for (const item of items) {
|
||||
if (item.type === "skill_category" && item._id === selected_skillcat) {
|
||||
console.log(`rmss | rmss_skill_sheet | Calculating Skill Category bonus for skill: ${this.object.name}`);
|
||||
this.object.system.category_bonus = item.system.total_bonus;
|
||||
}
|
||||
let skillC = this.parent?.items || RFRPUtility.getSkillCategories();
|
||||
if (skillC) {
|
||||
let item = skillC.find(it => it.type == "skill_category" && it.name.toLowerCase() == itemData.system.category.toLowerCase());
|
||||
if (item) {
|
||||
this.system.category_bonus = item.system.total_bonus;
|
||||
return
|
||||
}
|
||||
}
|
||||
ui.notifications.warn("No Skill Categories found for " + this.name + ". Please create and link a Skill Category.");
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
BIN
packs/skill_categories/000080.ldb
Normal file
BIN
packs/skill_categories/000080.ldb
Normal file
Binary file not shown.
@ -1 +1 @@
|
||||
MANIFEST-000056
|
||||
MANIFEST-000113
|
||||
|
@ -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/10-00:13:42.653716 7f9286a006c0 Recovering log #111
|
||||
2024/08/10-00:13:42.702147 7f9286a006c0 Delete type=3 #109
|
||||
2024/08/10-00:13:42.702252 7f9286a006c0 Delete type=0 #111
|
||||
2024/08/10-00:15:09.358300 7f9285a006c0 Level-0 table #116: started
|
||||
2024/08/10-00:15:09.358337 7f9285a006c0 Level-0 table #116: 0 bytes OK
|
||||
2024/08/10-00:15:09.364353 7f9285a006c0 Delete type=0 #114
|
||||
2024/08/10-00:15:09.392733 7f9285a006c0 Manual compaction at level-0 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end)
|
||||
2024/08/10-00:15:09.392780 7f9285a006c0 Manual compaction at level-1 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end)
|
||||
|
@ -1,8 +1,8 @@
|
||||
2024/08/02-16:41:04.243624 7f2b134006c0 Recovering log #50
|
||||
2024/08/02-16:41:04.298794 7f2b134006c0 Delete type=3 #48
|
||||
2024/08/02-16:41:04.298940 7f2b134006c0 Delete type=0 #50
|
||||
2024/08/02-16:47:53.296999 7f2b110006c0 Level-0 table #55: started
|
||||
2024/08/02-16:47:53.297027 7f2b110006c0 Level-0 table #55: 0 bytes OK
|
||||
2024/08/02-16:47:53.302866 7f2b110006c0 Delete type=0 #53
|
||||
2024/08/02-16:47:53.310260 7f2b110006c0 Manual compaction at level-0 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end)
|
||||
2024/08/02-16:47:53.310311 7f2b110006c0 Manual compaction at level-1 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end)
|
||||
2024/08/10-00:12:37.568139 7f9287e006c0 Recovering log #107
|
||||
2024/08/10-00:12:37.578251 7f9287e006c0 Delete type=3 #105
|
||||
2024/08/10-00:12:37.578313 7f9287e006c0 Delete type=0 #107
|
||||
2024/08/10-00:13:00.464797 7f9285a006c0 Level-0 table #112: started
|
||||
2024/08/10-00:13:00.464827 7f9285a006c0 Level-0 table #112: 0 bytes OK
|
||||
2024/08/10-00:13:00.471404 7f9285a006c0 Delete type=0 #110
|
||||
2024/08/10-00:13:00.478060 7f9285a006c0 Manual compaction at level-0 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end)
|
||||
2024/08/10-00:13:00.478094 7f9285a006c0 Manual compaction at level-1 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end)
|
||||
|
Binary file not shown.
BIN
packs/skill_categories/MANIFEST-000113
Normal file
BIN
packs/skill_categories/MANIFEST-000113
Normal file
Binary file not shown.
0
packs/skills-merp/000004.log
Normal file
0
packs/skills-merp/000004.log
Normal file
BIN
packs/skills-merp/000005.ldb
Normal file
BIN
packs/skills-merp/000005.ldb
Normal file
Binary file not shown.
1
packs/skills-merp/CURRENT
Normal file
1
packs/skills-merp/CURRENT
Normal file
@ -0,0 +1 @@
|
||||
MANIFEST-000002
|
0
packs/skills-merp/LOCK
Normal file
0
packs/skills-merp/LOCK
Normal file
5
packs/skills-merp/LOG
Normal file
5
packs/skills-merp/LOG
Normal file
@ -0,0 +1,5 @@
|
||||
2024/08/10-00:13:42.782130 7f9287e006c0 Delete type=3 #1
|
||||
2024/08/10-00:15:09.364559 7f9285a006c0 Level-0 table #5: started
|
||||
2024/08/10-00:15:09.368108 7f9285a006c0 Level-0 table #5: 33871 bytes OK
|
||||
2024/08/10-00:15:09.374591 7f9285a006c0 Delete type=0 #3
|
||||
2024/08/10-00:15:09.392750 7f9285a006c0 Manual compaction at level-0 from '!items!5Sg9t8YQubtRoghF' @ 72057594037927935 : 1 .. '!items!zvdsAxlRZnL6gqms' @ 0 : 0; will stop at (end)
|
BIN
packs/skills-merp/MANIFEST-000002
Normal file
BIN
packs/skills-merp/MANIFEST-000002
Normal file
Binary file not shown.
0
packs/skills-rmfrp/000004.log
Normal file
0
packs/skills-rmfrp/000004.log
Normal file
BIN
packs/skills-rmfrp/000005.ldb
Normal file
BIN
packs/skills-rmfrp/000005.ldb
Normal file
Binary file not shown.
1
packs/skills-rmfrp/CURRENT
Normal file
1
packs/skills-rmfrp/CURRENT
Normal file
@ -0,0 +1 @@
|
||||
MANIFEST-000002
|
0
packs/skills-rmfrp/LOCK
Normal file
0
packs/skills-rmfrp/LOCK
Normal file
5
packs/skills-rmfrp/LOG
Normal file
5
packs/skills-rmfrp/LOG
Normal file
@ -0,0 +1,5 @@
|
||||
2024/08/10-00:13:42.844297 7f9286a006c0 Delete type=3 #1
|
||||
2024/08/10-00:15:09.374814 7f9285a006c0 Level-0 table #5: started
|
||||
2024/08/10-00:15:09.380438 7f9285a006c0 Level-0 table #5: 109466 bytes OK
|
||||
2024/08/10-00:15:09.386532 7f9285a006c0 Delete type=0 #3
|
||||
2024/08/10-00:15:09.392760 7f9285a006c0 Manual compaction at level-0 from '!items!03BgTdeYE7TYk9LN' @ 72057594037927935 : 1 .. '!items!zYdJP3YQjsK9c3kh' @ 0 : 0; will stop at (end)
|
BIN
packs/skills-rmfrp/MANIFEST-000002
Normal file
BIN
packs/skills-rmfrp/MANIFEST-000002
Normal file
Binary file not shown.
BIN
packs/skills/000010.ldb
Normal file
BIN
packs/skills/000010.ldb
Normal file
Binary file not shown.
0
packs/skills/000029.log
Normal file
0
packs/skills/000029.log
Normal file
1
packs/skills/CURRENT
Normal file
1
packs/skills/CURRENT
Normal file
@ -0,0 +1 @@
|
||||
MANIFEST-000027
|
0
packs/skills/LOCK
Normal file
0
packs/skills/LOCK
Normal file
8
packs/skills/LOG
Normal file
8
packs/skills/LOG
Normal file
@ -0,0 +1,8 @@
|
||||
2024/08/10-00:12:37.581095 7f928cc006c0 Recovering log #25
|
||||
2024/08/10-00:12:37.591191 7f928cc006c0 Delete type=3 #23
|
||||
2024/08/10-00:12:37.591242 7f928cc006c0 Delete type=0 #25
|
||||
2024/08/10-00:13:00.458023 7f9285a006c0 Level-0 table #30: started
|
||||
2024/08/10-00:13:00.458082 7f9285a006c0 Level-0 table #30: 0 bytes OK
|
||||
2024/08/10-00:13:00.464677 7f9285a006c0 Delete type=0 #28
|
||||
2024/08/10-00:13:00.478046 7f9285a006c0 Manual compaction at level-0 from '!folders!Lr9SCthdWWHecwEI' @ 72057594037927935 : 1 .. '!items!zvdsAxlRZnL6gqms' @ 0 : 0; will stop at (end)
|
||||
2024/08/10-00:13:00.478087 7f9285a006c0 Manual compaction at level-1 from '!folders!Lr9SCthdWWHecwEI' @ 72057594037927935 : 1 .. '!items!zvdsAxlRZnL6gqms' @ 0 : 0; will stop at (end)
|
8
packs/skills/LOG.old
Normal file
8
packs/skills/LOG.old
Normal file
@ -0,0 +1,8 @@
|
||||
2024/08/10-00:09:58.191133 7f9287e006c0 Recovering log #21
|
||||
2024/08/10-00:09:58.202000 7f9287e006c0 Delete type=3 #19
|
||||
2024/08/10-00:09:58.202091 7f9287e006c0 Delete type=0 #21
|
||||
2024/08/10-00:12:27.849269 7f9285a006c0 Level-0 table #26: started
|
||||
2024/08/10-00:12:27.849334 7f9285a006c0 Level-0 table #26: 0 bytes OK
|
||||
2024/08/10-00:12:27.856159 7f9285a006c0 Delete type=0 #24
|
||||
2024/08/10-00:12:27.862891 7f9285a006c0 Manual compaction at level-0 from '!folders!Lr9SCthdWWHecwEI' @ 72057594037927935 : 1 .. '!items!zvdsAxlRZnL6gqms' @ 0 : 0; will stop at (end)
|
||||
2024/08/10-00:12:27.862915 7f9285a006c0 Manual compaction at level-1 from '!folders!Lr9SCthdWWHecwEI' @ 72057594037927935 : 1 .. '!items!zvdsAxlRZnL6gqms' @ 0 : 0; will stop at (end)
|
BIN
packs/skills/MANIFEST-000027
Normal file
BIN
packs/skills/MANIFEST-000027
Normal file
Binary file not shown.
7
rmss.css
7
rmss.css
@ -232,6 +232,10 @@
|
||||
border-bottom: 1px solid;
|
||||
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
|
||||
}
|
||||
.skills-name-left-align {
|
||||
text-align: left;
|
||||
padding-left: 2px;
|
||||
}
|
||||
.money-column {
|
||||
flex-direction: column;
|
||||
}
|
||||
@ -494,6 +498,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%;
|
||||
|
81
rmss.js
81
rmss.js
@ -19,34 +19,7 @@ import RMSSSkillSheet from "./module/sheets/skills/rmss_skill_sheet.js";
|
||||
import RMSSPlayerSheet from "./module/sheets/actors/rmss_player_sheet.js";
|
||||
import RMSSToolsSCImporter from "./module/sheets/apps/rmss_import_skill_categories.js";
|
||||
import RMSSToolsDiceRoller from "./module/sheets/apps/rmss_dice_roller.js";
|
||||
|
||||
/** Preload handlebars templates for character sheets */
|
||||
async function preloadHandlebarsTemplates() {
|
||||
const templatePaths = [
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-stats.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-fixed-info.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-armor-info.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-resistance.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-race-stat-fixed-info.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-role-traits.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-background-info.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-skill-categories.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-skills.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-fav-skills.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-items.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-weapons.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-money.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-skill-categories.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-skills.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-armor.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-herbs.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-spells.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-fav-spells.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/actors/parts/actor-fav-items.html",
|
||||
"systems/fvtt-rolemaster-frp/templates/sheets/apps/app_skill_category_importer.html"
|
||||
];
|
||||
return loadTemplates(templatePaths);
|
||||
}
|
||||
import { RFRPUtility } from "./module/rfrp-utility.js";
|
||||
|
||||
// Register Scene Controls
|
||||
// registerGetSceneControlButtonsHook();
|
||||
@ -107,48 +80,14 @@ Hooks.once("init", function () {
|
||||
// Actors
|
||||
Actors.registerSheet("fvtt-rolemaster-frp", RMSSPlayerSheet, { makeDefault: true, label: "rmss.entity_sheet.player_characrer", types: ["character"] });
|
||||
|
||||
// Preload Handlebars Templates
|
||||
console.log("rmss | Preloading Handlebars Templates");
|
||||
preloadHandlebarsTemplates();
|
||||
|
||||
// Handlebars Helpers
|
||||
Handlebars.registerHelper('count', function (list) {
|
||||
return list.length;
|
||||
})
|
||||
Handlebars.registerHelper('includes', function (array, val) {
|
||||
return array.includes(val);
|
||||
})
|
||||
Handlebars.registerHelper('upper', function (text) {
|
||||
return text.toUpperCase();
|
||||
})
|
||||
Handlebars.registerHelper('lower', function (text) {
|
||||
return text.toLowerCase()
|
||||
})
|
||||
Handlebars.registerHelper('upperFirst', function (text) {
|
||||
if (typeof text !== 'string') return text
|
||||
return text.charAt(0).toUpperCase() + text.slice(1)
|
||||
})
|
||||
Handlebars.registerHelper('notEmpty', function (list) {
|
||||
return list.length > 0;
|
||||
})
|
||||
Handlebars.registerHelper('mul', function (a, b) {
|
||||
return parseInt(a) * parseInt(b);
|
||||
})
|
||||
Handlebars.registerHelper("switch", function (value, options) {
|
||||
this.switch_value = value;
|
||||
return options.fn(this);
|
||||
});
|
||||
Handlebars.registerHelper("case", function (value, options) {
|
||||
if (value === this.switch_value) {
|
||||
return options.fn(this);
|
||||
}
|
||||
});
|
||||
// Handle v12 removal of this helper
|
||||
Handlebars.registerHelper('select', function (selected, options) {
|
||||
const escapedValue = RegExp.escape(Handlebars.escapeExpression(selected));
|
||||
const rgx = new RegExp(' value=[\"\']' + escapedValue + '[\"\']');
|
||||
const html = options.fn(this);
|
||||
return html.replace(rgx, "$& selected");
|
||||
});
|
||||
RFRPUtility.loadHandlebarsTemplates();
|
||||
RFRPUtility.loadHandlebarsHelpers();
|
||||
|
||||
});
|
||||
|
||||
Hooks.once("ready", async function () {
|
||||
console.log("rmss | Ready");
|
||||
|
||||
// Load Utility
|
||||
await RFRPUtility.ready();
|
||||
})
|
||||
|
20
system.json
20
system.json
@ -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.5.zip",
|
||||
"download": "https://www.uberwald.me/gitea/public/fvtt-rolemaster-frp/archive/v12.0.13.zip",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Cynicide",
|
||||
@ -14,7 +14,7 @@
|
||||
"email": ""
|
||||
}
|
||||
],
|
||||
"version": "12.0.5",
|
||||
"version": "12.0.13",
|
||||
"compatibility": {
|
||||
"minimum": "12",
|
||||
"verified": "12"
|
||||
@ -27,7 +27,21 @@
|
||||
"name": "skill_categories",
|
||||
"label": "Skill Categories",
|
||||
"system": "fvtt-rolemaster-frp",
|
||||
"path": "./packs/skill_categories.db",
|
||||
"path": "./packs/skill_categories",
|
||||
"type": "Item"
|
||||
},
|
||||
{
|
||||
"name": "skill-merp",
|
||||
"label": "Skills (MERP)",
|
||||
"system": "fvtt-rolemaster-frp",
|
||||
"path": "./packs/skills-merp",
|
||||
"type": "Item"
|
||||
},
|
||||
{
|
||||
"name": "skill-rmfrp",
|
||||
"label": "Skills (RMFRP)",
|
||||
"system": "fvtt-rolemaster-frp",
|
||||
"path": "./packs/skills-rmfrp",
|
||||
"type": "Item"
|
||||
}
|
||||
],
|
||||
|
@ -313,6 +313,7 @@
|
||||
"skill": {
|
||||
"templates": ["base"],
|
||||
"category" : "",
|
||||
"game_system": "common",
|
||||
"ranks": 0,
|
||||
"new_ranks": {
|
||||
"value": 0,
|
||||
@ -332,6 +333,7 @@
|
||||
"skill_category": {
|
||||
"templates": ["base"],
|
||||
"applicable_stats": "None",
|
||||
"game_system": "common",
|
||||
"app_stat_1": "None",
|
||||
"app_stat_2": "None",
|
||||
"app_stat_3": "None",
|
||||
|
@ -19,7 +19,7 @@
|
||||
{{#each skillcat as |skill_category id|}}
|
||||
<div class="skillcat-grid-container">
|
||||
|
||||
<div>{{skill_category.name}}</div>
|
||||
<div><a class="item-roll" title="Roll Check" data-item-id="{{skill_category._id}}">{{skill_category.name}}</a> <i class="fas fa-dice"></i></div>
|
||||
<div>{{skill_category.system.applicable_stats}}</div>
|
||||
<div>{{skill_category.system.development_cost}}</div>
|
||||
<div>{{skill_category.system.ranks}}</div>
|
||||
@ -40,7 +40,6 @@
|
||||
<div class="skillcat-icons">
|
||||
<a class="item-edit" title="Edit Category" data-item-id="{{skill_category._id}}"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-delete item" title="Delete Category" data-item-id="{{skill_category._id}}"><i class="fas fa-trash"></i></a>
|
||||
<a class="item-roll" title="Roll Check" data-item-id="{{skill_category._id}}"><i class="fas fa-dice"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
<div><a class="skill-favorite" data-item-id="{{skill._id}}"><i class="fa-regular fa-square"></i></a></div>
|
||||
{{/if}}
|
||||
<!--<div><input type="checkbox" name="system.favorite" {{checked skill.system.favorite}}/></div>-->
|
||||
<div>{{skill.name}}</div>
|
||||
<div class="skills-name-left-align"><a class="item-roll" title="Roll Check" data-item-id="{{skill_category._id}}">{{skill.name}}<i class="fas fa-dice"></i></a></div>
|
||||
<div>{{skill.system.ranks}}</div>
|
||||
<div>
|
||||
{{#switch skill.system.new_ranks.value}}
|
||||
@ -41,7 +41,6 @@
|
||||
<div >
|
||||
<a class="item-edit" title="Edit Skill" data-item-id="{{skill._id}}"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-delete" title="Delete Skill" data-item-id="{{skill._id}}"><i class="fas fa-trash"></i></a>
|
||||
<a class="item-roll" title="Roll Check" data-item-id="{{skill._id}}"><i class="fas fa-dice"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1,17 +1,25 @@
|
||||
<form>
|
||||
<div>
|
||||
<h3>Import Skill Categories</h3>
|
||||
|
||||
<h3>Import Skill Categories/Skills</h3>
|
||||
<div>
|
||||
WARNING: This will erase your existing Skill Categories and import all Skill Categories from the selected Compendium.
|
||||
WARNING: This will erase your existing Skill Categories or Skills and import all Skill Categories/Skills from the selected Compendium.
|
||||
</div>
|
||||
<div>
|
||||
Select Compendium:
|
||||
<select name="selectOptions" class="compendium-selector" value="None" itemid="blah">
|
||||
<div class="flexrow">
|
||||
<span >Select Skill Categories Compendium:</span>
|
||||
<select name="selectOptionsCategories" class="compendium-selector" value="None" itemid="blah">
|
||||
{{selectOptions selectOptions}}
|
||||
</select></div>
|
||||
<div>
|
||||
<button class="import-skillcats" title="Import">Import</button>
|
||||
</select>
|
||||
<button class="import-skillcats" value="skill_category" name="skill_category" title="Import">Import Skill Categories</button>
|
||||
</div>
|
||||
|
||||
<div class="flexrow">
|
||||
<span>Select Skills Compendium:</span>
|
||||
<select name="selectOptionsSkills" class="compendium-selector" value="None" itemid="blah">
|
||||
{{selectOptions selectOptions}}
|
||||
</select>
|
||||
<button class="import-skills" value="skill" name="skill" title="Import">Import Skills</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
@ -4,12 +4,19 @@
|
||||
<h1><input name="name" type="text" value="{{item.name}}" placeholder="{{ localize 'Name' }}"/></h1>
|
||||
</header>
|
||||
<div class="sheet-content">
|
||||
<div>Rank Bonus Progression
|
||||
<select name="system.bonus_progression" value="{{system.bonus_progression}}" itemid="{{ item._id }}">
|
||||
{{selectOptions config.rankBonusProgressionList selected=system.bonus_progression valueAttr="key" labelAttr="label"}}
|
||||
</select>
|
||||
<div class="flexrow">
|
||||
<div>Rank Bonus Progression
|
||||
<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 class="applicable-stats-grid-container">
|
||||
<div>
|
||||
Applicable Stat 1
|
||||
<select name="system.app_stat_1" class="app-stat-selector" value="{{system.app_stat_1}}" itemid="{{ item._id }}">
|
||||
|
@ -4,15 +4,22 @@
|
||||
<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>
|
||||
<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>
|
||||
Skill Category
|
||||
<select name="system.category" class="app-stat-selector" value="{{system.category}}" itemid="{{ item._id }}">
|
||||
{{selectOptions owned_skillcats selected=selected_skillcat }}
|
||||
<select name="system.category" class="app-stat-selector" value="{{system.category}}">
|
||||
{{selectOptions owned_skillcats selected=selected_skillcat nameAttr="name" valueAttr="name" labelAttr="name"}}
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
|
Reference in New Issue
Block a user