txj-xyz / rs3-ability-tracker

A RuneScape 3 Ability Tracker for Streamers and all alike
3 stars 0 forks source link

Fix having more than one bar with multi style #23

Closed txj-xyz closed 2 years ago

txj-xyz commented 2 years ago

I have Range DW / Range 2h and Melee DW / Melee 2h

with toggle switching only uses range DW

txj-xyz commented 2 years ago

Perhaps check the names of the bars for switching per style

txj-xyz commented 2 years ago
if (
    config.toggleSwitching &&
    reference.icon.match(/(weapons\/(magic|melee|range)|slot-icons)/g) &&
    bind.bar.toLowerCase() !== this.activeBar?.toLowerCase() &&
    bind.bar.toLowerCase().includes(this.activeBar?.toLowerCase().split(' ')[0])
)
    this.activeBar = bind.bar;
bind.bar.toLowerCase().includes(this.activeBar?.toLowerCase().split(' ')[0])

Sloppy but is possible doing something like this to stay on the same style itself, perhaps its time to introduce pre-configured bars to keep on the same style

txj-xyz commented 2 years ago

I've added defaults to all new users that download to check against in the future, however checking is limited right now, seems as though the only smart way of staying on a style is if the style is included in the naming of the bars on both from / to sides.

https://github.com/txj-xyz/rs3-ability-tracker/blob/5cf46f00c0db650314348b7b59df17d04b608a40/src/default/config.json#L15-L22