Ejemplo n.º 1
0
        //loads the HUDViewController.xib file and connects it to this object
        public HUDViewController()
        {
            Title = "HUD";
            NavigationItem.RightBarButtonItem = new UIBarButtonItem("Tap Me", UIBarButtonItemStyle.Bordered, (sender, e) => {
                time = 0;

                ProgressCircle.TwirlMode = !ProgressCircle.TwirlMode;
                if (!ProgressCircle.TwirlMode)
                {
                    ProgressCircle.SetProgress(0f, false);
                    ProgressCircle.SetProgress(1f, true);
                }
            });
        }
Ejemplo n.º 2
0
        private void AboutForm_Load(object sender, EventArgs e)
        {
            FormEx.Dockable(this);

            Icon = ResourcesEx.GetSystemIcon(ResourcesEx.IconIndex.HelpShield, Main.SystemResourcePath);

            Lang.SetControlLang(this);
            Text = Lang.GetText(Name);

            Main.SetFont(this);

            AddFileInfoLabels();

            logoPanel.BackColor = Main.Colors.Base;

            updateBtnPanel.Width = TextRenderer.MeasureText(updateBtn.Text, updateBtn.Font).Width + 32;
            updateBtn.Image      = ResourcesEx.GetSystemIcon(ResourcesEx.IconIndex.Network, Main.SystemResourcePath)?.ToBitmap();
            updateBtn.ForeColor  = Main.Colors.ButtonText;
            updateBtn.BackColor  = Main.Colors.Button;
            updateBtn.FlatAppearance.MouseDownBackColor = Main.Colors.Button;
            updateBtn.FlatAppearance.MouseOverBackColor = Main.Colors.ButtonHover;

            _progressCircle = new ProgressCircle
            {
                Anchor        = updateBtnPanel.Anchor,
                BackColor     = Color.Transparent,
                ForeColor     = mainPanel.BackColor,
                InnerRadius   = 7,
                Location      = new Point(updateBtnPanel.Right + 3, updateBtnPanel.Top + 1),
                OuterRadius   = 9,
                RotationSpeed = 80,
                Size          = new Size(updateBtnPanel.Height, updateBtnPanel.Height),
                Thickness     = 3,
                Visible       = false
            };
            mainPanel.Controls.Add(_progressCircle);

            aboutInfoLabel.ActiveLinkColor = Main.Colors.Base;
            aboutInfoLabel.BorderStyle     = BorderStyle.None;
            aboutInfoLabel.Text            = string.Format(Lang.GetText(aboutInfoLabel), "Si13n7 Developments", Lang.GetText(aboutInfoLabel.Name + "LinkLabel1"), Lang.GetText(aboutInfoLabel.Name + "LinkLabel2"));
            aboutInfoLabel.Links.Clear();
            aboutInfoLabel.LinkText("Si13n7 Developments", "http://www.si13n7.com");
            aboutInfoLabel.LinkText(Lang.GetText(aboutInfoLabel.Name + "LinkLabel1"), "http://paypal.si13n7.com");
            aboutInfoLabel.LinkText(Lang.GetText(aboutInfoLabel.Name + "LinkLabel2"), "https://support.si13n7.com");

            copyrightLabel.Text = string.Format(copyrightLabel.Text, DateTime.Now.Year);
        }
Ejemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (!isMining)
        {
            ProcessMovementInputs();
        }

        if (Input.GetAxis(trigger) == 1 && !isMining)
        {
            target = getClosestMineable();
            if (target)
            {
                isMining  = true;
                moveSpeed = 0;

                guiElement = new GameObject("Target");
                guiElement.transform.SetParent(GameObject.Find("Canvas").transform);
                ProgressCircle progressCircleComponent = guiElement.AddComponent <ProgressCircle>();
                progressCircleComponent.owner   = this;
                guiElement.transform.localScale = new Vector3(0.05f, 0.05f, 1);
                Image image = guiElement.AddComponent <Image>();
                image.fillAmount = 0;
                image.sprite     = progressCircle;
                image.type       = Image.Type.Filled;
                image.fillOrigin = 2;

                progress       = target.AddComponent <GUIHover>();
                progress.image = image;
            }
        }
        else if (isMining && Input.GetAxis(trigger) != 1)
        {
            isMining = false;
            Destroy(guiElement);
            Destroy(progress);
        }
    }
