コード例 #1
0
        private static void Init(SettingsBundle xml, MainForm mainForm)
        {
            // SETUP SKILLS
            if (xml.skills.def != null)
                SkillManager.InitSkills(xml.skills.def, xml.skills.special);
            SkillManager.CreateMissingSkills();

            // SETUP ACTIONS
            if (xml.actions != null)
                ActiveMode.LoadSettings(xml.actions);
            ActiveMode.LoadDefaultSettings();


            // INIT MAINFORM
            mainForm.Init(username: API.Users.AuthResult.user);

            // LOAD SCRIPTS
            ScriptManager.LoadScripts();
            // OVERRIDE SCRIPTS
            if (xml.scripts != null)
                ScriptManager.OverrideScripts(xml.scripts);

            // INIT ACTIVE MODE
            ActiveMode.Init();
        }
コード例 #2
0
        private static void Run(SettingsBundle xml)
        {
            // CREATE MAIN FORM
            MainForm mainForm = new MainForm();
            mainForm.FormClosing += (object s, FormClosingEventArgs e) => ShutDown();

            // INITIALIZE
            SetFormRefs(mainForm);
            Init(xml, mainForm);

            // TRY START DIABLO / TURBOHUD
            if (!CheckForStart()) MessageBox.Show("You might have to restart the Helper, after you started Diablo", "Restart Helper");

            // INIT COORDINATES
            Coords.Coords.InitCoords();
            (Dim dim, bool success) = ScreenTools.GetWindowDimensions();
            if (success)
                Coords.Coords.ConvertCoords(dim.Width, dim.Height);

            // INIT KILL COORDS
            SkillCoords.Init();

            // START SKILL LOOP
            StartSkillLoop();

            // START AUTH LOOP
            StartAuthLoop();

            // LAUNCH APPLICATION
            Application.Run(mainForm);
        }