コード例 #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            EditMain main = new EditMain();

            main.Show();
            this.Hide();
        }
コード例 #2
0
    public void Setup(EditMain editMain)
    {
        this.editMain = editMain;
        Util.FindIfNotSet(this, ref userMain);

        FindMaxDist();
    }
コード例 #3
0
    public override void Launch(EditMain _editmain)
    {
        base.Launch(_editmain);
        Util.FindIfNotSet(this, ref terrain);
        Util.FindIfNotSet(this, ref terrainRendering);
        Util.FindIfNotSet(this, ref undoStack);
        Util.FindIfNotSet(this, ref createTerrainPreview);

        editTerrainTool.Setup();

        terrainToolSettings = editMain.GetTerrainSidebar();
        terrainToolSettings.onModeChange      = SetMode;
        terrainToolSettings.onShapeChange     = SetShape;
        terrainToolSettings.onDirectionChange = SetDirection;

        terrainToolSettings.onEditCopy   = editTerrainTool.CopySelection;
        terrainToolSettings.onEditPaint  = editTerrainTool.PaintSelection;
        terrainToolSettings.onEditDelete = editTerrainTool.DeleteSelection;

        terrainToolSettings.RequestOpen();
        SetMode(terrainToolSettings.GetMode());
        SetShape(terrainToolSettings.GetBlockShape());
        SetDirection(terrainToolSettings.GetBlockDirection());

        createTerrainPreview.SetTint(editMain.GetAvatarTint());
        createToolRay.SetLocalRayOriginTransform(emissionAnchor);
        createToolRay.SetTint(editMain.GetAvatarTint());
        editMain.SetCameraFollowingActor(false);
        editMain.TryEscapeOutOfCameraView();

        RefreshPreviewVisibility();
    }
コード例 #4
0
ファイル: ScaleTool.cs プロジェクト: zachary2234/gamebuilder
 /*  public override bool ShowSelectedTargetFeedback()
  * {
  * return false;
  * }
  */
 public override void Launch(EditMain _editmain)
 {
     base.Launch(_editmain);
     toolEffectController.SetTint(editMain.GetAvatarTint());
     toolEffectController.originTransform = emissionAnchor;
     ForceUpdateTargetActor();
 }
コード例 #5
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            string teamToBeDELETED = lbTeamList.SelectedItem.ToString();

            TeamsEntity            selT   = storeHelper.TeamsList.FirstOrDefault(w => w.TeamName == teamToBeDELETED);
            List <WrestlersEntity> wrests = storeHelper.WrestlersList.Where(w => w.TeamName == teamToBeDELETED).ToList();

            foreach (WrestlersEntity w in wrests)
            {
                w.TeamName = "";

                wHelper.SaveWrestlersList(w);
            }

            string file = string.Concat(Directory.GetCurrentDirectory(), "\\Saves\\Main\\Teams\\" + selT.TeamID + ".dat");

            if (File.Exists(file))
            {
                File.Delete(file);
            }

            EditMain main = new EditMain();

            main.Show();
            this.Hide();
        }
コード例 #6
0
ファイル: Tool.cs プロジェクト: zachary2234/gamebuilder
    public virtual void Launch(EditMain _editmain)
    {
        Util.FindIfNotSet(this, ref toolMemory);
        editMain       = _editmain;
        mainAnchor     = editMain.mainAnchor;
        emissionAnchor = editMain.emissionAnchor;
        inputControl   = editMain.GetInputControl();

        active = true;


        if (reticleRect != null)
        {
            reticleRect.SetParent(editMain.GetReticleAnchor());
            reticleRect.anchoredPosition = Vector2.zero;
            reticleRect.gameObject.SetActive(true);
        }

        if (subtoolbarRect != null)
        {
            subtoolbarRect.SetParent(editMain.bottomToolbarAnchor);
            subtoolbarRect.SetAsFirstSibling();
            subtoolbarRect.anchoredPosition = Vector2.zero;
            subtoolbarRect.localScale       = Vector3.one;
        }

        if (subtoolbar != null)
        {
            subtoolbar.Setup();
            subtoolbar.OnSelectIndex = (newindex) => subtoolbarIndex = newindex;
            subtoolbar.SelectIndex(toolMemory.RequestSubtoolbarIndex(GetType()));
        }
    }
