private void BtnBrowseCodeLibraryDirectory_Click(object sender, EventArgs e) { var libName = LbCodeLibrary.Text; if (libName == "") { MessageBox.Show("你必须先选择一个代码库"); return; } CodeLibrary.OpenDirectory(libName); }
private void BtnEditCodeLibraryMain_Click(object sender, EventArgs e) { var libName = LbCodeLibrary.Text; if (libName == "") { MessageBox.Show("你必须先选择一个代码库"); return; } CodeLibrary.OpenMain(libName); }
private void BtnDeleteCodeLibrary_Click(object sender, EventArgs e) { var libName = LbCodeLibrary.Text; var lastSelectCodeLibraryIndex = LbCodeLibrary.SelectedIndex; LbCodeLibrary.SelectedIndex = -1; if (libName == "") { MessageBox.Show("你必须先选择一个代码库"); } else if (CodeLibrary.Exists(libName)) { CodeLibrary.Delete(libName); } RefreshLbCodeLibrary(lastSelectCodeLibraryIndex); }
private void FixedUpdate() { if (disabled == false) { ToggleObjects(true); currentLevel = Mathf.Clamp(currentLevel + increasePerTime, 0, 8); imageSelector.SetImage(Mathf.RoundToInt(currentLevel)); imageManager.speedModifier = CodeLibrary.Remap(currentLevel, 0, 8, 0.1f, 1); } else { ToggleObjects(false); currentLevel = 0; lastInput = InputType.circle; } }
private void BtnRefreshCodeLibrary_Click(object sender, EventArgs e) { var libName = LbCodeLibrary.Text; if (libName == "") { MessageBox.Show("你必须先选择一个代码库"); return; } try { CodeLibrary.Refresh(libName); MessageBox.Show("代码库 " + libName + " 刷新成功!"); } catch { MessageBox.Show("代码库 " + libName + " 刷新失败,到Wow9.Org反馈问题。\r\n(请注意附上错误的文件和截图,最好能够直接将编辑器目录打包反馈)"); } }
private void BtnConfirm_Click(object sender, EventArgs e) { var newLibName = TbCodeLibraryName.Text; if (newLibName == "") { MessageBox.Show("请输入代码库名字。"); FocusTbCodeLibraryName(); } else { var firstChar = newLibName[0]; if (char.IsDigit(firstChar)) { MessageBox.Show("第一个字符不能是数字。"); FocusTbCodeLibraryName(); } else if (newLibName.Any(c => !char.IsLetterOrDigit(c) || c.IsChinese())) { MessageBox.Show("名字只允许使用大小写的英文字母和数字。"); FocusTbCodeLibraryName(); } else { switch (CodeLibrary.Create(newLibName)) { case CreateState.Success: { SucceedCreateCodeLibrary(newLibName); Dispose(); break; } case CreateState.ConflictName: { MessageBox.Show("已存在相同名字的代码库,换一个名字。"); FocusTbCodeLibraryName(); return; } } } } }
private void FormXYCodeLibraryManager_Load(object sender, EventArgs e) { CodeLibrary.LoadExistsFromDisk(); RefreshLbCodeLibrary(); }