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.

FC - Settings bug

Featured Replies

Hi,

I'm making a FC in c# with the exemple there

Everythink is ok except for settings

when i click on settings, the box show settings but without default settings an when i try to save settings it only save the last data.

[Serializable]
public class ShamanSettings : Settings
{
    [Setting]
    [DefaultValue(true)]
    [Category("GHOST WOLF SETTINGS")]
    [DisplayName("Ghost Wolf")]
    [Description("Use Ghost Wolf")]
    public bool UGW { get; set; }

    [Setting]
    [DefaultValue(4)]
    [Category("GHOST WOLF SETTINGS")]
    [DisplayName("Use after X secondes")]
    [Description("Use Ghost Wolf after X secondes out of combat")]
    public int TGW { get; set; }

    [Setting]
    [DefaultValue(50)]
    [Category("GHOST WOLF SETTINGS")]
    [DisplayName("Mana required")]
    [Description("Use Ghost Wolf only if mana is superior or equal")]
    public int MGW { get; set; }

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

    public static ShamanSettings CurrentSetting { get; set; }

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

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

there is the full c# file

if somoene can help me to figure this out

 

Arkhan-ShamEnh.cs

Hello @arkhan, i've re-created it:



    public void ShowConfiguration()
    {
        CustomClass_ShamanSettings.Load();
        CustomClass_ShamanSettings.CurrentSetting.ToForm();
        CustomClass_ShamanSettings.CurrentSetting.Save();
    }





	public class CustomClass_ShamanSettings : Settings
    {
        public static CustomClass_ShamanSettings CurrentSetting { get; set; }
        public bool Save()
        {
            try
            {
                return Save(AdviserFilePathAndName("CustomClass_Shaman", ObjectManager.Me.Name + "." + Usefuls.RealmName));
            }
            catch (Exception e)
            {
                Logging.WriteError("CustomClass_ShamanSettings > Save(): " + e);
                return false;
            }
        }
        public static bool Load()
        {
            try
            {
                if (File.Exists(AdviserFilePathAndName("CustomClass_Shaman", ObjectManager.Me.Name + "." + Usefuls.RealmName)))
                {
                    CurrentSetting =
                        Load<CustomClass_ShamanSettings>(AdviserFilePathAndName("CustomClass_Shaman",
                                                                     ObjectManager.Me.Name + "." + Usefuls.RealmName));
                    return true;
                }
                CurrentSetting = new CustomClass_ShamanSettings
                {
                    UGW = true,
                    TGW = 4,
                    MGW = 50
                };
            }
            catch (Exception e)
            {
                Logging.WriteError("CustomClass_ShamanSettings > Load(): " + e);
            }
            return false;
        }

        [Setting]
        [Category("GHOST WOLF SETTINGS")]
        [DisplayName("Ghost Wolf")]
        [Description("Use Ghost Wolf")]
        public bool UGW { get; set; }

        [Setting]
        [Category("GHOST WOLF SETTINGS")]
        [DisplayName("Use after X secondes")]
        [Description("Use Ghost Wolf after X secondes out of combat")]
        public int TGW { get; set; }

        [Setting]
        [Category("GHOST WOLF SETTINGS")]
        [DisplayName("Mana required")]
        [Description("Use Ghost Wolf only if mana is superior or equal")]
        public int MGW { get; set; }

    }

 

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.