当前位置: 首页>>代码示例>>C#>>正文


C# ApplicationLauncherButton.SetTexture方法代码示例

本文整理汇总了C#中ApplicationLauncherButton.SetTexture方法的典型用法代码示例。如果您正苦于以下问题:C# ApplicationLauncherButton.SetTexture方法的具体用法?C# ApplicationLauncherButton.SetTexture怎么用?C# ApplicationLauncherButton.SetTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ApplicationLauncherButton的用法示例。


在下文中一共展示了ApplicationLauncherButton.SetTexture方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnGUIAppLauncherReady

    // Stock Toolbar Startup and cleanup
    private void OnGUIAppLauncherReady()
    {
      Utilities.LogMessage("SMAddon.OnGUIAppLauncherReady active...", "Info", SMSettings.VerboseLogging);
      try
      {
        // Setup SM WIndow button
        if (HighLogic.LoadedSceneIsFlight && SMButton_Stock == null && !SMSettings.EnableBlizzyToolbar)
        {
          string Iconfile = "IconOff_38";
          SMButton_Stock = ApplicationLauncher.Instance.AddModApplication(
              OnSMButtonToggle,
              OnSMButtonToggle,
              DummyHandler,
              DummyHandler,
              DummyHandler,
              DummyHandler,
              ApplicationLauncher.AppScenes.FLIGHT | ApplicationLauncher.AppScenes.MAPVIEW,
              (Texture)GameDatabase.Instance.GetTexture(TextureFolder + Iconfile, false));

          if (WindowManifest.ShowWindow)
            SMButton_Stock.SetTexture((Texture)GameDatabase.Instance.GetTexture(WindowManifest.ShowWindow ? TextureFolder + "IconOn_38" : TextureFolder + "IconOff_38", false));
        }

        // Setup Settings Button
        if (HighLogic.LoadedScene == GameScenes.SPACECENTER && SMSettings_Stock == null && !SMSettings.EnableBlizzyToolbar)
        {
          string Iconfile = "IconS_Off_38";
          SMSettings_Stock = ApplicationLauncher.Instance.AddModApplication(
              OnSMSettingsToggle,
              OnSMSettingsToggle,
              DummyHandler,
              DummyHandler,
              DummyHandler,
              DummyHandler,
              ApplicationLauncher.AppScenes.SPACECENTER,
              (Texture)GameDatabase.Instance.GetTexture(TextureFolder + Iconfile, false));

          if (WindowSettings.ShowWindow)
            SMSettings_Stock.SetTexture((Texture)GameDatabase.Instance.GetTexture(WindowSettings.ShowWindow ? TextureFolder + "IconS_On_38" : TextureFolder + "IconS_Off_38", false));
        }

        // Setup Roster Button
        if (HighLogic.LoadedScene == GameScenes.SPACECENTER && SMRoster_Stock == null && !SMSettings.EnableBlizzyToolbar)
        {
          string Iconfile = "IconR_Off_38";
          SMRoster_Stock = ApplicationLauncher.Instance.AddModApplication(
              OnSMRosterToggle,
              OnSMRosterToggle,
              DummyHandler,
              DummyHandler,
              DummyHandler,
              DummyHandler,
              ApplicationLauncher.AppScenes.SPACECENTER,
              (Texture)GameDatabase.Instance.GetTexture(TextureFolder + Iconfile, false));

          if (WindowRoster.ShowWindow)
            SMRoster_Stock.SetTexture((Texture)GameDatabase.Instance.GetTexture(WindowRoster.ShowWindow ? TextureFolder + "IconR_On_38" : TextureFolder + "IconR_Off_38", false));
        }

      }
      catch (Exception ex)
      {
        Utilities.LogMessage("Error in:  ShipManifestAddon.OnGUIAppLauncherReady.  " + ex.ToString(), "Error", true);
      }
    }
开发者ID:Shavenbeard,项目名称:ShipManifest,代码行数:66,代码来源:SMAddon.cs

示例2: OnGUIAppLauncherReady

        private void OnGUIAppLauncherReady()
        {
            // Setup PW Stock Toolbar button
            bool hidden = false;
            if(ApplicationLauncher.Ready && (partWizardStockButton == null || !ApplicationLauncher.Instance.Contains(partWizardStockButton, out hidden)))
            {
                partWizardStockButton = ApplicationLauncher.Instance.AddModApplication(
                    ToggleVisibility,
                    ToggleVisibility,
                    DummyHandler,
                    DummyHandler,
                    DummyHandler,
                    DummyHandler,
                    ApplicationLauncher.AppScenes.VAB | ApplicationLauncher.AppScenes.SPH,
                    (Texture)GameDatabase.Instance.GetTexture(StockToolbarIconActive, false));

                if(this.partWizardWindow.Visible)
                {
                    partWizardStockButton.SetTexture((Texture)GameDatabase.Instance.GetTexture(this.partWizardWindow.Visible ? this.toolbarIconActive : this.toolbarIconInactive, false));
                }
            }
        }
