示例#1
0
 private void Update()
 {
     if (boxNum != 8)
     {
         boxNum = Info_Panel.UpdateUI(b.hungerLevel, b.healthLevel, b.thirstLevel, boxNum);
     }
 }
示例#2
0
 private void InfoProxy_LB_Click(object sender, EventArgs e)
 {
     SelectedMenuLabel();
     InfoProxy_LB.ForeColor = Color.White;
     InfoProxy_Panel.Show();
     Info_Panel.Hide();
     RegistryHacks_Panel.Hide();
     CustRegHacks_Panel.Hide();
     Settings_Panel.Hide();
     SelectedLabel_LB.Location = new Point(25, SelectedLabel_LB.Location.Y);
     SelectedLabel_LB.Size     = new Size(93, 3);
 }
示例#3
0
    public void Update()
    {
        if (boxNum != 8)
        {
            boxNum = Info_Panel.UpdateUI(h.hungerLevel, h.healthLevel, h.thirstLevel, boxNum);
        }

        if (hasNest == false)
        {
            findClosestNest();
            hasNest = closestNest.addHareToNest(this.gameObject);
        }
    }
示例#4
0
 void OnMouseDown()
 {
     boxNum = Info_Panel.OpenBox(b.hungerLevel, b.healthLevel, b.thirstLevel, b.animalName, b.animalAge, b.animalSex, guid.gameObjectID);
 }
        /// <summary>
        /// Constructor
        /// </summary>
        public Generator()
        {
            strategyBest       = Data.Strategy.Clone();
            bestBalance        = isOOS ? Backtester.Balance(barOOS) : Backtester.NetBalance;
            isGenerating       = false;
            isStartegyChanged  = false;
            indicatorBlackList = new List<string>();

            font      = this.Font;
            colorText = LayoutColors.ColorControlText;

            tsStrategy         = new ToolStrip();
            tsGenerator        = new ToolStrip();
            strategyLayout     = new Strategy_Layout(strategyBest);
            pnlCommon          = new Fancy_Panel(Language.T("Common"));
            pnlLimitations     = new Fancy_Panel(Language.T("Limitations"));
            pnlSettings        = new Fancy_Panel(Language.T("Settings"));
            pnlTop10           = new Fancy_Panel(Language.T("Top 10"));
            pnlIndicators      = new Fancy_Panel(Language.T("Indicators"));
            smallBalanceChart  = new Small_Balance_Chart();
            infpnlAccountStatistics = new Info_Panel();
            progressBar        = new ProgressBar();
            lblCalcStrInfo     = new Label();
            lblCalcStrNumb     = new Label();
            btnAccept          = new Button();
            btnGenerate        = new Button();
            btnCancel          = new Button();
            chbGenerateNewStrategy = new CheckBox();
            chbPreservPermSL   = new CheckBox();
            chbPreservPermTP   = new CheckBox();
            chbInitialOptimisation = new CheckBox();
            nudWorkingMinutes  = new NumericUpDown();
            lblWorkingMinutes  = new Label();

            MaximizeBox     = false;
            Icon            = Data.Icon;
            FormBorderStyle = FormBorderStyle.FixedDialog;
            BackColor       = LayoutColors.ColorFormBack;
            AcceptButton    = btnGenerate;
            Text            = Language.T("Strategy Generator") + " - " + Data.Symbol + " " + Data.PeriodString + ", " + Data.Bars.ToString() + " " + Language.T("bars");
            FormClosing    += new FormClosingEventHandler(Generator_FormClosing);

            // Tool Strip Strategy
            tsStrategy.Parent   = this;
            tsStrategy.Dock     = DockStyle.None;
            tsStrategy.AutoSize = false;

            // Tool Strip Generator
            tsGenerator.Parent   = this;
            tsGenerator.Dock     = DockStyle.None;
            tsGenerator.AutoSize = false;

            // Creates a Strategy Layout
            strategyLayout.Parent                = this;
            strategyLayout.ShowAddSlotButtons    = false;
            strategyLayout.ShowRemoveSlotButtons = false;
            strategyLayout.ShowPadlockImg        = true;
            strategyLayout.SlotPropertiesTipText = Language.T("Lock or unlock the slot.");
            strategyLayout.SlotToolTipText       = Language.T("Lock, link, or unlock the slot.");

            pnlCommon.Parent       = this;
            pnlLimitations.Parent  = this;
            pnlSettings.Parent     = this;
            pnlTop10.Parent        = this;
            pnlIndicators.Parent   = this;

            // smallBalanceChart
            smallBalanceChart.Parent    = this;
            smallBalanceChart.BackColor = LayoutColors.ColorControlBack;
            smallBalanceChart.Visible   = true;
            smallBalanceChart.Cursor    = Cursors.Hand;
            smallBalanceChart.Click    += new EventHandler(AccountAutput_Click);
            smallBalanceChart.DoubleClick += new EventHandler(AccountAutput_Click);
            toolTip.SetToolTip(smallBalanceChart, Language.T("Show account statistics."));
            smallBalanceChart.SetChartData();

            // Info Panel Account Statistics
            infpnlAccountStatistics.Parent  = this;
            infpnlAccountStatistics.Visible = false;
            infpnlAccountStatistics.Cursor  = Cursors.Hand;
            infpnlAccountStatistics.Click  += new EventHandler(AccountAutput_Click);
            infpnlAccountStatistics.DoubleClick += new EventHandler(AccountAutput_Click);
            toolTip.SetToolTip(infpnlAccountStatistics, Language.T("Show account chart."));

            // ProgressBar
            progressBar.Parent  = this;
            progressBar.Minimum = 1;
            progressBar.Maximum = 100;
            progressBar.Step    = 1;

            //Button Generate
            btnGenerate.Parent = this;
            btnGenerate.Name   = "Generate";
            btnGenerate.Text   = Language.T("Generate");
            btnGenerate.Click += new EventHandler(BtnGenerate_Click);
            btnGenerate.UseVisualStyleBackColor = true;

            //Button Accept
            btnAccept.Parent  = this;
            btnAccept.Name    = "Accept";
            btnAccept.Text    = Language.T("Accept");
            btnAccept.Enabled = false;
            btnAccept.DialogResult = DialogResult.OK;
            btnAccept.UseVisualStyleBackColor = true;

            //Button Cancel
            btnCancel.Parent = this;
            btnCancel.Text   = Language.T("Cancel");
            btnCancel.DialogResult = DialogResult.Cancel;
            btnCancel.UseVisualStyleBackColor = true;

            // BackgroundWorker
            bgWorker = new BackgroundWorker();
            bgWorker.WorkerReportsProgress      = true;
            bgWorker.WorkerSupportsCancellation = true;
            bgWorker.DoWork             += new DoWorkEventHandler(BgWorker_DoWork);
            bgWorker.ProgressChanged    += new ProgressChangedEventHandler(BgWorker_ProgressChanged);
            bgWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(BgWorker_RunWorkerCompleted);

            SetButtonsStrategy();
            SetButtonsGenerator();
            SetPanelCommon();
            SetPanelLimitations();
            SetPanelSettings();
            SetPanelTop10();
            SetPanelIndicators();
            LoadOptions();
            SetSrategyDescriptionButton();

            chbHideFSB.CheckedChanged += new EventHandler(HideFSB_Click);

            return;
        }