Esempio n. 1
0
 public void Init(UI_ElectionTactics ui, string displayName, string tooltipTitle, string tooltipText)
 {
     UI                  = ui;
     DisplayText         = GetComponent <Text>();
     DisplayText.text    = displayName;
     TooltipTarget       = GetComponent <TooltipTarget>();
     TooltipTarget.Title = tooltipTitle;
     TooltipTarget.Text  = tooltipText;
 }
Esempio n. 2
0
 public void Init(UI_ElectionTactics ui, Religion r)
 {
     if (r != Religion.None)
     {
         HoverAction = () => { UI.MapControls.ShowReligionOverlay(r); }
     }
     ;
     Init(ui, EnumHelper.GetDescription(r), EnumHelper.GetDescription(r), "The religion which most people follow in this district.");
 }
Esempio n. 3
0
        public void Init(UI_ElectionTactics UI, List <District> districts)
        {
            for (int i = 0; i < ListContainer.transform.childCount; i++)
            {
                Destroy(ListContainer.transform.GetChild(i).gameObject);
            }

            foreach (District d in districts)
            {
                UI_DistrictListElement elem = Instantiate(ListElementPrefab, ListContainer.transform);
                elem.Init(UI, d);
            }
        }
        public void Init(UI_ElectionTactics UI, District d)
        {
            District       = d;
            NameText.text  = d.Name;
            SeatsText.text = d.Seats.ToString();
            if (d.CurrentWinnerParty != null)
            {
                PartyIcon.gameObject.SetActive(true);
                PartyIcon.color = d.CurrentWinnerParty.Color;
                float margin = d.GetLatestElectionResult().GetMargin(UI.Game.LocalPlayerParty);
                MarginText.text = (margin > 0 ? "+" : "") + margin.ToString("0.0") + " %";
            }
            else
            {
                PartyIcon.gameObject.SetActive(false);
                MarginText.text = "";
            }

            GetComponent <Button>().onClick.AddListener(() => { d.Region.SetAnimatedHighlight(false); UI.SelectDistrict(d); });
        }
Esempio n. 5
0
 public void Init(UI_ElectionTactics ui, Language l)
 {
     HoverAction = () => { UI.MapControls.ShowLanguageOverlay(l); };
     Init(ui, EnumHelper.GetDescription(l), EnumHelper.GetDescription(l), "The most spoken language within this district.");
 }
Esempio n. 6
0
 public void Init(UI_ElectionTactics ui, AgeGroup age)
 {
     HoverAction = () => { UI.MapControls.ShowAgeOverlay(age); };
     Init(ui, EnumHelper.GetDescription(age), EnumHelper.GetDescription(age), "The most represented generation in this district");
 }
Esempio n. 7
0
 public void Init(UI_ElectionTactics ui, Density d)
 {
     HoverAction = () => { UI.MapControls.ShowDensityOverlay(d); };
     Init(ui, EnumHelper.GetDescription(d), EnumHelper.GetDescription(d), "Describes how densely populated this district is");
 }
Esempio n. 8
0
 public void Init(UI_ElectionTactics ui, EconomyTrait et)
 {
     HoverAction = () => { UI.MapControls.ShowEconomyOverlay(et); };
     Init(ui, EnumHelper.GetDescription(et), EnumHelper.GetDescription(et), "Economy sector");
 }
Esempio n. 9
0
 public void Init(UI_ElectionTactics ui, GeographyTrait gt)
 {
     HoverAction = () => { UI.MapControls.ShowGeographyOverlay(gt.Type); };
     Init(ui, gt.FullName, gt.BaseName, gt.Description);
 }