Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[VANILLA] Custom settings not saved properly

  • Version: All
  • Product: WRobot General
  • Type: Bug
  • Status: Not a Bug

Here is an example of class I use :

public class PriestSettings : Settings
{
    [Setting]
    [DefaultValue(true)]
    [Category("Movements")]
    [DisplayName("Follow Mode")]
    [Description("Follow the party Leader. Only working when in party")]
    public bool FollowMode { get; set; }


    [Setting]
    [DefaultValue(80)]
    [Category("Heal")]
    [DisplayName("Lesser Heal Treshold")]
    [Description("Limit of Life under which bot trigger LesserHeal.In percent")]
    public double LesserHealTreshold { get; set; }


    private PriestSettings()
    {
        ConfigWinForm(new System.Drawing.Point(400, 400), "Priest " + Translate.Get("Settings"));
    }

    public static PriestSettings CurrentSetting { get; set; }

    public bool Save()
    {
        try
        {
            return Save(AdviserFilePathAndName("McRo-Priest", ObjectManager.Me.Name + "." + Usefuls.RealmName));
        }
        catch (Exception e)
        {
            Logging.WriteError("PriestSettings > Save(): " + e);
            return false;
        }
    }

    public static bool Load()
    {
        try
        {
            if (File.Exists(AdviserFilePathAndName("McRo-Priest", ObjectManager.Me.Name + "." + Usefuls.RealmName)))
            {
                CurrentSetting =
                    Load<PriestSettings>(AdviserFilePathAndName("McRo-Priest",
                                                                 ObjectManager.Me.Name + "." + Usefuls.RealmName));
                return true;
            }
            CurrentSetting = new PriestSettings();
        }
        catch (Exception e)
        {
            Logging.WriteError("PriestSettings > Load(): " + e);
        }
        return false;
    }
}

When trying to change a value, in the resulting XML: 

  • the value changed is never saved. If it existed in the file it is totaly deleted
  • the value non targeted by the change may be delete also (randomly)

 

 

User Feedback

Recommended Comments

Hello, do you call method "Save()" ? Do you get error in your log?

DonaldMacRonald

Members

Hello,

Yes I do call Save(), at the end of the sowconfiguration, and no curiously I have no message, even in debug mode.

DonaldMacRonald

Members

Oddly, when the configuration Panels open, the current state of the file isn't correctly displayed too.
Some variables are displayed false whereas they are set at true in  the saved file.

No correlation between default values.

Matenia

Elite user

This works when making the Settings constructor public, for some reason.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.