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); } } }
public override void ShowDetail(PanelBuilder panel) { panel.AddSubLabel("Position", _mapElementInfo.Pos().ToString()); panel.AddHeaderLabel("HP"); panel.AddInput("HP", _mapElementInfo.data.hp, (s => { _mapElementInfo.data.hp = s; })); panel.AddHeaderLabel("AP"); panel.AddInput("AP", _mapElementInfo.data.ap, (s => { _mapElementInfo.data.ap = s; })); panel.AddButton("Set Finish", _mapElementInfo.FinishConstruct); //display all actions foreach (var act in _mapElementInfo.data.action.actions) { act.PerformAction().BuildPanel(new ActionDisplaySettings(panel, _mapElementInfo.Player(), _mapElementInfo, _mapElementInfo.Pos(), act)); } //display modis }
public void AddOption(PanelBuilder panel) { if (type == "bool") { panel.AddCheckbox(Bool(), Name(), s => { SetValue(Convert.ToString(s)); }); return; } if (type.StartsWith("scale")) { panel.AddHeaderLabel(Name()); var t = SplitHelper.SeparatorInt(SplitHelper.Delimiter(type).value); panel.AddSlider(t[0], t[1], PlayerPrefs.GetInt(id, Int32.Parse(Value())), s => { SetValue(s.ToString()); }); return; } if (type == "text") { panel.AddInput(Name(), Value(), SetValue); } if (type.StartsWith("dropdown")) { var values = SplitHelper.Separator(SplitHelper.Delimiter(type).value); List <string> titles = new List <string>(); foreach (var value in values) { titles.Add(S.T(value)); } panel.AddHeaderLabel(Name()); panel.AddDropdown(values, Value(), titles.ToArray(), SetValue); } }
public override void ShowDetail(PanelBuilder panel) { panel.AddHeaderLabel("Level"); panel.AddInput("Level", town.level, (s => { town.level = s; })); }