Skip to content

Commit

Permalink
Pathfinder 1e Conversion
Browse files Browse the repository at this point in the history
# Core
- An exception will no longer be generated when attempting to load a world with rolls in the log.
- If a GM asks themselves to roll, the popup will now properly appear.
- Settings for Log Level will now properly show up as a Choice Menu.

# Starfinder 1 (sfrpg)
- It is now possible to roll Save Checks

# Pathfinder 1 (pf1e)
- This system is now online and Ceus can now be used with this system.
  • Loading branch information
Imper1um authored Sep 26, 2023
2 parents e33568b + 3f4236b commit c117d7b
Show file tree
Hide file tree
Showing 27 changed files with 1,059 additions and 730 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,22 @@ jobs:
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Commit and Push Updated module.json to deploy branch
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add module.json
git commit -m "Update version in module.json"
git push origin deploy
- name: Create Pull Request to push new version back to master
uses: repo-sync/pull-request@v2
with:
source_branch: "deploy"
destination_branch: "master"
pr_title: "Deploy to Master"
pr_body: "Auto PR to update version number."
pr_label: "automerge"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 1 addition & 9 deletions Old Module.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
This file is just holding old module.json information for later.
"dnd5e",
"dnd5eJP",
"pf1",
"pf2e",
"D35E",
"sw5e",
Expand All @@ -26,14 +25,7 @@ This file is just holding old module.json information for later.
"id": "dnd5eJP",
"type": "system"
},
{
"id": "pf1",
"type": "system",
"manifest": "https://gitlab.com/foundryvtt_pathfinder1e/foundryvtt-pathfinder1/-/releases/v0.82.1/downloads/system.json",
"compatibility": {
"verified": "0.82.1"
}
},
,
{
"id": "pf2e",
"type": "system",
Expand Down
7 changes: 7 additions & 0 deletions css/pf1.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* WARNING: When mentioning any changes, all CSS must be prefixed with .game.system-pf1 in this file. If you need to edit Ceus-wide CSS, please edit ceus.css. */
/* Pathfinder 1 Specific CSS */
.game.system-pf1 .ceus.ceus-result header,
.game.system-pf1 .ceus.ceus-result .result-body .result-total,
.game.system-pf1 .ceus.ceus-result .result-body .result-breakdown {
background-color: rgba(255,255,255,0.3);
}
16 changes: 13 additions & 3 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Ceus",
"title": "Ceus - Ask For Rolls",
"description": "Want your players to roll in a specific way? Ceus asks players for specific rolls, preventing them from spending time looking for rolls.",
"version": "0.80",
"version": "0.81",
"author": "KaKaRoTo, iotech, Limping Ninja, Rughalt, Calego, VTT Lair, Imper1um",
"authors": [{
"name": "Imper1um",
Expand All @@ -14,7 +14,8 @@
],
"scripts": [],
"styles": [
"/css/ceus.css"
"/css/ceus.css",
"/css/pf1.css"
],
"minimumCoreVersion": "11",
"compatibleCoreVersion": "11",
Expand All @@ -29,10 +30,19 @@
}
],
"systems": [
"pf1",
"sf1e"
],
"relationships": {
"systems": [
{
"id": "pf1",
"type": "system",
"manifest": "https://gitlab.com/foundryvtt_pathfinder1e/foundryvtt-pathfinder1/-/releases/v0.82.1/downloads/system.json",
"compatibility": {
"verified": "0.82.1"
}
},
{
"id": "sfrpg",
"type": "system",
Expand All @@ -46,7 +56,7 @@
"socket": true,
"url": "https://github.com/Imper1um/foundry-ceus/",
"manifest": "https://github.com/Imper1um/foundry-ceus/releases/latest/download/module.json",
"download": "https://github.com/Imper1um/foundry-ceus/releases/download/v3.00/module.zip",
"download": "https://github.com/Imper1um/foundry-ceus/releases/download/0.81/module.zip",
"changelog": "https://github.com/Imper1um/foundry-ceus/releases",
"bugs": "https://github.com/Imper1um/foundry-ceus/issues"
}
106 changes: 4 additions & 102 deletions src/ceus.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ceus_SocketEngine } from "./ceus_SocketEngine.js";
import { ceus_SettingsEngine } from "./ceus_SettingsEngine.js";
import { ceus_ResultsWindow } from "./ceus_ResultsWindow.js";
import { ceus_LogEngine } from "./ceus_LogEngine.js";
import { CeusRequestor } from "./requestor.js";


export class Ceus {
Expand Down Expand Up @@ -34,7 +33,7 @@ export class Ceus {
}

async onChatMessage(app, html, data) {
Ceus.log.Trace("onChatMessage", {app, html, data});
if (Ceus.current && Ceus.current.settingsEngine) { Ceus.log.Trace("onChatMessage", {app, html, data}); } //Avoids conflicts when starting up.
if (game.user.isGM) { return; }
if (html.hasClass("sensitive") && html.hasClass("ceus")) {
html.find('.result-total').text('???');
Expand Down Expand Up @@ -87,31 +86,10 @@ export class Ceus {
}
}

onThemeChange(enabled) {
$(".ceus.ceus-requestor,.ceus.ceus-roller").toggleClass("ceus-parchment", enabled);
if (!this.requestor) { return; }
if (enabled) {
this.requestor.options.classes.push("ceus-parchment");
} else {
this.requestor.options.classes = this.requestor.options.classes.filter(c => c !== "ceus-parchment");
}
// Resize to fit the new theme
if (this.requestor.element.length) {
this.requestor.setPosition({ width: "auto", height: "auto" });
}
}

requestRoll() {
if (this.providerEngine.currentRollProvider.rollProviderType() === 'legacy') {
if (this.requestor === undefined) {
this.requestor = new CeusRequestor();
}
this.requestor.render(true);
} else if (this.providerEngine.currentRollProvider.rollProviderType() === 'refactor') {
const requestwindow = new ceus_RequestWindow();
this.requestWindows.push(requestwindow);
requestwindow.render(true);
}
const requestwindow = new ceus_RequestWindow();
this.requestWindows.push(requestwindow);
requestwindow.render(true);
}

async registerHandlebarsHelpers() {
Expand Down Expand Up @@ -212,80 +190,4 @@ export class Ceus {
static requestRoll(data) {
if (!game.user.isGM) { return; }
}

/*async onReady() {
this.providerEngine.onReady();
this.socketEngine.onReady();
if (game.settings.get('ceus', 'deselectOnRequestorRender')) {
Hooks.on("renderCeusRequestor", () => {
canvas.tokens.releaseAll();
});
}
Hooks.on('renderChatMessage', this.hideBlind);
}*/

/*
results() {
if (this.results === undefined) {
this.results = new Array();
}
return this.results;
}
addResults(newResults) {
const r = results();
r.push(newResults);
this.results = r;
}
getResults(id) {
return results.find(r => r.id == id);
}
async hideBlind(app, html, msg) {
if (msg.message.flags && msg.message.flags.ceus) {
if (msg.message.flags.ceus.blind && !game.user.isGM) {
msg.content = '<p>??</p>';
let idx = html[0].innerHTML.indexOf('<div class="message-content">');
html[0].innerHTML = html[0].innerHTML.substring(0, idx);
html[0].innerHTML += `<div class="message-content">${msg.content}</div>`;
}
}
}
fromUuid(uuid) {
let parts = uuid.split(".");
let doc;
if (parts.length === 1) return game.actors.get(uuid);
// Compendium Documents
if (parts[0] === "Compendium") {
return undefined;
}
// World Documents
else {
const [docName, docId] = parts.slice(0, 2);
parts = parts.slice(2);
const collection = CONFIG[docName].collection.instance;
doc = collection.get(docId);
}
// Embedded Documents
while (parts.length > 1) {
const [embeddedName, embeddedId] = parts.slice(0, 2);
doc = doc.getEmbeddedDocument(embeddedName, embeddedId);
parts = parts.slice(2);
}
if (doc.actor) doc = doc.actor;
return doc || undefined;
} */
}
5 changes: 5 additions & 0 deletions src/ceus_LogEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export class ceus_LogEngine {
}

Error(module, message, error = null, system = null) {
if (!Ceus.current.settingsEngine || !Ceus.current.settingsEngine.isInitialized) { return; }
if (system == null) { system = this.system; }
if (typeof message !== "string") { message = JSON.stringify(message); }
const logLevel = Ceus.current.settingsEngine.LogLevel;
Expand All @@ -41,6 +42,7 @@ export class ceus_LogEngine {
}

Warn(module, message, error = null, system = null) {
if (!Ceus.current.settingsEngine || !Ceus.current.settingsEngine.isInitialized) { return; }
if (system == null) { system = this.system; }
if (typeof message !== "string") { message = JSON.stringify(message); }
const logLevel = Ceus.current.settingsEngine.LogLevel;
Expand All @@ -60,6 +62,7 @@ export class ceus_LogEngine {
}

Info(module, message, error = null, system = null) {
if (!Ceus.current.settingsEngine || !Ceus.current.settingsEngine.isInitialized) { return; }
if (system == null) { system = this.system; }
if (typeof message !== "string") { message = JSON.stringify(message); }
const logLevel = Ceus.current.settingsEngine.LogLevel;
Expand All @@ -79,6 +82,7 @@ export class ceus_LogEngine {
}

Debug(module, message, error = null, system = null) {
if (!Ceus.current.settingsEngine || !Ceus.current.settingsEngine.isInitialized) { return; }
if (system == null) { system = this.system; }
if (typeof message !== "string") { message = JSON.stringify(message); }
const logLevel = Ceus.current.settingsEngine.LogLevel;
Expand All @@ -98,6 +102,7 @@ export class ceus_LogEngine {
}

Trace(module, message, error = null, system = null) {
if (!Ceus.current.settingsEngine || !Ceus.current.settingsEngine.isInitialized) { return; }
if (system == null) { system = this.system; }
if (typeof message !== "string") { message = JSON.stringify(message); }
const logLevel = Ceus.current.settingsEngine.LogLevel;
Expand Down
12 changes: 6 additions & 6 deletions src/ceus_ProviderEngine.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ceus_RollProvider_pf1 } from "./ceus_RollProvider_pf1.js";
import { ceus_RollProvider_sf1e } from "./ceus_RollProvider_sf1e.js";
/*import { ceus_RollProvider_pf2e } from "./ceus_RollProvider_pf2e.js";
import { ceus_RollProvider_cof } from "./ceus_RollProvider_cof.js";
import { ceus_RollProvider_coc } from "./ceus_RollProvider_coc.js";
Expand All @@ -8,13 +10,13 @@ import { ceus_RollProvider_dnd5eJP } from "./ceus_RollProvider_dnd5eJP.js";
import { ceus_RollProvider_dnd35 } from "./ceus_RollProvider_dnd35.js";
import { ceus_RollProvider_ffd20 } from "./ceus_RollProvider_ffd20.js";
import { ceus_RollProvider_ose } from "./ceus_RollProvider_ose.js";
import { ceus_RollProvider_pf1 } from "./ceus_RollProvider_pf1.js";*/
import { ceus_RollProvider_sf1e } from "./ceus_RollProvider_sf1e.js";
//import { ceus_RollProvider_sw5e } from "./ceus_RollProvider_sw5e.js";
import { ceus_RollProvider_sw5e } from "./ceus_RollProvider_sw5e.js";*/

export class ceus_ProviderEngine {
constructor() {
this.externalRollProviders = [
new ceus_RollProvider_pf1(),
new ceus_RollProvider_sf1e()
/*new ceus_RollProvider_cd(),
new ceus_RollProvider_coc(),
new ceus_RollProvider_cof(),
Expand All @@ -24,9 +26,7 @@ export class ceus_ProviderEngine {
new ceus_RollProvider_dnd35(),
new ceus_RollProvider_ffd20(),
new ceus_RollProvider_ose(),
new ceus_RollProvider_pf1(),
new ceus_RollProvider_pf2e(),*/
new ceus_RollProvider_sf1e()/*,
new ceus_RollProvider_pf2e(),
new ceus_RollProvider_sw5e()*/
];
}
Expand Down
Loading

0 comments on commit c117d7b

Please sign in to comment.