private void createRecipeButton_Click(object sender, EventArgs e) { RecipeViewer rv = new RecipeViewer(new Recipe(), baseRecipe_Assign); MessageBox.Show("You do not have to fill out the Warm Up, Verb ID, Linked Recipes or effects portion, just the: ID, Label, Start Description, Description, and Requirements. You do not need to include desire: -1 or ritual: 1 in Requirements."); rv.Show(); }
private void CreateRecipeButton_Click(object sender, EventArgs e) { Recipe startSummonRecipe = new Recipe() { actionId = "work", requirements = new Dictionary <string, string>() { { "desire", "-1" }, { "ritual", "1" } }, warmup = 60, effects = new Dictionary <string, string> { { BaseSummon.ID, "1" } }, linked = new List <RecipeLink> { new RecipeLink("summoninglosingcontrol", 30, false, null, null) }, craftable = true }; RecipeViewer rv = new RecipeViewer(startSummonRecipe, BaseRecipe_Assign, RecipeType.Generator, null); MessageBox.Show("The fields with red labels are required.", "Required Values"); rv.Show(); }
public async Task CraftAsync([Name("recipe_id")] Recipe recipe) { /* * if (!ItemHelper.RecipeExists(recipeId)) * { * await Context.Channel.WarnAsync("Could not find the specified recipe."); * return; * }*/ if (!CraftHelper.CanCraft(Context.Account, recipe)) { var notice = new StringBuilder(); notice.AppendLine(Format.Warning("You are unable to craft this recipe.")); notice.AppendLine("\n> **Missing Components**"); foreach ((string itemId, int amount) in CraftHelper.GetMissingFromRecipe(Context.Account, recipe)) { notice.AppendLine(RecipeViewer.WriteRecipeComponent(itemId, amount)); } await Context.Channel.SendMessageAsync(notice.ToString()); return; } if (CraftHelper.Craft(Context.Account, recipe)) { var result = new StringBuilder(); result.AppendLine($"> 📑 **{ItemHelper.NameOf(recipe.Result.ItemId)}**{(recipe.Result.Amount > 1 ? $" (x**{recipe.Result.Amount:##,0}**)" : "")}"); result.AppendLine("> Successfully crafted an item!"); result.AppendLine("\n> **Losses**"); foreach ((string itemId, int amount) in recipe.Components) { string icon = ItemHelper.IconOf(itemId); if (!Check.NotNull(icon)) { icon = "•"; } result.AppendLine($"{icon} **{ItemHelper.NameOf(itemId)}**{(amount > 1 ? $" (x**{amount:##,0}**)" : "")}"); } await Context.Channel.SendMessageAsync(result.ToString()); return; } await Context.Channel.SendMessageAsync(Format.Warning("An unknown error has occured when crafting this recipe.")); }
public async Task ViewRecipeAsync([Name("recipe_id")] Recipe recipe) { /* * if (!ItemHelper.RecipeExists(recipeId)) * { * await Context.Channel.WarnAsync("Could not find the specified recipe."); * return; * }*/ await Context.Channel.SendMessageAsync(RecipeViewer.ViewRecipeInfo(Context.Account, recipe)); }
private void resultsListBox_MouseDoubleClick(object sender, MouseEventArgs e) { if (resultsListBox.SelectedItem == null) { return; } if (Utilities.recipeExists(resultsListBox.SelectedItem.ToString())) { RecipeViewer ev = new RecipeViewer(Utilities.getRecipe(resultsListBox.SelectedItem.ToString()), null); ev.Show(); } }
private void inducesDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { string id = inducesDataGridView.Rows[e.RowIndex].Cells[0].Value as String; if (id == null) { return; } RecipeViewer rv = new RecipeViewer(Utilities.getRecipe(id), null); rv.Show(); }
private void OpenRecipeButton_Click(object sender, EventArgs e) { if (Utilities.RecipeExists(idTextBox.Text)) { RecipeViewer rv = new RecipeViewer(Utilities.GetRecipe(idTextBox.Text), null, null); rv.Show(); } else { MessageBox.Show("That recipe does not currently exist."); } }
private void ResultsListBox_MouseDoubleClick(object sender, MouseEventArgs e) { if (resultsListBox.SelectedItem == null) { return; } Recipe selectedRecipe = resultsWithId[resultsListBox.SelectedItem.ToString()]; RecipeViewer ev = new RecipeViewer(selectedRecipe.Copy(), null, null); ev.Show(); }
private void InspectSuccessRecipeButton_Click(object sender, EventArgs e) { RecipeViewer rv = new RecipeViewer(SucceedSummon, null, null); rv.Show(); }
public async Task ViewRecipesAsync() { await Context.Channel.SendMessageAsync(RecipeViewer.View(Context.Account)); }
private void inspectBaseRecipeButton_Click(object sender, EventArgs e) { RecipeViewer rv = new RecipeViewer(startSummon, null); rv.Show(); }
private void openRecipeButton_Click(object sender, EventArgs e) { RecipeViewer rv = new RecipeViewer(Utilities.getRecipe(idTextBox.Text), null); rv.Show(); }