Exemplo n.º 1
0
        private void CheckNewVersion()
        {
            var currentVer = (string)BstManager.Instance.SystemSettings["version"];

            new Thread(() =>
            {
                var releasedVer = BstManager.GetStringFromWeb(BstManager.GithubVersionTxt);
                // releasedVer是从网络下载的,在网络无法访问或下载失败的情况下,可能为null,需要做验证
                if (!String.IsNullOrEmpty(releasedVer) && currentVer != releasedVer)
                {
                    var result = BstManager.DisplayConfirmMessageBox(
                        this._i18N.LoadI18NValue("App", "newVerTitle"),
                        string.Format(
                            this._i18N.LoadI18NValue("App", "newVerContent"),
                            currentVer,
                            releasedVer,
                            BstI18NLoader.Instance.LoadI18NValue("App", "releaseSiteUrl"))
                        );
                    if (result == DialogResult.OK)
                    {
                        Process.Start(BstI18NLoader.Instance.LoadI18NValue("App", "releaseSiteUrl"));
                    }
                }
            }).Start();
        }
Exemplo n.º 2
0
 private void btnTopRestoreAll_Click(Object sender, EventArgs e)
 {
     // 恢复全部模型
     if (BstManager.DisplayConfirmMessageBox(
             this._i18N.LoadI18NValue("GuiItems", "actionConfirmTitle"),
             this._i18N.LoadI18NValue("GuiItems", "actionRestoreMsg")) == DialogResult.OK)
     {
         BstManager.Instance.RunGrunt(this.textBoxOut, "restore");
     }
 }
Exemplo n.º 3
0
 private void btnReplace_Click(Object sender, EventArgs e)
 {
     // 替换模型
     if (this._originElementId == null)
     {
         BstManager.DisplayErrorMessageBox(
             this._i18N.LoadI18NValue("GuiItems", "actionReplaceErrorTitle"),
             this._i18N.LoadI18NValue("GuiItems", "actionOriginEmptyErrorMsg")
             );
         return;
     }
     if (this._targetElementId == null)
     {
         BstManager.DisplayErrorMessageBox(
             this._i18N.LoadI18NValue("GuiItems", "actionReplaceErrorTitle"),
             this._i18N.LoadI18NValue("GuiItems", "actionTargetEmptyErrorMsg")
             );
         return;
     }
     if (this._originElementId == this._targetElementId)
     {
         BstManager.DisplayErrorMessageBox(
             this._i18N.LoadI18NValue("GuiItems", "actionReplaceErrorTitle"),
             this._i18N.LoadI18NValue("GuiItems", "actionTargetSameErrorMsg")
             );
         return;
     }
     if (this._formType == BstManager.TypeWeapon) // 只有武器不可替换
     {
         // FIXME 后续制作功能,并开发这个限制
         BstManager.DisplayErrorMessageBox(
             this._i18N.LoadI18NValue("GuiItems", "actionFuncNotDoneTitle"),
             this._i18N.LoadI18NValue("GuiItems", "actionWaitForFuncMsg")
             );
         return;
     }
     if (BstManager.DisplayConfirmMessageBox(
             this._i18N.LoadI18NValue("GuiItems", "actionConfirmTitle"),
             this._i18N.LoadI18NValue("GuiItems", "actionReplaceMsg")) == DialogResult.OK)
     {
         string race = null;
         if (this._formType == BstManager.TypeAttach ||
             this._formType == BstManager.TypeCostume)
         {
             race = BstManager.Instance.RaceTypes[this.comboBoxRace.SelectedIndex];
         }
         BstManager.Instance.RunGrunt(this.textBoxOut, "replace", new string[]
         {
             "--part=" + BstManager.GetTypeName(this._formType),
             "--model=" + this._targetElementId,
             "--race=" + race
         });
     }
 }