internal static void DetachLuaEventHandlers() { GarrisonBase.Log("Detaching LUA Event Handlers"); //Lua.Events.DetachEvent("GARRISON_FOLLOWER_LIST_UPDATE", Coroutines.GarrisonFollowerListUpdate); Lua.Events.DetachEvent("GARRISON_MISSION_LIST_UPDATE", GARRISON_MISSION_LIST_UPDATE); Lua.Events.DetachEvent("GARRISON_MISSION_STARTED", GARRISON_MISSION_STARTED); Lua.Events.DetachEvent("GARRISON_MISSION_FINISHED", GARRISON_MISSION_FINISHED); Lua.Events.DetachEvent("GARRISON_MISSION_NPC_OPENED", GARRISON_MISSION_NPC_OPENED); Lua.Events.DetachEvent("GARRISON_MISSION_NPC_CLOSED", GARRISON_MISSION_NPC_CLOSED); Lua.Events.DetachEvent("GARRISON_SHOW_LANDING_PAGE", GARRISON_SHOW_LANDING_PAGE); Lua.Events.DetachEvent("GARRISON_BUILDING_ACTIVATABLE", GARRISON_BUILDING_ACTIVATABLE); Lua.Events.DetachEvent("SHIPMENT_CRAFTER_OPENED", SHIPMENT_CRAFTER_OPENED); Lua.Events.DetachEvent("SHIPMENT_CRAFTER_CLOSED", SHIPMENT_CRAFTER_CLOSED); Lua.Events.DetachEvent("LOOT_CLOSED", LOOT_CLOSED); Lua.Events.DetachEvent("LOOT_OPENED", LOOT_OPENED); Lua.Events.DetachEvent("QUEST_COMPLETE", QUEST_COMPLETE); Lua.Events.DetachEvent("QUEST_PROGRESS", QUEST_PROGRESS); Lua.Events.DetachEvent("QUEST_DETAIL", QUEST_DETAIL); Lua.Events.DetachEvent("QUEST_FINISHED", QUEST_FINISHED); Lua.Events.DetachEvent("QUEST_LOG_UPDATE", QUEST_LOG_UPDATE); Lua.Events.DetachEvent("QUEST_REMOVED", QUEST_REMOVED); Lua.Events.DetachEvent("QUEST_ACCEPTED", QUEST_ACCEPTED); Lua.Events.DetachEvent("QUEST_WATCH_UPDATE", QUEST_WATCH_UPDATE); Lua.Events.DetachEvent("GOSSIP_SHOW", GOSSIP_SHOW); Lua.Events.DetachEvent("GOSSIP_CLOSED", GOSSIP_CLOSED); Lua.Events.DetachEvent("TRADE_SKILL_CLOSE", TRADE_SKILL_CLOSE); Lua.Events.DetachEvent("TRADE_SKILL_SHOW", TRADE_SKILL_SHOW); Lua.Events.DetachEvent("BAG_UPDATE", BAG_UPDATE); Lua.Events.DetachEvent("PLAYERBANKSLOTS_CHANGED", PLAYERBANKSLOTS_CHANGED); Lua.Events.DetachEvent("PLAYERREAGENTBANKSLOTS_CHANGED", PLAYERREAGENTBANKSLOTS_CHANGED); Lua.Events.DetachEvent("ZONE_CHANGED", ZONE_CHANGED); Lua.Events.DetachEvent("ZONE_CHANGED_NEW_AREA", ZONE_CHANGED_NEW_AREA); Lua.Events.DetachEvent("MERCHANT_SHOW", MERCHANT_SHOW); Lua.Events.DetachEvent("MERCHANT_CLOSED", MERCHANT_CLOSED); Lua.Events.DetachEvent("CURRENT_SPELL_CAST_CHANGED", CURRENT_SPELL_CAST_CHANGED); Lua.Events.DetachEvent("UI_ERROR_MESSAGE", UI_ERROR_MESSAGE); Lua.Events.DetachEvent("CURRENCY_DISPLAY_UPDATE", CURRENCY_DISPLAY_UPDATE); Lua.Events.DetachEvent("MAIL_SHOW", MAIL_SHOW); Lua.Events.DetachEvent("MAIL_CLOSED", MAIL_CLOSED); Lua.Events.DetachEvent("TAXIMAP_OPENED", TAXIMAP_OPENED); Lua.Events.DetachEvent("TAXIMAP_CLOSED", TAXIMAP_CLOSED); LuaEventsAttached = false; }
public static void LoadSettings() { //Check for Config file if (!File.Exists(settingsPath)) { GarrisonBase.Log("No settings file found, now creating a new config from defaults at: " + settingsPath); SerializeToXML(CurrentSettings); } CurrentSettings = DeserializeFromXML(settingsPath); GarrisonBase.Log("Settings Loaded!"); }