public void Show(ModeButton Mode = ModeButton.Normal) { GlobalMutex.GetMutex.WaitOne(); if (Mode == ModeButton.Normal) { Console.ForegroundColor = ConsoleColor.White; m_status = 0; } else if (Mode == ModeButton.Move) { Console.ForegroundColor = ConsoleColor.Red; m_status = 1; } else if (Mode == ModeButton.Click) { Console.ForegroundColor = ConsoleColor.DarkYellow; Console.BackgroundColor = ConsoleColor.DarkBlue; m_status = 2; } WindowShow(); if (Mode == ModeButton.Move) { Console.SetCursorPosition(Left + Width - 1, Top); Console.Write('x'); } int space = (20 - m_title.Length) / 2; Console.SetCursorPosition(Left + 1 + space, Top + 1); Console.WriteLine(m_title); Console.ForegroundColor = ConsoleColor.White; Console.BackgroundColor = ConsoleColor.Black; GlobalMutex.GetMutex.ReleaseMutex(); }
void ReleaseDesignerOutlets() { if (SearchButton != null) { SearchButton.Dispose(); SearchButton = null; } if (SearchInProgress != null) { SearchInProgress.Dispose(); SearchInProgress = null; } if (SearchInput != null) { SearchInput.Dispose(); SearchInput = null; } if (SearchResults != null) { SearchResults.Dispose(); SearchResults = null; } if (ModeButton != null) { ModeButton.Dispose(); ModeButton = null; } }
} //Show or hide (visable) 2 GameMode Button private void gunaButton2_Click(object sender, EventArgs e) { sound.Play(sound.click); ModeButton.Focus(); ShowPlayModeButton(false); f.rForm = new RuleForm(Location); f.rForm.Show(); Visible = false; }
private void Start() { Input.simulateMouseWithTouches = false; ModeButton = ModeButtonGameObject.GetComponent <ModeButton>(); //StartCoroutine(SurfaceCollider_CR()); surfaceCollider = GetComponent <Cognitics.UnityCDB.SurfaceCollider>();; TerrainTester = GameObject.Find("TerrainTester"); SurfaceCollider = TerrainTester.GetComponent <Cognitics.UnityCDB.SurfaceCollider>(); eventDataCurrentPosition = new PointerEventData(EventSystem.current); }
private void RuniForm(bool Mode) { ModeButton.Focus(); //Create InfoForm f.iForm = new InfoForm(Mode); f.iForm.Show(); //Hide StartForm ShowPlayModeButton(false); Visible = false; }
private void Exit_Button_Click(object sender, EventArgs e) { //hide Mode button ModeButton.Focus(); ShowPlayModeButton(false); //Show exitForm; Point location = new Point(Location.X + 200, Location.Y + 200); ExitForm eform = new ExitForm(location); sound.Play(sound.announce); eform.ShowDialog(); }
private void AddModeButton(GameMode mode, Transform parent, int y) { GameObject obj = Instantiate(modeButtonPrefab); ModeButton btn = obj.GetComponent <ModeButton> (); btn.mode = mode; if (parent.gameObject == customModeMenu) { btn.forCustom = true; } obj.transform.SetParent(parent, false); RectTransform rectTransform = (RectTransform)obj.transform; obj.transform.localPosition = new Vector3(0, y * rectTransform.rect.height * 1.5f, 0); }
public void Update(ModeButton mode = ModeButton.Normal) { GlobalMutex.GetMutex.WaitOne(); Console.ForegroundColor = ConsoleColor.Black; if (mode == ModeButton.Normal) { Console.BackgroundColor = ConsoleColor.DarkYellow; } else if (mode == ModeButton.Move) { Console.BackgroundColor = ConsoleColor.DarkGray; } else { Console.BackgroundColor = ConsoleColor.DarkGreen; } Console.SetCursorPosition(m_positionX, 0); Console.Write(" " + m_titles + " "); Console.ForegroundColor = ConsoleColor.DarkYellow; Console.BackgroundColor = ConsoleColor.Black; GlobalMutex.GetMutex.ReleaseMutex(); }
public ElementScreen() : base("Element") { AddElement(new Button("Button", "It is Button") { OnLeftClicked = () => { ModEntry.GetInstance().Monitor.Log("Clicked", LogLevel.Debug); } }); var toggleButton = new ToggleButton("ToggleButton", "It is Toggle"); toggleButton.OnLeftClicked = () => { ModEntry.GetInstance().Monitor.Log(toggleButton.Toggled + "", LogLevel.Debug); }; AddElement(toggleButton); var modeButton = new ModeButton("ModeButton", "Left key plus right key minus") { modes = new List <string> { "Mode1", "Mode2", "Mode3", "Mode4" }, Current = "Mode1" }; modeButton.OnLeftClicked = () => { ModEntry.GetInstance().Monitor.Log(modeButton.Current, LogLevel.Debug); }; AddElement(modeButton); AddElementRange(new Label("Label1", "It is Label1"), new Label("Label2", "It is Label2"), new Label("Label3", "It is Label3"), new Label("Label4", "It is Label4")); AddElement(new ValueButton("ValueButton", "It is ValueButton") { Current = 1, Min = 1, Max = 10 }); AddElement(new Button("Colors", "Colors") { OnLeftClicked = () => { OpenScreenGui(new Colors()); } }); }
public void Show(ModeButton Mode = ModeButton.Normal) { GlobalMutex.GetMutex.WaitOne(); if (Mode == ModeButton.Normal) { Console.ForegroundColor = ConsoleColor.White; } else if (Mode == ModeButton.Move) { Console.ForegroundColor = ConsoleColor.Red; } else if (Mode == ModeButton.Click) { Console.ForegroundColor = ConsoleColor.Black; Console.BackgroundColor = ConsoleColor.DarkGreen; } WindowShow(); Console.SetCursorPosition(Left + 2, Top + 1); Console.WriteLine(m_Caption); Console.ForegroundColor = ConsoleColor.White; Console.BackgroundColor = ConsoleColor.Black; GlobalMutex.GetMutex.ReleaseMutex(); }
protected override void AddButton(GameObject target, AudioSource audioSourceDown, AudioSource audioSourceUp) { ModeButton button = Undoable.AddComponent <ModeButton>(target); PopulateButton(button, audioSourceDown, audioSourceUp); }
public void PopulateButton(ModeButton button, AudioSource audioSourceDown, AudioSource audioSourceUp) { base.PopulateButton(button, audioSourceDown, audioSourceUp); button.clickOnTriggerExit = true; button.mode = mode; }
private IEnumerator PopButton(ModeButton obj, float transitionTime = 0, float delay = 0) { yield return new WaitForSeconds (delay * Time.timeScale); obj.rectTransform.localScale = Vector3.zero; obj.button.SetActive (true); float timeToComplete = 0; float popScale = 0; float maxScale = 1.75f; Vector2 translateVector = Vector2.one * 0.5f; while (timeToComplete < transitionTime) { popScale = Mathf.Lerp (0, maxScale, timeToComplete / transitionTime); obj.rectTransform.localScale = popScale * Vector3.one; translateVector = Vector2.Lerp (translateVector, obj.initialPosition, timeToComplete / transitionTime); obj.rectTransform.anchorMax = translateVector; obj.rectTransform.anchorMin = translateVector; timeToComplete += Time.deltaTime / Time.timeScale; yield return null; } obj.rectTransform.localScale = Vector3.one; obj.rectTransform.anchorMax = obj.initialPosition; obj.rectTransform.anchorMin = obj.initialPosition; }
private void InitModeButton(ModeButton mode) { mode.rectTransform = mode.button.GetComponent<RectTransform> (); mode.initialPosition = mode.rectTransform.anchorMax; mode.button.SetActive (false); }
private IEnumerator DepopButton(ModeButton obj, float transitionTime = 0) { float timeToComplete = 0; float depopScale = 0; Vector2 endVector = Vector2.one * 0.5f; Vector2 translateVector; while (timeToComplete < transitionTime) { depopScale = Mathf.Lerp (1, 0, timeToComplete / transitionTime); obj.rectTransform.localScale = depopScale * Vector3.one; translateVector = Vector2.Lerp (obj.initialPosition, endVector, timeToComplete / transitionTime); obj.rectTransform.anchorMax = translateVector; obj.rectTransform.anchorMin = translateVector; timeToComplete += Time.deltaTime / Time.timeScale; yield return null; } obj.rectTransform.localScale = Vector3.zero; obj.button.SetActive (false); }