コード例 #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            do
            {
                client = ClientChooser.ShowBox();
            } while (client == null && MessageBox.Show("Please select a Tibia client", "Notification", MessageBoxButtons.RetryCancel, MessageBoxIcon.Asterisk) == DialogResult.Retry);

            if (client == null)
            {
                Application.Exit();
                return;
            }
            else
            {
                screen = client.Screen;
                client.ContextMenu.AddContextMenu(1000, "Add as Ally", ContextMenuType.CopyNameContextMenu, true);
                client.ContextMenu.AddContextMenu(1001, "Add as Enemy", ContextMenuType.CopyNameContextMenu, true);
                client.ContextMenu.AddContextMenu(1002, "Show Item Id", ContextMenuType.LookContextMenu, true);
                client.ContextMenu.Click += new Tibia.Objects.ContextMenu.ContextMenuEvent(ContextMenu_Click);

                client.Icon.AddIcon(1, 20, 30, 64, 1841, 0, ClientFont.NormalBorder, Color.White);
                client.Screen.DrawScreenText("ally", new Location(20, 84, 0), Color.LightBlue, ClientFont.NormalBorder, "Display/Hide Allies");
                client.Icon.AddIcon(2, 20, 110, 64, 9438, 0, ClientFont.NormalBorder, Color.White);
                client.Screen.DrawScreenText("enemy", new Location(20, 164, 0), Color.Red, ClientFont.NormalBorder, "Display/Hide Enemies");

                client.Icon.Click += new Tibia.Objects.Icon.IconEvent(Icon_Click);
            }
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: Xileck/tibiaapi
        private void MainForm_Load(object sender, EventArgs e)
        {
            do
            {
                client = ClientChooser.ShowBox();
            } while (client == null && MessageBox.Show("Please select a Tibia client", "Notification", MessageBoxButtons.RetryCancel, MessageBoxIcon.Asterisk) == DialogResult.Retry);

            if (client == null)
            {
                Application.Exit();
                return;
            }
            else
            {
                screen = client.Screen;
                client.ContextMenu.AddContextMenu(1000, "Add as Ally", ContextMenuType.CopyNameContextMenu, true);
                client.ContextMenu.AddContextMenu(1001, "Add as Enemy", ContextMenuType.CopyNameContextMenu, true);
                client.ContextMenu.AddContextMenu(1002, "Show Item Id", ContextMenuType.LookContextMenu, true);
                client.ContextMenu.Click += new Tibia.Objects.ContextMenu.ContextMenuEvent(ContextMenu_Click);

                client.Icon.AddIcon(1, 20, 30, 64, 1841, 0, ClientFont.NormalBorder, Color.White);
                client.Screen.DrawScreenText("ally",new Location(20,84,0),Color.LightBlue, ClientFont.NormalBorder, "Display/Hide Allies");
                client.Icon.AddIcon(2, 20, 110, 64, 9438, 0, ClientFont.NormalBorder, Color.White);
                client.Screen.DrawScreenText("enemy", new Location(20, 164, 0), Color.Red, ClientFont.NormalBorder, "Display/Hide Enemies");

                client.Icon.Click+=new Tibia.Objects.Icon.IconEvent(Icon_Click);
            }
        }