private string getrandawardstring(PVEExploreLevelConfig c) { string r = ""; foreach (var v in c.randAward) { int cid = v.cid; if (cid > 0) { r += tools.helper.getresourcetype((ResourceTypes)cid) + ":"; int tr = 0; foreach (var rate in v.rate) { tr += rate["num"] * rate["rate"]; //r += rate["num"] == 0 ? "无" : rate["num"] + "-%" + rate["rate"] + " "; } r += tr + "%"; } break; //r += v.Key + ":" + v.Value + " "; } if (r == "") { foreach (int cid in c.pruductGoods) { string item = tools.helper.getresourcetype((ResourceTypes)cid); if (item != null) { r += item + " "; } } } return r; }
private string getoilammocost(PVEExploreLevelConfig c) { string r = ""; r += "油:" + c.needOil + " 弹" + c.needAmmo; return(r); }
private string getrandawardstring(PVEExploreLevelConfig c) { string r = ""; foreach (var v in c.randAward) { int cid = v.cid; if (cid > 0) { r += tools.helper.getresourcetype((ResourceTypes)cid) + ":"; int tr = 0; foreach (var rate in v.rate) { tr += rate["num"] * rate["rate"]; //r += rate["num"] == 0 ? "无" : rate["num"] + "-%" + rate["rate"] + " "; } r += tr + "%"; } break; //r += v.Key + ":" + v.Value + " "; } if (r == "") { foreach (int cid in c.pruductGoods) { string item = tools.helper.getresourcetype((ResourceTypes)cid); if (item != null) { r += item + " "; } } } return(r); }
public void FinishExploreAtLevel(object[] os) { PVEExploreLevelConfig config = os[0] as PVEExploreLevelConfig; this.currentSelectedLevel = config; int id = (int) os[1]; this.finishingFleet = this.gamedata.GetFleetOfId(id); this.ReqFinishExplore(config.id); }
public void SetLevelConfig(PVEExploreLevelConfig config) { this.levelConfig = config; this.userPVELevel = GameData.instance.GetExploreAtLevel(this.levelConfig.id); if (this.userPVELevel != null) { this.isFinished = this.userPVELevel.IsFinished; } this.UpdateBasicInfo(); }
private string gettyperequiredstring(PVEExploreLevelConfig c) { string r = ""; foreach (var v in c.needShipType) { r += tools.helper.getshiptype((ShipType)v.type) + ":" + v.num + " "; } return(r); }
private GameObject GetLevelPrefab(PVEExploreLevelConfig cfg) { UserPVEExplore exploreAtLevel = this.gamedata.GetExploreAtLevel(cfg.id); if (exploreAtLevel == null) { return this.levelItemPrefabNotUsing; } if (exploreAtLevel.IsFinished) { return this.levelItemPrefabFinished; } return this.levelItemPrefabUsing; }
private string getrewardstring(PVEExploreLevelConfig c) { string r = ""; try { foreach (var v in c.award) { int t = int.Parse(v.Key); r += tools.helper.getresourcetype((ResourceTypes)t) + ":" + v.Value + " "; } } catch (Exception) { } return(r); }
private string gettyperequiredstring(PVEExploreLevelConfig c) { string r = ""; foreach (var v in c.needShipType) { r += tools.helper.getshiptype((ShipType)v.type) + ":" + v.num + " "; } return r; }
private void updateExploreInfo() { Dictionary <int, int> explist = new Dictionary <int, int>(); foreach (var expl in GameData.instance.GetUserPVEExplores()) { explist[expl.exploreId] = expl.fleetId; } GridPanel panel = explorelist.PrimaryGrid; panel.Rows.Clear(); int i = 0; foreach (KeyValuePair <int, PVEExploreLevelConfig> kv in GameConfigs.instance.getallExploreLevels()) { int key = kv.Key; PVEExploreLevelConfig conf = kv.Value; object[] vals = new object[12]; vals[0] = conf.id; vals[1] = conf.title; vals[2] = getrewardstring(conf); vals[3] = conf.TimeNeed; vals[4] = conf.needShipNum; vals[5] = conf.needFlagShipLevel; vals[6] = gettyperequiredstring(conf); vals[7] = getrandawardstring(conf); vals[8] = "%" + conf.bigSuccessRate; vals[9] = getoilammocost(conf); vals[10] = false; vals[11] = "执行"; GridRow gr = new GridRow(vals); gr.RowHeight = 0; panel.Rows.Add(gr); panel.GetCell(i, 11).Tag = conf.id; if (explist.ContainsKey(conf.id)) { panel.GetCell(i, 10).Visible = false; panel.GetCell(i, 11).Visible = false; int flid = explist[conf.id]; var uf = GameData.instance.UserFleets[flid - 1]; panel.GetCell(i, 2).Value = uf.title + " 正在执行中..."; panel.GetCell(i, 2).CellStyles.Default.Background = new DevComponents.DotNetBar.SuperGrid.Style.Background(Color.LightGreen); var r = panel.GetRowFromIndex(i); if (r != null) { r.CellStyles.Default.Background = new DevComponents.DotNetBar.SuperGrid.Style.Background(Color.LightGreen); } } i++; } }
public void StartExploreAtLevel(PVEExploreLevelConfig level) { if (GlobalLock.instance.CanGo) { GlobalLock.instance.GoNow(); TutorialManager.instance.CheckStepFinishAction("StartExplorePrepareClick"); this.levelParent.gameObject.SetActive(false); this.currentSelectedLevel = level; CurrentWarParameters.selectedExploreLevel = this.currentSelectedLevel; GameObject obj2 = UnityEngine.Object.Instantiate(this.levelPreparePrefab) as GameObject; obj2.GetComponent<PVEExplorePrepareUIManager>().SetPVEChapterUIManager(this); this.hideAction.SetActive(true); this.hideAction.GetComponent<AnimatePosition>().StartMove(); } }
private string getrewardstring(PVEExploreLevelConfig c) { string r = ""; try { foreach (var v in c.award) { int t = int.Parse(v.Key); r += tools.helper.getresourcetype((ResourceTypes)t) + ":" + v.Value + " "; } } catch (Exception) { } return r; }
public void CancelExploreAtLevel(PVEExploreLevelConfig level) { this.currentSelectedLevel = level; this.ConfirmCancel(); }
private string getoilammocost(PVEExploreLevelConfig c) { string r = ""; r += "油:" + c.needOil + " 弹" + c.needAmmo; return r; }
internal bool m_3F(PVEExploreLevelConfig n1) { return(n1.pveId == this.pveId); }
internal bool m_3F(PVEExploreLevelConfig n1) { return (n1.pveId == this.pveId); }
public void PreparePVEExploreLevels(PVEExploreLevelConfig[] levels) { if ((levels != null) && (levels.Length > 0)) { this.allExploreLevelsList = levels.ToList<PVEExploreLevelConfig>(); this.allExploreLevels = new Dictionary<int, PVEExploreLevelConfig>(); foreach (PVEExploreLevelConfig config in levels) { this.allExploreLevels[config.id] = config; } } }