コード例 #1
0
        /// <summary>
        /// initialises a Toolbar Button for this mod
        /// </summary>
        /// <returns>The ToolbarButtonWrapper that was created</returns>
        internal IButton InitToolbarButton()
        {
            IButton btnReturn = null;

            try
            {
                Log.detail("Initialising the Toolbar Icon");
                btnReturn             = ToolbarManager.Instance.add("KerbalAlarmClock", "btnToolbarIcon");
                btnReturn.TexturePath = KACResources.GetIconTexturePath(KACUtils.PathToolbarIcons, "KACIcon-Norm");
                btnReturn.ToolTip     = "Kerbal Alarm Clock";
                btnReturn.OnClick    += (e) =>
                {
                    WindowVisibleByActiveScene = !WindowVisibleByActiveScene;
                    settings.Save();
                };
            }
            catch (Exception ex)
            {
                DestroyToolbarButton(btnReturn);
                Log.error(ex, "Error Initialising Toolbar Button");
            }
            return(btnReturn);
        }
コード例 #2
0
 void ddlSettingsSkin_OnSelectionChanged(KerbalAlarmClock.DropDownList sender, int OldIndex, int NewIndex)
 {
     settings.SelectedSkin = (Settings.DisplaySkin)NewIndex;
     KACResources.SetSkin(settings.SelectedSkin);
     settings.Save();
 }