[Userscript] Total Progress Bar (Allows Level Progress Removal)(aka 2Cool4Progress)

In include it’s just one argument as far as I am aware, i.e. 'Menu,Settings,ItemData'. Not sure if it also works as separate arguments, but I’ve only seen it as one.

Pretty sure that unless you specify a path it’s not categorized

edit: wait, you are correct, since those are the defaults, sorry. I was thinking about when you create the settings in the menu

I think you do this too in Heatmap.

I’ll give that a go :slight_smile:

Actually, I have two sections: Colors and General.
Should I not have done that?

EDIT: Uhm…

Just checked and I only have one argument wkof.include('Menu,Settings,ItemData,Apiv2')

That is fine, but then you will have to add paths to the settings if you want them to be separate. For example

ReverseOrder: {
    type: 'checkbox',
    label: 'Reverse Order?',
    hover_tip: 'Reverse the order of the categories',
    default: 'false',
    path: '@general.ReverseOrder'
}

Else they will all be stored in wkof.settings.total_progress. If that is what you want, then you have to remove the general from the defaults object.

Those syntax errors are so worthless. So hard to figure out where the error is from that.


Your defaults objects sets wkof.settings.total_progress as

general {
    setting1: ...,
    setting2: ...,
    ...
}

So currently you have to call them as wkof.settings.total_progress.general.settingN

But in the menu they are uncategorised, so your settings object will end up with duplicates when saved

general {
    setting1: ...,
    setting2: ...,
    ...
},
setting1: ...,
setting2: ...,
...

By specifying path you can make it so that the menu saves the setting inside general, or you can move the settings outside of general in the defaults and make it so that they are uncategorised.

2 Likes

I also just wanted to write that. It’s probably easier if you just remove general from the defaults. Then you can access the variables as you initially wanted (with wkof.settings.total_progression.LockedLessonColor), and don’t need to specify path in the settings dialog config.
The structure of the dialog box (general: {type: 'group', ...} and colors: {type: 'group', ...}) does not need to match the structure of the wkof.settings.total_progression object (or in other words: the structure is not automatically replicated and you would have to use path).

2 Likes

So that’s what I have too right?

I currently have this, but total_progression is still undefined. Not sure what’s going on!

I thought this should work

You seem to use wkof.include('Menu','Settings','ItemData') instead of wkof.include('Menu,Settings,ItemData'). So you pass three arguments instead of one string.
(I haven’t tested if this works too)

2 Likes

Oh! That might be it then

Other problems could be:

  • Are you calling load_settings()?
  • When are you trying to access wkof.settings.total_progression? Has wkof.Settings.load() finished by then? As far as I know this is an asynchronous function, so it is not guaranteed to have finished after you call load_settings().

Seems that might be it… Let’s try!

Got the menu back!!!

EDIT: Ok everything works now. Now I just need to have it updating when I press save. Thanks for your patience @Kumirei and @Sinyaven!

4 Likes

I just uploaded the new script. It finally has a good settings page thanks to the WKOF script.

For some reason, the changes will only go into effect when you reload your page, still finding out how to change that one :man_shrugging:

3 Likes

For it to update dynamically you need to create a function which updates the bar and use it as a callback function for on_save

You are currently calling fetch_and_update() when the changed settings are saved, but I don’t think that fetch_and_update() does anything useful?

And in case you want to add a button for resetting to default colors:

  1. Define your default colors:
let defaultColors = {
	LockedLessonColor: '#545454',
	Apprentice1Color: ...
}
  1. Add the button to the settings menu:
resetColor: {type: "button", label: "Reset to default", text: "Reset", on_click: () => {Object.assign(wkof.settings.total_progression, defaultColors); dialog.refresh();}}

It seems that the Open Framework automatically reverts your changes to wkof.settings.total_progression if you click “cancel”. At least it seemed to work in my ConfusionGuesser script.

EDIT: nvm, you already have several color presets in a dropdown menu

2 Likes

Thanks for the tips, I will look into that. I did see that fetch and update basically did nothing, so I will be trying to find a way that only refreshes my little part of the webpage. So far, I think I will give the main div a class, and just remove that class before putting the div back :relaxed:

Hi Pep, I’m back on my computer now. Here’s how it looks

And my setting for your script is

1 Like

Currently, only the inside the progress bar section works, so I should put WIP there, sorry for that.

Also you found the GREEN SQUARE OF TESTINY!

1 Like

Ok, I got the settings to work properly! They now update when you press save :slight_smile:

Presets work now too!!

2 Likes

If I’m correct, the positions should all work now :slight_smile:

Even better, everything works now!!! Yay! Have fun with it!

Also thanks a bunch to @Sinyaven and @Kumirei for helping me when all things got confuzzling.

5 Likes

lol akkolul

1 Like

Thank you for making the script!
Would it be possible to have an option that merges all the 4 apprentice levels in one, and the two guru levels? I don’t think I need to know all the different SRS stages. (I mean I can change the colors on my own but the percentages aren’t centered now. Or you could give me an option to hide the percentages, that would work too :slight_smile:)

2 Likes

It still doesn’t show up correctly here.

Edit: After I set up the colour to default WK. It’s working fine. But I can’t scroll down my page on WK Dashboard. Closed the tab. Opened a new tab. And here it is. Working fine.

I’m ok if rfindley’s bubble bubbles of turtles (WK Dashboard Progress Plus) are still showing up since I’m not 60 yet. There should prolly be option to let it clearly show rfindley’s bubbles of turtles for non 60, or not :thinking: Since it’s clear I’m not 60 yet.

The most important thing for me is that kitsun default progression bar is beautifully there along with Kumi’s level by SRS. Mmm… Dreamy!

Thanks for maintaining this script!

3 Likes