private void OnClickableMenuClosed(object sender, EventArgsClickableMenuClosed e) { Utils.DebugLog(e.PriorMenu.GetType().ToString() + " menu closed."); if (currentGiftHelper != null) { Utils.DebugLog("Closing current helper: " + currentGiftHelper.GetType().ToString()); UnsubscribeEvents(); currentGiftHelper.OnClose(); } }
private void OnClickableMenuClosed(IClickableMenu priorMenu) { Utils.DebugLog(previousMenu.GetType().ToString() + " menu closed."); if (currentGiftHelper != null) { Utils.DebugLog("[OnClickableMenuClosed] Closing current helper: " + currentGiftHelper.GetType().ToString()); UnsubscribeEvents(); currentGiftHelper.OnClose(); } }
private void OnClickableMenuChanged(object sender, EventArgsClickableMenuChanged e) { DebugPrintMenuInfo(e.PriorMenu, e.NewMenu); // Reset flag wasMenuClosedInvoked = false; previousMenu = e.PriorMenu; Type newMenuType = e.NewMenu.GetType(); if (currentGiftHelper != null && currentGiftHelper.IsOpen() && e.PriorMenu != null && e.PriorMenu.GetType() == newMenuType) { // resize event Utils.DebugLog("[OnClickableMenuChanged] Invoking resize event on helper: " + currentGiftHelper.GetType().ToString()); currentGiftHelper.OnResize(e.NewMenu); return; } if (giftHelpers.ContainsKey(newMenuType)) { // Close the current gift helper if (currentGiftHelper != null) { Utils.DebugLog("[OnClickableMenuChanged] Closing current helper: " + currentGiftHelper.GetType().ToString()); UnsubscribeEvents(); currentGiftHelper.OnClose(); } currentGiftHelper = giftHelpers[newMenuType]; if (!currentGiftHelper.IsInitialized()) { Utils.DebugLog("[OnClickableMenuChanged initialized helper: " + currentGiftHelper.GetType().ToString()); currentGiftHelper.Init(e.NewMenu); } if (currentGiftHelper.OnOpen(e.NewMenu)) { Utils.DebugLog("[OnClickableMenuChanged Successfully opened helper: " + currentGiftHelper.GetType().ToString()); // Only subscribe to the events if it opened successfully SubscribeEvents(); } } }