コード例 #7
0
    public override void Launch(EditMain _editmain)
    {
        base.Launch(_editmain);
        Util.FindIfNotSet(this, ref voosEngine);
        Util.FindIfNotSet(this, ref undoStack);

        SetToPaste();
    }
コード例 #8
0
ファイル: AddOrg.cs プロジェクト: pjalmighty42/SuperFight
        private void button4_Click(object sender, EventArgs e)
        {
            if (isEditOrg)
            {
                if (tbInitals.Text == "" || tbNewName.Text == "" || cbxLoc.SelectedItem == null)
                {
                    tbNewName.BackColor = Color.MistyRose;
                    tbInitals.BackColor = Color.MistyRose;
                    cbxLoc.BackColor    = Color.MistyRose;
                }
                else
                {
                    PromotionsEntity promo = shHelper.PromotionsList.FirstOrDefault(p => p.Name == lbOrgList.SelectedItem.ToString());

                    foreach (PromotionsEntity p in shHelper.PromotionsList)
                    {
                        if (p.OrgID == promo.OrgID)
                        {
                            promo.Name     = tbNewName.Text;
                            promo.Initals  = tbInitals.Text;
                            promo.Location = cbxLoc.SelectedItem.ToString();

                            pHelper.SavePromotionsList(promo);
                        }
                    }

                    EditMain main = new EditMain();
                    main.Show();
                    this.Hide();
                }
            }
            else
            {
                if (tbInitals.Text == "" || tbNewName.Text == "" || cbxLoc.SelectedItem == null)
                {
                    tbNewName.BackColor = Color.MistyRose;
                    tbInitals.BackColor = Color.MistyRose;
                    cbxLoc.BackColor    = Color.MistyRose;
                }
                else
                {
                    PromotionsEntity promo = new PromotionsEntity()
                    {
                        OrgID    = idHelper.CurrentID(false, false, false, true, false, false, false),
                        Name     = tbNewName.Text,
                        Initals  = tbInitals.Text,
                        Location = cbxLoc.SelectedItem.ToString()
                    };

                    pHelper.SavePromotionsList(promo);

                    EditMain main = new EditMain();
                    main.Show();
                    this.Hide();
                }
            }
        }
コード例 #9
0
ファイル: TextTool.cs プロジェクト: zachary2234/gamebuilder
    public override void Launch(EditMain _editmain)
    {
        base.Launch(_editmain);

        inputField       = editMain.textToolInput;
        inputFieldObject = editMain.textToolInputObject;
        inputField.onEndEdit.AddListener((inputstring) => EndTextEditing());
        inputField.onValueChanged.AddListener(UpdateInputText);
        selectorNode.transform.localScale = DEFAULT_TEXT_SCALE * SELECTOR_NODE_LOCAL_SCALE;
        numManualRotations = 0;
    }
コード例 #10
0
ファイル: EditAddOrg.cs プロジェクト: pjalmighty42/SuperFight
        private void button1_Click(object sender, EventArgs e)
        {
            if (lbOrgList.SelectedItems.Count == 1)
            {
                Promotions promo = promos.FirstOrDefault(p => p.Name == lbOrgList.SelectedItem.ToString());

                pHelper.DeletePromotion(promo);

                EditMain main = new EditMain();
                main.Show();
                this.Hide();
            }
        }
