Compare commits
10 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 211b9b3135 | |||
| 8cadd8318b | |||
| 849da4bb54 | |||
| 500eabc755 | |||
| b36fe27182 | |||
| 9177b7cc2d | |||
| 288f3a54b5 | |||
| dddad7f55d | |||
| a34525f05e | |||
| 786cb7f5ec |
14 changed files with 165 additions and 18 deletions
|
|
@ -43,7 +43,6 @@ jobs:
|
|||
run: node scripts/src/createForgejoRelease.mjs
|
||||
env:
|
||||
TAG: "v${{steps.version.outputs.version}}"
|
||||
CDN_URL: "${{vars.CDN_URL}}"
|
||||
|
||||
wiki-release-artifact:
|
||||
name: "Add Wiki to Release"
|
||||
|
|
@ -65,10 +64,10 @@ jobs:
|
|||
token: ${{forgejo.token}}
|
||||
|
||||
- name: "Install dependencies"
|
||||
run: "pwd; npm i"
|
||||
run: "npm i"
|
||||
|
||||
- name: "Remove development folders"
|
||||
run: "rm -rf .git .vscode"
|
||||
- name: "Remove development/web folders"
|
||||
run: "rm -rf .git .vscode _*"
|
||||
working-directory: "wiki"
|
||||
|
||||
- name: "Compress wiki folder"
|
||||
|
|
|
|||
1
dev/dev.mjs
Normal file
1
dev/dev.mjs
Normal file
|
|
@ -0,0 +1 @@
|
|||
import "./hooks/renderSettings.mjs";
|
||||
5
dev/hooks/renderSettings.mjs
Normal file
5
dev/hooks/renderSettings.mjs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
Hooks.on(`renderSettings`, (app, html, ctx, options) => {
|
||||
/** @type {HTMLElement|undefined} */
|
||||
const coreUpdateTooltip = html.querySelector(`.build .value a`);
|
||||
coreUpdateTooltip?.remove();
|
||||
});
|
||||
|
|
@ -67,6 +67,11 @@
|
|||
"macro-is-in-use": "The Macro is used by {count} items/attributes in the world or Actors, the items will lose their ability to use the macro.",
|
||||
"roll": "Roll",
|
||||
"use": "Use",
|
||||
"version": "Version {version}",
|
||||
"whats-new": "What's New",
|
||||
"releases": "Releases",
|
||||
"wiki": "Wiki",
|
||||
"issues": "Issues",
|
||||
"item": {
|
||||
"weight": "Weight",
|
||||
"quantity": "Quantity",
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { __ID__, filePath } from "../consts.mjs";
|
||||
import { deleteItemFromElement, editItemFromElement } from "./utils.mjs";
|
||||
import { createContextMenuOption, deleteItemFromElement, editItemFromElement } from "./utils.mjs";
|
||||
import { config } from "../config.mjs";
|
||||
import { Logger } from "../utils/Logger.mjs";
|
||||
import { TAFDocumentSheetConfig } from "./TAFDocumentSheetConfig.mjs";
|
||||
import { TAFDocumentSheetConfig } from "./overrides/TAFDocumentSheetConfig.mjs";
|
||||
import { TAFDocumentSheetMixin } from "./mixins/TAFDocumentSheetMixin.mjs";
|
||||
import { TAFActor } from "../documents/Actor.mjs";
|
||||
|
||||
|
|
@ -226,24 +226,24 @@ export class PlayerSheet extends
|
|||
this.element,
|
||||
`[data-item-uuid]`,
|
||||
[
|
||||
{
|
||||
createContextMenuOption({
|
||||
label: _loc(`taf.misc.edit`),
|
||||
condition: (el) => {
|
||||
visible: (el) => {
|
||||
const itemUuid = el.dataset.itemUuid;
|
||||
const itemExists = itemUuid != null && itemUuid !== ``;
|
||||
return this.isEditable && itemExists;
|
||||
},
|
||||
onClick: editItemFromElement,
|
||||
},
|
||||
{
|
||||
}),
|
||||
createContextMenuOption({
|
||||
label: _loc(`taf.misc.delete`),
|
||||
condition: (el) => {
|
||||
visible: (el) => {
|
||||
const itemUuid = el.dataset.itemUuid;
|
||||
const itemExists = itemUuid != null && itemUuid !== ``;
|
||||
return this.isEditable && itemExists;
|
||||
},
|
||||
onClick: deleteItemFromElement,
|
||||
},
|
||||
}),
|
||||
],
|
||||
{ jQuery: false, fixed: true },
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { __ID__, filePath } from "../consts.mjs";
|
||||
import { getDefaultSizing } from "../utils/getSizing.mjs";
|
||||
import { localizer } from "../utils/localizer.mjs";
|
||||
import { __ID__, filePath } from "../../consts.mjs";
|
||||
import { getDefaultSizing } from "../../utils/getSizing.mjs";
|
||||
import { localizer } from "../../utils/localizer.mjs";
|
||||
|
||||
const { diffObject, expandObject, flattenObject } = foundry.utils;
|
||||
const { DocumentSheetConfig } = foundry.applications.apps;
|
||||
30
module/apps/overrides/TAFSettingsSidebar.mjs
Normal file
30
module/apps/overrides/TAFSettingsSidebar.mjs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import { filePath } from "../../consts.mjs";
|
||||
|
||||
const { renderTemplate } = foundry.applications.handlebars;
|
||||
const { Settings } = foundry.applications.sidebar.tabs;
|
||||
|
||||
export class TAFSettingsSidebar extends Settings {
|
||||
// #region Lifecycle
|
||||
async _onRender() {
|
||||
// remove the row from the HTML
|
||||
const systemRow = this.element.querySelector(`.info .system`);
|
||||
systemRow?.remove();
|
||||
|
||||
// add the more customized system info into the sidebar
|
||||
const systemBlock = this.element.querySelector(`section.system`);
|
||||
if (!systemBlock) {
|
||||
const htmlString = await renderTemplate(
|
||||
filePath(`templates/settings-sidebar-addition.hbs`),
|
||||
{ system: game.system, },
|
||||
);
|
||||
|
||||
const temp = document.createElement(`div`);
|
||||
temp.innerHTML = htmlString;
|
||||
const rendered = temp.firstChild;
|
||||
|
||||
const info = this.element.querySelector(`section.info`);
|
||||
info.insertAdjacentElement(`afterend`, rendered);
|
||||
};
|
||||
};
|
||||
// #endregion Lifecycle
|
||||
};
|
||||
|
|
@ -3,6 +3,25 @@ This file contains utility methods used by Applications in order to be
|
|||
DRYer
|
||||
*/
|
||||
|
||||
/**
|
||||
* A helper function that takes a v14-compatible ContextMenuEntry option
|
||||
* and adjusts it for v13 if required
|
||||
*
|
||||
* @param {ContextMenuEntry} option The v14+ compatible menu entry option
|
||||
* @returns {ContextMenuEntry} The v14+ or <v13 menu option object
|
||||
*/
|
||||
export function createContextMenuOption(option) {
|
||||
if (game.release.generation < 14) {
|
||||
return {
|
||||
name: option.label,
|
||||
condition: option.visible,
|
||||
callback: (target) => option.onClick(null, target),
|
||||
};
|
||||
};
|
||||
|
||||
return option;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Event} _event The click event
|
||||
* @param {HTMLElement} target The element to operate on
|
||||
|
|
|
|||
|
|
@ -130,8 +130,11 @@ export class TAFActor extends Actor {
|
|||
* This checks and performs all data migrations that the system requires, some
|
||||
* of these are one-time only migrations, others of them will happen every time
|
||||
* an Actor is updated.
|
||||
*
|
||||
* The defaulting of options is provided to ensure that the migration doesn't
|
||||
* cause errors in Foundry v13
|
||||
*/
|
||||
static migrateData(data, options) {
|
||||
static migrateData(data, options = {}) {
|
||||
this.#migrateToAttributeItems(data, options);
|
||||
return super.migrateData(data, options);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import helpers from "../handlebarsHelpers/_index.mjs";
|
|||
import { Logger } from "../utils/Logger.mjs";
|
||||
import { registerCustomComponents } from "../apps/elements/_index.mjs";
|
||||
import { registerSockets } from "../sockets/_index.mjs";
|
||||
import { TAFSettingsSidebar } from "../apps/overrides/TAFSettingsSidebar.mjs";
|
||||
|
||||
Hooks.on(`init`, () => {
|
||||
Logger.debug(`Initializing`);
|
||||
|
|
@ -44,6 +45,10 @@ Hooks.on(`init`, () => {
|
|||
CONFIG.Item.dataModels.attribute = AttributeItemData;
|
||||
// #endregion Data Models
|
||||
|
||||
// #region App Overrides
|
||||
CONFIG.ui.settings = TAFSettingsSidebar;
|
||||
// #endregion App Overrides
|
||||
|
||||
// #region Sheets
|
||||
foundry.documents.collections.Actors.registerSheet(
|
||||
__ID__,
|
||||
|
|
|
|||
29
styles/Apps/TAFSettingsSidebar.css
Normal file
29
styles/Apps/TAFSettingsSidebar.css
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#settings > .system {
|
||||
.version-info {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
gap: 8px;
|
||||
|
||||
.whats-new {
|
||||
font-size: smaller;
|
||||
}
|
||||
}
|
||||
|
||||
.links {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
li {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -31,3 +31,4 @@
|
|||
@import url("./Apps/PlayerSheet.css") layer(apps);
|
||||
@import url("./Apps/QueryStatus.css") layer(apps);
|
||||
@import url("./Apps/TAFDocumentSheetConfig.css") layer(apps);
|
||||
@import url("./Apps/TAFSettingsSidebar.css") layer(apps);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"id": "taf",
|
||||
"title": "Text-Based Actors",
|
||||
"description": "An intentionally minimalist system that enables you to play rules-light games without getting in your way!",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.2",
|
||||
"download": "",
|
||||
"manifest": "",
|
||||
"url": "https://git.varify.ca/Foundry/taf",
|
||||
|
|
@ -15,7 +15,8 @@
|
|||
{ "name": "Oliver" }
|
||||
],
|
||||
"esmodules": [
|
||||
"module/main.mjs"
|
||||
"module/main.mjs",
|
||||
"dev/dev.mjs"
|
||||
],
|
||||
"styles": [
|
||||
{
|
||||
|
|
@ -54,6 +55,7 @@
|
|||
},
|
||||
"socket": true,
|
||||
"flags": {
|
||||
"forgejo_api": "https://git.varify.ca/api/v1",
|
||||
"hotReload": {
|
||||
"extensions": ["css", "hbs", "json", "js", "mjs", "svg"],
|
||||
"paths": ["templates", "langs", "styles", "module", "assets"]
|
||||
|
|
|
|||
48
templates/settings-sidebar-addition.hbs
Normal file
48
templates/settings-sidebar-addition.hbs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<section class="system flexcol">
|
||||
<h4 class="divider">
|
||||
{{ system.title }}
|
||||
</h4>
|
||||
<div class="version-info">
|
||||
<span class="version">
|
||||
{{localize "taf.misc.version" version=system.version}}
|
||||
</span>
|
||||
<a
|
||||
href="{{ system.url }}/releases/tag/v{{ system.version }}"
|
||||
class="whats-new"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
style="font-size: smaller"
|
||||
>
|
||||
{{localize "taf.misc.whats-new"}}
|
||||
</a>
|
||||
</div>
|
||||
<ul class="links">
|
||||
<li>
|
||||
<a
|
||||
href="{{ system.url }}/releases"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
{{localize "taf.misc.releases"}}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="{{ system.url }}/wiki"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
{{localize "taf.misc.wiki"}}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="{{ system.url }}/issues"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
{{localize "taf.misc.issues"}}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
Loading…
Add table
Add a link
Reference in a new issue