IsSoundRunning() public method

public IsSoundRunning ( int snd ) : bool
snd int
return bool
Exemplo n.º 1
0
        public bool IsResourceInUse(ResType type, int idx)
        {
            //if (!ResourceManager.ValidateResource("isResourceInUse", type, idx))
            //    return false;
            switch (type)
            {
            case ResType.Room:
                return(_roomResource == (byte)idx);

            case ResType.RoomImage:
                return(_roomResource == (byte)idx);

            case ResType.RoomScripts:
                return(_roomResource == (byte)idx);

            case ResType.Script:
                return(IsScriptInUse(idx));

            case ResType.Costume:
                return(IsCostumeInUse(idx));

            case ResType.Sound:
                // Sound resource 1 is used for queued speech
                //if (_game.heversion >= 60 && idx == 1)
                //    return true;
                //else
                return(Sound.IsSoundInUse(idx));

            case ResType.Charset:
                return(_charset.GetCurId() == idx);

            /*case ResType.Image:
             *  return ResourceManager.IsModified(type, idx) != 0;*/
            case ResType.SpoolBuffer:
                return(Sound.IsSoundRunning(10000 + idx));

            default:
                return(false);
            }
        }
Exemplo n.º 2
0
        protected override TimeSpan Loop()
        {
            Variables[VariableIsSoundRunning.Value] = (Sound.LastSound != 0) && Sound.IsSoundRunning(Sound.LastSound) ? 1 : 0;

            return(base.Loop());
        }
Exemplo n.º 3
0
        protected override void ActorTalk(byte[] msg)
        {
            var stringWrap = false;

            ConvertMessageToString(msg, _charsetBuffer, 0);

            // Play associated speech, if any
            PlaySpeech(_lastStringTag);

            if (Game.GameId == GameId.Dig || Game.GameId == GameId.CurseOfMonkeyIsland)
            {
                if (Variables[VariableHaveMessage.Value] != 0)
                {
                    StopTalk();
                }
            }
            else
            {
                if (!_keepText)
                {
                    StopTalk();
                }
            }
            if (_actorToPrintStrFor == 0xFF)
            {
                TalkingActor  = 0xFF;
                _charsetColor = String[0].Color;
            }
            else
            {
                var a = Actors[_actorToPrintStrFor];
                TalkingActor = a.Number;
                if (!String[0].NoTalkAnim)
                {
                    a.RunActorTalkScript(a.TalkStartFrame);
                }
                _charsetColor = a.TalkColor;
            }

            _charsetBufPos = 0;
            _talkDelay     = 0;
            _haveMsg       = 1;
            if (Game.GameId == GameId.FullThrottle)
            {
                Variables[VariableHaveMessage.Value] = 0xFF;
            }
            _haveActorSpeechMsg = (Game.GameId == GameId.FullThrottle) ? true : (!Sound.IsSoundRunning(Sound.TalkSoundID));
            if (Game.GameId == GameId.Dig || Game.GameId == GameId.CurseOfMonkeyIsland)
            {
                stringWrap         = String[0].Wrapping;
                String[0].Wrapping = true;
            }
            Charset();
            if (Game.GameId == GameId.Dig || Game.GameId == GameId.CurseOfMonkeyIsland)
            {
                if (Game.Version == 8)
                {
                    Variables[VariableHaveMessage.Value] = (String[0].NoTalkAnim) ? 2 : 1;
                }
                else
                {
                    Variables[VariableHaveMessage.Value] = 1;
                }
                String[0].Wrapping = stringWrap;
            }
        }
Exemplo n.º 4
0
 protected virtual void IsSoundRunning(int sound)
 {
     Push(sound != 0 && Sound.IsSoundRunning(sound));
 }