private void content_MouseMove(object sender, MouseEventArgs e) { if (add_selectedtype != 0 && PreviewMod != null) { PreviewMod.setCords((int)e.GetPosition(content).X, (int)e.GetPosition(content).Y); } }
private void addMod(object sender, MouseEventArgs e) { //Put selected type on canvas if (add_selectedtype != 0) { try { Mod temp = GetType(add_selectedtype); temp.setCords((int)e.GetPosition(content).X, (int)e.GetPosition(content).Y); //in canvas? if (isValidPosition(temp.x, temp.y)) { ModList.Add(temp); showMod(temp, false); SelectedMod = temp; } add_selectedtype = 0; PreviewMod = null; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } } }