private void OpponentAnimation(int waitTime, Ability abilityChosen)
        {
            InfoChange    infoChange    = new InfoChange(LabelInfoChange);
            UpdateControl updateControl = new UpdateControl(DoUpdate);
            UpdateAbility updateAbility = new UpdateAbility(UpdateAbilityChosen);

            int dots = 0;

            while (ResourceBarProgressFinished() != true)
            {
                string dotString = "";
                for (int i = 0; i < 3; i++)
                {
                    dotString += (i < dots) ? "." : " ";
                }
                Invoke(infoChange, new object[] { "Waiting for opponent " + dotString });
                dots = (dots + 1) % 4;
                Thread.Sleep(500);
            }

            Invoke(infoChange, new object[] { "" });
            Invoke(updateControl);
            Invoke(updateAbility, new object[] { abilityChosen });
            Thread waitForEnablingThread = new Thread(ButtonFinishRoundWaitForEnabling);

            waitForEnablingThread.Start();
        }
Beispiel #2
0
        protected void ApplyUpdateObjChange(List <UpdateObject> updateList, List <RenderObject> renderList)
        {
            if (updateObj != null)
            {
                updateObj.Deactivate();
                updateList.Remove(updateObj);
                // have our update object remove its commands from the child controls.
                for (int indexCard = 0; indexCard < listControls.Count; indexCard++)
                {
                    IControl control = listControls[indexCard] as IControl;
                    updateObj.RemoveCommandsFromControl(control);
                }
            }

            updateObj = updateObjPending;

            AttachCommands();

            // Keep updatelist from having multiple copies of the same obj.
            if (!updateList.Contains(updateObj))
            {
                updateList.Add(updateObj);
            }
            // updateObj.Activate(); this is only called when hot
        }
Beispiel #3
0
 public SingleDrumsControl(UserContext context)
 {
     InitializeComponent();
     //异步通信初始数据定义
     UpdateList   += new UpdateControlList(this.listTest);
     UpdateStatus += new UpdateControl(this.Status);
 }
Beispiel #4
0
 public UpdateForm(string viewName, ViewControl control)
 {
     contentManager = Program.Context.ContentManager;
     updateControl  = new UpdateControl(viewName, control);
     this.Controls.Add(updateControl);
     InitializeComponent();
     this.Size = updateControl.Size;
 }
        public LightIndihiangForm(string fileName)
        {
            _fileName = fileName;
            InitializeComponent();

            _delegate        = UpdateTextMethod;
            _delegateControl = UpdateControlMethod;
        }
        private void EndGame()
        {
            UpdateControl endGameControl = new UpdateControl(EndGameUpdate);

            while (ResourceBarProgressFinished() != true)
            {
                Thread.Sleep(500);
            }

            Invoke(endGameControl);
        }
Beispiel #7
0
        public UpgradeForm(List <UpdateInfo> info)
        {
            InitializeComponent();

            if (info != null)
            {
                upgradeListDataGridView.DataSource = info;
            }

            UpdateControl.EnableElevateIcon(upgradeButton);
        }
Beispiel #8
0
        public void PlaceReflex(Object sender, EventArgs args)
        {
            Foley.PlayBack();

            reflexBlock.Moving           = false;
            UiCursor.ActiveCursor.Parent = this;

            // switch modes
            this.updateObjPending = this.updateObjEditReflex;
            this.renderObj.State  = ControlRenderObj.idStateHot;
            AffixLineNumberToCurrentState();
            BokuGame.objectListDirty = true;
        }   // end of PlaceReflex()
Beispiel #9
0
        public ReflexPanel(Object parent, Reflex reflex, ControlCollection controls)
        {
            this.parent   = parent;
            this.reflex   = reflex;
            this.controls = controls;
            renderPanel   = controls.InstanceControlRenderObj(parent, idRow);

            updateObjEditCards = new UpdateObjEditCards(this);

            CreateCards(ControlRenderObj.idStateNormal);

            updateObjPending = updateObjEditCards;
        }
        public void Update()
        {
            var Axis = new Vector2(
                Mathf.Clamp(Input.GetAxisRaw("Horizontal") + (left + right), -1, 1),
                Mathf.Clamp(Input.GetAxisRaw("Vertical") + (up + down), -1, 1)
                );

            if (Axis != previousAxis)
            {
                UpdateControl?.Invoke(Axis);
            }

            previousAxis = Axis;
        }
