public PopupXScroll getScrollSetVotes(Person p, VoteIssue vi) { PopupXScroll specific = getInnerXScrollSet(); foreach (VoteOption vo in vi.options) { PopupXBoxThreat box = getVoteReasonBox(vi, vo, p); box.gameObject.transform.SetParent(specific.gameObject.transform); specific.scrollables.Add(box); } return(specific); }
public PopupXScroll getScrollSetGods(List <God> gods) { PopupXScroll specific = getInnerXScrollSetGods(); foreach (God item in gods) { PopupXBoxGodSelectMsg box = getGodBox(item); box.gameObject.transform.SetParent(specific.gameObject.transform); box.ui = world.ui; specific.scrollables.Add(box); } return(specific); }
private PopupXScroll getInnerXScrollSet() { GameObject obj = Instantiate(xScrollSet) as GameObject; PopupXScroll specific = obj.GetComponent <PopupXScroll>(); if (specific == null) { World.log("Unable to find scrip subobject"); } specific.ui = world.ui; specific.next.onClick.AddListener(delegate { specific.bNext(); }); specific.prev.onClick.AddListener(delegate { specific.bPrev(); }); specific.cancel.onClick.AddListener(delegate { specific.bCancel(); }); return(specific); }
public PopupXScroll getScrollSetThreats(List <ThreatItem> threats) { PopupXScroll specific = getInnerXScrollSet(); List <ThreatItem> dupe = new List <ThreatItem>(); foreach (ThreatItem item in threats) { dupe.Add(item); } List <ThreatItem> ordered = new List <ThreatItem>(); int viewedCount = 0; while (dupe.Count > 0) { ThreatItem best = dupe[0]; foreach (ThreatItem item in dupe) { if (item.threat > best.threat) { best = item; } } if (best.threat < 75 && best.group != null && best.group is Society && viewedCount >= 3) { //Skip it, we don't need to list all minor factions we aren't scared of } else { viewedCount += 1; ordered.Add(best); } dupe.Remove(best); } foreach (ThreatItem item in ordered) { PopupXBoxThreat box = getThreatBox(item); box.gameObject.transform.SetParent(specific.gameObject.transform); specific.scrollables.Add(box); } return(specific); }