コード例 #11
0
    public override void Launch(EditMain _editmain)
    {
        base.Launch(_editmain);
        selectionEffect = Instantiate(inspectorEffectPrefab, transform).transform;
        effectColor     = selectionEffect.GetComponent <ToolRingFXColor>();

        selectionEffect.gameObject.SetActive(false);
        inspectorController             = editMain.GetInspectorController();
        inspectorController.onOpenActor = OnOpenActor;
        ForceUpdateTargetActor();

        inspectorController.Show();
    }
コード例 #12
0
ファイル: CreateTool.cs プロジェクト: zachary2234/gamebuilder
    public override void Launch(EditMain _editmain)
    {
        base.Launch(_editmain);

        creationLibrary              = editMain.GetCreationLibrarySidebar();
        creationLibrary.updateAsset += UpdateAsset;
        UpdateAsset(creationLibrary.GetLastResult());
        creationLibrary.RequestOpen();
        createToolRay.SetLocalRayOriginTransform(emissionAnchor);
        createToolRay.SetTint(editMain.GetAvatarTint());
        createToolPreview.SetTint(editMain.GetAvatarTint());
        editMain.TryEscapeOutOfCameraView();
    }
コード例 #13
0
ファイル: AddOrg.cs プロジェクト: pjalmighty42/SuperFight
        private void btnDelete_Click(object sender, EventArgs e)
        {
            string orgToBeDELETED = lbOrgList.SelectedItem.ToString();

            List <WrestlersEntity> selW     = shHelper.WrestlersList.Where(w => w.CurrentCompanyName == orgToBeDELETED).ToList();
            List <TitlesEntity>    selT     = shHelper.TitlesList.Where(t => t.OwnerOrgName == orgToBeDELETED).ToList();
            List <TeamsEntity>     selTeams = shHelper.TeamsList.Where(te => te.OrgName == orgToBeDELETED).ToList();

            foreach (WrestlersEntity w in selW)
            {
                w.CurrentCompanyName = "";
                w.BrandName          = "";

                w.TeamName = "";


                wHelper.SaveWrestlersList(w);
            }

            foreach (TitlesEntity t in selT)
            {
                t.OwnerOrgName = "";

                tHelper.SaveTitlesList(t);
            }

            //Delete Teams attached to Org (cannot have team w/o org it performs in)
            foreach (TeamsEntity t in selTeams)
            {
                string teamFile = string.Concat(Directory.GetCurrentDirectory(), "\\Saves\\Main\\Teams\\" + t.TeamID + ".dat");

                if (File.Exists(teamFile))
                {
                    File.Delete(teamFile);
                }
            }

            PromotionsEntity promo = shHelper.PromotionsList.FirstOrDefault(p => p.Name == lbOrgList.SelectedItem.ToString());

            string file = string.Concat(Directory.GetCurrentDirectory(), "\\Saves\\Main\\Promotions\\" + promo.OrgID + ".dat");

            if (File.Exists(file))
            {
                File.Delete(file);
            }

            EditMain main = new EditMain();

            main.Show();
            this.Hide();
        }
コード例 #14
0
    bool IsCodeEditorOpen()
    {
        if (editMain == null)
        {
            editMain = FindObjectOfType <EditMain>();
        }

        if (editMain != null)
        {
            return(editMain.IsCodeViewOpen());
        }
        else
        {
            return(false);
        }
    }
コード例 #15
0
ファイル: MoveTool.cs プロジェクト: zachary2234/gamebuilder
    public override void Launch(EditMain _editmain)
    {
        base.Launch(_editmain);

        gizmoSelectionFeedback.Setup();

        toolEffectController.originTransform = emissionAnchor;
        toolEffectController.SetTint(editMain.GetAvatarTint());
        moveToolSettings = Instantiate(moveToolSettingsPrefab, editMain.topLeftAnchor);
        moveToolSettings.Setup();
        dummyTransform = new GameObject("MoveDummyTransform").transform;
        dummyTransform.SetParent(transform);
        LoadToolMemory();

        ForceUpdateTargetActor();
    }
