public override void Update(float deltaTime)
        {
            Enemy e = GetEnemy();

            if (e == null)
            {
                if (isOpen)
                {
                    Close();
                }
            }
            else
            {
                if (!isOpen)
                {
                    Open();
                }
                name.SetText(e.name);
                health.SetValue($"{e.HP}/{e.maxHP}");
                ammo.SetValue($"{e.currAmmo}/{e.maxAmmo}");
                damage.SetValue($"{e.GetCurrentDamage()}");
                moveRange.SetValue($"{e.GetMovementRange()}");
                skillRange.SetValue($"{e.GetSkillRange()}");
            }


            base.Update(deltaTime);
        }
Esempio n. 2
0
 public void UpdateTexts()
 {
     name.SetText(city.Name);
     lvl1.SetValue(city.GetNumberOfCitizensOfLevel(DistrictType.Suburb).ToString());
     lvl2.SetValue(city.GetNumberOfCitizensOfLevel(DistrictType.City).ToString());
     lvl3.SetValue(city.GetNumberOfCitizensOfLevel(DistrictType.Business).ToString());
 }
        private void UpdateTexts()
        {
            deliveredPizzas.SetValue($"{store.GetDeliveredPizzas()}");
            outStandingOrders.SetValue($"{store.GetCurrentOutstandingOrderCount()}");
            avgDeliveryTime.SetValue(String.Format("{0:0.00}", store.GetAvgDeliveryTime()));
            deliveryEmployeesCount.SetValue(store.GetDeliveryEmployeeCount().ToString());

            int rent  = store.GetRent();
            int wages = store.GetWages();

            weeklyRent.SetValue(rent.ToString());
            weeklyEmployeeWage.SetValue(wages.ToString());
            weeklyTotalCost.SetValue((rent + wages).ToString());

            lastWeeksIncome.SetValue(store.GetLastWeeksIncome().ToString());
        }
Esempio n. 4
0
        private void SelectBuilding(int index)
        {
            VerticalLayout l = buildings[index];

            if (l.sprite == null)
            {
                if (selected < 4)
                {
                    selected++;
                    l.sprite = frameSpr;
                }
            }
            else
            {
                selected--;
                l.sprite = null;
            }

            selectedText.SetValue(selected.ToString());
        }
Esempio n. 5
0
        public override void Update(float deltaTime)
        {
            Actor a = GetActor();

            if (a == null)
            {
                buttonTooltip.SetText("");
                Close();
            }
            else
            {
                if (!isOpen)
                {
                    Open();
                }

                // Update the ui thingies
                movesLeft.SetValue($"{a.movesLeft}/{a.movesPerTurn}");
                movesLeft.SetValueColor(a.movesLeft == 0 ? unusableColor : normalColor);

                actionsLeft.SetValue($"{a.actionsLeft}/{a.actionsPerTurn}");
                actionsLeft.SetValueColor(a.actionsLeft == 0 ? unusableColor : normalColor);

                ammo.SetValue($"{a.currAmmo}/{a.maxAmmo}");
                ammo.SetValueColor(a.currAmmo == 0 ? unusableColor : (a.currAmmo < a.maxAmmo - 1 ? warningColor : normalColor));

                damage.SetValue($"{a.GetCurrentDamage()}");

                health.SetValue($"{a.CurrentHealth()}/{a.maxHP}");
                health.SetValueColor(a.CurrentHealth() < a.maxHP - 2 ? warningColor : normalColor);

                moveRange.SetValue($"{a.GetMovementRange()}");
                skillRange.SetValue($"{a.GetSkillRange()}");

                Skills s = a.selectedSkill;

                if (buttons[(int)s] != selectedButton)
                {
                    if (selectedButton != null)
                    {
                        for (int i = 1; i < (int)Skills.Num; i++)
                        {
                            if (buttons[i] == selectedButton)
                            {
                                Skills old = (Skills)i;
                                selectedButton.sprite = uiSprites[old.ToString()];
                                break;
                            }
                        }
                    }
                    if (s != Skills.None)
                    {
                        buttons[(int)s].sprite = uiSprites[s.ToString() + "Selected"];
                        selectedButton         = buttons[(int)s];
                    }
                }
            }


            base.Update(deltaTime);
        }