Exemplo n.º 1
0
        public override void ShowDetail(PanelBuilder panel)
        {
            //res
            town.ShowCombineRes(panel);

            //res
            town.ShowRes(panel);

            //show grow last round
            bool found = false;

            foreach (var r in town.resStatistic.GetLast(ResType.Produce))
            {
                var i = L.b.res[r.Key];
                if (i.special || i.Hidden)
                {
                    continue;
                }

                if (!found)
                {
                    found = true;
                    panel.AddHeaderLabelT("townProduceLastRound");
                }
                i.AddImageLabel(panel, (int)r.Value);
            }
        }
Exemplo n.º 2
0
        public override void ShowDetail(PanelBuilder panel)
        {
            panel.AddHeaderLabelT("name");
            panel.AddInputRandom("Name", startConfig[id + "name"], s => {
                startConfig[id + "name"] = s;
                UIHelper.UpdateButtonText(button, s);
            }, () => LClass.s.NameGenerator("unit"));

            panel.AddHeaderLabelT("nation");
            panel.AddDropdown(L.b.nations.Values().ToList(), startConfig[id + "nation"],
                              s => {
                startConfig[id + "nation"] = s;
            });

            panel.AddHeaderLabelT("coat");
            panel.AddDropdown(L.b.coats.GetAllByCategory("kingdom"), startConfig[id + "coat"],
                              s => {
                startConfig[id + "coat"] = s;
                UIHelper.UpdateButtonImage(button, L.b.coats[s].Sprite());
            });

            panel.AddHeaderLabelT("endlessWin");
            panel.AddCheckbox(Boolean.Parse(startConfig[id + "winGold"]), S.T("endlessWinGold"), b =>
            {
                startConfig[id + "winGold"] = b.ToString();
            });

            panel.AddHeaderLabelT("endlessLose");
            panel.AddCheckbox(Boolean.Parse(startConfig[id + "loseKing"]), S.T("endlessLoseUnit"), b =>
            {
                startConfig[id + "loseKing"] = b.ToString();
            });
        }
Exemplo n.º 3
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.º 4
0
        public void ShowRes(PanelBuilder panel, Player player, NVector pos)
        {
            //addHeader
            if (pos != null && GameMgmt.Get().data.map.levels[pos.level].ResGenKey(pos.x, pos.y) != null && player != null && player.overlay.Get("res", pos) == 1)
            {
                panel.AddHeaderLabelT("res");
                foreach (string key in GameMgmt.Get().data.map.levels[pos.level].ResGenKey(pos.x, pos.y))
                {
                    if (S.Debug())
                    {
                        panel.AddHeaderLabel(key);
                        panel.AddInput(key, GameMgmt.Get().data.map.ResGen(pos, key),
                                       val => GameMgmt.Get().data.map.ResGenAdd(pos, key, val - GameMgmt.Get().data.map.ResGen(pos, key)));
                        continue;
                    }
                    L.b.res[key].AddImageLabel(panel, L.b.terrains.GenDesc(GameMgmt.Get().data.map.ResGen(pos, key)));
                }
                return;
            }

            if (res.Count > 0)
            {
                panel.AddHeaderLabelT("resInclude");
                foreach (KeyValuePair <string, string> r in res)
                {
                    int    chance = ResChance(r.Key);
                    var    c      = ResRange(r.Key);
                    string txt    = S.T("resCountRange", L.b.terrains.GenDesc(c.min), L.b.terrains.GenDesc(c.max));
                    L.b.res[r.Key].AddImageLabel(panel, chance >= 1 ? S.T("resCountChance", chance, txt) : txt);
                }
            }
        }
Exemplo n.º 5
0
 public override void ShowDetail(PanelBuilder panel)
 {
     foreach (var action in info.data.action.actions)
     {
         action.PerformAction().BuildPanel(new ActionDisplaySettings(panel, info.Player(), info, info.Pos(), action));
     }
 }
