Esempio n. 1
0
 void Start()
 {
     overlayControl = GetComponentInParent <OverlayControl>();
     boostText      = GameObject.Find("boost");
     plusText       = GameObject.Find("plus");
     dmText         = GameObject.Find("dmboost");
 }
        public override System.Windows.Forms.Control CreateConfigControl()
        {
            var control  = new OverlayControl();
            var initDone = false;

            var configFile = "ui/config/config.html";
            var distFolder = "dist/";
            var dir        = new VersionChecker(this).GetCactbotDirectory();
            var url        = Path.GetFullPath(Path.Combine(dir, distFolder, configFile));

            // Attempt to use the local webpack override, otherwise fall back to default path
            if (!File.Exists(url))
            {
                url = Path.GetFullPath(Path.Combine(dir, configFile));
            }

            control.VisibleChanged += (o, e) => {
                if (initDone)
                {
                    return;
                }
                initDone = true;
                control.Init(url);
                MinimalApi.AttachTo(control.Renderer);
            };
            return(control);
        }
Esempio n. 3
0
        private static void UpdateStatusOverlayContent(OverlayControl control)
        {
            Status status = Settings.BotBase.Instance.IsPaused ? Status.Paused : Status.Running;

            if (control.TabIndex == (int)status)
            {
                return;
            }
            control.TabIndex = (int)status;
            switch (status)
            {
            case Status.Running:
                control.Content    = "Kombatant Running";
                control.Background = new SolidColorBrush(Color.FromArgb(96, 220, 20, 60));
                break;

            case Status.Paused:
                control.Content    = "Kombatant Paused";
                control.Background = new SolidColorBrush(Color.FromArgb(96, 220, 220, 60));
                break;
                //case Status.Stopped:
                //	control.Content = "Kombatant Stopped";
                //	control.Background = new SolidColorBrush(Color.FromArgb(64, 0, 0, 0));
                //	break;
            }
        }
Esempio n. 4
0
        private void OverlayAdd(int index, Overlay overlay, bool isLoading)
        {
            var gridSize = ((Ratio)_cmbGridSize.SelectedItem);
            var control  = new OverlayControl(_standardColors, _availableColors, _recentColors, gridSize.Width, gridSize.Height, isLoading);

            if (control.WasCanceled)
            {
                return;
            }

            if (overlay != null)
            {
                control.Overlay = overlay;
            }

            control.OnDraw     += Draw;
            control.OnRemove   += Remove;
            control.OnMoveUp   += MoveUp;
            control.OnMoveDown += MoveDown;
            control.OnClone    += Clone;

            _lstOverlays.Children.Insert(index, control);

            SetOverlayMargins();

            if (!_isLoading)
            {
                Draw();
                SetAsUnsaved();
            }
        }
 internal void LoadOverlay()
 {
     MyOverlay         = new OverlayControl();
     MyOverlay.Visible = false;
     Controls.Add(MyOverlay);
     MyOverlay.Location = Point.Empty;
     MyOverlay.Size     = Size;
 }
 public DesignerFrame(ISite site)
 {
     this.Text           = "DesignerFrame";
     this.designerSite   = site;
     this.designerRegion = new OverlayControl(site);
     base.Controls.Add(this.designerRegion);
     this.designerRegion.AutoScroll      = true;
     this.designerRegion.Dock            = DockStyle.Fill;
     SystemEvents.UserPreferenceChanged += new UserPreferenceChangedEventHandler(this.OnUserPreferenceChanged);
 }
