Added the ability to Drag n Drop an actor's image to map (token).
some fix on editor for symbol
This commit is contained in:
@@ -70,6 +70,37 @@ export class ArmySheetL5r5e extends BaseSheetL5r5e {
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate a named TinyMCE text editor
|
||||
* @param {string} name The named data field which the editor modifies.
|
||||
* @param {object} options TinyMCE initialization options passed to TextEditor.create
|
||||
* @param {string} initialContent Initial text content for the editor area.
|
||||
* @override
|
||||
*/
|
||||
activateEditor(name, options = {}, initialContent = "") {
|
||||
if (["data.army_abilities", "data.supplies_logistics", "data.past_battles"].includes(name) && initialContent) {
|
||||
initialContent = game.l5r5e.HelpersL5r5e.convertSymbols(initialContent, false);
|
||||
}
|
||||
super.activateEditor(name, options, initialContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called upon form submission after form data is validated
|
||||
* @param event {Event} The initial triggering submission event
|
||||
* @param formData {Object} The object of validated form data with which to update the object
|
||||
* @returns {Promise} A Promise which resolves once the update operation has completed
|
||||
* @override
|
||||
*/
|
||||
async _updateObject(event, formData) {
|
||||
["data.army_abilities", "data.supplies_logistics", "data.past_battles"].forEach((name) => {
|
||||
if (!formData[name]) {
|
||||
return;
|
||||
}
|
||||
formData[name] = game.l5r5e.HelpersL5r5e.convertSymbols(formData[name], true);
|
||||
});
|
||||
return super._updateObject(event, formData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to events from the sheet.
|
||||
* @param {jQuery} html HTML content of the sheet.
|
||||
|
||||
Reference in New Issue
Block a user