Example #1
0
        public YotogiSubtitles()
        {
            SubtitleConfig = new SubtitleConfig(Config);

            Logger.Log(LogLevel.Debug, $"Subtitles {(SubtitleConfig.EnableSubtitle ? "Enabled" : "Disabled")}.");
            Logger.Log(LogLevel.Debug, $"Max subtitles {SubtitleConfig.MaxSubtitle }.");
        }
Example #2
0
        private void OnKeyShort()
        {
            if (Event.current.type != EventType.KeyUp)
            {
                return;
            }
            if (!Event.current.alt)
            {
                return;
            }

            switch (Event.current.keyCode)
            {
            case KeyCode.F1:
                SubtitleConfig.Reload();
                Logger.Log(LogLevel.Info, $"Config reloaded.");
                Logger.Log(LogLevel.Info, $"Subtitles {(SubtitleConfig.EnableSubtitle ? "Enabled" : "Disabled")}.");
                Logger.Log(LogLevel.Info, $"Max subtitles {SubtitleConfig.MaxSubtitle }.");
                break;

            case KeyCode.F2:
                SubtitleConfig.EnableSubtitle = !SubtitleConfig.EnableSubtitle;
                Logger.Log(LogLevel.Info, $"Subtitles {(SubtitleConfig.EnableSubtitle ? "Enabled" : "Disabled")}.");
                break;

            case KeyCode.Keypad1:
                lock (PlayingAudioSource)
                {
                    var index = 0;
                    foreach (var audioFileName in PlayingAudio)
                    {
                        var audioSource = PlayingAudioSource[audioFileName];
                        Logger.Log(LogLevel.Debug, $"{index} : Now playing {audioFileName}({audioSource.isPlaying})");
                        index++;
                    }
                }
                break;
            }
        }