コード例 #1
0
ファイル: RecipeCompound.xaml.cs プロジェクト: update88/mtb
 private void recipeGrid_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyboardDevice.Modifiers == ModifierKeys.Control && e.Key == Key.S)
     {
         compound_recipe recipe = compoundRecipeList.SelectedItem as compound_recipe;
         if (recipe != null)
         {
             WorldWorker.SaveCompoundRecipe(recipe);
             LegacyToolBox.AppendMessage("Compound Recipe " + recipe.ID + " Saved.");
         }
     }
 }
コード例 #2
0
 public static void DeleteCompoundRecipe(compound_recipe recipe)
 {
     var r = (from d in DB.LEGACY.compound_recipe where d.ID == recipe.ID select d).SingleOrDefault();
     if (r != null)
     {
         DB.LEGACY.compound_recipe.Remove(r);
         DB.LSaveA();
     }
 }
コード例 #3
0
 public static compound_recipe CreateNewCompoundRecipe(int skill)
 {
     int maxID = (from d in DB.LEGACY.compound_recipe select d.ID).Max() + 1;
     compound_recipe recipe = new compound_recipe();
     recipe.ID = maxID;
     recipe.ReqSkill = skill;
     DB.LEGACY.compound_recipe.Add(recipe);
     DB.LSaveA();
     return recipe;
 }
コード例 #4
0
 public static void SaveCompoundRecipe(compound_recipe recipe)
 {
     var old = (from d in DB.LEGACY.compound_recipe where d.ID == recipe.ID select d).SingleOrDefault();
     if (old != null)
         DB.LEGACY.compound_recipe.Remove(old);
     DB.LSave();
     DB.LEGACY.compound_recipe.Add(recipe);
     DB.LSaveA();
 }
コード例 #5
0
 public static compound_recipe CopyCompoundRecipe(compound_recipe recipe)
 {
     int maxID = (from d in DB.LEGACY.compound_recipe select d.ID).Max() + 1;
     compound_recipe newRecipe = new compound_recipe();
     newRecipe.ID = maxID;
     newRecipe.CDCategory = recipe.CDCategory;
     newRecipe.Comment = recipe.Comment;
     newRecipe.Cooldown = recipe.Cooldown;
     newRecipe.Count1 = recipe.Count1;
     newRecipe.Count2 = recipe.Count2;
     newRecipe.Count3 = recipe.Count3;
     newRecipe.Count4 = recipe.Count4;
     newRecipe.Count5 = recipe.Count5;
     newRecipe.Count6 = recipe.Count6;
     newRecipe.Count7 = recipe.Count7;
     newRecipe.Count8 = recipe.Count8;
     newRecipe.Enabled = recipe.Enabled;
     newRecipe.Item1 = recipe.Item1;
     newRecipe.Item2 = recipe.Item2;
     newRecipe.Item3 = recipe.Item3;
     newRecipe.Item4 = recipe.Item4;
     newRecipe.ItemCount1 = recipe.ItemCount1;
     newRecipe.ItemCount2 = recipe.ItemCount2;
     newRecipe.ItemCount3 = recipe.ItemCount3;
     newRecipe.ItemCount4 = recipe.ItemCount4;
     newRecipe.Reagent1 = recipe.Reagent1;
     newRecipe.Reagent2 = recipe.Reagent2;
     newRecipe.Reagent3 = recipe.Reagent3;
     newRecipe.Reagent4 = recipe.Reagent4;
     newRecipe.Reagent5 = recipe.Reagent5;
     newRecipe.Reagent6 = recipe.Reagent6;
     newRecipe.Reagent7 = recipe.Reagent7;
     newRecipe.Reagent8 = recipe.Reagent8;
     newRecipe.ReqClass = recipe.ReqClass;
     newRecipe.ReqSkill = recipe.ReqSkill;
     newRecipe.ReqSkillValue = recipe.ReqSkillValue;
     newRecipe.ReqSpellFocus = recipe.ReqSpellFocus;
     newRecipe.SkillUpYellow = recipe.SkillUpYellow;
     newRecipe.SkillUpGreen = recipe.SkillUpGreen;
     newRecipe.ReqTool1 = recipe.ReqTool1;
     newRecipe.ReqTool2 = recipe.ReqTool2;
     newRecipe.ReqTotem1 = recipe.ReqTotem1;
     newRecipe.ReqTotem2 = recipe.ReqTotem2;
     DB.LEGACY.compound_recipe.Add(newRecipe);
     DB.LSaveA();
     return newRecipe;
 }