private void ShowFormSetting_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F3) { ShowButton.PerformClick(); } }
//______________________________________________________ private void RemoveButton_Click(object sender, EventArgs e) { //Remove all contacts DialogResult dialogResult = MessageBox.Show("Are you sure you want to delete all your contacts?", "Remove everything?", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { connection.Open(); string comand = "DELETE FROM Table1"; OleDbCommand cmd = new OleDbCommand(comand, connection); cmd.ExecuteNonQuery(); connection.Close(); ClearAllTextBoxes(); ShowButton.PerformClick(); } }
private void ShowORHideButton() { if (TextDis.Text.Length > 0 && TextFocus.Text.Length > 0) { int dis = int.Parse(TextDis.Text); int con = int.Parse(TextFocus.Text); if (dis >= 1 && con >= 1) { ShowButton.Begin(); } else if (BtComfirm.Visibility == Visibility.Visible) { HideButton.Begin(); } } }
//______________________________________________________ void add() { //add to database the followinds based on the key connection.Open(); String query = "Insert into Table1(FName,LName,Phone,EMail,Address,City,ZCode,BDay,Photo,Music) " + "values ('" + FNameTextBox.Text + "','" + LNameTextBox.Text + "'," + "'" + Convert.ToInt32(PhoneTextBox.Text) + "', '" + EMailTextBox.Text + "'," + "'" + AddressTextBox.Text + "','" + CityTextBox.Text + "'," + "'" + Convert.ToInt32(ZCodeTextBox.Text) + "'," + "'" + BDay.Value.ToString() + "', '" + photo + "', '" + music + "' )"; OleDbCommand command = new OleDbCommand(query, connection); int count = command.ExecuteNonQuery(); connection.Close(); MessageBox.Show(count.ToString() + " Contact added successfully!"); ShowButton.PerformClick(); }
//______________________________________________________ private void SaveButton_Click(object sender, EventArgs e) { //Check if requested values are properly seted and procced to add(); if (FNameTextBox.Text != "") { if (LNameTextBox.Text != "") { if (NumberOnly(PhoneTextBox.Text)) { if (!Existance()) { if (CheckEMail(EMailTextBox.Text)) { if (NumberOnly(ZCodeTextBox.Text)) { add(); ShowButton.PerformClick(); } else { MessageBox.Show("Provide a valid Zip Code!"); } } else { MessageBox.Show("Please provide a valid E-Mail address!"); } } } else { MessageBox.Show("Please provide a valid phone number"); } } else { MessageBox.Show("Please provide a Last Name!"); } } else { MessageBox.Show("Please provide a First Name!"); } }
void ReleaseDesignerOutlets() { if (WolfVIew != null) { WolfVIew.Dispose(); WolfVIew = null; } if (HideButton != null) { HideButton.Dispose(); HideButton = null; } if (ShowButton != null) { ShowButton.Dispose(); ShowButton = null; } }
private async void VerifyDistractions(ThreadPoolTimer timer) { if (!IsInternet()) { await Dispatcher.RunAsync(CoreDispatcherPriority.High, () => { if ((ShowButton.GetCurrentState() == ClockState.Stopped || ShowButton.GetCurrentState() == ClockState.Filling) && BtNext.Visibility != Visibility.Visible) { ShowButton.Begin(); } }); } else { await Dispatcher.RunAsync(CoreDispatcherPriority.High, () => { if ((HideButton.GetCurrentState() == ClockState.Stopped || HideButton.GetCurrentState() == ClockState.Filling) && BtNext.Visibility != Visibility.Collapsed) { HideButton.Begin(); } }); } }
// Use this for initialization void Start() { desatColi = false; pc = GameObject.Find ("player").GetComponent<PlayerClimb> (); sB = this.gameObject.GetComponent ("ShowButton") as ShowButton; }
// Use this for initialization void Start() { desatColi = false; pc = GameObject.Find("player").GetComponent <PlayerClimb> (); sB = this.gameObject.GetComponent("ShowButton") as ShowButton; }
private Vector2 GuiContentList(Dictionary <string, PartContent> contentsList, ShowButton showButton, KASModuleContainer actionContainer, Vector2 scrollPos, bool showTotal = true, KASModuleContainer destContainer = null, float scrollHeight = 300f) { scrollPos = GUILayout.BeginScrollView(scrollPos, guiDataboxStyle, GUILayout.Width(600f), GUILayout.Height(scrollHeight)); foreach (PartContent item in contentsList.Values) { GUILayout.BeginHorizontal(); GUILayout.Label(new GUIContent(" " + item.part.title, "Name"), guiCenterStyle, GUILayout.Width(300f)); GUILayout.Label(new GUIContent(" " + item.storedSize.ToString("0.0"), "Size"), guiCenterStyle, GUILayout.Width(50f)); GUILayout.Label(new GUIContent(" " + item.averageMass.ToString("0.000"), "Mass"), guiCenterStyle, GUILayout.Width(50f)); GUILayout.Label(new GUIContent(" " + item.totalCount, "Quantity"), guiCenterStyle, GUILayout.Width(50f)); if (showButton == ShowButton.Add) { if (GUILayout.Button(new GUIContent("Add", "Add part to container"), guiButtonStyle, GUILayout.Width(50f))) { if (actionContainer.MaxSizeReached(item.grabModule, 1)) { fxSndBipWrong.audio.Play(); ScreenMessages.PostScreenMessage("Max size of the container reached !", 5, ScreenMessageStyle.UPPER_CENTER); return(scrollPos); } else { actionContainer.Add(item.part, 1); } } } if (showButton == ShowButton.Remove) { if (GUILayout.Button(new GUIContent("Remove", "Remove part from container"), guiButtonStyle, GUILayout.Width(60f))) { actionContainer.Remove(item.part, 1); } } if (showButton == ShowButton.Take) { if (GUILayout.Button(new GUIContent("Take", "Take part from container"), guiButtonStyle, GUILayout.Width(60f))) { actionContainer.Take(item); } /* * if (GUILayout.Button(new GUIContent("Attach", "Attach part"), guiButtonStyle, GUILayout.Width(60f))) * { * KASModuleGrab moduleGrab = ct.Key.partPrefab.GetComponent<KASModuleGrab>(); * KASAddonPointer.StartPointer(ct.Key.partPrefab, KASAddonPointer.PointerMode.CopyAndAttach, true, true, true, 2, this.part.transform, false); * }*/ } if (showButton == ShowButton.Move) { if (GUILayout.Button(new GUIContent("Move", "Move part to the destination container"), guiButtonStyle, GUILayout.Width(60f))) { actionContainer.Move(item, 1, destContainer); } } GUILayout.EndHorizontal(); } if (showTotal) { GUILayout.Space(5); GUILayout.BeginVertical(guiCenterStyle); GUILayout.BeginHorizontal(); GUIStyle guiLeftWhiteStyle = new GUIStyle(GUI.skin.label); guiLeftWhiteStyle.wordWrap = false; guiLeftWhiteStyle.normal.textColor = Color.white; guiLeftWhiteStyle.alignment = TextAnchor.MiddleLeft; GUIStyle guiRightWhiteStyle = new GUIStyle(GUI.skin.label); guiRightWhiteStyle.wordWrap = false; guiRightWhiteStyle.normal.textColor = Color.white; guiRightWhiteStyle.alignment = TextAnchor.MiddleRight; GUILayout.Label(new GUIContent("Weight : " + actionContainer.part.mass.ToString("0.000"), "Total weight of the container with contents"), guiRightWhiteStyle); GUILayout.Label(new GUIContent(" | Space : " + actionContainer.totalSize.ToString("0.0") + " / " + actionContainer.maxSize.ToString("0.0"), "Space used / Max space"), guiRightWhiteStyle); GUILayout.Label(new GUIContent(" | Cost : √" + actionContainer.GetModuleCost().ToString("0.00"), "Total cost of the container's contents"), guiRightWhiteStyle); GUILayout.EndHorizontal(); GUILayout.EndVertical(); } GUILayout.EndScrollView(); return(scrollPos); }
private Vector2 GuiContentList(Dictionary<AvailablePart, int> contentsList, ShowButton showButton, KASModuleContainer actionContainer, Vector2 scrollPos, bool showTotal = true, KASModuleContainer destContainer = null, float scrollHeight = 300f) { scrollPos = GUILayout.BeginScrollView(scrollPos, guiDataboxStyle, GUILayout.Width(600f), GUILayout.Height(scrollHeight)); foreach (KeyValuePair<AvailablePart, int> ct in contentsList) { GUILayout.BeginHorizontal(); GUILayout.Label(new GUIContent(" " + ct.Key.title, "Name"), guiCenterStyle, GUILayout.Width(300f)); GUILayout.Label(new GUIContent(" " + GetPartSize(ct.Key).ToString("0.0"), "Size"), guiCenterStyle, GUILayout.Width(50f)); GUILayout.Label(new GUIContent(" " + ct.Key.partPrefab.mass.ToString("0.000"), "Mass"), guiCenterStyle, GUILayout.Width(50f)); GUILayout.Label(new GUIContent(" " + ct.Value, "Quantity"), guiCenterStyle, GUILayout.Width(50f)); if (showButton == ShowButton.Add) { if (GUILayout.Button(new GUIContent("Add", "Add part to container"), guiButtonStyle, GUILayout.Width(50f))) { if (actionContainer.MaxSizeReached(ct.Key, 1)) { fxSndBipWrong.audio.Play(); ScreenMessages.PostScreenMessage("Max size of the container reached !", 5, ScreenMessageStyle.UPPER_CENTER); return scrollPos; } else { actionContainer.Add(ct.Key, 1); } } } if (showButton == ShowButton.Remove) { if (GUILayout.Button(new GUIContent("Remove", "Remove part from container"), guiButtonStyle, GUILayout.Width(60f))) { actionContainer.Remove(ct.Key, 1); } } if (showButton == ShowButton.Take) { if (GUILayout.Button(new GUIContent("Take", "Take part from container"), guiButtonStyle, GUILayout.Width(60f))) { actionContainer.Take(ct.Key); } /* if (GUILayout.Button(new GUIContent("Attach", "Attach part"), guiButtonStyle, GUILayout.Width(60f))) { KASModuleGrab moduleGrab = ct.Key.partPrefab.GetComponent<KASModuleGrab>(); KASAddonPointer.StartPointer(ct.Key.partPrefab, KASAddonPointer.PointerMode.CopyAndAttach, true, true, true, 2, this.part.transform, false); }*/ } if (showButton == ShowButton.Move) { if (GUILayout.Button(new GUIContent("Move", "Move part to the destination container"), guiButtonStyle, GUILayout.Width(60f))) { actionContainer.Move(ct.Key, 1, destContainer); } } GUILayout.EndHorizontal(); } if (showTotal) { GUILayout.Space(5); GUILayout.BeginVertical(guiCenterStyle); GUILayout.BeginHorizontal(); GUIStyle guiLeftWhiteStyle = new GUIStyle(GUI.skin.label); guiLeftWhiteStyle.wordWrap = false; guiLeftWhiteStyle.normal.textColor = Color.white; guiLeftWhiteStyle.alignment = TextAnchor.MiddleLeft; GUIStyle guiRightWhiteStyle = new GUIStyle(GUI.skin.label); guiRightWhiteStyle.wordWrap = false; guiRightWhiteStyle.normal.textColor = Color.white; guiRightWhiteStyle.alignment = TextAnchor.MiddleRight; GUILayout.Label(new GUIContent("Weight : " + actionContainer.part.mass.ToString("0.000"), "Total weight of the container with contents"), guiRightWhiteStyle); GUILayout.Label(new GUIContent(" | Space : " + actionContainer.totalSize.ToString("0.0") + " / " + actionContainer.maxSize.ToString("0.0"), "Space used / Max space"), guiRightWhiteStyle); GUILayout.EndHorizontal(); GUILayout.EndVertical(); } GUILayout.EndScrollView(); return scrollPos; }
/// <summary>カードを選択する</summary> IEnumerator CardChoice() { int ObjIndex = 0; bool EndFlag = false, Select = true; List <int> ChangeCardIndex = new List <int>(); if (gamePhase == GamePhase.Change) { ChangeButton.SetActive(true); SelectFrame.SetActive(true); } if (gamePhase == GamePhase.Select) { ShowButton.SetActive(true); SelectFrame.SetActive(true); } Vector3 FrameScale = SelectFrame.transform.localScale; while (!EndFlag) { if (Select) { SelectFrame.transform.position = player.PlayerZone[ObjIndex].transform.position; SelectFrame.transform.localScale = FrameScale; } else { if (gamePhase == GamePhase.Change) { SelectFrame.transform.position = ChangeButton.transform.position; SelectFrame.transform.localScale = new Vector3(50, 30, 1); } if (gamePhase == GamePhase.Select) { SelectFrame.transform.position = ShowButton.transform.position; SelectFrame.transform.localScale = new Vector3(50, 30, 1); } } if (Input.GetKeyDown(KeyCode.LeftArrow) || GetAxlsInput.X_Minus) { ObjIndex--; if (ObjIndex < 0) { ObjIndex = 6; } } if (Input.GetKeyDown(KeyCode.RightArrow) || GetAxlsInput.X_Plus) { ObjIndex++; if (ObjIndex > 6) { ObjIndex = 0; } } if (Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.DownArrow) || GetAxlsInput.Y_Minus || GetAxlsInput.Y_Plus) { Select = !Select; } if (Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.JoystickButton1)) { if (Select) { int Index = ChangeCardIndex.IndexOf(ObjIndex); if (Index == -1) { if (gamePhase == GamePhase.Select) { if (ChangeCardIndex.Count < 5) { CardUp(ChangeCardIndex, ObjIndex); } } else { CardUp(ChangeCardIndex, ObjIndex); } } else { SE[0].PlayOneShot(SE[0].clip); ChangeCardIndex.Remove(ObjIndex); player.PlayerCard[ObjIndex].transform.DOMove(player.PlayerZone[ObjIndex].transform.position, 0.5f); } } else { switch (gamePhase) { case GamePhase.Change: EndFlag = true; break; case GamePhase.Select: if (ChangeCardIndex.Count == 5) { EndFlag = true; TextFalse(); } else if (coroutine == null) { coroutine = StartCoroutine(TextPou("5枚選択してください")); } break; } } } yield return(null); } SelectFrame.transform.localScale = FrameScale; if (gamePhase == GamePhase.Change) { ChangeButton.SetActive(false); SelectFrame.SetActive(false); } if (gamePhase == GamePhase.Select) { ShowButton.SetActive(false); SelectFrame.SetActive(false); } ChangeCard(ChangeCardIndex); }
private void FixedUpdate() { for (var i = 0; i < currentCharacters.Count; i++) { if (currentCharacters[i].PreviousPosition == POSITION_AT_COUNTER - 1) { currentCharacters[i].transform.position = Vector3.MoveTowards(currentCharacters[i].transform.position, path.PathElements[currentCharacters[i].CurrentPosition].position, Time.fixedDeltaTime * currentCharacters[i].Speed); if (IsClick) { scoreController.HideReward(); if (currentCharacters[i].transform.position != path.PathElements[currentCharacters[i].CurrentPosition].position) { currentCharacters[i].Animator.SetBool("walk", true); if (bagsController.isFail) { bag.transform.position = Vector3.MoveTowards(bag.transform.position, pathForBag.PathElements[1].position, Time.deltaTime * speed); } else { bag.transform.position = Vector3.MoveTowards(bag.transform.position, pathForBag.PathElements[2].position, Time.deltaTime * speed); } ShowButton?.Invoke(false); } else { currentCharacters[i].Animator.SetBool("walk", false); DestroyCharacter(i); i = 0; IsMove = true; IsClick = false; } } } if (IsMove) { bag.transform.position = Vector3.MoveTowards(bag.transform.position, pathForBag.PathElements[0].position, Time.deltaTime * speed); if (currentCharacters[i].PreviousPosition == POSITION_AT_COUNTER - 1) { continue; } currentCharacters[i].transform.position = Vector3.MoveTowards(currentCharacters[i].transform.position, path.PathElements[currentCharacters[i].CurrentPosition].position, Time.fixedDeltaTime * currentCharacters[i].Speed); if (currentCharacters[i].transform.position != path.PathElements[currentCharacters[i].CurrentPosition].position) { currentCharacters[i].Animator.SetBool("walk", true); } else { currentCharacters[i].Animator.SetBool("walk", false); } var valueFinishetCharacters = 0; foreach (var character in currentCharacters) { if (!character.Animator.GetBool("walk")) { valueFinishetCharacters++; } } if (valueFinishetCharacters == currentCharacters.Count) { IsMove = false; bagsController.InstantiateBag(); scoreController.ShowReward(bagsController.ibag.Reward); ShowButton?.Invoke(!IsMove); SpawnCharacter(); } valueFinishetCharacters = 0; } } }