Use embedded property dialog in tree tab. Colors for creature properties
This commit is contained in:
@@ -74,6 +74,7 @@ const insertProperty = new ValidatedMethod({
|
||||
name: 'CreatureProperties.methods.insert',
|
||||
validate: null,
|
||||
run({creatureProperty}) {
|
||||
delete creatureProperty._id;
|
||||
assertPropertyEditPermission(creatureProperty, this.userId);
|
||||
let _id = CreatureProperties.insert(creatureProperty);
|
||||
let property = CreatureProperties.findOne(_id);
|
||||
@@ -81,6 +82,23 @@ const insertProperty = new ValidatedMethod({
|
||||
},
|
||||
});
|
||||
|
||||
const duplicateProperty = new ValidatedMethod({
|
||||
name: 'CreatureProperties.methods.duplicate',
|
||||
validate: new SimpleSchema({
|
||||
_id: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
}
|
||||
}).validator(),
|
||||
run({_id}) {
|
||||
let creatureProperty = CreatureProperties.findOne(_id);
|
||||
assertPropertyEditPermission(creatureProperty, this.userId);
|
||||
delete creatureProperty._id;
|
||||
CreatureProperties.insert(creatureProperty);
|
||||
recomputeCreatures(creatureProperty);
|
||||
},
|
||||
});
|
||||
|
||||
const insertPropertyFromLibraryNode = new ValidatedMethod({
|
||||
name: 'CreatureProperties.methods.insertPropertyFromLibraryNode',
|
||||
validate: new SimpleSchema({
|
||||
@@ -290,6 +308,7 @@ export default CreatureProperties;
|
||||
export {
|
||||
CreaturePropertySchema,
|
||||
insertProperty,
|
||||
duplicateProperty,
|
||||
insertPropertyFromLibraryNode,
|
||||
updateProperty,
|
||||
damageProperty,
|
||||
|
||||
Reference in New Issue
Block a user