private void UpdateImage(PictureBox pb, int species, int form, int item, int gender) { if (!pb.Enabled) { pb.Image = null; return; } pb.Image = Util.getSprite(species, form, gender, item); }
private void changeSpecies(object sender, EventArgs e) { // Fetch the corresponding PictureBox to update string name = (sender as ComboBox).Name; int group = int.Parse(name[4] + "") - 1; int index = int.Parse(name[6] + ""); int species = (sender as ComboBox).SelectedIndex; Previews[group][index].Image = Util.scaleImage(Util.getSprite(species, 0, 0, 0), 3); }
private void showTeams(int i) { if (tr == null || randomizing) { return; } if (i >= tr.Team.Length) { pba[i].Image = null; return; } Bitmap rawImg = Util.getSprite(tr.Team[i].Species, tr.Team[i].Form, tr.Team[i].Gender, tr.Team[i].Item); pba[i].Image = Util.scaleImage(rawImg, 2); }
private void changeInto(object sender, EventArgs e) { if (loading || dumping) { return; } int index = sender is ComboBox?Array.IndexOf(rb, sender) : Array.IndexOf(fb, sender); int species = Array.IndexOf(specieslist, rb[index].Text); int form = (int)fb[index].Value; if (form == -1) { form = baseForms[species]; } pic[index].Image = Util.getSprite(species, form, 0, 0); }
private void updateSpeciesForm(object sender, EventArgs e) { if (loadingdata) { return; } var cur_pb = CB_TableID.SelectedIndex % 2 == 0 ? PB_DayTable : PB_NightTable; var cur_img = cur_pb.Image; object[][] source = sender is NumericUpDown ? (object[][])nup_spec : cb_spec; int table = Array.FindIndex(source, t => t.Contains(sender)); int slot = Array.IndexOf(source[table], sender); var cb_l = cb_spec[table]; var nup_l = nup_spec[table]; if (table == 8) { CurrentTable.AdditionalSOS[slot].Species = (uint)cb_l[slot].SelectedIndex; CurrentTable.AdditionalSOS[slot].Forme = (uint)nup_l[slot].Value; } CurrentTable.Encounters[table][slot].Species = (uint)cb_l[slot].SelectedIndex; CurrentTable.Encounters[table][slot].Forme = (uint)nup_l[slot].Value; using (var g = Graphics.FromImage(cur_img)) { int x = 40 * slot; int y = 30 * (table + 1); if (table == 8) { x = 40 * slot + 60; y = 270; } var pnt = new Point(x, y); g.SetClip(new Rectangle(pnt.X, pnt.Y, 40, 30), CombineMode.Replace); g.Clear(Color.Transparent); var enc = CurrentTable.Encounters[table][slot]; g.DrawImage(enc.Species == 0 ? Properties.Resources.empty : Util.getSprite((int)enc.Species, (int)enc.Forme, 0, 0), pnt); } cur_pb.Image = cur_img; }
public Bitmap GetTableImg() { var img = new Bitmap(10 * 40, 10 * 30); using (var g = Graphics.FromImage(img)) { g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit; for (int i = 0; i < Encounters.Length - 1; i++) { for (int j = 0; j < Encounters[i].Length; j++) { g.DrawImage((Encounters[i][j].Species == 0 ? Properties.Resources.empty : Util.getSprite((int)Encounters[i][j].Species, (int)Encounters[i][j].Forme, 0, 0)), new Point(40 * j, 30 * (i + 1))); } } for (int i = 0; i < Rates.Length; i++) { g.DrawString($"{Rates[i]}%", font, Brushes.Black, new PointF(40 * i + 10, 10)); } g.DrawString("Weather: ", font, Brushes.Black, new PointF(10, 280)); for (int i = 0; i < AdditionalSOS.Length; i++) { g.DrawImage((AdditionalSOS[i].Species == 0 ? Properties.Resources.empty : Util.getSprite((int)AdditionalSOS[i].Species, (int)AdditionalSOS[i].Forme, 0, 0)), new Point(40 * i + 60, 270)); } } return(img); }
private void changeSpecies(object sender, EventArgs e) { PB_PKM.Image = Util.getSprite(CB_Species.SelectedIndex, 0, 0, CB_Item.SelectedIndex); }
private static void getQuickFiller(PictureBox pb, trpoke7 pk) { Bitmap rawImg = Util.getSprite(pk.Species, pk.Form, pk.Gender, pk.Item, pk.Shiny); pb.Image = Util.scaleImage(rawImg, 2); }