Compare commits

..

8 Commits
0.2.1 ... 0.2.4

Author SHA1 Message Date
Stefan Zermatten
7430c2c795 Prevented evaluate crashing when given duff abilityMod strings 2015-05-06 12:12:18 +02:00
Stefan Zermatten
39f7548b8d Fixed singlecharacter publication returning undefined rather than an empty array 2015-05-06 12:11:37 +02:00
Stefan Zermatten
c4a8c4b7ba Fixed typos in the guide, floating action buttons are on the bottom RIGHT not left 2015-05-04 10:01:47 +02:00
Stefan Zermatten
263aba596c Changed Guide styling to be more spacious 2015-05-04 09:53:29 +02:00
Stefan Zermatten
f98ed0b659 Fixed old proficiency dialog showing up after it has been depreciated 2015-04-30 07:42:59 +02:00
Stefan Zermatten
6159ce0e88 Characters menu item now shows up when no characters yet exist 2015-04-30 07:42:30 +02:00
Stefan Zermatten
e9509a3a24 Fixed containers not responding to rename or delete 2015-04-30 07:30:37 +02:00
Stefan Zermatten
aa069fd885 Removed single character subscription vulnerability 2015-04-30 07:18:42 +02:00
8 changed files with 125 additions and 118 deletions

View File

@@ -85,19 +85,6 @@ Template.features.events({
var featureId = this._id; var featureId = this._id;
Features.update(featureId, {$set: {used: 0}}); Features.update(featureId, {$set: {used: 0}});
}, },
"tap #proficiencies": function(event){
var charId = this._id;
GlobalUI.setDetail({
template: "textDialog",
data: {
charId: charId,
field: "proficiencies",
title: "Proficiencies",
color: "q",
},
heroId: this._id + "proficiencies",
});
},
"tap .enabledCheckbox": function(event){ "tap .enabledCheckbox": function(event){
event.stopPropagation(); event.stopPropagation();
}, },

View File

@@ -9,7 +9,7 @@
</template> </template>
<template name="containerEdit"> <template name="containerEdit">
<paper-input id="containerNameInput fullwidth" <paper-input id="containerNameInput"
label="Name" label="Name"
floatinglabel floatinglabel
value={{name}}></paper-input> value={{name}}></paper-input>

View File