Exemplo n.º 6
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.º 7
0
        public void BuildPanel(PanelBuilder panel, string title, Player player = null)
        {
            try
            {
                //addHeader
                if (reqs.Count == 0)
                {
                    return;
                }

                panel.AddHeaderLabel(title);

                //add req
                foreach (var req in reqs)
                {
                    BaseReq r = OLib.GetReq(req[0]);
                    if (player == null)
                    {
                        panel.AddLabel(r.Desc(null, req[1]));
                    }
                    else
                    {
                        panel.AddImageLabel(r.Desc(player, req[1]), r.Check(player, req[1]));
                    }
                }
            }
            catch (Exception e)
            {
                ExceptionHelper.ShowException(e);
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 获取标签生成器
        /// </summary>
        protected override TagBuilder GetTagBuilder()
        {
            var builder = new PanelBuilder();

            Config(builder);
            return(builder);
        }
Exemplo n.º 9
0
        public override void ShowDetail(PanelBuilder panel)
        {
            base.ShowDetail(panel);
            //show cost differences
            panel.AddHeaderLabel("Real cost");
            bool found = false;

            foreach (var cost in build.cost)
            {
                var r = L.b.res[cost.Key];
                if (!go.baseData.cost.ContainsKey(cost.Key))
                {
                    r.AddImageLabel(panel, cost.Value);
                    found = true;
                    continue;
                }

                if (cost.Value > go.baseData.cost[cost.Key])
                {
                    r.AddImageLabel(panel, cost.Value - go.baseData.cost[cost.Key]);
                    found = true;
                }
            }

            if (!found)
            {
                panel.AddLabel("No extra cost");
            }
        }
Exemplo n.º 10
0
 public override void ShowDetail(PanelBuilder panel)
 {
     AddItem(panel, "hand1", "hand");
     AddItem(panel, "hand2", "hand");
     AddItem(panel, "armour", "armour");
     AddItem(panel, "shoe", "shoe");
 }
Exemplo n.º 11
0
 public override void ShowDetail(PanelBuilder panel)
 {
     foreach (Quest q in S.ActPlayer().quests.quests)
     {
         panel.AddSubLabel(q.Name(), q.status.ToString(), q.Sprite());
     }
 }
Exemplo n.º 12
0
        public override void ShowDetail(PanelBuilder panel)
        {
            panel.AddHeaderLabel("Receipts");

            int  i     = 0;
            bool found = false;

            while (_holder.data.ContainsKey("craft" + i))
            {
                found = true;
                var    d  = SplitHelper.SplitInt(_holder.data["craft" + i]);
                Craft  c  = L.b.crafts[d.key];
                int    id = i;
                Button b  = panel.AddImageTextButton((d.value == -1?"Endless ":d.value + "x ") + c.Name(), c.Icon, () =>
                {
                    Remove(id);
                });

                i++;
            }

            if (!found)
            {
                panel.AddLabel("No active receipt found. You can add some from the left menu.");
            }
        }
Exemplo n.º 13
0
        public override void ShowLexicon(PanelBuilder panel)
        {
            base.ShowLexicon(panel);

            panel.AddSubLabel("Author", author);
            panel.AddSubLabel("Level", level);
            panel.AddSubLabel("Size", $"{width}x{height}");
            if (S.Debug())
            {
                panel.AddLabel("Folder: " + folder);
            }
            req.BuildPanel(panel, null);

            if (Intern())
            {
                panel.AddHeaderLabel("Overview");
                panel.AddImage(UnityEngine.Resources.Load <Sprite>(folder.Substring(1) + "/" + id));
            }
            else
            {
                FileInfo img = new FileInfo(Dir() + id + ".png");
                if (img.Exists)
                {
                    panel.AddHeaderLabel("Overview");
                    panel.AddImage(SpriteHelper.LoadExternalSprite(img.FullName));
                }
            }
        }
Exemplo n.º 14
0
        static void Main(string[] args)
        {
            Builder builder = new PanelBuilder("Exfactor Grup SRL");
            House   house2  = builder.Create();

            builder = new WoodBuilder("Dansicons SRL");
            House house = builder.Create();
        }
Exemplo n.º 15
0
 public override void ShowDetail(PanelBuilder panel)
 {
     panel.AddHeaderLabelT("general");
     panel.AddSubLabel("Name", _player.name, _player.Coat().Icon);
     panel.AddSubLabel(L.b.nations.Name(), _player.Nation().Name(), _player.Nation().Icon);
     panel.AddSubLabel("Points", _player.points.ToString());
     panel.AddModi(S.Game().data.modi);
 }
Exemplo n.º 16
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.º 17
0
 public override void ShowLexicon(PanelBuilder panel)
 {
     base.ShowLexicon(panel);
     foreach (var k in trans)
     {
         panel.AddHeaderLabel(k.Key);
         panel.AddLabel(k.Value);
     }
 }
Exemplo n.º 18
0
        public void ShowInfo(PanelBuilder panel, Player player = null)
        {
            AddImageLabel(panel);
            panel.RichText(desc);
            panel.AddSubLabel("Status", (IsFinish() ? "Finish":"In Progress"), IsFinish() ?"yes":"round");

            reqs.BuildPanel(panel, player);
            actions.BuildPanelT(new ActionDisplaySettings(panel, null));
        }
Exemplo n.º 19
0
        public void AddSubLabel(PanelBuilder panel, int count, string header = null, string display = null)
        {
            if (string.IsNullOrEmpty(display))
            {
                display = count.ToString();
            }
            var text = Plural(count, header, display);

            panel.AddSubLabel(Name(), text, Sprite());
        }
Exemplo n.º 20
0
        public override void ShowLexicon(PanelBuilder panel)
        {
            base.ShowLexicon(panel);
            req.BuildPanel(panel, "Requirements for development");

            if (LClass.s.elementRuns.ContainsKey(id))
            {
                LClass.s.elementRuns[id].ShowDetail(panel);
            }
        }
        ///<summary>
        /// Constructor for <see cref="BusinessObjectPanelVWG{T}"/>
        ///</summary>
        ///<param name="controlFactory"></param>
        ///<param name="uiDefName"></param>
        public BusinessObjectPanelVWG(IControlFactory controlFactory, string uiDefName)
        {
            PanelBuilder panelBuilder = new PanelBuilder(controlFactory);

            _panelInfo = panelBuilder.BuildPanelForForm(ClassDef.Get <T>().UIDefCol[uiDefName].UIForm);
            BorderLayoutManager layoutManager = controlFactory.CreateBorderLayoutManager(this);

            layoutManager.AddControl(_panelInfo.Panel, BorderLayoutManager.Position.Centre);
            this.Size        = _panelInfo.Panel.Size;
            this.MinimumSize = _panelInfo.Panel.Size;
        }
Exemplo n.º 22
0
 public override void ShowDetail(PanelBuilder panel)
 {
     panel.AddHeaderLabelT("general");
     panel.AddSubLabel("Total",_mapElementInfo.data.spells.total.ToString());
     panel.AddHeaderLabelT("spell");
     foreach (var s in _mapElementInfo.data.spells.known)
     {
         Spell spell = L.b.spells[s];
         panel.AddSubLabel(spell.Name(), _mapElementInfo.data.spells.count[s].ToString(), spell.Icon);
     }
 }
Exemplo n.º 23
0
        internal static IPanelInfo CreatePanelInfo
            (IControlFactory controlFactory, IClassDef classDef, string uiDefName, IBOEditorControl iboEditorControl)
        {
            IUIForm             uiForm        = GetUiForm(classDef, uiDefName);
            PanelBuilder        panelBuilder  = new PanelBuilder(controlFactory);
            IPanelInfo          panelInfo     = panelBuilder.BuildPanelForForm(uiForm);
            BorderLayoutManager layoutManager = controlFactory.CreateBorderLayoutManager(iboEditorControl);

            layoutManager.AddControl(panelInfo.Panel, BorderLayoutManager.Position.Centre);
            return(panelInfo);
        }
Exemplo n.º 24
0
        public override void ShowDetail(PanelBuilder panel)
        {
            panel.AddHeaderLabel("General");
            LSys.tem.inputs.GetAllByCategory("general").ForEach(i => i.BuildPanel(panel));

            panel.AddHeaderLabel("Actions");
            LSys.tem.inputs.GetAllByCategory("unit").ForEach(i => i.BuildPanel(panel));

            panel.AddHeaderLabel("Camera");
            LSys.tem.inputs.GetAllByCategory("camera").ForEach(i => i.BuildPanel(panel));
        }
Exemplo n.º 25
0
    ////////////////////////////////////////////////
    ////////////////////////////////////////////////

    void Awake()
    {
        if (_instance != null && _instance != this)
        {
            Destroy(gameObject);
        }
        else
        {
            _instance = this;
        }
    }
Exemplo n.º 26
0
        public override void ShowDetail(PanelBuilder panel)
        {
            panel.AddCheckbox(true, "Send errors automatically", s => { }).interactable = false;
            panel.AddCheckbox(true, "Send diagnostics", s => { }).interactable          = false;
            panel.AddLabel(
                "If you do not want, to send the infos, please disable the network");
            panel.AddLabel(
                "or use a firewall. See also the privacy statement in the help menu");

            base.ShowDetail(panel);
        }
Exemplo n.º 27
0
 public void ShowInfo(PanelBuilder panel)
 {
     panel.AddHeaderLabel(name);
     panel.AddSubLabel("Round", round, "round");
     panel.AddSubLabel("Date", date.ToLongDateString(), "!Icons/fugue:date");
     panel.AddSubLabel("Game", version, "logo");
     if (S.Debug())
     {
         panel.AddSubLabel("File", file, "file");
     }
 }
Exemplo n.º 28
0
 public void ShowDetail(PanelBuilder panel)
 {
     base.ShowLexicon(panel);
     panel.AddHeaderLabel("Scenarios");
     foreach (Scenario s in Scenarios())
     {
         if (s.req.Check(null))
         {
             panel.AddImageTextButton(s.Name(), SpriteHelper.Load(s.Icon), (() => s.Start()));
         }
     }
 }
Exemplo n.º 29
0
        public override void ShowLexicon(PanelBuilder panel)
        {
            base.ShowLexicon(panel);
            panel.AddImageLabel(S.T("spellCost", cost), "ap");
            req.BuildPanel(panel);
            reqTarget.BuildPanel(panel);

            var ah = new ActionDisplaySettings(panel, null);

            action.BuildPanelT(ah, "spellPerformSuccess");
            actionFail.BuildPanelT(ah, "spellPerformFail");
        }
Exemplo n.º 30
0
 public override void ShowLexicon(PanelBuilder panel)
 {
     base.ShowLexicon(panel);
     panel.AddSubLabel("Daytime", daytime);
     panel.AddSubLabel("Season", season);
     panel.AddModi(modi);
     if (S.IsGame())
     {
         panel.AddHeaderLabel("Actual");
         panel.AddLabel(GameMgmt.Get().gameRound.GetRoundString());
     }
 }
Exemplo n.º 31
0
	public static PanelBuilder parent(Transform obj)
	{
		PanelBuilder b = new PanelBuilder ();
		b._parent = obj;
		return b;
	}