Exemple #1
0
        static void Main(string[] args)
        {
            // Step1.模拟显示功能键设置窗口
            FBSettingWindow window = new FBSettingWindow("功能键设置窗口");

            // Step2.假如目前要设置两个功能键
            FunctionButton buttonA = new FunctionButton("功能键A");
            FunctionButton buttonB = new FunctionButton("功能键B");

            // Step3.读取配置文件和反射生成具体命令对象
            Command commandA = new HelpCommand();
            Command commandB = new MinimizeCommand();

            // Step4.将命令注入功能键
            buttonA.SetCommand(commandA);
            buttonB.SetCommand(commandB);

            window.AddFunctionButton(buttonA);
            window.AddFunctionButton(buttonB);
            window.Display();

            // Step5.调用功能键的业务方法
            buttonA.OnClick();
            buttonB.OnClick();
        }
Exemple #2
0
        static void Main1301()
        {
            Console.WriteLine("Holle Command Pattern!");

            var fbsw = new FBSettingWindow("Setting Function Buttons");

            var fb1 = new FunctionButton("Function Button 1");
            var fb2 = new FunctionButton("Function Button 2");


            Commander command1 = new MinimizeCommader(new WindowsHandler());
            Commander command2 = new HelpCommander(new HelpHandler());

            //将命令对象注入功能键
            fb1.SetCommander(command1);
            fb2.SetCommander(command2);

            fbsw.AddFunctionButton(fb1);
            fbsw.AddFunctionButton(fb2);
            fbsw.Display();

            //调用功能键的业务方法
            fb1.OnClick();
            fb2.OnClick();

            Console.ReadLine();
        }
Exemple #3
0
        public FunctionButton AddFunction(Panel p, string Text, string Iden, bool Closable, Action <GameContext> OnEnabled, Action <GameContext> OnDisabled)
        {
            if (!FunctionsNumber.ContainsKey(p))
            {
                FunctionsNumber[p] = 0;
            }

            FunctionButton b = new FunctionButton(Iden,
                                                  s => HackContext.GetSign((s as FunctionButton).Identity) > 0, Closable);

            b.OnEnable += (s, e) =>
            {
                var btn = (s as FunctionButton);
                OnEnabled?.Invoke(HackContext.GameContext);
                HackContext.SetSign((s as FunctionButton).Identity, 1);
            };
            b.OnDisable += (s, e) =>
            {
                OnDisabled?.Invoke(HackContext.GameContext);
                HackContext.SetSign((s as FunctionButton).Identity, 0);
            };
            b.Location = new Point(0, 20 * FunctionsNumber[p]);
            b.Text     = Text;
            p.Controls.Add(b);
            FunctionsNumber[p]++;
            return(b);
        }
Exemple #4
0
        // ****************************************
        // *** function button press (+/-, %)
        // ****************************************
        private void OnButtonPress(FunctionButton button)
        {
            WKInterfaceDevice.CurrentDevice.PlayHaptic(WKHapticType.Click);
            calculator.Operation = Calculator.Operation.None;

            try
            {
                calculator.Operand1 = Convert.ToDouble(CalculatorText);
                calculator.Function = button.Function;

                switch (button.Function)
                {
                case Calculator.Function.Percent:
                    calculator.Calculate();
                    CalculatorText = string.Empty;
                    break;

                case Calculator.Function.PluMinus:
                    break;
                }

                WriteTextToScreen($@"{calculator.TotalSum}");
            }
            catch (Exception)
            {
                WriteTextToScreen($@"Operation Error");
            }
            finally
            {
                SetButtonColors();
                //button.Button.SetBackgroundColor(button.PressedColor);
                button.Button.SetBackgroundColor(UIColor.Gray);
            }
        }
        public void CircuitStateEndDefinitionTest()
        {
            ProjectTester.InitResources();
            CircuitProject project      = CircuitProject.Create(null);
            CircuitButton  button       = null;
            CircuitSymbol  buttonSymbol = null;
            Gate           led          = null;
            CircuitSymbol  ledSymbol    = null;

            project.InTransaction(() => {
                button       = project.CircuitButtonSet.Create("b", false, PinSide.Right);
                buttonSymbol = project.CircuitSymbolSet.Create(button, project.ProjectSet.Project.LogicalCircuit, 1, 1);
                led          = project.GateSet.Gate(GateType.Led, 1, false);
                ledSymbol    = project.CircuitSymbolSet.Create(led, project.ProjectSet.Project.LogicalCircuit, 5, 1);
            });

            CircuitState   target         = new CircuitState(3);
            int            buttonResult   = target.ReserveState();
            FunctionButton functionButton = new FunctionButton(target, new CircuitSymbol[] { buttonSymbol }, buttonResult);
            FunctionLed    functionLed    = new FunctionLed(target, new CircuitSymbol[] { ledSymbol }, buttonResult);

            target.EndDefinition();

            Assert.IsTrue(functionButton.Dependent != null && functionButton.Dependent.Length == 1 && functionButton.Dependent[0] == functionLed);
            Assert.IsTrue(functionLed.Dependent == null);
        }
Exemple #6
0
        public static void Main(string[] args)
        {
            // Step1.模拟显示功能键设置窗口
            FBSettingWindow window = new FBSettingWindow("功能键设置窗口");

            // Step2.假如目前要设置两个功能键
            FunctionButton buttonA = new FunctionButton("功能键A");
            FunctionButton buttonB = new FunctionButton("功能键B");

            // Step3.读取配置文件和反射生成具体命令对象
            Command.Command commandA = (Command.Command)AppConfigHelper.GetCommandAInstance();
            Command.Command commandB = (Command.Command)AppConfigHelper.GetCommandBInstance();

            // Step4.将命令注入功能键
            buttonA.SetCommand(commandA);
            buttonB.SetCommand(commandB);

            window.AddFunctionButton(buttonA);
            window.AddFunctionButton(buttonB);
            window.Display();

            // Step5.调用功能键的业务方法
            buttonA.OnClick();
            buttonB.OnClick();

            Console.ReadKey();
        }
        private void TimerPauseAdjustments()
        {
            FunctionText.Text  = Formatter.FormatMode($"{ModeTimer}");
            TimerText.ReadOnly = true;
            Painter <Blue> .Paint(TimerText, PaintMode.Normal);

            FunctionButton.SetImage(Resources.Play);
        }
        private void TimerStartAdjustments()
        {
            FunctionText.Text  = Formatter.FormatMode($"{ModeFunction}");
            TimerText.ReadOnly = true;
            Painter <Blue> .Paint(TimerText, PaintMode.Light);

            FunctionButton.SetImage(Resources.Pause);
        }
