improve paint_editor event

There was only one paint editor event and it only distig,nuished between character or background. This change distinguishes between editing a background from the library vs user-created. For characters it distinguishes between new and edit, and between library assets or user-created.
This commit is contained in:
Chris Garrity 2019-10-23 08:58:53 -04:00
parent b6a1569438
commit 2c4520e9e1

View file

@ -161,7 +161,16 @@ export default class Paint {
}
static open (bkg, md5, sname, cname, cscale, sw, sh) {
iOS.analyticsEvent('editor', 'paint_editor_opened', bkg ? 'bkg' : 'character');
let action = '';
let label = '';
if (bkg) {
action = 'edit_background';
label = (md5 in MediaLib.keys) ? md5 : 'user_background';
} else {
action = sname ? 'edit_character' : 'new_character';
label = (md5 in MediaLib.keys) ? md5 : 'user_character';
}
iOS.analyticsEvent('paint_editor', action, label);
PaintUndo.buffer = [];
PaintUndo.index = 0;
maxZoom = 5;