Ejemplo n.º 4
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.Inflate(Resource.Layout.fragment_timer, container, false);

            progressCircle = rootView.FindViewById <ProgressCircle>(Resource.Id.circle_progress);
            txtTimerHour   = rootView.FindViewById <EditText>(Resource.Id.txtTimerHour);
            txtTimerMin    = rootView.FindViewById <EditText>(Resource.Id.txtTimerMin);
            txtTimerSec    = rootView.FindViewById <EditText>(Resource.Id.txtTimerSec);

            btnStart = rootView.FindViewById <Button>(Resource.Id.btnStart);
            btnStop  = rootView.FindViewById <Button>(Resource.Id.btnStop);
            btnReset = rootView.FindViewById <Button>(Resource.Id.btnReset);

            txtTimerHour.ClearFocus();

            //input limiter
            txtTimerHour.SetFilters(new Android.Text.IInputFilter[] { new InputFilterMinMax(0, 99) });
            txtTimerMin.SetFilters(new Android.Text.IInputFilter[] { new InputFilterMinMax(0, 60) });
            txtTimerSec.SetFilters(new Android.Text.IInputFilter[] { new InputFilterMinMax(0, 60) });

            btnStart.Click += delegate
            {
                if (txtTimerHour.Text == "")
                {
                    txtTimerHour.Text = "00";
                }
                if (txtTimerMin.Text == "")
                {
                    txtTimerMin.Text = "00";
                }
                if (txtTimerSec.Text == "")
                {
                    txtTimerSec.Text = "00";
                }

                hour = Convert.ToInt32(txtTimerHour.Text);
                min  = Convert.ToInt32(txtTimerMin.Text);
                sec  = Convert.ToInt32(txtTimerSec.Text);

                if (hour > 0 || min > 0 || sec > 0)
                {
                    timer          = new Timer();
                    timer.Interval = 1000;    //1000 = 1second
                    timer.Elapsed += Timer_Elapsed;
                    timer.Start();
                    btnStart.Enabled = false;
                    btnStop.Enabled  = true;
                    btnReset.Enabled = false;
                    running          = true;
                    txtInputDisable();
                    player = MediaPlayer.Create(Context, Resource.Drawable.alarm1);
                    ButtonsStateColor();
                }
                else
                {
                    ShowToast("Please, set the time", true);
                }
            };

            btnStop.Click += delegate
            {
                timer.Dispose();
                timer            = null;
                btnStart.Enabled = true;
                btnStop.Enabled  = false;
                btnReset.Enabled = true;
                running          = false;
                txtInputEnable();
                ButtonsStateColor();
                if (player.Looping == true)
                {
                    player.Stop();
                }
            };

            btnReset.Click += delegate
            {
                hour             = 00;
                min              = 00;
                sec              = 00;
                btnStart.Enabled = true;
                btnStop.Enabled  = false;
                btnReset.Enabled = false;
                running          = false;
                txtInputEnable();
                ResetUi();
            };

            if (running == false)
            {
                btnStart.Enabled = true;
                btnStop.Enabled  = false;
                btnReset.Enabled = false;
            }
            if (running == true)
            {
                btnStart.Enabled = false;
                btnStop.Enabled  = true;
                btnReset.Enabled = false;
            }

            return(rootView);
        }
