Beispiel #1
0
 private void RefreshInternals()
 {
     if (IsChecked)
     {
         if (HasHighlight)
         {
             BackgroundTexture = m_styleDef.HighlightCheckedTexture;
         }
         else
         {
             BackgroundTexture = m_styleDef.NormalCheckedTexture;
         }
         m_icon = m_styleDef.CheckedIcon;
         Size   = m_styleDef.SizeOverride ?? BackgroundTexture.MinSizeGui;
     }
     else
     {
         if (HasHighlight)
         {
             BackgroundTexture = m_styleDef.HighlightUncheckedTexture;
         }
         else
         {
             BackgroundTexture = m_styleDef.NormalUncheckedTexture;
         }
         m_icon = m_styleDef.UncheckedIcon;
         Size   = m_styleDef.SizeOverride ?? BackgroundTexture.MinSizeGui;
     }
     MinSize = BackgroundTexture.MinSizeGui;
     MaxSize = BackgroundTexture.MaxSizeGui;
 }
        private void RefreshInternals()
        {
            if (m_styleDef == null)
            {
                m_styleDef = m_styles[(int)MyGuiControlCheckboxStyleEnum.Default];
            }

            if (IsChecked)
            {
                if (HasHighlight)
                {
                    BackgroundTexture = m_styleDef.HighlightCheckedTexture;
                }
                else
                {
                    BackgroundTexture = m_styleDef.NormalCheckedTexture;
                }
                m_icon = m_styleDef.CheckedIcon;
                Size   = m_styleDef.SizeOverride ?? BackgroundTexture.MinSizeGui;
            }
            else
            {
                if (HasHighlight)
                {
                    BackgroundTexture = m_styleDef.HighlightUncheckedTexture;
                }
                else
                {
                    BackgroundTexture = m_styleDef.NormalUncheckedTexture;
                }
                m_icon = m_styleDef.UncheckedIcon;
                Size   = m_styleDef.SizeOverride ?? BackgroundTexture.MinSizeGui;
            }
            MinSize = BackgroundTexture.MinSizeGui;
            MaxSize = BackgroundTexture.MaxSizeGui;
        }