开发者ID:Kerbas-ad-astra,项目名称:PartWizard,代码行数:22,代码来源:PartWizardPlugin.cs

示例3: OnGUIAppLauncherReady

        // Stock Toolbar Startup and cleanup
        private void OnGUIAppLauncherReady()
        {
            Utilities.LogMessage("RosterManagerAddon.OnGUIAppLauncherReady active...", "Info", RMSettings.VerboseLogging);
            try
            {
                // Setup Roster Button
                if (HighLogic.LoadedScene == GameScenes.SPACECENTER && RMRoster_Stock == null && !RMSettings.EnableBlizzyToolbar)
                {
                    string Iconfile = "Icon_Off_38";
                    RMRoster_Stock = ApplicationLauncher.Instance.AddModApplication(
                        OnRMRosterToggle,
                        OnRMRosterToggle,
                        DummyVoid,
                        DummyVoid,
                        DummyVoid,
                        DummyVoid,
                        ApplicationLauncher.AppScenes.SPACECENTER,
                        (Texture)GameDatabase.Instance.GetTexture(TextureFolder + Iconfile, false));

                    if (WindowRoster.ShowWindow)
                        RMRoster_Stock.SetTexture((Texture)GameDatabase.Instance.GetTexture(WindowRoster.ShowWindow ? TextureFolder + "Icon_On_38" : TextureFolder + "Icon_Off_38", false));
                }

            }
            catch (Exception ex)
            {
                Utilities.LogMessage("Error in:  RosterManagerAddon.OnGUIAppLauncherReady.  " + ex.ToString(), "Error", true);
            }
        }
开发者ID:JPLRepo,项目名称:RosterManager,代码行数:30,代码来源:RMAddon.cs

示例4: OnGuiAppLauncherReady

        // Stock Toolbar Startup and cleanup
        private void OnGuiAppLauncherReady()
        {
            try
              {
            // Setup SM WIndow button
            if (HighLogic.LoadedSceneIsFlight && _smButtonStock == null && !SMSettings.EnableBlizzyToolbar)
            {
              string iconfile = "IconOff_38";
              _smButtonStock = ApplicationLauncher.Instance.AddModApplication(
            OnSmButtonClicked,
            OnSmButtonClicked,
            DummyHandler,
            DummyHandler,
            DummyHandler,
            DummyHandler,
            ApplicationLauncher.AppScenes.FLIGHT | ApplicationLauncher.AppScenes.MAPVIEW,
            GameDatabase.Instance.GetTexture(TextureFolder + iconfile, false));

              if (WindowManifest.ShowWindow)
            _smButtonStock.SetTexture(
              GameDatabase.Instance.GetTexture(
                WindowManifest.ShowWindow ? TextureFolder + "IconOn_38" : TextureFolder + "IconOff_38", false));
            }

            // Setup Settings Button
            if (HighLogic.LoadedScene == GameScenes.SPACECENTER && _smSettingsStock == null &&
            !SMSettings.EnableBlizzyToolbar)
            {
              string iconfile = "IconS_Off_38";
              _smSettingsStock = ApplicationLauncher.Instance.AddModApplication(
            OnSmSettingsClicked,
            OnSmSettingsClicked,
            DummyHandler,
            DummyHandler,
            DummyHandler,
            DummyHandler,
            ApplicationLauncher.AppScenes.SPACECENTER,
            GameDatabase.Instance.GetTexture(TextureFolder + iconfile, false));

              if (WindowSettings.ShowWindow)
            _smSettingsStock.SetTexture(
              GameDatabase.Instance.GetTexture(
                WindowSettings.ShowWindow ? TextureFolder + "IconS_On_38" : TextureFolder + "IconS_Off_38", false));
            }

            // Setup Roster Button
            if (HighLogic.LoadedScene != GameScenes.SPACECENTER || _smRosterStock != null || SMSettings.EnableBlizzyToolbar)
              return;
            {
              string iconfile = "IconR_Off_38";
              _smRosterStock = ApplicationLauncher.Instance.AddModApplication(
            OnSmRosterClicked,
            OnSmRosterClicked,
            DummyHandler,
            DummyHandler,
            DummyHandler,
            DummyHandler,
            ApplicationLauncher.AppScenes.SPACECENTER,
            GameDatabase.Instance.GetTexture(TextureFolder + iconfile, false));

              if (WindowRoster.ShowWindow)
            _smRosterStock.SetTexture(
              GameDatabase.Instance.GetTexture(
                WindowRoster.ShowWindow ? TextureFolder + "IconR_On_38" : TextureFolder + "IconR_Off_38", false));
            }
              }
              catch (Exception ex)
              {
            Utilities.LogMessage("Error in:  SMAddon.OnGUIAppLauncherReady.  " + ex, Utilities.LogType.Error, true);
              }
        }
开发者ID:Kerbas-ad-astra,项目名称:ShipManifest,代码行数:72,代码来源:SMAddon.cs


注:本文中的ApplicationLauncherButton.SetTexture方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。