Exemple #9
0
        partial void OnButtonPressPercent()
        {
            FunctionButton button = new FunctionButton {
                Function = Calculator.Function.Percent, Button = btnPercent
            };

            OnButtonPress(button);
        }
Exemple #10
0
        partial void OnButtonPressPlusMinus()
        {
            FunctionButton button = new FunctionButton {
                Function = Calculator.Function.PluMinus, Button = btnPlusMinus
            };

            OnButtonPress(button);
        }
        private void TimerStopAdjustments()
        {
            FunctionText.Text  = Formatter.FormatMode($"{ModeTimer}");
            TimerText.ReadOnly = true;
            TimerText.Text     = c_InitialTime;
            Painter <Blue> .Paint(TimerText, PaintMode.Dark);

            FunctionButton.SetImage(Resources.Stop);
        }
Exemple #12
0
 public void Register(FunctionButton _toggleButton)
 {
     toggleButtons[_toggleButton.order] = _toggleButton;
     if (!orders.Contains(_toggleButton.order))
     {
         orders.Add(_toggleButton.order);
         orders.Sort(OrderCompare);
     }
 }
Exemple #13
0
        public ATMButton getButton(string identifier)
        {
            ATMButton b = null;

            switch (identifier)
            {
            case "Enter":
            {
                FunctionButton b1 = new FunctionButton();

                b1.Text = identifier;
                b1.setColour("Lime");
                b1.Location = new System.Drawing.Point(385, 359);
                b1.Name     = identifier;
                b1.Size     = new System.Drawing.Size(75, 45);
                b1.TabIndex = 11;
                //

                b = b1;
                break;
            }

            case "Cancel": {
                FunctionButton b1 = new FunctionButton();

                b1.Text = identifier;
                b1.setColour("Red");
                b1.Location = new System.Drawing.Point(385, 257);
                b1.Name     = "button10";
                b1.Size     = new System.Drawing.Size(75, 45);
                b1.TabIndex = 9;
                b           = b1;
                break;
            }

            case "Clear": {
                FunctionButton b1 = new FunctionButton();

                b1.Text = identifier;
                b1.setColour("Yellow");
                b1.Location = new System.Drawing.Point(385, 308);
                b1.Name     = identifier;
                b1.Size     = new System.Drawing.Size(75, 45);
                b1.TabIndex = 10;
                b           = b1;
                break;
            }

            default:
            {
                b = new NumberButton(identifier); break;
            }
            }

            return(b);
        }
Exemple #14
0
    public void UnRegister(FunctionButton _toggleButton)
    {
        toggleButtons.Remove(_toggleButton.order);

        if (orders.Contains(_toggleButton.order))
        {
            orders.Remove(_toggleButton.order);
            orders.Sort(OrderCompare);
        }
    }
Exemple #15
0
        public void LoadPanel(System.Collections.Generic.IEnumerable <SaveData.Models.PanelButton> saveData)
        {
            for (int i = 0; i < _buttons.Length; i++)
            {
                _buttons[i] = null;
            }

            var elms = ButtonsCanvas.Children.OfType <PadOS.CustomControls.AlphaSilhouetteImage>().ToArray();

            foreach (var item in elms)
            {
                item.Source = null;
            }

            foreach (var data in saveData)
            {
                var functionButton = new FunctionButton {
                    ImageUri     = new Uri(Utils.ResourcesPath + data.Function.ImageUrl),
                    Title        = data.Function.Title,
                    Identifier   = data.Function.Parameter,
                    FunctionType = data.Function.FunctionType
                };

                var elm = elms[data.Position];

                elm.Source              = new System.Windows.Media.Imaging.BitmapImage(functionButton.ImageUri);
                elm.Visibility          = Visibility.Visible;
                _buttons[data.Position] = new FunctionViewModel {
                    FrameworkElement = elm,
                    Function         = data.Function,
                    FunctionButton   = functionButton
                };
            }

            const int    segments = 8;
            const double segment  = (Math.PI * 2) / segments;

            ButtonsCanvas.Loaded += delegate {
                for (var i = 0; i < segments; i++)
                {
                    Canvas.SetLeft(elms[i], Math.Cos(segment * i - segment * 2) * 270 + ButtonsCanvas.ActualWidth / 2);
                    Canvas.SetTop(elms[i], Math.Sin(segment * i - segment * 2) * 270 + ButtonsCanvas.ActualHeight / 2);

                    if (_buttons[i] != null)
                    {
                        continue;
                    }
                    elms[i].Source     = null;
                    elms[i].Visibility = Visibility.Collapsed;
                }
            };
        }
