Skip to content

Commit

Permalink
Merge pull request #1491 from StarWarsFoundryVTT/purchase_1477
Browse files Browse the repository at this point in the history
fix(actors): skill purchase
  • Loading branch information
wrycu authored May 8, 2024
2 parents 9e29b09 + 543410a commit ed735ee
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Re-running the importer for vehicles no longer duplicates the weapons on those vehicles
* Fix overflowing "special" field on weapons in Mandar theme
* Corrected tooltip for equipped/unequipped gear (and localized it)
* non-character actors no longer show the option to buy skill ranks

`1.809`
* Features:
Expand Down
27 changes: 19 additions & 8 deletions modules/actors/actor-sheet-ffg.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export class ActorSheetFFG extends ActorSheet {
this.sheetHeight = this.position.height;
});

new ContextMenu(html, ".skillsGrid .skill", [
let contextMenuOptions = [
{
name: game.i18n.localize("SWFFG.SkillChangeCharacteristicContextItem"),
icon: '<i class="fas fa-wrench"></i>',
Expand All @@ -290,14 +290,25 @@ export class ActorSheetFFG extends ActorSheet {
this._onRemoveSkill(li);
},
},
{
name: game.i18n.localize("SWFFG.Actors.Sheets.Purchase.SkillRank.ContextMenuText"),
icon: '<i class="fas fa-dollar"></i>',
callback: (li) => {
this._buySkillRank(li);
];

if (this.actor.type === "character") {
contextMenuOptions.push(
{
name: game.i18n.localize("SWFFG.Actors.Sheets.Purchase.SkillRank.ContextMenuText"),
icon: '<i class="fas fa-dollar"></i>',
callback: (li) => {
this._buySkillRank(li);
},
},
},
]);
);
}

new ContextMenu(
html,
".skillsGrid .skill",
contextMenuOptions,
);

new ContextMenu(html, "div.skillsHeader", [
{
Expand Down

0 comments on commit ed735ee

Please sign in to comment.