Esempio n. 1
0
 private void showUnclassifiedPhotosToolStripMenuItem_Click(object sender, EventArgs e)
 {
     MessageForm.ShowMessage("Unclassified photos", GetUnclassifiedPlayers());
 }
Esempio n. 2
0
        private void CheckFaces()
        {
            string        prevKey = mTool.GetKey(true, true).Replace("#", "Key=");
            FaceForm      ff      = new FaceForm();
            StringBuilder sb      = new StringBuilder();

            mTool.SetKey("Key=Position,fname,lname,Photo,Skin");
            sb.Append(mTool.GetKey(true, true).Replace("#", "Key="));
            sb.Append("\nLookupAndModify\n" +
                      "#Team=FreeAgents   (This line is a comment, but allows the player editor to function on this data)\n\n");

            string skin        = "";
            string face        = "";
            int    faceInt     = 0;
            int    playerLimit = 1928;

            for (int player = 0; player < playerLimit; player++)
            {
                skin    = mTool.GetPlayerField(player, "Skin");
                face    = mTool.GetAttribute(player, PlayerOffsets.Photo);
                faceInt = Int32.Parse(face);
                switch (skin)
                {
                case "Skin1":       // white guys
                case "Skin9":
                case "Skin17":
                    if (!ff.CheckFace(faceInt, "lightPlayers"))
                    {
                        sb.Append(mTool.GetPlayerData(player, true, true));
                        sb.Append("\n");
                    }
                    break;

                case "Skin2":      // mixed White&black(light) guys, Samoans
                case "Skin18":     // mixed White&black(light) guys, Samoans, Latino, White,
                    break;

                // dark guys
                case "Skin3":     // inconsistently assigned
                case "Skin4":
                case "Skin5":
                case "Skin6":
                case "Skin10":
                case "Skin11":
                case "Skin12":
                case "Skin13":
                case "Skin14":
                case "Skin19":
                case "Skin20":
                case "Skin21":
                case "Skin22":
                    if (!ff.CheckFace(faceInt, "darkPlayers"))
                    {
                        sb.Append(mTool.GetPlayerData(player, true, true));
                        sb.Append("\n");
                    }
                    break;
                }
            }
            MessageForm.ShowMessage("Results", sb.ToString(), SystemIcons.Information, false, false);
            ff.Dispose();
            mTool.SetKey(prevKey);
        }
Esempio n. 3
0
 /// <summary>
 /// Shows the errors (if any exist)
 /// </summary>
 /// <param name="showToConsole">true to print the errors to the console, 
 /// false to show them in a GUI dialog</param>
 public static void ShowErrors(bool showToConsole)
 {
     if (Errors.Count > 0)
     {
         StringBuilder b = new StringBuilder();
         foreach (string s in Errors)
         {
             b.Append(s);
             b.Append("\n");
         }
         if (!showToConsole)
         {
             MessageForm form = new MessageForm(System.Drawing.SystemIcons.Error);
             form.Text = "Error!";
             form.MessageText = b.ToString();
             form.ShowDialog();
         }
         else
         {
             Console.Error.WriteLine(b.ToString());
         }
         Errors = new List<string>();
     }
 }