Skip to content

Commit

Permalink
Merge pull request #337 from mrkwnzl/develop
Browse files Browse the repository at this point in the history
Update v2.10.2
  • Loading branch information
mrkwnzl committed Oct 1, 2023
2 parents e300c7c + 444797e commit bdd75c4
Show file tree
Hide file tree
Showing 45 changed files with 181 additions and 97 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.10.2] - 2023-10-01
### Changed
- The welcome message is shown only once. Enabling the setting now only shows the welcome message the next time the world is loaded by the GM, and is then automatically disabled again.
- Actor and item sheets can finally be resized. Note that there’s a minimum height of 575 px and width of 650 px in order to keep the formatting intact. Note also that using the TinyMCE editor results in undesired behavior when resizing the sheets while editing.
- The All-in-One Roll dialog is now styled using the system’s sheet customization settings.

### Fixed
- Empty cost fields for abilities will no longer result in NaN errors in the chat output of die rolls.
- Most numerical fields in item sheets are now being auto-populated with the value “0” if they are submitted empty.

## [2.10.1] - 2023-09-24
### Fixed
- Hotfix for broken download link.
Expand Down
36 changes: 32 additions & 4 deletions css/cyphersystem.css
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,21 @@ li.folder.collapsed>.folder-header h3 {

/* until here */

.cyphersystem.sheet.pc,
.cyphersystem.sheet.npc,
.cyphersystem.sheet.companion,
.cyphersystem.sheet.community,
.cyphersystem.sheet.token,
.cyphersystem.sheet.vehicle {
min-width: 650px;
min-height: 550px;
}

.cyphersystem.sheet.item {
min-width: 575px;
min-height: 550px;
}

.cyphersystem .editor-content {
padding: 0.3em !important;
line-height: 1.4;
Expand All @@ -339,6 +354,10 @@ li.folder.collapsed>.folder-header h3 {
--color-hover-bg: rgb(0, 0, 0, 0.15);
}

.cyphersystem .prosemirror .editor-container {
margin: 0;
}

.cyphersystem .ProseMirror menu .pm-dropdown ul {
background: #DDD;
}
Expand Down Expand Up @@ -408,6 +427,7 @@ li.folder.collapsed>.folder-header h3 {
.cyphersystem .background-image {
margin: -8px;
padding: 8px;
height: 100%;
}

.cyphersystem .background-image.paper {
Expand Down Expand Up @@ -451,6 +471,7 @@ li.folder.collapsed>.folder-header h3 {

.cyphersystem .background-image.cypher-blue {
background-image: linear-gradient(rgb(203, 203, 218), white) !important;
background-size: cover;
}

.cyphersystem .background-image.custom {
Expand Down Expand Up @@ -550,6 +571,7 @@ li.folder.collapsed>.folder-header h3 {
flex: 0 0 100px;
height: 115px;
width: 115px;
min-width: 115px;
margin-right: 5px;
border: 1px solid rgb(0, 0, 0, 0);
border-radius: 3px;
Expand Down Expand Up @@ -624,6 +646,11 @@ li.folder.collapsed>.folder-header h3 {
z-index: 0;
}

.cyphersystem .sheet-body {
height: 100%;
overflow-y: auto;
}

.cyphersystem.gmi-form {
border: 1px solid var(--color-border-dark-1);
backdrop-filter: blur(5px);
Expand Down Expand Up @@ -682,18 +709,18 @@ li.folder.collapsed>.folder-header h3 {
.cyphersystem .sheet-body .tab {
border: 1px solid #999;
border-top: none;
height: 456px;
height: 100%;
overflow-y: auto;
}

.cyphersystem .sheet-body .editor {
height: 456px;
height: 100%;
margin-top: 0px
}

.cyphersystem .sheet-body.limited .tab,
.cyphersystem .sheet-body.limited .editor {
height: 549px;
height: 100%;
}

.cyphersystem .resource-label {
Expand Down Expand Up @@ -740,7 +767,6 @@ li.folder.collapsed>.folder-header h3 {
list-style: none;
margin: 7px 0;
padding: 0 5px;
overflow-y: auto;
}

.cyphersystem .items-list.gmi-list {
Expand Down Expand Up @@ -1243,11 +1269,13 @@ select.settings-input {
.cyphersystem .dice-tray.right {
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
left: 100%;
}

.cyphersystem .dice-tray.left {
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
left: -32px;
}

.cyphersystem .dice-tray-hidden {
Expand Down
4 changes: 2 additions & 2 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"CYPHERSYSTEM.SettingShowRollDetails": "Show Roll Details",
"CYPHERSYSTEM.SettingShowRollDetailsHint": "Enable this setting to show all roll details by default.",
"CYPHERSYSTEM.SettingShowWelcome": "Show Welcome Message",
"CYPHERSYSTEM.SettingShowWelcomeHint": "Show the welcome message at every launch of this world.",
"CYPHERSYSTEM.SettingShowWelcomeHint": "Show the welcome message at the next launch of this world.",
"CYPHERSYSTEM.SettingRollButtons": "Roll Buttons on Character Sheets",
"CYPHERSYSTEM.SettingRollButtonsHint": "This enables roll buttons on all character sheets.",
"CYPHERSYSTEM.SettingDiceTray": "Dice Tray",
Expand Down Expand Up @@ -634,7 +634,7 @@
"CYPHERSYSTEM.MultiRollValueChanged": "Value changed due to multi roll action in progress.",
"CYPHERSYSTEM.MultiRollInProgress": "Multi roll action in progress. Click to cancel.",
"CYPHERSYSTEM.SheetEditor": "Sheet Editor",
"CYPHERSYSTEM.SheetEditorHint": "Select which editor is used on actor and item sheets.",
"CYPHERSYSTEM.SheetEditorHint": "Select which editor is used on actor and item sheets. Note that using TinyMCE might result in undesired behavior when resizing a window while in editing mode.",
"CYPHERSYSTEM.CopyAs": "Copy as…",
"CYPHERSYSTEM.ItemCreatedAsSkill": "{item} has been copied as a skill.",
"CYPHERSYSTEM.ItemCreatedAsAttack": "{item} has been copied as an attack.",
Expand Down
4 changes: 2 additions & 2 deletions module/actor/community-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export class CypherActorSheetCommunity extends CypherActorSheet {
classes: ["cyphersystem", "sheet", "actor", "community"],
template: "systems/cyphersystem/templates/actor-sheets/community-sheet.html",
width: 650,
height: false,
resizable: false,
height: 700,
resizable: true,
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body"}],
scrollY: [".sheet-body", ".tab", ".skills", ".description", ".combat", ".items", ".abilities", ".settings", ".editor-content"]
});
Expand Down
4 changes: 2 additions & 2 deletions module/actor/companion-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export class CypherActorSheetCompanion extends CypherActorSheet {
classes: ["cyphersystem", "sheet", "actor", "companion"],
template: "systems/cyphersystem/templates/actor-sheets/companion-sheet.html",
width: 650,
height: false,
resizable: false,
height: 700,
resizable: true,
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body"}],
scrollY: [".sheet-body", ".tab", ".skills", ".description", ".settings", ".items", ".editor-content"]
});
Expand Down
4 changes: 2 additions & 2 deletions module/actor/marker-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export class CypherActorSheetMarker extends CypherActorSheet {
classes: ["cyphersystem", "sheet", "actor", "token"],
template: "systems/cyphersystem/templates/actor-sheets/marker-sheet.html",
width: 650,
height: false,
resizable: false,
height: 700,
resizable: true,
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body"}],
scrollY: [".sheet-body", ".tab", ".skills", ".description", ".items", ".settings", ".editor-content"]
});
Expand Down
4 changes: 2 additions & 2 deletions module/actor/npc-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export class CypherActorSheetNPC extends CypherActorSheet {
classes: ["cyphersystem", "sheet", "actor", "npc"],
template: "systems/cyphersystem/templates/actor-sheets/npc-sheet.html",
width: 650,
height: false,
resizable: false,
height: 700,
resizable: true,
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body"}],
scrollY: [".sheet-body", ".tab", ".description", ".settings", ".items", ".editor-content"]
});
Expand Down
10 changes: 7 additions & 3 deletions module/actor/pc-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ import {disableMultiRoll} from "../forms/roll-engine-dialog-sheet.js";

export class CypherActorSheetPC extends CypherActorSheet {

// Reposition dice tray
_onResize(event) {
super._onResize(event);
};

/** @override */
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["cyphersystem", "sheet", "actor", "pc"],
template: "systems/cyphersystem/templates/actor-sheets/pc-sheet.html",
width: 650,
height: false,
resizable: false,
height: 750,
resizable: true,
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body"}],
scrollY: [".sheet-body", ".tab", ".skills", ".description", ".combat", ".items", ".abilities", ".settings", ".tags", ".editor-content"]
});
Expand All @@ -45,7 +50,6 @@ export class CypherActorSheetPC extends CypherActorSheet {
data.sheetSettings.isExclusiveTagActive = isExclusiveTagActive(this.actor);
const diceTraySettings = ["hidden", "left", "right"];
data.sheetSettings.diceTray = diceTraySettings[game.settings.get("cyphersystem", "diceTray")];
data.sheetSettings.sheetWidth = (data.sheetSettings.diceTray == "right") ? this.actor.sheet.options.width : -32;

data.sheetSettings.disabledStaticStats = (this.actor.getFlag("cyphersystem", "disabledStaticStats") || this.actor.getFlag("cyphersystem", "multiRoll.active")) ? "disabled" : "";

Expand Down
4 changes: 2 additions & 2 deletions module/actor/vehicle-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export class CypherActorSheetVehicle extends CypherActorSheet {
classes: ["cyphersystem", "sheet", "actor", "vehicle"],
template: "systems/cyphersystem/templates/actor-sheets/vehicle-sheet.html",
width: 650,
height: false,
resizable: false,
height: 700,
resizable: true,
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body"}],
scrollY: [".sheet-body", ".tab", ".description", ".items", ".settings", ".editor-content"]
});
Expand Down
9 changes: 9 additions & 0 deletions module/forms/roll-engine-dialog-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import {rollEngineComputation} from "../utilities/roll-engine/roll-engine-computation.js";
import {useEffectiveDifficulty} from "../utilities/roll-engine/roll-engine-main.js";
import {getBackgroundImage, getBackgroundImageOverlayOpacity, getBackgroundImagePath} from "./sheet-customization.js";

export class RollEngineDialogSheet extends FormApplication {
/** @override */
Expand Down Expand Up @@ -94,6 +95,14 @@ export class RollEngineDialogSheet extends FormApplication {
data.multiRollSpeedEdge = (actor.getFlag("cyphersystem", "multiRoll.active") === true && actor.getFlag("cyphersystem", "multiRoll.modifiers.speed.edge") != 0) ? "multi-roll-active" : "";
data.multiRollIntellectEdge = (actor.getFlag("cyphersystem", "multiRoll.active") === true && actor.getFlag("cyphersystem", "multiRoll.modifiers.intellect.edge") != 0) ? "multi-roll-active" : "";

data.sheetSettings = {};
data.sheetSettings.backgroundImageBaseSetting = "background-image";
data.sheetSettings.backgroundImage = getBackgroundImage();
if (data.sheetSettings.backgroundImage == "custom") {
data.sheetSettings.backgroundImagePath = "/" + getBackgroundImagePath();
data.sheetSettings.backgroundOverlayOpacity = getBackgroundImageOverlayOpacity();
}

// Return data
return data;
}
Expand Down
2 changes: 1 addition & 1 deletion module/forms/sheet-customization.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class SheetCustomization extends FormApplication {

async function rerenderAllActorWindows() {
for (let window of Object.values(ui.windows)) {
if (window instanceof CypherActorSheet || window instanceof CypherItemSheet) {
if (window instanceof CypherActorSheet || window instanceof CypherItemSheet || window instanceof FormApplication) {
window.render(false);
}
}
Expand Down
37 changes: 36 additions & 1 deletion module/item/item-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export class CypherItemSheet extends ItemSheet {
return foundry.utils.mergeObject(super.defaultOptions, {
classes: ["cyphersystem", "sheet", "item", "item-sheet"],
width: 575,
resizable: false,
height: 675,
resizable: true,
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}],
scrollY: [".sheet-body", ".tab"]
});
Expand All @@ -33,6 +34,34 @@ export class CypherItemSheet extends ItemSheet {
async getData() {
const data = await super.getData();

// Fallback for empty input fields
if (["skill", "ability", "attack"].includes(this.item.type)) {
if (!this.item.system.basic?.cost) {
this.item.update({"system.basic.cost": 0});
}
if (!this.item.system.basic?.damage) {
this.item.update({"system.basic.damage": 0});
}
if (!this.item.system.basic?.steps) {
this.item.update({"system.basic.steps": 0});
}
if (!this.item.system.settings?.rollButton?.additionalCost) {
this.item.update({"system.settings.rollButton.additionalCost": 0});
}
if (!this.item.system.settings?.rollButton?.bonus) {
this.item.update({"system.settings.rollButton.bonus": 0});
}
if (!this.item.system.settings?.rollButton?.additionalSteps) {
this.item.update({"system.settings.rollButton.additionalSteps": 0});
}
if (!this.item.system.settings?.rollButton?.damage) {
this.item.update({"system.settings.rollButton.damage": 0});
}
if (!this.item.system.settings?.rollButton?.damagePerLOE) {
this.item.update({"system.settings.rollButton.damagePerLOE": 0});
}
}

// Sheet settings
data.sheetSettings = {};
data.sheetSettings.isGM = game.user.isGM;
Expand Down Expand Up @@ -83,6 +112,12 @@ export class CypherItemSheet extends ItemSheet {
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;

// html.find("input[name='system.basic.cost']").change(changeEvent => {
// if ($(changeEvent.currentTarget.value) == "") {
// $(changeEvent.currentTarget.value) = 0;
// }
// });

html.find('.identify-item').click(clickEvent => {
if (this.item.system.basic.identified) {
this.item.update({"system.basic.identified": false});
Expand Down
17 changes: 17 additions & 0 deletions module/utilities/roll-engine/roll-engine-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,23 @@ export async function rollEngineMain(data) {

data.initiativeRoll = (item) ? item.system.settings.general.initiative : false;

// Fallback for empty data
if (!data.poolPointCost) {
data.poolPointCost = 0;
}
if (!data.bonus) {
data.bonus = 0;
}
if (!data.difficultyModifier) {
data.difficultyModifier = 0;
}
if (!data.damage) {
data.damage = 0;
}
if (!data.damagePerLOE) {
data.damagePerLOE = 0;
}

// Set GMI Range
if (data.gmiRange === undefined) {
if (game.settings.get("cyphersystem", "useGlobalGMIRange")) {
Expand Down
9 changes: 6 additions & 3 deletions module/utilities/welcome-message.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import {chatCardWelcomeMessage} from "./chat-cards.js";

export function sendWelcomeMessage() {
ChatMessage.create({
content: chatCardWelcomeMessage()
});
if (game.user.isGM && game.settings.get("cyphersystem", "welcomeMessage")) {
ChatMessage.create({
content: chatCardWelcomeMessage()
});
game.settings.set("cyphersystem", "welcomeMessage", false);
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion packs/markers/CURRENT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MANIFEST-000602
MANIFEST-000642
6 changes: 3 additions & 3 deletions packs/markers/LOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
2023/09/24-14:09:19.620793 30adc8000 Recovering log #600
2023/09/24-14:09:19.621119 30adc8000 Delete type=0 #600
2023/09/24-14:09:19.621148 30adc8000 Delete type=3 #598
2023/10/01-09:24:03.102717 31093e000 Recovering log #641
2023/10/01-09:24:03.103047 31093e000 Delete type=0 #641
2023/10/01-09:24:03.103075 31093e000 Delete type=3 #640
11 changes: 3 additions & 8 deletions packs/markers/LOG.old
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
2023/09/24-14:06:42.188624 3149c1000 Recovering log #597
2023/09/24-14:06:42.188968 3149c1000 Delete type=3 #596
2023/09/24-14:06:42.189011 3149c1000 Delete type=0 #597
2023/09/24-14:06:57.046997 30d8bf000 Level-0 table #601: started
2023/09/24-14:06:57.047011 30d8bf000 Level-0 table #601: 0 bytes OK
2023/09/24-14:06:57.047158 30d8bf000 Delete type=0 #599
2023/09/24-14:06:57.047697 30d8bf000 Manual compaction at level-0 from '!actors!5Q0EHfaj9oRsZI60' @ 72057594037927935 : 1 .. '!actors!y0TbX4GPi4HOajtz' @ 0 : 0; will stop at (end)
2023/09/24-14:06:57.047730 30d8bf000 Manual compaction at level-1 from '!actors!5Q0EHfaj9oRsZI60' @ 72057594037927935 : 1 .. '!actors!y0TbX4GPi4HOajtz' @ 0 : 0; will stop at (end)
2023/09/30-11:45:31.964911 30c153000 Recovering log #638
2023/09/30-11:45:31.965226 30c153000 Delete type=0 #638
2023/09/30-11:45:31.965251 30c153000 Delete type=3 #636
Binary file not shown.
File renamed without changes.
2 changes: 1 addition & 1 deletion packs/roll-macros/CURRENT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MANIFEST-000602
MANIFEST-000642
6 changes: 3 additions & 3 deletions packs/roll-macros/LOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
2023/09/24-14:09:19.618982 30b5c7000 Recovering log #600
2023/09/24-14:09:19.619355 30b5c7000 Delete type=0 #600
2023/09/24-14:09:19.619392 30b5c7000 Delete type=3 #598
2023/10/01-09:24:03.100601 31013f000 Recovering log #641
2023/10/01-09:24:03.100976 31013f000 Delete type=0 #641
2023/10/01-09:24:03.101007 31013f000 Delete type=3 #640
Loading

0 comments on commit bdd75c4

Please sign in to comment.