Ejemplo n.º 5
0
        public AboutForm()
        {
            InitializeComponent();

            Language.SetControlLang(this);
            Text = Language.GetText(Name);

            Icon = CacheData.GetSystemIcon(ResourcesEx.IconIndex.HelpShield);

            AddFileInfoLabels();

            var series = spaceChart.Series.FirstOrDefault();

            if (series != null)
            {
                series.LabelForeColor = Color.Transparent;
                series.LabelBackColor = Color.Transparent;
            }
            diskChartUpdater.RunWorkerAsync();

            logoPanel.BackgroundImage = Resources.diagonal_pattern;
            logoPanel.BackColor       = Settings.Window.Colors.Base.EnsureLightLight();
            logoBox.BackgroundImage   = Resources.Logo256px.Redraw(128, 128);

            updateBtnPanel.Width = TextRenderer.MeasureText(updateBtn.Text, updateBtn.Font).Width + 32;
            updateBtn.Image      = CacheData.GetSystemImage(ResourcesEx.IconIndex.Network);
            updateBtn.ForeColor  = Settings.Window.Colors.ButtonText;
            updateBtn.BackColor  = Settings.Window.Colors.Button;
            updateBtn.FlatAppearance.MouseDownBackColor = Settings.Window.Colors.Button;
            updateBtn.FlatAppearance.MouseOverBackColor = Settings.Window.Colors.ButtonHover;

            _progressCircle = new ProgressCircle
            {
                Anchor        = updateBtnPanel.Anchor,
                BackColor     = Color.Transparent,
                ForeColor     = mainPanel.BackColor,
                InnerRadius   = 7,
                Location      = new Point(updateBtnPanel.Right + 3, updateBtnPanel.Top + 1),
                OuterRadius   = 9,
                RotationSpeed = 80,
                Size          = new Size(updateBtnPanel.Height, updateBtnPanel.Height),
                Thickness     = 3,
                Visible       = false
            };
            mainPanel.Controls.Add(_progressCircle);

            var aboutInfoLabelData = new[]
            {
                new[]
                {
                    "Si13n7 Developments",
                    "http://www.si13n7.com"
                },
                new[]
                {
                    Language.GetText(nameof(aboutInfoLabel) + "LinkLabel1"),
                    "http://paypal.si13n7.com"
                },
                new[]
                {
                    Language.GetText(nameof(aboutInfoLabel) + "LinkLabel2"),
                    "https://support.si13n7.com"
                }
            };

            aboutInfoLabel.ActiveLinkColor = Settings.Window.Colors.Base;
            aboutInfoLabel.BorderStyle     = BorderStyle.None;
            aboutInfoLabel.Text            = string.Format(Language.GetText(aboutInfoLabel), aboutInfoLabelData.Select(x => x.First()).Cast <object>().ToArray());
            aboutInfoLabel.Links.Clear();
            aboutInfoLabelData.ForEach(x => aboutInfoLabel.LinkText(x.First(), x.Last()));

            copyrightLabel.Text = string.Format(copyrightLabel.Text, DateTime.Now.Year);

            ((ISupportInitialize)logoBox).EndInit();
            logoPanel.ResumeLayout(false);
            ((ISupportInitialize)spaceChart).EndInit();
            mainPanel.ResumeLayout(false);
            updateBtnPanel.ResumeLayout(false);
            ResumeLayout(false);
        }
Ejemplo n.º 6
0
    void UpdateHealth(int newHealth)
    {
        // if we were already dead, do nothing
        if(health == 0)
            return;

        health = newHealth;
        if(health <= 0) {
            if(pc != null) {
                Destroy(pc.gameObject);
                pc = null;
            }
            health = 0;
            SendMessage("Die");
            return;
        }
        if(health >= MaxHealth) {
            health = MaxHealth;
            if(pc != null) {
                Destroy(pc.gameObject);
                pc = null;
            }
            return;
        }
        if(pc == null) {
            pc = (Instantiate(progressTemplate) as GameObject).GetComponent<ProgressCircle>();
            pc.transform.parent = transform;
            Vector3 pos = transform.position + offset;
            // put the height slightly above the offset so it doesn't collide with a ground
            // texture, and randomize slightly so overlapping units don't flicker
            pos.y += Random.Range(.05f, .15f);
            pc.transform.position = pos;
            pc.transform.rotation = Quaternion.Euler(new Vector3(90, 180, 0));
            pc.transform.localScale = new Vector3(healthbarScale, healthbarScale, healthbarScale);
        }
        pc.Percent = ((float)health / MaxHealth);
    }
Ejemplo n.º 7
0
 void StartCharge()
 {
     // started charging, grab the target square
     RaycastHit hit;
     Vector3 pos = transform.position;
     pos.y += .1f;
     if(!Physics.Raycast(pos, -Vector3.up, out hit, cc.height * 1.1f))  {
         Debug.Log("Missed a square?!?");
         return;
     }
     chargeTarget = hit.collider.gameObject.GetComponent<SquareController>();
     if (chargeTarget == null)  {
         Debug.Log("No SquareController on target!");
         return;
     }
     // if we're currently restricted to only toggling a
     // certain square (such as during the tutorial)
     // make sure this is it
     if(restrictedCharge != null && restrictedCharge != chargeTarget)
         return;
     pc = ((GameObject)GameObject.Instantiate(progressCircleTemplate)).GetComponent<ProgressCircle>();
     pc.Percent = 0;
     pc.FullColor = Color.white;
     pc.EmptyColor = Color.white;
     pos = chargeTarget.transform.position;
     pos.y += .1f;
     pc.transform.position = pos;
     pc.transform.rotation = Quaternion.Euler(new Vector3(90, 180, 0));
     chargeStart = Time.time;
     anim.SetBool("Charging", true);
     anim.SetBool("Pound", false);
     velocity = Vector3.zero;
 }
