コード例 #1
0
ファイル: Program.cs プロジェクト: kobra322/EnsageSharp-1
        private static void Main()
        {
            #region Init

            Game.OnUpdate += Game_OnUpdate;
            _loaded = false;
            Drawing.OnDraw += Drawing_OnDraw;
            ShowCooldownOnTopPanel = true;
            ShowHealthOnTopPanel = true;
            ShowManaOnTopPanel = true;
            ShowCooldownOnTopPanelLikeText = true;
            ShowRoshanTimer = true;
            ShowBuybackCooldown = true;

            #region Init font & line

            for (var i = 0; i <= 20; i++)
            {
                FontArray[i] = new Font(
                    Drawing.Direct3DDevice9,
                    new FontDescription
                    {
                        FaceName = "Tahoma",
                        Height = 10 + i,
                        OutputPrecision = FontPrecision.Default,
                        Quality = FontQuality.Default
                    });
            }
            _line = new Line(Drawing.Direct3DDevice9);

            #endregion

            Drawing.OnPreReset += Drawing_OnPreReset;
            Drawing.OnPostReset += Drawing_OnPostReset;
            Drawing.OnEndScene += Drawing_OnEndScene;
            AppDomain.CurrentDomain.DomainUnload += CurrentDomainDomainUnload;
            Game.OnWndProc += Game_OnWndProc;
            Game.OnFireEvent += Game_OnGameEvent;

            #endregion

            #region ShowMeMore

            ShowMeMoreH[0] = new ShowMeMoreHelper("modifier_invoker_sun_strike",
                "hero_invoker/invoker_sun_strike_team",
                "hero_invoker/invoker_sun_strike_ring_b",
                175);
            ShowMeMoreH[1] = new ShowMeMoreHelper("modifier_lina_light_strike_array",
                "hero_lina/lina_spell_light_strike_array_ring_collapse",
                "hero_lina/lina_spell_light_strike_array_sphere",
                225);
            ShowMeMoreH[2] = new ShowMeMoreHelper("modifier_kunkka_torrent_thinker",
                "hero_kunkka/kunkka_spell_torrent_pool",
                "hero_kunkka/kunkka_spell_torrent_bubbles_b",
                225);
            ShowMeMoreH[3] = new ShowMeMoreHelper("modifier_leshrac_split_earth_thinker",
                "hero_leshrac/leshrac_split_earth_b",
                "hero_leshrac/leshrac_split_earth_c",
                225);

            for (var z = 1; z <= 140; z++)
            {
                Eff[z] = new Dictionary<Unit, ParticleEffect>();
            }

            #endregion

            #region Save/load
            /*
            try
            {
                ShowHealthOnTopPanel =
                    Convert.ToBoolean(SaveLoadSysHelper.IniReadValue("Booleans", "Show Health on top panel")); //
                ShowManaOnTopPanel =
                    Convert.ToBoolean(SaveLoadSysHelper.IniReadValue("Booleans", "Show mana on top panel"));
                ShowCooldownOnTopPanel =
                    Convert.ToBoolean(SaveLoadSysHelper.IniReadValue("Booleans", "Show Cooldown on top panel")); //
                ShowCooldownOnTopPanelLikeText =
                    Convert.ToBoolean(SaveLoadSysHelper.IniReadValue("Booleans", "Show Cooldown on top panel (numbers)"));
                //
                OverlayOnlyOnEnemy =
                    Convert.ToBoolean(SaveLoadSysHelper.IniReadValue("Booleans", "Overlay only on enemy")); //

                ShowGlyph = Convert.ToBoolean(SaveLoadSysHelper.IniReadValue("Booleans", "Show glyph cd")); //
                ShowIllusions = Convert.ToBoolean(SaveLoadSysHelper.IniReadValue("Booleans", "Show Illusions"));
                ShowLastHit = Convert.ToBoolean(SaveLoadSysHelper.IniReadValue("Booleans", "Show LastHit/Deny"));
                ShowManabars = Convert.ToBoolean(SaveLoadSysHelper.IniReadValue("Booleans", "Show manabars"));
                ShowRoshanTimer = Convert.ToBoolean(SaveLoadSysHelper.IniReadValue("Booleans", "Show roshan timer"));
                ShowBuybackCooldown =
                    Convert.ToBoolean(SaveLoadSysHelper.IniReadValue("Booleans", "Show Buyback cooldown"));

                ShowMeMore = Convert.ToBoolean(SaveLoadSysHelper.IniReadValue("Booleans", "Show Me more"));

                AutoItemsActive = Convert.ToBoolean(SaveLoadSysHelper.IniReadValue("Booleans", "AutoItems Active"));
                AutoItemsPhase = Convert.ToBoolean(SaveLoadSysHelper.IniReadValue("Booleans", "Auto use phase boots"));
                AutoItemsMidas = Convert.ToBoolean(SaveLoadSysHelper.IniReadValue("Booleans", "Auto use midas"));
                AutoItemsStick = Convert.ToBoolean(SaveLoadSysHelper.IniReadValue("Booleans", "Auto use stick"));
            }
            catch
            {
                SaveLoadSysHelper.IniWriteValue("Booleans", "Show health on top panel", true.ToString());
                SaveLoadSysHelper.IniWriteValue("Booleans", "Show mana on top panel", true.ToString());
                SaveLoadSysHelper.IniWriteValue("Booleans", "Show cooldown on top panel", true.ToString());
                SaveLoadSysHelper.IniWriteValue("Booleans", "Show cooldown on top panel (numbers)", true.ToString());
                SaveLoadSysHelper.IniWriteValue("Booleans", "Overlay only on enemy", false.ToString());
                SaveLoadSysHelper.IniWriteValue("Booleans", "Show glyph cd", true.ToString());
                SaveLoadSysHelper.IniWriteValue("Booleans", "Show Illusions", true.ToString());
                SaveLoadSysHelper.IniWriteValue("Booleans", "Show LastHit/Deny", true.ToString());
                SaveLoadSysHelper.IniWriteValue("Booleans", "Show manabars", true.ToString());
                SaveLoadSysHelper.IniWriteValue("Booleans", "Show roshan timer", true.ToString());
                SaveLoadSysHelper.IniWriteValue("Booleans", "Show Buyback cooldown", true.ToString());
                SaveLoadSysHelper.IniWriteValue("Booleans", "Show Me more", true.ToString());

                SaveLoadSysHelper.IniWriteValue("Booleans", "AutoItems Active", true.ToString());
                SaveLoadSysHelper.IniWriteValue("Booleans", "Auto use phase boots", true.ToString());
                SaveLoadSysHelper.IniWriteValue("Booleans", "Auto use midas", true.ToString());
                SaveLoadSysHelper.IniWriteValue("Booleans", "Auto use stick", true.ToString());

                Console.Beep(1000, 100);
                Console.Beep(1000, 100);
                Console.Beep(1000, 100);
            }
             */
            #endregion
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: dendimonster/EnsageSharp-1
        private static void Main()
        {
            #region Init
            Game.OnUpdate += Game_OnUpdate;
            _loaded = false;
            Drawing.OnDraw += Drawing_OnDraw;

            #region Init font & line

            for (var i = 0; i <= 20; i++)
            {
                FontArray[i] = new Font(
                    Drawing.Direct3DDevice9,
                    new FontDescription
                    {
                        FaceName = "Tahoma",
                        Height = 10 + i,
                        OutputPrecision = FontPrecision.Default,
                        Quality = FontQuality.Default
                    });
            }
            _line = new Line(Drawing.Direct3DDevice9);

            #endregion

            Drawing.OnPreReset += Drawing_OnPreReset;
            Drawing.OnPostReset += Drawing_OnPostReset;
            Drawing.OnEndScene += Drawing_OnEndScene;
            AppDomain.CurrentDomain.DomainUnload += CurrentDomainDomainUnload;
            Game.OnWndProc += Game_OnWndProc;
            Game.OnFireEvent += Game_OnGameEvent;
            //ObjectMgr.OnAddEntity += ObjectMgr_OnAddEntity;
            //ObjectMgr.OnRemoveEntity += ObjectMgr_OnRemoveEntity;

            Menu.AddItem(new MenuItem("ShowHealthOnTopPanel", "Show Health on Top").SetValue(true));
            Menu.AddItem(new MenuItem("ShowManaOnTopPanel", "Show Mana on Top").SetValue(true));
            Menu.AddItem(new MenuItem("ShowRoshanTimer", "Show Roshan Timer").SetValue(true));
            Menu.AddItem(new MenuItem("ShowMeMore", "Show Me More").SetValue(true));
            Menu.AddItem(new MenuItem("ShowIllusions", "Show Illusions").SetValue(true));
            Menu.AddItem(new MenuItem("perfomance", "Perfomance").SetValue(new Slider(1,1,500)).SetTooltip("1 - good PC, 500 - wooden PC"));

            var enemyStatus = new Menu("Enemy Status", "enemystatus");
            enemyStatus.AddItem(new MenuItem("ShowStatusInfoActivated", "Activated").SetValue(true));
            enemyStatus.AddItem(new MenuItem("StatusEnemyTimer", "Show Enemy Status").SetValue(true).SetTooltip("show how long enemy in current status (in fog, in invis, under vision)"));
            enemyStatus.AddItem(new MenuItem("_showPAonMinimap", "Show PhantomAssasin on minimap").SetValue(true).SetFontStyle(FontStyle.Bold, Color.Gray));
            enemyStatus.AddItem(new MenuItem("_statusEnemyOnMap", "Show Enemy Last Position on Map").SetValue(true));
            enemyStatus.AddItem(new MenuItem("_visionStatus", "Show on top panel Ally's vision status").SetValue(true));
            
            var dangitems=new Menu("Dangerous Items","dangitems");
            dangitems.AddItem(new MenuItem("DangItems", "Show Dangerous Items").SetValue(true));
            //dangitems.AddItem(new MenuItem("dangItemEnemy", "Only For Enemy").SetValue(true));
            var dict = new Dictionary<string, bool>
            {
                {"item_gem", true},
                {"item_dust", true},
                {"item_sphere", true},
                {"item_blink", true},
                {"item_ward_observer", true},
                {"item_ward_sentry", true},
                {"item_black_king_bar", true},
                {"item_ward_dispenser", true}
            };
            dangitems.AddItem(new MenuItem("dangItemsUsage", "Item List: ").SetValue(new AbilityToggler(dict)));

            var ultimates = new Menu("Ultimates", "ultimates");
            ultimates.AddItem(new MenuItem("ShowUltimateCd", "Show ultimate Icon").SetValue(true));
            ultimates.AddItem(new MenuItem("ShowUltimateCdText", "Show ultimate Text").SetValue(true).SetFontStyle(FontStyle.Bold, Color.Gray));

            var autoItems = new Menu("Auto Items", "autoitems");
            autoItems.AddItem(new MenuItem("AutoItemsActive", "Auto Items Active").SetValue(false));
            var autoitemlist = new Dictionary<string, bool>
            {
                {"item_magic_wand", false},
                {"item_phase_boots", true},
                {"item_hand_of_midas", true}
            };
            autoItems.AddItem(new MenuItem("autoitemsList", "Item List: ").SetValue(new AbilityToggler(autoitemlist)));
            autoItems.AddItem(new MenuItem("autoitemlistHealth", "Minimum Health (%)").SetValue(new Slider(30, 1)));
            autoItems.AddItem(new MenuItem("autoitemlistMana", "Minimum Mana (%)").SetValue(new Slider(30, 1)));

            var runes = new Menu("Rune Notification", "runenotification");
            runes.AddItem(new MenuItem("ShowRunes", "Print Info").SetValue(true));
            runes.AddItem(new MenuItem("ShowRunesMinimap", "Show on Minimap").SetValue(false).SetFontStyle(FontStyle.Bold, Color.Gray));

            var settings = new Menu("Settings", "settings");
            settings.AddItem(new MenuItem("BarPosX", "HP/MP bar Position X").SetValue(new Slider(0, -300, 300)));
            settings.AddItem(new MenuItem("BarPosY", "HP/MP bar Position Y").SetValue(new Slider(0, -300, 300)));
            settings.AddItem(new MenuItem("BarSizeY", "HP/MP bar Size Y").SetValue(new Slider(0, -10, 10)));

            /*var visibility = new Menu("Visibility", "Visibility");
            visibility.AddItem(new MenuItem("Visibility.Enable", "Enable").SetValue(false).SetFontStyle(FontStyle.Bold, Color.Gray).SetTooltip("can cause game crashing"));
            visibility.AddItem(new MenuItem("Visibility.Red", "Red").SetValue(new Slider(0, 0, 255)).SetFontStyle(FontStyle.Bold, Color.Red));
            visibility.AddItem(new MenuItem("Visibility.Green", "Green").SetValue(new Slider(0, 0, 255)).SetFontStyle(FontStyle.Bold, Color.Green));
            visibility.AddItem(new MenuItem("Visibility.Blue", "Blue").SetValue(new Slider(100, 0, 255)).SetFontStyle(FontStyle.Bold, Color.Blue));
            visibility.AddItem(new MenuItem("Visibility.Alpha", "Alpha").SetValue(new Slider(50, 0, 255)).SetFontStyle(FontStyle.Bold, Color.WhiteSmoke));*/

            //Menu.AddSubMenu(visibility);
            Menu.AddSubMenu(dangitems);
            Menu.AddSubMenu(ultimates);
            Menu.AddSubMenu(autoItems);
            Menu.AddSubMenu(runes);
            Menu.AddSubMenu(enemyStatus);
            Menu.AddSubMenu(settings);
            
            Menu.AddToMainMenu();

            #endregion

            #region ShowMeMore

            ShowMeMoreH[0] = new ShowMeMoreHelper("modifier_invoker_sun_strike",
                "hero_invoker/invoker_sun_strike_team",
                "hero_invoker/invoker_sun_strike_ring_b",
                175);
            ShowMeMoreH[1] = new ShowMeMoreHelper("modifier_lina_light_strike_array",
                "hero_lina/lina_spell_light_strike_array_ring_collapse",
                "hero_lina/lina_spell_light_strike_array_sphere",
                225);
            ShowMeMoreH[2] = new ShowMeMoreHelper("modifier_kunkka_torrent_thinker",
                "hero_kunkka/kunkka_spell_torrent_pool",
                "hero_kunkka/kunkka_spell_torrent_bubbles_b",
                225);
            ShowMeMoreH[3] = new ShowMeMoreHelper("modifier_leshrac_split_earth_thinker",
                "hero_leshrac/leshrac_split_earth_b",
                "hero_leshrac/leshrac_split_earth_c",
                225);

            for (var z = 1; z <= 140; z++)
            {
                Eff[z] = new Dictionary<Unit, ParticleEffect>();
            }

            #endregion

            #region SaveLoadSys
            /*
            try
            {
                LoadThis(out ShowHealthOnTopPanel, "ShowHealthOnTopPanel");
                LoadThis(out ShowManaOnTopPanel, "ShowManaOnTopPanel");
                LoadThis(out ShowRoshanTimer, "ShowRoshanTimer");
                LoadThis(out ShowIllusions, "ShowIllusions");
                LoadThis(out ShowMeMore, "ShowMeMore");
                LoadThis(out DangItems, "DangItems");
                LoadThis(out AutoItemsMenu, "AutoItemsMenu");
                LoadThis(out AutoItemsActive, "AutoItemsActive");
                LoadThis(out AutoItemsMidas, "AutoItemsMidas");
                LoadThis(out AutoItemsPhase, "AutoItemsPhase");
                LoadThis(out AutoItemsStick, "AutoItemsStick");
                LoadThis(out ShowUltimateCd, "ShowUltimateCd");
                LoadThis(out ExtraVisionPanel, "ExtraVisionPanel");
                LoadThis(out StatusEnemyTimer, "StatusEnemyTimer");
                LoadThis(out ShowStatusInfo, "ShowStatusInfo");
                LoadThis(out ShowStatusInfoActivated, "ShowStatusInfoActivated");
                LoadThis(out ShowExtraVisionPanel, "ShowExtraVisionPanel");
                LoadThis(out StatusEnemyOnMinimap, "StatusEnemyOnMinimap");
                LoadThis(out ShowRunes, "ShowRunes");
            }
            catch
            {
                SaveAll();

                Console.Beep(1000, 100);
                Console.Beep(1000, 100);
                Console.Beep(1000, 100);
            }
            */
            #endregion
        }