private async Task <bool> RepeatClick(LineButton button) { if (!string.IsNullOrEmpty(button.Voice) && (button.Duration > 0)) { MaidTimer.Interval = button.Duration; _saying = true; await PlayMusic0(SignKey, button.Voice, "correctclick"); MaidTimer.Start(); return(true); } return(false); }
private void Init() { _maid1Eye1 = new LineButton(ButtonItems[0]); _maid1Eye2 = new LineButton(ButtonItems[1]); _maid1Breast1 = new LineButton(ButtonItems[2]); _maid1Breast2 = new LineButton(ButtonItems[3]); _maid1Oxter1 = new LineButton(ButtonItems[4]); _maid1Oxter2 = new LineButton(ButtonItems[5]); _maid2Eye1 = new LineButton(ButtonItems[6]); _maid2Eye2 = new LineButton(ButtonItems[7]); _maid2Breast1 = new LineButton(ButtonItems[8]); _maid2Breast2 = new LineButton(ButtonItems[9]); _maid2Oxter1 = new LineButton(ButtonItems[10]); _maid2Oxter2 = new LineButton(ButtonItems[11]); _greenFace = new LineButton(ButtonItems[12]); _redFace = new LineButton(ButtonItems[13]); _maid1Light = RelayItems[0]; _maid2Light = RelayItems[1]; _maid1.Add(_maid1Eye1); _maid1.Add(_maid1Eye2); _maid1.Add(_maid1Breast1); _maid1.Add(_maid1Breast2); _maid1.Add(_maid1Oxter1); _maid1.Add(_maid1Oxter2); _maid2.Add(_maid2Eye1); _maid2.Add(_maid2Eye2); _maid2.Add(_maid2Breast1); _maid2.Add(_maid2Breast2); _maid2.Add(_maid2Oxter1); _maid2.Add(_maid2Oxter2); _step = 1; CreatStep(); _hitCheckTask = new HitCheckTask.HitCheckTask(SignKey, _redFace.MachineButtonItem); MaidTimer.Elapsed += MaidTimer_Elapsed; Maid1MuteTimer.Elapsed += Maid1MuteTimer_Elapsed; Maid2MuteTimer.Elapsed += Maid2MuteTimer_Elapsed; }