Ejemplo n.º 8
0
            /// <summary>
            ///     Initializes an instance of the <see cref="IconBrowserDialog"/> class.
            /// </summary>
            /// <param name="path">
            ///     The path of the file to open.
            /// </param>
            /// <param name="backColor">
            ///     The background color of the dialog box.
            /// </param>
            /// <param name="foreColor">
            ///     The foreground color of the dialog box.
            /// </param>
            /// <param name="buttonFace">
            ///     The button color of the dialog box.
            /// </param>
            /// <param name="buttonText">
            ///     The button text color of the dialog box.
            /// </param>
            /// <param name="buttonHighlight">
            ///     The button highlight color of the dialog box.
            /// </param>
            public IconBrowserDialog(string path = "%system%\\imageres.dll", Color?backColor = null, Color?foreColor = null, Color?buttonFace = null, Color?buttonText = null, Color?buttonHighlight = null)
            {
                _components = new Container();
                SuspendLayout();
                var resPath = PathEx.Combine(path);

                if (PathEx.IsDir(resPath))
                {
                    resPath = PathEx.Combine(path, "imageres.dll");
                }
                if (!File.Exists(resPath))
                {
                    resPath = PathEx.Combine("%system%", "imageres.dll");
                }
                var resLoc = Path.GetDirectoryName(resPath);

                AutoScaleDimensions = new SizeF(96f, 96f);
                AutoScaleMode       = AutoScaleMode.Dpi;
                BackColor           = backColor ?? SystemColors.Control;
                ForeColor           = foreColor ?? SystemColors.ControlText;
                Font              = new Font("Consolas", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0);
                Icon              = GetSystemIcon(IconIndex.DirectorySearch, true, resLoc);
                MaximizeBox       = false;
                MaximumSize       = new Size(680, Screen.FromHandle(Handle).WorkingArea.Height);
                MinimizeBox       = false;
                MinimumSize       = new Size(680, 448);
                Name              = "IconBrowserForm";
                Size              = MinimumSize;
                SizeGripStyle     = SizeGripStyle.Hide;
                StartPosition     = FormStartPosition.CenterScreen;
                Text              = UIStrings.ResourceBrowser;
                _tableLayoutPanel = new TableLayoutPanel
                {
                    BackColor       = Color.Transparent,
                    CellBorderStyle = TableLayoutPanelCellBorderStyle.None,
                    Dock            = DockStyle.Fill,
                    Name            = "tableLayoutPanel",
                    RowCount        = 2
                };
                _tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100f));
                _tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 36));
                Controls.Add(_tableLayoutPanel);
                _panel = new Panel
                {
                    AutoScroll  = true,
                    BackColor   = buttonFace ?? SystemColors.ButtonFace,
                    BorderStyle = BorderStyle.FixedSingle,
                    Enabled     = false,
                    ForeColor   = buttonText ?? SystemColors.ControlText,
                    Dock        = DockStyle.Fill,
                    Name        = "panel",
                    TabIndex    = 0
                };
                _panel.Scroll += (s, e) => (s as Panel)?.Update();
                _tableLayoutPanel.Controls.Add(_panel, 0, 0);
                _innerTableLayoutPanel = new TableLayoutPanel
                {
                    BackColor       = Color.Transparent,
                    ColumnCount     = 2,
                    CellBorderStyle = TableLayoutPanelCellBorderStyle.None,
                    Dock            = DockStyle.Fill,
                    Name            = "innerTableLayoutPanel"
                };
                _innerTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f));
                _innerTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 24));
                _tableLayoutPanel.Controls.Add(_innerTableLayoutPanel, 0, 1);
                _textBox = new TextBox
                {
                    BorderStyle = BorderStyle.FixedSingle,
                    Dock        = DockStyle.Top,
                    Font        = Font,
                    Name        = "textBox",
                    TabIndex    = 1
                };
                _textBox.TextChanged += TextBox_TextChanged;
                _innerTableLayoutPanel.Controls.Add(_textBox, 0, 0);
                _buttonPanel = new Panel
                {
                    Anchor      = AnchorStyles.Top | AnchorStyles.Right,
                    BackColor   = Color.Transparent,
                    BorderStyle = BorderStyle.FixedSingle,
                    Name        = "buttonPanel",
                    Size        = new Size(20, 20)
                };
                _innerTableLayoutPanel.Controls.Add(_buttonPanel, 1, 0);
                _button = new Button
                {
                    BackColor             = buttonFace ?? SystemColors.ButtonFace,
                    BackgroundImage       = GetSystemIcon(IconIndex.Directory, false, resLoc).ToBitmap(),
                    BackgroundImageLayout = ImageLayout.Zoom,
                    Dock      = DockStyle.Fill,
                    FlatStyle = FlatStyle.Flat,
                    Font      = Font,
                    ForeColor = buttonText ?? SystemColors.ControlText,
                    Name      = "button",
                    TabIndex  = 2,
                    UseVisualStyleBackColor = false
                };
                _button.FlatAppearance.BorderSize         = 0;
                _button.FlatAppearance.MouseOverBackColor = buttonHighlight ?? ProfessionalColors.ButtonSelectedHighlight;
                _button.Click += Button_Click;
                _buttonPanel.Controls.Add(_button);
                _progressCircle = new ProgressCircle
                {
                    Active        = false,
                    Anchor        = AnchorStyles.Top | AnchorStyles.Right,
                    BackColor     = Color.Transparent,
                    Dock          = DockStyle.Fill,
                    ForeColor     = (backColor ?? SystemColors.Control).InvertRgb().ToGrayScale(),
                    RotationSpeed = 80,
                    Thickness     = 2,
                    Visible       = true
                };
                _timer = new Timer(_components)
                {
                    Interval = 1
                };
                _timer.Tick += Timer_Tick;
                _iconBoxes   = new List <IconBox>();
                Shown       += (sender, args) => TaskBarProgress.SetState(Handle, TaskBarProgressState.Indeterminate);
                ResumeLayout(false);
                PerformLayout();
                var curPath = PathEx.Combine(path);

                if (!File.Exists(curPath))
                {
                    curPath = resPath;
                }
                if (!File.Exists(curPath))
                {
                    return;
                }
                _textBox.Text = curPath;
            }
