Ejemplo n.º 1
0
        public ExperienceBar(IModHelper helper)
        {
            _helper = helper;
            String path = string.Empty;

            try
            {
                path    = Path.Combine(_helper.DirectoryPath, "LevelUp.wav");
                _player = new SoundPlayer(path);
                //path = path.Replace(Environment.CurrentDirectory, "");
                //path = path.TrimStart(Path.DirectorySeparatorChar);
                //_soundEffect = SoundEffect.FromStream(TitleContainer.OpenStream(path)).CreateInstance();
                //_soundEffect.Volume = 1f;
            }
            catch (Exception ex)
            {
                ModEntry.MonitorObject.Log("Error loading sound file from " + path + ": " + ex.Message + Environment.NewLine + ex.StackTrace, LogLevel.Error);
            }
            _timeToDisappear.Elapsed           += StopTimerAndFadeBarOut;
            helper.Events.Display.RenderingHud += OnRenderingHud;
            helper.Events.Player.Warped        += OnWarped_RemoveAllExperiencePointDisplays;

            var something = _helper.ModRegistry.GetApi("DevinLematty.LevelExtender");

            try
            {
                _levelExtenderAPI = _helper.ModRegistry.GetApi <LevelExtenderInterface>("DevinLematty.LevelExtender");
            }
            catch (Exception ex)
            {
                int j = 4;
            }
            int f = 3;

            //if (something != null)
            //{
            //    try
            //    {
            //        var methods = something.GetType().GetMethods();
            //        var currentXPMethod = something.GetType().GetMethod("currentXP");

            //        foreach (var method in methods)
            //        {

            //        }
            //    }
            //    catch (Exception ex)
            //    {
            //        int f = 3;
            //    }
            //}
        }