Ejemplo n.º 1
0
 public override void Awake()
 {
     base.Awake();
     size = new Vector2(0, 0);
     lineTexture.SetPixel(1, 1, MUIUtil.DarkenColor(Color.grey, 0.10f));
     lineTexture.Apply();
 }
Ejemplo n.º 2
0
        public override void UpdateData()
        {
            setGameState();

            if (CityInfoDatas.RushHourUI != null)
            {
                if (RushHourTimeLabel != null /* && RushHourTimeLabel.isVisible*/)
                {
                    lblGameTime.text    = RushHourTimeLabel.text;
                    lblGameTime.tooltip = RushHourSprite.tooltip;
                }
                else
                {
                    lblGameTime.text = CityInfoDatas.GameTime.text;
                }
            }
            else
            {
                lblGameTime.text = CityInfoDatas.GameTime.text;
            }

            lblDayTime.text     = CityInfoDatas.GameTimeOfDay.text;
            lblThermometer.text = CityInfoDatas.Temperatur.text;

            //UpdateLocalTimeVisible();

            btnDayNightSwitch.opacity         = Singleton <CityInfoDatas> .instance.enableDayNight ? 0.5f : 0.05f;
            btnDayNightSwitch.playAudioEvents = Singleton <CityInfoDatas> .instance.enableDayNight;
            btnWeatherSwitch.opacity          = Singleton <CityInfoDatas> .instance.enableWeather ? 0.5f : 0.1f;
            btnWeatherSwitch.playAudioEvents  = Singleton <CityInfoDatas> .instance.enableWeather;

            var timeControler = ExtendedInfoManager.timeControler;

            if (timeControler != null)
            {
                lblDayTime.textColor = (timeControler.speed.num == 0) ? MUIUtil.DarkenColor(ExtendedPanel.COLOR_TEXT, 0.5f) : ExtendedPanel.COLOR_TEXT;
                lblDayTimeA.opacity  = (timeControler.speed.num == 0) ? 0.2f : 1f;
            }

            if (ChirpPanel.instance != null)
            {
                btnChirperContainer.opacity = ChirpPanel.instance.gameObject.activeSelf ? 0.5f : 0.1f;
            }
        }
