Exemple #1
0
		private void SendMessage(EventArgs x) {
			if (Manager.UseGuide && Guide.IsVisible)
				return;

			KeyEventArgs k = new KeyEventArgs();
			GamePadEventArgs g = new GamePadEventArgs(PlayerIndex.One);

			if (x is KeyEventArgs)
				k = x as KeyEventArgs;
			else if (x is GamePadEventArgs)
				g = x as GamePadEventArgs;

			ConsoleChannel ch = channels[cmbMain.Text];
			if (ch != null) {
				txtMain.TextColor = ch.Color;

				string message = txtMain.Text;
				if ((k.Key == Microsoft.Xna.Framework.Input.Keys.Enter || g.Button == GamePadActions.Press) && message != null && message != "") {
					x.Handled = true;

					ConsoleMessageEventArgs me = new ConsoleMessageEventArgs(new ConsoleMessage(message, ch.Index));
					OnMessageSent(me);

					buffer.Add(new ConsoleMessage(me.Message.Text, me.Message.Channel));

					txtMain.Text = "";
					ClientArea.Invalidate();

					CalcScrolling();
				}
			}
		}
Exemple #2
0
		void txtMain_GamePadDown(object sender, GamePadEventArgs e) {
			SendMessage(e);
		}
Exemple #3
0
		void btnSlider_GamePadPress(object sender, GamePadEventArgs e) {
			if (e.Button == GamePadActions.Left || e.Button == GamePadActions.Down)
				Value -= stepSize;
			if (e.Button == GamePadActions.Right || e.Button == GamePadActions.Up)
				Value += stepSize;
		}
Exemple #4
0
		void Input_GamePadDown(object sender, GamePadEventArgs e) {
			if (Visible && (Manager.FocusedControl != null && Manager.FocusedControl.Root == this)) {
				if (e.Button == (GamePadActions as EWindowGamePadActions).Accept) {
					Close(EModalResult.Ok);
				} else if (e.Button == (GamePadActions as EWindowGamePadActions).Cancel) {
					Close(EModalResult.Cancel);
				}
			}
		}
Exemple #5
0
		void Input_GamePadDown(object sender, GamePadEventArgs e) {
			if (this.Contains(Manager.FocusedControl, true)) {
				if (e.Button == (GamePadActions as ETabControlGamePadActions).NextTab) {
					e.Handled = true;
					SelectedIndex += 1;
				} else if (e.Button == (GamePadActions as ETabControlGamePadActions).PrevTab) {
					e.Handled = true;
					SelectedIndex -= 1;
				}
			}
		}