Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public override void ShowDetail(PanelBuilder panel)
        {
            panel.AddImageLabel(_info.name, _info.Sprite());
            panel.AddHeaderLabel("Information");
            //diff unit?
            if (!_info.Owner(S.ActPlayerID()))
            {
                panel.AddSubLabel("Owner", _info.Player().name, _info.Player().Coat().Icon);
                panel.AddSubLabel("HP", $"??/{_info.baseData.hp}", "hp");
                panel.AddSubLabel("AP", $"??/{_info.baseData.ap}", "ap");
                return;
            }

            panel.RichText(_info.data.info.LastInfo());
            panel.AddSubLabel("HP", $"{_info.data.hp}/{_info.data.hpMax}", "hp");
            panel.AddSubLabel("AP", $"{_info.data.ap}/{_info.data.apMax}", "ap");

            Construction con = _info.GetComponent <Construction>();

            if (con != null)
            {
                panel.AddResT("constructionOnGoing", _info.data.construction.ToDictionary(entry => entry.Key, entry => entry.Value));
                panel.AddLabelT("constructionOnGoingDesc");
            }

            panel.AddModi(_info.data.modi);
        }
Exemplo n.º 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);

            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();
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
0
        public override void ShowLexicon(PanelBuilder panel)
        {
            base.ShowLexicon(panel);
            L.b.res[C.BuildRes].AddSubLabel(panel, buildTime, "round");
            L.b.modifiers[C.ViewModi].AddSubLabel(panel, visibilityRange, "field");
            ShowWorker(panel);
            panel.AddResT("constructionCost", cost);
            req.BuildPanel(panel, S.T("constructionReq"));
            panel.AddModi(modi);

            ActionDisplaySettings sett = new ActionDisplaySettings(panel, null);

            sett.compact = true;
            action.BuildPanelT(sett);
        }
Exemplo n.º 6
0
 public override void ShowLexicon(PanelBuilder panel)
 {
     base.ShowLexicon(panel);
     panel.AddResT("craftReceipt", res);
     req.BuildPanel(panel);
 }