Пример #1
0
        private void ShowIntern(PanelBuilder panel, MapElementInfo onMap, NVector pos)
        {
            base.ShowLexicon(panel);
            var b = L.b.modifiers[C.BuildRes].CalcText(buildTime, S.ActPlayer(), pos);

            L.b.res[C.BuildRes].AddSubLabel(panel, b.value, "round", b.display);

            int _view = onMap == null ? visibilityRange : onMap.data.visibilityRange;
            int _atk  = onMap == null ? atk : onMap.data.atk;
            int _def  = onMap == null ? def : onMap.data.def;

            var v = L.b.modifiers[C.ViewModi].CalcText(_view, S.ActPlayer(), pos);

            L.b.modifiers[C.ViewModi].AddSubLabel(panel, v.value, "field", v.display);
            ShowWorker(panel);

            if (_atk > 0 || _def > 0)
            {
                panel.AddHeaderLabelT("fight");
            }
            panel.AddSubLabelT("atk", _atk, "atk");
            panel.AddSubLabelT("def", _def, "def");

            panel.AddResT("constructionCost", cost);
            req.BuildPanel(panel, S.T("constructionReq"), null, pos);
            panel.AddModi(modi);
        }
Пример #2
0
        public override void ShowDetail(PanelBuilder panel)
        {
            _build.AddImageLabel(panel);
            panel.AddResT("constructionCost", _cost);
            panel.AddHeaderLabelT("general");
            var hpap = CalculatedData.Calc(_build, _cost);

            panel.AddSubLabelT("hp", hpap.hp, "hp");
            panel.AddSubLabelT("ap", hpap.ap, "ap");
            var b = L.b.modifiers[C.BuildRes].CalcText(hpap.buildTime, S.ActPlayer(), pos);

            L.b.res[C.BuildRes].AddSubLabel(panel, b.value, "round", b.display);

            panel.AddButtonT("reset", (() =>
            {
                _cost = new Dictionary <string, int>(_costOrg);
                ReCalc(0);
            }));

            //what replace?
            if (!_cost.ContainsKey(replace.id))
            {
                panel.AddLabel(S.T("constructionOwnReplaceNothing", _build.Name()));
                return;
            }

            panel.AddHeaderLabel(S.T("constructionOwnReplace", replace.Text(_cost[replace.id])));

            //build dropdown
            List <string> values = new List <string>();
            List <string> titles = new List <string>();

            foreach (Resource r in L.b.res.GetAllByCategory(replace.id))
            {
                if (r.special == false && _town.KnowRes(r.id))
                {
                    values.Add(r.id);
                    titles.Add(r.Text(_town.GetRes(r.id)));
                }
            }

            panel.AddDropdown(values.ToArray(), values[0], titles.ToArray(), s =>
            {
                selected = L.b.res[s];
                UpdateButton();
            });

            _one = panel.AddImageTextButton("", "logo", () => { ReCalc(1); });

            _ten = panel.AddImageTextButton("", "logo", () => { ReCalc(10); });

            max = panel.AddImageTextButton("", "logo", () => { ReCalc(Math.Min(_cost[replace.id], _town.GetRes(selected.id))); });

            total = panel.AddImageTextButton("", "logo", () => { ReCalc(_cost[replace.id]); });

            selected = L.b.res[values[0]];
            UpdateButton();
        }
Пример #3
0
        public override void ShowDetail(PanelBuilder panel)
        {
            build.AddImageLabel(panel);
            panel.AddResT("constructionCost", cost);
            panel.AddHeaderLabelT("general");
            var hpap = CalculatedData.Calc(build, cost);

            panel.AddSubLabelT("hp", hpap.hp, "hp");
            panel.AddSubLabelT("ap", hpap.ap, "ap");
            var b = L.b.modifiers[C.BuildRes].CalcText(hpap.buildTime, S.ActPlayer(), pos);

            L.b.res[C.BuildRes].AddSubLabel(panel, b.value, "round", b.display);
        }
Пример #4
0
        public override void ShowLexicon(PanelBuilder panel)
        {
            base.ShowLexicon(panel);

            if (category == "construction")
            {
                panel.AddHeaderLabelT("construction");
                panel.AddSubLabelT("hp", hp, "hp");
                panel.AddSubLabelT("ap", ap, "ap");
                panel.AddModi(modi);
            }

            if (category == "food")
            {
                panel.AddHeaderLabelT("food");
                panel.AddSubLabelT("hp", hp, "hp");
                panel.AddSubLabelT("ap", ap, "ap");
                panel.AddModi(modi);
            }
        }