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); }
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); }
public void Settings() { WFMSettings.Load(); WFMSettings.CurrentSettings.ToForm(); WFMSettings.CurrentSettings.Save(); }