Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Durtur committed Oct 11, 2021
1 parent bee394e commit 7e6ae35
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/css/sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
.sidebar {
width: 2.5em;
height: 100%;
top: 2.2em;
top: 1.4em;
overflow: hidden;
background-color: var(--main-color);
transform: translateZ(0);
Expand Down
7 changes: 5 additions & 2 deletions app/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ h1 {
text-align: center;
font-family: var(--basic-font);
white-space: pre;
pointer-events: none;
}

.code_ac {
Expand Down Expand Up @@ -1292,7 +1293,7 @@ button:disabled {

.pcnode:hover {
height: 122px;
background-color: var(--dark-transparent-bg);
background-color: var(--lighter-background);
}

.pcnode {
Expand Down Expand Up @@ -1324,7 +1325,7 @@ button:disabled {

.pcnode .pcnode_notes {
flex: 1;
background-color: var(--dark-transparent-bg);
background-color: var(--lighter-background);
padding: 5px;
margin: 0;
z-index: 1;
Expand Down Expand Up @@ -1514,6 +1515,8 @@ button:disabled {
top: 0.5em;
width: 1.5em !important;
height: 1.5em !important;
background-image: url(img/close.png);
background-size:contain;
}

.popup_menu .awesomplete>input {
Expand Down
19 changes: 10 additions & 9 deletions app/js/dataaccess.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ const defaultTokenPath = pathModule.join(app.getPath("userData"), "data", "mapto
const defaultEffectPath = pathModule.join(app.getPath("userData"), "data", "maptool_effects");
const conditionImagePath = pathModule.join(app.getPath("userData"), "data", "condition_images");
const conditionResourcePath = pathModule.join(app.getAppPath(), 'app', 'mappingTool', 'tokens', 'conditions');


module.exports = function () {
var isFirstTimeLoading = false;
function initializeData() {
Expand Down Expand Up @@ -163,15 +165,13 @@ module.exports = function () {
return baseGet("homebrew.json", callback);
}

function addHomebrew(dataList, overwrite, callback){
getHomebrewMonsters(hbData=> {
if(overwrite){
console.log("Conflicts");
console.log(hbData.filter(x=> dataList.find(y=> y.name == x.name)));
hbData = hbData.filter(x=> !dataList.find(y=> y.name == x.name));
function addHomebrew(dataList, overwrite, callback) {
getHomebrewMonsters(hbData => {
if (overwrite) {
hbData = hbData.filter(x => !dataList.find(y => y.name == x.name));
}
hbData = hbData.concat(dataList);
setHomebrewMonsters(hbData, callback);
setHomebrewMonsters(hbData, callback);
});
}
function setHomebrewMonsters(data, callback) {
Expand Down Expand Up @@ -460,7 +460,8 @@ module.exports = function () {

function checkIfFirstTimeLoadComplete() {
var baseFolder = pathModule.join(app.getPath("userData"), "data");
if (!fs.existsSync(baseFolder)) initializeData();
if (!fs.existsSync(baseFolder))
initializeData();
}

function saveCoverImage(path) {
Expand Down Expand Up @@ -492,7 +493,7 @@ module.exports = function () {
setMonsters: setMonsters,
getHomebrewMonsters: getHomebrewMonsters,
setHomebrewMonsters: setHomebrewMonsters,
addHomebrew:addHomebrew,
addHomebrew: addHomebrew,
getHomebrewAndMonsters: getHomebrewAndMonsters,
getEncounters: getEncounters,
setEncounters: setEncounters,
Expand Down
2 changes: 1 addition & 1 deletion app/mappingTool/mapscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ var MAP_RESIZE_BUFFER = 0, LAST_MAP_RESIZE, onZoomCallback;
*/

function zoomIntoMap(event, resizeAmount, onZoomed) {
console.log(`Zoom ${resizeAmount}`)

if(onZoomed)
onZoomCallback = onZoomed;
window.requestAnimationFrame(function (ts) {
Expand Down
10 changes: 9 additions & 1 deletion data/spells.json
Original file line number Diff line number Diff line change
Expand Up @@ -9677,7 +9677,15 @@
"casting_time": "1 action",
"duration": "Concentration, up to 1 minute",
"ritual": false,
"id": "cacvjpc94kgy0yg4f"
"id": "cacvjpc94kgy0yg4f",
"metadata": {
"savingThrow": [
"dexterity"
],
"conditionInflict": [
"restrained"
]
}
},
{
"name": "Find Greater Steed",
Expand Down

0 comments on commit 7e6ae35

Please sign in to comment.