Exemple #16
0
 public void NotifyToggleOn(FunctionButton _toggleButton)
 {
     if (_toggleButton.state == FunctionButton.State.Selected)
     {
         currentOrder = _toggleButton.order;
         for (int i = 0; i < orders.Count; i++)
         {
             var toggleButton = toggleButtons[orders[i]];
             if (toggleButton != _toggleButton && toggleButton.state != FunctionButton.State.Locked)
             {
                 toggleButton.state = FunctionButton.State.Normal;
             }
         }
     }
 }
        public FunctionButton AddFunction(Panel p, string Text, string Iden, bool Closable, Action <GameContext> OnEnabled, Action <GameContext> OnDisabled)
        {
            if (!FunctionsNumber.ContainsKey(p))
            {
                FunctionsNumber[p] = 0;
            }

            FunctionButton b = new FunctionButton(Iden,
                                                  s => HackContext.GetSign((s as FunctionButton).Identity) > 0, Closable);

            b.OnEnable += (s, e) =>
            {
#if DEBUG || ENG
#else
                if (!(MainForm.Configs["CFG_QTRHacker"] as CFG_QTRHacker).OnlineMode && HackContext.GameContext.NetMode != 0)
                {
                    MessageBox.Show("你无法在多人游戏中使用修改器的'基础功能'\n" +
                                    "因为在线模式已被关闭\n" +
                                    "除非在配置文件./configs/CFG_QTRHacker.json中将OnlineMode项由false修改为true来开启在线模式\n" +
                                    "而在线模式一旦开启,则代表你将为你使用本修改器做出的任何行为负全责\n" +
                                    "这并不代表在线模式处于关闭的情况下有除你之外的其他人需要为你使用修改器所做出的行为负责\n" +
                                    "最后,请记住,在多人游戏中使用修改器在大多数时候是不被允许的");
                    e.Enabled = false;
                    return;
                }
#endif
                var btn = (s as FunctionButton);
                OnEnabled?.Invoke(HackContext.GameContext);
                HackContext.SetSign((s as FunctionButton).Identity, 1);
            };
            b.OnDisable += (s, e) =>
            {
                OnDisabled?.Invoke(HackContext.GameContext);
                HackContext.SetSign((s as FunctionButton).Identity, 0);
            };
            b.Location = new Point(0, 20 * FunctionsNumber[p]);
            b.Text     = Text;
            p.Controls.Add(b);
            FunctionsNumber[p]++;
            return(b);
        }
 public void RemoveFunctionButton(FunctionButton fb)
 {
     fbList.Remove(fb);
 }
        public PagePanel_Basic(int Width, int Height) : base(Width, Height)
        {
            FunctionsNumber        = new Dictionary <Control, int>();
            ButtonsPanel           = new Panel();
            ButtonsPanel.Bounds    = new Rectangle(0, 0, 60, Height);
            ButtonsPanel.BackColor = Color.FromArgb(30, 255, 255, 255);
            Controls.Add(ButtonsPanel);

            ContentPanel           = new Panel();
            ContentPanel.Bounds    = new Rectangle(60, 3, Width - 60, Height - 6);
            ContentPanel.BackColor = TextButton.SelectedColor;
            Controls.Add(ContentPanel);

            Page1              = new Panel();
            Page1.Bounds       = new Rectangle(3, 0, Width - 60, Height);
            Page2              = new Panel();
            Page2.Bounds       = new Rectangle(3, 0, Width - 60, Height);
            Page3              = new Panel();
            Page3.Bounds       = new Rectangle(3, 0, Width - 60, Height);
            PageEvent          = new Panel();
            PageEvent.Bounds   = new Rectangle(3, 0, Width - 60, Height);
            PageBuilder        = new Panel();
            PageBuilder.Bounds = new Rectangle(3, 0, Width - 60, Height);
            PageMisc           = new Panel();
            PageMisc.Bounds    = new Rectangle(3, 0, Width - 60, Height);

            AddFunction(Page1, MainForm.CurrentLanguage["InfLife"], "3BD0E7860C0441E2B95E63C3F04B4871", true, Utils.InfiniteLife_E, Utils.InfiniteLife_D);
            AddFunction(Page1, MainForm.CurrentLanguage["InfOxygen"], "37EF93BAB687481F87D4D0F95941C781", true, Utils.InfiniteOxygen_E, Utils.InfiniteOxygen_D);
            AddFunction(Page1, MainForm.CurrentLanguage["InfMinion"], "D1808E759CBC533C332968E2603376AD", true, Utils.InfiniteMinion_E, Utils.InfiniteMinion_D);
            AddFunction(Page1, MainForm.CurrentLanguage["InfMana"], "E8A50F6CC601D8B3977E8E9D4677F6DD", true, Utils.InfiniteMana_E, Utils.InfiniteMana_D);
            AddFunction(Page1, MainForm.CurrentLanguage["InfItemAmmo"], "830D900B05074CD0A8DADD1D2EB5F6BC", true, Utils.InfiniteAmmo_E, Utils.InfiniteAmmo_D);
            AddFunction(Page1, MainForm.CurrentLanguage["InfFly"], "8669ADD79BBDD647B240409BE2094DDB", true, Utils.InfiniteFly_E, Utils.InfiniteFly_D);
            AddFunction(Page1, MainForm.CurrentLanguage["ImmuneDebuff"], "A339FE530BB6693DCA0ABC020138A880", true, Utils.ImmuneDebuffs_E, Utils.ImmuneDebuffs_D);
            AddFunction(Page1, MainForm.CurrentLanguage["HighLight"], "800DE5238B9475F09B2D49BAD8CF56D6", true, Utils.HighLight_E, Utils.HighLight_D);
            AddFunction(Page1, MainForm.CurrentLanguage["GhostMode"], "BC5F7996B2B89012715CFBCDBF9434CB", true, Utils.GhostMode_E, Utils.GhostMode_D);

            AddFunction(Page2, MainForm.CurrentLanguage["SlowFall"], "84E55372621C1D6FD4389456C0D64C33", true, Utils.LowGravity_E, Utils.LowGravity_D);
            AddFunction(Page2, MainForm.CurrentLanguage["FastSpeed"], "5B9B9517D95F6F86CCE0D6F0CF16EDAA", true, Utils.FastSpeed_E, Utils.FastSpeed_D);
            AddFunction(Page2, MainForm.CurrentLanguage["ProjectileIgnoreTiles"], "9E594D35FA0657AFA83604C40FF88C76", true, Utils.ProjectileIgnoreTile_E, Utils.ProjectileIgnoreTile_D);
            AddFunction(Page2, MainForm.CurrentLanguage["GrabFarAway"], "BDBFD8A007CA446B01FC3D5DA7BA8560", true, Utils.GrabItemFarAway_E, Utils.GrabItemFarAway_D);
            AddFunction(Page2, MainForm.CurrentLanguage["BonusTwoSlots"], "265E7EE043E026964283772D666DD914", true, Utils.BonusTwoSlots_E, Utils.BonusTwoSlots_D);
            AddFunction(Page2, MainForm.CurrentLanguage["GoldHoleDropBags"], "4FB4064F1FEB6E155313756DCBB82203", true, Utils.GoldHoleDropsBag_E, Utils.GoldHoleDropsBag_D);
            AddFunction(Page2, MainForm.CurrentLanguage["SlimeGunBurnNPCS"], "23280EF2B335403BEF698C2F6AB9CB8A", true, Utils.SlimeGunBurn_E, Utils.SlimeGunBurn_D);
            AddFunction(Page2, MainForm.CurrentLanguage["FishOnlyCrates"], "77D322DE31DDE8C328C44A8A7E63AD04", true, Utils.FishOnlyCrates_E, Utils.FishOnlyCrates_D);
            AddFunction(Page2, MainForm.CurrentLanguage["EnableAllRecipes"], "DA840529BCE9704EF4F1BA5CB6C6ECD4", true, Utils.EnableAllRecipes_E, Utils.EnableAllRecipes_D);
            AddFunction(Page2, MainForm.CurrentLanguage["StengthenedVampireKnives"], "418C48524EA50ECC6717C5D629AF7B32", true, Utils.StrengthenVampireKnives_E, Utils.StrengthenVampireKnives_D);
            AddFunction(Page2, MainForm.CurrentLanguage["SwingIgnoringTiles"], "4B246B44592B441C9DC23E9EBC077A98", true, Utils.SwingIgnoringTils_E, Utils.SwingIgnoringTils_D);
            AddFunction(Page2, MainForm.CurrentLanguage["SwingingAttacksAll"], "1D2F13AE9E084743898A11EE64D744D2", true, Utils.SwingingAttacksAll_E, Utils.SwingingAttacksAll_D);

            AddFunction(Page3, MainForm.CurrentLanguage["BurnAllNPCS"], "9A3F870D0DDB5B46F6E1B1266D6882AD", false,
                        g =>
            {
                int i = 0;
                PopupProgressBar p        = new PopupProgressBar();
                p.MainProgressBar.Maximum = NPC.MAXNUMBER;
                System.Timers.Timer timer = new System.Timers.Timer(1);
                timer.Elapsed            += (sender, e) =>
                {
                    var b   = p.MainProgressBar;
                    b.Value = i;
                    b.Invalidate();
                    b.Text = b.Value + "/" + b.Maximum;
                    if (i >= b.Maximum)
                    {
                        p.Dispose();
                    }
                };
                timer.Start();
                p.Show();
                p.Location = new Point(MainForm.MainFormInstance.Location.X + MainForm.MainFormInstance.Width / 2 - p.ClientSize.Width / 2, MainForm.MainFormInstance.Location.Y + MainForm.MainFormInstance.Height / 2 - p.ClientSize.Height / 2);
                new Thread(() =>
                {
                    MainForm.MainFormInstance.Enabled = false;
                    var npc = HackContext.GameContext.NPC;
                    for (; i < NPC.MAXNUMBER; i++)
                    {
                        if (npc[i].Active)
                        {
                            npc[i].AddBuff(153, 216000);
                        }
                    }
                    MainForm.MainFormInstance.Enabled = true;
                }).Start();
            }, null);
            AddFunction(Page3, MainForm.CurrentLanguage["BurnAllPlayers"], "37EF93BAB687481F87D4D0F95941C781", false,
                        g =>
            {
                int i = 0;
                PopupProgressBar p        = new PopupProgressBar();
                p.MainProgressBar.Maximum = Player.MAXNUMBER;
                System.Timers.Timer timer = new System.Timers.Timer(1);
                timer.Elapsed            += (sender, e) =>
                {
                    var b   = p.MainProgressBar;
                    b.Value = i;
                    b.Invalidate();
                    b.Text = b.Value + "/" + b.Maximum;
                    if (i >= b.Maximum)
                    {
                        p.Dispose();
                    }
                };
                timer.Start();
                p.Show();
                p.Location = new Point(MainForm.MainFormInstance.Location.X + MainForm.MainFormInstance.Width / 2 - p.ClientSize.Width / 2, MainForm.MainFormInstance.Location.Y + MainForm.MainFormInstance.Height / 2 - p.ClientSize.Height / 2);
                new Thread(() =>
                {
                    MainForm.MainFormInstance.Enabled = false;
                    var player = HackContext.GameContext.Players;
                    for (; i < Player.MAX_PLAYER; i++)
                    {
                        if (player[i].Active)
                        {
                            player[i].AddBuff(44, 216000);
                        }
                    }
                    MainForm.MainFormInstance.Enabled = true;
                }).Start();
            }, null);
            AddFunction(Page3, MainForm.CurrentLanguage["PourLavaOntoPlayers"], "D1808E759CBC533C332968E2603376AD", false, Utils.DropLavaOntoPlayers, null);
            FunctionButton _b = null;

            _b = AddFunction(Page3, MainForm.CurrentLanguage["RandomUUID"], "E8A50F6CC601D8B3977E8E9D4677F6DD", false,
                             g =>
            {
                HackContext.GameContext.UUID = Guid.NewGuid().ToString();
                _b.Text = HackContext.GameContext.UUID;
            }, null);
            AddFunction(Page3, MainForm.CurrentLanguage["ExploreWholeWorld"], "830D900B05074CD0A8DADD1D2EB5F6BC", false, Utils.RevealMap, null);
            AddFunction(Page3, MainForm.CurrentLanguage["RightClickToTP"], "8669ADD79BBDD647B240409BE2094DDB", false, Utils.RightClickToTP, null);
            AddFunction(Page3, MainForm.CurrentLanguage["ProjectilePuzzle"], "A339FE530BB6693DCA0ABC020138A880", false,
                        g =>
            {
                OpenFileDialog ofd = new OpenFileDialog();

                ofd.Filter = "png files (*.png)|*.png";
                if (ofd.ShowDialog(this) == DialogResult.OK)
                {
                    var ctx       = HackContext.GameContext;
                    var config    = (MainForm.Configs["CFG_ProjDrawer"] as CFG_ProjDrawer);
                    ProjImage img = ProjImage.FromImage(ofd.FileName, config.ProjType, config.Resolution);
                    this.Enabled  = false;
                    img.Emit(ctx, new MPointF(ctx.MyPlayer.X, ctx.MyPlayer.Y));
                    this.Enabled = true;
                }
            }, null);
            AddFunction(Page3, MainForm.CurrentLanguage["RainbowTexting"], "89494BDF0C804010910932F71E5EC75E", false,
                        g =>
            {
                MForm Form = new MForm
                {
                    BackColor     = Color.FromArgb(90, 90, 90),
                    Text          = MainForm.CurrentLanguage["RainbowTexting"],
                    StartPosition = FormStartPosition.CenterParent,
                    ClientSize    = new Size(245, 72)
                };

                CheckBox ReloadAllFonts = new CheckBox()
                {
                    Text     = MainForm.CurrentLanguage["ReloadFonts"],
                    Location = new Point(10, 0),
                    Size     = new Size(200, 20),
                };
                Form.MainPanel.Controls.Add(ReloadAllFonts);

                Label Tip = new Label()
                {
                    Text      = MainForm.CurrentLanguage["Text"] + ":",
                    Location  = new Point(0, 20),
                    Size      = new Size(80, 20),
                    TextAlign = ContentAlignment.MiddleCenter
                };
                Form.MainPanel.Controls.Add(Tip);

                TextBox Box = new TextBox
                {
                    BorderStyle = BorderStyle.FixedSingle,
                    BackColor   = Color.FromArgb(120, 120, 120),
                    Text        = "",
                    Location    = new Point(85, 20),
                    Size        = new Size(95, 20),
                    ImeMode     = ImeMode.On
                };
                Form.MainPanel.Controls.Add(Box);

                Button ConfirmButton    = new Button();
                ConfirmButton.Text      = MainForm.CurrentLanguage["Confirm"];
                ConfirmButton.FlatStyle = FlatStyle.Flat;
                ConfirmButton.Size      = new Size(65, 20);
                ConfirmButton.Location  = new Point(180, 20);
                ConfirmButton.Click    += (s1, e1) =>
                {
                    if (HackContext.Characters == null)
                    {
                        HackContext.Characters = new Dictionary <char, ProjImage>();
                        HackContext.LoadRainbowFonts(HackContext.Characters);
                    }
                    if (ReloadAllFonts.Checked)
                    {
                        HackContext.Characters.Clear();
                        HackContext.LoadRainbowFonts(HackContext.Characters);
                    }
                    RainbowTextDrawer rtd = new RainbowTextDrawer(HackContext.Characters);
                    rtd.DrawString(Box.Text, center: new MPointF());
                    var ctx    = HackContext.GameContext;
                    var player = ctx.MyPlayer;
                    rtd.Emit(ctx, new MPointF(player.X, player.Y));
                    Form.Dispose();
                };
                Form.MainPanel.Controls.Add(ConfirmButton);
                Form.Activated += (s, e) =>
                {
                    Box.Focus();
                };
                Form.ShowDialog(this);
            }, null);
            AddFunction(Page3, MainForm.CurrentLanguage["CoronaVirus"], "7FF4CE10ED9B4924BA63F92E2443C79A", false,
                        g =>
            {
                var player = g.MyPlayer;
                for (int i = 0; i < 3; i++)
                {
                    NPC.NewNPC(g, Convert.ToInt32(player.X), Convert.ToInt32(player.Y) - 2, 51);
                }
                player.AddBuff(44, 600, true);
                player.AddBuff(153, 600, true);
                player.AddBuff(67, 600, true);
                player.AddBuff(24, 600, true);
            }, null);
            //AddFunction(Page3, MainForm.CurrentLanguage["HarpLeftClickTP"], "800DE5238B9475F09B2D49BAD8CF56D6", true, Utils.HarpToTP_E, Utils.HarpToTP_D);

            AddFunction(PageEvent, MainForm.CurrentLanguage["ToggleDayNight"], "E6F33D980A95291E6D0C0033F39E6629", false, g => g.DayTime        = !g.DayTime, null);
            AddFunction(PageEvent, MainForm.CurrentLanguage["ToggleSunDial"], "6FFF093BA44EEFD41C9E3585FA18EBBA", false, g => g.FastForwardTime = !g.FastForwardTime, null);
            AddFunction(PageEvent, MainForm.CurrentLanguage["ToggleBloodMoon"], "C8DE8467590D278A312E9C5A0A63DF84", false, g => g.BloodMoon     = !g.BloodMoon, null);
            AddFunction(PageEvent, MainForm.CurrentLanguage["ToggleEclipse"], "DA4EFFA8EAC423555CF33536D6851570", false, g => g.Eclipse         = !g.Eclipse, null);
            AddFunction(PageEvent, MainForm.CurrentLanguage["ToggleSnowMoon"], "A74C10BB62FE043E1924AB2267570C42", false, g => g.SnowMoon       = !g.SnowMoon, null);
            AddFunction(PageEvent, MainForm.CurrentLanguage["TogglePumpkinMoon"], "192BB3BD522421DC4AC18EC61800EE04", false, g => g.PumpkinMoon = !g.PumpkinMoon, null);

            AddFunction(PageBuilder, MainForm.CurrentLanguage["SuperRange"], "2045F3ED1E8276545D86390FFFA9B02E", true, Utils.SuperRange_E, Utils.SuperRange_D);
            AddFunction(PageBuilder, MainForm.CurrentLanguage["FastTilingAndWallingSpeed"], "B5892B95C1D1C38DA5E8E0499E34235D", true, Utils.FastTileAndWallSpeed_E, Utils.FastTileAndWallSpeed_D);
            AddFunction(PageBuilder, MainForm.CurrentLanguage["MechanicalRulerEffect"], "B84EB7D6788F944E81654735A22DB528", true, Utils.MachinicalRulerEffect_E, Utils.MachinicalRulerEffect_D);
            AddFunction(PageBuilder, MainForm.CurrentLanguage["MechanicalGlassesEffect"], "62DC9F0484D233B9FB54A6BF15521354", true, Utils.ShowCircuit_E, Utils.ShowCircuit_D);

            AddFunction(PageMisc, MainForm.CurrentLanguage["ShadowDodge"], "4C930E9DB193D5E61AFEDB24E8D5392E", true, Utils.ShadowDodge_E, Utils.ShadowDodge_D);
            AddFunction(PageMisc, MainForm.CurrentLanguage["ShowInvisiblePlayers"], "1EE572824476A3BBB1AA367E70BFF790", true, Utils.ShowInvisiblePlayers_E, Utils.ShowInvisiblePlayers_D);

            AddTab(MainForm.CurrentLanguage["Basic_1"], Page1).Selected = true;
            AddTab(MainForm.CurrentLanguage["Basic_2"], Page2);
            AddTab(MainForm.CurrentLanguage["Advanced"], Page3);
            AddTab(MainForm.CurrentLanguage["Event"], PageEvent);
            AddTab(MainForm.CurrentLanguage["Builder"], PageBuilder);
            AddTab(MainForm.CurrentLanguage["Miscs"], PageMisc);
        }