@@ -4,11 +4,7 @@ Template.containerDialog.helpers({
} }
}); });
Template.containerEdit.onRendered(function(){ Template.containerDialog.events({
updatePolymerInputs(this);
});
Template.containerEdit.events({
"color-change": function(event, instance){ "color-change": function(event, instance){
Containers.update(instance.data.containerId, {$set: {color: event.color}}); Containers.update(instance.data.containerId, {$set: {color: event.color}});
}, },
@@ -20,8 +16,15 @@ Template.containerEdit.events({
); );
GlobalUI.closeDetail(); GlobalUI.closeDetail();
}, },
});
Template.containerEdit.onRendered(function(){
updatePolymerInputs(this);
});
Template.containerEdit.events({
//TODO validate input (integer, non-negative, etc) for these inputs and give validation errors //TODO validate input (integer, non-negative, etc) for these inputs and give validation errors
"change #containerNameInput, input #containerNameInput": function(event){ "change #containerNameInput": function(event){
var name = Template.instance().find("#containerNameInput").value; var name = Template.instance().find("#containerNameInput").value;
Containers.update(this._id, {$set: {name: name}}); Containers.update(this._id, {$set: {name: name}});
}, },

View File

@@ -1,6 +1,6 @@
<template name="characterSideList"> <template name="characterSideList">
{{#if characters.count}}
<core-item icon="social:people" label="Characters"></core-item> <core-item icon="social:people" label="Characters"></core-item>
{{#if characters.count}}
<div> <div>
{{#each characters}} {{#each characters}}
<div class="singleLineItem">{{name}}</div> <div class="singleLineItem">{{name}}</div>

View File

@@ -0,0 +1,7 @@
.wallOfText h2{
margin-top: 24px
}
.wallOfText p{
margin-top: 8px;
}

View File

@@ -1,4 +1,5 @@
<template name="guide"> <template name="guide">
<div class="wallOfText">
<h1>Dicecloud Beta</h1> <h1>Dicecloud Beta</h1>
<p>Welcome to the Dicecloud beta. Please don't share the link with people you don't actively play with, since the beta is intended to be small, and your experience will probably get laggy if it gets more traffic than I'm expecting.</p> <p>Welcome to the Dicecloud beta. Please don't share the link with people you don't actively play with, since the beta is intended to be small, and your experience will probably get laggy if it gets more traffic than I'm expecting.</p>
<p>The beta is going to start with just the character sheet. You can play D&amp;D without minis and maps, without a pre-written adventure, you can play without a lot of things, but the character sheet is necessary. So I'm starting here and working my way outwards.</p> <p>The beta is going to start with just the character sheet. You can play D&amp;D without minis and maps, without a pre-written adventure, you can play without a lot of things, but the character sheet is necessary. So I'm starting here and working my way outwards.</p>
@@ -10,7 +11,7 @@
<p>You need to swim through a sunken section of dungeon to fetch the quest's Thing.<br>You'll need to take off your magical Plate Armor of +1 Constitution to swim without sinking, of course. Taking it off will change your armor class, your speed and your constitution, which in turn changes your hitpoints and your constitution saving throw. Working out all those changes in the middle of a game will drag the game to a hault. <br> Fortunately you have a digital character sheet, so it's a matter of dragging your Plate Armor +1 Con from your "equipment" box to your "backpack" box and you're done. Your hitpoints change correctly, your saving throws are up to date, your armor class goes back to reflecting the fact that you have natural armor from being a dragonborn. Your character sheet keeps up and you ultimately get more time to play the game. Huzzah!</p> <p>You need to swim through a sunken section of dungeon to fetch the quest's Thing.<br>You'll need to take off your magical Plate Armor of +1 Constitution to swim without sinking, of course. Taking it off will change your armor class, your speed and your constitution, which in turn changes your hitpoints and your constitution saving throw. Working out all those changes in the middle of a game will drag the game to a hault. <br> Fortunately you have a digital character sheet, so it's a matter of dragging your Plate Armor +1 Con from your "equipment" box to your "backpack" box and you're done. Your hitpoints change correctly, your saving throws are up to date, your armor class goes back to reflecting the fact that you have natural armor from being a dragonborn. Your character sheet keeps up and you ultimately get more time to play the game. Huzzah!</p>
<h2>Creating a Character</h2> <h2>Creating a Character</h2>
<ul> <ul>
<li>In the <a href={{pathFor route="characterList"}}>character list</a>, click the plus button, floating in the bottom left corner.</li> <li>In the <a href={{pathFor route="characterList"}}>character list</a>, click the plus button, floating in the bottom right corner.</li>
<li>Give your character a name, gender and race, these can be changed later if you change your mind. Then click the Add button</li> <li>Give your character a name, gender and race, these can be changed later if you change your mind. Then click the Add button</li>
<li>Your new character should open, with most of its attributes and abilities at zero.</li> <li>Your new character should open, with most of its attributes and abilities at zero.</li>
</ul> </ul>
@@ -40,7 +41,7 @@
<p>Your character currently doesn't have any ability scores, so lets fix that. Whether you roll your abilities or point-buy them, lets add a feature to represent where they came from</p> <p>Your character currently doesn't have any ability scores, so lets fix that. Whether you roll your abilities or point-buy them, lets add a feature to represent where they came from</p>
<ul> <ul>
<li>Navigate to the <emd>Features</emd> tab</li> <li>Navigate to the <emd>Features</emd> tab</li>
<li>Click the plus button in the bottom left to add a new feature</li> <li>Click the plus button in the bottom right to add a new feature</li>
<li>Give the Feature a name, like <em>Point Buy</em></li> <li>Give the Feature a name, like <em>Point Buy</em></li>
<li>Leave the feature as always enabled, don't limit its uses, and leave the description blank</li> <li>Leave the feature as always enabled, don't limit its uses, and leave the description blank</li>
<li>Click the <em>Add Effect</em> button</li> <li>Click the <em>Add Effect</em> button</li>
@@ -87,4 +88,5 @@
<li>Change your level and check that the <em>Stats</em> tab gets updated accordingly</li> <li>Change your level and check that the <em>Stats</em> tab gets updated accordingly</li>
</ul> </ul>
<p>You can try all sorts of calculations in your effects and in certain other places too. For example if you had some feature that is used a number of times equal to your wisdom modifier or 1, whichever is lower, you could limit its uses to <em>min(1, wisdomMod)</em> and the character sheet will figure it out for you, and update itself if you wisdom modifier happens to change later.</p> <p>You can try all sorts of calculations in your effects and in certain other places too. For example if you had some feature that is used a number of times equal to your wisdom modifier or 1, whichever is lower, you could limit its uses to <em>min(1, wisdomMod)</em> and the character sheet will figure it out for you, and update itself if you wisdom modifier happens to change later.</p>
</div>
</template> </template>

View File

@@ -9,23 +9,27 @@ evaluate = function(charId, string){
} }
//ability modifiers //ability modifiers
var abilityMods = [ var abilityMods = [
"STRENGTHMOD", "strengthMod",
"DEXTERITYMOD", "dexterityMod",
"CONSTITUTIONMOD", "constitutionMod",
"INTELLIGENCEMOD", "intelligenceMod",
"WISDOMMOD", "wisdomMod",
"CHARISMAMOD", "charismaMod",
]; ];
if (_.contains(abilityMods, sub.toUpperCase())){ if (_.contains(abilityMods, sub)){
var slice = sub.slice(0, -3); var slice = sub.slice(0, -3);
try {
return char.abilityMod(slice); return char.abilityMod(slice);
} catch (e){
return sub;
}
} }
//class levels //class levels
if (/\w+levels?\b/gi.test(sub)){ if (/\w+levels?\b/gi.test(sub)){
//strip out "level" //strip out "level"
var className = sub.replace(/levels?\b/gi, ""); var className = sub.replace(/levels?\b/gi, "");
var cls = Classes.findOne({charId: charId, name: className}); var cls = Classes.findOne({charId: charId, name: className});
return cls && cls.level; return cls && cls.level || sub;
} }
//character level //character level
if (sub.toUpperCase() === "LEVEL"){ if (sub.toUpperCase() === "LEVEL"){

View File

@@ -1,4 +1,6 @@
Meteor.publish("singleCharacter", function(characterId, userId){ Meteor.publish("singleCharacter", function(characterId){
userId = this.userId;
if (!userId) return [];
var char = Characters.findOne({ var char = Characters.findOne({
_id: characterId, _id: characterId,
$or: [ $or: [
@@ -29,5 +31,7 @@ Meteor.publish("singleCharacter", function(characterId, userId){
{fields: {username: 1}} {fields: {username: 1}}
), ),
]; ];
} else {
return [];
} }
}); });