private void ApplyTemplate( ITemplate tpl ) { EItemType type = (EItemType)tpl.cmbType; cmbType.SelectedIndex = tpl.cmbType; cmbItemIcon.SelectedIndex = tpl.cmbItemIcon; cmbQuality.SelectedIndex = tpl.cmbQuality; cmbASPD.SelectedIndex = tpl.cmbASPD; numEnchant.Value = tpl.numEnchant; if( type == EItemType.Lapis ) { Lapi tplLapi = new Lapi( tpl.LapisType, tpl.LapisLevel ); int i = 0; foreach( Lapi l in LapiComboBox.Lapis ) { if( l.Name == tplLapi.Name ) { cmbLapi.SelectedIndex = i; break; } i++; } } cmbSockel1.SelectedIndex = tpl.cmbSockel1; cmbSockel2.SelectedIndex = tpl.cmbSockel2; cmbSockel3.SelectedIndex = tpl.cmbSockel3; cmbSockel4.SelectedIndex = tpl.cmbSockel4; cmbSockel5.SelectedIndex = tpl.cmbSockel5; cmbSockel6.SelectedIndex = tpl.cmbSockel6; txtGold.SetGold( tpl.txtGold ); if( type != EItemType.Lapis && type != EItemType.Lapisa ) txtName.Text = tpl.txtName; txtANG1.Text = tpl.txtANG1; txtANG2.Text = tpl.txtANG2; txtHaltbarkeit.Text = tpl.txtHaltbarkeit; txtLP.Text = tpl.txtLP; txtMP.Text = tpl.txtMP; txtAP.Text = tpl.txtAP; txtGES.Text = tpl.txtGES; txtGLÜ.Text = tpl.txtGLÜ; txtSTR.Text = tpl.txtSTR; txtWEI.Text = tpl.txtWEI; txtINT.Text = tpl.txtINT; txtABW.Text = tpl.txtABW; txtLPEP4.Text = tpl.txtLPEP4; txtMPEP4.Text = tpl.txtMPEP4; txtAPEP4.Text = tpl.txtAPEP4; txtGESEP4.Text = tpl.txtGESEP4; txtGLÜEP4.Text = tpl.txtGLÜEP4; txtSTREP4.Text = tpl.txtSTREP4; txtWEIEP4.Text = tpl.txtWEIEP4; txtINTEP4.Text = tpl.txtINTEP4; txtABWEP4.Text = tpl.txtABWEP4; txtResistenz.Text = tpl.txtResistenz; txtSeller.Text = tpl.txtSeller; }
private ToolStripMenuItem TemplateItem_OnAdd( ITemplate Template, ToolStripMenuItem Item ) { EItemType type = (EItemType)Template.cmbType; if( type != EItemType.Lapis && type != EItemType.Lapisa ) Item.Image = GetTemplateItemImage( type, Template.cmbItemIcon ); else if( type == EItemType.Lapis ) { Lapi l = new Lapi( Template.LapisType, Template.LapisLevel ); Item.Image = GetTemplateItemImage( type, l.ToImageIndex() + 1 ); // 0 = free slot } else if( type == EItemType.Lapisa ) Item.Image = GetTemplateItemImage( type, Template.cmbLapisa ); return Item; }