コード例 #16
0
ファイル: RotateTool.cs プロジェクト: zachary2234/gamebuilder
    public override void Launch(EditMain _editmain)
    {
        base.Launch(_editmain);

        rotateSelectionFeedback.Setup();

        rotateToolSettings = Instantiate(rotateToolSettingsPrefab, editMain.topLeftAnchor);
        rotateToolSettings.Setup();
        toolEffectController.SetTint(editMain.GetAvatarTint());
        toolEffectController.originTransform = emissionAnchor;
        internalTransform = new GameObject().transform;

        LoadToolMemory();

        ForceUpdateTargetActor();
    }
コード例 #17
0
 public ActorInfo(VoosActor actor, EditMain editMain)
 {
     this.actor    = actor;
     hierarchyPath = new List <ActorHierarchyInfo>();
     for (VoosActor thisActor = actor; thisActor != null; thisActor = thisActor.GetParentActor())
     {
         ActorHierarchyInfo info = new ActorHierarchyInfo();
         info.name        = thisActor.name;
         info.displayName = thisActor.GetDisplayName();
         if (editMain != null)
         {
             info.distance = Vector3.Distance(editMain.GetAvatarPosition(), thisActor.GetPosition());
         }
         hierarchyPath.Insert(0, info);
     }
 }
コード例 #18
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            string wrestToBeDELETED = lbWrestlerList.SelectedItem.ToString();

            WrestlersEntity wrest = shHelper.WrestlersList.FirstOrDefault(w => w.Name == wrestToBeDELETED);

            string file = string.Concat(Directory.GetCurrentDirectory(), "\\Saves\\Main\\Wrestlers\\" + wrest.WrestlerID + ".dat");

            if (File.Exists(file))
            {
                File.Delete(file);
            }

            EditMain main = new EditMain();

            main.Show();
            this.Hide();
        }
コード例 #19
0
ファイル: AddTitles.cs プロジェクト: pjalmighty42/SuperFight
        private void btnDelete_Click(object sender, EventArgs e)
        {
            string teamToBeDELETED = lbChampList.SelectedItem.ToString();

            TitlesEntity title = tHelper.PopulateTitlesList().FirstOrDefault(t => t.Name == teamToBeDELETED);

            string file = string.Concat(Directory.GetCurrentDirectory(), "\\Saves\\Main\\Titles\\" + title.TitleID + ".dat");

            if (File.Exists(file))
            {
                File.Delete(file);
            }

            EditMain main = new EditMain();

            main.Show();
            this.Hide();
        }
コード例 #20
0
ファイル: EditAddOrg.cs プロジェクト: pjalmighty42/SuperFight
        private void button4_Click(object sender, EventArgs e)
        {
            if (tbNewName.Text == null || tbInitals.Text == null || cbxLoc.SelectedItem == null)
            {
                tbNewName.BackColor = Color.MistyRose;
                tbInitals.BackColor = Color.MistyRose;
                cbxLoc.BackColor    = Color.MistyRose;
            }
            else
            {
                Promotions newPromo = new Promotions()
                {
                    Name     = tbNewName.Text,
                    Initals  = tbInitals.Text,
                    Location = cbxLoc.SelectedItem.ToString()
                };

                pHelper.SavePromotionsList(newPromo);

                EditMain main = new EditMain();
                main.Show();
                this.Hide();
            }
        }
