예제 #1
0
        void OnGUI()
        {
            if (HighLogic.LoadedSceneIsFlight && !MapView.MapIsEnabled && BDArmorySettings.GAME_UI_ENABLED && !delayedEnabling)
            {
                if (cameraEnabled && vessel.isActiveVessel && FlightGlobals.ready)
                {
                    //window
                    if (activeCam == this && TargetingCamera.ReadyForUse)
                    {
                        camWindowRect = GUI.Window(125452, camWindowRect, CamWindow, string.Empty, HighLogic.Skin.window);
                        BDGUIUtils.UseMouseEventInRect(camWindowRect);
                    }

                    //locked target icon
                    if (groundStabilized)
                    {
                        BDGUIUtils.DrawTextureOnWorldPos(groundTargetPosition, BDArmorySettings.Instance.greenPointCircleTexture, new Vector3(20, 20), 0);
                    }
                    else
                    {
                        BDGUIUtils.DrawTextureOnWorldPos(targetPointPosition, BDArmorySettings.Instance.greenCircleTexture, new Vector3(18, 18), 0);
                    }
                }

                if (BDArmorySettings.DRAW_DEBUG_LABELS)
                {
                    GUI.Label(new Rect(500, 500, 500, 500), "Slew rate: " + finalSlewSpeed);
                }
            }
        }
예제 #2
0
        void OnGUI()
        {
            if (HighLogic.LoadedSceneIsFlight && vessel && vessel.isActiveVessel && !vessel.packed)
            {
                if (BDArmorySettings.GAME_UI_ENABLED)
                {
                    if (showGUI)
                    {
                        if (!rectInit)
                        {
                            guiWindowRect                        = new Rect(45, 75, 240, 800);
                            buttonWidth                          = guiWindowRect.width - (2 * margin);
                            buttonEndY                           = buttonStartY;
                            wingmanButtonStyle                   = new GUIStyle(HighLogic.Skin.button);
                            wingmanButtonStyle.alignment         = TextAnchor.MiddleLeft;
                            wingmanButtonStyle.wordWrap          = false;
                            wingmanButtonStyle.fontSize          = 11;
                            wingmanButtonSelectedStyle           = new GUIStyle(HighLogic.Skin.box);
                            wingmanButtonSelectedStyle.alignment = TextAnchor.MiddleLeft;
                            wingmanButtonSelectedStyle.wordWrap  = false;
                            wingmanButtonSelectedStyle.fontSize  = 11;
                            rectInit = true;
                        }
                        guiWindowRect = GUI.Window(1293293, guiWindowRect, WingmenWindow, "WingCommander",
                                                   HighLogic.Skin.window);

                        if (showAGWindow)
                        {
                            AGWindow();
                        }
                    }

                    //command position diamonds
                    float diamondSize = 24;
                    foreach (var comPos in commandedPositions)
                    {
                        BDGUIUtils.DrawTextureOnWorldPos(comPos.worldPos, BDArmorySettings.Instance.greenDiamondTexture,
                                                         new Vector2(diamondSize, diamondSize), 0);
                        Vector2 labelPos;
                        if (BDGUIUtils.WorldToGUIPos(comPos.worldPos, out labelPos))
                        {
                            labelPos.x += diamondSize / 2;
                            labelPos.y -= 10;
                            GUI.Label(new Rect(labelPos.x, labelPos.y, 300, 20), comPos.name);
                        }
                    }

                    if (drawMouseDiamond)
                    {
                        Vector2 mouseDiamondPos  = Input.mousePosition;
                        Rect    mouseDiamondRect = new Rect(mouseDiamondPos.x - (diamondSize / 2),
                                                            Screen.height - mouseDiamondPos.y - (diamondSize / 2), diamondSize, diamondSize);
                        GUI.DrawTexture(mouseDiamondRect, BDArmorySettings.Instance.greenDiamondTexture,
                                        ScaleMode.StretchToFill, true);
                    }
                }
            }
        }
예제 #3
0
 void OnGUI()
 {
     if (setupComplete)
     {
         for (int i = 0; i < localAnchors.Length; i++)
         {
             BDGUIUtils.DrawTextureOnWorldPos(parentTransform.TransformPoint(localAnchors[i]), BDArmorySettings.Instance.greenDotTexture, new Vector2(6, 6), 0);
         }
     }
 }
예제 #4
0
 void OnGUI()
 {
     if (drawGUI)
     {
         if (boresightScan)
         {
             BDGUIUtils.DrawTextureOnWorldPos(transform.position + (3500 * transform.up), BDArmorySettings.Instance.dottedLargeGreenCircle, new Vector2(156, 156), 0);
         }
     }
 }
예제 #5
0
		void OnGUI()
		{
			if(weaponState == WeaponStates.Enabled && vessel && !vessel.packed && vessel.isActiveVessel && BDArmorySettings.DRAW_AIMERS && !aiControlled & !MapView.MapIsEnabled)
			{
				float size = 30;
				
				Vector3 reticlePosition;
				if(BDArmorySettings.AIM_ASSIST && vessel.srf_velocity.sqrMagnitude < Mathf.Pow(750,2))
				{
					if(targetAcquired && (slaved || yawRange < 1 || maxPitch-minPitch < 1))
					{
						reticlePosition = pointingAtPosition+fixedLeadOffset;

						if(!slaved)
						{
							BDGUIUtils.DrawLineBetweenWorldPositions(pointingAtPosition, reticlePosition, 2, new Color(0, 1, 0, 0.6f));
						}

						BDGUIUtils.DrawTextureOnWorldPos(pointingAtPosition, BDArmorySettings.Instance.greenDotTexture, new Vector2(6, 6), 0);

						if(atprAcquired)
						{
							BDGUIUtils.DrawTextureOnWorldPos(targetPosition, BDArmorySettings.Instance.openGreenSquare, new Vector2(20, 20), 0);
						}
					}
					else
					{
						reticlePosition = bulletPrediction;
					}
				}
				else
				{
					reticlePosition = pointingAtPosition;
				}
				

				
				Texture2D texture;
				if(Vector3.Angle(pointingAtPosition-transform.position, finalAimTarget-transform.position) < 1f)
				{
					texture = BDArmorySettings.Instance.greenSpikedPointCircleTexture;
				}
				else
				{
					texture = BDArmorySettings.Instance.greenPointCircleTexture;
				}
				BDGUIUtils.DrawTextureOnWorldPos (reticlePosition, texture, new Vector2 (size, size), 0);

				if(BDArmorySettings.DRAW_DEBUG_LINES)
				{
					if(targetAcquired)
					{
						BDGUIUtils.DrawLineBetweenWorldPositions(fireTransforms[0].position, targetPosition, 2, Color.blue);
					}
				}
			}

			if(HighLogic.LoadedSceneIsEditor && BDArmorySettings.showWeaponAlignment)
			{
				DrawAlignmentIndicator();
			}
		}