Exemplo n.º 1
0
        private void Start()
        {
            if (icon == null)
            {
                icon = new Texture2D(38, 38, TextureFormat.ARGB32, false);

                string path = Path.Combine(new DirectoryInfo(KSPUtil.ApplicationRootPath).FullName, "GameData/BasicOrbit/Resources/AppIcon.png").Replace("\\", "/");

                if (File.Exists(path))
                {
                    icon.LoadImage(File.ReadAllBytes(path));
                }
            }

            instance = this;

            if (buttonAdder != null)
            {
                StopCoroutine(buttonAdder);
            }

            buttonAdder = AddButton();
            StartCoroutine(buttonAdder);

            GameEvents.OnGameSettingsApplied.Add(Reposition);
        }
Exemplo n.º 2
0
        private void Start()
        {
            panelManager = gameObject.AddComponent <BasicPanelManager>();

            orbitHUD          = new BasicHUD(AddOrbitModules());
            orbitHUD.Position = BasicSettings.Instance.orbitPosition;

            targetHUD          = new BasicHUD(AddTargetModules());
            targetHUD.Position = BasicSettings.Instance.targetPosition;

            maneuverHUD          = new BasicHUD(AddManeuverModules());
            maneuverHUD.Position = BasicSettings.Instance.maneuverPosition;

            Assembly assembly = AssemblyLoader.loadedAssemblies.GetByAssembly(Assembly.GetExecutingAssembly()).assembly;
            var      ainfoV   = Attribute.GetCustomAttribute(assembly, typeof(AssemblyInformationalVersionAttribute)) as AssemblyInformationalVersionAttribute;

            switch (ainfoV == null)
            {
            case true: _version = ""; break;

            default: _version = ainfoV.InformationalVersion; break;
            }

            if (BasicSettings.Instance.showOrbitPanel)
            {
                AddOrbitPanel();
            }

            if (BasicSettings.Instance.showTargetPanel)
            {
                AddTargetPanel();
            }

            if (BasicSettings.Instance.showManeuverPanel)
            {
                AddManeuverPanel();
            }

            appLauncher = gameObject.AddComponent <BasicOrbitAppLauncher>();

            onGameSettings();
            GameEvents.OnGameSettingsApplied.Add(onGameSettings);
        }
Exemplo n.º 3
0
        private void Start()
        {
            if (icon == null)
            {
                icon = GameDatabase.Instance.GetTexture("BasicOrbit/Resources/AppIcon", false);
            }

            instance = this;

            if (buttonAdder != null)
            {
                StopCoroutine(buttonAdder);
            }

            buttonAdder = AddButton();
            StartCoroutine(buttonAdder);

            GameEvents.OnGameSettingsApplied.Add(Reposition);
        }