public override void Initialize(ScreenInfo parent) { // Create the space to make the left and right side menus // and add the generated GUIMenu objects into it. List<GUIObject> find = FindObjectsOfType(typeof(GUIMenu)); if (find.Count > 0) lmenu = find[0] as GUIMenu; find = FindObjectsOfType(typeof(GUIScrollMenu)); if (find.Count > 0) rmenu = find[0] as GUIScrollMenu; find = FindObjectsOfType(typeof(GUILabel)); if (find.Count > 0) { title = find[0] as GUILabel; if (interactObject != null) title.text = interactObject.prettyname; } find.Clear(); Elements.Clear(); GUIVerticalCommand vert = new GUIVerticalCommand(); vert.Elements = new List<GUIObject>(); Elements.Add(vert); if (title != null ) vert.Elements.Add(title); GUISpace space = new GUISpace(); space.pixels = 5; vert.Elements.Add(space); if (lmenu != null && rmenu != null) { GUIHorizontalCommand hc = new GUIHorizontalCommand(); hc.Elements = new List<GUIObject>(); hc.Elements.Add(lmenu); hc.Elements.Add(rmenu); vert.Elements.Add(hc); } base.Initialize(parent); patient = Patient.FindObjectOfType(typeof(Patient)) as Patient; Object[] temp = ObjectInteraction.FindObjectsOfType(typeof(ObjectInteraction)); foreach (Object obj in temp) { if (obj == patient) continue; roomObjects.Add(obj as ObjectInteraction); } listings = new Listings(); listings.category = "root"; current = listings; }
public override void Process(GUIScreen parentScreen, GUIArea container) { base.Process(parentScreen, container); if (scrollMenu != null) { scrollMenu.Process(parentScreen, container); menus = new GUIScrollMenu[4]; menus[0] = new GUIScrollMenu(); menus[1] = new GUIScrollMenu(); menus[2] = new GUIScrollMenu(); menus[3] = new GUIScrollMenu(); menus[0].CopyFrom(scrollMenu); menus[1].CopyFrom(scrollMenu); menus[2].CopyFrom(scrollMenu); menus[3].CopyFrom(scrollMenu); menus[0].buttonTemplate = scrollMenu.buttonTemplate; menus[0].scrollviewTemplate = scrollMenu.scrollviewTemplate; menus[0].Process(parentScreen, container); menus[1].buttonTemplate = scrollMenu.buttonTemplate; menus[1].scrollviewTemplate = scrollMenu.scrollviewTemplate; menus[1].Process(parentScreen, container); menus[2].buttonTemplate = scrollMenu.buttonTemplate; menus[2].scrollviewTemplate = scrollMenu.scrollviewTemplate; menus[2].Process(parentScreen, container); menus[3].buttonTemplate = scrollMenu.buttonTemplate; menus[3].scrollviewTemplate = scrollMenu.scrollviewTemplate; menus[3].Process(parentScreen, container); } if (divider != null) divider.Process(parentScreen, container); }