void OnConfirmAssignment(ConfirmAssignmentEvent e)
        {
            bool scavengerTeamsUnassigned = false;
            bool survivorsUnassigned      = false;

            foreach (SurvivorModel model in SurvivorModel.AllModels)
            {
                if (model.AssignedBuilding == null)
                {
                    survivorsUnassigned = true;
                    break;
                }
            }

            if (!survivorsUnassigned && !scavengerTeamsUnassigned)
            {
                OnModalOk();
                return;
            }

            string confirmText   = LocalisationManager.GetValue(ANYTHING_UNASSIGNED_KEY);
            string survivorText  = survivorsUnassigned ? LocalisationManager.GetValue(SURVIVORS_UNASSIGNED_KEY) : string.Empty;
            string scavengerText = scavengerTeamsUnassigned ? LocalisationManager.GetValue(SCAVENGERS_UNASSIGNED_KEY) : string.Empty;

            string cancelText = LocalisationManager.GetValue(CANCEL_KEY);
            string okText     = LocalisationManager.GetValue(OK_KEY);

            confirmText = string.Format(confirmText, survivorText, scavengerText);
            EventSystem.Publish(new ShowModalEvent(confirmText, okText, OnModalOk, cancelText, null));
        }
Пример #2
0
 void UpdateDisplay()
 {
     DayText.text               = string.Format(DAY_STRING_FORMAT, LocalisationManager.GetValue(DAY_LOCALISATION_KEY), 1);
     PopulationText.text        = string.Format(POPULATION_STRING_FORMAT, SurvivorModel.AllModels.Count, "TODO");
     FoodText.text              = PlayerResources.Singleton.Food.ToString();
     BuildingMaterialsText.text = PlayerResources.Singleton.BuildingMaterials.ToString();
 }
Пример #3
0
        void OnShowReport(ShowReportEvent e)
        {
            Title.text = LocalisationManager.GetValue(TITLE_LOCALISATION_KEY + GameStateController.CurrentState.ToString().ToLower());
            ContinueButtonText.text = LocalisationManager.GetValue(ADVANCE_LOCALISATION_KEY + GameStateController.CurrentState.ToString().ToLower());

            SurvivorSection.UpdateView();

            ScrollView.verticalNormalizedPosition = 1f;

            CanvasFader.ForceShow();
        }
        private string GetLimitString(int limitAmount, AmountLimit[] lookupArray)
        {
            for (int i = 0; i < lookupArray.Length; i++)
            {
                if (limitAmount <= lookupArray[i].Limit)
                {
                    return LocalisationManager.GetValue(lookupArray[i].LocalisationKey);
                }
            }

            return LocalisationManager.GetValue(lookupArray[lookupArray.Length - 1].LocalisationKey);
        }