Beispiel #1
0
 protected internal virtual void OnDeactivate(EventArgs e)
 {
     if (_isActive == true)
     {
         _isActive = false;
         Deactivate?.Invoke(this, e);
     }
 }
Beispiel #2
0
    private void OnSelect()
    {
        Deactivate.Invoke();
        border.GetComponent <Image>().enabled = true;

        EquipmentManager.character = character;
        EquipmentManager.armor.ImageSwitch();
        EquipmentManager.weapon.ImageSwitch();
    }
Beispiel #3
0
    public void Switch()
    {
        if (activeTurn)
        {
            Activate?.Invoke();
        }
        else
        {
            Deactivate?.Invoke();
        }

        activeTurn = !activeTurn;
    }
Beispiel #4
0
    public void Initialize()
    {
        button = GetComponent <Button>();
        button.onClick.AddListener(OnSelect);
        border = new GameObject("border");
        Image img = border.AddComponent(typeof(Image)) as Image;

        img.sprite = Resources.Load <Sprite>("Sprites/border");
        border.transform.SetParent(this.gameObject.transform);
        RectTransform rec = border.GetComponent <RectTransform>();

        rec.anchoredPosition = Vector2.zero;
        rec.localScale       = Vector2.one;
        Deactivate          += lambda = () => { border.GetComponent <Image>().enabled = false; };
        Deactivate.Invoke();
    }
Beispiel #5
0
        public void Startup()
        {
            Form = new Form();

            Form.Activated  += (sender, e) => Activated?.Invoke(sender, e);
            Form.Deactivate += (sender, e) => Deactivate?.Invoke(sender, e);
            Form.FormClosed += (sender, e) => Closed?.Invoke(sender, e);

            RenderControl = new GlControl();
            Form.SuspendLayout();
            //
            // RenderControl
            //
            RenderControl.Animation          = true;
            RenderControl.AnimationTimer     = false;
            RenderControl.BackColor          = System.Drawing.Color.DimGray;
            RenderControl.ColorBits          = 24u;
            RenderControl.DepthBits          = 0u;
            RenderControl.Dock               = DockStyle.Fill;
            RenderControl.Location           = new System.Drawing.Point(0, 0);
            RenderControl.MultisampleBits    = 0u;
            RenderControl.Name               = "RenderControl";
            RenderControl.Size               = new System.Drawing.Size(731, 428);
            RenderControl.StencilBits        = 0u;
            RenderControl.TabIndex           = 0;
            RenderControl.ContextCreated    += RenderControl_ContextCreated;
            RenderControl.ContextDestroying += (sender, e) => ContextDestroying?.Invoke(sender, e);
            RenderControl.Render            += (sender, e) => Render?.Invoke(sender, e);
            RenderControl.ContextUpdate     += (sender, e) => Update?.Invoke(sender, e);
            RenderControl.SizeChanged       += RenderControl_SizeChanged;

            Form.Controls.Add(RenderControl);
            Form.ResumeLayout(false);

            Form.Show();

            WorldMatrix = Matrix.OrthoRH(-1000.0f, 1000.0f, -1000.0f, 1000.0f, -1000.0f, 1000.0f);
            //WorldMatrix = Matrix.Translation(0, 0, 0);
        }
Beispiel #6
0
 internal virtual void OnDeactivate(Toplevel activated)
 {
     Deactivate?.Invoke(activated);
 }
        /// <inheritdoc />
        public async Task DeactivateAsync(bool activatedBefore)
        {
            await Xamarin.Forms.Application.Current.MainPage.DisplayAlert("Deactivating", "Deactivating", "OK");

            Deactivate?.Invoke(this, activatedBefore);
        }
Beispiel #8
0
 public void OnDeactivate()
 {
     deactivate?.Invoke();
 }
Beispiel #9
0
 private void Form_Deactivate(object sender, EventArgs e)
 {
     Deactivate?.Invoke(sender, e);
 }
Beispiel #10
0
 protected virtual void OnLostFocus(object sender, EventArgs e)
 {
     Deactivate?.Invoke(this, EventArgs.Empty);
     Leave?.Invoke(this, EventArgs.Empty);
 }