Exemple #20
0
        public PagePanel_Basic(int Width, int Height) : base(Width, Height)
        {
            FunctionsNumber        = new Dictionary <Control, int>();
            ButtonsPanel           = new Panel();
            ButtonsPanel.Bounds    = new Rectangle(0, 0, 60, Height);
            ButtonsPanel.BackColor = Color.FromArgb(30, 255, 255, 255);
            Controls.Add(ButtonsPanel);

            ContentPanel           = new Panel();
            ContentPanel.Bounds    = new Rectangle(60, 3, Width - 60, Height - 6);
            ContentPanel.BackColor = TextButton.SelectedColor;
            Controls.Add(ContentPanel);

            Page1              = new Panel();
            Page1.Bounds       = new Rectangle(3, 0, Width - 60, Height);
            Page2              = new Panel();
            Page2.Bounds       = new Rectangle(3, 0, Width - 60, Height);
            Page3              = new Panel();
            Page3.Bounds       = new Rectangle(3, 0, Width - 60, Height);
            PageEvent          = new Panel();
            PageEvent.Bounds   = new Rectangle(3, 0, Width - 60, Height);
            PageBuilder        = new Panel();
            PageBuilder.Bounds = new Rectangle(3, 0, Width - 60, Height);
            PageMisc           = new Panel();
            PageMisc.Bounds    = new Rectangle(3, 0, Width - 60, Height);

            AddFunction(Page1, MainForm.CurrentLanguage["InfLife"], "3BD0E7860C0441E2B95E63C3F04B4871", true, Utils.InfiniteLife_E, Utils.InfiniteLife_D);
            AddFunction(Page1, MainForm.CurrentLanguage["InfOxygen"], "37EF93BAB687481F87D4D0F95941C781", true, Utils.InfiniteOxygen_E, Utils.InfiniteOxygen_D);
            AddFunction(Page1, MainForm.CurrentLanguage["InfMinion"], "D1808E759CBC533C332968E2603376AD", true, Utils.InfiniteMinion_E, Utils.InfiniteMinion_D);
            AddFunction(Page1, MainForm.CurrentLanguage["InfMana"], "E8A50F6CC601D8B3977E8E9D4677F6DD", true, Utils.InfiniteMana_E, Utils.InfiniteMana_D);
            AddFunction(Page1, MainForm.CurrentLanguage["InfItemAmmo"], "830D900B05074CD0A8DADD1D2EB5F6BC", true, Utils.InfiniteAmmo_E, Utils.InfiniteAmmo_D);
            AddFunction(Page1, MainForm.CurrentLanguage["InfFly"], "8669ADD79BBDD647B240409BE2094DDB", true, Utils.InfiniteFly_E, Utils.InfiniteFly_D);
            AddFunction(Page1, MainForm.CurrentLanguage["ImmuneDebuff"], "A339FE530BB6693DCA0ABC020138A880", true, Utils.ImmuneDebuffs_E, Utils.ImmuneDebuffs_D);
            AddFunction(Page1, MainForm.CurrentLanguage["HighLight"], "800DE5238B9475F09B2D49BAD8CF56D6", true, Utils.HighLight_E, Utils.HighLight_D);
            AddFunction(Page1, MainForm.CurrentLanguage["GhostMode"], "BC5F7996B2B89012715CFBCDBF9434CB", true, Utils.GhostMode_E, Utils.GhostMode_D);

            AddFunction(Page2, MainForm.CurrentLanguage["SlowFall"], "84E55372621C1D6FD4389456C0D64C33", true, Utils.LowGravity_E, Utils.LowGravity_D);
            AddFunction(Page2, MainForm.CurrentLanguage["FastSpeed"], "5B9B9517D95F6F86CCE0D6F0CF16EDAA", true, Utils.FastSpeed_E, Utils.FastSpeed_D);
            AddFunction(Page2, MainForm.CurrentLanguage["ProjectileIgnoreTiles"], "9E594D35FA0657AFA83604C40FF88C76", true, Utils.ProjectileIgnoreTile_E, Utils.ProjectileIgnoreTile_D);
            AddFunction(Page2, MainForm.CurrentLanguage["GrabFarAway"], "BDBFD8A007CA446B01FC3D5DA7BA8560", true, Utils.GrabItemFarAway_E, Utils.GrabItemFarAway_D);
            AddFunction(Page2, MainForm.CurrentLanguage["BonusTwoSlots"], "265E7EE043E026964283772D666DD914", true, Utils.BonusTwoSlots_E, Utils.BonusTwoSlots_D);
            AddFunction(Page2, MainForm.CurrentLanguage["GoldHoleDropBags"], "4FB4064F1FEB6E155313756DCBB82203", true, Utils.GoldHoleDropsBag_E, Utils.GoldHoleDropsBag_D);
            AddFunction(Page2, MainForm.CurrentLanguage["SlimeGunBurnNPCS"], "23280EF2B335403BEF698C2F6AB9CB8A", true, Utils.SlimeGunBurn_E, Utils.SlimeGunBurn_D);
            AddFunction(Page2, MainForm.CurrentLanguage["FishOnlyCrates"], "77D322DE31DDE8C328C44A8A7E63AD04", true, Utils.FishOnlyCrates_E, Utils.FishOnlyCrates_D);
            AddFunction(Page2, MainForm.CurrentLanguage["EnableAllRecipes"], "DA840529BCE9704EF4F1BA5CB6C6ECD4", true, Utils.EnableAllRecipes_E, Utils.EnableAllRecipes_D);
            AddFunction(Page2, MainForm.CurrentLanguage["StengthenedVampireKnives"], "418C48524EA50ECC6717C5D629AF7B32", true, Utils.StrengthenVampireKnives_E, Utils.StrengthenVampireKnives_D);

            AddFunction(Page3, MainForm.CurrentLanguage["BurnAllNPCS"], "9A3F870D0DDB5B46F6E1B1266D6882AD", false,
                        g =>
            {
                int i = 0;
                PopupProgressBar p        = new PopupProgressBar();
                p.MainProgressBar.Maximum = NPC.MAXNUMBER;
                System.Timers.Timer timer = new System.Timers.Timer(1);
                timer.Elapsed            += (sender, e) =>
                {
                    var b   = p.MainProgressBar;
                    b.Value = i;
                    b.Invalidate();
                    b.Text = b.Value + "/" + b.Maximum;
                    if (i >= b.Maximum)
                    {
                        p.Dispose();
                    }
                };
                timer.Start();
                p.Show();
                p.Location = new Point(MainForm.MainFormInstance.Location.X + MainForm.MainFormInstance.Width / 2 - p.ClientSize.Width / 2, MainForm.MainFormInstance.Location.Y + MainForm.MainFormInstance.Height / 2 - p.ClientSize.Height / 2);
                new Thread(() =>
                {
                    MainForm.MainFormInstance.Enabled = false;
                    var npc = HackContext.GameContext.NPC;
                    for (; i < NPC.MAXNUMBER; i++)
                    {
                        if (npc[i].Active)
                        {
                            npc[i].AddBuff(0x99, 216000);
                        }
                    }
                    MainForm.MainFormInstance.Enabled = true;
                }).Start();
            }, null);
            AddFunction(Page3, MainForm.CurrentLanguage["BurnAllPlayers"], "37EF93BAB687481F87D4D0F95941C781", false,
                        g =>
            {
                int i = 0;
                PopupProgressBar p        = new PopupProgressBar();
                p.MainProgressBar.Maximum = NPC.MAXNUMBER;
                System.Timers.Timer timer = new System.Timers.Timer(1);
                timer.Elapsed            += (sender, e) =>
                {
                    var b   = p.MainProgressBar;
                    b.Value = i;
                    b.Invalidate();
                    b.Text = b.Value + "/" + b.Maximum;
                    if (i >= b.Maximum)
                    {
                        p.Dispose();
                    }
                };
                timer.Start();
                p.Show();
                p.Location = new Point(MainForm.MainFormInstance.Location.X + MainForm.MainFormInstance.Width / 2 - p.ClientSize.Width / 2, MainForm.MainFormInstance.Location.Y + MainForm.MainFormInstance.Height / 2 - p.ClientSize.Height / 2);
                new Thread(() =>
                {
                    MainForm.MainFormInstance.Enabled = false;
                    var player = HackContext.GameContext.Players;
                    for (; i < Player.MAX_PLAYER; i++)
                    {
                        if (player[i].Active)
                        {
                            player[i].AddBuff(44, 216000);
                        }
                    }
                    MainForm.MainFormInstance.Enabled = true;
                }).Start();
            }, null);
            AddFunction(Page3, MainForm.CurrentLanguage["PourLavaOntoPlayers"], "D1808E759CBC533C332968E2603376AD", false, Utils.DropLavaOntoPlayers, null);
            FunctionButton _b = null;

            _b = AddFunction(Page3, MainForm.CurrentLanguage["RandomUUID"], "E8A50F6CC601D8B3977E8E9D4677F6DD", false,
                             g =>
            {
                HackContext.GameContext.UUID = Guid.NewGuid().ToString();
                _b.Text = HackContext.GameContext.UUID;
            }, null);
            AddFunction(Page3, MainForm.CurrentLanguage["ExploreWholeWorld"], "830D900B05074CD0A8DADD1D2EB5F6BC", false, Utils.RevealMap, null);
            AddFunction(Page3, MainForm.CurrentLanguage["RightClickToTP"], "8669ADD79BBDD647B240409BE2094DDB", false, Utils.RightClickToTP, null);
            AddFunction(Page3, MainForm.CurrentLanguage["ProjectilePuzzle"], "A339FE530BB6693DCA0ABC020138A880", false,
                        g =>
            {
                OpenFileDialog ofd = new OpenFileDialog();

                ofd.Filter = "png files (*.png)|*.png";
                if (ofd.ShowDialog(this) == DialogResult.OK)
                {
                    var ctx       = HackContext.GameContext;
                    ProjImage img = ProjImage.FromImage(ofd.FileName, MainForm.Config_ProjDrawer.ProjType, MainForm.Config_ProjDrawer.Resolution);
                    this.Enabled  = false;
                    img.Emit(ctx, ctx.MyPlayer.X, ctx.MyPlayer.Y);
                    this.Enabled = true;
                }
            }, null);
            AddFunction(Page3, MainForm.CurrentLanguage["HarpLeftClickTP"], "800DE5238B9475F09B2D49BAD8CF56D6", true, Utils.HarpToTP_E, Utils.HarpToTP_D);

            AddFunction(PageEvent, MainForm.CurrentLanguage["ToggleDayNight"], "E6F33D980A95291E6D0C0033F39E6629", false, g => g.DayTime        = !g.DayTime, null);
            AddFunction(PageEvent, MainForm.CurrentLanguage["ToggleSunDial"], "6FFF093BA44EEFD41C9E3585FA18EBBA", false, g => g.FastForwardTime = !g.FastForwardTime, null);
            AddFunction(PageEvent, MainForm.CurrentLanguage["ToggleBloodMoon"], "C8DE8467590D278A312E9C5A0A63DF84", false, g => g.BloodMoon     = !g.BloodMoon, null);
            AddFunction(PageEvent, MainForm.CurrentLanguage["ToggleEclipse"], "DA4EFFA8EAC423555CF33536D6851570", false, g => g.Eclipse         = !g.Eclipse, null);
            AddFunction(PageEvent, MainForm.CurrentLanguage["ToggleSnowMoon"], "A74C10BB62FE043E1924AB2267570C42", false, g => g.SnowMoon       = !g.SnowMoon, null);
            AddFunction(PageEvent, MainForm.CurrentLanguage["TogglePumpkinMoon"], "192BB3BD522421DC4AC18EC61800EE04", false, g => g.PumpkinMoon = !g.PumpkinMoon, null);

            AddFunction(PageBuilder, MainForm.CurrentLanguage["SuperRange"], "2045F3ED1E8276545D86390FFFA9B02E", true, Utils.SuperRange_E, Utils.SuperRange_D);
            AddFunction(PageBuilder, MainForm.CurrentLanguage["FastTileSpeed"], "B5892B95C1D1C38DA5E8E0499E34235D", true, Utils.FastTileSpeed_E, Utils.FastTileSpeed_D);
            AddFunction(PageBuilder, MainForm.CurrentLanguage["RulerEffect"], "6FFA25DEFAFB8DD7EE02BC7179509859", true, Utils.RulerEffect_E, Utils.RulerEffect_D);
            AddFunction(PageBuilder, MainForm.CurrentLanguage["MechanicalRulerEffect"], "B84EB7D6788F944E81654735A22DB528", true, Utils.MachinicalRulerEffect_E, Utils.MachinicalRulerEffect_D);
            AddFunction(PageBuilder, MainForm.CurrentLanguage["MechanicalGlassesEffect"], "62DC9F0484D233B9FB54A6BF15521354", true, Utils.ShowCircuit_E, Utils.ShowCircuit_D);

            AddFunction(PageMisc, MainForm.CurrentLanguage["ShadowDodge"], "4C930E9DB193D5E61AFEDB24E8D5392E", true, Utils.ShadowDodge_E, Utils.ShadowDodge_D);
            AddFunction(PageMisc, MainForm.CurrentLanguage["ShowInvisiblePlayers"], "1EE572824476A3BBB1AA367E70BFF790", true, Utils.ShowInvisiblePlayers_E, Utils.ShowInvisiblePlayers_D);

            AddTab(MainForm.CurrentLanguage["Basic_1"], Page1).Selected = true;
            AddTab(MainForm.CurrentLanguage["Basic_2"], Page2);
            AddTab(MainForm.CurrentLanguage["Advanced"], Page3);
            AddTab(MainForm.CurrentLanguage["Event"], PageEvent);
            AddTab(MainForm.CurrentLanguage["Builder"], PageBuilder);
            AddTab(MainForm.CurrentLanguage["Miscs"], PageMisc);
        }
