StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Rob  
#1 Posted : Tuesday, June 11, 2019 12:37:56 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,349
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
This loops through all gestures and builds a list of usage, then copies the results to the clipboard.

This is just per drawing, not based on the action. For example, if you had the same gesture in two actions they both are counted here.

Code:
//Array to hold values
var tuples = [];

//Loop through all gestures and build list/count
for(j=0;j<sp_config.Gestures.Count;j++){
    tuples.push([sp_config.Gestures[j].Name, sp_config.Gestures[j].MatchCount]);
}

//Sort array
tuples.sort(function(a, b) {
    a = a[1];
    b = b[1];
    return a < b ? -1 : (a > b ? 1 : 0);
});

//Build output string and copy to clipboard
var output = "";
for (var i = tuples.length-1; i >= 0; i--) {
    output += tuples[i][1] + ' - ' + tuples[i][0] + '\r\n';
}
clip.SetText(output);
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.