bool CTriggerAutoMusicPlayer::TriggerAutoMusicPlayerMsg(CTriggerAutoMusicPlayerMsg *msg) { CRoomItem *room1 = msg->_value == 1 ? locateRoom(_roomName) : findRoom(); CRoomItem *room2 = msg->_value == 2 ? locateRoom(_roomName) : findRoom(); CChangeMusicMsg changeMsg; changeMsg._flags = 1; changeMsg.execute(room1, CAutoMusicPlayer::_type, MSGFLAG_CLASS_DEF | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN); changeMsg._flags = 2; changeMsg.execute(room2, CAutoMusicPlayer::_type, MSGFLAG_CLASS_DEF | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN); return true; }
bool CAutoMusicPlayerBase::TimerMsg(CTimerMsg *msg) { CChangeMusicMsg musicMsg; musicMsg._flags = 2; musicMsg.execute(this); return true; }
bool CSeasonalMusicPlayer::ArboretumGateMsg(CArboretumGateMsg *msg) { CChangeMusicMsg changeMsg; changeMsg._action = msg->_value ? MUSIC_START : MUSIC_STOP; changeMsg.execute(this); return true; }
bool CAutoMusicPlayerBase::TimerMsg(CTimerMsg *msg) { CChangeMusicMsg musicMsg; musicMsg._action = MUSIC_START; musicMsg.execute(this); return true; }
bool CAutoMusicPlayer::LeaveRoomMsg(CLeaveRoomMsg *msg) { if (_isRepeated) { CRoomItem *room = findRoom(); if (msg->_oldRoom == room) { CChangeMusicMsg changeMsg; changeMsg._flags = 1; changeMsg.execute(this); } } if (!_leaveRoomSound.empty()) playSound(_leaveRoomSound); return true; }
bool CAutoMusicPlayer::LeaveRoomMsg(CLeaveRoomMsg *msg) { if (_isEnabled) { CRoomItem *room = findRoom(); if (msg->_oldRoom == room) { CChangeMusicMsg changeMsg; changeMsg._action = MUSIC_STOP; changeMsg.execute(this); } } if (!_leaveRoomSound.empty()) playSound(_leaveRoomSound); return true; }
bool CSeasonalMusicPlayer::ChangeSeasonMsg(CChangeSeasonMsg *msg) { _isSpring = msg->_season == "spring"; _isSummer = msg->_season == "summer"; _isAutumn = msg->_season == "autumn"; _isWinter = msg->_season == "winter"; _springMode = _isSpring ? VOL_QUIET : VOL_MUTE; _summerMode = _isSummer ? VOL_QUIET : VOL_MUTE; _autumnMode = _isAutumn ? VOL_QUIET : VOL_MUTE; _winterMode = _isWinter ? VOL_QUIET : VOL_MUTE; CChangeMusicMsg changeMsg; changeMsg._filename = msg->_season; changeMsg.execute(this); return true; }
bool CNodeAutoSoundPlayer::LeaveNodeMsg(CLeaveNodeMsg *msg) { CNodeItem *node = findNode(); CRoomItem *room = findRoom(); if (node == msg->_oldNode) { CTurnOff offMsg; offMsg.execute(this); if (_enabled) { CChangeMusicMsg changeMsg; changeMsg._action = MUSIC_START; changeMsg.execute(room, CAutoMusicPlayer::_type, MSGFLAG_CLASS_DEF | MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN); } } return true; }
bool CViewAutoSoundPlayer::EnterViewMsg(CEnterViewMsg *msg) { CViewItem *view = findView(); CRoomItem *room = findRoom(); if (view == msg->_newView) { CTurnOn onMsg; onMsg.execute(this); if (_enabled) { CChangeMusicMsg changeMsg; changeMsg._action = MUSIC_STOP; changeMsg.execute(room, CAutoMusicPlayer::_type, MSGFLAG_CLASS_DEF |MSGFLAG_BREAK_IF_HANDLED | MSGFLAG_SCAN); } } return true; }