Esempio n. 7
0
 void Start()
 {
     for (int i = 2; i < 11; i++)
     {
         qts.Add(GameObject.Find(i + "qt").GetComponent <Text>());
     }
     mat1key        = GameObject.Find("mat1key").GetComponent <Text>();
     mat2key        = GameObject.Find("mat2key").GetComponent <Text>();
     cooldown       = GameObject.Find("cooldown").GetComponent <Text>();
     overlayControl = GetComponent <OverlayControl>();
 }
 public DesignerFrame(ISite site)
 {
     this.Text = "DesignerFrame";
     this.designerSite = site;
     this.designerRegion = new OverlayControl(site);
     this.uiService = this.designerSite.GetService(typeof(IUIService)) as IUIService;
     if ((this.uiService != null) && (this.uiService.Styles["ArtboardBackground"] is System.Drawing.Color))
     {
         this.BackColor = (System.Drawing.Color) this.uiService.Styles["ArtboardBackground"];
     }
     base.Controls.Add(this.designerRegion);
     this.designerRegion.AutoScroll = true;
     this.designerRegion.Dock = DockStyle.Fill;
     SystemEvents.UserPreferenceChanged += new UserPreferenceChangedEventHandler(this.OnUserPreferenceChanged);
 }
        /// <include file='doc\DesignerFrame.uex' path='docs/doc[@for="DesignerFrame.DesignerFrame"]/*' />
        /// <devdoc>
        /// <para>Initializes a new instance of the <see cref='System.Windows.Forms.Design.DesignerFrame'/> class.</para>
        /// </devdoc>
        public DesignerFrame(ISite site)
        {
            this.Text           = "DesignerFrame";
            this.designerSite   = site;
            this.designerRegion = new OverlayControl(site);

            this.Controls.Add(designerRegion);

            // Now we must configure our designer to be at the correct
            // location, and setup the autoscrolling for its container.
            //
            designerRegion.AutoScroll           = true;
            designerRegion.Dock                 = DockStyle.Fill;
            SystemEvents.UserPreferenceChanged += new UserPreferenceChangedEventHandler(OnUserPreferenceChanged);
        }
Esempio n. 10
0
 /// <summary>
 ///  Initializes a new instance of the <see cref='System.Windows.Forms.Design.DesignerFrame'/> class.
 /// </summary>
 public DesignerFrame(ISite site)
 {
     Text            = "DesignerFrame";
     _designerSite   = site;
     _designerRegion = new OverlayControl(site);
     _uiService      = _designerSite.GetService(typeof(IUIService)) as IUIService;
     if (_uiService != null)
     {
         if (_uiService.Styles["ArtboardBackground"] is Color)
         {
             BackColor = (Color)_uiService.Styles["ArtboardBackground"];
         }
     }
     Controls.Add(_designerRegion);
     // Now we must configure our designer to be at the correct location, and setup the autoscrolling for its container.
     _designerRegion.AutoScroll = true;
     _designerRegion.Dock       = DockStyle.Fill;
 }
Esempio n. 11
0
        public override Control CreateConfigControl()
        {
            var control  = new OverlayControl();
            var initDone = false;

            var url = pluginMain.OfflineCactbotConfigHtmlFile;

            control.VisibleChanged += (o, e) =>
            {
                if (initDone)
                {
                    return;
                }
                initDone = true;
                control.Init(url);
                MinimalApi.AttachTo(control.Renderer, container);
            };
            return(control);
        }
Esempio n. 12
0
            protected override Tile GetTileAt(int x, int y)
            {
                OverlayControl     parent  = this.Parent as OverlayControl;
                OverlayTilePattern pattern = parent.GetPatternAt((int)(x * this.Zoom), (int)(y * this.Zoom));

                if (pattern == null)
                {
                    return(null);
                }

                Point location = parent.patternList[pattern];

                x = (x - location.X) / Tile.Size;
                y = (y - location.Y) / Tile.Size;

                byte tileId = pattern[x, y];

                return(tileId == OverlayTile.None ? null : parent.Tileset[tileId]);
            }
        public override Control CreateConfigControl()
        {
            var control  = new OverlayControl();
            var initDone = false;

            var url = "https://quisquous.github.io/cactbot/ui/config/config.html";

            control.VisibleChanged += (o, e) =>
            {
                if (initDone)
                {
                    return;
                }
                initDone = true;
                control.Init(url);
                MinimalApi.AttachTo(control.Renderer, container);
            };
            return(control);
        }
Esempio n. 14
0
        public override System.Windows.Forms.Control CreateConfigControl()
        {
            var control  = new OverlayControl();
            var initDone = false;

            var configFile = "ui/config/config.html";
            var dir        = new VersionChecker(this).GetCactbotDirectory();
            var url        = Path.GetFullPath(Path.Combine(dir, configFile));

            control.VisibleChanged += (o, e) => {
                if (initDone)
                {
                    return;
                }
                initDone = true;
                control.Init(url);
                MinimalApi.AttachTo(control.Renderer);
            };
            return(control);
        }
