public override void Click(UIMouseEvent evt) { slot.Click(evt); if (!Main.keyState.IsKeyDown(Main.FavoriteKey)) { if ((slot.craftPathCalculated || slot.craftPathsCalculated) && slot.craftPaths.Count > 0) { RecipeBrowserUI.instance.tabController.SetPanel(RecipeBrowserUI.Craft); CraftUI.instance.SetRecipe(slot.index); if (!RecipeBrowserUI.instance.ShowRecipeBrowser) { RecipeBrowserUI.instance.ShowRecipeBrowser = true; } } else { // inherited. RecipeCatalogueUI.instance.SetRecipe(slot.index); RecipeBrowserUI.instance.tabController.SetPanel(RecipeBrowserUI.RecipeCatalogue); RecipeCatalogueUI.instance.recipeGrid.Goto(delegate(UIElement element) { UIRecipeSlot itemSlot = element as UIRecipeSlot; return(itemSlot == slot); }, true); if (!RecipeBrowserUI.instance.ShowRecipeBrowser) { RecipeBrowserUI.instance.ShowRecipeBrowser = true; } } } }
public override int CompareTo(object obj) { UIRecipeSlot other = obj as UIRecipeSlot; if (favorited && !other.favorited) { return(-1); } if (!favorited && other.favorited) { return(1); } if (recentlyDiscovered && !other.recentlyDiscovered) { return(-1); } if (!recentlyDiscovered && other.recentlyDiscovered) { return(1); } if (favorited && other.favorited) { return(RecipeBrowserUI.instance.favoritedRecipes.IndexOf(this).CompareTo(RecipeBrowserUI.instance.favoritedRecipes.IndexOf(other))); } return(index.CompareTo(other.index)); }
public override void Click(UIMouseEvent evt) { slot.Click(evt); if (!(Main.keyState.IsKeyDown(Main.FavoriteKey) && Main.drawingPlayerChat)) { // inherited. RecipeCatalogueUI.instance.SetRecipe(slot.index); RecipeCatalogueUI.instance.recipeGrid.Goto(delegate(UIElement element) { UIRecipeSlot itemSlot = element as UIRecipeSlot; return(itemSlot == slot); }, true); RecipeBrowserUI.instance.ShowRecipeBrowser = true; } }
public int CompareToIgnoreIndex(UIRecipeSlot other) { if (favorited && !other.favorited) { return(-1); } if (!favorited && other.favorited) { return(1); } if (recentlyDiscovered && !other.recentlyDiscovered) { return(-1); } if (!recentlyDiscovered && other.recentlyDiscovered) { return(1); } if (favorited && other.favorited) { return(RecipeBrowserUI.instance.localPlayerFavoritedRecipes.IndexOf(this.index).CompareTo(RecipeBrowserUI.instance.localPlayerFavoritedRecipes.IndexOf(other.index))); } return(0); }
public UIMockRecipeSlot(UIRecipeSlot slot, float scale = 0.75f) : base(slot.item, scale) { this.slot = slot; }