コード例 #21
0
ファイル: LogicTool.cs プロジェクト: zachary2234/gamebuilder
    public override void Launch(EditMain _editmain)
    {
        base.Launch(_editmain);

        logicSidebar    = editMain.GetLogicSidebar();
        selectionEffect = Instantiate(inspectorEffectPrefab, transform).transform;
        selectionEffect.GetComponent <ToolRingFXColor>().SetTint(editMain.GetAvatarTint());

        selectionEffect.gameObject.SetActive(false);

        logicSidebar.OnSwitchToCodeView = OnSwitchToCodeView;
        logicSidebar.OnSwitchToCardView = OnSwitchToCardView;

        logicSidebar.onOpenActor = OnOpenActor;

        if (toolMemory.logicTabIndex == 0)
        {
            logicSidebar.SetToCardView();
        }
        else
        {
            logicSidebar.SetToCodeView();
        }

        if (editMain.GetSingleTargetActor() != null)
        {
            if (!(editMain.GetSingleTargetActor() == toolMemory.logicActor && toolMemory.logicSidebarClosed))
            {
                ForceUpdateTargetActor();
            }
        }
        else
        {
            logicSidebar.OpenWithParams(null);
        }
    }
コード例 #22
0
ファイル: AddTitles.cs プロジェクト: pjalmighty42/SuperFight
        private void button4_Click(object sender, EventArgs e)
        {
            if (isEdit)
            {
                if (tbNewName.Text == "" ||
                    cbxWeight.SelectedItem == null ||
                    cbxSpec.SelectedItem == null ||
                    cbxAsscOrg.SelectedItem == null ||
                    cbxGenre.SelectedItem == null
                    )
                {
                    tbNewName.BackColor  = Color.MistyRose;
                    cbxWeight.BackColor  = Color.MistyRose;
                    cbxSpec.BackColor    = Color.MistyRose;
                    cbxAsscOrg.BackColor = Color.MistyRose;
                    cbxGenre.BackColor   = Color.MistyRose;
                }
                else
                {
                    TitlesEntity title = tHelper.PopulateTitlesList().FirstOrDefault(ti => ti.Name == lbChampList.SelectedItem.ToString());

                    foreach (TitlesEntity t in storeHelper.TitlesList)
                    {
                        if (t.TitleID == title.TitleID)
                        {
                            title.Name           = tbNewName.Text;
                            title.WeightClass    = cbxWeight.SelectedItem.ToString();
                            title.OwnerOrgName   = cbxAsscOrg.SelectedItem.ToString();
                            title.Specialization = cbxSpec.SelectedItem.ToString();
                            title.GenereType     = cbxGenre.SelectedItem.ToString();

                            tHelper.SaveTitlesList(title);

                            EditMain main = new EditMain();
                            main.Show();
                            this.Hide();
                        }
                    }
                }
            }
            else
            {
                if (tbNewName.Text == "" ||
                    cbxWeight.SelectedItem == null ||
                    cbxSpec.SelectedItem == null ||
                    cbxAsscOrg.SelectedItem == null ||
                    cbxGenre.SelectedItem == null
                    )
                {
                    tbNewName.BackColor  = Color.MistyRose;
                    cbxWeight.BackColor  = Color.MistyRose;
                    cbxSpec.BackColor    = Color.MistyRose;
                    cbxAsscOrg.BackColor = Color.MistyRose;
                    cbxGenre.BackColor   = Color.MistyRose;
                }
                else
                {
                    TitlesEntity title = new TitlesEntity()
                    {
                        TitleID        = idHelper.CurrentID(false, false, false, false, false, true, false),
                        Name           = tbNewName.Text,
                        WeightClass    = cbxWeight.SelectedItem.ToString(),
                        OwnerOrgName   = cbxAsscOrg.SelectedItem.ToString(),
                        Specialization = cbxSpec.SelectedItem.ToString(),
                        GenereType     = cbxGenre.SelectedItem.ToString()
                    };

                    tHelper.SaveTitlesList(title);

                    EditMain main = new EditMain();
                    main.Show();
                    this.Hide();
                }
            }
        }
