public void SetType( string guiName, GUIEditObject.GUITypes guiType ) { // create based on type if ( guiType == GUITypes.Screen ) { guiScreen = new GUIScreen(); guiScreen.name = guiName; } if ( guiType == GUITypes.Area ) { guiObject = new GUIArea(); guiObject.name = guiName; } if ( guiType == GUITypes.Label ) { guiObject = new GUILabel(); guiObject.name = guiName; } if ( guiType == GUITypes.Button ) { guiObject = new GUIButton(); guiObject.name = guiName; } if ( guiType == GUITypes.Horizontal ) { guiObject = new GUIHorizontalCommand(); guiObject.name = guiName; } if ( guiType == GUITypes.Vertical ) { guiObject = new GUIVerticalCommand(); guiObject.name = guiName; } if ( guiType == GUITypes.Scrollview ) { guiObject = new GUIScrollView(); guiObject.name = guiName; } if ( guiType == GUITypes.Toggle ) { guiObject = new GUIToggle(); guiObject.name = guiName; } if ( guiType == GUITypes.Space ) { guiObject = new GUISpace(); guiObject.name = guiName; } if ( guiType == GUITypes.EditBox ) { guiObject = new GUIEditbox(); guiObject.name = guiName; } if ( guiType == GUITypes.Box ) { guiObject = new GUIBox(); guiObject.name = guiName; } if ( guiType == GUITypes.HorizontalSlider ) { guiObject = new GUIHorizontalSlider(); guiObject.name = guiName; } if ( guiType == GUITypes.VerticalSlider ) { guiObject = new GUIVerticalSlider(); guiObject.name = guiName; } if ( guiType == GUITypes.Movie ) { guiObject = new GUIMovie(); guiObject.name = guiName; } }
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; }