public static Color ToColor(this KeyColor color) { switch (color) { case KeyColor.KeyBlue: return(Color.Blue); case KeyColor.KeyCyan: return(Color.Cyan); case KeyColor.KeyGreen: return(Color.Green); case KeyColor.KeyMagenta: return(Color.Magenta); case KeyColor.KeyRed: return(Color.Red); case KeyColor.KeyYellow: return(Color.Yellow); default: throw new NotImplementedException(); } }
public void SetKeyFill(KeyColor inputColor) { switch (inputColor) { case KeyColor.BLACK: fill = new System.Drawing.SolidBrush(System.Drawing.Color.Black); break; case KeyColor.RED: fill = new System.Drawing.SolidBrush(System.Drawing.Color.Red); break; case KeyColor.GREEN: fill = new System.Drawing.SolidBrush(System.Drawing.Color.Green); break; case KeyColor.BLUE: fill = new System.Drawing.SolidBrush(System.Drawing.Color.Blue); break; case KeyColor.YELLOW: fill = new System.Drawing.SolidBrush(System.Drawing.Color.Yellow); break; default: fill = new System.Drawing.SolidBrush(System.Drawing.Color.White); break; } }
public static InventoryItemType ToInventeryItemType(this KeyColor color) { switch (color) { case KeyColor.KeyBlue: return(InventoryItemType.KeyBlue); case KeyColor.KeyCyan: return(InventoryItemType.KeyCyan); case KeyColor.KeyGreen: return(InventoryItemType.KeyGreen); case KeyColor.KeyMagenta: return(InventoryItemType.KeyMagenta); case KeyColor.KeyRed: return(InventoryItemType.KeyRed); case KeyColor.KeyYellow: return(InventoryItemType.KeyYellow); default: throw new NotImplementedException(); } }
public void UpdateColor() { metroSMMainForm.Style = mainColor; switch (mainColor) { case MetroFramework.MetroColorStyle.Red: mainKeyColor = KeyColor.RED; learnHandler.mainKeyColor = KeyColor.RED; break; case MetroFramework.MetroColorStyle.Green: mainKeyColor = KeyColor.GREEN; learnHandler.mainKeyColor = KeyColor.GREEN; break; case MetroFramework.MetroColorStyle.Blue: mainKeyColor = KeyColor.BLUE; learnHandler.mainKeyColor = KeyColor.BLUE; break; case MetroFramework.MetroColorStyle.Yellow: mainKeyColor = KeyColor.YELLOW; learnHandler.mainKeyColor = KeyColor.YELLOW; break; default: mainKeyColor = KeyColor.BLUE; learnHandler.mainKeyColor = KeyColor.BLUE; break; } }
public Bar(int x, int length, int bottom_offset, KeyColor color) { this.X = x; this.Y = new int[length]; this.Length = length; this.Bottom_offset = bottom_offset; this.Color = color; }
public ChromaKeyData() { LowerLimit = 0; UpperLimit = 1; KeyColor = Color.FromArgb(0, 255, 0); KeySaturation = HSV.FromRGB(KeyColor).S; KeyHue = KeyColor.GetHue(); HueTolerance = 5; SaturationTolerance = HueTolerance / 100; }
/// <summary> /// Constructor /// </summary> /// <param name="ns">Notescheduler handles all the code for playing music</param> /// <param name="_Keyboard">Keyboard to draw the keyboard</param> /// <param name="_canvas">Canvas needed to draw and fill in the colors</param> public LearnHandler(NoteScheduler ns, List <Key> _Keyboard, System.Windows.Forms.Panel _canvas, MetroButton _learnSongBtn, MetroButton _previewSongBtn, KeyColor _mainKeyColor, MidiFileHandler mfh) { MFH = mfh; noteScheduler = ns; MidiFileDirectory = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase), "MidiTextFiles"); keyBoard = _Keyboard; canvas = _canvas; LearnSongBtn = _learnSongBtn; PreviewSongBtn = _previewSongBtn; mainKeyColor = _mainKeyColor; }
public KeyColorMyRawBitmapData(Bitmap b) : base(b) { List <KeyColor> k = getKeyColor(this, 1); if (k.Count > 0) { keyColor = k[0]; } else { keyColor = null; } }
private void Unlock(KeyColor keyType) { if (keyType != KeyTypeToUnlock) { return; } Color color = _spriteRenderer.color; color.a = 0.5f; _spriteRenderer.color = color; _boxCollider2D.enabled = false; }
//色と位置の初期化 public void Initialize(KeyColor keyColor, float offset) { ren = gameObject.GetComponent <Renderer>(); if (keyColor == KeyColor.White) { inactiveKeyColor = whiteKeyColor; } else { inactiveKeyColor = blackKeyColor; } ren.material.color = inactiveKeyColor; transform.localPosition += Vector3.forward * offset; defaultLocalPos = transform.localPosition; }
void Update() { if (Extensions.Editor()) { if (keyColor != oldKeyColor) { oldKeyColor = keyColor; closed = opened = keyColor.color; opened.a = openedAlpha; closed.a = closedAlpha; } colored.color = closed; colored.Update(); } else { GetComponent<MeshRenderer>().material.ChangeAlpha(Opened(Player.instance.current) ? openedAlpha : closedAlpha); } }
public void AddKey(KeyColor color) { if (color == KeyColor.Gold) { goldkey++; } else if (color == KeyColor.Green) { greenKey++; } else if (color == KeyColor.Red) { redKey++; } }
void Update() { if (Extensions.Editor()) { if (keyColor == null) { Debug.Log("Key {0}: keyColor missing; set some", this); keyColor = FindObjectOfType<KeyColor>(); } } colored.color = keyColor.color; colored.Update(); //if (!Extensions.Editor()) { // gameObject.name = string.Format("{0} key{1}", keyColor.name, inventorySlot == null ? "" : " in " + inventorySlot.name); //} }
public Sound(string name, KeyColor color) { Name = name; Color = color; if (color == KeyColor.Black) { BlackImage = new BitmapImage(new Uri("ms-appx:///Assets/Images/Black.png")); AudioFile = string.Format("ms-appx:///Assets/Audio/22.wav", name); } else if (color == KeyColor.White) { WhiteImage = new BitmapImage(new Uri("ms-appx:///Assets/Images/White.PNG")); AudioFile = string.Format("ms-appx:///Assets/Audio/11.wav", name); } }
void Update() { if (Extensions.Editor()) { if (keyColor != oldKeyColor) { oldKeyColor = keyColor; closed = opened = keyColor.color; opened.a = openedAlpha; closed.a = closedAlpha; } colored.color = closed; } else { GetComponent <MeshRenderer>().material.ChangeAlpha(Opened(Player.current) ? openedAlpha : closedAlpha); } }
/// <summary> /// 初始化 /// </summary> private void Init() { Keys = new List <KeyColor>(); string config = "./Resources/Resource.txt"; StreamReader reader = new StreamReader(config, Encoding.UTF8); string line = string.Empty; while (!string.IsNullOrEmpty(line = reader.ReadLine())) { KeyColor item = JsonConvert.DeserializeObject <KeyColor>(line); string[] keys = item.Key.Split(','); System.Windows.Media.Color color = new System.Windows.Media.Color(); switch (item.Color) { case "red": color = Colors.Red; break; case "blue": color = Colors.Blue; break; default: color = Colors.Black; break; } foreach (var key in keys) { var temp = new KeyColor(); temp.Key = key; temp.SolidColorBrush = new SolidColorBrush(color); Keys.Add(temp); } } }
public void AddKey(KeyColor color) { switch (color) { case KeyColor.Red: redKey++; redKeyText.text = redKey.ToString(); //<----- break; case KeyColor.Green: greenKey++; greenKeyText.text = greenKey.ToString(); //<----- break; case KeyColor.Gold: goldKey++; goldKeyText.text = goldKey.ToString(); //<----- break; } }
public void Flash(int amount, int color_duration, KeyColor color_on, KeyColor color_off) { for (int i = 0; i < amount; i++) { for (int j = 0; j < Length; j++) { LaunchUtils.TellPad(X, 7 - Bottom_offset - j, color_off); } Thread.Sleep(color_duration); for (int j = 0; j < Length; j++) { LaunchUtils.TellPad(X, 7 - Bottom_offset - j, color_on); } Thread.Sleep(color_duration); } Update(); }
public bool SetLedColor(int iRow, int iColumn, KeyColor keyColor) { return(DLL.SetLedColor(iRow, iColumn, keyColor.r, keyColor.g, keyColor.b, DeviceIndex)); }
public bool IsKeyReceived(KeyColor keyColor) { if(!dict.ContainsKey(keyColor)) return false; return dict[keyColor].received; }
public void ReceiveKey(KeyColor keyColor) { dict[keyColor].received = true; }
public L_Key(int inputX, int inputY, KeyColor inputColor) : base(KeyType.T_KEY, inputX, inputY, inputColor) { this.SetKeyFill(inputColor); }
public override void UpdateToAdditionalInfo() { doorColor = (KeyColor)Data.AdditionalInfo; secondarySpriteColor = doorColor.ToColor(); }
public static void TellPad(int key, KeyColor color) { MidiMessageHandler.Instance().SendMessage(key, (int)color); }
public InventoryKey(KeyColor color) { type = color.ToInventeryItemType(); }
public bool isKeyFound(KeyColor color) { return(keysFound[(int)color]); }
public void setKey(KeyColor color, bool found) { keysFound[(int)color] = found; }
public static void TellPad(int x, int y, KeyColor color) { TellPad((y * 16) + x, color); }
public void setShape(KeyColor _color, Rectangle _shape) { color = _color; shape = _shape; interior = new Rectangle(shape.X + 1, shape.Y + 1, shape.Width - 2, shape.Height - 2); }
public bool SetFullLedColor(KeyColor keyColor) { return(DLL.SetFullLedColor(keyColor.r, keyColor.g, keyColor.b, DeviceIndex)); }
public LaunchAction(int x, int y, KeyColor color) : this((y * 16) + x, color) { }
public LaunchAction(int key, KeyColor color) { this.Key = key; this.Color = color; }
public void GetActiveDoor(KeyColor color, Door pDoor) { _activeDoor = pDoor; _activeDoorColor = color; CanOpenDoor = true; }
public bool HasKeyOfColor(KeyColor color) { return(_keys[(int)color]); }