コード例 #23
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (isEdit)
            {
                WrestlersEntity wrest = shHelper.WrestlersList.FirstOrDefault(w => w.Name == lbWrestlerList.SelectedItem.ToString());

                foreach (WrestlersEntity w in shHelper.WrestlersList)
                {
                    if (w.WrestlerID == wrest.WrestlerID)
                    {
                        if (tbNewName.Text == "" || cbxWeight.SelectedItem == null)
                        {
                            tbNewName.BackColor = Color.MistyRose;
                            cbxWeight.BackColor = Color.MistyRose;
                        }
                        else
                        {
                            int wins   = 0;
                            int losses = 0;
                            int draws  = 0;

                            int tempWins  = 0;
                            int tempLoss  = 0;
                            int tempDraws = 0;

                            if (tbWins.Text == "" ||
                                tbLosses.Text == "" ||
                                tbDraws.Text == "")
                            {
                                wins   = 0;
                                losses = 0;
                                draws  = 0;
                            }
                            else if (int.TryParse(tbWins.Text, out tempWins) &&
                                     int.TryParse(tbLosses.Text, out tempLoss) &&
                                     int.TryParse(tbDraws.Text, out tempDraws))
                            {
                                wins   = tempWins;
                                losses = tempLoss;
                                draws  = tempDraws;

                                IDSetterHelper idHelper = new IDSetterHelper();

                                string assocCo = "";

                                if (cbxAsscCo.SelectedItem != null)
                                {
                                    assocCo = cbxAsscCo.SelectedItem.ToString();
                                }
                                else
                                {
                                    assocCo = "";
                                }

                                wrest.Name               = tbNewName.Text;
                                wrest.WeightClass        = cbxWeight.SelectedItem.ToString();
                                wrest.CurrentCompanyName = assocCo;
                                wrest.Wins               = wins;
                                wrest.Losses             = losses;
                                wrest.Draws              = draws;

                                wHelper.SaveWrestlersList(wrest);

                                EditMain main = new EditMain();
                                main.Show();
                                this.Hide();
                            }
                        }
                    }
                }
            }
            else
            {
                if (tbNewName.Text == "" || cbxWeight.SelectedItem == null)
                {
                    tbNewName.BackColor = Color.MistyRose;
                    cbxWeight.BackColor = Color.MistyRose;
                }
                else
                {
                    int wins   = 0;
                    int losses = 0;
                    int draws  = 0;

                    int tempWins  = 0;
                    int tempLoss  = 0;
                    int tempDraws = 0;

                    if (tbWins.Text == "" ||
                        tbLosses.Text == "" ||
                        tbDraws.Text == "")
                    {
                        wins   = 0;
                        losses = 0;
                        draws  = 0;
                    }
                    else if (int.TryParse(tbWins.Text, out tempWins) &&
                             int.TryParse(tbLosses.Text, out tempLoss) &&
                             int.TryParse(tbDraws.Text, out tempDraws))
                    {
                        wins   = tempWins;
                        losses = tempLoss;
                        draws  = tempDraws;

                        IDSetterHelper idHelper = new IDSetterHelper();

                        string assocCo   = "";
                        string brandName = "";

                        if (cbxAsscCo.SelectedItem != null)
                        {
                            assocCo = cbxAsscCo.SelectedItem.ToString();
                        }
                        else
                        {
                            assocCo = "";
                        }

                        WrestlersEntity wrest = new WrestlersEntity()
                        {
                            WrestlerID         = idHelper.CurrentID(false, false, false, false, false, false, true),
                            Name               = tbNewName.Text,
                            WeightClass        = cbxWeight.SelectedItem.ToString(),
                            CurrentCompanyName = assocCo,

                            Wins   = Convert.ToInt32(tbWins.Text),
                            Losses = Convert.ToInt32(tbLosses.Text),
                            Draws  = Convert.ToInt32(tbDraws.Text),

                            BrandName = brandName,

                            TeamName = ""
                        };

                        wHelper.SaveWrestlersList(wrest);

                        EditMain main = new EditMain();
                        main.Show();
                        this.Hide();
                    }
                }
            }
        }
