Beispiel #1
0
 // Initialize Menu
 public Menu(Process.position x, ScriptHandler s, Items i1, Items i2, Items i3)
 {
     this.menuType = x;
     this.items[0] = i1;
     this.items[1] = i2;
     this.items[2] = i3;
     script = s;
 }
Beispiel #2
0
        public void selected(Process.sel x)
        {
            if (sel != x)
            {
                sel = x;
                timerOffset = 0;
                itemSelected = false;
                this.Invalidate();
            }
            else
                timerOffset++;

            if (timerOffset > 20)
            {
                itemSelected = true;
                eyeSelector(sel);
                Process.reset();

                timerOffset = 0;
            }
        }
Beispiel #3
0
        // Selecting script a execute based to eye position
        private void eyeSelector(Process.sel item)
        {
            if (menuType == Process.position.UP)
            {
                switch (item)
                {
                    case Process.sel.LEFT:
                        script.Execute("UP_LEFT");
                        break;

                    case Process.sel.RIGHT:
                        script.Execute("UP_RIGHT");
                        break;

                    case Process.sel.CENTER:
                        script.Execute("UP_CENTER");
                        break;
                }
            }
            else if (menuType == Process.position.LEFT)
            {
                switch (item)
                {
                    case Process.sel.LEFT:
                        script.Execute("LEFT_LEFT");
                        break;

                    case Process.sel.RIGHT:
                        script.Execute("LEFT_RIGHT");
                        break;

                    case Process.sel.CENTER:
                        script.Execute("LEFT_CENTER");
                        break;
                }
            }
            else if (menuType == Process.position.RIGHT)
            {
                switch (item)
                {
                    case Process.sel.LEFT:
                        script.Execute("RIGHT_LEFT");
                        break;

                    case Process.sel.RIGHT:
                        script.Execute("RIGHT_RIGHT");
                        break;

                    case Process.sel.CENTER:
                        script.Execute("RIGHT_CENTER");
                        break;
                }
            }
            else if (menuType == Process.position.DOWN)
            {
                switch (item)
                {
                    case Process.sel.LEFT:
                        script.Execute("DOWN_LEFT");
                        break;

                    case Process.sel.RIGHT:
                        script.Execute("DOWN_RIGHT");
                        break;

                    case Process.sel.CENTER:
                        script.Execute("DOWN_CENTER");
                        break;
                }
            }
        }
Beispiel #4
0
 static void Main()
 {
     Process p = new Process();
     Application.Run(p);
 }