//public void ButtonEnabler(UITextureSprite sPrite) { //if (sPrite == FavCimsCBMenuSprite) { //FavCimsCBMenuSprite.texture = FavCimsCBETexture; //FavCimsBBMenuSprite.texture = FavCimsBBDTexture; //FavCimsSBMenuSprite.texture = FavCimsSBDTexture; //} else if (sPrite == FavCimsBBMenuSprite) { //FavCimsCBMenuSprite.texture = FavCimsCBDTexture; //FavCimsBBMenuSprite.texture = FavCimsBBETexture; //FavCimsSBMenuSprite.texture = FavCimsSBDTexture; //} else if (sPrite == FavCimsSBMenuSprite) { //FavCimsCBMenuSprite.texture = FavCimsCBDTexture; //FavCimsBBMenuSprite.texture = FavCimsBBDTexture; //FavCimsSBMenuSprite.texture = FavCimsSBETexture; //} //return; //} public override void Start() { var uiView = UIView.GetAView(); this.name = "FavCimsPanel"; this.width = 1200; this.height = 700; this.opacity = 0.95f; this.eventVisibilityChanged += (component, value) => change_visibility_event (); //Main Panel BG Texture Texture FavCimsMainBGTexture = ResourceLoader.loadTexture ((int)this.width, (int)this.height, "UIMainPanel.mainbg.png"); FavCimsMainBGTexture.wrapMode = TextureWrapMode.Clamp; FavCimsMainBGTexture.filterMode = FilterMode.Bilinear; //FavCimsMainBGTexture.anisoLevel = 9; Set 1 Bad to 9 Very God FavCimsMainBGTexture.name = "FavCimsMainBGTexture"; UITextureSprite FavCimsMainBGSprite; FavCimsMainBGSprite = this.AddUIComponent<UITextureSprite> (); FavCimsMainBGSprite.name = "FavCimsMainBGSprite"; FavCimsMainBGSprite.texture = FavCimsMainBGTexture; FavCimsMainBGSprite.relativePosition = new Vector3 (0, 0); FavCimsMainBGSprite.eventMouseDown += delegate { if (Input.GetMouseButton (0)) { if (this.GetComponentInChildren<WindowController> () != null) { this.PanelMover = this.GetComponentInChildren<WindowController> (); this.PanelMover.ComponentToMove = this; this.PanelMover.Stop = false; this.PanelMover.Start (); } else { this.PanelMover = this.AddUIComponent (typeof(WindowController)) as WindowController; this.PanelMover.ComponentToMove = this; } this.opacity = 0.5f; } }; FavCimsMainBGSprite.eventMouseUp += delegate { if (this.PanelMover != null) { this.PanelMover.Stop = true; this.PanelMover.ComponentToMove = null; this.PanelMover = null; } this.opacity = 1f; }; //Main Panel Title Texture Texture FavCimsTitleTexture; FavCimsTitleTexture = ResourceLoader.loadTexture ((int)this.width, 58, "UIMainPanel.favcimstitle.png"); FavCimsTitleTexture.wrapMode = TextureWrapMode.Clamp; FavCimsTitleTexture.filterMode = FilterMode.Bilinear; FavCimsTitleTexture.mipMapBias = -0.5f; //FavCimsTitleTexture.anisoLevel = 9; // Set 1 Bad to 9 Very God FavCimsTitleTexture.name = "FavCimsTitleTexture"; FavCimsTitleSprite = FavCimsMainBGSprite.AddUIComponent<UITextureSprite> (); FavCimsTitleSprite.name = "FavCimsTitleSprite"; FavCimsTitleSprite.texture = FavCimsTitleTexture; float FavCimsTitleSpriteRelPosX = ((this.width / 2) - (float)FavCimsTitleTexture.width / 2); FavCimsTitleSprite.relativePosition = new Vector3 (FavCimsTitleSpriteRelPosX, 0); /////////////////////////////////////////////// //Game Default Close Button ////////////////////////////////////////////// UIButton FavCimsMenuCloseButton = this.AddUIComponent<UIButton> (); FavCimsMenuCloseButton.name = "FavCimsMenuCloseButton"; FavCimsMenuCloseButton.width = 32; FavCimsMenuCloseButton.height = 32; FavCimsMenuCloseButton.normalBgSprite = "buttonclose"; FavCimsMenuCloseButton.hoveredBgSprite = "buttonclosehover"; FavCimsMenuCloseButton.pressedBgSprite = "buttonclosepressed"; FavCimsMenuCloseButton.opacity = 1; FavCimsMenuCloseButton.useOutline = true; FavCimsMenuCloseButton.playAudioEvents = true; FavCimsMenuCloseButton.eventClick += (component, eventParam) => FavoritesCimsButton.FavCimsPanelToggle (); //Printing FavCimsMenuCloseButton.relativePosition = new Vector3 (this.width - (FavCimsMenuCloseButton.width * 1.5f), ((float)FavCimsTitleTexture.height / 2) - FavCimsMenuCloseButton.height / 2); /////////////////////////////////////////////// //Main Panel Menu Background Texture /////////////////////////////////////////////// Texture FavCimsBGMenuTexture; FavCimsBGMenuTexture = ResourceLoader.loadTexture ((int)this.width - 10, 70, "UIMainPanel.submenubar.png"); FavCimsBGMenuTexture.wrapMode = TextureWrapMode.Clamp; FavCimsBGMenuTexture.filterMode = FilterMode.Bilinear; FavCimsBGMenuTexture.name = "FavCimsBGMenuTexture"; UITextureSprite FavCimsBGMenuSprite = FavCimsMainBGSprite.AddUIComponent<UITextureSprite> (); FavCimsBGMenuSprite.name = "FavCimsBGMenuSprite"; FavCimsBGMenuSprite.texture = FavCimsBGMenuTexture; float FavCimsBGMenuSpriteRelPosX = ((this.width / 2) - (float)FavCimsBGMenuTexture.width / 2); FavCimsBGMenuSprite.relativePosition = new Vector3 (FavCimsBGMenuSpriteRelPosX, 58); //Citizen Button Texture (Enabled & Disabled) FavCimsCBETexture = ResourceLoader.loadTexture (200, 59, "UIMainPanel.citizenbuttonenabled.png"); FavCimsCBDTexture = ResourceLoader.loadTexture (200, 59, "UIMainPanel.citizenbuttondisabled.png"); FavCimsCBETexture.wrapMode = TextureWrapMode.Clamp; FavCimsCBETexture.filterMode = FilterMode.Bilinear; FavCimsCBETexture.name = "FavCimsCBETexture"; FavCimsCBETexture.mipMapBias = -0.5f; FavCimsCBDTexture.wrapMode = TextureWrapMode.Clamp; FavCimsCBDTexture.filterMode = FilterMode.Bilinear; FavCimsCBDTexture.name = "FavCimsCBDTexture"; FavCimsCBDTexture.mipMapBias = -0.5f; FavCimsCBMenuSprite = FavCimsMainBGSprite.AddUIComponent<UITextureSprite> (); FavCimsCBMenuSprite.name = "FavCimsBGMenuSprite"; FavCimsCBMenuSprite.texture = FavCimsCBETexture; //Citizens Transparent Button (For Easy Text Change) FavCimsBCMenuButton = this.AddUIComponent<UIButton> (); FavCimsBCMenuButton.name = "FavCimsBCMenuButton"; FavCimsBCMenuButton.width = FavCimsCBMenuSprite.width; FavCimsBCMenuButton.height = FavCimsCBMenuSprite.height; FavCimsBCMenuButton.useOutline = true; FavCimsBCMenuButton.playAudioEvents = true; FavCimsBCMenuButton.font = UIDynamicFont.FindByName ("OpenSans-Regular"); FavCimsBCMenuButton.textScale = 1.8f; FavCimsBCMenuButton.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a FavCimsBCMenuButton.hoveredTextColor = new Color32 (204, 102, 0, 20); FavCimsBCMenuButton.pressedTextColor = new Color32 (153, 0, 0, 0); FavCimsBCMenuButton.focusedTextColor = new Color32 (102, 153, 255, 147); FavCimsBCMenuButton.textPadding.left = 15; FavCimsBCMenuButton.useDropShadow = true; FavCimsBCMenuButton.tooltipBox = uiView.defaultTooltipBox; //Printing FavCimsCBMenuSprite.relativePosition = new Vector3 (27, 69); FavCimsBCMenuButton.relativePosition = new Vector3 (27, 69); /////////////////////////////////////////////// //Buildings Button Texture (Enabled & Disabled) ////////////////////////////////////////////// /* FavCimsBBETexture = ResourceLoader.loadTexture (200, 59, "UIMainPanel.buildingsbuttonenabled.png"); FavCimsBBDTexture = ResourceLoader.loadTexture (200, 59, "UIMainPanel.buildingsbuttondisabled.png"); FavCimsBBETexture.wrapMode = TextureWrapMode.Clamp; FavCimsBBETexture.filterMode = FilterMode.Bilinear; FavCimsBBETexture.name = "FavCimsBBETexture"; FavCimsBBETexture.mipMapBias = -0.5f; FavCimsBBDTexture.wrapMode = TextureWrapMode.Clamp; FavCimsBBDTexture.filterMode = FilterMode.Bilinear; FavCimsBBDTexture.name = "FavCimsBBETexture"; FavCimsBBDTexture.mipMapBias = -0.5f; FavCimsBBMenuSprite = FavCimsMainBGSprite.AddUIComponent<UITextureSprite> (); FavCimsBBMenuSprite.name = "FavCimsBBMenuSprite"; FavCimsBBMenuSprite.texture = FavCimsBBDTexture; //Buildings Transparent Button (For Easy Text Change) FavCimsBBMenuButton = this.AddUIComponent<UIButton> (); FavCimsBBMenuButton.name = "FavCimsBBMenuButton"; FavCimsBBMenuButton.width = FavCimsBBETexture.width; FavCimsBBMenuButton.height = FavCimsBBETexture.height; FavCimsBBMenuButton.useOutline = true; FavCimsBBMenuButton.playAudioEvents = true; FavCimsBBMenuButton.font = UIDynamicFont.FindByName ("OpenSans-Regular"); FavCimsBBMenuButton.textScale = 1.8f; FavCimsBBMenuButton.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a FavCimsBBMenuButton.hoveredTextColor = new Color32 (204, 102, 0, 20); FavCimsBBMenuButton.pressedTextColor = new Color32 (153, 0, 0, 0); FavCimsBBMenuButton.focusedTextColor = new Color32 (102, 153, 255, 147); FavCimsBBMenuButton.textPadding.left = 20; FavCimsBBMenuButton.useDropShadow = true; FavCimsBBMenuButton.tooltipBox = uiView.defaultTooltipBox; //Printing //FavCimsBBMenuSprite.relativePosition = new Vector3 (FavCimsCBMenuSprite.position.x + FavCimsBBMenuSprite.width + 21, 69); //html => margin-left:21px; //FavCimsBBMenuButton.relativePosition = new Vector3 (FavCimsBCMenuButton.position.x + FavCimsBBMenuButton.width + 35, 69); /////////////////////////////////////////////// //Stats Button Texture (Enabled & Disabled) ////////////////////////////////////////////// FavCimsSBETexture = ResourceLoader.loadTexture (200, 59, "UIMainPanel.statsbuttonenabled.png"); FavCimsSBDTexture = ResourceLoader.loadTexture (200, 59, "UIMainPanel.statsbuttondisabled.png"); FavCimsSBETexture.wrapMode = TextureWrapMode.Clamp; FavCimsSBETexture.filterMode = FilterMode.Bilinear; FavCimsSBETexture.name = "FavCimsSBETexture"; FavCimsSBETexture.mipMapBias = -0.5f; FavCimsSBDTexture.wrapMode = TextureWrapMode.Clamp; FavCimsSBDTexture.filterMode = FilterMode.Bilinear; FavCimsSBDTexture.name = "FavCimsSBETexture"; FavCimsSBDTexture.mipMapBias = -0.5f; FavCimsSBMenuSprite = FavCimsMainBGSprite.AddUIComponent<UITextureSprite> (); FavCimsSBMenuSprite.name = "FavCimsSBMenuSprite"; FavCimsSBMenuSprite.texture = FavCimsSBDTexture; //Stats Transparent Button (For Easy Text Change) FavCimsBSMenuButton = this.AddUIComponent<UIButton> (); FavCimsBSMenuButton.name = "FavCimsBSMenuButton"; FavCimsBSMenuButton.width = FavCimsSBETexture.width; FavCimsBSMenuButton.height = FavCimsSBETexture.height; FavCimsBSMenuButton.useOutline = true; FavCimsBSMenuButton.playAudioEvents = true; FavCimsBSMenuButton.font = UIDynamicFont.FindByName ("OpenSans-Regular"); FavCimsBSMenuButton.textScale = 1.8f; FavCimsBSMenuButton.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a FavCimsBSMenuButton.hoveredTextColor = new Color32 (204, 102, 0, 20); FavCimsBSMenuButton.pressedTextColor = new Color32 (153, 0, 0, 0); FavCimsBSMenuButton.focusedTextColor = new Color32 (102, 153, 255, 147); FavCimsBSMenuButton.textPadding.left = 0; FavCimsBSMenuButton.useDropShadow = true; FavCimsBSMenuButton.tooltipBox = uiView.defaultTooltipBox; //Printing //FavCimsSBMenuSprite.relativePosition = new Vector3 (FavCimsBBMenuSprite.position.x + FavCimsSBMenuSprite.width + 21, 69); //html => margin-left:21px; //FavCimsBSMenuButton.relativePosition = new Vector3 (FavCimsBBMenuButton.position.x + FavCimsBSMenuButton.width + 21, 69); //html => margin-left:21px; /////////////////////////////////////////////// //Click Operation for Main Buttons ////////////////////////////////////////////// //FavCimsBCMenuButton.eventClick += (component, eventParam) => ButtonEnabler (FavCimsCBMenuSprite); //FavCimsBBMenuButton.eventClick += (component, eventParam) => ButtonEnabler (FavCimsBBMenuSprite); //FavCimsBSMenuButton.eventClick += (component, eventParam) => ButtonEnabler (FavCimsSBMenuSprite); */ /////////////////////////////////////////////// //Citizens Panel ////////////////////////////////////////////// CitizensPanel = this.AddUIComponent<UIPanel> (); CitizensPanel.name = "CitizensPanel"; CitizensPanel.width = 1190; CitizensPanel.height = 558; CitizensPanel.relativePosition = new Vector3 (((this.width / 2) - (float)CitizensPanel.width / 2), 128); /////////////////////////////////////////////// //Citizens Panel Body Background ////////////////////////////////////////////// FavCimsMainBodyTexture = ResourceLoader.loadTexture (1190, 558, "UIMainPanel.bodybg.png"); FavCimsMainBodyTexture.wrapMode = TextureWrapMode.Clamp; FavCimsMainBodyTexture.filterMode = FilterMode.Bilinear; FavCimsMainBodyTexture.name = "FavCimsMainBodyTexture"; FavCimsBodySprite = CitizensPanel.AddUIComponent<UITextureSprite> (); FavCimsBodySprite.name = "FavCimsCBGBodySprite"; FavCimsBodySprite.texture = FavCimsMainBodyTexture; //Printing FavCimsBodySprite.relativePosition = Vector3.zero; /////////////////////////////////////////////// //Index Column Background ////////////////////////////////////////////// Texture FavCimsIndexBgBar = ResourceLoader.loadTexture (1146, 26, "UIMainPanel.indexerbgbar.png"); FavCimsIndexBgBar.wrapMode = TextureWrapMode.Clamp; FavCimsIndexBgBar.filterMode = FilterMode.Bilinear; FavCimsIndexBgBar.name = "FavCimsIndexBgBar"; FavCimsIndexBgBar.mipMapBias = -0.5f; UITextureSprite FavCimsIndexBgBarSprite = CitizensPanel.AddUIComponent<UITextureSprite> (); FavCimsIndexBgBarSprite.name = "FavCimsIndexBgBarSprite"; FavCimsIndexBgBarSprite.texture = FavCimsIndexBgBar; //Printing FavCimsIndexBgBarSprite.relativePosition = new Vector3 (21, 7); //////////////////////////////////////////////// //Index Columns (Button for future sort order...) //////////////////////////////////////////////// //Status FavCimsHappinesColText = CitizensPanel.AddUIComponent<UIButton> (); FavCimsHappinesColText.name = "FavCimsHappinesColText"; FavCimsHappinesColText.width = 60; FavCimsHappinesColText.height = FavCimsIndexBgBar.height; FavCimsHappinesColText.textVerticalAlignment = UIVerticalAlignment.Middle; FavCimsHappinesColText.textHorizontalAlignment = UIHorizontalAlignment.Center; FavCimsHappinesColText.playAudioEvents = true; FavCimsHappinesColText.font = UIDynamicFont.FindByName ("OpenSans-Regular"); FavCimsHappinesColText.textScale = 0.7f; FavCimsHappinesColText.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a FavCimsHappinesColText.hoveredTextColor = new Color32 (204, 102, 0, 20); FavCimsHappinesColText.pressedTextColor = new Color32 (153, 0, 0, 0); FavCimsHappinesColText.focusedTextColor = new Color32 (102, 153, 255, 147); FavCimsHappinesColText.textPadding.left = 0; FavCimsHappinesColText.tooltipBox = uiView.defaultTooltipBox; //Printing Status FavCimsHappinesColText.relativePosition = new Vector3 (FavCimsIndexBgBarSprite.relativePosition.x + 6, FavCimsIndexBgBarSprite.relativePosition.y + 1); //Name FavCimsNameColText = CitizensPanel.AddUIComponent<UIButton> (); FavCimsNameColText.name = "FavCimsNameColText"; FavCimsNameColText.width = 180; FavCimsNameColText.height = FavCimsIndexBgBar.height; FavCimsNameColText.textVerticalAlignment = UIVerticalAlignment.Middle; FavCimsNameColText.textHorizontalAlignment = UIHorizontalAlignment.Center; FavCimsNameColText.playAudioEvents = true; FavCimsNameColText.font = UIDynamicFont.FindByName ("OpenSans-Regular"); FavCimsNameColText.textScale = 0.7f; FavCimsNameColText.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a FavCimsNameColText.hoveredTextColor = new Color32 (204, 102, 0, 20); FavCimsNameColText.pressedTextColor = new Color32 (153, 0, 0, 0); FavCimsNameColText.focusedTextColor = new Color32 (102, 153, 255, 147); FavCimsNameColText.textPadding.left = 0; FavCimsNameColText.tooltipBox = uiView.defaultTooltipBox; //Printing Name FavCimsNameColText.relativePosition = new Vector3 (FavCimsHappinesColText.relativePosition.x + FavCimsHappinesColText.width, FavCimsIndexBgBarSprite.relativePosition.y + 1); //Age Phase FavCimsAgePhaseColText = CitizensPanel.AddUIComponent<UIButton> (); FavCimsAgePhaseColText.name = "FavCimsAgePhaseColText"; FavCimsAgePhaseColText.width = 120; FavCimsAgePhaseColText.height = FavCimsIndexBgBar.height; FavCimsAgePhaseColText.textVerticalAlignment = UIVerticalAlignment.Middle; FavCimsAgePhaseColText.textHorizontalAlignment = UIHorizontalAlignment.Center; FavCimsAgePhaseColText.playAudioEvents = true; FavCimsAgePhaseColText.font = UIDynamicFont.FindByName ("OpenSans-Regular"); FavCimsAgePhaseColText.textScale = 0.7f; FavCimsAgePhaseColText.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a FavCimsAgePhaseColText.hoveredTextColor = new Color32 (204, 102, 0, 20); FavCimsAgePhaseColText.pressedTextColor = new Color32 (153, 0, 0, 0); FavCimsAgePhaseColText.focusedTextColor = new Color32 (102, 153, 255, 147); FavCimsAgePhaseColText.textPadding.left = 0; FavCimsAgePhaseColText.tooltipBox = uiView.defaultTooltipBox; //Printing Age Phase FavCimsAgePhaseColText.relativePosition = new Vector3 (FavCimsNameColText.relativePosition.x + FavCimsNameColText.width, FavCimsIndexBgBarSprite.relativePosition.y + 1); //Age FavCimsAgeColText = CitizensPanel.AddUIComponent<UIButton> (); FavCimsAgeColText.name = "FavCimsAgeColText"; FavCimsAgeColText.width = 40; FavCimsAgeColText.height = FavCimsIndexBgBar.height; FavCimsAgeColText.textVerticalAlignment = UIVerticalAlignment.Middle; FavCimsAgeColText.textHorizontalAlignment = UIHorizontalAlignment.Center; FavCimsAgeColText.playAudioEvents = true; FavCimsAgeColText.font = UIDynamicFont.FindByName ("OpenSans-Regular"); FavCimsAgeColText.textScale = 0.7f; FavCimsAgeColText.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a FavCimsAgeColText.hoveredTextColor = new Color32 (204, 102, 0, 20); FavCimsAgeColText.pressedTextColor = new Color32 (153, 0, 0, 0); FavCimsAgeColText.focusedTextColor = new Color32 (102, 153, 255, 147); FavCimsAgeColText.textPadding.left = 0; FavCimsAgeColText.tooltipBox = uiView.defaultTooltipBox; //Printing Age FavCimsAgeColText.relativePosition = new Vector3 (FavCimsAgePhaseColText.relativePosition.x + FavCimsAgePhaseColText.width, FavCimsIndexBgBarSprite.relativePosition.y + 1); //Education FavCimsEduColText = CitizensPanel.AddUIComponent<UIButton> (); FavCimsEduColText.name = "FavCimsEduColText"; FavCimsEduColText.width = 140; FavCimsEduColText.height = FavCimsIndexBgBar.height; FavCimsEduColText.textVerticalAlignment = UIVerticalAlignment.Middle; FavCimsEduColText.textHorizontalAlignment = UIHorizontalAlignment.Center; FavCimsEduColText.playAudioEvents = true; FavCimsEduColText.font = UIDynamicFont.FindByName ("OpenSans-Regular"); FavCimsEduColText.textScale = 0.7f; FavCimsEduColText.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a FavCimsEduColText.hoveredTextColor = new Color32 (204, 102, 0, 20); FavCimsEduColText.pressedTextColor = new Color32 (153, 0, 0, 0); FavCimsEduColText.focusedTextColor = new Color32 (102, 153, 255, 147); FavCimsEduColText.textPadding.left = 0; FavCimsEduColText.tooltipBox = uiView.defaultTooltipBox; //Printing Education FavCimsEduColText.relativePosition = new Vector3 (FavCimsAgeColText.relativePosition.x + FavCimsAgeColText.width, FavCimsIndexBgBarSprite.relativePosition.y + 1); //Home FavCimsHomeColText = CitizensPanel.AddUIComponent<UIButton> (); FavCimsHomeColText.name = "FavCimsHomeColText"; FavCimsHomeColText.width = 184; FavCimsHomeColText.height = FavCimsIndexBgBar.height; FavCimsHomeColText.textVerticalAlignment = UIVerticalAlignment.Middle; FavCimsHomeColText.textHorizontalAlignment = UIHorizontalAlignment.Center; FavCimsHomeColText.playAudioEvents = true; FavCimsHomeColText.font = UIDynamicFont.FindByName ("OpenSans-Regular"); FavCimsHomeColText.textScale = 0.7f; FavCimsHomeColText.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a FavCimsHomeColText.hoveredTextColor = new Color32 (204, 102, 0, 20); FavCimsHomeColText.pressedTextColor = new Color32 (153, 0, 0, 0); FavCimsHomeColText.focusedTextColor = new Color32 (102, 153, 255, 147); FavCimsHomeColText.textPadding.left = 0; FavCimsHomeColText.tooltipBox = uiView.defaultTooltipBox; //Printing Home FavCimsHomeColText.relativePosition = new Vector3 (FavCimsEduColText.relativePosition.x + FavCimsEduColText.width, FavCimsIndexBgBarSprite.relativePosition.y + 1); //Working Place FavCimsWorkingPlaceColText = CitizensPanel.AddUIComponent<UIButton> (); FavCimsWorkingPlaceColText.name = "FavCimsWorkingPlaceColText"; FavCimsWorkingPlaceColText.width = 180; FavCimsWorkingPlaceColText.height = FavCimsIndexBgBar.height; FavCimsWorkingPlaceColText.textVerticalAlignment = UIVerticalAlignment.Middle; FavCimsWorkingPlaceColText.textHorizontalAlignment = UIHorizontalAlignment.Center; FavCimsWorkingPlaceColText.playAudioEvents = true; FavCimsWorkingPlaceColText.font = UIDynamicFont.FindByName ("OpenSans-Regular"); FavCimsWorkingPlaceColText.textScale = 0.7f; FavCimsWorkingPlaceColText.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a FavCimsWorkingPlaceColText.hoveredTextColor = new Color32 (204, 102, 0, 20); FavCimsWorkingPlaceColText.pressedTextColor = new Color32 (153, 0, 0, 0); FavCimsWorkingPlaceColText.focusedTextColor = new Color32 (102, 153, 255, 147); FavCimsWorkingPlaceColText.textPadding.left = 0; FavCimsWorkingPlaceColText.tooltipBox = uiView.defaultTooltipBox; //Printing Working Place FavCimsWorkingPlaceColText.relativePosition = new Vector3 (FavCimsHomeColText.relativePosition.x + FavCimsHomeColText.width, FavCimsIndexBgBarSprite.relativePosition.y + 1); //Last Activity FavCimsLastActColText = CitizensPanel.AddUIComponent<UIButton> (); FavCimsLastActColText.name = "FavCimsLastActColText"; FavCimsLastActColText.width = 180; FavCimsLastActColText.height = FavCimsIndexBgBar.height; FavCimsLastActColText.textVerticalAlignment = UIVerticalAlignment.Middle; FavCimsLastActColText.textHorizontalAlignment = UIHorizontalAlignment.Center; FavCimsLastActColText.playAudioEvents = true; FavCimsLastActColText.font = UIDynamicFont.FindByName ("OpenSans-Regular"); FavCimsLastActColText.textScale = 0.7f; FavCimsLastActColText.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a FavCimsLastActColText.hoveredTextColor = new Color32 (204, 102, 0, 20); FavCimsLastActColText.pressedTextColor = new Color32 (153, 0, 0, 0); FavCimsLastActColText.focusedTextColor = new Color32 (102, 153, 255, 147); FavCimsLastActColText.textPadding.left = 0; FavCimsLastActColText.tooltipBox = uiView.defaultTooltipBox; //Printing Last Activity FavCimsLastActColText.relativePosition = new Vector3 (FavCimsWorkingPlaceColText.relativePosition.x + FavCimsWorkingPlaceColText.width, FavCimsIndexBgBarSprite.relativePosition.y + 1); //Close Button FavCimsCloseButtonCol = CitizensPanel.AddUIComponent<UIButton> (); FavCimsCloseButtonCol.name = "FavCimsCloseButtonCol"; FavCimsCloseButtonCol.width = 50; FavCimsCloseButtonCol.height = FavCimsIndexBgBar.height; FavCimsCloseButtonCol.textVerticalAlignment = UIVerticalAlignment.Middle; FavCimsCloseButtonCol.textHorizontalAlignment = UIHorizontalAlignment.Center; FavCimsCloseButtonCol.playAudioEvents = true; FavCimsCloseButtonCol.font = UIDynamicFont.FindByName ("OpenSans-Regular"); FavCimsCloseButtonCol.textScale = 0.7f; FavCimsCloseButtonCol.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a FavCimsCloseButtonCol.hoveredTextColor = new Color32 (204, 102, 0, 20); FavCimsCloseButtonCol.pressedTextColor = new Color32 (153, 0, 0, 0); FavCimsCloseButtonCol.focusedTextColor = new Color32 (102, 153, 255, 147); FavCimsCloseButtonCol.textPadding.right = 6; FavCimsCloseButtonCol.tooltipBox = uiView.defaultTooltipBox; //Printing Close Button FavCimsCloseButtonCol.relativePosition = new Vector3 (FavCimsLastActColText.relativePosition.x + FavCimsLastActColText.width, FavCimsIndexBgBarSprite.relativePosition.y + 1); /////////////////////////////////////////////// /////Rows Panel Body /////////////////////////////////////////////// FavCimsCitizenRowsPanel = CitizensPanel.AddUIComponent<UIScrollablePanel> (); FavCimsCitizenRowsPanel.name = "FavCimsCitizenRowsPanel"; FavCimsCitizenRowsPanel.width = FavCimsIndexBgBarSprite.width - 12; FavCimsCitizenRowsPanel.height = 500; FavCimsCitizenRowsPanel.autoLayoutDirection = LayoutDirection.Vertical; FavCimsCitizenRowsPanel.autoLayout = true; FavCimsCitizenRowsPanel.clipChildren = true; FavCimsCitizenRowsPanel.autoLayoutPadding = new RectOffset (0, 0, 0, 0); FavCimsCitizenRowsPanel.relativePosition = new Vector3 (FavCimsIndexBgBarSprite.relativePosition.x + 6, FavCimsIndexBgBarSprite.relativePosition.y + FavCimsIndexBgBarSprite.height); //Damn ScrollBar UIScrollablePanel FavCimsCitizenRowsPanelScrollBar = CitizensPanel.AddUIComponent<UIScrollablePanel> (); FavCimsCitizenRowsPanelScrollBar.name = "FavCimsCitizenRowsPanelScrollBar"; FavCimsCitizenRowsPanelScrollBar.width = 10; FavCimsCitizenRowsPanelScrollBar.height = 500; FavCimsCitizenRowsPanelScrollBar.relativePosition = new Vector3 (FavCimsIndexBgBarSprite.relativePosition.x + FavCimsIndexBgBarSprite.width, FavCimsCitizenRowsPanel.relativePosition.y); UIScrollbar FavCimsMainPanelScrollBar = FavCimsCitizenRowsPanelScrollBar.AddUIComponent<UIScrollbar> (); FavCimsMainPanelScrollBar.width = 10; FavCimsMainPanelScrollBar.height = FavCimsCitizenRowsPanel.height; FavCimsMainPanelScrollBar.orientation = UIOrientation.Vertical; FavCimsMainPanelScrollBar.pivot = UIPivotPoint.TopRight; FavCimsMainPanelScrollBar.AlignTo (FavCimsMainPanelScrollBar.parent, UIAlignAnchor.TopRight); FavCimsMainPanelScrollBar.minValue = 0; FavCimsMainPanelScrollBar.value = 0; FavCimsMainPanelScrollBar.incrementAmount = 40; UISlicedSprite FavCimsMainPanelTrackSprite = FavCimsMainPanelScrollBar.AddUIComponent<UISlicedSprite> (); FavCimsMainPanelTrackSprite.relativePosition = FavCimsMainPanelScrollBar.relativePosition; FavCimsMainPanelTrackSprite.autoSize = true; FavCimsMainPanelTrackSprite.size = FavCimsMainPanelTrackSprite.parent.size; FavCimsMainPanelTrackSprite.fillDirection = UIFillDirection.Vertical; FavCimsMainPanelTrackSprite.spriteName = "ScrollbarTrack"; FavCimsMainPanelScrollBar.trackObject = FavCimsMainPanelTrackSprite; UISlicedSprite thumbSprite = FavCimsMainPanelScrollBar.AddUIComponent<UISlicedSprite> (); thumbSprite.relativePosition = FavCimsMainPanelScrollBar.relativePosition; thumbSprite.autoSize = true; thumbSprite.width = thumbSprite.parent.width; thumbSprite.fillDirection = UIFillDirection.Vertical; thumbSprite.spriteName = "ScrollbarThumb"; FavCimsMainPanelScrollBar.thumbObject = thumbSprite; FavCimsCitizenRowsPanel.verticalScrollbar = FavCimsMainPanelScrollBar; /* Thx to CNightwing for this piece of code */ FavCimsCitizenRowsPanel.eventMouseWheel += (component, eventParam) => { var sign = Math.Sign (eventParam.wheelDelta); FavCimsCitizenRowsPanel.scrollPosition += new Vector2 (0, sign * (-1) * FavCimsMainPanelScrollBar.incrementAmount); }; /* End */ FavCimsCitizenRowsPanel.eventComponentAdded += (component, eventParam) => ReorderRowsBackgrounds (); FavCimsCitizenRowsPanel.eventComponentRemoved += (component, eventParam) => ReorderRowsBackgrounds (); /////////////////////////////////////////////// /////Rows Panel Footer /////////////////////////////////////////////// UITextureSprite FavCimsFooterBgBarSprite = CitizensPanel.AddUIComponent<UITextureSprite> (); FavCimsFooterBgBarSprite.name = "FavCimsFooterBgBarSprite"; FavCimsFooterBgBarSprite.width = FavCimsIndexBgBarSprite.width; FavCimsFooterBgBarSprite.height = 15; FavCimsFooterBgBarSprite.texture = FavCimsIndexBgBar; //Printing FavCimsFooterBgBarSprite.relativePosition = new Vector3 (21, FavCimsCitizenRowsPanel.relativePosition.y + FavCimsCitizenRowsPanel.height); //Row End //Load Initial Row (People Renamed) foreach(KeyValuePair<InstanceID, string> FavCitizen in FavCimsCore.FavoriteCimsList()) { if(FavCitizen.Key.Type == InstanceType.Citizen) { // || FavCitizen.Key.Type == InstanceType.CitizenInstance CitizenRow FavCimsCitizenSingleRowPanel = FavCimsCitizenRowsPanel.AddUIComponent(typeof(CitizenRow)) as CitizenRow; FavCimsCitizenSingleRowPanel.MyInstanceID = FavCitizen.Key; FavCimsCitizenSingleRowPanel.MyInstancedName = FavCitizen.Value; } } }
public override void Start() { //Atlas UITextureAtlas m_atlas = MyAtlas.FavCimsAtlas; //////////Main Family Panel//////////// this.width = 250; this.height = 500; this.clipChildren = true; //this.backgroundSprite = "CitizenBackground"; int RandXMin = 30; int RandXMax = Screen.width / 4; int RandYMin = 100; int RandYMax = Screen.height - (int)this.height - RandYMin; System.Random rnd = new System.Random (); //Family Panel Bg Sprite this.FavCimsOtherInfoSprite = this.AddUIComponent<UITextureSprite> (); this.FavCimsOtherInfoSprite.name = "FavCimsOtherInfoSprite"; this.FavCimsOtherInfoSprite.texture = TextureDB.FavCimsOtherInfoTexture; this.FavCimsOtherInfoSprite.width = this.width; this.FavCimsOtherInfoSprite.height = this.height; this.FavCimsOtherInfoSprite.relativePosition = Vector3.zero; //Header Panel this.BubbleHeaderPanel = this.AddUIComponent<UIPanel>(); this.BubbleHeaderPanel.name = "BubbleHeaderPanel"; this.BubbleHeaderPanel.width = 250; this.BubbleHeaderPanel.height = 41; this.BubbleHeaderPanel.relativePosition = new Vector3(0,0); //Icon Sprite this.BubbleHeaderIconSprite = this.BubbleHeaderPanel.AddUIComponent<UITextureSprite> (); this.BubbleHeaderIconSprite.name = "BubbleHeaderIconSprite"; this.BubbleHeaderIconSprite.texture = TextureDB.BubbleHeaderIconSpriteTextureMale; this.BubbleHeaderIconSprite.relativePosition = new Vector3 (9, this.BubbleHeaderPanel.relativePosition.y+9); //UIButton Name this.BubbleHeaderCitizenName = this.BubbleHeaderPanel.AddUIComponent<UIButton> (); this.BubbleHeaderCitizenName.name = "BubbleHeaderCitizenName"; this.BubbleHeaderCitizenName.width = this.BubbleHeaderPanel.width; this.BubbleHeaderCitizenName.height = this.BubbleHeaderPanel.height; this.BubbleHeaderCitizenName.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleHeaderCitizenName.textHorizontalAlignment = UIHorizontalAlignment.Center; this.BubbleHeaderCitizenName.playAudioEvents = false; this.BubbleHeaderCitizenName.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleHeaderCitizenName.font.size = 15; this.BubbleHeaderCitizenName.textScale = 1f; this.BubbleHeaderCitizenName.wordWrap = true; this.BubbleHeaderCitizenName.textPadding.left = 5; this.BubbleHeaderCitizenName.textPadding.right = 5; this.BubbleHeaderCitizenName.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a this.BubbleHeaderCitizenName.hoveredTextColor = new Color32 (204, 204, 51, 40); //r,g,b,a this.BubbleHeaderCitizenName.pressedTextColor = new Color32 (204, 204, 51, 40); //r,g,b,a this.BubbleHeaderCitizenName.focusedTextColor = new Color32 (204, 204, 51, 40); //r,g,b,a this.BubbleHeaderCitizenName.useDropShadow = true; this.BubbleHeaderCitizenName.dropShadowOffset = new Vector2 (1, -1); this.BubbleHeaderCitizenName.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubbleHeaderCitizenName.relativePosition = Vector3.zero; //Panel Mover this.BubbleHeaderCitizenName.eventMouseDown += delegate { if(Input.GetMouseButton(0)) { if(this.GetComponentInChildren<WindowController>() != null) { this.PanelMover = this.GetComponentInChildren<WindowController>(); this.PanelMover.ComponentToMove = this; this.PanelMover.Stop = false; this.PanelMover.Start(); } else { this.PanelMover = this.AddUIComponent(typeof(WindowController)) as WindowController; this.PanelMover.ComponentToMove = this; } this.opacity = 0.5f; } }; //Panel Mover Close Event this.BubbleHeaderCitizenName.eventMouseUp += delegate { if(this.PanelMover != null) { this.PanelMover.Stop = true; this.PanelMover.ComponentToMove = null; this.PanelMover = null; } this.opacity = 1f; }; //Bubble Close Panel this.BubbleCloseButton = this.AddUIComponent<UIButton> (); this.BubbleCloseButton.name = "BubbleCloseButton"; this.BubbleCloseButton.width = 26; this.BubbleCloseButton.height = 26; this.BubbleCloseButton.normalBgSprite = "buttonclose"; this.BubbleCloseButton.hoveredBgSprite = "buttonclosehover"; this.BubbleCloseButton.pressedBgSprite = "buttonclosepressed"; this.BubbleCloseButton.opacity = 0.9f; //this.BubbleCloseButton.useOutline = true; this.BubbleCloseButton.playAudioEvents = true; this.BubbleCloseButton.tooltipBox = UIView.GetAView().defaultTooltipBox; this.BubbleCloseButton.eventClick += delegate { try { //GameObject.Destroy(this.gameObject); this.Hide(); this.MyInstanceID = InstanceID.Empty; }catch(Exception e) { Debug.Error("Can't remove family panel " + e.ToString()); } }; //Printing this.BubbleCloseButton.relativePosition = new Vector3 (this.BubbleHeaderPanel.width - 36, 7); //FamilyPortrait this.BubbleFamilyPortraitPanel = this.AddUIComponent<UIPanel>(); this.BubbleFamilyPortraitPanel.name = "BubbleFamilyPortraitPanel"; this.BubbleFamilyPortraitPanel.width = 242; this.BubbleFamilyPortraitPanel.height = 156; this.BubbleFamilyPortraitPanel.relativePosition = new Vector3(4,this.BubbleHeaderPanel.relativePosition.y+this.BubbleHeaderPanel.height); //Sprite CitizenDetail Background this.BubbleFamPortBgSpriteBack = this.BubbleFamilyPortraitPanel.AddUIComponent<UITextureSprite> (); this.BubbleFamPortBgSpriteBack.name = "BubbleFamPortBgSpriteBack"; this.BubbleFamPortBgSpriteBack.texture = TextureDB.BubbleFamPortBgSpriteBackTexture; this.BubbleFamPortBgSpriteBack.relativePosition = new Vector3 (4, 4); //Sprite CitizenDetail Foreground this.BubbleFamPortBgSprite = this.BubbleFamilyPortraitPanel.AddUIComponent<UITextureSprite> (); this.BubbleFamPortBgSprite.name = "BubbleFamPortBgSprite"; this.BubbleFamPortBgSprite.texture = TextureDB.BubbleFamPortBgSpriteTexture; this.BubbleFamPortBgSprite.relativePosition = Vector3.zero; //Panel (Happiness Icon + Age + Age Phase + Education (Label & Value)) this.BubbleRow1Panel = this.BubbleFamPortBgSprite.AddUIComponent<UIPanel> (); this.BubbleRow1Panel.name = "BubbleRow1Panel"; this.BubbleRow1Panel.width = 234; this.BubbleRow1Panel.height = 36; this.BubbleRow1Panel.relativePosition = new Vector3 (4, 4); //Happiness Container Panel this.BubbleRow1HappyPanel = this.BubbleRow1Panel.AddUIComponent<UIPanel> (); this.BubbleRow1HappyPanel.name = "BubbleRow1Panel"; this.BubbleRow1HappyPanel.width = 36; this.BubbleRow1HappyPanel.height = 36; this.BubbleRow1HappyPanel.relativePosition = Vector3.zero; //Happiness Icon this.BubbleRow1HappyIcon = this.BubbleRow1HappyPanel.AddUIComponent<UIButton> (); this.BubbleRow1HappyIcon.width = 26; this.BubbleRow1HappyIcon.height = 26; this.BubbleRow1HappyIcon.isEnabled = false; this.BubbleRow1HappyIcon.playAudioEvents = false; this.BubbleRow1HappyIcon.tooltipBox = UIView.GetAView().defaultTooltipBox; this.BubbleRow1HappyIcon.relativePosition = new Vector3 (4, 5); //Wellbeing Icon this.BubbleRow2WellbeingIcon = this.BubbleRow1HappyPanel.AddUIComponent<UIButton> (); this.BubbleRow2WellbeingIcon.width = 11; this.BubbleRow2WellbeingIcon.height = 11; this.BubbleRow2WellbeingIcon.isEnabled = false; this.BubbleRow2WellbeingIcon.playAudioEvents = false; this.BubbleRow2WellbeingIcon.tooltipBox = UIView.GetAView().defaultTooltipBox; this.BubbleRow2WellbeingIcon.relativePosition = new Vector3 (24, 5); //Labels & Values Container Panel this.BubbleRow1TextPanel = this.BubbleRow1Panel.AddUIComponent<UIPanel> (); this.BubbleRow1TextPanel.name = "BubbleRow1TextPanel"; this.BubbleRow1TextPanel.width = 198; this.BubbleRow1TextPanel.height = 37; this.BubbleRow1TextPanel.relativePosition = new Vector3 (36, 0); //Labels Container Sprite this.BubbleRow1LabelsSprite = this.BubbleRow1TextPanel.AddUIComponent<UITextureSprite> (); this.BubbleRow1LabelsSprite.name = "BubbleRow1LabelsSprite"; this.BubbleRow1LabelsSprite.width = 198; this.BubbleRow1LabelsSprite.height = 34; this.BubbleRow1LabelsSprite.texture = TextureDB.BubbleBgBar1Big; this.BubbleRow1LabelsSprite.relativePosition = new Vector3 (0, 3); //Age Label Panel this.BubbleRow1AgeLabelPanel = this.BubbleRow1LabelsSprite.AddUIComponent<UIPanel> (); this.BubbleRow1AgeLabelPanel.name = "BubbleRow1AgeLabelPanel"; this.BubbleRow1AgeLabelPanel.width = 32; this.BubbleRow1AgeLabelPanel.height = 17; this.BubbleRow1AgeLabelPanel.relativePosition = Vector3.zero; //Age Button (Label) Text this.BubbleCitizenAge = this.BubbleRow1AgeLabelPanel.AddUIComponent<UIButton> (); this.BubbleCitizenAge.name = "BubbleCitizenAge"; this.BubbleCitizenAge.width = this.BubbleRow1AgeLabelPanel.width; this.BubbleCitizenAge.height = this.BubbleRow1AgeLabelPanel.height; this.BubbleCitizenAge.textHorizontalAlignment = UIHorizontalAlignment.Center; this.BubbleCitizenAge.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleCitizenAge.font.size = 15; this.BubbleCitizenAge.textScale = 0.80f; this.BubbleCitizenAge.outlineColor = new Color32 (0, 0, 0, 0); this.BubbleCitizenAge.outlineSize = 1; this.BubbleCitizenAge.textColor = new Color32 (0, 51, 102, 140); //r,g,b,a this.BubbleCitizenAge.isInteractive = false; this.BubbleCitizenAge.useDropShadow = true; this.BubbleCitizenAge.dropShadowOffset = new Vector2 (1, -1); this.BubbleCitizenAge.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubbleCitizenAge.relativePosition = new Vector3 (0, 1); //Age Phase Label Panel this.BubbleRow1AgePhaseLabelPanel = this.BubbleRow1LabelsSprite.AddUIComponent<UIPanel> (); this.BubbleRow1AgePhaseLabelPanel.name = "BubbleRow1AgePhaseLabelPanel"; this.BubbleRow1AgePhaseLabelPanel.width = 100; this.BubbleRow1AgePhaseLabelPanel.height = 17; this.BubbleRow1AgePhaseLabelPanel.relativePosition = new Vector3 (32, 0); //Age Phase Button (Label) Text this.BubbleCitizenAgePhase = this.BubbleRow1AgePhaseLabelPanel.AddUIComponent<UIButton> (); this.BubbleCitizenAgePhase.name = "BubbleCitizenAgePhase"; this.BubbleCitizenAgePhase.width = this.BubbleRow1AgePhaseLabelPanel.width; this.BubbleCitizenAgePhase.height = this.BubbleRow1AgePhaseLabelPanel.height; this.BubbleCitizenAgePhase.textHorizontalAlignment = UIHorizontalAlignment.Center; this.BubbleCitizenAgePhase.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleCitizenAgePhase.font.size = 15; this.BubbleCitizenAgePhase.textScale = 0.8f; this.BubbleCitizenAgePhase.outlineColor = new Color32 (0, 0, 0, 0); this.BubbleCitizenAgePhase.outlineSize = 1; this.BubbleCitizenAgePhase.textColor = new Color32 (0, 51, 102, 140); //r,g,b,a this.BubbleCitizenAgePhase.isInteractive = false; this.BubbleCitizenAgePhase.useDropShadow = true; this.BubbleCitizenAgePhase.dropShadowOffset = new Vector2 (1, -1); this.BubbleCitizenAgePhase.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubbleCitizenAgePhase.relativePosition = new Vector3 (0, 1); //Education Label Panel this.BubbleRow1EducationLabelPanel = this.BubbleRow1LabelsSprite.AddUIComponent<UIPanel> (); this.BubbleRow1EducationLabelPanel.name = "BubbleRow1LabelsPanel"; this.BubbleRow1EducationLabelPanel.width = 66; this.BubbleRow1EducationLabelPanel.height = 17; this.BubbleRow1EducationLabelPanel.relativePosition = new Vector3 (132, 0); //Education Button (Label) Text this.BubbleCitizenEducation = this.BubbleRow1EducationLabelPanel.AddUIComponent<UIButton> (); this.BubbleCitizenEducation.name = "BubbleCitizenEducation"; this.BubbleCitizenEducation.width = this.BubbleRow1EducationLabelPanel.width; this.BubbleCitizenEducation.height = this.BubbleRow1EducationLabelPanel.height; //this.BubbleCitizenEducation.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleCitizenEducation.textHorizontalAlignment = UIHorizontalAlignment.Center; this.BubbleCitizenEducation.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleCitizenEducation.font.size = 15; this.BubbleCitizenEducation.textScale = 0.80f; //this.BubbleCitizenEducation.wordWrap = true; //this.BubbleCitizenEducation.textPadding.left = 2; //this.BubbleCitizenEducation.textPadding.right = 2; this.BubbleCitizenEducation.outlineColor = new Color32 (0, 0, 0, 0); this.BubbleCitizenEducation.outlineSize = 1; this.BubbleCitizenEducation.textColor = new Color32 (0, 51, 102, 140); //r,g,b,a this.BubbleCitizenEducation.isInteractive = false; this.BubbleCitizenEducation.useDropShadow = true; this.BubbleCitizenEducation.dropShadowOffset = new Vector2 (1, -1); this.BubbleCitizenEducation.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubbleCitizenEducation.relativePosition = new Vector3 (0, 1); //Values Container Sprite this.BubbleRow1ValuesPanel = this.BubbleRow1LabelsSprite.AddUIComponent<UIPanel> (); this.BubbleRow1ValuesPanel.name = "BubbleRow1ValuesPanel"; this.BubbleRow1ValuesPanel.width = 198; this.BubbleRow1ValuesPanel.height = 17; //this.BubbleRow1ValuesPanel.texture = TextureDB.BubbleBgBar1Small; this.BubbleRow1ValuesPanel.relativePosition = new Vector3 (0, 17); //Age Value Panel this.BubbleRow1AgeValuePanel = this.BubbleRow1ValuesPanel.AddUIComponent<UIPanel> (); this.BubbleRow1AgeValuePanel.name = "BubbleRow1AgeValuePanel"; this.BubbleRow1AgeValuePanel.width = 32; this.BubbleRow1AgeValuePanel.height = 17; this.BubbleRow1AgeValuePanel.relativePosition = Vector3.zero; //Age Button (Value) Text this.BubbleCitizenAgeVal = this.BubbleRow1AgeValuePanel.AddUIComponent<UIButton> (); this.BubbleCitizenAgeVal.name = "BubbleCitizenAgeVal"; this.BubbleCitizenAgeVal.width = this.BubbleRow1AgeValuePanel.width; this.BubbleCitizenAgeVal.height = this.BubbleRow1AgeValuePanel.height; //this.BubbleCitizenAgeVal.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleCitizenAgeVal.textHorizontalAlignment = UIHorizontalAlignment.Center; this.BubbleCitizenAgeVal.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleCitizenAgeVal.font.size = 15; this.BubbleCitizenAgeVal.textScale = 0.85f; //this.BubbleCitizenAgeVal.wordWrap = true; //this.BubbleCitizenAgeVal.textPadding.left = 2; //this.BubbleCitizenAgeVal.textPadding.right = 2; this.BubbleCitizenAgeVal.outlineColor = new Color32 (0, 0, 0, 0); this.BubbleCitizenAgeVal.outlineSize = 1; this.BubbleCitizenAgeVal.textColor = new Color32 (0, 51, 102, 140); //r,g,b,a this.BubbleCitizenAgeVal.isInteractive = false; this.BubbleCitizenAgeVal.useDropShadow = true; this.BubbleCitizenAgeVal.dropShadowOffset = new Vector2 (1, -1); this.BubbleCitizenAgeVal.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubbleCitizenAgeVal.relativePosition = new Vector3 (0, 0); //Age Phase Value Panel this.BubbleRow1AgePhaseValuePanel = this.BubbleRow1ValuesPanel.AddUIComponent<UIPanel> (); this.BubbleRow1AgePhaseValuePanel.name = "BubbleRow1AgePhaseValuePanel"; this.BubbleRow1AgePhaseValuePanel.width = 100; this.BubbleRow1AgePhaseValuePanel.height = 17; this.BubbleRow1AgePhaseValuePanel.relativePosition = new Vector3 (32, 0); //Age Phase Button (Value) Text this.BubbleCitizenAgePhaseVal = this.BubbleRow1AgePhaseValuePanel.AddUIComponent<UIButton> (); this.BubbleCitizenAgePhaseVal.name = "BubbleCitizenAgePhaseVal"; this.BubbleCitizenAgePhaseVal.width = this.BubbleRow1AgePhaseValuePanel.width; this.BubbleCitizenAgePhaseVal.height = this.BubbleRow1AgePhaseValuePanel.height; this.BubbleCitizenAgePhaseVal.textHorizontalAlignment = UIHorizontalAlignment.Center; this.BubbleCitizenAgePhaseVal.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleCitizenAgePhaseVal.font.size = 15; this.BubbleCitizenAgePhaseVal.textScale = 0.85f; this.BubbleCitizenAgePhaseVal.outlineColor = new Color32 (0, 0, 0, 0); this.BubbleCitizenAgePhaseVal.outlineSize = 1; this.BubbleCitizenAgePhaseVal.textColor = new Color32 (0, 51, 102, 140); //r,g,b,a this.BubbleCitizenAgePhaseVal.isInteractive = false; this.BubbleCitizenAgePhaseVal.useDropShadow = true; this.BubbleCitizenAgePhaseVal.dropShadowOffset = new Vector2 (1, -1); this.BubbleCitizenAgePhaseVal.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubbleCitizenAgePhaseVal.relativePosition = new Vector3 (0, 0); //Education Value Panel this.BubbleRow1EducationValuePanel = this.BubbleRow1ValuesPanel.AddUIComponent<UIPanel> (); this.BubbleRow1EducationValuePanel.name = "BubbleRow1LabelsPanel"; this.BubbleRow1EducationValuePanel.width = 66; this.BubbleRow1EducationValuePanel.height = 17; //this.BubbleRow1EducationValuePanel.padding.top = 1; this.BubbleRow1EducationValuePanel.relativePosition = new Vector3 (132, 0); //Education Level 1 this.BubbleEduLevel1 = this.BubbleRow1EducationValuePanel.AddUIComponent<UIButton> (); this.BubbleEduLevel1.width = 18; this.BubbleEduLevel1.height = 17; this.BubbleEduLevel1.normalBgSprite = "InfoIconEducation"; this.BubbleEduLevel1.disabledBgSprite = "InfoIconEducationDisabled"; this.BubbleEduLevel1.isEnabled = false; this.BubbleEduLevel1.playAudioEvents = false; this.BubbleEduLevel1.relativePosition = new Vector3 (2, 0); //Education Level 2 this.BubbleEduLevel2 = this.BubbleRow1EducationValuePanel.AddUIComponent<UIButton> (); this.BubbleEduLevel2.width = this.BubbleEduLevel1.width; this.BubbleEduLevel2.height = this.BubbleEduLevel1.height; this.BubbleEduLevel2.normalBgSprite = "InfoIconEducation"; this.BubbleEduLevel2.disabledBgSprite = "InfoIconEducationDisabled"; this.BubbleEduLevel2.isEnabled = false; this.BubbleEduLevel2.playAudioEvents = false; this.BubbleEduLevel2.relativePosition = new Vector3 (24, 0); //Education Level 3 this.BubbleEduLevel3 = this.BubbleRow1EducationValuePanel.AddUIComponent<UIButton> (); this.BubbleEduLevel3.width = this.BubbleEduLevel1.width; this.BubbleEduLevel3.height = this.BubbleEduLevel1.height; this.BubbleEduLevel3.normalBgSprite = "InfoIconEducation"; this.BubbleEduLevel3.disabledBgSprite = "InfoIconEducationDisabled"; this.BubbleEduLevel3.isEnabled = false; this.BubbleEduLevel3.playAudioEvents = false; this.BubbleEduLevel3.relativePosition = new Vector3 (46, 0); //Education Tooltip Area this.BubbleRow1EducationTooltipArea = this.BubbleRow1ValuesPanel.AddUIComponent<UIPanel> (); this.BubbleRow1EducationTooltipArea.name = "BubbleRow1EducationTooltipArea"; this.BubbleRow1EducationTooltipArea.width = this.BubbleRow1EducationValuePanel.width; this.BubbleRow1EducationTooltipArea.height = this.BubbleRow1EducationValuePanel.height; this.BubbleRow1EducationTooltipArea.absolutePosition = BubbleRow1EducationValuePanel.absolutePosition; this.BubbleRow1EducationTooltipArea.tooltipBox = UIView.GetAView().defaultTooltipBox; //Target Panel this.BubbleTargetPanel = this.BubbleFamPortBgSprite.AddUIComponent<UIPanel> (); this.BubbleTargetPanel.name = "BubbleTargetPanel"; this.BubbleTargetPanel.width = 58; this.BubbleTargetPanel.height = 36; this.BubbleTargetPanel.relativePosition = new Vector3 (4, 35); //Target Button this.BubbleTargetIcon = this.BubbleTargetPanel.AddUIComponent<UIButton> (); this.BubbleTargetIcon.width = 28; this.BubbleTargetIcon.height = 28; this.BubbleTargetIcon.normalBgSprite = "LocationMarkerNormal"; this.BubbleTargetIcon.hoveredBgSprite = "LocationMarkerHovered"; this.BubbleTargetIcon.focusedBgSprite = "LocationMarkerFocused"; this.BubbleTargetIcon.pressedBgSprite = "LocationMarkerPressed"; this.BubbleTargetIcon.disabledBgSprite = "LocationMarkerDisabled"; this.BubbleTargetIcon.playAudioEvents = true; this.BubbleTargetIcon.relativePosition = new Vector3 (4, 0); this.BubbleTargetIcon.eventMouseDown += (component, eventParam) => GoToCitizen (MyInstanceID); //Wealth + Health Panel this.BubbleRow2Panel = this.BubbleFamPortBgSprite.AddUIComponent<UIPanel> (); this.BubbleRow2Panel.name = "BubbleRow2Panel"; this.BubbleRow2Panel.width = 198; this.BubbleRow2Panel.height = 34; this.BubbleRow2Panel.relativePosition = new Vector3 (40, 44); //Wealth + Health Bg Sprite this.BubbleWealthHealthSprite = this.BubbleRow2Panel.AddUIComponent<UITextureSprite> (); this.BubbleWealthHealthSprite.name = "BubbleWealthHealthSprite"; this.BubbleWealthHealthSprite.width = 198; this.BubbleWealthHealthSprite.height = 34; this.BubbleWealthHealthSprite.texture = TextureDB.BubbleBgBar1Big; this.BubbleWealthHealthSprite.relativePosition = Vector3.zero; //Wealth Sprite Panel this.BubbleWealthSpritePanel = this.BubbleWealthHealthSprite.AddUIComponent<UIPanel> (); this.BubbleWealthSpritePanel.name = "BubbleWealthSpritePanel"; this.BubbleWealthSpritePanel.width = 37; this.BubbleWealthSpritePanel.height = 34; this.BubbleWealthSpritePanel.relativePosition = new Vector3 (0, 0); //Wealth Button Sprite this.BubbleWealthSprite = this.BubbleWealthSpritePanel.AddUIComponent<UIButton> (); this.BubbleWealthSprite.name = "BubbleWealthSprite"; this.BubbleWealthSprite.width = 25; this.BubbleWealthSprite.height = 25; this.BubbleWealthSprite.normalBgSprite = "MoneyThumb"; this.BubbleWealthSprite.playAudioEvents = false; this.BubbleWealthSprite.tooltipBox = UIView.GetAView().defaultTooltipBox; this.BubbleWealthSprite.relativePosition = new Vector3(10,5); //Weatlh Button Value this.BubbleRow2WealthValueVal = this.BubbleWealthHealthSprite.AddUIComponent<UIButton> (); this.BubbleRow2WealthValueVal.name = "BubbleRow2WealthValueVal"; this.BubbleRow2WealthValueVal.width = 70; this.BubbleRow2WealthValueVal.height = 34; this.BubbleRow2WealthValueVal.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleRow2WealthValueVal.textHorizontalAlignment = UIHorizontalAlignment.Center; this.BubbleRow2WealthValueVal.font = UIDynamicFont.FindByName ("OpenSans-Regular"); //this.BubbleRow2WealthValueVal.textPadding.left = 2; //this.BubbleRow2WealthValueVal.textPadding.right = 2; this.BubbleRow2WealthValueVal.textPadding.top = 1; this.BubbleRow2WealthValueVal.font.size = 15; this.BubbleRow2WealthValueVal.textScale = 0.80f; this.BubbleRow2WealthValueVal.outlineColor = new Color32 (0, 0, 0, 0); this.BubbleRow2WealthValueVal.outlineSize = 1; this.BubbleRow2WealthValueVal.textColor = new Color32 (0, 51, 102, 140); //r,g,b,a this.BubbleRow2WealthValueVal.isInteractive = false; this.BubbleRow2WealthValueVal.useDropShadow = true; this.BubbleRow2WealthValueVal.wordWrap = true; this.BubbleRow2WealthValueVal.dropShadowOffset = new Vector2 (1, -1); this.BubbleRow2WealthValueVal.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubbleRow2WealthValueVal.relativePosition = new Vector3(37,0); //Health Sprite Panel this.BubbleHealthSpritePanel = this.BubbleWealthHealthSprite.AddUIComponent<UIPanel> (); this.BubbleHealthSpritePanel.name = "BubbleHealthSpritePanel"; this.BubbleHealthSpritePanel.width = 26; this.BubbleHealthSpritePanel.height = 34; this.BubbleHealthSpritePanel.relativePosition = new Vector3 (107, 0); //Health Button Sprite this.BubbleHealthSprite = this.BubbleHealthSpritePanel.AddUIComponent<UIButton> (); this.BubbleHealthSprite.name = "BubbleWealthSprite"; this.BubbleHealthSprite.width = 26; this.BubbleHealthSprite.height = 26; this.BubbleHealthSprite.playAudioEvents = false; this.BubbleHealthSprite.tooltipBox = UIView.GetAView().defaultTooltipBox; this.BubbleHealthSprite.relativePosition = new Vector3(0,4); //Heatlh Button Value this.BubbleHealthValue = this.BubbleWealthHealthSprite.AddUIComponent<UIButton> (); this.BubbleHealthValue.name = "BubbleHealthValue"; this.BubbleHealthValue.width = 65; this.BubbleHealthValue.height = 34; this.BubbleHealthValue.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleHealthValue.textHorizontalAlignment = UIHorizontalAlignment.Center; this.BubbleHealthValue.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleHealthValue.textPadding.left = 5; this.BubbleHealthValue.textPadding.right = 5; this.BubbleHealthValue.textPadding.top = 1; this.BubbleHealthValue.font.size = 15; this.BubbleHealthValue.textScale = 0.85f; this.BubbleHealthValue.outlineColor = new Color32 (0, 0, 0, 0); this.BubbleHealthValue.outlineSize = 1; this.BubbleHealthValue.textColor = new Color32 (0, 51, 102, 140); //r,g,b,a this.BubbleHealthValue.isInteractive = false; this.BubbleHealthValue.useDropShadow = true; this.BubbleHealthValue.wordWrap = true; this.BubbleHealthValue.dropShadowOffset = new Vector2 (1, -1); this.BubbleHealthValue.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubbleHealthValue.relativePosition = new Vector3(133,0); //Work Building Panel this.WorkBuildingPanel = this.BubbleFamPortBgSprite.AddUIComponent<UIPanel> (); this.WorkBuildingPanel.name = "WorkBuildingPanel"; this.WorkBuildingPanel.width = 234; this.WorkBuildingPanel.height = 25; this.WorkBuildingPanel.relativePosition = new Vector3 (4, 82); //Work Building Background this.BubbleWorkBuildingSprite = this.WorkBuildingPanel.AddUIComponent<UITextureSprite> (); this.BubbleWorkBuildingSprite.name = "BubbleWorkBuildingSprite"; this.BubbleWorkBuildingSprite.width = this.WorkBuildingPanel.width; this.BubbleWorkBuildingSprite.height = this.WorkBuildingPanel.height; this.BubbleWorkBuildingSprite.texture = TextureDB.BubbleBg1Special; this.BubbleWorkBuildingSprite.relativePosition = Vector3.zero; this.BubbleWorkBuildingSprite.clipChildren = true; this.FavCimsWorkingPlace = this.BubbleWorkBuildingSprite.AddUIComponent<UIButton> (); this.FavCimsWorkingPlace.name = "FavCimsWorkingPlace"; this.FavCimsWorkingPlace.width = this.BubbleWorkBuildingSprite.width; this.FavCimsWorkingPlace.height = this.BubbleWorkBuildingSprite.height; this.FavCimsWorkingPlace.textVerticalAlignment = UIVerticalAlignment.Middle; this.FavCimsWorkingPlace.textHorizontalAlignment = UIHorizontalAlignment.Left; this.FavCimsWorkingPlace.playAudioEvents = true; this.FavCimsWorkingPlace.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.FavCimsWorkingPlace.font.size = 15; this.FavCimsWorkingPlace.textScale = 0.85f; //this.FavCimsWorkingPlace.wordWrap = true; this.FavCimsWorkingPlace.textPadding.left = 40; this.FavCimsWorkingPlace.textPadding.right = 5; this.FavCimsWorkingPlace.outlineColor = new Color32 (0, 0, 0, 0); this.FavCimsWorkingPlace.outlineSize = 1; this.FavCimsWorkingPlace.textColor = new Color32 (21, 59, 96, 140); //r,g,b,a this.FavCimsWorkingPlace.hoveredTextColor = new Color32 (204, 102, 0, 20); this.FavCimsWorkingPlace.pressedTextColor = new Color32 (153, 0, 0, 0); this.FavCimsWorkingPlace.focusedTextColor = new Color32 (102, 153, 255, 147); this.FavCimsWorkingPlace.disabledTextColor = new Color32 (51, 51, 51, 160); //r,g,b,a this.FavCimsWorkingPlace.useDropShadow = true; this.FavCimsWorkingPlace.dropShadowOffset = new Vector2 (1, -1); this.FavCimsWorkingPlace.dropShadowColor = new Color32 (0, 0, 0, 0); this.FavCimsWorkingPlace.tooltipBox = UIView.GetAView().defaultTooltipBox; this.FavCimsWorkingPlace.eventMouseDown += (component, eventParam) => GoToInstance (WorkPlaceID); this.FavCimsWorkingPlace.relativePosition = new Vector3 (0, 1); //Work Panel this.BubbleWorkIconPanel = this.BubbleFamPortBgSprite.AddUIComponent<UIPanel> (); this.BubbleWorkIconPanel.name = "BubbleRow2Panel"; this.BubbleWorkIconPanel.width = 36; this.BubbleWorkIconPanel.height = 40; this.BubbleWorkIconPanel.absolutePosition = new Vector3 (BubbleFamPortBgSprite.absolutePosition.x + 4, BubbleFamPortBgSprite.absolutePosition.y + 71); //70 //Work sprites this.FavCimsWorkingPlaceSprite = this.BubbleWorkIconPanel.AddUIComponent<UITextureSprite> (); this.FavCimsWorkingPlaceSprite.name = "FavCimsWorkingPlaceSprite"; this.FavCimsWorkingPlaceSprite.width = 20; this.FavCimsWorkingPlaceSprite.height = 40; this.FavCimsWorkingPlaceSprite.relativePosition = new Vector3 (9, 3); this.FavCimsWorkingPlaceSprite.tooltipBox = UIView.GetAView().defaultTooltipBox; this.FavCimsWorkingPlaceButtonGamDefImg = this.FavCimsWorkingPlaceSprite.AddUIComponent<UIButton> (); this.FavCimsWorkingPlaceButtonGamDefImg.name = "FavCimsWorkingPlaceButtonGamDefImg"; this.FavCimsWorkingPlaceButtonGamDefImg.width = 20; this.FavCimsWorkingPlaceButtonGamDefImg.height = 20; this.FavCimsWorkingPlaceButtonGamDefImg.relativePosition = new Vector3 (0, 10); this.FavCimsWorkingPlaceButtonGamDefImg.isInteractive = false; this.FavCimsWorkingPlaceButtonGamDefImg.tooltipBox = UIView.GetAView().defaultTooltipBox; this.FavCimsCitizenWorkPlaceLevelSprite = this.FavCimsWorkingPlaceSprite.AddUIComponent<UITextureSprite> (); this.FavCimsCitizenWorkPlaceLevelSprite.name = "FavCimsCitizenWorkPlaceLevelSprite"; this.FavCimsCitizenWorkPlaceLevelSprite.relativePosition = new Vector3 (0, 0); //Citizen Personal Vehicle this.BubblePersonalCarButton = this.BubbleFamPortBgSprite.AddUIComponent<UITextureSprite> (); this.BubblePersonalCarButton.name = "BubblePersonalCarButton"; this.BubblePersonalCarButton.width = 30; this.BubblePersonalCarButton.height = 20; this.BubblePersonalCarButton.texture = TextureDB.BubbleCarDisabled; this.BubblePersonalCarButton.tooltipBox = UIView.GetAView().defaultTooltipBox; this.BubblePersonalCarButton.absolutePosition = new Vector3(BubbleTargetIcon.absolutePosition.x, this.BubbleTargetIcon.absolutePosition.y + this.BubbleTargetIcon.height); this.BubblePersonalCarButton.eventMouseDown += (component, eventParam) => this.GoToInstance(this.PersonalVehicleID); this.BubblePersonalCarButton.BringToFront (); //Activity Panel this.BubbleActivityPanel = this.BubbleFamPortBgSprite.AddUIComponent<UIPanel> (); this.BubbleActivityPanel.name = "BubbleActivityPanel"; this.BubbleActivityPanel.width = 234; this.BubbleActivityPanel.height = 18; //15 this.BubbleActivityPanel.relativePosition = new Vector3 (4, this.WorkBuildingPanel.relativePosition.y + 31); //34 //Activity Background this.BubbleActivitySprite = this.BubbleActivityPanel.AddUIComponent<UITextureSprite> (); this.BubbleActivitySprite.name = "BubbleActivitySprite"; this.BubbleActivitySprite.width = this.BubbleActivityPanel.width; this.BubbleActivitySprite.height = this.BubbleActivityPanel.height; this.BubbleActivitySprite.texture = TextureDB.BubbleBg1Special2; this.BubbleActivitySprite.relativePosition = Vector3.zero; //Citizen Vehicle Panel this.BubbleActivityVehiclePanel = this.BubbleActivitySprite.AddUIComponent<UIPanel> (); this.BubbleActivityVehiclePanel.name = "BubbleActivityVehiclePanel"; this.BubbleActivityVehiclePanel.width = 234; this.BubbleActivityVehiclePanel.height = 18; //15 this.BubbleActivityVehiclePanel.relativePosition = new Vector3 (4, 0); //Citizen Vehicle this.FavCimsLastActivityVehicleButton = this.BubbleActivityVehiclePanel.AddUIComponent<UIButton> (); this.FavCimsLastActivityVehicleButton.name = "FavCimsLastActivityVehicleButton"; this.FavCimsLastActivityVehicleButton.width = 18; this.FavCimsLastActivityVehicleButton.height = 17; this.FavCimsLastActivityVehicleButton.relativePosition = new Vector3 (0, 0); this.FavCimsLastActivityVehicleButton.eventMouseDown += (component, eventParam) => GoToInstance(this.MyVehicleID); //Last Activity this.FavCimsLastActivity = this.BubbleActivitySprite.AddUIComponent<UIButton> (); this.FavCimsLastActivity.name = "FavCimsLastActivity"; this.FavCimsLastActivity.width = this.BubbleActivitySprite.width-27; this.FavCimsLastActivity.height = this.BubbleActivitySprite.height; this.FavCimsLastActivity.textVerticalAlignment = UIVerticalAlignment.Middle; this.FavCimsLastActivity.textHorizontalAlignment = UIHorizontalAlignment.Left; this.FavCimsLastActivity.playAudioEvents = true; this.FavCimsLastActivity.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.FavCimsLastActivity.font.size = 15; this.FavCimsLastActivity.textScale = 0.75f; //this.FavCimsLastActivity.wordWrap = true; this.FavCimsLastActivity.textPadding.left = 0; this.FavCimsLastActivity.textPadding.right = 5; //this.FavCimsLastActivity.textPadding.left = (int)this.FavCimsLastActivitySprite.width + (int)this.FavCimsLastActivitySprite.relativePosition.x + 10; this.FavCimsLastActivity.outlineColor = new Color32 (0, 0, 0, 0); this.FavCimsLastActivity.outlineSize = 1; this.FavCimsLastActivity.textColor = new Color32 (21, 59, 96, 140); //r,g,b,a this.FavCimsLastActivity.hoveredTextColor = new Color32 (204, 102, 0, 20); this.FavCimsLastActivity.pressedTextColor = new Color32 (153, 0, 0, 0); this.FavCimsLastActivity.focusedTextColor = new Color32 (102, 153, 255, 147); this.FavCimsLastActivity.disabledTextColor = new Color32 (51, 51, 51, 160); //r,g,b,a this.FavCimsLastActivity.useDropShadow = true; this.FavCimsLastActivity.dropShadowOffset = new Vector2 (1, -1); this.FavCimsLastActivity.dropShadowColor = new Color32 (0, 0, 0, 0); this.FavCimsLastActivity.maximumSize = new Vector2 (this.BubbleActivitySprite.width-40, this.BubbleActivitySprite.height); this.FavCimsLastActivity.tooltipBox = UIView.GetAView().defaultTooltipBox; this.FavCimsLastActivity.eventMouseDown += (component, eventParam) => GoToInstance(this.MyTargetID); this.FavCimsLastActivity.relativePosition = new Vector3 (27, 1); //District Panel this.BubbleDistrictPanel = this.BubbleFamPortBgSprite.AddUIComponent<UIPanel> (); this.BubbleDistrictPanel.name = "BubbleDistrictPanel"; this.BubbleDistrictPanel.width = 234; this.BubbleDistrictPanel.height = 15; this.BubbleDistrictPanel.relativePosition = new Vector3 (4, this.BubbleActivityPanel.relativePosition.y + 21); //District Background this.BubbleDistrictSprite = this.BubbleDistrictPanel.AddUIComponent<UITextureSprite> (); this.BubbleDistrictSprite.name = "BubbleDistrictSprite"; this.BubbleDistrictSprite.width = this.BubbleDistrictPanel.width; this.BubbleDistrictSprite.height = this.BubbleDistrictPanel.height; this.BubbleDistrictSprite.texture = TextureDB.BubbleBg1Special2; this.BubbleDistrictSprite.relativePosition = Vector3.zero; //District Label this.FavCimsDistrictLabel = this.BubbleDistrictSprite.AddUIComponent<UIButton> (); this.FavCimsDistrictLabel.name = "FavCimsDistrictLabel"; this.FavCimsDistrictLabel.width = 60; this.FavCimsDistrictLabel.height = 15; this.FavCimsDistrictLabel.textVerticalAlignment = UIVerticalAlignment.Middle; this.FavCimsDistrictLabel.textHorizontalAlignment = UIHorizontalAlignment.Center; this.FavCimsDistrictLabel.playAudioEvents = true; this.FavCimsDistrictLabel.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.FavCimsDistrictLabel.font.size = 15; this.FavCimsDistrictLabel.textScale = 0.70f; //this.FavCimsDistrictLabel.wordWrap = true; this.FavCimsDistrictLabel.textPadding.left = 0; this.FavCimsDistrictLabel.textPadding.right = 5; this.FavCimsDistrictLabel.outlineColor = new Color32 (0, 0, 0, 0); this.FavCimsDistrictLabel.outlineSize = 1; this.FavCimsDistrictLabel.textColor = new Color32 (153, 0, 0, 0); this.FavCimsDistrictLabel.isInteractive = false; //this.FavCimsDistrictLabel.hoveredTextColor = new Color32 (204, 102, 0, 20); //this.FavCimsDistrictLabel.pressedTextColor = new Color32 (153, 0, 0, 0); //this.FavCimsDistrictLabel.focusedTextColor = new Color32 (102, 153, 255, 147); //this.FavCimsDistrictLabel.disabledTextColor = new Color32 (51, 51, 51, 160); //r,g,b,a this.FavCimsDistrictLabel.useDropShadow = true; this.FavCimsDistrictLabel.dropShadowOffset = new Vector2 (1, -1); this.FavCimsDistrictLabel.dropShadowColor = new Color32 (0, 0, 0, 0); this.FavCimsDistrictLabel.relativePosition = new Vector3 (4, 1); //Now in this District this.FavCimsDistrictValue = this.BubbleDistrictSprite.AddUIComponent<UIButton> (); this.FavCimsDistrictValue.name = "FavCimsDistrictValue"; this.FavCimsDistrictValue.width = this.BubbleDistrictPanel.width - 74; this.FavCimsDistrictValue.height = 15; this.FavCimsDistrictValue.textVerticalAlignment = UIVerticalAlignment.Middle; this.FavCimsDistrictValue.textHorizontalAlignment = UIHorizontalAlignment.Left; this.FavCimsDistrictValue.playAudioEvents = true; this.FavCimsDistrictValue.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.FavCimsDistrictValue.font.size = 15; this.FavCimsDistrictValue.textScale = 0.70f; //this.FavCimsDistrictValue.wordWrap = true; this.FavCimsDistrictValue.textPadding.left = 0; this.FavCimsDistrictValue.textPadding.right = 5; this.FavCimsDistrictValue.outlineColor = new Color32 (0, 0, 0, 0); this.FavCimsDistrictValue.outlineSize = 1; this.FavCimsDistrictValue.textColor = new Color32 (21, 59, 96, 140); //r,g,b,a //this.FavCimsDistrictValue.isInteractive = false; //this.FavCimsDistrictValue.hoveredTextColor = new Color32 (204, 102, 0, 20); //this.FavCimsDistrictValue.pressedTextColor = new Color32 (153, 0, 0, 0); //this.FavCimsDistrictValue.focusedTextColor = new Color32 (102, 153, 255, 147); this.FavCimsDistrictValue.disabledTextColor = new Color32 (21, 59, 96, 140); //r,g,b,a this.FavCimsDistrictValue.isEnabled = false; this.FavCimsDistrictValue.useDropShadow = true; this.FavCimsDistrictValue.dropShadowOffset = new Vector2 (1, -1); this.FavCimsDistrictValue.dropShadowColor = new Color32 (0, 0, 0, 0); this.FavCimsDistrictValue.relativePosition = new Vector3 (64, 1); //Details & Problems Panel this.BubbleDetailsPanel = this.AddUIComponent<UIPanel>(); this.BubbleDetailsPanel.name = "BubbleDetailsPanel"; this.BubbleDetailsPanel.width = 235; this.BubbleDetailsPanel.height = 60; this.BubbleDetailsPanel.relativePosition = new Vector3(7,this.BubbleFamilyPortraitPanel.relativePosition.y+this.BubbleFamilyPortraitPanel.height+1); //Details & Problems Background Sprite this.BubbleDetailsBgSprite = this.BubbleDetailsPanel.AddUIComponent<UITextureSprite> (); this.BubbleDetailsBgSprite.name = "BubbleFamPortBgSprite"; this.BubbleDetailsBgSprite.texture = TextureDB.BubbleDetailsBgSprite; this.BubbleDetailsBgSprite.relativePosition = Vector3.zero; //Home Icon this.BubbleHomeIcon = this.BubbleDetailsPanel.AddUIComponent<UITextureSprite> (); this.BubbleHomeIcon.name = "FavCimsCitizenHomeSprite"; this.BubbleHomeIcon.relativePosition = new Vector3 (10,10); this.BubbleHomeIcon.tooltipBox = UIView.GetAView().defaultTooltipBox; //Home Level this.BubbleHomeLevel = this.BubbleHomeIcon.AddUIComponent<UITextureSprite> (); this.BubbleHomeLevel.name = "FavCimsCitizenResidentialLevelSprite"; this.BubbleHomeLevel.relativePosition = Vector3.zero; //Home Name & Level this.BubbleHomePanel = this.BubbleDetailsPanel.AddUIComponent<UIPanel>(); this.BubbleHomePanel.name = "BubbleHomePanel"; this.BubbleHomePanel.width = 181; this.BubbleHomePanel.height = 30; this.BubbleHomePanel.maximumSize = new Vector2(181,40); this.BubbleHomePanel.autoLayoutDirection = LayoutDirection.Horizontal; this.BubbleHomePanel.autoLayout = true; this.BubbleHomePanel.relativePosition = new Vector3(40,4); //Home Name this.BubbleHomeName = this.BubbleHomePanel.AddUIComponent<UIButton> (); this.BubbleHomeName.name = "BubbleHomeName"; this.BubbleHomeName.width = this.BubbleHomePanel.width; this.BubbleHomeName.height = this.BubbleHomePanel.height; this.BubbleHomeName.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleHomeName.textHorizontalAlignment = UIHorizontalAlignment.Left; //this.BubbleHomeName.textPadding.left = 5; this.BubbleHomeName.playAudioEvents = true; this.BubbleHomeName.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleHomeName.font.size = 15; this.BubbleHomeName.textScale = 0.90f; this.BubbleHomeName.wordWrap = true; this.BubbleHomeName.textPadding.left = 2; this.BubbleHomeName.textPadding.right = 5; this.BubbleHomeName.outlineColor = new Color32 (0, 0, 0, 0); this.BubbleHomeName.outlineSize = 1; this.BubbleHomeName.textColor = new Color32 (21, 59, 96, 140); //r,g,b,a this.BubbleHomeName.hoveredTextColor = new Color32 (204, 102, 0, 20); this.BubbleHomeName.pressedTextColor = new Color32 (153, 0, 0, 0); this.BubbleHomeName.focusedTextColor = new Color32 (102, 153, 255, 147); this.BubbleHomeName.disabledTextColor = new Color32 (51, 51, 51, 160); //r,g,b,a this.BubbleHomeName.useDropShadow = true; this.BubbleHomeName.dropShadowOffset = new Vector2 (1, -1); this.BubbleHomeName.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubbleHomeName.maximumSize = new Vector2 (this.BubbleHomePanel.width, this.BubbleHomePanel.height); this.BubbleHomeName.tooltipBox = UIView.GetAView().defaultTooltipBox; //this.BubbleHomeName.text = "prova"; this.BubbleHomeName.eventMouseDown += (component, eventParam) => this.GoToInstance (this.CitizenHomeID); this.BubbleHomeName.relativePosition = Vector3.zero; //Details & Problems Icons Panel this.BubbleDetailsIconsPanel = this.BubbleDetailsPanel.AddUIComponent<UIPanel>(); this.BubbleDetailsIconsPanel.name = "BubbleDetailsIconsPanel"; this.BubbleDetailsIconsPanel.width = 181; this.BubbleDetailsIconsPanel.height = 20; //this.BubbleDetailsIconsPanel.padding.left = 7; //this.BubbleDetailsIconsPanel.padding.right = 7; this.BubbleDetailsIconsPanel.maximumSize = new Vector2(181,30); this.BubbleDetailsIconsPanel.autoLayoutDirection = LayoutDirection.Horizontal; this.BubbleDetailsIconsPanel.autoLayout = true; this.BubbleDetailsIconsPanel.relativePosition = new Vector3(this.BubbleHomePanel.relativePosition.x, 30); //Details & Problems Icons Buttons; this.BubbleDetailsElettricity = this.BubbleDetailsIconsPanel.AddUIComponent<UIButton> (); this.BubbleDetailsElettricity.name = "BubbleDetailsElettricity"; this.BubbleDetailsElettricity.normalBgSprite = "ToolbarIconElectricity"; this.BubbleDetailsElettricity.width = 20; this.BubbleDetailsElettricity.height = 20; this.BubbleDetailsElettricity.playAudioEvents = false; this.BubbleDetailsElettricity.tooltipBox = UIView.GetAView().defaultTooltipBox; //this.BubbleDetailsElettricity.isInteractive = false; this.BubbleDetailsWater = this.BubbleDetailsIconsPanel.AddUIComponent<UIButton> (); this.BubbleDetailsWater.name = "BubbleDetailsWater"; this.BubbleDetailsWater.normalBgSprite = "IconPolicyWaterSaving"; this.BubbleDetailsWater.width = this.BubbleDetailsElettricity.width; this.BubbleDetailsWater.height = this.BubbleDetailsElettricity.height; this.BubbleDetailsWater.playAudioEvents = false; this.BubbleDetailsWater.tooltipBox = UIView.GetAView().defaultTooltipBox; //this.BubbleDetailsWater.isInteractive = false; this.BubbleDetailsLandValue = this.BubbleDetailsIconsPanel.AddUIComponent<UIButton> (); this.BubbleDetailsLandValue.name = "BubbleDetailsLandValue"; this.BubbleDetailsLandValue.normalBgSprite = "InfoIconLandValue"; this.BubbleDetailsLandValue.width = BubbleDetailsElettricity.width; this.BubbleDetailsLandValue.height = BubbleDetailsElettricity.height; this.BubbleDetailsLandValue.playAudioEvents = false; this.BubbleDetailsLandValue.tooltipBox = UIView.GetAView().defaultTooltipBox; //this.BubbleDetailsLandValue.isInteractive = false; this.BubbleDetailsCrime = this.BubbleDetailsIconsPanel.AddUIComponent<UIButton> (); this.BubbleDetailsCrime.name = "BubbleDetailsCrime"; this.BubbleDetailsCrime.normalBgSprite = "InfoIconCrime"; this.BubbleDetailsCrime.width = this.BubbleDetailsElettricity.width; this.BubbleDetailsCrime.height = this.BubbleDetailsElettricity.height; this.BubbleDetailsCrime.playAudioEvents = false; this.BubbleDetailsCrime.tooltipBox = UIView.GetAView().defaultTooltipBox; //this.BubbleDetailsCrime.isInteractive = false; this.BubbleDetailsNoise = this.BubbleDetailsIconsPanel.AddUIComponent<UIButton> (); this.BubbleDetailsNoise.name = "BubbleDetailsNoise"; this.BubbleDetailsNoise.normalBgSprite = "InfoIconNoisePollution"; this.BubbleDetailsNoise.width = this.BubbleDetailsElettricity.width; this.BubbleDetailsNoise.height = this.BubbleDetailsElettricity.height; this.BubbleDetailsNoise.playAudioEvents = false; this.BubbleDetailsNoise.tooltipBox = UIView.GetAView().defaultTooltipBox; //this.BubbleDetailsNoise.isInteractive = false; this.BubbleDetailsGarbage = this.BubbleDetailsIconsPanel.AddUIComponent<UIButton> (); this.BubbleDetailsGarbage.name = "BubbleDetailsGarbage"; this.BubbleDetailsGarbage.normalBgSprite = "InfoIconGarbage"; this.BubbleDetailsGarbage.width = this.BubbleDetailsElettricity.width; this.BubbleDetailsGarbage.height = this.BubbleDetailsElettricity.height; this.BubbleDetailsGarbage.playAudioEvents = false; this.BubbleDetailsGarbage.tooltipBox = UIView.GetAView().defaultTooltipBox; //this.BubbleDetailsGarbage.isInteractive = false; this.BubbleDetailsDeath = this.BubbleDetailsIconsPanel.AddUIComponent<UIButton> (); this.BubbleDetailsDeath.name = "BubbleDetailsDeath"; this.BubbleDetailsDeath.normalBgSprite = "NotificationIconVerySick"; this.BubbleDetailsDeath.width = this.BubbleDetailsElettricity.width; this.BubbleDetailsDeath.height = this.BubbleDetailsElettricity.height; this.BubbleDetailsDeath.playAudioEvents = false; this.BubbleDetailsDeath.tooltipBox = UIView.GetAView().defaultTooltipBox; //this.BubbleDetailsDeath.isInteractive = false; this.BubbleDetailsFire = this.BubbleDetailsIconsPanel.AddUIComponent<UIButton> (); this.BubbleDetailsFire.name = "BubbleDetailsFire"; this.BubbleDetailsFire.normalBgSprite = "ToolbarIconFireDepartment"; this.BubbleDetailsFire.width = this.BubbleDetailsElettricity.width; this.BubbleDetailsFire.height = this.BubbleDetailsElettricity.height; this.BubbleDetailsFire.playAudioEvents = false; this.BubbleDetailsFire.tooltipBox = UIView.GetAView().defaultTooltipBox; //this.BubbleDetailsFire.isInteractive = false; this.BubbleDetailsPollution = this.BubbleDetailsIconsPanel.AddUIComponent<UIButton> (); this.BubbleDetailsPollution.name = "BubbleDetailsPollution"; this.BubbleDetailsPollution.normalBgSprite = "InfoIconPollution"; this.BubbleDetailsPollution.width = this.BubbleDetailsElettricity.width; this.BubbleDetailsPollution.height = this.BubbleDetailsElettricity.height; this.BubbleDetailsPollution.playAudioEvents = false; this.BubbleDetailsPollution.tooltipBox = UIView.GetAView().defaultTooltipBox; //this.BubbleDetailsPollution.isInteractive = false; //Header Family Bar Panel this.BubbleFamilyBarPanel = this.AddUIComponent<UIPanel>(); this.BubbleFamilyBarPanel.name = "BubbleFamilyBarPanel"; this.BubbleFamilyBarPanel.width = 236; this.BubbleFamilyBarPanel.height = 20; this.BubbleFamilyBarPanel.relativePosition = new Vector3(7,this.BubbleDetailsPanel.relativePosition.y + this.BubbleDetailsPanel.height + 2); //Header Family Bar Bg this.BubbleFamilyBarPanelBg = this.BubbleFamilyBarPanel.AddUIComponent<UITextureSprite> (); this.BubbleFamilyBarPanelBg.name = "BubbleFamilyBarPanelBg"; this.BubbleFamilyBarPanelBg.width = this.BubbleFamilyBarPanel.width; this.BubbleFamilyBarPanelBg.height = this.BubbleFamilyBarPanel.height; this.BubbleFamilyBarPanelBg.texture = TextureDB.BubbleBgBarHover; this.BubbleFamilyBarPanelBg.relativePosition = Vector3.zero; //Header Family Label this.BubbleFamilyBarLabel = this.BubbleFamilyBarPanel.AddUIComponent<UILabel> (); this.BubbleFamilyBarLabel.name = "BubbleFamilyBarLabel"; this.BubbleFamilyBarLabel.height = this.BubbleFamilyBarPanel.height; this.BubbleFamilyBarLabel.width = 221; this.BubbleFamilyBarLabel.font.size = 11; this.BubbleFamilyBarLabel.textScale = 1f; this.BubbleFamilyBarLabel.textColor = new Color32 (102, 0, 51, 220); this.BubbleFamilyBarLabel.relativePosition = new Vector3(7,2); //Header Family Dog SpriteButton this.BubbleFamilyBarDogButton = this.BubbleFamilyBarPanel.AddUIComponent<UITextureSprite> (); this.BubbleFamilyBarDogButton.name = "BubbleFamilyBarDogButton"; this.BubbleFamilyBarDogButton.texture = TextureDB.BubbleDogDisabled; this.BubbleFamilyBarDogButton.tooltipBox = UIView.GetAView().defaultTooltipBox; this.BubbleFamilyBarDogButton.relativePosition = new Vector3(175,0); this.BubbleFamilyBarDogButton.eventMouseDown += (component, eventParam) => this.GoToInstance(this.MyPetID); //Header Family Car SpriteButton this.BubbleFamilyBarCarButton = this.BubbleFamilyBarPanel.AddUIComponent<UITextureSprite> (); this.BubbleFamilyBarCarButton.name = "BubbleFamilyBarCarButton"; this.BubbleFamilyBarCarButton.texture = TextureDB.BubbleCarDisabled; this.BubbleFamilyBarCarButton.tooltipBox = UIView.GetAView().defaultTooltipBox; this.BubbleFamilyBarCarButton.relativePosition = new Vector3(this.BubbleFamilyBarDogButton.relativePosition.x + this.BubbleFamilyBarDogButton.width + 10,0); this.BubbleFamilyBarCarButton.eventMouseDown += (component, eventParam) => this.GoToInstance(this.FamilyVehicleID); //Family Panel this.BubbleFamilyPanel = this.AddUIComponent<UIPanel>(); this.BubbleFamilyPanel.name = "BubbleFamilyPanel"; this.BubbleFamilyPanel.width = 236; this.BubbleFamilyPanel.height = 212; this.BubbleFamilyPanel.clipChildren = true; this.BubbleFamilyPanel.padding = new RectOffset(0,0,0,0); this.BubbleFamilyPanel.autoLayout = true; this.BubbleFamilyPanel.autoLayoutDirection = LayoutDirection.Vertical; this.BubbleFamilyPanel.relativePosition = new Vector3(7,this.BubbleFamilyBarPanel.relativePosition.y + this.BubbleFamilyBarPanel.height); //No partner panel this.NoPartnerPanel = this.BubbleFamilyPanel.AddUIComponent<UIPanel>(); this.NoPartnerPanel.name = "NoPartnerPanel"; this.NoPartnerPanel.width = this.BubbleFamilyPanel.width; this.NoPartnerPanel.height = 52; this.NoPartnerPanel.Hide (); //No partner button sprite this.NoPartnerBSprite = this.NoPartnerPanel.AddUIComponent<UIButton> (); this.NoPartnerBSprite.name = "NoPartnerBSprite"; this.NoPartnerBSprite.normalBgSprite = "InfoIconHealthDisabled"; this.NoPartnerBSprite.width = 36; this.NoPartnerBSprite.height = 36; this.NoPartnerBSprite.relativePosition = new Vector3 (7, 5); //No partner fake button this.NoPartnerFButton = this.NoPartnerPanel.AddUIComponent<UIButton> (); this.NoPartnerFButton.name = "NoPartnerFButton"; this.NoPartnerFButton.width = 155; this.NoPartnerFButton.height = this.NoPartnerBSprite.height; this.NoPartnerFButton.textVerticalAlignment = UIVerticalAlignment.Middle; this.NoPartnerFButton.textHorizontalAlignment = UIHorizontalAlignment.Left; this.NoPartnerFButton.playAudioEvents = false; this.NoPartnerFButton.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.NoPartnerFButton.font.size = 16; this.NoPartnerFButton.textScale = 0.9f; this.NoPartnerFButton.wordWrap = true; this.NoPartnerFButton.useDropShadow = true; this.NoPartnerFButton.dropShadowOffset = new Vector2 (1, -1); this.NoPartnerFButton.dropShadowColor = new Color32 (0, 0, 0, 0); this.NoPartnerFButton.textPadding.left = 5; this.NoPartnerFButton.textPadding.right = 5; this.NoPartnerFButton.isEnabled = false; this.NoPartnerFButton.disabledTextColor = new Color32 (51, 51, 51, 160); //r,g,b,a this.NoPartnerFButton.relativePosition = new Vector3 (this.NoPartnerBSprite.relativePosition.x + this.NoPartnerBSprite.width, this.NoPartnerBSprite.relativePosition.y); //x 4 Rows //Partner Panel this.PartnerPanel = this.BubbleFamilyPanel.AddUIComponent<UIPanel>(); this.PartnerPanel.name = "PartnerPanel"; this.PartnerPanel.width = this.BubbleFamilyPanel.width; this.PartnerPanel.height = 52; this.PartnerPanel.clipChildren = true; this.PartnerPanel.padding = new RectOffset(0,0,0,0); this.PartnerPanel.autoLayout = true; this.PartnerPanel.autoLayoutDirection = LayoutDirection.Vertical; //Partner Background Bar this.BubblePartnerBgBar = this.PartnerPanel.AddUIComponent<UITextureSprite> (); this.BubblePartnerBgBar.name = "BubblePartnerBgBar"; this.BubblePartnerBgBar.width = this.PartnerPanel.width; this.BubblePartnerBgBar.height = 26; this.BubblePartnerBgBar.texture = TextureDB.BubbleBgBar1; //Partner Fake Button Hearth this.BubblePartnerLove = this.BubblePartnerBgBar.AddUIComponent<UIButton> (); this.BubblePartnerLove.name = "BubblePartnerLove"; this.BubblePartnerLove.normalBgSprite = "InfoIconHealth"; this.BubblePartnerLove.width = 22; this.BubblePartnerLove.height = 22; this.BubblePartnerLove.isInteractive = false; this.BubblePartnerLove.relativePosition = new Vector3 (7, 2); //Partner Name Button this.BubblePartnerName = this.BubblePartnerBgBar.AddUIComponent<UIButton> (); this.BubblePartnerName.name = "BubblePartnerName"; this.BubblePartnerName.width = 135; this.BubblePartnerName.height = this.BubblePartnerBgBar.height; this.BubblePartnerName.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubblePartnerName.textHorizontalAlignment = UIHorizontalAlignment.Left; this.BubblePartnerName.playAudioEvents = true; this.BubblePartnerName.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubblePartnerName.font.size = 15; this.BubblePartnerName.textScale = 0.80f; this.BubblePartnerName.wordWrap = true; this.BubblePartnerName.useDropShadow = true; this.BubblePartnerName.dropShadowOffset = new Vector2 (1, -1); this.BubblePartnerName.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubblePartnerName.textPadding.left = 5; this.BubblePartnerName.textPadding.right = 5; this.BubblePartnerName.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a this.BubblePartnerName.hoveredTextColor = new Color32 (204, 102, 0, 20); this.BubblePartnerName.pressedTextColor = new Color32 (102, 153, 255, 147); this.BubblePartnerName.focusedTextColor = new Color32 (153, 0, 0, 0); this.BubblePartnerName.disabledTextColor = new Color32 (51, 51, 51, 160); //r,g,b,a this.BubblePartnerName.relativePosition = new Vector3 (this.BubblePartnerLove.relativePosition.x + this.BubblePartnerLove.width, 2); this.BubblePartnerName.eventMouseDown += (component, eventParam) => this.GoToCitizen(this.PartnerID); //Partner Real Age Button this.BubbleParnerAgeButton = this.BubblePartnerBgBar.AddUIComponent<UIButton> (); this.BubbleParnerAgeButton.name = "BubbleParnerAgeButton"; this.BubbleParnerAgeButton.width = 23; this.BubbleParnerAgeButton.height = 18; this.BubbleParnerAgeButton.textHorizontalAlignment = UIHorizontalAlignment.Center; this.BubbleParnerAgeButton.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleParnerAgeButton.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleParnerAgeButton.textScale = 0.90f; this.BubbleParnerAgeButton.font.size = 15; this.BubbleParnerAgeButton.dropShadowOffset = new Vector2 (1, -1); this.BubbleParnerAgeButton.dropShadowColor = new Color32 (0, 0, 0, 0); //this.BubbleParnerAgeButton.text = "99"; //Real Age test //this.BubbleParnerAgeButton.normalBgSprite = "GenericPanel"; this.BubbleParnerAgeButton.isInteractive = false; this.BubbleParnerAgeButton.relativePosition = new Vector3 (this.BubblePartnerName.relativePosition.x + this.BubblePartnerName.width + 6, 6); //Partner Follow Texture Sprite this.BubblePartnerFollowToggler = this.BubblePartnerBgBar.AddUIComponent<UIButton> (); this.BubblePartnerFollowToggler.name = "BubblePartnerFollowToggler"; this.BubblePartnerFollowToggler.atlas = m_atlas; this.BubblePartnerFollowToggler.size = new Vector2(18,18); this.BubblePartnerFollowToggler.playAudioEvents = true; this.BubblePartnerFollowToggler.relativePosition = new Vector3 (this.BubbleParnerAgeButton.relativePosition.x + this.BubbleParnerAgeButton.width + 12, 4); this.BubblePartnerFollowToggler.eventClick += (component, eventParam) => { FavCimsCore.AddToFavorites (this.PartnerID); }; //Partner Activity Background Bar this.BubblePartnerActivityBar = this.PartnerPanel.AddUIComponent<UITextureSprite> (); this.BubblePartnerActivityBar.name = "BubblePartnerActivityBar"; this.BubblePartnerActivityBar.width = this.PartnerPanel.width; this.BubblePartnerActivityBar.height = 26; this.BubblePartnerActivityBar.texture = TextureDB.BubbleBgBar2; //Partner Activity Vehicle Button this.BubblePartnerVehicleButton = this.BubblePartnerActivityBar.AddUIComponent<UIButton> (); this.BubblePartnerVehicleButton.name = "BubblePartnerVehicleButton"; this.BubblePartnerVehicleButton.width = 22; this.BubblePartnerVehicleButton.height = 22; this.BubblePartnerVehicleButton.relativePosition = new Vector3 (7, 2); this.BubblePartnerVehicleButton.eventMouseDown += (component, eventParam) => GoToInstance(this.PartnerVehID); //Partner Activity Destination this.BubblePartnerDestination = this.BubblePartnerActivityBar.AddUIComponent<UIButton> (); this.BubblePartnerDestination.name = "BubblePartnerDestination"; this.BubblePartnerDestination.width = this.BubblePartnerActivityBar.width-this.BubblePartnerVehicleButton.width; this.BubblePartnerDestination.height = this.BubblePartnerActivityBar.height; this.BubblePartnerDestination.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubblePartnerDestination.textHorizontalAlignment = UIHorizontalAlignment.Left; this.BubblePartnerDestination.playAudioEvents = true; this.BubblePartnerDestination.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubblePartnerDestination.font.size = 15; this.BubblePartnerDestination.textScale = 0.75f; this.BubblePartnerDestination.wordWrap = true; this.BubblePartnerDestination.textPadding.left = 0; this.BubblePartnerDestination.textPadding.right = 5; this.BubblePartnerDestination.outlineColor = new Color32 (0, 0, 0, 0); this.BubblePartnerDestination.outlineSize = 1; this.BubblePartnerDestination.textColor = new Color32 (21, 59, 96, 140); //r,g,b,a this.BubblePartnerDestination.hoveredTextColor = new Color32 (204, 102, 0, 20); this.BubblePartnerDestination.pressedTextColor = new Color32 (153, 0, 0, 0); this.BubblePartnerDestination.focusedTextColor = new Color32 (102, 153, 255, 147); this.BubblePartnerDestination.disabledTextColor = new Color32 (51, 51, 51, 160); //r,g,b,a this.BubblePartnerDestination.useDropShadow = true; this.BubblePartnerDestination.dropShadowOffset = new Vector2 (1, -1); this.BubblePartnerDestination.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubblePartnerDestination.maximumSize = new Vector2 (this.BubblePartnerDestination.width, this.BubblePartnerActivityBar.height); this.BubblePartnerDestination.relativePosition = new Vector3 (this.BubblePartnerVehicleButton.relativePosition.x + this.BubblePartnerVehicleButton.width +5, 2); this.BubblePartnerDestination.eventMouseDown += (component, eventParam) => GoToInstance(this.PartnerTarget); //Parent 1 Panel this.Parent1Panel = this.BubbleFamilyPanel.AddUIComponent<UIPanel>(); this.Parent1Panel.name = "PartnerPanel"; this.Parent1Panel.width = this.BubbleFamilyPanel.width; this.Parent1Panel.height = 52; this.Parent1Panel.clipChildren = true; this.Parent1Panel.padding = new RectOffset(0,0,0,0); this.Parent1Panel.autoLayout = true; this.Parent1Panel.autoLayoutDirection = LayoutDirection.Vertical; this.Parent1Panel.relativePosition = new Vector3(0,0); this.Parent1Panel.Hide (); //Parent1 Background Bar this.BubbleParent1BgBar = this.Parent1Panel.AddUIComponent<UITextureSprite> (); this.BubbleParent1BgBar.name = "BubbleParent1BgBar"; this.BubbleParent1BgBar.width = this.Parent1Panel.width; this.BubbleParent1BgBar.height = 26; this.BubbleParent1BgBar.texture = TextureDB.BubbleBgBar1; //Parent1 Fake Button Hearth this.BubbleParent1Love = this.BubbleParent1BgBar.AddUIComponent<UIButton> (); this.BubbleParent1Love.name = "BubbleParent1Love"; this.BubbleParent1Love.normalBgSprite = "InfoIconAge"; this.BubbleParent1Love.width = 22; this.BubbleParent1Love.height = 22; this.BubbleParent1Love.isInteractive = false; this.BubbleParent1Love.relativePosition = new Vector3 (7, 2); //Parent1 Name Button this.BubbleParent1Name = this.BubbleParent1BgBar.AddUIComponent<UIButton> (); this.BubbleParent1Name.name = "BubbleParent1Name"; this.BubbleParent1Name.width = 135; this.BubbleParent1Name.height = this.BubbleParent1BgBar.height; this.BubbleParent1Name.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleParent1Name.textHorizontalAlignment = UIHorizontalAlignment.Left; this.BubbleParent1Name.playAudioEvents = true; this.BubbleParent1Name.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleParent1Name.font.size = 15; this.BubbleParent1Name.textScale = 0.80f; this.BubbleParent1Name.wordWrap = true; this.BubbleParent1Name.useDropShadow = true; this.BubbleParent1Name.dropShadowOffset = new Vector2 (1, -1); this.BubbleParent1Name.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubbleParent1Name.textPadding.left = 5; this.BubbleParent1Name.textPadding.right = 5; this.BubbleParent1Name.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a this.BubbleParent1Name.hoveredTextColor = new Color32 (204, 102, 0, 20); this.BubbleParent1Name.pressedTextColor = new Color32 (102, 153, 255, 147); this.BubbleParent1Name.focusedTextColor = new Color32 (153, 0, 0, 0); this.BubbleParent1Name.disabledTextColor = new Color32 (51, 51, 51, 160); //r,g,b,a this.BubbleParent1Name.relativePosition = new Vector3 (this.BubbleParent1Love.relativePosition.x + this.BubbleParent1Love.width, 2); this.BubbleParent1Name.eventMouseDown += (component, eventParam) => this.GoToCitizen(this.Parent1ID); //Parent1 Real Age Button this.BubbleParent1AgeButton = this.BubbleParent1BgBar.AddUIComponent<UIButton> (); this.BubbleParent1AgeButton.name = "BubbleParent1AgeButton"; this.BubbleParent1AgeButton.width = 23; this.BubbleParent1AgeButton.height = 18; this.BubbleParent1AgeButton.textHorizontalAlignment = UIHorizontalAlignment.Center; this.BubbleParent1AgeButton.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleParent1AgeButton.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleParent1AgeButton.textScale = 0.90f; this.BubbleParent1AgeButton.font.size = 15; this.BubbleParent1AgeButton.dropShadowOffset = new Vector2 (1, -1); this.BubbleParent1AgeButton.dropShadowColor = new Color32 (0, 0, 0, 0); //this.BubbleParent1AgeButton.text = "99"; //Real Age test //this.BubbleParent1AgeButton.normalBgSprite = "GenericPanel"; this.BubbleParent1AgeButton.isInteractive = false; this.BubbleParent1AgeButton.relativePosition = new Vector3 (this.BubbleParent1Name.relativePosition.x + this.BubbleParent1Name.width + 6, 6); //Parent1 Follow Texture Sprite this.BubbleParent1FollowToggler = this.BubbleParent1BgBar.AddUIComponent<UIButton> (); this.BubbleParent1FollowToggler.name = "BubbleParent1FollowToggler"; this.BubbleParent1FollowToggler.atlas = m_atlas; this.BubbleParent1FollowToggler.size = new Vector2 (18, 18); this.BubbleParent1FollowToggler.playAudioEvents = true; this.BubbleParent1FollowToggler.relativePosition = new Vector3 (this.BubbleParent1AgeButton.relativePosition.x + this.BubbleParent1AgeButton.width + 12, 4); this.BubbleParent1FollowToggler.eventClick += (component, eventParam) => { FavCimsCore.AddToFavorites (this.Parent1ID); }; //Parent1 Activity Background Bar this.BubbleParent1ActivityBar = this.Parent1Panel.AddUIComponent<UITextureSprite> (); this.BubbleParent1ActivityBar.name = "BubbleParent1ActivityBar"; this.BubbleParent1ActivityBar.width = this.Parent1Panel.width; this.BubbleParent1ActivityBar.height = 26; this.BubbleParent1ActivityBar.texture = TextureDB.BubbleBgBar2; //Parent1 Activity Vehicle Button this.BubbleParent1VehicleButton = this.BubbleParent1ActivityBar.AddUIComponent<UIButton> (); this.BubbleParent1VehicleButton.name = "BubbleParent1VehicleButton"; this.BubbleParent1VehicleButton.width = 22; this.BubbleParent1VehicleButton.height = 22; this.BubbleParent1VehicleButton.relativePosition = new Vector3 (7, 2); this.BubbleParent1VehicleButton.eventMouseDown += (component, eventParam) => GoToInstance(this.Parent1VehID); //Parent1 Activity Destination this.BubbleParent1Destination = this.BubbleParent1ActivityBar.AddUIComponent<UIButton> (); this.BubbleParent1Destination.name = "BubbleParent1Destination"; this.BubbleParent1Destination.width = this.BubbleParent1ActivityBar.width-this.BubbleParent1VehicleButton.width; this.BubbleParent1Destination.height = this.BubbleParent1ActivityBar.height; this.BubbleParent1Destination.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleParent1Destination.textHorizontalAlignment = UIHorizontalAlignment.Left; this.BubbleParent1Destination.playAudioEvents = true; this.BubbleParent1Destination.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleParent1Destination.font.size = 15; this.BubbleParent1Destination.textScale = 0.75f; this.BubbleParent1Destination.wordWrap = true; this.BubbleParent1Destination.textPadding.left = 0; this.BubbleParent1Destination.textPadding.right = 5; this.BubbleParent1Destination.outlineColor = new Color32 (0, 0, 0, 0); this.BubbleParent1Destination.outlineSize = 1; this.BubbleParent1Destination.textColor = new Color32 (21, 59, 96, 140); //r,g,b,a this.BubbleParent1Destination.hoveredTextColor = new Color32 (204, 102, 0, 20); this.BubbleParent1Destination.pressedTextColor = new Color32 (153, 0, 0, 0); this.BubbleParent1Destination.focusedTextColor = new Color32 (102, 153, 255, 147); this.BubbleParent1Destination.disabledTextColor = new Color32 (51, 51, 51, 160); //r,g,b,a this.BubbleParent1Destination.useDropShadow = true; this.BubbleParent1Destination.dropShadowOffset = new Vector2 (1, -1); this.BubbleParent1Destination.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubbleParent1Destination.maximumSize = new Vector2 (this.BubbleParent1Destination.width, this.BubbleParent1ActivityBar.height); this.BubbleParent1Destination.relativePosition = new Vector3 (this.BubblePartnerDestination.relativePosition.x, 2); this.BubbleParent1Destination.eventMouseDown += (component, eventParam) => GoToInstance(this.Parent1Target); //No Child Panel this.NoChildsPanel = this.BubbleFamilyPanel.AddUIComponent<UIPanel>(); this.NoChildsPanel.name = "NoChildsPanel"; this.NoChildsPanel.width = this.BubbleFamilyPanel.width; this.NoChildsPanel.height = 52; this.NoChildsPanel.Hide (); //No Child button sprite this.NoChildsBSprite = this.NoChildsPanel.AddUIComponent<UIButton> (); this.NoChildsBSprite.name = "NoChildsBSprite"; this.NoChildsBSprite.normalBgSprite = "InfoIconHappinessDisabled"; this.NoChildsBSprite.width = 36; this.NoChildsBSprite.height = 36; this.NoChildsBSprite.relativePosition = new Vector3 (7, 5); //No Childs fake button this.NoChildsFButton = this.NoChildsPanel.AddUIComponent<UIButton> (); this.NoChildsFButton.name = "NoChildsFButton"; this.NoChildsFButton.width = 155; this.NoChildsFButton.height = this.NoChildsBSprite.height; this.NoChildsFButton.textVerticalAlignment = UIVerticalAlignment.Middle; this.NoChildsFButton.textHorizontalAlignment = UIHorizontalAlignment.Left; this.NoChildsFButton.playAudioEvents = false; this.NoChildsFButton.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.NoChildsFButton.font.size = 16; this.NoChildsFButton.textScale = 0.9f; this.NoChildsFButton.wordWrap = true; this.NoChildsFButton.useDropShadow = true; this.NoChildsFButton.dropShadowOffset = new Vector2 (1, -1); this.NoChildsFButton.dropShadowColor = new Color32 (0, 0, 0, 0); this.NoChildsFButton.textPadding.left = 5; this.NoChildsFButton.textPadding.right = 5; this.NoChildsFButton.isEnabled = false; this.NoChildsFButton.disabledTextColor = new Color32 (51, 51, 51, 160); //r,g,b,a this.NoChildsFButton.relativePosition = new Vector3 (this.NoChildsBSprite.relativePosition.x + this.NoChildsBSprite.width, this.NoChildsBSprite.relativePosition.y); //Parent 2 Panel this.FamilyMember2Panel = this.BubbleFamilyPanel.AddUIComponent<UIPanel>(); this.FamilyMember2Panel.name = "FamilyMember2Panel"; this.FamilyMember2Panel.width = this.BubbleFamilyPanel.width; this.FamilyMember2Panel.height = 52; this.FamilyMember2Panel.clipChildren = true; this.FamilyMember2Panel.padding = new RectOffset(0,0,0,0); this.FamilyMember2Panel.autoLayout = true; this.FamilyMember2Panel.autoLayoutDirection = LayoutDirection.Vertical; this.FamilyMember2Panel.relativePosition = new Vector3(0,0); this.FamilyMember2Panel.Hide (); //Family 2 Background bar this.BubbleFamilyMember2BgBar = this.FamilyMember2Panel.AddUIComponent<UITextureSprite> (); this.BubbleFamilyMember2BgBar.name = "BubbleFamilyMember2BgBar"; this.BubbleFamilyMember2BgBar.width = this.BubbleFamilyPanel.width; this.BubbleFamilyMember2BgBar.height = 26; this.BubbleFamilyMember2BgBar.texture = TextureDB.BubbleBgBar1; //Family 2 icon sprite this.BubbleFamilyMember2IconSprite = this.BubbleFamilyMember2BgBar.AddUIComponent<UITextureSprite> (); this.BubbleFamilyMember2IconSprite.name = "BubbleFamilyMember2IconSprite"; this.BubbleFamilyMember2IconSprite.width = 18; this.BubbleFamilyMember2IconSprite.height = 18; this.BubbleFamilyMember2IconSprite.texture = TextureDB.BubbleHeaderIconSpriteTextureMale; this.BubbleFamilyMember2IconSprite.relativePosition = new Vector3(7,4); //Family 2 name button this.BubbleFamilyMember2Name = this.BubbleFamilyMember2BgBar.AddUIComponent<UIButton> (); this.BubbleFamilyMember2Name.name = "BubbleFamilyMember2Name"; this.BubbleFamilyMember2Name.width = 135; this.BubbleFamilyMember2Name.height = this.BubbleFamilyMember2BgBar.height; this.BubbleFamilyMember2Name.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleFamilyMember2Name.textHorizontalAlignment = UIHorizontalAlignment.Left; this.BubbleFamilyMember2Name.playAudioEvents = true; this.BubbleFamilyMember2Name.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleFamilyMember2Name.font.size = 15; this.BubbleFamilyMember2Name.textScale = 0.80f; this.BubbleFamilyMember2Name.wordWrap = true; this.BubbleFamilyMember2Name.useDropShadow = true; this.BubbleFamilyMember2Name.dropShadowOffset = new Vector2 (1, -1); this.BubbleFamilyMember2Name.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubbleFamilyMember2Name.textPadding.left = 5; this.BubbleFamilyMember2Name.textPadding.right = 5; this.BubbleFamilyMember2Name.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a this.BubbleFamilyMember2Name.hoveredTextColor = new Color32 (204, 102, 0, 20); this.BubbleFamilyMember2Name.pressedTextColor = new Color32 (102, 153, 255, 147); this.BubbleFamilyMember2Name.focusedTextColor = new Color32 (153, 0, 0, 0); this.BubbleFamilyMember2Name.disabledTextColor = new Color32 (51, 51, 51, 160); //r,g,b,a this.BubbleFamilyMember2Name.relativePosition = new Vector3 (this.BubbleFamilyMember2IconSprite.relativePosition.x + this.BubbleFamilyMember2IconSprite.width+2, 2); this.BubbleFamilyMember2Name.eventMouseDown += (component, eventParam) => this.GoToCitizen(this.Parent2ID); //Family Member2 Real Age Button this.BubbleFamilyMember2AgeButton = this.BubbleFamilyMember2BgBar.AddUIComponent<UIButton> (); this.BubbleFamilyMember2AgeButton.name = "BubbleFamilyMember2AgeButton"; this.BubbleFamilyMember2AgeButton.width = 23; this.BubbleFamilyMember2AgeButton.height = 18; this.BubbleFamilyMember2AgeButton.textHorizontalAlignment = UIHorizontalAlignment.Center; this.BubbleFamilyMember2AgeButton.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleFamilyMember2AgeButton.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleFamilyMember2AgeButton.textScale = 0.90f; this.BubbleFamilyMember2AgeButton.font.size = 15; this.BubbleFamilyMember2AgeButton.dropShadowOffset = new Vector2 (1, -1); this.BubbleFamilyMember2AgeButton.dropShadowColor = new Color32 (0, 0, 0, 0); //this.BubbleFamilyMember2AgeButton.text = "99"; //Real Age test //this.BubbleFamilyMember2AgeButton.normalBgSprite = "GenericPanel"; this.BubbleFamilyMember2AgeButton.isInteractive = false; this.BubbleFamilyMember2AgeButton.relativePosition = new Vector3 (this.BubbleFamilyMember2Name.relativePosition.x + this.BubbleFamilyMember2Name.width + 6, 6); //Family 2 Follow Texture Sprite this.BubbleFamilyMember2FollowToggler = this.BubbleFamilyMember2BgBar.AddUIComponent<UIButton> (); this.BubbleFamilyMember2FollowToggler.name = "BubbleFamilyMember2FollowToggler"; this.BubbleFamilyMember2FollowToggler.atlas = m_atlas; this.BubbleFamilyMember2FollowToggler.size = new Vector2 (18, 18); this.BubbleFamilyMember2FollowToggler.playAudioEvents = true; this.BubbleFamilyMember2FollowToggler.relativePosition = new Vector3 (this.BubbleFamilyMember2AgeButton.relativePosition.x + this.BubbleFamilyMember2AgeButton.width + 12, 4); this.BubbleFamilyMember2FollowToggler.eventClick += (component, eventParam) => { FavCimsCore.AddToFavorites (this.Parent2ID); }; //Family 2 Activity background this.BubbleFamilyMember2ActivityBgBar = this.FamilyMember2Panel.AddUIComponent<UITextureSprite> (); this.BubbleFamilyMember2ActivityBgBar.name = "BubbleFamilyMember2ActivityBgBar"; this.BubbleFamilyMember2ActivityBgBar.width = this.BubbleFamilyPanel.width; this.BubbleFamilyMember2ActivityBgBar.height = 26; this.BubbleFamilyMember2ActivityBgBar.texture = TextureDB.BubbleBgBar2; //Family 2 Activity Vehicle Button this.BubbleFamilyMember2ActivityVehicleButton = this.BubbleFamilyMember2ActivityBgBar.AddUIComponent<UIButton> (); this.BubbleFamilyMember2ActivityVehicleButton.name = "BubbleFamilyMember2ActivityVehicleButton"; this.BubbleFamilyMember2ActivityVehicleButton.width = 22; this.BubbleFamilyMember2ActivityVehicleButton.height = 22; this.BubbleFamilyMember2ActivityVehicleButton.relativePosition = new Vector3 (7, 2); this.BubbleFamilyMember2ActivityVehicleButton.eventMouseDown += (component, eventParam) => GoToInstance(this.Parent2VehID); //Family 2 Activity Destination this.BubbleFamilyMember2ActivityDestination = this.BubbleFamilyMember2ActivityBgBar.AddUIComponent<UIButton> (); this.BubbleFamilyMember2ActivityDestination.name = "BubbleFamilyMember2ActivityDestination"; this.BubbleFamilyMember2ActivityDestination.width = this.BubbleFamilyMember2ActivityBgBar.width-this.BubbleFamilyMember2ActivityVehicleButton.width; this.BubbleFamilyMember2ActivityDestination.height = this.BubbleFamilyMember2ActivityBgBar.height; this.BubbleFamilyMember2ActivityDestination.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleFamilyMember2ActivityDestination.textHorizontalAlignment = UIHorizontalAlignment.Left; this.BubbleFamilyMember2ActivityDestination.playAudioEvents = true; this.BubbleFamilyMember2ActivityDestination.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleFamilyMember2ActivityDestination.font.size = 15; this.BubbleFamilyMember2ActivityDestination.textScale = 0.75f; this.BubbleFamilyMember2ActivityDestination.wordWrap = true; this.BubbleFamilyMember2ActivityDestination.textPadding.left = 0; this.BubbleFamilyMember2ActivityDestination.textPadding.right = 5; this.BubbleFamilyMember2ActivityDestination.outlineColor = new Color32 (0, 0, 0, 0); this.BubbleFamilyMember2ActivityDestination.outlineSize = 1; this.BubbleFamilyMember2ActivityDestination.textColor = new Color32 (21, 59, 96, 140); //r,g,b,a this.BubbleFamilyMember2ActivityDestination.hoveredTextColor = new Color32 (204, 102, 0, 20); this.BubbleFamilyMember2ActivityDestination.pressedTextColor = new Color32 (153, 0, 0, 0); this.BubbleFamilyMember2ActivityDestination.focusedTextColor = new Color32 (102, 153, 255, 147); this.BubbleFamilyMember2ActivityDestination.disabledTextColor = new Color32 (51, 51, 51, 160); //r,g,b,a this.BubbleFamilyMember2ActivityDestination.useDropShadow = true; this.BubbleFamilyMember2ActivityDestination.dropShadowOffset = new Vector2 (1, -1); this.BubbleFamilyMember2ActivityDestination.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubbleFamilyMember2ActivityDestination.maximumSize = new Vector2 (this.BubbleFamilyMember2ActivityDestination.width, this.BubbleFamilyMember2ActivityBgBar.height); this.BubbleFamilyMember2ActivityDestination.relativePosition = new Vector3 (this.BubblePartnerDestination.relativePosition.x, 2); this.BubbleFamilyMember2ActivityDestination.eventMouseDown += (component, eventParam) => GoToInstance(this.Parent2Target); //Parent 3 Panel this.FamilyMember3Panel = this.BubbleFamilyPanel.AddUIComponent<UIPanel>(); this.FamilyMember3Panel.name = "FamilyMember3Panel"; this.FamilyMember3Panel.width = this.BubbleFamilyPanel.width; this.FamilyMember3Panel.height = 52; this.FamilyMember3Panel.clipChildren = true; this.FamilyMember3Panel.padding = new RectOffset(0,0,0,0); this.FamilyMember3Panel.autoLayout = true; this.FamilyMember3Panel.autoLayoutDirection = LayoutDirection.Vertical; this.FamilyMember3Panel.relativePosition = new Vector3(0,0); this.FamilyMember3Panel.Hide (); //Family 3 Background bar this.BubbleFamilyMember3BgBar = this.FamilyMember3Panel.AddUIComponent<UITextureSprite> (); this.BubbleFamilyMember3BgBar.name = "BubbleFamilyMember3BgBar"; this.BubbleFamilyMember3BgBar.width = this.BubbleFamilyPanel.width; this.BubbleFamilyMember3BgBar.height = 26; this.BubbleFamilyMember3BgBar.texture = TextureDB.BubbleBgBar1; //Family 3 icon sprite this.BubbleFamilyMember3IconSprite = this.BubbleFamilyMember3BgBar.AddUIComponent<UITextureSprite> (); this.BubbleFamilyMember3IconSprite.name = "BubbleFamilyMember3IconSprite"; this.BubbleFamilyMember3IconSprite.width = 18; this.BubbleFamilyMember3IconSprite.height = 18; this.BubbleFamilyMember3IconSprite.texture = TextureDB.BubbleHeaderIconSpriteTextureMale; this.BubbleFamilyMember3IconSprite.relativePosition = new Vector3(7,4); //Family 3 name button this.BubbleFamilyMember3Name = this.BubbleFamilyMember3BgBar.AddUIComponent<UIButton> (); this.BubbleFamilyMember3Name.name = "BubbleFamilyMember3Name"; this.BubbleFamilyMember3Name.width = 135; this.BubbleFamilyMember3Name.height = this.BubbleFamilyMember3BgBar.height; this.BubbleFamilyMember3Name.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleFamilyMember3Name.textHorizontalAlignment = UIHorizontalAlignment.Left; this.BubbleFamilyMember3Name.playAudioEvents = true; this.BubbleFamilyMember3Name.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleFamilyMember3Name.font.size = 15; this.BubbleFamilyMember3Name.textScale = 0.80f; this.BubbleFamilyMember3Name.wordWrap = true; this.BubbleFamilyMember3Name.useDropShadow = true; this.BubbleFamilyMember3Name.dropShadowOffset = new Vector2 (1, -1); this.BubbleFamilyMember3Name.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubbleFamilyMember3Name.textPadding.left = 5; this.BubbleFamilyMember3Name.textPadding.right = 5; this.BubbleFamilyMember3Name.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a this.BubbleFamilyMember3Name.hoveredTextColor = new Color32 (204, 102, 0, 20); this.BubbleFamilyMember3Name.pressedTextColor = new Color32 (102, 153, 255, 147); this.BubbleFamilyMember3Name.focusedTextColor = new Color32 (153, 0, 0, 0); this.BubbleFamilyMember3Name.disabledTextColor = new Color32 (51, 51, 51, 160); //r,g,b,a this.BubbleFamilyMember3Name.relativePosition = new Vector3 (this.BubbleFamilyMember3IconSprite.relativePosition.x + this.BubbleFamilyMember3IconSprite.width+2, 2); this.BubbleFamilyMember3Name.eventMouseDown += (component, eventParam) => this.GoToCitizen(this.Parent3ID); //Family Member3 Real Age Button this.BubbleFamilyMember3AgeButton = this.BubbleFamilyMember3BgBar.AddUIComponent<UIButton> (); this.BubbleFamilyMember3AgeButton.name = "BubbleFamilyMember3AgeButton"; this.BubbleFamilyMember3AgeButton.width = 23; this.BubbleFamilyMember3AgeButton.height = 18; this.BubbleFamilyMember3AgeButton.textHorizontalAlignment = UIHorizontalAlignment.Center; this.BubbleFamilyMember3AgeButton.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleFamilyMember3AgeButton.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleFamilyMember3AgeButton.textScale = 0.90f; this.BubbleFamilyMember3AgeButton.font.size = 15; this.BubbleFamilyMember3AgeButton.dropShadowOffset = new Vector2 (1, -1); this.BubbleFamilyMember3AgeButton.dropShadowColor = new Color32 (0, 0, 0, 0); //this.BubbleFamilyMember3AgeButton.text = "99"; //Real Age test //this.BubbleFamilyMember3AgeButton.normalBgSprite = "GenericPanel"; this.BubbleFamilyMember3AgeButton.isInteractive = false; this.BubbleFamilyMember3AgeButton.relativePosition = new Vector3 (this.BubbleFamilyMember3Name.relativePosition.x + this.BubbleFamilyMember3Name.width + 6, 6); //Family 3 Follow Texture Sprite this.BubbleFamilyMember3FollowToggler = this.BubbleFamilyMember3BgBar.AddUIComponent<UIButton> (); this.BubbleFamilyMember3FollowToggler.name = "BubbleFamilyMember3FollowToggler"; this.BubbleFamilyMember3FollowToggler.atlas = m_atlas; this.BubbleFamilyMember3FollowToggler.size = new Vector2 (18, 18); this.BubbleFamilyMember3FollowToggler.playAudioEvents = true; this.BubbleFamilyMember3FollowToggler.relativePosition = new Vector3 (this.BubbleFamilyMember3AgeButton.relativePosition.x + this.BubbleFamilyMember3AgeButton.width + 12, 4); this.BubbleFamilyMember3FollowToggler.eventClick += (component, eventParam) => { FavCimsCore.AddToFavorites (this.Parent3ID); }; //Family 3 Activity background this.BubbleFamilyMember3ActivityBgBar = this.FamilyMember3Panel.AddUIComponent<UITextureSprite> (); this.BubbleFamilyMember3ActivityBgBar.name = "BubbleFamilyMember3ActivityBgBar"; this.BubbleFamilyMember3ActivityBgBar.width = this.BubbleFamilyPanel.width; this.BubbleFamilyMember3ActivityBgBar.height = 26; this.BubbleFamilyMember3ActivityBgBar.texture = TextureDB.BubbleBgBar2; //Family 3 Activity Vehicle Button this.BubbleFamilyMember3ActivityVehicleButton = this.BubbleFamilyMember3ActivityBgBar.AddUIComponent<UIButton> (); this.BubbleFamilyMember3ActivityVehicleButton.name = "BubbleFamilyMember3ActivityVehicleButton"; this.BubbleFamilyMember3ActivityVehicleButton.width = 22; this.BubbleFamilyMember3ActivityVehicleButton.height = 22; this.BubbleFamilyMember3ActivityVehicleButton.relativePosition = new Vector3 (7, 2); this.BubbleFamilyMember3ActivityVehicleButton.eventMouseDown += (component, eventParam) => GoToInstance(this.Parent3VehID); //Family 3 Activity Destination this.BubbleFamilyMember3ActivityDestination = this.BubbleFamilyMember3ActivityBgBar.AddUIComponent<UIButton> (); this.BubbleFamilyMember3ActivityDestination.name = "BubbleFamilyMember3ActivityDestination"; this.BubbleFamilyMember3ActivityDestination.width = this.BubbleFamilyMember3ActivityBgBar.width-this.BubbleFamilyMember3ActivityVehicleButton.width; this.BubbleFamilyMember3ActivityDestination.height = this.BubbleFamilyMember3ActivityBgBar.height; this.BubbleFamilyMember3ActivityDestination.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleFamilyMember3ActivityDestination.textHorizontalAlignment = UIHorizontalAlignment.Left; this.BubbleFamilyMember3ActivityDestination.playAudioEvents = true; this.BubbleFamilyMember3ActivityDestination.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleFamilyMember3ActivityDestination.font.size = 15; this.BubbleFamilyMember3ActivityDestination.textScale = 0.75f; this.BubbleFamilyMember3ActivityDestination.wordWrap = true; this.BubbleFamilyMember3ActivityDestination.textPadding.left = 0; this.BubbleFamilyMember3ActivityDestination.textPadding.right = 5; this.BubbleFamilyMember3ActivityDestination.outlineColor = new Color32 (0, 0, 0, 0); this.BubbleFamilyMember3ActivityDestination.outlineSize = 1; this.BubbleFamilyMember3ActivityDestination.textColor = new Color32 (21, 59, 96, 140); //r,g,b,a this.BubbleFamilyMember3ActivityDestination.hoveredTextColor = new Color32 (204, 102, 0, 20); this.BubbleFamilyMember3ActivityDestination.pressedTextColor = new Color32 (153, 0, 0, 0); this.BubbleFamilyMember3ActivityDestination.focusedTextColor = new Color32 (102, 153, 255, 147); this.BubbleFamilyMember3ActivityDestination.disabledTextColor = new Color32 (51, 51, 51, 160); //r,g,b,a this.BubbleFamilyMember3ActivityDestination.useDropShadow = true; this.BubbleFamilyMember3ActivityDestination.dropShadowOffset = new Vector2 (1, -1); this.BubbleFamilyMember3ActivityDestination.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubbleFamilyMember3ActivityDestination.maximumSize = new Vector2 (this.BubbleFamilyMember3ActivityDestination.width, this.BubbleFamilyMember3ActivityBgBar.height); this.BubbleFamilyMember3ActivityDestination.relativePosition = new Vector3 (this.BubblePartnerDestination.relativePosition.x, 2); this.BubbleFamilyMember3ActivityDestination.eventMouseDown += (component, eventParam) => GoToInstance(this.Parent3Target); //Parent 4 Panel this.FamilyMember4Panel = this.BubbleFamilyPanel.AddUIComponent<UIPanel>(); this.FamilyMember4Panel.name = "FamilyMember4Panel"; this.FamilyMember4Panel.width = this.BubbleFamilyPanel.width; this.FamilyMember4Panel.height = 52; this.FamilyMember4Panel.clipChildren = true; this.FamilyMember4Panel.padding = new RectOffset(0,0,0,0); this.FamilyMember4Panel.autoLayout = true; this.FamilyMember4Panel.autoLayoutDirection = LayoutDirection.Vertical; this.FamilyMember4Panel.relativePosition = new Vector3(0,0); this.FamilyMember4Panel.Hide (); //Family 4 Background bar this.BubbleFamilyMember4BgBar = this.FamilyMember4Panel.AddUIComponent<UITextureSprite> (); this.BubbleFamilyMember4BgBar.name = "BubbleFamilyMember4BgBar"; this.BubbleFamilyMember4BgBar.width = this.BubbleFamilyPanel.width; this.BubbleFamilyMember4BgBar.height = 26; this.BubbleFamilyMember4BgBar.texture = TextureDB.BubbleBgBar1; //Family 4 icon sprite this.BubbleFamilyMember4IconSprite = this.BubbleFamilyMember4BgBar.AddUIComponent<UITextureSprite> (); this.BubbleFamilyMember4IconSprite.name = "BubbleFamilyMember4IconSprite"; this.BubbleFamilyMember4IconSprite.width = 18; this.BubbleFamilyMember4IconSprite.height = 18; this.BubbleFamilyMember4IconSprite.texture = TextureDB.BubbleHeaderIconSpriteTextureMale; this.BubbleFamilyMember4IconSprite.relativePosition = new Vector3(7,4); //Family 4 name button this.BubbleFamilyMember4Name = this.BubbleFamilyMember4BgBar.AddUIComponent<UIButton> (); this.BubbleFamilyMember4Name.name = "BubbleFamilyMember4Name"; this.BubbleFamilyMember4Name.width = 135; this.BubbleFamilyMember4Name.height = this.BubbleFamilyMember4BgBar.height; this.BubbleFamilyMember4Name.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleFamilyMember4Name.textHorizontalAlignment = UIHorizontalAlignment.Left; this.BubbleFamilyMember4Name.playAudioEvents = true; this.BubbleFamilyMember4Name.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleFamilyMember4Name.font.size = 15; this.BubbleFamilyMember4Name.textScale = 0.80f; this.BubbleFamilyMember4Name.wordWrap = true; this.BubbleFamilyMember4Name.useDropShadow = true; this.BubbleFamilyMember4Name.dropShadowOffset = new Vector2 (1, -1); this.BubbleFamilyMember4Name.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubbleFamilyMember4Name.textPadding.left = 5; this.BubbleFamilyMember4Name.textPadding.right = 5; this.BubbleFamilyMember4Name.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a this.BubbleFamilyMember4Name.hoveredTextColor = new Color32 (204, 102, 0, 20); this.BubbleFamilyMember4Name.pressedTextColor = new Color32 (102, 153, 255, 147); this.BubbleFamilyMember4Name.focusedTextColor = new Color32 (153, 0, 0, 0); this.BubbleFamilyMember4Name.disabledTextColor = new Color32 (51, 51, 51, 160); //r,g,b,a this.BubbleFamilyMember4Name.relativePosition = new Vector3 (this.BubbleFamilyMember4IconSprite.relativePosition.x + this.BubbleFamilyMember4IconSprite.width+2, 2); this.BubbleFamilyMember4Name.eventMouseDown += (component, eventParam) => this.GoToCitizen(this.Parent4ID); //Family Member4 Real Age Button this.BubbleFamilyMember4AgeButton = this.BubbleFamilyMember4BgBar.AddUIComponent<UIButton> (); this.BubbleFamilyMember4AgeButton.name = "BubbleFamilyMember4AgeButton"; this.BubbleFamilyMember4AgeButton.width = 23; this.BubbleFamilyMember4AgeButton.height = 18; this.BubbleFamilyMember4AgeButton.textHorizontalAlignment = UIHorizontalAlignment.Center; this.BubbleFamilyMember4AgeButton.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleFamilyMember4AgeButton.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleFamilyMember4AgeButton.textScale = 0.90f; this.BubbleFamilyMember4AgeButton.font.size = 15; this.BubbleFamilyMember4AgeButton.dropShadowOffset = new Vector2 (1, -1); this.BubbleFamilyMember4AgeButton.dropShadowColor = new Color32 (0, 0, 0, 0); //this.BubbleFamilyMember4AgeButton.text = "99"; //Real Age test //this.BubbleFamilyMember4AgeButton.normalBgSprite = "GenericPanel"; this.BubbleFamilyMember4AgeButton.isInteractive = false; this.BubbleFamilyMember4AgeButton.relativePosition = new Vector3 (this.BubbleFamilyMember4Name.relativePosition.x + this.BubbleFamilyMember4Name.width + 6, 6); //Family 4 Follow Texture Sprite this.BubbleFamilyMember4FollowToggler = this.BubbleFamilyMember4BgBar.AddUIComponent<UIButton> (); this.BubbleFamilyMember4FollowToggler.name = "BubbleFamilyMember4FollowToggler"; this.BubbleFamilyMember4FollowToggler.atlas = m_atlas; this.BubbleFamilyMember4FollowToggler.width = 18; this.BubbleFamilyMember4FollowToggler.height = 18; this.BubbleFamilyMember4FollowToggler.playAudioEvents = true; this.BubbleFamilyMember4FollowToggler.relativePosition = new Vector3 (this.BubbleFamilyMember4AgeButton.relativePosition.x + this.BubbleFamilyMember4AgeButton.width + 12, 4); this.BubbleFamilyMember4FollowToggler.eventClick += (component, eventParam) => { FavCimsCore.AddToFavorites (this.Parent4ID); }; //Family 4 Activity background this.BubbleFamilyMember4ActivityBgBar = this.FamilyMember4Panel.AddUIComponent<UITextureSprite> (); this.BubbleFamilyMember4ActivityBgBar.name = "BubbleFamilyMember4ActivityBgBar"; this.BubbleFamilyMember4ActivityBgBar.width = this.BubbleFamilyPanel.width; this.BubbleFamilyMember4ActivityBgBar.height = 26; this.BubbleFamilyMember4ActivityBgBar.texture = TextureDB.BubbleBgBar2; //Family 4 Activity Vehicle Button this.BubbleFamilyMember4ActivityVehicleButton = this.BubbleFamilyMember4ActivityBgBar.AddUIComponent<UIButton> (); this.BubbleFamilyMember4ActivityVehicleButton.name = "BubbleFamilyMember4ActivityVehicleButton"; this.BubbleFamilyMember4ActivityVehicleButton.width = 22; this.BubbleFamilyMember4ActivityVehicleButton.height = 22; this.BubbleFamilyMember4ActivityVehicleButton.relativePosition = new Vector3 (7, 2); this.BubbleFamilyMember4ActivityVehicleButton.eventMouseDown += (component, eventParam) => GoToInstance(this.Parent4VehID); //Family 4 Activity Destination this.BubbleFamilyMember4ActivityDestination = this.BubbleFamilyMember4ActivityBgBar.AddUIComponent<UIButton> (); this.BubbleFamilyMember4ActivityDestination.name = "BubbleFamilyMember4ActivityDestination"; this.BubbleFamilyMember4ActivityDestination.width = this.BubbleFamilyMember4ActivityBgBar.width-this.BubbleFamilyMember4ActivityVehicleButton.width; this.BubbleFamilyMember4ActivityDestination.height = this.BubbleFamilyMember4ActivityBgBar.height; this.BubbleFamilyMember4ActivityDestination.textVerticalAlignment = UIVerticalAlignment.Middle; this.BubbleFamilyMember4ActivityDestination.textHorizontalAlignment = UIHorizontalAlignment.Left; this.BubbleFamilyMember4ActivityDestination.playAudioEvents = true; this.BubbleFamilyMember4ActivityDestination.font = UIDynamicFont.FindByName ("OpenSans-Regular"); this.BubbleFamilyMember4ActivityDestination.font.size = 15; this.BubbleFamilyMember4ActivityDestination.textScale = 0.75f; this.BubbleFamilyMember4ActivityDestination.wordWrap = true; this.BubbleFamilyMember4ActivityDestination.textPadding.left = 0; this.BubbleFamilyMember4ActivityDestination.textPadding.right = 5; this.BubbleFamilyMember4ActivityDestination.outlineColor = new Color32 (0, 0, 0, 0); this.BubbleFamilyMember4ActivityDestination.outlineSize = 1; this.BubbleFamilyMember4ActivityDestination.textColor = new Color32 (21, 59, 96, 140); //r,g,b,a this.BubbleFamilyMember4ActivityDestination.hoveredTextColor = new Color32 (204, 102, 0, 20); this.BubbleFamilyMember4ActivityDestination.pressedTextColor = new Color32 (153, 0, 0, 0); this.BubbleFamilyMember4ActivityDestination.focusedTextColor = new Color32 (102, 153, 255, 147); this.BubbleFamilyMember4ActivityDestination.disabledTextColor = new Color32 (51, 51, 51, 160); //r,g,b,a this.BubbleFamilyMember4ActivityDestination.useDropShadow = true; this.BubbleFamilyMember4ActivityDestination.dropShadowOffset = new Vector2 (1, -1); this.BubbleFamilyMember4ActivityDestination.dropShadowColor = new Color32 (0, 0, 0, 0); this.BubbleFamilyMember4ActivityDestination.maximumSize = new Vector2 (this.BubbleFamilyMember4ActivityDestination.width, this.BubbleFamilyMember4ActivityBgBar.height); this.BubbleFamilyMember4ActivityDestination.relativePosition = new Vector3 (this.BubblePartnerDestination.relativePosition.x, 2); this.BubbleFamilyMember4ActivityDestination.eventMouseDown += (component, eventParam) => GoToInstance(this.Parent4Target); this.absolutePosition = new Vector3 ((float)rnd.Next (RandXMin, RandXMax), (float)rnd.Next (RandYMin, RandYMax)); //this.absolutePosition = new Vector3 (FavCimsMainClass.FavCimsPanel.absolutePosition.x - this.width - 15, (FavCimsMainClass.FavCimsPanel.absolutePosition.y / 2) - (this.height / 2));//(MouseClickPos.y - Screen.height)*-1); //this.BringToFront (); ///////////////End Bubble/////////////// }
//public void ButtonEnabler(UITextureSprite sPrite) { //if (sPrite == FavCimsCBMenuSprite) { //FavCimsCBMenuSprite.texture = FavCimsCBETexture; //FavCimsBBMenuSprite.texture = FavCimsBBDTexture; //FavCimsSBMenuSprite.texture = FavCimsSBDTexture; //} else if (sPrite == FavCimsBBMenuSprite) { //FavCimsCBMenuSprite.texture = FavCimsCBDTexture; //FavCimsBBMenuSprite.texture = FavCimsBBETexture; //FavCimsSBMenuSprite.texture = FavCimsSBDTexture; //} else if (sPrite == FavCimsSBMenuSprite) { //FavCimsCBMenuSprite.texture = FavCimsCBDTexture; //FavCimsBBMenuSprite.texture = FavCimsBBDTexture; //FavCimsSBMenuSprite.texture = FavCimsSBETexture; //} //return; //} public override void Start() { var uiView = UIView.GetAView(); this.name = "FavCimsPanel"; this.width = 1200; this.height = 700; this.opacity = 0.95f; this.eventVisibilityChanged += (component, value) => change_visibility_event(); //Main Panel BG Texture Texture FavCimsMainBGTexture = ResourceLoader.loadTexture((int)this.width, (int)this.height, "UIMainPanel.mainbg.png"); FavCimsMainBGTexture.wrapMode = TextureWrapMode.Clamp; FavCimsMainBGTexture.filterMode = FilterMode.Bilinear; //FavCimsMainBGTexture.anisoLevel = 9; Set 1 Bad to 9 Very God FavCimsMainBGTexture.name = "FavCimsMainBGTexture"; UITextureSprite FavCimsMainBGSprite; FavCimsMainBGSprite = this.AddUIComponent <UITextureSprite> (); FavCimsMainBGSprite.name = "FavCimsMainBGSprite"; FavCimsMainBGSprite.texture = FavCimsMainBGTexture; FavCimsMainBGSprite.relativePosition = new Vector3(0, 0); FavCimsMainBGSprite.eventMouseDown += delegate { if (Input.GetMouseButton(0)) { if (this.GetComponentInChildren <WindowController> () != null) { this.PanelMover = this.GetComponentInChildren <WindowController> (); this.PanelMover.ComponentToMove = this; this.PanelMover.Stop = false; this.PanelMover.Start(); } else { this.PanelMover = this.AddUIComponent(typeof(WindowController)) as WindowController; this.PanelMover.ComponentToMove = this; } this.opacity = 0.5f; } }; FavCimsMainBGSprite.eventMouseUp += delegate { if (this.PanelMover != null) { this.PanelMover.Stop = true; this.PanelMover.ComponentToMove = null; this.PanelMover = null; } this.opacity = 1f; }; //Main Panel Title Texture Texture FavCimsTitleTexture; FavCimsTitleTexture = ResourceLoader.loadTexture((int)this.width, 58, "UIMainPanel.favcimstitle.png"); FavCimsTitleTexture.wrapMode = TextureWrapMode.Clamp; FavCimsTitleTexture.filterMode = FilterMode.Bilinear; FavCimsTitleTexture.mipMapBias = -0.5f; //FavCimsTitleTexture.anisoLevel = 9; // Set 1 Bad to 9 Very God FavCimsTitleTexture.name = "FavCimsTitleTexture"; FavCimsTitleSprite = FavCimsMainBGSprite.AddUIComponent <UITextureSprite> (); FavCimsTitleSprite.name = "FavCimsTitleSprite"; FavCimsTitleSprite.texture = FavCimsTitleTexture; float FavCimsTitleSpriteRelPosX = ((this.width / 2) - (float)FavCimsTitleTexture.width / 2); FavCimsTitleSprite.relativePosition = new Vector3(FavCimsTitleSpriteRelPosX, 0); /////////////////////////////////////////////// //Game Default Close Button ////////////////////////////////////////////// UIButton FavCimsMenuCloseButton = this.AddUIComponent <UIButton> (); FavCimsMenuCloseButton.name = "FavCimsMenuCloseButton"; FavCimsMenuCloseButton.width = 32; FavCimsMenuCloseButton.height = 32; FavCimsMenuCloseButton.normalBgSprite = "buttonclose"; FavCimsMenuCloseButton.hoveredBgSprite = "buttonclosehover"; FavCimsMenuCloseButton.pressedBgSprite = "buttonclosepressed"; FavCimsMenuCloseButton.opacity = 1; FavCimsMenuCloseButton.useOutline = true; FavCimsMenuCloseButton.playAudioEvents = true; FavCimsMenuCloseButton.eventClick += (component, eventParam) => FavoritesCimsButton.FavCimsPanelToggle(); //Printing FavCimsMenuCloseButton.relativePosition = new Vector3(this.width - (FavCimsMenuCloseButton.width * 1.5f), ((float)FavCimsTitleTexture.height / 2) - FavCimsMenuCloseButton.height / 2); /////////////////////////////////////////////// //Main Panel Menu Background Texture /////////////////////////////////////////////// Texture FavCimsBGMenuTexture; FavCimsBGMenuTexture = ResourceLoader.loadTexture((int)this.width - 10, 70, "UIMainPanel.submenubar.png"); FavCimsBGMenuTexture.wrapMode = TextureWrapMode.Clamp; FavCimsBGMenuTexture.filterMode = FilterMode.Bilinear; FavCimsBGMenuTexture.name = "FavCimsBGMenuTexture"; UITextureSprite FavCimsBGMenuSprite = FavCimsMainBGSprite.AddUIComponent <UITextureSprite> (); FavCimsBGMenuSprite.name = "FavCimsBGMenuSprite"; FavCimsBGMenuSprite.texture = FavCimsBGMenuTexture; float FavCimsBGMenuSpriteRelPosX = ((this.width / 2) - (float)FavCimsBGMenuTexture.width / 2); FavCimsBGMenuSprite.relativePosition = new Vector3(FavCimsBGMenuSpriteRelPosX, 58); //Citizen Button Texture (Enabled & Disabled) FavCimsCBETexture = ResourceLoader.loadTexture(200, 59, "UIMainPanel.citizenbuttonenabled.png"); FavCimsCBDTexture = ResourceLoader.loadTexture(200, 59, "UIMainPanel.citizenbuttondisabled.png"); FavCimsCBETexture.wrapMode = TextureWrapMode.Clamp; FavCimsCBETexture.filterMode = FilterMode.Bilinear; FavCimsCBETexture.name = "FavCimsCBETexture"; FavCimsCBETexture.mipMapBias = -0.5f; FavCimsCBDTexture.wrapMode = TextureWrapMode.Clamp; FavCimsCBDTexture.filterMode = FilterMode.Bilinear; FavCimsCBDTexture.name = "FavCimsCBDTexture"; FavCimsCBDTexture.mipMapBias = -0.5f; FavCimsCBMenuSprite = FavCimsMainBGSprite.AddUIComponent <UITextureSprite> (); FavCimsCBMenuSprite.name = "FavCimsBGMenuSprite"; FavCimsCBMenuSprite.texture = FavCimsCBETexture; //Citizens Transparent Button (For Easy Text Change) FavCimsBCMenuButton = this.AddUIComponent <UIButton> (); FavCimsBCMenuButton.name = "FavCimsBCMenuButton"; FavCimsBCMenuButton.width = FavCimsCBMenuSprite.width; FavCimsBCMenuButton.height = FavCimsCBMenuSprite.height; FavCimsBCMenuButton.useOutline = true; FavCimsBCMenuButton.playAudioEvents = true; FavCimsBCMenuButton.font = UIDynamicFont.FindByName("OpenSans-Regular"); FavCimsBCMenuButton.textScale = 1.8f; FavCimsBCMenuButton.textColor = new Color32(204, 204, 51, 40); //r,g,b,a FavCimsBCMenuButton.hoveredTextColor = new Color32(204, 102, 0, 20); FavCimsBCMenuButton.pressedTextColor = new Color32(153, 0, 0, 0); FavCimsBCMenuButton.focusedTextColor = new Color32(102, 153, 255, 147); FavCimsBCMenuButton.textPadding.left = 15; FavCimsBCMenuButton.useDropShadow = true; FavCimsBCMenuButton.tooltipBox = uiView.defaultTooltipBox; //Printing FavCimsCBMenuSprite.relativePosition = new Vector3(27, 69); FavCimsBCMenuButton.relativePosition = new Vector3(27, 69); /////////////////////////////////////////////// //Buildings Button Texture (Enabled & Disabled) ////////////////////////////////////////////// /* * FavCimsBBETexture = ResourceLoader.loadTexture (200, 59, "UIMainPanel.buildingsbuttonenabled.png"); * FavCimsBBDTexture = ResourceLoader.loadTexture (200, 59, "UIMainPanel.buildingsbuttondisabled.png"); * * FavCimsBBETexture.wrapMode = TextureWrapMode.Clamp; * FavCimsBBETexture.filterMode = FilterMode.Bilinear; * FavCimsBBETexture.name = "FavCimsBBETexture"; * FavCimsBBETexture.mipMapBias = -0.5f; * FavCimsBBDTexture.wrapMode = TextureWrapMode.Clamp; * FavCimsBBDTexture.filterMode = FilterMode.Bilinear; * FavCimsBBDTexture.name = "FavCimsBBETexture"; * FavCimsBBDTexture.mipMapBias = -0.5f; * FavCimsBBMenuSprite = FavCimsMainBGSprite.AddUIComponent<UITextureSprite> (); * FavCimsBBMenuSprite.name = "FavCimsBBMenuSprite"; * FavCimsBBMenuSprite.texture = FavCimsBBDTexture; * * //Buildings Transparent Button (For Easy Text Change) * FavCimsBBMenuButton = this.AddUIComponent<UIButton> (); * FavCimsBBMenuButton.name = "FavCimsBBMenuButton"; * FavCimsBBMenuButton.width = FavCimsBBETexture.width; * FavCimsBBMenuButton.height = FavCimsBBETexture.height; * FavCimsBBMenuButton.useOutline = true; * FavCimsBBMenuButton.playAudioEvents = true; * FavCimsBBMenuButton.font = UIDynamicFont.FindByName ("OpenSans-Regular"); * FavCimsBBMenuButton.textScale = 1.8f; * FavCimsBBMenuButton.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a * FavCimsBBMenuButton.hoveredTextColor = new Color32 (204, 102, 0, 20); * FavCimsBBMenuButton.pressedTextColor = new Color32 (153, 0, 0, 0); * FavCimsBBMenuButton.focusedTextColor = new Color32 (102, 153, 255, 147); * FavCimsBBMenuButton.textPadding.left = 20; * FavCimsBBMenuButton.useDropShadow = true; * FavCimsBBMenuButton.tooltipBox = uiView.defaultTooltipBox; * * //Printing * //FavCimsBBMenuSprite.relativePosition = new Vector3 (FavCimsCBMenuSprite.position.x + FavCimsBBMenuSprite.width + 21, 69); //html => margin-left:21px; * //FavCimsBBMenuButton.relativePosition = new Vector3 (FavCimsBCMenuButton.position.x + FavCimsBBMenuButton.width + 35, 69); * * /////////////////////////////////////////////// * //Stats Button Texture (Enabled & Disabled) * ////////////////////////////////////////////// * * FavCimsSBETexture = ResourceLoader.loadTexture (200, 59, "UIMainPanel.statsbuttonenabled.png"); * FavCimsSBDTexture = ResourceLoader.loadTexture (200, 59, "UIMainPanel.statsbuttondisabled.png"); * * FavCimsSBETexture.wrapMode = TextureWrapMode.Clamp; * FavCimsSBETexture.filterMode = FilterMode.Bilinear; * FavCimsSBETexture.name = "FavCimsSBETexture"; * FavCimsSBETexture.mipMapBias = -0.5f; * FavCimsSBDTexture.wrapMode = TextureWrapMode.Clamp; * FavCimsSBDTexture.filterMode = FilterMode.Bilinear; * FavCimsSBDTexture.name = "FavCimsSBETexture"; * FavCimsSBDTexture.mipMapBias = -0.5f; * FavCimsSBMenuSprite = FavCimsMainBGSprite.AddUIComponent<UITextureSprite> (); * FavCimsSBMenuSprite.name = "FavCimsSBMenuSprite"; * FavCimsSBMenuSprite.texture = FavCimsSBDTexture; * * //Stats Transparent Button (For Easy Text Change) * FavCimsBSMenuButton = this.AddUIComponent<UIButton> (); * FavCimsBSMenuButton.name = "FavCimsBSMenuButton"; * FavCimsBSMenuButton.width = FavCimsSBETexture.width; * FavCimsBSMenuButton.height = FavCimsSBETexture.height; * FavCimsBSMenuButton.useOutline = true; * FavCimsBSMenuButton.playAudioEvents = true; * FavCimsBSMenuButton.font = UIDynamicFont.FindByName ("OpenSans-Regular"); * FavCimsBSMenuButton.textScale = 1.8f; * FavCimsBSMenuButton.textColor = new Color32 (204, 204, 51, 40); //r,g,b,a * FavCimsBSMenuButton.hoveredTextColor = new Color32 (204, 102, 0, 20); * FavCimsBSMenuButton.pressedTextColor = new Color32 (153, 0, 0, 0); * FavCimsBSMenuButton.focusedTextColor = new Color32 (102, 153, 255, 147); * FavCimsBSMenuButton.textPadding.left = 0; * FavCimsBSMenuButton.useDropShadow = true; * FavCimsBSMenuButton.tooltipBox = uiView.defaultTooltipBox; * * //Printing * //FavCimsSBMenuSprite.relativePosition = new Vector3 (FavCimsBBMenuSprite.position.x + FavCimsSBMenuSprite.width + 21, 69); //html => margin-left:21px; * //FavCimsBSMenuButton.relativePosition = new Vector3 (FavCimsBBMenuButton.position.x + FavCimsBSMenuButton.width + 21, 69); //html => margin-left:21px; * * /////////////////////////////////////////////// * //Click Operation for Main Buttons * ////////////////////////////////////////////// * * //FavCimsBCMenuButton.eventClick += (component, eventParam) => ButtonEnabler (FavCimsCBMenuSprite); * //FavCimsBBMenuButton.eventClick += (component, eventParam) => ButtonEnabler (FavCimsBBMenuSprite); * //FavCimsBSMenuButton.eventClick += (component, eventParam) => ButtonEnabler (FavCimsSBMenuSprite); */ /////////////////////////////////////////////// //Citizens Panel ////////////////////////////////////////////// CitizensPanel = this.AddUIComponent <UIPanel> (); CitizensPanel.name = "CitizensPanel"; CitizensPanel.width = 1190; CitizensPanel.height = 558; CitizensPanel.relativePosition = new Vector3(((this.width / 2) - (float)CitizensPanel.width / 2), 128); /////////////////////////////////////////////// //Citizens Panel Body Background ////////////////////////////////////////////// FavCimsMainBodyTexture = ResourceLoader.loadTexture(1190, 558, "UIMainPanel.bodybg.png"); FavCimsMainBodyTexture.wrapMode = TextureWrapMode.Clamp; FavCimsMainBodyTexture.filterMode = FilterMode.Bilinear; FavCimsMainBodyTexture.name = "FavCimsMainBodyTexture"; FavCimsBodySprite = CitizensPanel.AddUIComponent <UITextureSprite> (); FavCimsBodySprite.name = "FavCimsCBGBodySprite"; FavCimsBodySprite.texture = FavCimsMainBodyTexture; //Printing FavCimsBodySprite.relativePosition = Vector3.zero; /////////////////////////////////////////////// //Index Column Background ////////////////////////////////////////////// Texture FavCimsIndexBgBar = ResourceLoader.loadTexture(1146, 26, "UIMainPanel.indexerbgbar.png"); FavCimsIndexBgBar.wrapMode = TextureWrapMode.Clamp; FavCimsIndexBgBar.filterMode = FilterMode.Bilinear; FavCimsIndexBgBar.name = "FavCimsIndexBgBar"; FavCimsIndexBgBar.mipMapBias = -0.5f; UITextureSprite FavCimsIndexBgBarSprite = CitizensPanel.AddUIComponent <UITextureSprite> (); FavCimsIndexBgBarSprite.name = "FavCimsIndexBgBarSprite"; FavCimsIndexBgBarSprite.texture = FavCimsIndexBgBar; //Printing FavCimsIndexBgBarSprite.relativePosition = new Vector3(21, 7); //////////////////////////////////////////////// //Index Columns (Button for future sort order...) //////////////////////////////////////////////// //Status FavCimsHappinesColText = CitizensPanel.AddUIComponent <UIButton> (); FavCimsHappinesColText.name = "FavCimsHappinesColText"; FavCimsHappinesColText.width = 60; FavCimsHappinesColText.height = FavCimsIndexBgBar.height; FavCimsHappinesColText.textVerticalAlignment = UIVerticalAlignment.Middle; FavCimsHappinesColText.textHorizontalAlignment = UIHorizontalAlignment.Center; FavCimsHappinesColText.playAudioEvents = true; FavCimsHappinesColText.font = UIDynamicFont.FindByName("OpenSans-Regular"); FavCimsHappinesColText.textScale = 0.7f; FavCimsHappinesColText.textColor = new Color32(204, 204, 51, 40); //r,g,b,a FavCimsHappinesColText.hoveredTextColor = new Color32(204, 102, 0, 20); FavCimsHappinesColText.pressedTextColor = new Color32(153, 0, 0, 0); FavCimsHappinesColText.focusedTextColor = new Color32(102, 153, 255, 147); FavCimsHappinesColText.textPadding.left = 0; FavCimsHappinesColText.tooltipBox = uiView.defaultTooltipBox; //Printing Status FavCimsHappinesColText.relativePosition = new Vector3(FavCimsIndexBgBarSprite.relativePosition.x + 6, FavCimsIndexBgBarSprite.relativePosition.y + 1); //Name FavCimsNameColText = CitizensPanel.AddUIComponent <UIButton> (); FavCimsNameColText.name = "FavCimsNameColText"; FavCimsNameColText.width = 180; FavCimsNameColText.height = FavCimsIndexBgBar.height; FavCimsNameColText.textVerticalAlignment = UIVerticalAlignment.Middle; FavCimsNameColText.textHorizontalAlignment = UIHorizontalAlignment.Center; FavCimsNameColText.playAudioEvents = true; FavCimsNameColText.font = UIDynamicFont.FindByName("OpenSans-Regular"); FavCimsNameColText.textScale = 0.7f; FavCimsNameColText.textColor = new Color32(204, 204, 51, 40); //r,g,b,a FavCimsNameColText.hoveredTextColor = new Color32(204, 102, 0, 20); FavCimsNameColText.pressedTextColor = new Color32(153, 0, 0, 0); FavCimsNameColText.focusedTextColor = new Color32(102, 153, 255, 147); FavCimsNameColText.textPadding.left = 0; FavCimsNameColText.tooltipBox = uiView.defaultTooltipBox; //Printing Name FavCimsNameColText.relativePosition = new Vector3(FavCimsHappinesColText.relativePosition.x + FavCimsHappinesColText.width, FavCimsIndexBgBarSprite.relativePosition.y + 1); //Age Phase FavCimsAgePhaseColText = CitizensPanel.AddUIComponent <UIButton> (); FavCimsAgePhaseColText.name = "FavCimsAgePhaseColText"; FavCimsAgePhaseColText.width = 120; FavCimsAgePhaseColText.height = FavCimsIndexBgBar.height; FavCimsAgePhaseColText.textVerticalAlignment = UIVerticalAlignment.Middle; FavCimsAgePhaseColText.textHorizontalAlignment = UIHorizontalAlignment.Center; FavCimsAgePhaseColText.playAudioEvents = true; FavCimsAgePhaseColText.font = UIDynamicFont.FindByName("OpenSans-Regular"); FavCimsAgePhaseColText.textScale = 0.7f; FavCimsAgePhaseColText.textColor = new Color32(204, 204, 51, 40); //r,g,b,a FavCimsAgePhaseColText.hoveredTextColor = new Color32(204, 102, 0, 20); FavCimsAgePhaseColText.pressedTextColor = new Color32(153, 0, 0, 0); FavCimsAgePhaseColText.focusedTextColor = new Color32(102, 153, 255, 147); FavCimsAgePhaseColText.textPadding.left = 0; FavCimsAgePhaseColText.tooltipBox = uiView.defaultTooltipBox; //Printing Age Phase FavCimsAgePhaseColText.relativePosition = new Vector3(FavCimsNameColText.relativePosition.x + FavCimsNameColText.width, FavCimsIndexBgBarSprite.relativePosition.y + 1); //Age FavCimsAgeColText = CitizensPanel.AddUIComponent <UIButton> (); FavCimsAgeColText.name = "FavCimsAgeColText"; FavCimsAgeColText.width = 40; FavCimsAgeColText.height = FavCimsIndexBgBar.height; FavCimsAgeColText.textVerticalAlignment = UIVerticalAlignment.Middle; FavCimsAgeColText.textHorizontalAlignment = UIHorizontalAlignment.Center; FavCimsAgeColText.playAudioEvents = true; FavCimsAgeColText.font = UIDynamicFont.FindByName("OpenSans-Regular"); FavCimsAgeColText.textScale = 0.7f; FavCimsAgeColText.textColor = new Color32(204, 204, 51, 40); //r,g,b,a FavCimsAgeColText.hoveredTextColor = new Color32(204, 102, 0, 20); FavCimsAgeColText.pressedTextColor = new Color32(153, 0, 0, 0); FavCimsAgeColText.focusedTextColor = new Color32(102, 153, 255, 147); FavCimsAgeColText.textPadding.left = 0; FavCimsAgeColText.tooltipBox = uiView.defaultTooltipBox; //Printing Age FavCimsAgeColText.relativePosition = new Vector3(FavCimsAgePhaseColText.relativePosition.x + FavCimsAgePhaseColText.width, FavCimsIndexBgBarSprite.relativePosition.y + 1); //Education FavCimsEduColText = CitizensPanel.AddUIComponent <UIButton> (); FavCimsEduColText.name = "FavCimsEduColText"; FavCimsEduColText.width = 140; FavCimsEduColText.height = FavCimsIndexBgBar.height; FavCimsEduColText.textVerticalAlignment = UIVerticalAlignment.Middle; FavCimsEduColText.textHorizontalAlignment = UIHorizontalAlignment.Center; FavCimsEduColText.playAudioEvents = true; FavCimsEduColText.font = UIDynamicFont.FindByName("OpenSans-Regular"); FavCimsEduColText.textScale = 0.7f; FavCimsEduColText.textColor = new Color32(204, 204, 51, 40); //r,g,b,a FavCimsEduColText.hoveredTextColor = new Color32(204, 102, 0, 20); FavCimsEduColText.pressedTextColor = new Color32(153, 0, 0, 0); FavCimsEduColText.focusedTextColor = new Color32(102, 153, 255, 147); FavCimsEduColText.textPadding.left = 0; FavCimsEduColText.tooltipBox = uiView.defaultTooltipBox; //Printing Education FavCimsEduColText.relativePosition = new Vector3(FavCimsAgeColText.relativePosition.x + FavCimsAgeColText.width, FavCimsIndexBgBarSprite.relativePosition.y + 1); //Home FavCimsHomeColText = CitizensPanel.AddUIComponent <UIButton> (); FavCimsHomeColText.name = "FavCimsHomeColText"; FavCimsHomeColText.width = 184; FavCimsHomeColText.height = FavCimsIndexBgBar.height; FavCimsHomeColText.textVerticalAlignment = UIVerticalAlignment.Middle; FavCimsHomeColText.textHorizontalAlignment = UIHorizontalAlignment.Center; FavCimsHomeColText.playAudioEvents = true; FavCimsHomeColText.font = UIDynamicFont.FindByName("OpenSans-Regular"); FavCimsHomeColText.textScale = 0.7f; FavCimsHomeColText.textColor = new Color32(204, 204, 51, 40); //r,g,b,a FavCimsHomeColText.hoveredTextColor = new Color32(204, 102, 0, 20); FavCimsHomeColText.pressedTextColor = new Color32(153, 0, 0, 0); FavCimsHomeColText.focusedTextColor = new Color32(102, 153, 255, 147); FavCimsHomeColText.textPadding.left = 0; FavCimsHomeColText.tooltipBox = uiView.defaultTooltipBox; //Printing Home FavCimsHomeColText.relativePosition = new Vector3(FavCimsEduColText.relativePosition.x + FavCimsEduColText.width, FavCimsIndexBgBarSprite.relativePosition.y + 1); //Working Place FavCimsWorkingPlaceColText = CitizensPanel.AddUIComponent <UIButton> (); FavCimsWorkingPlaceColText.name = "FavCimsWorkingPlaceColText"; FavCimsWorkingPlaceColText.width = 180; FavCimsWorkingPlaceColText.height = FavCimsIndexBgBar.height; FavCimsWorkingPlaceColText.textVerticalAlignment = UIVerticalAlignment.Middle; FavCimsWorkingPlaceColText.textHorizontalAlignment = UIHorizontalAlignment.Center; FavCimsWorkingPlaceColText.playAudioEvents = true; FavCimsWorkingPlaceColText.font = UIDynamicFont.FindByName("OpenSans-Regular"); FavCimsWorkingPlaceColText.textScale = 0.7f; FavCimsWorkingPlaceColText.textColor = new Color32(204, 204, 51, 40); //r,g,b,a FavCimsWorkingPlaceColText.hoveredTextColor = new Color32(204, 102, 0, 20); FavCimsWorkingPlaceColText.pressedTextColor = new Color32(153, 0, 0, 0); FavCimsWorkingPlaceColText.focusedTextColor = new Color32(102, 153, 255, 147); FavCimsWorkingPlaceColText.textPadding.left = 0; FavCimsWorkingPlaceColText.tooltipBox = uiView.defaultTooltipBox; //Printing Working Place FavCimsWorkingPlaceColText.relativePosition = new Vector3(FavCimsHomeColText.relativePosition.x + FavCimsHomeColText.width, FavCimsIndexBgBarSprite.relativePosition.y + 1); //Last Activity FavCimsLastActColText = CitizensPanel.AddUIComponent <UIButton> (); FavCimsLastActColText.name = "FavCimsLastActColText"; FavCimsLastActColText.width = 180; FavCimsLastActColText.height = FavCimsIndexBgBar.height; FavCimsLastActColText.textVerticalAlignment = UIVerticalAlignment.Middle; FavCimsLastActColText.textHorizontalAlignment = UIHorizontalAlignment.Center; FavCimsLastActColText.playAudioEvents = true; FavCimsLastActColText.font = UIDynamicFont.FindByName("OpenSans-Regular"); FavCimsLastActColText.textScale = 0.7f; FavCimsLastActColText.textColor = new Color32(204, 204, 51, 40); //r,g,b,a FavCimsLastActColText.hoveredTextColor = new Color32(204, 102, 0, 20); FavCimsLastActColText.pressedTextColor = new Color32(153, 0, 0, 0); FavCimsLastActColText.focusedTextColor = new Color32(102, 153, 255, 147); FavCimsLastActColText.textPadding.left = 0; FavCimsLastActColText.tooltipBox = uiView.defaultTooltipBox; //Printing Last Activity FavCimsLastActColText.relativePosition = new Vector3(FavCimsWorkingPlaceColText.relativePosition.x + FavCimsWorkingPlaceColText.width, FavCimsIndexBgBarSprite.relativePosition.y + 1); //Close Button FavCimsCloseButtonCol = CitizensPanel.AddUIComponent <UIButton> (); FavCimsCloseButtonCol.name = "FavCimsCloseButtonCol"; FavCimsCloseButtonCol.width = 50; FavCimsCloseButtonCol.height = FavCimsIndexBgBar.height; FavCimsCloseButtonCol.textVerticalAlignment = UIVerticalAlignment.Middle; FavCimsCloseButtonCol.textHorizontalAlignment = UIHorizontalAlignment.Center; FavCimsCloseButtonCol.playAudioEvents = true; FavCimsCloseButtonCol.font = UIDynamicFont.FindByName("OpenSans-Regular"); FavCimsCloseButtonCol.textScale = 0.7f; FavCimsCloseButtonCol.textColor = new Color32(204, 204, 51, 40); //r,g,b,a FavCimsCloseButtonCol.hoveredTextColor = new Color32(204, 102, 0, 20); FavCimsCloseButtonCol.pressedTextColor = new Color32(153, 0, 0, 0); FavCimsCloseButtonCol.focusedTextColor = new Color32(102, 153, 255, 147); FavCimsCloseButtonCol.textPadding.right = 6; FavCimsCloseButtonCol.tooltipBox = uiView.defaultTooltipBox; //Printing Close Button FavCimsCloseButtonCol.relativePosition = new Vector3(FavCimsLastActColText.relativePosition.x + FavCimsLastActColText.width, FavCimsIndexBgBarSprite.relativePosition.y + 1); /////////////////////////////////////////////// /////Rows Panel Body /////////////////////////////////////////////// FavCimsCitizenRowsPanel = CitizensPanel.AddUIComponent <UIScrollablePanel> (); FavCimsCitizenRowsPanel.name = "FavCimsCitizenRowsPanel"; FavCimsCitizenRowsPanel.width = FavCimsIndexBgBarSprite.width - 12; FavCimsCitizenRowsPanel.height = 500; FavCimsCitizenRowsPanel.autoLayoutDirection = LayoutDirection.Vertical; FavCimsCitizenRowsPanel.autoLayout = true; FavCimsCitizenRowsPanel.clipChildren = true; FavCimsCitizenRowsPanel.autoLayoutPadding = new RectOffset(0, 0, 0, 0); FavCimsCitizenRowsPanel.relativePosition = new Vector3(FavCimsIndexBgBarSprite.relativePosition.x + 6, FavCimsIndexBgBarSprite.relativePosition.y + FavCimsIndexBgBarSprite.height); //Damn ScrollBar UIScrollablePanel FavCimsCitizenRowsPanelScrollBar = CitizensPanel.AddUIComponent <UIScrollablePanel> (); FavCimsCitizenRowsPanelScrollBar.name = "FavCimsCitizenRowsPanelScrollBar"; FavCimsCitizenRowsPanelScrollBar.width = 10; FavCimsCitizenRowsPanelScrollBar.height = 500; FavCimsCitizenRowsPanelScrollBar.relativePosition = new Vector3(FavCimsIndexBgBarSprite.relativePosition.x + FavCimsIndexBgBarSprite.width, FavCimsCitizenRowsPanel.relativePosition.y); UIScrollbar FavCimsMainPanelScrollBar = FavCimsCitizenRowsPanelScrollBar.AddUIComponent <UIScrollbar> (); FavCimsMainPanelScrollBar.width = 10; FavCimsMainPanelScrollBar.height = FavCimsCitizenRowsPanel.height; FavCimsMainPanelScrollBar.orientation = UIOrientation.Vertical; FavCimsMainPanelScrollBar.pivot = UIPivotPoint.TopRight; FavCimsMainPanelScrollBar.AlignTo(FavCimsMainPanelScrollBar.parent, UIAlignAnchor.TopRight); FavCimsMainPanelScrollBar.minValue = 0; FavCimsMainPanelScrollBar.value = 0; FavCimsMainPanelScrollBar.incrementAmount = 40; UISlicedSprite FavCimsMainPanelTrackSprite = FavCimsMainPanelScrollBar.AddUIComponent <UISlicedSprite> (); FavCimsMainPanelTrackSprite.relativePosition = FavCimsMainPanelScrollBar.relativePosition; FavCimsMainPanelTrackSprite.autoSize = true; FavCimsMainPanelTrackSprite.size = FavCimsMainPanelTrackSprite.parent.size; FavCimsMainPanelTrackSprite.fillDirection = UIFillDirection.Vertical; FavCimsMainPanelTrackSprite.spriteName = "ScrollbarTrack"; FavCimsMainPanelScrollBar.trackObject = FavCimsMainPanelTrackSprite; UISlicedSprite thumbSprite = FavCimsMainPanelScrollBar.AddUIComponent <UISlicedSprite> (); thumbSprite.relativePosition = FavCimsMainPanelScrollBar.relativePosition; thumbSprite.autoSize = true; thumbSprite.width = thumbSprite.parent.width; thumbSprite.fillDirection = UIFillDirection.Vertical; thumbSprite.spriteName = "ScrollbarThumb"; FavCimsMainPanelScrollBar.thumbObject = thumbSprite; FavCimsCitizenRowsPanel.verticalScrollbar = FavCimsMainPanelScrollBar; /* Thx to CNightwing for this piece of code */ FavCimsCitizenRowsPanel.eventMouseWheel += (component, eventParam) => { var sign = Math.Sign(eventParam.wheelDelta); FavCimsCitizenRowsPanel.scrollPosition += new Vector2(0, sign * (-1) * FavCimsMainPanelScrollBar.incrementAmount); }; /* End */ FavCimsCitizenRowsPanel.eventComponentAdded += (component, eventParam) => ReorderRowsBackgrounds(); FavCimsCitizenRowsPanel.eventComponentRemoved += (component, eventParam) => ReorderRowsBackgrounds(); /////////////////////////////////////////////// /////Rows Panel Footer /////////////////////////////////////////////// UITextureSprite FavCimsFooterBgBarSprite = CitizensPanel.AddUIComponent <UITextureSprite> (); FavCimsFooterBgBarSprite.name = "FavCimsFooterBgBarSprite"; FavCimsFooterBgBarSprite.width = FavCimsIndexBgBarSprite.width; FavCimsFooterBgBarSprite.height = 15; FavCimsFooterBgBarSprite.texture = FavCimsIndexBgBar; //Printing FavCimsFooterBgBarSprite.relativePosition = new Vector3(21, FavCimsCitizenRowsPanel.relativePosition.y + FavCimsCitizenRowsPanel.height); //Row End //Load Initial Row (People Renamed) foreach (KeyValuePair <InstanceID, string> FavCitizen in FavCimsCore.FavoriteCimsList()) { if (FavCitizen.Key.Type == InstanceType.Citizen) // || FavCitizen.Key.Type == InstanceType.CitizenInstance { CitizenRow FavCimsCitizenSingleRowPanel = FavCimsCitizenRowsPanel.AddUIComponent(typeof(CitizenRow)) as CitizenRow; FavCimsCitizenSingleRowPanel.MyInstanceID = FavCitizen.Key; FavCimsCitizenSingleRowPanel.MyInstancedName = FavCitizen.Value; } } }