Skip to content

Commit

Permalink
0.9.4: UI Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Savantford committed Aug 20, 2023
1 parent a878cc0 commit 56c3629
Show file tree
Hide file tree
Showing 12 changed files with 130 additions and 56 deletions.
Binary file added assets/ui/pause-circle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ui/sotww-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"WW.Intellect": "Intellect",
"WW.Will": "Will",
"WW.Luck": "Luck",
"WW.None": "None",
"WW.Dont": "Don't Roll",

"WW.Stats": "Stats",
"WW.Traits": "Traits",
Expand Down
5 changes: 3 additions & 2 deletions module/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ WW.dropdownNumbers = {
"10": "10",
}
WW.dropdownAttributes = {
"": "WW.None",
"": "WW.Dont",
"str": "WW.Strength",
"agi": "WW.Agility",
"int": "WW.Intellect",
"wil": "WW.Will"
"wil": "WW.Will",
"luck": "WW.Luck"
}

WW.dropdownSubtypes = {
Expand Down
9 changes: 7 additions & 2 deletions module/sheets/actor-sheet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ export class WeirdWizardActorSheet extends ActorSheet {
// Define variables to be used
let system = this.object.system;
let label = '';
let content = '';
let attribute = '';
let fixedBoons = 0;

Expand All @@ -273,9 +274,12 @@ export class WeirdWizardActorSheet extends ActorSheet {
label = item.name;
fixedBoons = item.system.boons;

if (this.actor.system.attributes[attribute]) {
attribute = this.actor.system.attributes[attribute];
if (this.actor.type == 'Character') content = item.system.description.value;

if (this.actor.system.attributes[item.system.attribute]) {
attribute = this.actor.system.attributes[item.system.attribute];
}

}

// If the clicked element has a data-label, use it to determine the mod and label
Expand Down Expand Up @@ -311,6 +315,7 @@ export class WeirdWizardActorSheet extends ActorSheet {
actor: this.actor,
target: ev,
label: label,
content: content,
attribute: attribute,
fixedBoons: fixedBoons
}
Expand Down
54 changes: 25 additions & 29 deletions module/sheets/apps/roll-attribute.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ export class rollAttribute extends FormApplication {

// Assign label, name and fixed boons/banes
this.label = obj.label;
console.log(obj.attribute);
this.content = obj.content;
this.name = obj.attribute.name;
this.effectBoonsGlobal = obj.attribute.boons?.global ? obj.attribute.boons.global : 0;
this.fixedBoons = obj.fixedBoons ? obj.fixedBoons : 0;

// Assign mod

this.mod = plusify(obj.attribute.mod ? obj.attribute.mod : 0); // If mod is positive, give a + sign if positive. If undefined, set it to 0
this.mod = obj.attribute.mod ? plusify(obj.attribute.mod) : 0; // If undefined, set it to 0
}

static get defaultOptions() {
Expand Down Expand Up @@ -55,6 +54,7 @@ export class rollAttribute extends FormApplication {
// Get roll variables
let boonsFinal = 0;
const label = this.label;
const content = this.content;
const mod = this.mod;
const name = this.name;
const fixedBoons = this.fixedBoons;
Expand Down Expand Up @@ -106,39 +106,35 @@ export class rollAttribute extends FormApplication {

// Execute the roll
await r.evaluate();

// Send to chat
let message = await r.toMessage({
speaker: ChatMessage.getSpeaker({ actor: this.actor }),
flavor: label,
rollMode: game.settings.get('core', 'rollMode')
});

// Append damage roll to the chat message
/*if (damage) {
let d = new Roll(damage + "[Damage]");
await d.evaluate();
message.update({'rolls': [...message.rolls, d]})
}
/**/

// Append healing roll to the chat message
if (healing) {
let h = new Roll(healing + "[Healing]");
await h.evaluate();
if (content) {
let rollHtml = await r.render();

message.update({'rolls': [...message.rolls, h]})
}*/

// The parsed terms of the roll formula
//console.log(r.terms); // [Die, OperatorTerm, NumericTerm, OperatorTerm, NumericTerm]
let messageData = {
speaker: ChatMessage.getSpeaker({ actor: this.actor }),
flavor: label,
content: rollHtml + content,
sound: CONFIG.sounds.dice
};

ChatMessage.applyRollMode(messageData, game.settings.get('core', 'rollMode'));

ChatMessage.create(messageData);

} else {
let message = await r.toMessage({
speaker: ChatMessage.getSpeaker({ actor: this.actor }),
flavor: label,
rollMode: game.settings.get('core', 'rollMode')
});
}

// The resulting equation after it was rolled
console.log('Formula = ' + r.formula + '\nResult = ' + r.result + '\nTotal = ' + r.total); // 16 + 2 + 4; 22

/*export class DLEroll extends Roll { // Extended custom Demon Lord Engine roll // Not Needed ATM
constructor() { ... }
}*/
})

}
Expand Down
72 changes: 67 additions & 5 deletions styles/weirdwizard.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions templates/actors/parts/Character-equipment.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}" width="24" height="24" /></div>
<label class="item-name">{{item.name}}
{{#if item.system.description.value}}<a class="item-scroll" data-tooltip="{{item.system.description.value}}"><i class="far fa-scroll"></i></a>{{/if}}
<a class="rollable item-roll" title="Roll Attack"><i
class="fas fa-dice-d20"></i></a>
<a class="rollable item-roll" title="Roll Attack">
<i class="fas fa-dice-d20"></i></a>
<a class="damage-roll" title="Roll Damage Dice"><i class="fas fa-burst"></i></a>
</label>
<div class="item-fixed damage-roll"><a>{{item.system.damage}}</a></div>
Expand Down
8 changes: 4 additions & 4 deletions templates/actors/parts/Character-spells.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}" width="24" height="24" /></div>
<label class="item-name">{{item.name}}
{{#if item.system.description.value}}<a class="item-scroll" data-tooltip="{{item.system.description.value}}"><i class="far fa-scroll"></i></a>{{/if}}
<a class="rollable item-roll" title="Roll Spell"><i
class="fas fa-dice-d20"></i></a>
{{#if item.system.attribute}}<a class="rollable item-roll" title="Roll Spell">
<i class="fas fa-dice-d20"></i></a>{{/if}}
{{#if item.system.damage}}<a class="damage-roll" title="Roll Damage Dice"><i class="fas fa-burst"></i></a>{{/if}}
{{#if item.system.healing}}<a class="healing-roll" title="Roll Healing Dice"><i class="fas fa-sparkles"></i></a>{{/if}}
</label>
<div>{{item.system.tier}}</div>
<div>{{item.system.tradition}}</div>
<div>
{{#each item.uses as |pip id|}}
<a class="item-pip" title="{{#if (eq pip "far")}}Spend casting{{else}}Recover casting{{/if}}"><i
class="{{pip}} fa-circle"></i></a>
{{/each}}
</div>
<div>{{item.system.tier}}</div>
<div>{{item.system.tradition}}</div>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
Expand Down
6 changes: 4 additions & 2 deletions templates/actors/parts/Character-summary.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@
<ol class="compact-list stat">
{{#each talents as |item id|}}
<li class="item" data-item-id="{{item._id}}">
<a class="rollable item-roll" title="Roll Talent">{{item.name}}</a>
{{#if item.system.attribute}}<a class="rollable item-roll" title="Roll Talent">{{item.name}}</a>
{{else}}<label>{{item.name}}</label>{{/if}}
<a class="item-edit" title="Edit Talent"><i class="fas fa-edit"></i></a>
{{#if item.system.description.value}}<a class="item-scroll" data-tooltip="{{item.system.description.value}}"><i class="far fa-scroll"></i></a>{{/if}}
{{#if item.system.damage}}<a class="damage-roll" title="Roll Damage Dice"><i class="fas fa-burst"></i></a>{{/if}}
Expand Down Expand Up @@ -158,7 +159,8 @@
<ol class="compact-list stat">
{{#each spells as |item id|}}
<li class="item" data-item-id="{{item._id}}">
<a class="rollable item-roll" title="Roll Spell">{{item.name}}</a>
{{#if item.system.attribute}}<a class="rollable item-roll" title="Roll Spell">{{item.name}}</a>
{{else}}<label>{{item.name}}</label>{{/if}}
<a class="item-edit" title="Edit Spell"><i class="fas fa-edit"></i></a>
{{#if item.system.description.value}}<a class="item-scroll" data-tooltip="{{item.system.description.value}}"><i class="far fa-scroll"></i></a>{{/if}}
{{#if item.system.damage}}<a class="damage-roll" title="Roll Damage Dice"><i class="fas fa-burst"></i></a>{{/if}}
Expand Down
8 changes: 5 additions & 3 deletions templates/actors/parts/Character-talents.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,20 @@
<div class="item-image"><img src="{{item.img}}" title="{{item.name}}" width="24" height="24" /></div>
<label class="item-name">{{item.name}}
{{#if item.system.description.value}}<a class="item-scroll" data-tooltip="{{item.system.description.value}}"><i class="far fa-scroll"></i></a>{{/if}}
<a class="rollable item-roll" title="Roll Talent"><i
class="fas fa-dice-d20"></i></a>

{{#if item.system.attribute}}<a class="rollable item-roll" title="Roll Talent">
<i class="fas fa-dice-d20"></i></a>{{/if}}
{{#if item.system.damage}}<a class="damage-roll" title="Roll Damage Dice"><i class="fas fa-burst"></i></a>{{/if}}
{{#if item.system.healing}}<a class="healing-roll" title="Roll Healing Dice"><i class="fas fa-sparkles"></i></a>{{/if}}
</label>
<div>{{item.system.source}}</div>
<div>
{{#each item.uses as |pip id|}}
<a class="item-pip" title="{{#if (eq pip "far")}}Spend use{{else}}Recover use{{/if}}"><i
class="{{pip}} fa-circle"></i></a>
{{/each}}
</div>
<div>{{item.system.source}}</div>

<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
Expand Down
18 changes: 12 additions & 6 deletions templates/actors/parts/NPC-summary.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
<ol class="described-list">
{{#each auras as |item id|}}
<li class="item" data-item-id="{{item._id}}">
<a class="rollable item-roll" title="Roll Aura">{{item.name}}</a>
{{#if item.system.attribute}}<a class="rollable item-roll" title="Roll Aura">{{item.name}}</a>
{{else}}<label>{{item.name}}</label>{{/if}}
<a class="item-edit" title="Edit Aura"><i class="fas fa-edit"></i></a>
{{#if item.system.description.value}}<a class="item-scroll" title="Send to Chat"><i class="far fa-scroll"></i></a>{{/if}}
{{#if item.system.damage}}<a class="damage-roll" title="Roll Damage Dice"><i class="fas fa-burst"></i></a>{{/if}}
Expand Down Expand Up @@ -111,7 +112,8 @@
<ol class="described-list">{{!-- Talents --}}
{{#each talents as |item id|}}
<li class="item" data-item-id="{{item._id}}">
<a class="rollable item-roll" title="Roll Talent">{{item.name}}</a>
{{#if item.system.attribute}}<a class="rollable item-roll" title="Roll Trait or Talent">{{item.name}}</a>
{{else}}<label>{{item.name}}</label>{{/if}}
<a class="item-edit" title="Edit Trait or Talent"><i class="fas fa-edit"></i></a>
{{#if item.system.description.value}}<a class="item-scroll" title="Send to Chat"><i class="far fa-scroll"></i></a>{{/if}}
{{#if item.system.damage}}<a class="damage-roll" title="Roll Damage Dice"><i class="fas fa-burst"></i></a>{{/if}}
Expand Down Expand Up @@ -160,7 +162,8 @@
<ol class="described-list">
{{#each actions as |item id|}}
<li class="item" data-item-id="{{item._id}}">
<a class="rollable item-roll" title="Roll Action">{{item.name}}</a>
{{#if item.system.attribute}}<a class="rollable item-roll" title="Roll Action">{{item.name}}</a>
{{else}}<label>{{item.name}}</label>{{/if}}
<a class="item-edit" title="Edit Action"><i class="fas fa-edit"></i></a>
{{#if item.system.description.value}}<a class="item-scroll" title="Send to Chat"><i class="far fa-scroll"></i></a>{{/if}}
{{#if item.system.damage}}<a class="damage-roll" title="Roll Damage Dice"><i class="fas fa-burst"></i></a>{{/if}}
Expand All @@ -185,7 +188,8 @@
<ol class="described-list">
{{#each reactions as |item id|}}
<li class="item" data-item-id="{{item._id}}">
<a class="rollable item-roll" title="Roll Reaction">{{item.name}}</a>
{{#if item.system.attribute}}<a class="rollable item-roll" title="Roll Reaction">{{item.name}}</a>
{{else}}<label>{{item.name}}</label>{{/if}}
<a class="item-edit" title="Edit Reaction"><i class="fas fa-edit"></i></a>
{{#if item.system.description.value}}<a class="item-scroll" title="Send to Chat"><i class="far fa-scroll"></i></a>{{/if}}
{{#if item.system.damage}}<a class="damage-roll" title="Roll Damage Dice"><i class="fas fa-burst"></i></a>{{/if}}
Expand All @@ -201,7 +205,8 @@
<ol class="described-list">
{{#each end as |item id|}}
<li class="item" data-item-id="{{item._id}}">
<a class="rollable item-roll" title="Roll End of Round Effect">{{item.name}}</a>
{{#if item.system.attribute}}<a class="rollable item-roll" title="Roll End of Round Effect">{{item.name}}</a>
{{else}}<label>{{item.name}}</label>{{/if}}
<a class="item-edit" title="Edit End of Round Effect"><i class="fas fa-edit"></i></a>
{{#if item.system.description.value}}<a class="item-scroll" title="Send to Chat"><i class="far fa-scroll"></i></a>{{/if}}
{{#if item.system.damage}}<a class="damage-roll" title="Roll Damage Dice"><i class="fas fa-burst"></i></a>{{/if}}
Expand All @@ -217,7 +222,8 @@
{{#each fury as |item id|}}
<li class="item" data-item-id="{{item._id}}">
<h5 class="fury-header">
<a class="rollable item-roll" title="Roll Fury">{{item.name}}</a>
{{#if item.system.attribute}}<a class="rollable item-roll" title="Roll Fury">{{item.name}}</a>
{{else}}<label>{{item.name}}</label>{{/if}}
<a class="item-edit" title="Edit Fury"><i class="fas fa-edit"></i></a>
{{#if item.system.description.value}}<a class="item-scroll" title="Send to Chat"><i class="far fa-scroll"></i></a>{{/if}}
{{#if item.uses}}
Expand Down

0 comments on commit 56c3629

Please sign in to comment.