Jump to content

Enable/Disable command bug

Pending 1.5.1

mecwerks
mecwerks

Posted (edited)

Hello,
Currently if you try to enable/disable profiles in quickish succession it does not work. When trying to enable about 5 profiles only the first and last ones enable. When running 3 or so manually from console, it inconsistently disables a previously enabled one. Is there a better way to set the AutoStart option on multiple profiles from another plugin?

Thanks in advance.

Edited by mecwerks
  • Administrator
Steenamaroo

Posted

Hi,
Are you using quotation marks around profile names where "There are spaces"?
If so, is it profile names with spaces which are failing?
It may be that I need to insert_underscores_behind the scenes.

Let me know, please. I'll look into it today for you.

Thanks for reporting.

mecwerks

Posted

Hello,

The profile names are the default monument names and yes I am using quotes for it. I think the issue may be due to ReloadData being called without UI=true so the data does not save first or maybe an issue with the reloading of the config when this is ran to quickly one after the other.

  • Administrator
Steenamaroo

Posted (edited)

I see what's happening.
We're not saving back to disk immediately after the change and because enable/disable is tied in to ReloadProfile(),
it's re-reading from data file for every command you run.

For Default profiles the result should be forgetting all your enable/disable changes except the last one.

It's not related to the
if (UI)
    SaveData();

That's there to catch changes you make in UI before clicking "Reload Profile",
since, ordinarily, UI changes are saved down when you close it.


I think taking out the SaveData() call in ReloadData, and moving it to the bottom (so it always runs) will solve the problem,
although it's still inefficient.


A better solution, which I'll look in to, would be to allow for an enable/disable string of profiles as one command,
so it reads the files fresh once, makes all the changes, then saves back once.

Are you able and willing to test the quick-fix?
If you need me to mod it and send it over let me know and I'll do that today.

Edited by Steenamaroo
  • Administrator
Steenamaroo

Posted (edited)

Problem solved and tested.
No need for any changes to how you're calling enable/disable.

 

There's a required update for wipe on Thursday, so this fix will be in that update.
Thanks for flagging this. 👍

Edited by Steenamaroo
mecwerks

Posted

Awesome, appreciate it! Definitely don't mind helping to test future updates if you would like. 

Thanks again.

  • Like 1

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
2.5m
Total downloads
Customers
11.3k
Customers served
Files Sold
161.4k
Total sales
Payments
3.5m
Processed total
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.