Beispiel #11
0
//        private ControlCollection controls;

        public ReflexHandle(Object parent, Reflex reflex, ControlCollection controls)
        {
            this.parent = parent;
            this.reflex = reflex;
//            this.controls = controls;

            renderObj = controls.InstanceControlRenderObj(parent, idHandle);

            UpdateReflexLineNumber();

            updateObjMoveReflex = new UpdateObjMoveReflex(this);
            updateObjEditReflex = new UpdateObjEditReflex(this);

            updateObjPending = updateObjEditReflex;
        }
Beispiel #12
0
        public void Recompute()
        {
            UpdateControl updateFunc = null;

            if (_neuronUIcontrols.Count == 0)
            {
                updateFunc = addNeuron;
            }
            else
            {
                updateFunc = updateNeuron;
            }

            int curOffsetX = (Size.Width - _ann._outputs.Neurons.Count * _neuronWidth) / (_ann._outputs.Neurons.Count + 1);
            int curOffsetY = (Size.Height - (_ann._innerLayers.Count + 2) * _neuronHeight) / (_ann._innerLayers.Count + 3);
            int curX       = curOffsetX;
            int curY       = curOffsetY;
            int idxNeuron  = 0;

            foreach (var nn in _ann._outputs.Neurons)
            {
                updateFunc(nn, curX + _ann._outputs.Neurons.IndexOf(nn) * _neuronWidth, curY, idxNeuron++);
                curX += curOffsetX;
            }
            foreach (var layer in _ann._innerLayers)
            {
                curOffsetX = (Size.Width - layer.Neurons.Count * _neuronWidth) / (layer.Neurons.Count + 1);
                curX       = curOffsetX;
                curY      += _neuronHeight + curOffsetY;
                foreach (var nn in layer.Neurons)
                {
                    updateFunc(nn, curX + layer.Neurons.IndexOf(nn) * _neuronWidth, curY, idxNeuron++);
                    curX += curOffsetX;
                }
            }
            curOffsetX = (Size.Width - _ann._inputs.Neurons.Count * _neuronWidth) / (_ann._inputs.Neurons.Count + 1);
            curX       = curOffsetX;
            curY      += _neuronHeight + curOffsetY;
            foreach (var nn in _ann._inputs.Neurons)
            {
                updateFunc(nn, curX + _ann._inputs.Neurons.IndexOf(nn) * _neuronWidth, curY, idxNeuron++);
                curX += curOffsetX;
            }
        }
Beispiel #13
0
        public static bool Setup()
        {
            Console.WriteLine("Sciter " + SciterX.Version);

            #region Ion
            if (IonApp.GetStatus() != EIonStatus.ACTIVE || IonApp.IsTrial)
            {
                DlgLicense.ShowDialog();
            }
            if (IonApp.GetStatus() != EIonStatus.ACTIVE)
            {
                return(false);
            }
            UpdateControl.Setup();
            #endregion

            // Create the window
            AppWindow   = new Window();
            AppDebugger = new DebuggerHost();
            AppHost     = new Host(AppWindow);

            State.Setup();

            // Args passing
            var sv = new SciterValue();
            sv["t"] = new SciterValue(App.g_arg_t);
            sv["r"] = new SciterValue(App.g_arg_r);
            AppHost.CallFunction("View_Setup", sv);

            if (!string.IsNullOrEmpty(g_arg_page))
            {
                //MessageBox.ShowMessageBox(AppWindow, g_arg_page);
                State.LoadURL(g_arg_page);
            }

            AppWindow.CenterTopLevelWindow();
            AppWindow.Show();

#if DEBUG
            //AppHost.InvokePost(() => Tests.Run());
#endif
            return(true);
        }
Beispiel #14
0
        protected void ApplyUpdateObjChange(List <UpdateObject> updateList, List <RenderObject> renderList)
        {
            if (updateObj != null)
            {
                if (State == States.Hot)
                {
                    updateObj.Deactivate();
                }
                updateList.Remove(updateObj);
            }

            updateObj = updateObjPending;

            updateList.Add(updateObj);
            if (State == States.Hot)
            {
                updateObj.Activate();
            }
        }