Esempio n. 15
0
 void Start()
 {
     mat1           = GameObject.Find("materia1");
     mat2           = GameObject.Find("materia2");
     overlayControl = GetComponent <OverlayControl>();
 }
Esempio n. 16
0
 void Start()
 {
     overlayControl = GetComponent <OverlayControl>();
 }
Esempio n. 17
0
 public OverlayControlAccessibleObject(OverlayControl owner) : base(owner)
 {
 }
	// Constructors
	public OverlayControlAccessibleObject(OverlayControl owner) {}
Esempio n. 19
0
        public void ManageOverlays(Collection <ScheduleItem> overlays)
        {
            try
            {
                var _overlays = PlayerSettings.OverlayList;
                Debug.WriteLine("Arrived at Manage Overlays with " + overlays.Count + " overlay schedules to show. We're already showing " + _overlays.Count + " overlay Regions", "Overlays");

                // Take the ones we currently have up and remove them if they aren't in the new list or if they've been set to refresh
                // We use a for loop so that we are able to remove the region from the collection
                for (int i = 0; i < _overlays.Count; i++)
                {
                    Debug.WriteLine("Assessing Overlay Region " + i, "Overlays");

                    string _ovelayName = "overlay" + _overlays[i].layoutId;

                    var  region  = PlayerSettings.OverlayList[i];
                    bool found   = false;
                    bool refresh = false;

                    foreach (ScheduleItem item in overlays)
                    {
                        if (item.scheduleid == region.scheduleId)
                        {
                            found   = true;
                            refresh = item.Refresh;
                            break;
                        }
                    }

                    if (!found || refresh)
                    {
                        if (refresh)
                        {
                            Trace.WriteLine(new LogMessage("MainForm - ManageOverlays", "Refreshing item that has changed."), LogType.Info.ToString());
                        }
                        Debug.WriteLine("Removing overlay " + i + " which is no-longer required. Overlay: " + region.scheduleId, "Overlays");

                        // Remove the Region from the overlays collection
                        _overlays.Remove(region);

                        // As we've removed the thing we're iterating over, reduce i
                        i--;

                        // Clear down and dispose of the region.
                        region = null;

                        this.Dispatcher.BeginInvoke(new Action(() =>
                        {
                            var item = root.FindName(_ovelayName) as System.Windows.Controls.UserControl;
                            try
                            {
                                this.Overlay.Children.Remove(item);
                            }
                            catch (Exception ex)
                            {
                            }
                        }));
                    }
                    else
                    {
                        Debug.WriteLine("Overlay Region found and not needing refresh " + i, "Overlays");
                    }
                }

                // Take the ones that are in the new list and add them
                foreach (ScheduleItem item in overlays)
                {
                    // Check its not already added.
                    bool found = false;
                    foreach (LayoutOption region in _overlays)
                    {
                        if (region.scheduleId == item.scheduleid)
                        {
                            found = true;
                            break;
                        }
                    }

                    if (found)
                    {
                        Debug.WriteLine("Region already found for overlay - we're assuming here that if we've found one, they are all there.", "Overlays");
                        continue;
                    }

                    // Reset refresh
                    item.Refresh = false;

                    var _ovelayOptions = new LayoutOption();
                    RenderOverlays.ReadOvelyas(item, _ovelayOptions);

                    PlayerSettings.OverlayList.Add(_ovelayOptions);

                    string _ovelayName = "overlay" + _ovelayOptions.layoutId.ToString();

                    this.Dispatcher.BeginInvoke(new Action(() =>
                    {
                        /* run your code here */
                        var overlayouts  = new OverlayControl(_ovelayOptions.layoutId.ToString(), _ovelayOptions);
                        overlayouts.Name = _ovelayName;
                        root.RegisterName(_ovelayName, overlayouts);

                        this.Overlay.Children.Add(overlayouts);
                    }));
                }
            }
            catch (Exception ex)
            {
            }
        }
Esempio n. 20
0
 void Start()
 {
     timeleft       = GameObject.Find("timeleft").GetComponent <Text>();
     esitoTxt       = GameObject.Find("esitoTxt");
     overlayControl = GetComponent <OverlayControl>();
 }