Exemplo n.º 1
0
    private void PrepareButtons()
    {
        if (showingCrew == null)
        {
            hiremode = true;
            if (observingRCenter.finding)
            {
                hireButton.gameObject.SetActive(false);
                UIController.current.ActivateProgressPanel(ProgressPanelMode.RecruitingCenter);
                crewsDropdown.gameObject.SetActive(false);
            }
            else
            {
                hireButton.gameObject.SetActive(true);
                UIController.current.DeactivateProgressPanel(ProgressPanelMode.RecruitingCenter);
                crewsDropdown.gameObject.SetActive(true);
            }
            infoButton.SetActive(false);
            replenishButton.SetActive(false);
            membersText.enabled = false;
            Crew.DisableObserver();
        }
        else
        {
            crewsDropdown.gameObject.SetActive(true);
            hiremode = false;
            UIController.current.DeactivateProgressPanel(ProgressPanelMode.RecruitingCenter);
            hireButton.gameObject.SetActive(false);
            infoButton.SetActive(true);

            replenishButton.transform.GetChild(1).GetComponent <Text>().text = RecruitingCenter.REPLENISH_COST.ToString();
            replenishButton.SetActive(
                (showingCrew.membersCount != Crew.MAX_MEMBER_COUNT) & (showingCrew.atHome));

            membersText.text    = Localization.GetPhrase(LocalizedPhrase.MembersCount) + ": " + showingCrew.membersCount.ToString() + '/' + Crew.MAX_MEMBER_COUNT.ToString();
            membersText.enabled = true;

            if (Crew.crewObserver != null && Crew.crewObserver.isActiveAndEnabled)
            {
                Crew.crewObserver.RedrawWindow();
            }
        }
    }