Beispiel #1
0
 public void SetSticky(string button, bool isSticky, AutoPatternBool pattern = null)
 {
     if (isSticky)
     {
         pattern ??= new AutoPatternBool(_on, _off);
         _boolPatterns[button] = pattern;
     }
     else
     {
         _boolPatterns.Remove(button);
     }
 }
Beispiel #2
0
		private void SetUpColumns()
		{
			TasView.AllColumns.Clear();
			AddColumn(CursorColumnName, string.Empty, 18);
			AddColumn(FrameColumnName, "Frame#", 68);

			var columnNames = GenerateColumnNames();
			foreach (var kvp in columnNames)
			{
				// N64 hack for now, for fake analog
				if (Emulator.SystemId == "N64")
				{
					if (kvp.Key.Contains("A Up") || kvp.Key.Contains("A Down") ||
					kvp.Key.Contains("A Left") || kvp.Key.Contains("A Right"))
					{
						continue;
					}
				}

				AddColumn(kvp.Key, kvp.Value, 20 * kvp.Value.Length);
			}

			var columnsToHide = TasView.AllColumns
				.Where(c => c.Name == "Power" || c.Name == "Reset");

			foreach (var column in columnsToHide)
			{
				column.Visible = false;
			}

			TasView.AllColumns.ColumnsChanged();			

			// Patterns
			int bStart = 0;
			int fStart = 0;
			if (BoolPatterns == null)
			{
				BoolPatterns = new AutoPatternBool[controllerType.BoolButtons.Count + 2];
				FloatPatterns = new AutoPatternFloat[controllerType.FloatControls.Count + 2];
			}
			else
			{
				bStart = BoolPatterns.Length - 2;
				fStart = FloatPatterns.Length - 2;
				Array.Resize(ref BoolPatterns, controllerType.BoolButtons.Count + 2);
				Array.Resize(ref FloatPatterns, controllerType.FloatControls.Count + 2);
			}

			for (int i = bStart; i < BoolPatterns.Length - 2; i++)
				BoolPatterns[i] = new AutoPatternBool(1, 1);
			BoolPatterns[BoolPatterns.Length - 2] = new AutoPatternBool(1, 0);
			BoolPatterns[BoolPatterns.Length - 1] = new AutoPatternBool(
				Global.Config.AutofireOn, Global.Config.AutofireOff);

			for (int i = fStart; i < FloatPatterns.Length - 2; i++)
				FloatPatterns[i] = new AutoPatternFloat(new float[] { 1f });
			FloatPatterns[FloatPatterns.Length - 2] = new AutoPatternFloat(new float[] { 1f });
			FloatPatterns[FloatPatterns.Length - 1] = new AutoPatternFloat(
				1f, Global.Config.AutofireOn, 0f, Global.Config.AutofireOff);

			SetUpToolStripColumns();
		}
Beispiel #3
0
		public void SetSticky(string button, bool isSticky, AutoPatternBool pattern = null)
		{
			if (isSticky)
			{
				if (pattern == null)
					pattern = new AutoPatternBool(On, Off);
				_boolPatterns[button] = pattern;
			}
			else
			{
				_boolPatterns.Remove(button);
			}
		}