Example #1
0
        public static void Bootstrap(Skin.ModuleClass moduleClass)
        {
			if (!MyInfo().isEnabled)
			{
				Deinitialize();
				return;
			}
			Debug.LogWarning("Trying to bootstrap moduleClass: " + Enum.GetName(typeof(Skin.ModuleClass), moduleClass) + " status of bootstrap is: " + _bootstrapped);
			if (_bootstrapped && moduleClass != _currentModuleClass)
            {
				Debug.LogWarning("De-strapping moduleClass: " + Enum.GetName(typeof(Skin.ModuleClass), moduleClass) + " because bootstrap was " + _bootstrapped);
				Deinitialize();
            }
			else if (_bootstrapped && moduleClass == _currentModuleClass)
			{
				Debug.Log("Already bootstrapped for this class, skipping");
				return;
			}

            ErrorLogger.ResetSettings();

            _currentModuleClass = moduleClass;
			Debug.LogWarning("Success bootstrapping moduleClass: " + Enum.GetName(typeof(Skin.ModuleClass), moduleClass));

            FindObjectOfType<UIView>().gameObject.AddComponent<Core>();
            _bootstrapped = true;
        }
Example #2
0
        public static void Bootstrap(Skin.ModuleClass moduleClass)
        {
            if (!MyInfo().isEnabled)
            {
                Deinitialize();
                return;
            }
            Debug.LogWarning("Trying to bootstrap moduleClass: " + Enum.GetName(typeof(Skin.ModuleClass), moduleClass) + " status of bootstrap is: " + _bootstrapped);
            if (_bootstrapped && moduleClass != _currentModuleClass)
            {
                Debug.LogWarning("De-strapping moduleClass: " + Enum.GetName(typeof(Skin.ModuleClass), moduleClass) + " because bootstrap was " + _bootstrapped);
                Deinitialize();
            }
            else if (_bootstrapped && moduleClass == _currentModuleClass)
            {
                Debug.Log("Already bootstrapped for this class, skipping");
                return;
            }

            ErrorLogger.ResetSettings();

            _currentModuleClass = moduleClass;
            Debug.LogWarning("Success bootstrapping moduleClass: " + Enum.GetName(typeof(Skin.ModuleClass), moduleClass));

            FindObjectOfType <UIView>().gameObject.AddComponent <Core>();
            _bootstrapped = true;
        }
Example #3
0
        public static void Bootstrap(Skin.ModuleClass moduleClass)
        {
            if (bootstrapped)
            {
                return;
            }

            ErrorLogger.ResetSettings();

            currentModuleClass = moduleClass;

            FindObjectOfType <UIView>().gameObject.AddComponent <Core>();
            bootstrapped = true;
        }
Example #4
0
        public static UIButton CreateSapphireButton(Skin.ModuleClass moduleClass)
        {
            var uiView = GameObject.Find("UIView").GetComponent <UIView>();

            if (uiView == null)
            {
                Debug.LogError("UIView is null!");
                return(null);
            }

            var button = uiView.AddUIComponent(typeof(UIButton)) as UIButton;

            button.name            = "SapphireButton";
            button.gameObject.name = "SapphireButton";
            button.width           = 32;
            button.height          = 32;

            button.pressedBgSprite  = "";
            button.normalBgSprite   = "";
            button.hoveredBgSprite  = "";
            button.disabledBgSprite = "";

            button.atlas                = EmbeddedResources.GetSapphireAtlas();
            button.normalFgSprite       = "SapphireIcon";
            button.hoveredFgSprite      = "SapphireIconHover";
            button.pressedFgSprite      = "SapphireIconPressed";
            button.foregroundSpriteMode = UIForegroundSpriteMode.Scale;
            button.scaleFactor          = 1.0f;

            button.tooltip    = "Sapphire Skin Manager";
            button.tooltipBox = uiView.defaultTooltipBox;

            if (moduleClass == Skin.ModuleClass.MainMenu)
            {
                button.relativePosition = new Vector3(4.0f, 2.0f, 0.0f);
            }
            else
            {
                button.relativePosition = new Vector3(64.0f, 16.0f, 0.0f);
            }

            return(button);
        }
Example #5
0
        public static UIButton CreateQuartzButton(Skin.ModuleClass moduleClass)
        {
            Debug.Log("Creating button");
            var uiView = GameObject.Find("UIView").GetComponent <UIView>();

            if (uiView == null)
            {
                Debug.LogError("UIView is null!");
                return(null);
            }

            var button = uiView.AddUIComponent(typeof(UIButton)) as UIButton;

            if (button != null)
            {
                button.name            = "QuartzButton";
                button.gameObject.name = "QuartzButton";
                button.width           = 32;
                button.height          = 32;

                button.pressedBgSprite  = "";
                button.normalBgSprite   = "";
                button.hoveredBgSprite  = "";
                button.disabledBgSprite = "";

                button.atlas                = EmbeddedResources.GetQuartzAtlas();
                button.normalFgSprite       = "QuartzIcon";
                button.hoveredFgSprite      = "QuartzIconHover";
                button.pressedFgSprite      = "QuartzIconPressed";
                button.foregroundSpriteMode = UIForegroundSpriteMode.Scale;
                button.scaleFactor          = 1.0f;

                button.tooltip    = "Quartz Skin Manager";
                button.tooltipBox = uiView.defaultTooltipBox;

                Vector2 viewSize = uiView.GetScreenResolution();

                button.relativePosition = moduleClass == Skin.ModuleClass.MainMenu
                                              ? new Vector3(viewSize.x - 4.0f - button.width, 2.0f, 0.0f)
                                              : new Vector3(viewSize.x - 19.0f - button.width, 34.0f + button.height, 0.0f);
            }
            return(button);
        }