(API) MistyBars

  • plamzi
  • plamzi's Avatar Topic Author
  • Offline
  • Administrator
20 Feb 2014 14:58 - 06 Apr 2014 14:32 #1 by plamzi
(API) MistyBars was created by plamzi
Creates a draggable graphic status window that looks like this:

EXAMPLE USE (minimal):
new MistyBars();

process: function() { /* your custom data processing code */ }
If supplied, this will be the function used to intercept incoming location data from the server. The default processing function is a GMCP parser for Aardwolf-style stat data, with some extended options. To drive the bar showing progress to next level, you can pass the total experience the user needs at this level inside 'enl'. You have to also pass the experience left to next level inside 'tnl'. If you want to display lifetime experience, pass it inside 'exp' and set 'tnl' to -1.
listen: 'event name'
If supplied, this will be the event for which the processing function will listen. Default is 'gmcp'.


As the table above indicates, this module has built-in flexibility when it comes to how you receive and parse the data that drives it. When you initialize MistyBars, you can specify that you want to listen for msdp data, for example, and then pass a custom function that will parse your data:
new MistyBars({
listen 'msdp',
process: function(d) {
/* parse your data here, populating the object cm with a character's max stats, cv with a char's vitals data, cs with a char's status data. the details for what goes into each object you can get from Aardwolf's gmcp wiki page or from playing Bedlam with &debug=1 and looking at the console log. you can reset these objects fully or update them incrementally, whichever you need. */
/* when you have all the data that requires / allows a redraw: */
/* return the msdp data to other event hooks if you need to use it again: */
return d;
Last edit: 06 Apr 2014 14:32 by plamzi.
The topic has been locked.