示例#1
0
        //basically, the layout function, but also adds dragability
        protected void OnWindow(int WindowID)
        {
            //Alpha blending
            Color tmpColor = GUI.color;

            GUI.color = new Color(1, 1, 1, SteamGauges.Alpha);

            //Checks for any buttons that may be on the gauge.
            bool save = GaugeButtons();

            //Performs the actions and drawing specific to this gauge.
            GaugeActions();
            //Draws any buttons that may be on the gauge
            DrawGaugeButtons();

            //Reset Alpha blending
            GUI.color = tmpColor;

            //Make it dragable
            if (!SteamGauges.windowLock)
            {
                GUI.DragWindow();
            }

            //Save check so we only save after draging
            if (save || windowPosition.x != lastPosition.x || windowPosition.y != lastPosition.y)
            {
                lastPosition = windowPosition;
                home.SaveMe();
            }
        }