private void btnGold_Click(object sender, EventArgs e) { this.chatPreview1.RenderText("&6Color Preview"); ColorRelatedButton b = sender as ColorRelatedButton; Relation = b.Relation; }
private void btnDarkGreen_Click( object sender, EventArgs e ) { this.chatPreview1.RenderText( "&2Color Preview" ); ColorRelatedButton b = sender as ColorRelatedButton; Relation = b.Relation; }
public ColorSelectionDialog(ColorRelation preDraw) { if(preDraw == null) throw new ArgumentNullException("preDraw", "Cannot be null"); this.preDraw = preDraw; InitializeComponent(); this.chatPreview1.RenderText(preDraw.MinecraftColorCode + "Color Preview"); }
public ColorSelectionDialog(ColorRelation preDraw) { if (preDraw == null) { throw new ArgumentNullException("preDraw", "Cannot be null"); } this.preDraw = preDraw; InitializeComponent(); this.chatPreview1.RenderText(preDraw.MinecraftColorCode + "Color Preview"); }
void colorDialog_FormClosing( object sender, FormClosingEventArgs e ) { ColorSelectionDialog dialog = sender as ColorSelectionDialog; if ( dialog == null ) return; if ( dialog.DialogResult == System.Windows.Forms.DialogResult.Cancel ) return; Relation = dialog.Relation; if (OnColorRelationChanged != null) OnColorRelationChanged(); }
private void lstPlayers_SelectedIndexChanged(object sender, EventArgs e) { selectedPlayer = Player.Find(lstPlayers.SelectedItem.ToString().Substring(1)); bool enabled = true; #if !DEBUG if (selectedPlayer == null) { enabled = false; } #endif this.grpInfo.Enabled = enabled; this.btnColor.Enabled = enabled; this.btnTitleColor.Enabled = enabled; this.txtTitle.Enabled = enabled; this.btnEditMap.Enabled = enabled; this.btnEditRank.Enabled = enabled; this.btnBan.Enabled = enabled; this.btnKick.Enabled = enabled; this.btnUndo.Enabled = enabled; this.txtChat.Enabled = enabled; this.txtUndo.Enabled = enabled; this.txtStatus.Enabled = enabled; this.label1.Enabled = enabled; this.label2.Enabled = enabled; this.label3.Enabled = enabled; this.label4.Enabled = enabled; this.label5.Enabled = enabled; this.label6.Enabled = enabled; this.label7.Enabled = enabled; this.label8.Enabled = enabled; if (!enabled) { return; } #if DEBUG btnColor.Relation = ColorRelation.Red; btnTitleColor.Relation = ColorRelation.Green; #else btnColor.Relation = ColorRelation.FindColorRelationByMinecraftCode(selectedPlayer.Color); btnTitleColor.Relation = ColorRelation.FindColorRelationByMinecraftCode(selectedPlayer.ExtraData["TitleColor"].ToString()); #endif }
void colorDialog_FormClosing(object sender, FormClosingEventArgs e) { ColorSelectionDialog dialog = sender as ColorSelectionDialog; if (dialog == null) { return; } if (dialog.DialogResult == System.Windows.Forms.DialogResult.Cancel) { return; } Relation = dialog.Relation; }
private void ColorSelectionDialog_Load(object sender, EventArgs e) { this.btnBlack.Relation = ColorRelation.Black; this.btnBlue.Relation = ColorRelation.Blue; this.btnDarkBlue.Relation = ColorRelation.Navy; this.btnDarkGreen.Relation = ColorRelation.Green; this.btnDarkGrey.Relation = ColorRelation.Gray; this.btnDarkRed.Relation = ColorRelation.Maroon; this.btnDarkTeal.Relation = ColorRelation.Teal; this.btnGold.Relation = ColorRelation.Gold; this.btnGray.Relation = ColorRelation.Silver; this.btnLightGreen.Relation = ColorRelation.Lime; this.btnPink.Relation = ColorRelation.Pink; this.btnPurple.Relation = ColorRelation.Purple; this.btnRed.Relation = ColorRelation.Red; this.btnTeal.Relation = ColorRelation.Aqua; this.btnWhite.Relation = ColorRelation.White; this.btnYellow.Relation = ColorRelation.Yellow; }
private ChatColor relationToColor(ColorRelation r) { ChatColor c; switch (r.Text) { case "Black": c = ChatColor.Black; break; case "Navy": c = ChatColor.Dark_Blue; break; case "Green": c = ChatColor.Dark_Green; break; case "Teal": c = ChatColor.Dark_Aqua; break; case "Maroon": c = ChatColor.Dark_Red; break; case "Purple": c = ChatColor.Purple; break; case "Gold": c = ChatColor.Orange; break; case "Silver": c = ChatColor.Gray; break; case "Gray": c = ChatColor.Dark_Gray; break; case "Blue": c = ChatColor.Indigo; break; case "Lime": c = ChatColor.Bright_Green; break; case "Aqua": c = ChatColor.Aqua; break; case "Red": c = ChatColor.Red; break; case "Pink": c = ChatColor.Pink; break; case "Yellow": c = ChatColor.Yellow; break; case "White": c = ChatColor.White; break; default: c = null; break; } return c; }
private void ColorSelectionDialog_Load( object sender, EventArgs e ) { this.btnBlack.Relation = ColorRelation.Black; this.btnBlue.Relation = ColorRelation.Blue; this.btnDarkBlue.Relation = ColorRelation.Navy; this.btnDarkGreen.Relation = ColorRelation.Green; this.btnDarkGrey.Relation = ColorRelation.Gray; this.btnDarkRed.Relation = ColorRelation.Maroon; this.btnDarkTeal.Relation = ColorRelation.Teal; this.btnGold.Relation = ColorRelation.Gold; this.btnGray.Relation = ColorRelation.Silver; this.btnLightGreen.Relation = ColorRelation.Lime; this.btnPink.Relation = ColorRelation.Pink; this.btnPurple.Relation = ColorRelation.Purple; this.btnRed.Relation = ColorRelation.Red; this.btnTeal.Relation = ColorRelation.Aqua; this.btnWhite.Relation = ColorRelation.White; this.btnYellow.Relation = ColorRelation.Yellow; }