Exemple #1
0
    public void Initialize()
    {
        if (!Products.ProductName.Equals("Quester") &&
            !Products.ProductName.Equals("Grinder") &&
            !Products.ProductName.Equals("Wholesome Professions WotLK"))
        {
            return;
        }

        isLaunched = true;

        isHorde = ToolBox.GetIsHorde();

        WFMSettings.Load();
        WFMDeepSettings.Load();

        if (AutoUpdater.CheckUpdate(version))
        {
            Logger.LogWarning("New version downloaded, restarting plugin, please wait");
            ToolBox.Restart();
            return;
        }

        Logger.Log($"Launching version {version} on client {ToolBox.GetWoWVersion()}");
        MovementManager.StopMoveNewThread();
        MovementManager.StopMoveToNewThread();

        FlightMasterDB.Initialize();
        WFMSetup.SetBlacklistedZonesAndOffMeshConnections();
        WFMSetup.DiscoverDefaultNodes();

        detectionPulse.DoWork += BackGroundPulse;
        detectionPulse.RunWorkerAsync();

        FiniteStateMachineEvents.OnRunState         += StateEventHandler;
        MovementEvents.OnMovementPulse              += MovementEventsOnMovementPulse;
        MovementEvents.OnSeemStuck                  += SeemStuckHandler;
        EventsLuaWithArgs.OnEventsLuaStringWithArgs += ToolBox.MessageHandler;

        EventsLua.AttachEventLua("TAXIMAP_OPENED", (e) => isFMMapOpen = true);
        EventsLua.AttachEventLua("TAXIMAP_CLOSED", (e) => isFMMapOpen = false);
        EventsLua.AttachEventLua("GOSSIP_SHOW", (e) => isGossipOpen   = true);
        EventsLua.AttachEventLua("GOSSIP_CLOSED", (e) => isGossipOpen = false);
    }
Exemple #2
0
 public static bool Load()
 {
     try
     {
         if (File.Exists(AdviserFilePathAndName("WFMSettings",
                                                ObjectManager.Me.Name + "." + Usefuls.RealmName)))
         {
             CurrentSettings = Load <WFMSettings>(
                 AdviserFilePathAndName("WFMSettings",
                                        ObjectManager.Me.Name + "." + Usefuls.RealmName));
             return(true);
         }
         CurrentSettings = new WFMSettings();
     }
     catch (Exception ex)
     {
         Logging.WriteDebug("WFMSettings > Load(): " + ex);
     }
     return(false);
 }
Exemple #3
0
 public void Settings()
 {
     WFMSettings.Load();
     WFMSettings.CurrentSettings.ToForm();
     WFMSettings.CurrentSettings.Save();
 }