Пример #1
0
		public static void drawblanks(TexturesManager texman, StylesManager styman, String size, bool mySecs, bool myAm, bool existsSecs, bool existsAm, bool existsBoth)
		{
			if((mySecs && myAm) || (mySecs && !existsBoth))	
				return;
		
			if(!mySecs && !myAm)
			{
				if(existsBoth)
				{
					GUILayout.Label(texman.getTexture("secsblank_" + size), styman.texStyle);
					GUILayout.Label(texman.getTexture("amblank_" + size), styman.texStyle);
				}
				else if(existsSecs)
					GUILayout.Label(texman.getTexture("secsblank_" + size), styman.texStyle);
				else if(existsAm)
					GUILayout.Label(texman.getTexture("amblank_" + size), styman.texStyle);
			}
			else if(!mySecs && myAm)
			{
				if(existsBoth)
					GUILayout.Label(texman.getTexture("secsblank_" + size), styman.texStyle);
				else if(existsSecs)
					GUILayout.Label(texman.getTexture("interblank_" + size), styman.texStyle);
			}
			else if(mySecs && !myAm && existsBoth)
				GUILayout.Label(texman.getTexture("amblank_" + size), styman.texStyle);
		}
Пример #2
0
    private void WindowGUI(int windowID)
    {
        GUILayout.BeginVertical(styman.layoutStyle);

        if (displaylocal)
        {
            if (displaystrings)
            {
                GUILayout.Label("Local Time", styman.timeLabelStyle);
            }
            else
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label(texman.getTexture("local"), styman.texStyle);
                Utils.drawblanks(texman, styman, "top", false, false, existsSecs(), existsAm(), existsBoth());

                GUILayout.EndHorizontal();
            }
            timeDoubleToDisplay(localTime(), timeZone(), display24local, displaySecslocal, displayTZlocal, vessel.mainBody.bodyName.First());
        }
        if (displayrel)
        {
            if (displaystrings)
            {
                GUILayout.Label(vessel.mainBody.referenceBody.bodyName + " Related Time", styman.timeLabelStyle);
            }
            else
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label(texman.getTexture("rel"), styman.texStyle);
                Utils.drawblanks(texman, styman, "top", false, false, existsSecs(), existsAm(), existsBoth());

                GUILayout.EndHorizontal();
            }
            timeDoubleToDisplay(localRelativeTime(), timeZone(), display24rel, displaySecsrel, displayTZrel, vessel.mainBody.bodyName.First());
        }
        if (displayksc)
        {
            if (displaystrings)
            {
                GUILayout.Label("KSC Time", styman.timeLabelStyle);
            }
            else
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label(texman.getTexture("ksc"), styman.texStyle);
                Utils.drawblanks(texman, styman, "top", false, false, existsSecs(), existsAm(), existsBoth());

                GUILayout.EndHorizontal();
            }

            timeDoubleToDisplay(kscTime(), -5, display24ksc, displaySecsksc, displayTZksc, 'K');
        }
        if (displayreal)
        {
            if (displaystrings)
            {
                GUILayout.Label("Real World Time", styman.timeLabelStyle);
            }
            else
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label(texman.getTexture("earth"), styman.texStyle);
                Utils.drawblanks(texman, styman, "top", false, false, existsSecs(), existsAm(), existsBoth());

                GUILayout.EndHorizontal();
            }
            realWorldTime();
        }
        GUILayout.EndVertical();
        //DragWindow makes the window draggable. The Rect specifies which part of the window it can by dragged by, and is
        //clipped to the actual boundary of the window. You can also pass no argument at all and then the window can by
        //dragged by any part of it. Make sure the DragWindow command is AFTER all your other GUI input stuff, or else
        //it may "cover up" your controls and make them stop responding to the mouse.
        GUI.DragWindow(new Rect(0, 0, 10000, 20));
    }