-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
161 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
@forward "shared"; | ||
@import | ||
"shared", | ||
"actors/attributes"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,7 @@ | |
.actor { | ||
&__body { | ||
display: grid; | ||
margin: 8px; | ||
} | ||
|
||
&__grid { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.attribute__grid { | ||
display: grid; | ||
grid-template-columns: 2fr 2fr 1fr 1fr; | ||
border: 2px; | ||
} | ||
|
||
.attribute__parent { | ||
display: grid; | ||
grid-row: span 5; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
$columns: 6; | ||
|
||
%grid-styles { | ||
@include p-reset; | ||
display: grid; | ||
column-gap: 4px; | ||
} | ||
|
||
@mixin grid-x-columns { | ||
@for $i from 1 through $columns { | ||
.grid-#{$i}-columns { | ||
@extend %grid-styles; | ||
grid-template-columns: repeat(#{$i}, 1fr); | ||
} | ||
} | ||
} | ||
|
||
@include grid-x-columns; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import 'grids'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import {init} from "./src/hooks/init.mjs"; | ||
import {setup} from "./src/hooks/setup.mjs"; | ||
|
||
Hooks.once("init", init); | ||
Hooks.once("setup", setup); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
export const SYSTEM_ID = "jcom"; | ||
export const SYSTEM_NAME = "John Carter of Mars"; | ||
export const SYSTEM = {}; | ||
|
||
SYSTEM.ATTRIBUTES = { | ||
cunning: "JCOM.actor.attribute.cunning", | ||
daring: "JCOM.actor.attribute.daring", | ||
empathy: "JCOM.actor.attribute.empathy", | ||
might: "JCOM.actor.attribute.might", | ||
passion: "JCOM.actor.attribute.passion", | ||
reason: "JCOM.actor.attribute.reason", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
export default function registerHandlebarsHelpers() { | ||
|
||
Handlebars.registerHelper("ifCond", function(v1, operator, v2, options) { | ||
switch (operator) { | ||
case "==": | ||
return v1 === v2 ? options.fn(this) : options.inverse(this); | ||
case "===": | ||
return v1 === v2 ? options.fn(this) : options.inverse(this); | ||
case "!=": | ||
return v1 !== v2 ? options.fn(this) : options.inverse(this); | ||
case "!==": | ||
return v1 !== v2 ? options.fn(this) : options.inverse(this); | ||
case "<": | ||
return v1 < v2 ? options.fn(this) : options.inverse(this); | ||
case "<=": | ||
return v1 <= v2 ? options.fn(this) : options.inverse(this); | ||
case ">": | ||
return v1 > v2 ? options.fn(this) : options.inverse(this); | ||
case ">=": | ||
return v1 >= v2 ? options.fn(this) : options.inverse(this); | ||
case "&&": | ||
return v1 && v2 ? options.fn(this) : options.inverse(this); | ||
case "||": | ||
return v1 || v2 ? options.fn(this) : options.inverse(this); | ||
default: | ||
return options.inverse(this); | ||
} | ||
}); | ||
|
||
Handlebars.registerHelper("ifEq", function(arg1, arg2, options) { | ||
return arg1 === arg2 ? options.fn(this) : options.inverse(this); | ||
}); | ||
|
||
Handlebars.registerHelper("ifNeq", function(arg1, arg2, options) { | ||
return arg1 !== arg2 ? options.fn(this) : options.inverse(this); | ||
}); | ||
|
||
Handlebars.registerHelper("ifObjIndex", function(obj, index, options) { | ||
return obj[index] ? options.fn(this) : options.inverse(this); | ||
}); | ||
|
||
Handlebars.registerHelper("joinStrings", value => { | ||
value = value ? value : []; | ||
return value.join(", "); | ||
}); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export function setup() { | ||
jcom.logger.log("Setup Hook"); | ||
|
||
// Localize all the strings in the game config in advance | ||
// | ||
for (const obj in jcom.config) { | ||
if ({}.hasOwnProperty.call(jcom.config, obj)) { | ||
for (const el in jcom.config[obj]) { | ||
if ({}.hasOwnProperty.call(jcom.config[obj], el)) { | ||
if (typeof jcom.config[obj][el] === "string") { | ||
jcom.config[obj][el] = game.i18n.localize( | ||
jcom.config[obj][el] | ||
); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export default function() { | ||
const partials = [ | ||
"systems/jcom/templates/actors/adventurer/abilities.hbs", | ||
]; | ||
|
||
const paths = {}; | ||
for (const path of partials) { | ||
const [key] = path.split("/").slice(3).join("/").split("."); | ||
|
||
jcom.logger.debug(`Registering template "${key}" at path "${path}"`); | ||
|
||
paths[key] = path; | ||
} | ||
|
||
return loadTemplates(paths); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{#each CONFIG.ATTRIBUTES as |attr|}} | ||
<div class="grid-2-columns" style="width: 140px; height: 90px; align-items: center;"> | ||
<div class="grid-1-columns"> | ||
<div style="background: #7c1c27; color: white; height: min-content;"> | ||
{{attr}} | ||
</div> | ||
<div style="background: #d5ba99; height:max-content;"> | ||
4 | ||
</div> | ||
</div> | ||
<div> | ||
{{#each ../CONFIG.ATTRIBUTES as |linkedAttr|}} | ||
{{#ifNeq attr linkedAttr}} | ||
<div>+ {{linkedAttr}}</div> | ||
{{/ifNeq}} | ||
{{/each}} | ||
</div> | ||
</div> | ||
{{/each}} |