11 Commits

40 changed files with 141 additions and 45 deletions

View File

@ -45,4 +45,9 @@
font-weight: bold; font-weight: bold;
border-bottom: 1px solid; border-bottom: 1px solid;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0); background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
}
.skills-name-left-align {
text-align: left;
padding-left: 2px;
} }

View File

@ -14,8 +14,14 @@ export class RFRPUtility {
const skillCategories = await RFRPUtility.loadCompendium("fvtt-rolemaster-frp.skill_categories") 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); 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 getGameSystem() {
return this.gameSystem;
}
/* -------------------------------------------- */ /* -------------------------------------------- */
static getSkillCategories() { static getSkillCategories() {
return this.skillCategories return this.skillCategories

View File

@ -251,7 +251,9 @@ export default class RMSSPlayerSheet extends ActorSheet {
let selectOptions = {}; let selectOptions = {};
for (const pack of game.packs) { 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); new game.rmss.applications.RMSSToolsSCImporter(selectOptions, this.actor).render(true);
}); });

View File

@ -1,3 +1,5 @@
import { RFRPUtility } from "../../rfrp-utility.js";
export default class RMSSToolsSCImporter extends FormApplication { export default class RMSSToolsSCImporter extends FormApplication {
constructor(selectOptions, character) { constructor(selectOptions, character) {
@ -27,24 +29,28 @@ export default class RMSSToolsSCImporter extends FormApplication {
} }
async _updateObject(event, formData) { 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) { for (const item of this.character.items) {
if (item.type === "skill_category") { if (item.type === itemType) {
item.delete(); 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(); const skillCategoryData = await pack.getIndex();
console.log("Importing New Skill Categories."); console.log("Importing New Skills/Skill Categories.");
let gameSystem = RFRPUtility.getGameSystem();
for (const sc of skillCategoryData) { for (const sc of skillCategoryData) {
const newitem = await pack.getDocument(sc._id); const newitem = await pack.getDocument(sc._id);
let newDocuments = []; let newDocuments = [];
if (newitem.type === "skill_category") { if (newitem.type === itemType && (newitem.system.game_system === "common" || newitem.system.game_system === gameSystem)) {
console.log(newitem); //console.log(newitem);
newDocuments.push(newitem); newDocuments.push(newitem);
} }
if (newDocuments.length > 0) { if (newDocuments.length > 0) {

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
MANIFEST-000068 MANIFEST-000129

View File

@ -1,8 +1,8 @@
2024/08/07-17:16:18.797577 7f33982006c0 Recovering log #66 2024/08/10-00:24:43.914226 7f928cc006c0 Recovering log #127
2024/08/07-17:16:18.808374 7f33982006c0 Delete type=3 #64 2024/08/10-00:24:43.924061 7f928cc006c0 Delete type=3 #125
2024/08/07-17:16:18.808471 7f33982006c0 Delete type=0 #66 2024/08/10-00:24:43.924114 7f928cc006c0 Delete type=0 #127
2024/08/07-17:26:53.698667 7f33978006c0 Level-0 table #71: started 2024/08/10-00:25:55.309370 7f9285a006c0 Level-0 table #132: started
2024/08/07-17:26:53.698733 7f33978006c0 Level-0 table #71: 0 bytes OK 2024/08/10-00:25:55.309406 7f9285a006c0 Level-0 table #132: 0 bytes OK
2024/08/07-17:26:53.705983 7f33978006c0 Delete type=0 #69 2024/08/10-00:25:55.315743 7f9285a006c0 Delete type=0 #130
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/10-00:25:55.337699 7f9285a006c0 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) 2024/08/10-00:25:55.337766 7f9285a006c0 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/07-16:51:16.599301 7f33996006c0 Recovering log #62 2024/08/10-00:20:42.417666 7f9287e006c0 Recovering log #123
2024/08/07-16:51:16.610580 7f33996006c0 Delete type=3 #60 2024/08/10-00:20:42.428409 7f9287e006c0 Delete type=3 #121
2024/08/07-16:51:16.610673 7f33996006c0 Delete type=0 #62 2024/08/10-00:20:42.428461 7f9287e006c0 Delete type=0 #123
2024/08/07-17:16:03.322418 7f33978006c0 Level-0 table #67: started 2024/08/10-00:24:00.419073 7f9285a006c0 Level-0 table #128: started
2024/08/07-17:16:03.322491 7f33978006c0 Level-0 table #67: 0 bytes OK 2024/08/10-00:24:00.419133 7f9285a006c0 Level-0 table #128: 0 bytes OK
2024/08/07-17:16:03.329046 7f33978006c0 Delete type=0 #65 2024/08/10-00:24:00.425273 7f9285a006c0 Delete type=0 #126
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/10-00:24:00.455588 7f9285a006c0 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) 2024/08/10-00:24:00.455633 7f9285a006c0 Manual compaction at level-1 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end)

Binary file not shown.

Binary file not shown.

View File

View File

@ -0,0 +1 @@
MANIFEST-000010

0
packs/skills-merp/LOCK Normal file
View File

8
packs/skills-merp/LOG Normal file
View File

@ -0,0 +1,8 @@
2024/08/10-00:18:04.261355 7f92874006c0 Recovering log #8
2024/08/10-00:18:04.271365 7f92874006c0 Delete type=3 #6
2024/08/10-00:18:04.271415 7f92874006c0 Delete type=0 #8
2024/08/10-00:18:22.906854 7f9285a006c0 Level-0 table #13: started
2024/08/10-00:18:22.906926 7f9285a006c0 Level-0 table #13: 0 bytes OK
2024/08/10-00:18:22.913782 7f9285a006c0 Delete type=0 #11
2024/08/10-00:18:22.934544 7f9285a006c0 Manual compaction at level-0 from '!items!5Sg9t8YQubtRoghF' @ 72057594037927935 : 1 .. '!items!zvdsAxlRZnL6gqms' @ 0 : 0; will stop at (end)
2024/08/10-00:18:22.934626 7f9285a006c0 Manual compaction at level-1 from '!items!5Sg9t8YQubtRoghF' @ 72057594037927935 : 1 .. '!items!zvdsAxlRZnL6gqms' @ 0 : 0; will stop at (end)

View File

@ -0,0 +1,8 @@
2024/08/10-00:16:16.693967 7f92874006c0 Recovering log #4
2024/08/10-00:16:16.704014 7f92874006c0 Delete type=3 #2
2024/08/10-00:16:16.704134 7f92874006c0 Delete type=0 #4
2024/08/10-00:17:37.874387 7f9285a006c0 Level-0 table #9: started
2024/08/10-00:17:37.874475 7f9285a006c0 Level-0 table #9: 0 bytes OK
2024/08/10-00:17:37.881498 7f9285a006c0 Delete type=0 #7
2024/08/10-00:17:37.894547 7f9285a006c0 Manual compaction at level-0 from '!items!5Sg9t8YQubtRoghF' @ 72057594037927935 : 1 .. '!items!zvdsAxlRZnL6gqms' @ 0 : 0; will stop at (end)
2024/08/10-00:17:37.894586 7f9285a006c0 Manual compaction at level-1 from '!items!5Sg9t8YQubtRoghF' @ 72057594037927935 : 1 .. '!items!zvdsAxlRZnL6gqms' @ 0 : 0; will stop at (end)

Binary file not shown.

Binary file not shown.

View File

View File

@ -0,0 +1 @@
MANIFEST-000010

0
packs/skills-rmfrp/LOCK Normal file
View File

8
packs/skills-rmfrp/LOG Normal file
View File

@ -0,0 +1,8 @@
2024/08/10-00:18:04.273721 7f928cc006c0 Recovering log #8
2024/08/10-00:18:04.284604 7f928cc006c0 Delete type=3 #6
2024/08/10-00:18:04.284657 7f928cc006c0 Delete type=0 #8
2024/08/10-00:18:22.934766 7f9285a006c0 Level-0 table #13: started
2024/08/10-00:18:22.934803 7f9285a006c0 Level-0 table #13: 0 bytes OK
2024/08/10-00:18:22.944819 7f9285a006c0 Delete type=0 #11
2024/08/10-00:18:22.973938 7f9285a006c0 Manual compaction at level-0 from '!items!03BgTdeYE7TYk9LN' @ 72057594037927935 : 1 .. '!items!zYdJP3YQjsK9c3kh' @ 0 : 0; will stop at (end)
2024/08/10-00:18:22.973982 7f9285a006c0 Manual compaction at level-1 from '!items!03BgTdeYE7TYk9LN' @ 72057594037927935 : 1 .. '!items!zYdJP3YQjsK9c3kh' @ 0 : 0; will stop at (end)

View File

@ -0,0 +1,8 @@
2024/08/10-00:16:16.707097 7f9287e006c0 Recovering log #4
2024/08/10-00:16:16.718136 7f9287e006c0 Delete type=3 #2
2024/08/10-00:16:16.718187 7f9287e006c0 Delete type=0 #4
2024/08/10-00:17:37.881615 7f9285a006c0 Level-0 table #9: started
2024/08/10-00:17:37.881641 7f9285a006c0 Level-0 table #9: 0 bytes OK
2024/08/10-00:17:37.888187 7f9285a006c0 Delete type=0 #7
2024/08/10-00:17:37.894563 7f9285a006c0 Manual compaction at level-0 from '!items!03BgTdeYE7TYk9LN' @ 72057594037927935 : 1 .. '!items!zYdJP3YQjsK9c3kh' @ 0 : 0; will stop at (end)
2024/08/10-00:17:37.894604 7f9285a006c0 Manual compaction at level-1 from '!items!03BgTdeYE7TYk9LN' @ 72057594037927935 : 1 .. '!items!zYdJP3YQjsK9c3kh' @ 0 : 0; will stop at (end)

Binary file not shown.

BIN
packs/skills/000010.ldb Normal file

Binary file not shown.

0
packs/skills/000037.log Normal file
View File

1
packs/skills/CURRENT Normal file
View File

@ -0,0 +1 @@
MANIFEST-000035

0
packs/skills/LOCK Normal file
View File

8
packs/skills/LOG Normal file
View File

@ -0,0 +1,8 @@
2024/08/10-00:24:43.926981 7f9286a006c0 Recovering log #33
2024/08/10-00:24:43.937803 7f9286a006c0 Delete type=3 #31
2024/08/10-00:24:43.937890 7f9286a006c0 Delete type=0 #33
2024/08/10-00:25:55.315915 7f9285a006c0 Level-0 table #38: started
2024/08/10-00:25:55.315952 7f9285a006c0 Level-0 table #38: 0 bytes OK
2024/08/10-00:25:55.322635 7f9285a006c0 Delete type=0 #36
2024/08/10-00:25:55.337719 7f9285a006c0 Manual compaction at level-0 from '!folders!Lr9SCthdWWHecwEI' @ 72057594037927935 : 1 .. '!items!zvdsAxlRZnL6gqms' @ 0 : 0; will stop at (end)
2024/08/10-00:25:55.337776 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
View File

@ -0,0 +1,8 @@
2024/08/10-00:20:42.430762 7f9286a006c0 Recovering log #29
2024/08/10-00:20:42.440202 7f9286a006c0 Delete type=3 #27
2024/08/10-00:20:42.440254 7f9286a006c0 Delete type=0 #29
2024/08/10-00:24:00.432479 7f9285a006c0 Level-0 table #34: started
2024/08/10-00:24:00.432516 7f9285a006c0 Level-0 table #34: 0 bytes OK
2024/08/10-00:24:00.438691 7f9285a006c0 Delete type=0 #32
2024/08/10-00:24:00.455614 7f9285a006c0 Manual compaction at level-0 from '!folders!Lr9SCthdWWHecwEI' @ 72057594037927935 : 1 .. '!items!zvdsAxlRZnL6gqms' @ 0 : 0; will stop at (end)
2024/08/10-00:24:00.455646 7f9285a006c0 Manual compaction at level-1 from '!folders!Lr9SCthdWWHecwEI' @ 72057594037927935 : 1 .. '!items!zvdsAxlRZnL6gqms' @ 0 : 0; will stop at (end)

Binary file not shown.

View File

@ -232,6 +232,10 @@
border-bottom: 1px solid; border-bottom: 1px solid;
background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0); background-image: linear-gradient(rgba(0, 0, 0, 0.1) 0 0);
} }
.skills-name-left-align {
text-align: left;
padding-left: 2px;
}
.money-column { .money-column {
flex-direction: column; flex-direction: column;
} }

View File

@ -3,7 +3,7 @@
"title": "Rolemaster FRP System", "title": "Rolemaster FRP System",
"description": "The Rolemaster FRP system for FoundryVTT.", "description": "The Rolemaster FRP system for FoundryVTT.",
"manifest": "https://www.uberwald.me/gitea/public/fvtt-rolemaster-frp/raw/branch/develop/system.json", "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.8.zip", "download": "https://www.uberwald.me/gitea/public/fvtt-rolemaster-frp/archive/v12.0.15.zip",
"authors": [ "authors": [
{ {
"name": "Cynicide", "name": "Cynicide",
@ -14,7 +14,7 @@
"email": "" "email": ""
} }
], ],
"version": "12.0.8", "version": "12.0.15",
"compatibility": { "compatibility": {
"minimum": "12", "minimum": "12",
"verified": "12" "verified": "12"
@ -27,7 +27,14 @@
"name": "skill_categories", "name": "skill_categories",
"label": "Skill Categories", "label": "Skill Categories",
"system": "fvtt-rolemaster-frp", "system": "fvtt-rolemaster-frp",
"path": "./packs/skill_categories.db", "path": "./packs/skill_categories",
"type": "Item"
},
{
"name": "skill",
"label": "Skills",
"system": "fvtt-rolemaster-frp",
"path": "./packs/skills",
"type": "Item" "type": "Item"
} }
], ],

View File

@ -313,6 +313,7 @@
"skill": { "skill": {
"templates": ["base"], "templates": ["base"],
"category" : "", "category" : "",
"game_system": "common",
"ranks": 0, "ranks": 0,
"new_ranks": { "new_ranks": {
"value": 0, "value": 0,

View File

@ -19,7 +19,7 @@
{{#each skillcat as |skill_category id|}} {{#each skillcat as |skill_category id|}}
<div class="skillcat-grid-container"> <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.applicable_stats}}</div>
<div>{{skill_category.system.development_cost}}</div> <div>{{skill_category.system.development_cost}}</div>
<div>{{skill_category.system.ranks}}</div> <div>{{skill_category.system.ranks}}</div>
@ -39,8 +39,7 @@
<div>{{skill_category.system.total_bonus}}</div> <div>{{skill_category.system.total_bonus}}</div>
<div class="skillcat-icons"> <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-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-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>
</div> </div>

View File

@ -22,7 +22,7 @@
<div><a class="skill-favorite" data-item-id="{{skill._id}}"><i class="fa-regular fa-square"></i></a></div> <div><a class="skill-favorite" data-item-id="{{skill._id}}"><i class="fa-regular fa-square"></i></a></div>
{{/if}} {{/if}}
<!--<div><input type="checkbox" name="system.favorite" {{checked skill.system.favorite}}/></div>--> <!--<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._id}}">{{skill.name}}<i class="fas fa-dice"></i></a></div>
<div>{{skill.system.ranks}}</div> <div>{{skill.system.ranks}}</div>
<div> <div>
{{#switch skill.system.new_ranks.value}} {{#switch skill.system.new_ranks.value}}
@ -41,7 +41,6 @@
<div > <div >
<a class="item-edit" title="Edit Skill" data-item-id="{{skill._id}}"><i class="fas fa-edit"></i></a> <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-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>
</div> </div>

View File

@ -1,17 +1,26 @@
<form> <form>
<div> <div>
<h3>Import Skill Categories</h3>
<h3>Import Skill Categories/Skills</h3>
<div> <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.
Note that the import will select only skills and categories matching the "Common" items and the selected game system.
</div> </div>
<div> <div class="flexrow">
Select Compendium: <span >Select Skill Categories Compendium:</span>
<select name="selectOptions" class="compendium-selector" value="None" itemid="blah"> <select name="selectOptionsCategories" class="compendium-selector" value="None" itemid="blah">
{{selectOptions selectOptions}} {{selectOptions selectOptions}}
</select></div> </select>
<div> <button class="import-skillcats" value="skill_category" name="skill_category" title="Import">Import Skill Categories</button>
<button class="import-skillcats" title="Import">Import</button>
</div> </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> </div>
</form> </form>

View File

@ -4,12 +4,19 @@
<h1><input name="name" type="text" value="{{item.name}}" placeholder="{{ localize 'Name' }}"/></h1> <h1><input name="name" type="text" value="{{item.name}}" placeholder="{{ localize 'Name' }}"/></h1>
</header> </header>
<div class="sheet-content"> <div class="sheet-content">
<div class="flexrow">
<div>Rank Bonus Progression <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"}} {{selectOptions config.rankBonusProgressionList selected=system.bonus_progression valueAttr="key" labelAttr="label"}}
</select> </select>
</div> </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 Skill Category
<select name="system.category" class="app-stat-selector" value="{{system.category}}"> <select name="system.category" class="app-stat-selector" value="{{system.category}}">
{{selectOptions owned_skillcats selected=selected_skillcat nameAttr="name" valueAttr="name" labelAttr="name"}} {{selectOptions owned_skillcats selected=selected_skillcat nameAttr="name" valueAttr="name" labelAttr="name"}}