Ejemplo n.º 3
0
        void InitControls()
        {
            LocaleManager.eventLocaleChanged += OnLocaleChanged;
            // 图标
            lblIcon                  = this.AddUIComponent <MUILabel>();
            lblIcon.size             = new Vector2(PANEL_HEIGHT - 2, PANEL_HEIGHT - 2);
            lblIcon.relativePosition = new Vector3(0, 0);
            lblIcon.backgroundSprite = "InfoIconPopulationFocused";
            // 总人口
            lblPopulation                  = this.AddUIComponent <MUILabel>();
            lblPopulation.size             = new Vector2(83, LINEW);
            lblPopulation.relativePosition = new Vector3(32, LINE1);
            lblPopulation.textColor        = ExtendedPanel.COLOR_TEXT;
            lblPopulation.textAlignment    = UIHorizontalAlignment.Right;
            lblPopulation.fontStyle        = FontStyle.Bold;
            lblPopulation.fontSize         = (int)MUISkin.UIToScreen(14f);
            lblPopulation.tooltipLocaleID  = "MAIN_POPULATION";
            // 人口变化
            lblChange                  = this.AddUIComponent <MUILabel>();
            lblChange.size             = new Vector2(73, LINEW);
            lblChange.relativePosition = new Vector3(42, LINE2);
            lblChange.textColor        = COLOR_DARK_GREEN;
            lblChange.fontSize         = (int)MUISkin.UIToScreen(12f);
            lblChange.textAlignment    = UIHorizontalAlignment.Right;
            lblChange.fontStyle        = FontStyle.Bold;
            lblChange.tooltipLocaleID  = "MAIN_POPULATIONDELTA";
            // 失业率
            lblUnemploymentA                  = this.AddUIComponent <MUILabel>();
            lblUnemploymentA.size             = new Vector2(16, 16);
            lblUnemploymentA.relativePosition = new Vector3(125, LINE1 + 2);
            lblUnemploymentA.backgroundSprite = "IconPolicyWeAreTheNormPressed";
            lblUnemploymentA.opacity          = 0.1f;

            lblUnemployment                  = this.AddUIComponent <MUILabel>();
            lblUnemployment.size             = new Vector2(40, LINEW);
            lblUnemployment.relativePosition = new Vector3(130, LINE2);
            lblUnemployment.textColor        = COLOR_DARK_PURPLE;
            lblUnemployment.textAlignment    = UIHorizontalAlignment.Right;

            // 健康
            lblHealthA                  = this.AddUIComponent <MUILabel>();
            lblHealthA.size             = new Vector2(16, 16);
            lblHealthA.relativePosition = new Vector3(183, LINE1 + 2);
            lblHealthA.backgroundSprite = "InfoIconHealthPressed";
            lblHealthA.opacity          = 0.3f;

            lblHealth                  = this.AddUIComponent <MUILabel>();
            lblHealth.size             = new Vector2(50, LINEW);
            lblHealth.relativePosition = new Vector3(175, LINE1);
            lblHealth.textAlignment    = UIHorizontalAlignment.Right;
            lblHealth.textColor        = COLOR_DARK_GREEN;
            lblHealth.tooltipLocaleID  = "INFO_HEALTH_TITLE";

            // 教育
            lblEducationA                  = this.AddUIComponent <MUILabel>();
            lblEducationA.size             = new Vector2(16, 16);
            lblEducationA.relativePosition = new Vector3(235, LINE2 + 2);
            lblEducationA.backgroundSprite = "ToolbarIconEducationPressed";
            lblEducationA.opacity          = 0.3f;

            lblEducation1                  = this.AddUIComponent <MUILabel>();
            lblEducation1.size             = new Vector2(20, LINEW);
            lblEducation1.relativePosition = new Vector3(255, LINE2);
            lblEducation1.textColor        = COLOR_DARK_TEXT;
            lblEducation1.textAlignment    = UIHorizontalAlignment.Right;
            lblEducation1.tooltipLocaleID  = "ZONEDBUILDING_EDUCATED";

            lblEducation2                  = this.AddUIComponent <MUILabel>();
            lblEducation2.size             = new Vector2(20, LINEW);
            lblEducation2.relativePosition = new Vector3(285, LINE2);
            lblEducation2.textAlignment    = UIHorizontalAlignment.Center;
            lblEducation2.textColor        = COLOR_DARK_TEXT;
            lblEducation2.tooltipLocaleID  = "ZONEDBUILDING_WELLEDUCATED";

            lblEducation3                  = this.AddUIComponent <MUILabel>();
            lblEducation3.size             = new Vector2(20, LINEW);
            lblEducation3.relativePosition = new Vector3(315, LINE2);
            lblEducation3.textAlignment    = UIHorizontalAlignment.Right;
            lblEducation3.textColor        = COLOR_DARK_YELLOW;
            lblEducation3.tooltipLocaleID  = "ZONEDBUILDING_HIGHLYEDUCATED";

            lblEducation1.fontSize = (int)MUISkin.UIToScreen(10f);
            lblEducation2.fontSize = lblEducation1.fontSize;
            lblEducation3.fontSize = lblEducation1.fontSize;

            // 幸福度
            lblHappinessA                  = this.AddUIComponent <MUILabel>();
            lblHappinessA.size             = new Vector2(14, 14);
            lblHappinessA.relativePosition = new Vector3(235, LINE1 + 2);
            string happinessString = GetHappinessString(Citizen.GetHappinessLevel(Singleton <DistrictManager> .instance.m_districts.m_buffer[0].m_finalHappiness));

            lblHappinessA.backgroundSprite = happinessString; // "InfoIconHappiness";
            lblHappinessA.opacity          = 0.3f;

            lblHappiness                  = this.AddUIComponent <MUILabel>();
            lblHappiness.size             = new Vector2(50, LINEW);
            lblHappiness.relativePosition = new Vector3(235, LINE1);
            lblHappiness.textColor        = COLOR_DARK_TEXT;
            lblHappiness.textAlignment    = UIHorizontalAlignment.Right;
            lblHappiness.tooltipLocaleID  = "MAIN_HAPPINESS";

            // 老年人
            lblSeniorA                  = this.AddUIComponent <MUILabel>();
            lblSeniorA.size             = new Vector2(16, 16);
            lblSeniorA.relativePosition = new Vector3(295, LINE1 + 2);
            lblSeniorA.backgroundSprite = "InfoIconAgePressed";
            lblSeniorA.opacity          = 0.3f;
            //lblSeniorA.textColor = COLOR_CAPTION;
            //lblSeniorA.text = Locale.Get("INFO_AGE_SENIOR") + ":";
            //lblSeniorA.fontSize = (int)MUISkin.UIToScreen(9f);

            lblSenior                  = this.AddUIComponent <MUILabel>();
            lblSenior.size             = new Vector2(45, LINEW);
            lblSenior.relativePosition = new Vector3(290, LINE1);
            lblSenior.textAlignment    = UIHorizontalAlignment.Right;
            lblSenior.textColor        = COLOR_DARK_PURPLE; // MUIUtil.DarkenColor(Color.yellow, 0.50f);
            lblSenior.tooltipLocaleID  = "CITY_SENIORAMOUNT";

            // 活动人口
            lblActivityA                  = this.AddUIComponent <MUILabel>();
            lblActivityA.size             = new Vector2(70, LINEW);
            lblActivityA.relativePosition = new Vector3(125, LINE2);
            lblActivityA.textColor        = COLOR_CAPTION;
            if (MODUtil.IsChinaLanguage())
            {
                lblActivityA.text = "人口实例:";
            }
            else
            {
                lblActivityA.text = "instances:";
            }
            lblActivityA.fontSize = (int)MUISkin.UIToScreen(10f);

            lblActivity                  = this.AddUIComponent <MUILabel>();
            lblActivity.size             = new Vector2(95, LINEW);
            lblActivity.relativePosition = new Vector3(130, LINE2);
            lblActivity.textAlignment    = UIHorizontalAlignment.Right;
            lblActivity.textColor        = MUIUtil.DarkenColor(Color.yellow, 0.70f);

            lblIcon.eventClick             += OnSetInfoModeClick;
            lblPopulation.eventClick       += OnSetInfoModeClick;
            lblChange.eventClick           += OnSetInfoModeClick;
            lblSenior.eventClick           += OnSetInfoModeClick;
            lblUnemployment.eventClick     += OnSetInfoModeClick;
            lblHealth.eventClick           += OnSetInfoModeClick;
            lblEducation1.eventClick       += OnSetInfoModeClick;
            lblEducation2.eventClick       += OnSetInfoModeClick;
            lblEducation3.eventClick       += OnSetInfoModeClick;
            lblHappiness.eventClick        += OnSetInfoModeClick;
            lblIcon.playAudioEvents         = true;
            lblPopulation.playAudioEvents   = true;
            lblChange.playAudioEvents       = true;
            lblSenior.playAudioEvents       = true;
            lblUnemployment.playAudioEvents = true;
            lblHealth.playAudioEvents       = true;
            lblEducation1.playAudioEvents   = true;
            lblEducation2.playAudioEvents   = true;
            lblEducation3.playAudioEvents   = true;
            lblHappiness.playAudioEvents    = true;
            lblHappinessA.playAudioEvents   = true;
        }
Ejemplo n.º 4
0
 public ExtendedPanel()
 {
     isVisible = false;
     color     = MUIUtil.DarkenColor(Color.grey, 0.3f);
 }