コード例 #24
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (isEdit)
            {
                TeamsEntity team = storeHelper.TeamsList.FirstOrDefault(t => t.TeamName == lbTeamList.SelectedItem.ToString());

                foreach (TeamsEntity t in storeHelper.TeamsList)
                {
                    if (team.TeamID == t.TeamID)
                    {
                        if (tbNewName.Text == "")
                        {
                            tbNewName.BackColor = Color.MistyRose;
                        }
                        else
                        {
                            int    wins   = 0;
                            int    losses = 0;
                            int    draws  = 0;
                            string asscCo;

                            int tempWins  = 0;
                            int tempLoss  = 0;
                            int tempDraws = 0;

                            if (tbWins.Text == "" ||
                                tbLosses.Text == "" ||
                                tbDraws.Text == "")
                            {
                                wins   = 0;
                                losses = 0;
                                draws  = 0;
                            }
                            else if (int.TryParse(tbWins.Text, out tempWins) &&
                                     int.TryParse(tbLosses.Text, out tempLoss) &&
                                     int.TryParse(tbDraws.Text, out tempDraws))
                            {
                                wins   = tempWins;
                                losses = tempLoss;
                                draws  = tempDraws;

                                if (string.IsNullOrWhiteSpace(cbxAsscCo.SelectedItem.ToString()))
                                {
                                    asscCo = "";
                                }
                                else
                                {
                                    asscCo = cbxAsscCo.SelectedItem.ToString();
                                }

                                team.TeamName = tbNewName.Text;
                                team.OrgName  = asscCo;
                                team.Wins     = wins;
                                team.Losses   = losses;
                                team.Draws    = draws;

                                tHelper.SaveTeamsList(team);

                                EditMain main = new EditMain();
                                main.Show();
                                this.Hide();
                            }
                            else
                            {
                                tbWins.BackColor   = Color.MistyRose;
                                tbLosses.BackColor = Color.MistyRose;
                                tbDraws.BackColor  = Color.MistyRose;
                            }
                        }
                    }
                }
            }
            else
            {
                if (tbNewName.Text == "")
                {
                    tbNewName.BackColor = Color.MistyRose;
                }
                else
                {
                    int    wins   = 0;
                    int    losses = 0;
                    int    draws  = 0;
                    string asscCo;

                    int tempWins  = 0;
                    int tempLoss  = 0;
                    int tempDraws = 0;

                    if (tbWins.Text == "" ||
                        tbLosses.Text == "" ||
                        tbDraws.Text == "")
                    {
                        wins   = 0;
                        losses = 0;
                        draws  = 0;
                    }
                    else if (int.TryParse(tbWins.Text, out tempWins) &&
                             int.TryParse(tbLosses.Text, out tempLoss) &&
                             int.TryParse(tbDraws.Text, out tempDraws))
                    {
                        wins   = tempWins;
                        losses = tempLoss;
                        draws  = tempDraws;

                        TeamsEntity team = storeHelper.TeamsList.FirstOrDefault(t => t.TeamName == lbTeamList.SelectedItem.ToString());

                        if (string.IsNullOrWhiteSpace(cbxAsscCo.SelectedItem.ToString()))
                        {
                            asscCo = "";
                        }
                        else
                        {
                            asscCo = cbxAsscCo.SelectedItem.ToString();
                        }


                        TeamsEntity newTeam = new TeamsEntity()
                        {
                            TeamID   = idHelper.CurrentID(false, false, false, false, true, false, false),
                            TeamName = tbNewName.Text,
                            OrgName  = asscCo,
                            Wins     = wins,
                            Losses   = losses,
                            Draws    = draws
                        };

                        tHelper.SaveTeamsList(newTeam);

                        EditMain main = new EditMain();
                        main.Show();
                        this.Hide();
                    }
                    else
                    {
                        tbWins.BackColor   = Color.MistyRose;
                        tbLosses.BackColor = Color.MistyRose;
                        tbDraws.BackColor  = Color.MistyRose;
                    }
                }
            }
        }