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.

Settings support for XML fight classes

  • Version: All
  • Product: Fight Classes
  • Type: Suggestion
  • Status: Awaiting Feedback

In current implementation i can add to XML fight class additional C# code like this and use settings window:

[Serializable]
public class ShadowPriestSettings : Settings{
...bla bla bla
}

this works with settings class name exactly equals [FightClass]Settings where [FightClass] is name, declared in "General Settings" -> "Fight Class Name". It would be nice to use any name, with additional C# code like this:

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

[Serializable]
public class InnerSettings : Settings{
... bla bla bla
}

For now, it not works, robot says "Type 'Main' already defines a member called 'ShowConfiguration' with the same parameter types"

Is there any legal option to use settings with XML fight class?

User Feedback

Recommended Comments

kergudu

Members

It tricky but possible :wink:

This is additional C#, nothing special, only proof (with egyptian brackets, because i am Java programmer :smile:)

Spoiler

[Serializable]
public class TestSettings : Settings {

  [Setting, DefaultValue(0)]
  [Category("Test")]
  [DisplayName("Test Spell")]
  [Description("Print here any known spell")]
  public string testSpell { get; set; }

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

  public static TestSettings CurrentSetting { get; set; }

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

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

public bool castSpell() {
  SpellManager.CastSpellByNameLUA(Main.TestSettings.CurrentSetting.testSpell);
  Usefuls.WaitIsCasting();
  return true;
}

 

And this is fight class: testClass.xml 

Load it, open Settings and type any known spell. For example, "Steady Shot" for hunter. Then go to target dumy and check.

Just want to use the same "legally", without special names for settings class. Maybe one more property in fight class

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.