private void Start() { winScreen = transform.Find("WinScreen").gameObject; winText = transform.Find("WinScreen/WinMessage").GetComponent <Text>(); restartButton = transform.Find("WinScreen/RestartButton").GetComponent <Button>(); quitButton = transform.Find("WinScreen/QuitButton").GetComponent <Button>(); messageBox = transform.Find("MessageBox").GetComponent <UIMessageBox>(); messageBox.Init(); countDown = transform.Find("CountDown").GetComponent <CountDownControl>(); countDown.Init(this); winScreen.SetActive(false); helpTextBox = transform.Find("HelpText").gameObject; helpTextLabel = transform.Find("HelpText/Label").GetComponent <Text>(); ClearHelpText(); restartButton.onClick.AddListener(RestartButtonPressed); quitButton.onClick.AddListener(QuitButtonPressed); progress = transform.Find("Progress").GetComponent <ProgressControl>(); tipsDisplay = transform.Find("Tips").GetComponent <UITipsDisplay>(); lobby = transform.Find("LobbyUI").GetComponent <UILobby>(); audioSource = Camera.main.gameObject.AddComponent <AudioSource>(); }
private void OnDisable() { UIMessageBox.StopTimeUp(); UIMessageBox.m_CoroutineManager.StopAllCoroutine(); base.CancelInvoke(); Units.OnUnitsDead -= new Action <Units, Units>(this.OnTowerDeath); }
public void OpenMessage(TYPE _type, string _title, string _content, UIMessageBox.CallBackFunction _yes_callback = null, UIMessageBox.CallBackFunction _no_callback = null) { if (_type == TYPE.YesOrNo || _type == TYPE.Ok) { UIMessageBox ui_box = MenuManager.instance.CreateMenu <UIMessageBox>(); ui_box.OpenScreen(); ui_box.mTitle.text = TextManager.instance.GetText(_title); ui_box.mContent.text = TextManager.instance.GetText(_content); ui_box.mYesCallback = _yes_callback; ui_box.mNoCallback = _no_callback; if (_type == TYPE.YesOrNo) { ui_box.mBtnYes.gameObject.SetActive(true); ui_box.mBtnNo.gameObject.SetActive(true); ui_box.mBtnOK.gameObject.SetActive(false); } else if (_type == TYPE.Ok) { ui_box.mBtnYes.gameObject.SetActive(false); ui_box.mBtnNo.gameObject.SetActive(false); ui_box.mBtnOK.gameObject.SetActive(true); } } else if (_type == TYPE.RollMessage) { UIRollMessageBox roll_message_ui = MenuManager.instance.CreateMenu <UIRollMessageBox>(); roll_message_ui.OpenScreen(); roll_message_ui.SetMessage(TextManager.instance.GetText(_content)); } }
private bool Validate() { try { System.Net.IPAddress.Parse(Result); } catch { Disable(); if (myMsg != null) { Parent.RemoveChild(myMsg); } myMsg = new UIMessageBox("Not a valid IP Address", "Error", true) { Size = new Vector2(192, 48) }; Parent.AddChild(myMsg); myMsg.Centre(); myMsg.Closed += delegate(object sender, EventArgs e2) { myMsg = null; Enable(); }; return(false); } return(true); }
public void Visited() { //筛选出只与当前民族对应的数据 Nation nation = nations.FirstOrDefault(a => a.nation_name.Equals(info)); if (nation.nation_name.Equals(info)) { var _nation = new Nation() { nation_no = nation.nation_no, delete_mk = 1, datachg_usr = LoginInfo.WorkerNo, datachg_date = DateTime.Now }; if (_nation != null) { bool n = new BaseService().DelNation(_nation); if (n == true) { UIMessageBox.ShowSuccess("删除成功!"); ReloadNationList(); } } } }
private void OnDestroy() { MobaMessageManager.UnRegistMessage((ClientMsg)20007, new MobaMessageFunc(this.ClearPromptList)); UIMessageBox.m_CoroutineManager.StopAllCoroutine(); base.CancelInvoke(); UIMessageBox.m_Instance = null; }
private void uiSymbolButton8_Click_1(object sender, EventArgs e) { if (bookid.Text.Trim() == "" || address.Text.Trim() == "" || state.Text.Trim() == "") { UIMessageBox.ShowError("请填写完整信息"); } else { try { string sql = "insert into bookcase values('" + bookid.Text.Trim() + "','" + address.Text.Trim() + "','" + state.Text.Trim() + "')"; if (SqlHelper.ExecuteNonQuery(sql) > 0) { UIMessageBox.ShowSuccess("添加成功!"); caseid.Text = ""; bookid.Text = ""; address.Text = ""; state.Text = ""; SqlHelper.setGDV("select caseid 编号, id 书架编号, address 藏书地址,state 借阅状态 from bookcase", uiDataGridView7); } else { UIMessageTip.ShowError("添加失败"); } } catch { UIMessageBox.ShowError("添加失败"); } } }
public override void Trigger() { var dataObjs = data.GetDataFromIds(); items = new Item[dataObjs.Length]; for (int i = 0; i < items.Length; i++) { items[i] = ((ItemData)dataObjs[i]).CreateItem(PlayerController.Player.Inventory); } string itemNames = items.Length > 0 ? "You found " : "No items found"; for (int i = 0; i < items.Length; i++) { itemNames += items[i].Data.Name; if (i < items.Length - 1) { itemNames += ", "; } } messageBox = GameUIController.CurrentScreen.AddUIElement(new UIMessageBox( new Transform(Alignment.MiddleCenter, new Vector2(500, 250)), MainGame.Singleton.Content.Load <SpriteFont>("Fonts/Arial"), itemNames, TextAlign.TopCenter, 5, ContentHelper.Box4x4_Sprite, new EventArg0(_Trigger), GameUIController.CurrentScreen )); }
private void uiButton2_Click(object sender, EventArgs e) { RemoteOverclock remoteOverclock = new RemoteOverclock(); remoteOverclock.function = "overclock"; GPUOverClock gPUOverClock = new GPUOverClock(); remoteOverclock.OVData = gPUOverClock; remoteOverclock.OVData.Name = selectGPU.Text; remoteOverclock.OVData.Power = "0"; remoteOverclock.OVData.TempLimit = "0"; remoteOverclock.OVData.CoreClock = "0"; remoteOverclock.OVData.MemoryClock = "0"; if (selectGPU.Text.Contains("NVIDIA")) { remoteOverclock.OVData.CV = "N/A"; remoteOverclock.OVData.MV = "N/A"; } else { remoteOverclock.OVData.CV = "0"; remoteOverclock.OVData.MV = "0"; } remoteOverclock.OVData.Fan = "0"; string msg = JsonConvert.SerializeObject(remoteOverclock); for (int i = 0; i < remoteMinerStatusList.Count; i++) { UDPHelper.Send(msg, remoteMinerStatusList[i].IP); } UIMessageBox.Show("设置完成", "提示"); }
// 删除图书 private void uiSymbolButton9_Click_1(object sender, EventArgs e) { SqlHelper.ExecuteNonQuery("delete from bookcase where id = '" + tushucaozuoDV[0, tushucaozuoDV.CurrentCell.RowIndex].Value.ToString() + "'"); SqlHelper.ExecuteNonQuery("delete from book where id = '" + tushucaozuoDV[0, tushucaozuoDV.CurrentCell.RowIndex].Value.ToString() + "'"); UIMessageBox.ShowSuccess("删除成功!"); SqlHelper.setGDV("select id 编号, bookName 书名, author 作者,bookNumber 数量, publishCompany 出版社, publishDate 出版时间, bookType 类型, pages 页数, wordsNumber 字数 from book", tushucaozuoDV); }
void OnDestroy() { if (mInst == this) { mInst = null; } }
public void DestroyMessageBox(UIMessageBox messageBox) { if (null != messageBox) { GameObject.Destroy(messageBox.gameObject); } }
public UIMessageBox CreateMessageBox() { if (null != messageBoxPrefab && null != canvasObject) { GameObject messageBoxObject = Object.Instantiate <GameObject>(messageBoxPrefab); if (null != messageBoxObject) { messageBoxObject.SetActive(false); messageBoxObject.transform.position = Vector3.zero; messageBoxObject.transform.SetParent(canvasObject.transform, false); UIMessageBox msgBox = messageBoxObject.GetComponent <UIMessageBox>(); if (null != msgBox) { msgBox.manager = this; } return(msgBox); } } return(null); }
public override void SynInfo(SynSkillInfo info) { if (info.extraInt1 == 0 && this.unit.isPlayer) { UIMessageBox.ShowMessage("现在不能释放", 1.5f, 0); } }
private void uiButton9_Click(object sender, EventArgs e) { if (!checkTableSelected(MinerStatusTable)) { UIMessageBox.ShowError("请选择矿机"); return; } RemoteOtherOptions remoteOtherOptions = new RemoteOtherOptions(); remoteOtherOptions.function = "otherOption"; remoteOtherOptions.autoLogin = loginStart.Checked; remoteOtherOptions.autoMining = autoMining.Checked; remoteOtherOptions.autoMiningTime = autoMiningTime.Text; remoteOtherOptions.autoOv = autoOverclock.Checked; string msg = JsonConvert.SerializeObject(remoteOtherOptions); var i = 0; for (; i < MinerStatusTable.Rows.Count; i++) { if (MinerStatusTable.Rows[i].Cells[2].Value == null) { continue; } if (MinerStatusTable.Rows[i].Cells[2].Value.ToString() == "True") { UDPHelper.Send(msg, MinerStatusTable.Rows[i].Cells[12].Value.ToString()); UIMessageBox.Show("设置完成", "提示"); return; } } }
private void bSave_onLeftClick(object sender, EventArgs e) { if (textbox.Text.Length > 0) { textbox.Unfocus(); if (ModUtils.NetworkMode == NetworkMode.None) { if (!Waypoints.AddWaypoint(textbox.Text, waypointPos)) { UIMessageBox mb = new UIMessageBox(HEROsMod.HeroText("WaypointAlreadyExistsNote"), UIMessageBoxType.Ok, true); this.AddChild(mb); } else { Close(); } } else { HEROsModNetwork.GeneralMessages.RequestAddWaypoint(textbox.Text, waypointPos); Close(); } } }
private void bDelete_onLeftClick(object sender, EventArgs e) { UIMessageBox mb = new UIMessageBox(string.Format(HEROsMod.HeroText("AreYouSureDeleteGroup"), dropdown.Text), UIMessageBoxType.YesNo, true); mb.yesClicked += mb_yesClicked; this.Parent.AddChild(mb); }
void bDelete_onLeftClick(object sender, EventArgs e) { UIMessageBox mb = new UIMessageBox("Are you sure you want to delete the " + dropdown.Text + " group?", UIMessageBoxType.YesNo, true); mb.yesClicked += mb_yesClicked; this.Parent.AddChild(mb); }
public static void ShowMessageBox(string title, string content, Callback ok, Callback cancle) { GTWindowManager.Instance.OpenWindow(EWindowID.UIMessageBox); UIMessageBox dialog = (UIMessageBox)GTWindowManager.Instance.GetWindow(EWindowID.UIMessageBox); dialog.ShowView(title, content, ok, cancle); }
private void btnAddSellThing_Click(object sender, EventArgs e) { st = new SellThing() { SellNo = txtSellNo.Text, SellName = txtSellName.Text, SellPrice = Convert.ToDecimal(txtSellPrice.Text), format = Convert.ToString(txtformat.Text), Stock = Convert.ToInt32(txtStock.Text), datains_usr = AdminInfo.Account, datains_date = DateTime.Now }; if (CheckInput(st)) { new SellService().InsertSellThing(st); MessageBox.Show("添加商品成功"); dgvSellthing.DataSource = new SellService().SelectSellThingAll(); string SellId = new CounterHelper().GetNewId("SellId"); txtSellNo.Text = SellId; } else { UIMessageBox.ShowError("信息不完整,请检查!"); return; } }
private void uiSymbolButton1_Click(object sender, EventArgs e) { string pwd = SqlHelper.MD5Hash(uiTextBox2.Text); string flag = uiRadioButton1.Checked ? "admin" : "users"; string sql = "select * from " + flag + " where id = '" + uiTextBox1.Text + "' and pwd = '" + pwd + "'"; object result = SqlHelper.ExecuteScalar(sql); if (result != null) { global.role = result.ToString(); global.username = uiTextBox1.Text; UIMessageBox.ShowSuccess("登录成功"); this.Hide(); if (flag == "admin") { new ManagerMain().Show(); } else if (flag == "users") { new ReaderMain().Show(); } } else { UIMessageBox.ShowError("用户名或密码错误"); } }
public static void InitResetButton(UIBuildMenu __instance) { buildMenu = __instance; GameObject buttonPrefab = RebindBuildBarPlugin.resources.bundle.LoadAsset <GameObject>("Assets/RebindBuildBar/UI/buildmenu-button.prefab"); GameObject buttonGo = Object.Instantiate(buttonPrefab, __instance.childGroup.transform, false); ((RectTransform)buttonGo.transform).anchoredPosition = new Vector2(-300, 5); UIButton button = buttonGo.GetComponent <UIButton>(); button.onClick += _ => { bool heldCtrl = CustomKeyBindSystem.GetKeyBind("ReassignBuildBar").keyValue; string msg = (heldCtrl ? "ResetBuildMenuQuestion1" : "ResetBuildMenuQuestion2").Translate(); UIMessageBox.Show("ResetBuildMenuQuestionTitle".Translate(), msg, "否".Translate(), "是".Translate(), UIMessageBox.QUESTION, null, () => { ResetBuildBarItems(heldCtrl); buildMenu.SetCurrentCategory(buildMenu.currentCategory); VFAudio.Create("ui-click-0", null, Vector3.zero, true); }); }; }
void bSave_onLeftClick(object sender, EventArgs e) { if (textbox.Text.Length > 0) { textbox.Unfocus(); if (ModUtils.NetworkMode == NetworkMode.None) { if (!Waypoints.AddWaypoint(textbox.Text, waypointPos)) { UIMessageBox mb = new UIMessageBox("A waypoint with this name already exists, please enter another name.", UIMessageBoxType.Ok, true); this.AddChild(mb); } else { Close(); } } else { HEROsModNetwork.GeneralMessages.RequestAddWaypoint(textbox.Text, waypointPos); Close(); } } }
public static void startMiner(UIRichTextBox LogOutput, ref UIPanel panel) { try { Process minerProcess = new Process(); minerProcess.StartInfo.FileName = Application.StartupPath + "\\miner\\" + minerBigName + "\\" + minerSmallName + ".exe"; minerProcess.StartInfo.Arguments = string.Format(getArguments(), miningPool, wallet, worker, argu); LogOutput.AppendText("[" + DateTime.Now.ToLocalTime().ToString() + "] 开始挖矿,启动参数:" + minerProcess.StartInfo.Arguments + ",若长时间无反应,请勾选显示原版内核查看错误提示\n"); minerProcess.StartInfo.CreateNoWindow = false; minerProcess.StartInfo.UseShellExecute = false; if (minerSmallName.ToLower().Contains("nb")) { #if DEBUG LogOutput.AppendText("nbminer"); #endif minerProcess.StartInfo.EnvironmentVariables.Remove("NBDEV"); minerProcess.StartInfo.EnvironmentVariables.Add("NBDEV", "#@@@TSAmlU3LTYLdf9NFpnQbkIpKVFex7gJvUmzC01xGSyw="); } minerProcess.Start(); fr = new showMinerWindow(panel, ""); IntPtr NbminerHandle = fr.Start(minerProcess); fr.Application_Idle(null, null); StringBuilder 参数 = new StringBuilder(); 参数.Append("\""); 参数.Append(minerProcess.StartInfo.FileName); 参数.Append("\" "); 参数.Append(minerProcess.StartInfo.Arguments); 生成原版bat(参数.ToString()); } catch (Exception ex) { UIMessageBox.ShowError("错误:" + ex.ToString()); } }
private void uiButton8_Click(object sender, EventArgs e) { if (!checkTableSelected(MinerStatusTable)) { UIMessageBox.ShowError("请选择矿机"); return; } RemoteReboot remoteReboot = new RemoteReboot(); remoteReboot.function = "setreboot"; remoteReboot.hourReboot = timeRestart.Text; remoteReboot.hashrateReboot = lowHashrateRestart.Text; string msg = JsonConvert.SerializeObject(remoteReboot); var i = 0; for (; i < MinerStatusTable.Rows.Count; i++) { if (MinerStatusTable.Rows[i].Cells[2].Value == null) { continue; } if (MinerStatusTable.Rows[i].Cells[2].Value.ToString() == "True") { UDPHelper.Send(msg, MinerStatusTable.Rows[i].Cells[12].Value.ToString()); UIMessageBox.Show("设置完成", "提示"); return; } } }
private void uiButton2_Click_1(object sender, EventArgs e) { List <RemoteMinerStatus> selectedMiner = new List <RemoteMinerStatus>(); for (int i = 0; i < MinerStatusTable.Rows.Count; i++) { if (MinerStatusTable.Rows[i].Cells[2].Value == null) { continue; } if (MinerStatusTable.Rows[i].Cells[2].Value.ToString() == "True") { for (int j = 0; j < MinerStatusLoad.remoteMinerStatusList.Count; j++) { if (MinerStatusLoad.remoteMinerStatusList[i].IP == MinerStatusTable.Rows[i].Cells[12].Value.ToString()) { selectedMiner.Add(MinerStatusLoad.remoteMinerStatusList[i]); } } } } if (selectedMiner.Count <= 0) { UIMessageBox.ShowError("请选择矿机"); return; } overClockForm overClockForm = new overClockForm(selectedMiner); overClockForm.ShowDialog(); }
private void uiButton7_Click(object sender, EventArgs e) { string sql = "update users set name = '" + name.Text + "', sex = '" + sex.Text + "',email = '" + email.Text + "', role = '" + role.Text + "',pwd = '" + SqlHelper.MD5Hash(psd.Text) + "' where id = '" + id.Text + "'"; SqlHelper.ExecuteNonQuery(sql); UIMessageBox.ShowSuccess("修改成功"); id.Enabled = name.Enabled = sex.Enabled = psd.Enabled = email.Enabled = role.Enabled = false; }
// 读者荐购 private void yes_Click_1(object sender, EventArgs e) { string sql = "insert into recommend (name, author, type,publish,reason) values('" + name.Text.Trim() + "','" + author.Text.Trim() + "','" + type.Text.Trim() + "','" + publish.Text.Trim() + "','" + reason.Text.Trim() + "')"; SqlHelper.ExecuteNonQuery(sql); UIMessageBox.ShowSuccess("推荐成功,感谢您的推荐!"); name.Text = author.Text = publish.Text = type.Text = reason.Text = ""; }
// 保存 private void uiButton7_Click(object sender, EventArgs e) { string sqlsave = "update admin set name = '" + uiTextBox9.Text + "', sex = '" + sex1.Text + "',email = '" + uiTextBox8.Text + "',pwd = '" + SqlHelper.MD5Hash(psd1.Text) + "' where id = '" + uiTextBox10.Text + "'"; SqlHelper.ExecuteNonQuery(sqlsave); UIMessageBox.ShowSuccess("修改成功"); id.Enabled = name.Enabled = sex1.Enabled = psd1.Enabled = email.Enabled = role.Enabled = false; }
public override void Destroy() { if (this.message_box != null) { this.message_box.StopAllCoroutines(); this.message_box = null; } base.Destroy(); }
/// <summary> /// Set the instance. /// </summary> void Awake() { mInst = this; }