Ejemplo n.º 9
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.Inflate(Resource.Layout.fragment_stopWatch, container, false);

            progressCircle = rootView.FindViewById <ProgressCircle>(Resource.Id.stopwatch_circle_progress);
            txtTimer       = rootView.FindViewById <TextView>(Resource.Id.stopwatch_txtTimer);
            btnStart       = rootView.FindViewById <Button>(Resource.Id.stopwatch_btnStart);
            btnStop        = rootView.FindViewById <Button>(Resource.Id.stopwatch_btnStop);
            btnReset       = rootView.FindViewById <Button>(Resource.Id.stopwatch_btnReset);
            btnLap         = rootView.FindViewById <Button>(Resource.Id.stopwatch_btnLap);
            container_row  = rootView.FindViewById <LinearLayout>(Resource.Id.container_row);

            StartState();

            //sec = 55;//
            //progressCircle.SetProgressWithoutAnimation(55);//

            btnStart.Click += delegate
            {
                timer          = new Timer();
                timer.Interval = 100;               //0.1 second
                timer.Elapsed += Timer_Elapsed;
                timer.Start();
                btnStart.Enabled = false;
                btnStop.Enabled  = true;
                btnReset.Enabled = false;
                btnLap.Enabled   = true;
                running          = true;
                ButtonsStateColor();
            };

            btnStop.Click += delegate
            {
                timer.Dispose();
                timer            = null;
                btnStart.Enabled = true;
                btnStop.Enabled  = false;
                btnReset.Enabled = true;
                btnLap.Enabled   = false;
                running          = false;
                ButtonsStateColor();
            };

            btnReset.Click += delegate
            {
                hour          = 0;
                min           = 0;
                sec           = 0;
                milisec       = 0;
                txtTimer.Text = "00:00:00:0";
                progressCircle.SetProgress(0, 0);
                btnStart.Enabled = true;
                btnStop.Enabled  = false;
                btnReset.Enabled = false;
                btnLap.Enabled   = false;
                running          = false;
                container_row.RemoveAllViewsInLayout();
                ButtonsStateColor();
            };

            btnLap.Click += delegate
            {
                LayoutInflater inflater_row = (LayoutInflater)Context.GetSystemService(Context.LayoutInflaterService);
                View           addView      = inflater_row.Inflate(Resource.Layout.fragment_stopWatch_row, null);
                TextView       textContent  = addView.FindViewById <TextView>(Resource.Id.stopWatch_txtRow);
                textContent.Text = txtTimer.Text;
                container_row.AddView(addView);
            };

            if (running == false)
            {
                btnStart.Enabled = true;
                btnStop.Enabled  = false;
                btnReset.Enabled = false;
                btnLap.Enabled   = false;
            }
            if (running == true)
            {
                btnStart.Enabled = false;
                btnStop.Enabled  = true;
                btnReset.Enabled = false;
                btnLap.Enabled   = true;
            }

            return(rootView);
        }