Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Qaw committed Jan 6, 2022
2 parents c8caa55 + ff193cd commit 1dba139
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 19 deletions.
2 changes: 2 additions & 0 deletions css/coc.css
Expand Up @@ -1074,6 +1074,7 @@
color: #464331c4;
text-align: center;
border: none;
justify-content: center;
}
.coc.base nav.sheet-navigation.tabs .item {
text-overflow: ellipsis;
Expand All @@ -1086,6 +1087,7 @@
height: 28px;
box-shadow: 0 0 10px #00000052 inset;
background: #AAA;
width: 16.66%;
}
.coc.base nav.sheet-navigation.tabs .item:hover {
color: #464331c4;
Expand Down
15 changes: 8 additions & 7 deletions module/system/hooks.js
Expand Up @@ -80,44 +80,45 @@ export default function registerHooks() {

let command = `let onlyDamage = false;\nlet customLabel = "";\nlet skillDescription = "";\nlet dmgDescription = "";\n\nif (event) {\n if (event.shiftKey) onlyDamage = true;\n}\n\ngame.coc.macros.rollItemMacro("${item._id}", "${item.name}", "${item.type}", 0, 0, 0, onlyDamage, customLabel, skillDescription, dmgDescription);`;

let macro = game.macros.entities.find(m => (m.name === item.name) && (m.command === command));
let macro = game.macros.contents.find(m => (m.name === item.name) && (m.data.command === command));
if (!macro) {
macro = await Macro.create({
name: item.name,
type : "script",
img: item.img,
command : command
}, {displaySheet: false})
}, {displaySheet: false});
game.user.assignHotbarMacro(macro, slot);
}
game.user.assignHotbarMacro(macro, slot);

}
// Create a macro to open the actor sheet of the actor dropped on the hotbar
else if (data.type == "Actor") {
let actor = game.actors.get(data.id);
let command = `game.actors.get("${data.id}").sheet.render(true)`
let macro = game.macros.entities.find(m => (m.name === actor.name) && (m.command === command));
let macro = game.macros.contents.find(m => (m.name === actor.name) && (m.data.command === command));
if (!macro) {
macro = await Macro.create({
name: actor.data.name,
type: "script",
img: actor.data.img,
command: command
}, {displaySheet: false})
}, {displaySheet: false});
game.user.assignHotbarMacro(macro, slot);
}
}
// Create a macro to open the journal sheet of the journal dropped on the hotbar
else if (data.type == "JournalEntry") {
let journal = game.journal.get(data.id);
let command = `game.journal.get("${data.id}").sheet.render(true)`
let macro = game.macros.entities.find(m => (m.name === journal.name) && (m.command === command));
let macro = game.macros.contents.find(m => (m.name === journal.name) && (m.data.command === command));
if (!macro) {
macro = await Macro.create({
name: journal.data.name,
type: "script",
img: (journal.data.img) ? journal.data.img : "icons/svg/book.svg",
command: command
}, {displaySheet: false})
}, {displaySheet: false});
game.user.assignHotbarMacro(macro, slot);
}
}
Expand Down
2 changes: 2 additions & 0 deletions styles/components/base/tabs.less
Expand Up @@ -6,6 +6,7 @@ nav.sheet-navigation {
color: @c-darkbrown;
text-align: center;
border: none;
justify-content: center;

.item {
.ellipsis();
Expand All @@ -16,6 +17,7 @@ nav.sheet-navigation {
height: 28px;
box-shadow: 0 0 10px @c-shadow inset;
background:#AAA;
width: 16.66%;
&:hover {
color: @c-darkbrown;
background:#CCC;
Expand Down
31 changes: 19 additions & 12 deletions system.json
Expand Up @@ -2,11 +2,18 @@
"name": "coc",
"title": "Chroniques Oubliées Contemporain",
"description": "<p>Système Foundry VTT pour <a href='https://www.black-book-editions.fr/catalogue.php?id=477'>Chroniques Oubliées Contemporain</a>.</p><p> *** Rejoignez la communauté Discord FR :<a href='https://discord.gg/pPSDNJk'>https://discord.gg/pPSDNJk</a></p>",
"version": "0.8.9.6",
"minimumCoreVersion": "0.8.6",
"compatibleCoreVersion": "0.8.9",
"version": "9.238.1",
"minimumCoreVersion": "9",
"compatibleCoreVersion": "9.238",
"templateVersion": 2,
"author": "Zigmund",
"authors": [
{
"name": "Zigmund"
},
{
"name": "Kristov"
}
],
"scripts": [],
"esmodules": [
"module/coc.js"
Expand All @@ -32,55 +39,55 @@
"label": "Capacités",
"system": "coc",
"path": "./packs/capacities.db",
"entity": "Item",
"type": "Item",
"tag": "capacity"
},
{
"name": "items",
"label": "Equipement",
"system": "coc",
"path": "./packs/items.db",
"entity": "Item",
"type": "Item",
"tag": "item"
},
{
"name": "paths",
"label": "Voies",
"system": "coc",
"path": "./packs/paths.db",
"entity": "Item",
"type": "Item",
"tag": "path"
},
{
"name": "profiles",
"label": "Profils",
"system": "coc",
"path": "./packs/profiles.db",
"entity": "Item",
"type": "Item",
"tag": "profile"
},
{
"name": "traits",
"label": "Traits",
"system": "coc",
"path": "./packs/traits.db",
"entity": "Item",
"type": "Item",
"tag": "trait"
},
{
"name": "tables",
"label": "Tables",
"system": "coc",
"path": "./packs/tables.db",
"entity": "RollTable",
"type": "RollTable",
"tag": "table"
},
{
"name": "macros",
"label": "Macros",
"system": "coc",
"path": "./packs/macros.db",
"entity": "Macro",
"type": "Macro",
"tag": "macro"
}
],
Expand All @@ -91,6 +98,6 @@
"secondaryTokenAttribute": null,
"url": "https://github.com/ZigmundKreud/coc",
"manifest": "https://raw.githubusercontent.com/ZigmundKreud/coc/master/system.json",
"download": "https://github.com/ZigmundKreud/coc/archive/refs/tags/0.8.9.6.zip",
"download": "https://github.com/ZigmundKreud/coc/archive/refs/tags/9.238.1.zip",
"license": "LICENCE"
}

0 comments on commit 1dba139

Please sign in to comment.