Beispiel #15
0
        }   // end of MoveDown()

        /// <summary>
        /// Put a reflex and its children into "moving" mode.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public void MoveReflex(Object sender, EventArgs args)
        {
            Foley.PlayPressA();

            // Init the Moving block.
            ReflexPanel panel    = this.parent as ReflexPanel;
            int         curIndex = panel.LineNumber - 1;

            reflexBlock.Init(curIndex);
            reflexBlock.Moving = true;

            UiCursor.ActiveCursor.Parent = this;

            // switch modes
            this.updateObjPending = this.updateObjMoveReflex;
            this.renderObj.State  = ControlRenderObj.idStateSelected;
            AffixLineNumberToCurrentState();
            BokuGame.objectListDirty = true;
        }   // end of MoveReflex()
        private void deleteConfigButton_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Are you sure you want to delete OptionsOracle configuration files?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                if (!UpdateControl.ResetConfiguration(UpdateControl.ExitAndRestartModeT.ExitAndRestart))
                {
                    string cnfg_dirc = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\OptionsOracle";
                    statusTextBox.Text += "Conf: Deleting local configuration files...\r\n";

                    if (!Directory.Exists(cnfg_dirc))
                    {
                        statusTextBox.Text += "Conf: Error! Config directory '" + cnfg_dirc + "' does not exist.\r\n";
                        return;
                    }

                    string[] file_list = new string[] { @"config.xml", @"parser.xml", @"wizard.xml", @"plugin.xml" };

                    foreach (string cnfg_file in file_list)
                    {
                        if (File.Exists(cnfg_dirc + @"\" + cnfg_file))
                        {
                            try
                            {
                                File.Delete(cnfg_dirc + @"\" + cnfg_file);
                                statusTextBox.Text += "Conf: Config file '" + cnfg_file + "' was deleted.\r\n";
                            }
                            catch
                            {
                                statusTextBox.Text += "Conf: Error! Failed to delete config file '" + cnfg_file + "'.\r\n";
                            }
                        }
                        else
                        {
                            statusTextBox.Text += "Conf: Error! Config file '" + cnfg_file + "' does not exist.\r\n";
                        }
                    }

                    MessageBox.Show("Configuration files were removed, please restart OptionsOracle to create them.", "Completed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    statusTextBox.Text += "Conf: Config files were deleted successfully.\r\n";
                }
            }
        }
Beispiel #17
0
        /* ----------------------------------------------------------------- */
        ///
        /// OnUpdateControl
        ///
        /// <summary>
        /// Update(object) メソッドを通じてコントロールの内容が更新された
        /// 時に実行されます。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        protected virtual void OnUpdateControl(KeyValueCancelEventArgs <Control, object> e)
        {
            UpdateControl?.Invoke(this, e);
            if (e.Cancel)
            {
                return;
            }

            switch (e.Key.GetType().Name)
            {
            case nameof(Cube.Forms.ColorButton):
                UpdateColorButton(e.Key as Cube.Forms.ColorButton, e.Value as Color?);
                break;

            case nameof(Cube.Forms.FontButton):
                UpdateFontButton(e.Key as Cube.Forms.FontButton, e.Value as Font);
                break;

            case nameof(System.Windows.Forms.CheckBox):
                UpdateCheckBox(e.Key as System.Windows.Forms.CheckBox, e.Value as bool?);
                break;

            case nameof(System.Windows.Forms.ComboBox):
                UpdateComboBox(e.Key as System.Windows.Forms.ComboBox, e.Value as int?);
                break;

            case nameof(System.Windows.Forms.NumericUpDown):
                UpdateNumericUpDown(e.Key as System.Windows.Forms.NumericUpDown, e.Value as int?);
                break;

            case nameof(System.Windows.Forms.RadioButton):
                UpdateRadioButton(e.Key as System.Windows.Forms.RadioButton, e.Value as bool?);
                break;

            case nameof(System.Windows.Forms.TextBox):
                UpdateTextBox(e.Key as System.Windows.Forms.TextBox, e.Value as string);
                break;

            default:
                break;
            }
        }
        public AdvanceDiagForm()
        {
            InitializeComponent();

            UpdateControl.EnableElevateIcon(deleteConfigButton);
        }
Beispiel #19
0
        private void updateRecord_Click(object sender, RoutedEventArgs e)
        {
            UpdateControl updateControl = new UpdateControl();

            MainContentHolder.Content = updateControl;
        }