Exemple #21
0
 public void RemoveFunctionButton(FunctionButton fb)
 {
     functionButtons.Remove(fb);
 }
Exemple #22
0
 public void AddFunctionButton(FunctionButton fb)
 {
     functionButtons.Add(fb);
 }
 public void AddFunctionButton(FunctionButton fb)
 {
     fbList.Add(fb);
 }
Exemple #24
0
        private bool initFlowPicBox()
        {
            clear();
            string routeCode = "",
                   moCode    = "",
                   itemCode;

            object[] objs;

            if (string.IsNullOrEmpty(Convert.ToString(this.drownListMoCode.SelectedItemValue)))
            {
                return(false);
            }
            moCode = Convert.ToString(this.drownListMoCode.SelectedItemValue);
            if (string.IsNullOrEmpty(Convert.ToString(this.drownListRouteCode.SelectedItemValue)))
            {
                return(false);
            }
            routeCode = Convert.ToString(this.drownListRouteCode.SelectedItemValue);

            Messages msg = new Messages();

            if (m_DataCollectFacade == null)
            {
                m_DataCollectFacade = new DataCollectFacade(this.DataProvider);
            }
            try
            {
                //add
                string sourceRcard = m_DataCollectFacade.GetSourceCard(FormatHelper.CleanString(txtRcard.Text.ToUpper()), this.drownListMoCode.SelectedItemValue.ToString());
                //end
                //object objLastSimRe = m_DataCollectFacade.GetLastSimulationReport(FormatHelper.CleanString(sourceRcard));
                object objLastSimRe = m_DataCollectFacade.GetSimulationReport(this.drownListMoCode.SelectedItemValue.ToString(), FormatHelper.CleanString(sourceRcard));


                if (objLastSimRe == null)
                {
                    msg.Add(new UserControl.Message(MessageType.Error, "$Error_CS_ID_Not_Exist"));
                    txtRcard.SelectAll();
                    txtRcard.Focus();
                    ApplicationRun.GetInfoForm().Add(msg);
                    return(false);
                }
                else
                {
                    SimulationReport currentSimRe = (SimulationReport)objLastSimRe;
                    itemCode = currentSimRe.ItemCode;

                    //查询当前途程工序捞TBLITEMROUTE2OP表
                    //QueryItemOpFlow(当前itemCode,当前途程Code);
                    objs = m_DataCollectFacade.QueryItemOpFlow(itemCode, routeCode);
                    if (objs == null)
                    {
                        ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Normal, "$CS_No_Data_To_Display"));
                        //add by klaus 置焦点
                        txtRcard.SelectAll();
                        txtRcard.Focus();
                        return(false);
                    }

                    #region 画流程图
                    this.panelDrawFlow.Controls.Clear();
                    this.panelDrawFlow.Refresh();

                    StartButton btnStart = new StartButton();
                    this.panelDrawFlow.Controls.Add(btnStart);
                    btnStart.setProcessName(MutiLanguages.ParserString("$CS_Start"));
                    btnStart.Location = new Point(10, 30);
                    btnStart.DrawButton();

                    FunctionButton lastOne = btnStart;
                    FlowButton     btnFlow = new StraightArrowButton();
                    double         vdegree = 0;

                    ItemRoute2OP currentOP = null;

                    for (int i = 0; i < objs.Length; i++)
                    {
                        ItemRoute2OP itemRoute2Op = objs[i] as ItemRoute2OP;

                        btnFlow = lastOne.AddOutArrow(vdegree);
                        Operation op = (Operation) new BaseModelFacade(this.DataProvider).GetOperation(itemRoute2Op.OPCode);
                        lastOne = btnFlow.AddOutProcess(itemRoute2Op.OPCode);

                        lastOne.Tag       = itemRoute2Op.OPCode;
                        lastOne.ProcessID = op.OPDescription;
                        lastOne.DrawButton();
                        lastOne.BackColor = Color.Green;
                        lastOne.Click    += new EventHandler(btn_Click);

                        //string actionResult = m_DataCollectFacade.CheckOpIsExist(FormatHelper.CleanString(txtRcard.Text.Trim().ToUpper()), moCode, routeCode, itemRoute2Op.OPCode);
                        string actionResult = m_DataCollectFacade.CheckOpIsExist(sourceRcard, moCode, routeCode, itemRoute2Op.OPCode);
                        if (string.IsNullOrEmpty(actionResult))
                        {
                            lastOne.BackColor = Color.White;
                        }
                        else
                        {
                            if (actionResult == ProductStatus.GOOD)
                            {
                                lastOne.BackColor = Color.Green;
                            }
                            else
                            {
                                lastOne.BackColor = Color.Red;
                            }
                        }

                        if (itemRoute2Op.OPCode == currentSimRe.OPCode &&
                            itemRoute2Op.RouteCode == currentSimRe.RouteCode)
                        {
                            currentOP = (ItemRoute2OP)objs[i];
                            if (currentSimRe.Status == ProductStatus.GOOD)
                            {
                                lastOne.BackColor = Color.Green;
                            }
                            else
                            {
                                lastOne.BackColor = Color.Red;
                            }
                        }

                        #region 注释 Terry 2012-11-13
                        //如果途程里工序是从0开始,显示背景有问题。
                        //if ((currentOP != null) && (i > currentOP.OPSequence - 1))
                        //{
                        //    lastOne.BackColor = Color.WhiteSmoke;
                        //}
                        #endregion

                        if ((btnFlow as StraightArrowButton).Degree == 90)
                        {
                            vdegree = (vdegree + 180) % 360;
                        }
                    }
                    btnFlow = lastOne.AddOutArrow(vdegree);
                    EndButton btnEnd = btnFlow.AddEnd();
                    btnEnd.Text      = MutiLanguages.ParserString("$CS_End");
                    btnEnd.BackColor = lastOne.BackColor;
                    #endregion

                    return(true);
                }
            }
            catch (Exception ex)
            {
                msg.Add(new UserControl.Message(ex));
                ApplicationRun.GetInfoForm().Add(msg);
                txtRcard.Focus();
                return(false);
            }
        }