Esempio n. 1
0
 // Use this for initialization
 void Start()
 {
     lmenu     = GameObject.Find("Controller (left)").GetComponentInChildren <RadialMenu> ();
     LeftMenu  = GameObject.Find("LeftMenu").GetComponentInChildren <RadialMenu> (true);
     rmenu     = GameObject.Find("Controller (right)").GetComponentInChildren <RadialMenu> ();
     RightMenu = GameObject.Find("RightMenu").GetComponentInChildren <RadialMenu> (true);
 }
 public virtual void Init(RadialMenu radMenu, string name, GameObject objectToCall, string functionToCall)
 {
     m_RadMenu        = radMenu;
     m_ObjectName     = name;
     m_ObjectToCall   = objectToCall;
     m_FunctionToCall = functionToCall;
 }
Esempio n. 3
0
    // Start is called before the first frame update
    void Start()
    {
        ParentMenu = GetComponent <RadialMenu>();
        Sprites    = new List <SpriteRenderer>();

        for (int i = 0; i < Mathf.Min(SegmentIcons.Count, transform.childCount); ++i)
        {
            // Create a new icon object
            Transform icon = new GameObject().transform;
            icon.parent           = transform.GetChild(i);
            icon.name             = SegmentIcons[i].name;
            icon.gameObject.layer = LayerMask.NameToLayer("UI");

            // Update transform
            icon.localScale      *= 3f;
            icon.localEulerAngles = new Vector3(90.0f, -icon.parent.localEulerAngles.y, 0.0f);
            icon.localPosition    = new Vector3(0.5f * (ParentMenu.OuterRadius - ParentMenu.InnerRadius) + ParentMenu.InnerRadius, 1.0f, 0.0f);

            // Add icon sprite to object
            SpriteRenderer sprite = icon.gameObject.AddComponent <SpriteRenderer>();
            sprite.sprite = SegmentIcons[i];

            // Add so the alpha can update
            Sprites.Add(sprite);
        }
    }
Esempio n. 4
0
    private void Update()
    {
        if (Input.GetKeyDown(spotNumber.ToString()))
        {
            if (GetComponentInChildren <CannonController>())
            {
                cannonsManager.SetCannonActive(GetComponentInChildren <CannonController>());
            }
            else
            {
                RadialMenuSpawner.ins.SpawnMenu(GetComponent <Interactable>());
            }
        }

        if (Input.GetKeyUp(spotNumber.ToString()))
        {
            RadialMenu menu = FindObjectOfType <RadialMenu>();
            if (menu)
            {
                if (menu.selected)
                {
                    Debug.Log(menu.selected.title + " was selected!");
                    menu.selected.buttonAction.Invoke();
                }
                Destroy(menu.gameObject);
            }
        }
    }
Esempio n. 5
0
    public void SetButton(Vector2 localPos, RadialMenu menuController, RightClickMenuItem menuItem, bool topLevel)
    {
        this.menuItem           = menuItem;
        transform.localPosition = localPos;
        menuControl             = menuController;
        isTopLevel    = topLevel;
        circle.color  = menuItem.BackgroundColor;
        defaultColour = menuItem.BackgroundColor;
        action        = menuItem.Action;

        icon.sprite = menuItem.IconSprite;
        icon.color  = menuItem.IconColor;
        palette     = menuItem.palette;
        if (palette != null)
        {
            icon.material.SetInt(IsPaletted, 1);
            icon.material.SetColorArray(ColorPalette, menuItem.palette.ToArray());
        }
        else
        {
            icon.material.SetInt(IsPaletted, 0);
        }

        if (menuItem.BackgroundSprite != null)
        {
            circle.sprite = menuItem.BackgroundSprite;
        }

        if (!topLevel)
        {
            title.text = menuItem.Label;
        }
    }
Esempio n. 6
0
    public RadialMenu SpawnMenu(Interactable obj)
    {
        RadialMenu newMenu = Instantiate(menuPrefab) as RadialMenu;

        newMenu.transform.SetParent(transform, false);

        GameObject Flystick = GameObject.Find("Flystick");

        if (Flystick != null)
        {
            newMenu.transform.position = Flystick.transform.position;
            newMenu.transform.rotation = Flystick.transform.rotation;

            //newMenu.transform.Rotate (270f,0f,0f);
            newMenu.transform.Translate(Flystick.transform.forward * distanceFromFlystick, Space.World);

            newMenu.SpawnButtons(obj);
            NetworkServer.Spawn(newMenu.gameObject);
        }
        else
        {
            Debug.Log("Flystick not found");
        }

        return(newMenu);
    }
Esempio n. 7
0
        private void FormSchedule_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'lorikeetAppDataSet.Labels' table. You can move, or remove it, as needed.
            this.labelsTableAdapter.Fill(this.lorikeetAppDataSet.Labels);
            this.resourcesTableAdapter.Fill(this.lorikeetAppDataSet.Resources);
            this.appointmentsTableAdapter.Fill(this.lorikeetAppDataSet.Appointments);

            schedulerControl1.Start                    = DateTime.Today;
            schedulerControl1.ActiveViewType           = DevExpress.XtraScheduler.SchedulerViewType.Month;
            schedulerControl1.DayView.TopRowTime       = new TimeSpan(10, 0, 0);
            schedulerControl1.GroupType                = DevExpress.XtraScheduler.SchedulerGroupType.Resource;
            schedulerControl1.DayView.ResourcesPerPage = 1;
            schedulerControl1.DayView.TimeIndicatorDisplayOptions.ShowOverAppointment = false;
            schedulerControl1.Start = DateTime.Now.Date;
            schedulerControl1.DateNavigationBar.Visible             = false;
            schedulerControl1.ActiveView.NavigationButtonVisibility = NavigationButtonVisibility.Never;
            schedulerControl1.OptionsCustomization.AllowDisplayAppointmentFlyout = true;

            this.schedulerStorage1.AppointmentsChanged  += OnAppointmentChangedInsertedDeleted;
            this.schedulerStorage1.AppointmentsInserted += OnAppointmentChangedInsertedDeleted;
            this.schedulerStorage1.AppointmentsDeleted  += OnAppointmentChangedInsertedDeleted;

            InitializeLabels();

            barManager            = barManager1;
            barManager.ItemClick += new ItemClickEventHandler(barManager_ItemClick);

            radialMenu1 = new RadialMenu(barManager);
            radialMenu1.AddItems(GetRadialMenuItems(barManager));
        }
Esempio n. 8
0
        public Form1(int staffID)
        {
            InitializeComponent();

            barManager            = barManager1;
            barManager.ItemClick += new ItemClickEventHandler(barManager_ItemClick);

            radialMenu1 = new RadialMenu(barManager);
            radialMenu1.AddItems(GetRadialMenuItems(barManager));

            RefreshDataGrid();

            lastLogID    = Logging.GetLastLogID();
            this.staffID = staffID;

            buttonRefresh.Enabled = false;

            bw.WorkerReportsProgress      = true;
            bw.WorkerSupportsCancellation = true;
            bw.DoWork += new DoWorkEventHandler(bw_DoWork);

            if (bw.IsBusy != true)
            {
                bw.RunWorkerAsync();
            }
        }
Esempio n. 9
0
    public override void HandleInput()
    {
        bool leftClicked = Input.GetMouseButton(0);
        bool rightClicked = Input.GetMouseButton(1);

        bool rightUp = Input.GetMouseButtonUp(1);

        if (leftClicked &&
            _leftClickTimer.Tick(Time.deltaTime) &&
            _selectingInfo.SittingObject != null &&
            _selectingInfo.SittingObject.GetComponent<PlayerBoardObject>() != null)
        {
            _leftClickTimer.Reset();
            CursorManager.Instance.ChangeState(CursorManager.CursorState.Move);
        }

        if (rightClicked &&
            _rightClickTimer.Tick(Time.deltaTime) &&
            !Object.ReferenceEquals(_selectingInfo, null) &&
            !RadialMenu.Opened)
        {
            _rightClickTimer.Reset();
            RadialMenu.Show(_selectingInfo);
            _lineRenderer.enabled = false;
        }

        if (rightUp &&
            RadialMenu.Opened)
        {
            _lineRenderer.enabled = true;
            RadialMenu.Shut();
        }
    }
Esempio n. 10
0
    void Update()
    {
        MenuGUI menuState = FindObjectOfType <MenuGUI>();

        if (menu == null && menuState.state == MenuGUI.MenuState.Hidden && (Input.GetKeyDown(KeyCode.Escape) || InputSynchronizer.GetFlyStickButtonDown(3)))
        {
            menu = RadialMenuSpawner.ins.SpawnMenu(this);

            // fade music if in menu modus
            GameObject  BackgroundMusic       = GameObject.Find("BackgroundMusic");
            AudioSource backgroundMusicSource = BackgroundMusic.GetComponent <AudioSource>();
            backgroundMusicSource.volume = 0.5f;

            Debug.Log("Radial Menu created");
        }
        else if (menu != null && (Input.GetKeyDown(KeyCode.Escape) || InputSynchronizer.GetFlyStickButtonDown(3)))
        {
            // music back to full volume
            GameObject  BackgroundMusic       = GameObject.Find("BackgroundMusic");
            AudioSource backgroundMusicSource = BackgroundMusic.GetComponent <AudioSource>();
            backgroundMusicSource.volume = 1.0f;

            menu.Trigger();
            Destroy(menu.gameObject);
            menu = null;

            Debug.Log("Radial Menu destroyed");
        }
    }
Esempio n. 11
0
        // This function takes in a RadialMenu present in the scene and reads its properties,
        // then uses these properties to populate the window with that menu's current settings
        private void DisplayMenuToUpdate(RadialMenu menu)
        {
            var menuButtons = menu.GetComponentsInChildren <RadialButton>();
            var menuCursor  = menu.GetComponentInChildren <MenuCursor>();
            var menuToggle  = menu.GetComponent <MenuToggle>();

            _menuName        = menu.name;
            _buttonStyle     = menu.buttonStyle;
            _numberOfButtons = menuButtons.Length;
            _labelDisplay    = menuCursor.labelDisplayOption;

            // If all button colors match
            for (var i = 0; i < menuButtons.Length; i++)
            {
                var rendererOne     = menuButtons[i].GetComponent <Renderer>();
                var currentMatColor = rendererOne.sharedMaterial.color;

                if (i != menuButtons.Length - 1)
                {
                    var rendererTwo  = menuButtons[i + 1].GetComponent <Renderer>();
                    var nextMatColor = rendererTwo.sharedMaterial.color;

                    if (currentMatColor != nextMatColor)
                    {
                        _buttonsMatch = false;
                        break;
                    }
                }
                _buttonsMatch = true;
            }
            _sharedButtonColor    = menuButtons[0].GetComponent <Renderer>().sharedMaterial.color;
            _sharedHighlightColor = menuCursor.highlightMat.color;

            _selectionButton  = menuCursor.selectionButton;
            _menuToggle       = menuToggle.toggle;
            _menuToggleButton = menuToggle.toggleButton;

            _handAttachPoint  = menu.GetComponent <AttachToAnchor>().attachPoint;
            _playSoundOnClick = menuCursor.playSound;
            if (_playSoundOnClick)
            {
                _onClickSound = menuCursor.clickAudio;
            }
            _hapticHand = menuCursor.hapticHandOption;
            if (_hapticHand != EHapticHand.NoHaptics)
            {
                _hapticIntensity = menuCursor.hapticIntensityOption;
            }
            _buttonMats = new Material[menuButtons.Length];
            for (var i = 0; i < menuButtons.Length; i++)
            {
                _buttonLabels[i] = menuButtons[i].name;
                _buttonIcons[i]  = menuButtons[i].GetComponentInChildren <Image>().sprite;
                _buttonMats[i]   = menuButtons[i].GetComponent <Renderer>().sharedMaterial;
                if (!_buttonsMatch)
                {
                    _buttonColors[i] = _buttonMats[i].color;
                }
            }
        }
Esempio n. 12
0
 public virtual void Init(  RadialMenu radMenu, string name, GameObject objectToCall, string functionToCall )
 {
     m_RadMenu = radMenu;
     m_ObjectName = name;
     m_ObjectToCall = objectToCall;
     m_FunctionToCall = functionToCall;
 }
Esempio n. 13
0
    public void SpawnMenu(Interactable obj)
    {
        RadialMenu newMenu = Instantiate(menuPrefab) as RadialMenu;

        newMenu.transform.SetParent(transform, false);
        newMenu.SpawnButtons(obj);
    }
Esempio n. 14
0
    /// <summary>
    /// On unit select bring up menu of unit actions
    /// </summary>
    public override void onSelect()
    {
        base.onSelect();
        //Set the info panel to display information about this unit
        GameObject.Find("InfoPanel").GetComponent <InfoPanel>().setObject(this);

        //Create the radial menu for this unit
        GameObject radialMenuObj = (GameObject)Instantiate(Resources.Load("Prefabs/RadialMenu"));

        radialMenuObj.transform.SetParent(transform.parent, false);
        unitMenu = radialMenuObj.GetComponent <RadialMenu>();
        unitMenu.addOptionToMenu(new RadialButton.passDelegateNoValue(startMoveUnit), Resources.Load <Sprite>("Images/move"));
        unitMenu.addOptionToMenu(new RadialButton.passDelegateNoValue(deleteUnit), Resources.Load <Sprite>("Images/skull"));

        //Check if boats are near the unit, if so let the unit have the option to get on the boat
        if (!onBoat)
        {
            for (int i = 0; i < 6; i++)
            {
                Tile checkTile = transform.parent.parent.GetComponent <BoardManager>().getNeighborByDirection((BoardManager.tileDirections)i, transform.parent.GetComponent <Tile>());
                if (checkTile.setType == Tile.tileType.ShallowWater)
                {
                    if (checkTile.unitsOnTile.Count != 0)
                    {
                        if (checkTile.unitsOnTile[0].GetComponent <Boat>() != null)
                        {
                            unitMenu.addOptionToMenu(new RadialButton.passDelegateNoValue(addToNearestBoat), Resources.Load <Sprite>("Images/overhead"));
                            break;
                        }
                    }
                }
            }
        }
    }
Esempio n. 15
0
    public void SpawnMenu(Interatible obj)
    {
        RadialMenu newMenu = Instantiate(menuPrefab) as RadialMenu;

        newMenu.transform.SetParent(transform, false);
        newMenu.transform.position = Input.mousePosition;
        newMenu.SpawnButton(obj);
    }
Esempio n. 16
0
    public void SpawnRadialMenu(List <Rightclick.Menu> ListRightclick)
    {
        RadialMenu newMenu = Instantiate(menuPrefab) as RadialMenu;

        newMenu.transform.SetParent(transform, false);
        newMenu.transform.position = Input.mousePosition;
        newMenu.SetupMenu(ListRightclick);
    }
 public RadialMenuControl(RadialMenu menu, VRCExpressionsMenu.Control control) : base(control.name, control.icon, control.type, control.value)
 {
     _menu          = menu;
     _subMenu       = control.subMenu;
     _subLabels     = control.labels;
     _parameter     = menu.GetParam(control.parameter.name);
     _subParameters = control.subParameters.Select(parameter => menu.GetParam(parameter.name)).ToArray();
 }
Esempio n. 18
0
    // Start is called before the first frame update
    void Awake()
    {
        grid       = GetComponent <Grid3D>();
        colourMenu = GameObject.Find("Radial Menu - Colours").GetComponent <RadialMenu>();
        tempObject = null;

        grid.OnGridInitialised += Grid_OnGridInitialised;
    }
Esempio n. 19
0
    public void SpawnMenu(ClickToUpgrade obj)
    {
        //Instantiate radial menu prefab
        RadialMenu newMenu = Instantiate(menuPrefab) as RadialMenu;

        newMenu.transform.SetParent(transform, false);
        newMenu.transform.position = Input.mousePosition; //spawn the menu where the mouse is
        newMenu.SpawnButtons(obj);                        //spawn buttons
    }
Esempio n. 20
0
    public void SpawnMenu(Interactable obj)
    {
        RadialMenu newMenu = Instantiate(menuPrefab) as RadialMenu;

        newMenu.transform.SetParent(transform, false);
        //newMenu.transform.localPosition = Input.mousePosition;
        newMenu.transform.localPosition = new Vector3(0f, 0f, 0f);              //position or local position???
        newMenu.SpawnButtons(obj);
    }
Esempio n. 21
0
    public void SpawnMenu(Interactable obj)
    {
        RadialMenu newMenu = Instantiate(menuPrefab) as RadialMenu;

        newMenu.transform.SetParent(transform, false);
        newMenu.transform.position = Input.mousePosition;
        newMenu.label.text         = obj.title.ToUpper();
        newMenu.SpawnButtons(obj);
    }
Esempio n. 22
0
    public void SpawnMenu(PlayerController obj)
    {
        RadialMenu newMenu = Instantiate(menuPrefab) as RadialMenu;

        newMenu.transform.SetParent(transform, false);
        newMenu.transform.position = Input.mousePosition;

        newMenu.SpawnButtons(obj);
    }
Esempio n. 23
0
    public override void _Ready()
    {
        Radial = GetNode <RadialMenu>(RadialPath);

        FullRect = true;
        Decorate = false;

        Radial.Connect(nameof(RadialMenu.OnItemSelected), this, nameof(ForwardSelected));
        Radial.Visible = false;
    }
 public void SpawnMenu(Interactable obj)
 {
     if (obj.options.Count > 0)
     {
         RadialMenu newMenu = Instantiate(menuPrefab) as RadialMenu;
         newMenu.transform.SetParent(transform, false); // drops in the middle of the screen
                                                        //newMenu.transform.position = Input.mousePosition; // drops the menu on the mouse position
         newMenu.SpawnButtons(obj);
     }
 }
Esempio n. 25
0
    public void SpawnMenu()
    {
        RadialMenu newMenu = Instantiate(menuPrefab) as RadialMenu;

        newMenu.transform.SetParent(transform, false);
        Vector3 p = Input.mousePosition;

        p.z = 20;
        newMenu.transform.position = cam.ScreenToWorldPoint(p);
    }
        public Form1()
        {
            InitializeComponent();

            barManager            = barManager1;
            barManager.ItemClick += new ItemClickEventHandler(barManager_ItemClick);
            // Create Radial Menu
            radialMenu = new RadialMenu(barManager);
            radialMenu.AddItems(GetRadialMenuItems(barManager));
        }
Esempio n. 27
0
    public RadialMenu SpawnMenu(WandController wand, GameController gc)
    {
        RadialMenu newMenu = Instantiate(menuPrefab) as RadialMenu;

        newMenu.transform.SetParent(transform, false);
        newMenu.transform.localPosition = transform.localPosition + offset;
        newMenu.gameController          = gc;
        newMenu.SpawnButtons(wand);
        return(newMenu);
    }
Esempio n. 28
0
 public void Set(RadialMenu menu, float value)
 {
     value *= _amplifier;
     if (Is(value))
     {
         return;
     }
     InternalSet(value);
     _onChange?.Invoke(this, value);
     menu.UpdateValue(Name, value);
 }
    /// <summary>
    /// Creates a radial menu with the parameters set in the interactable object
    /// </summary>
    public void SpawnMenu(RadialMenu_ObjectInteractable obj, string[] display_options = null)
    { //Instanciates the menu prefab
        RadialMenu menu = Instantiate(menu_prefab) as RadialMenu;

        menu.transform.SetParent(transform, false);

        menu.transform.position = RectTransformUtility.WorldToScreenPoint(Camera.main, obj.transform.position);  //Position of the menu in Canvas coordinates
        menu.obj = obj;

        menu.SpawnButtons(obj, display_options);
    }
Esempio n. 30
0
    void Start()
    {
        menu       = GetComponent <RadialMenu>();
        MRToolkit  = GameObject.Find("MR Toolkit");
        controller = MRToolkit.GetComponent <MRManager>().calibrationController;

        controllerInput   = controller.GetComponent <SteamVR_TrackedController>();
        controllerInput_o = controller.GetComponent <SteamVR_TrackedObject>();

        Initialize();
    }
Esempio n. 31
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        RadialMenu rMenu = (RadialMenu)target;

        if (GUILayout.Button("Regenerate Buttons"))
        {
            rMenu.RegenerateButtons();
        }
    }
Esempio n. 32
0
 /// <summary>
 /// Creates a Shim from a button
 /// </summary>
 /// <param name="input">The actual CenterButton</param>
 /// <param name="tappedHandler">The tapped handler for this button</param>
 /// <returns></returns>
 public static CenterButtonShim ButtonToShim(CenterButton input, RadialMenu.CenterButtonTappedHandler tappedHandler)
 {
     return new CenterButtonShim
     {
         BorderBrush = input.BorderBrush,
         Background = input.Background,
         Content = input.Content,
         FontSize = input.FontSize,
         Top = input.Top,
         Left = input.Left,
         CenterButtonTappedHandler = tappedHandler
     };
 }
Esempio n. 33
0
        protected override object CreateControlCore()
        {
            var panel = new Panel();
            _panel = panel;
            var items = app.Model as IModelApplicationNavigationItems;
            var ctrl = new RadialMenu();

            menu = ctrl;

            var dock = app.MainWindow.Template as IBarManagerHolder;
            ctrl.Manager = dock.BarManager;
            BuildMenu(items.NavigationItems.Items, ctrl, dock);
            panel.MouseClick += Panel_MouseClick;
            menu.MenuRadius = (Screen.PrimaryScreen.Bounds.Height - 100)/4;
            return panel;
        }
Esempio n. 34
0
        public ControlsProcessor(Settings settings, 
			ControllerEmulation controllerEmulation, 
			Aiming aiming, 
			ExtendedView extendedView, 
			RadialMenu radialMenu, 
			SettingsMenu settingsMenu, 
            GameState gameState,
			DebugOutput debugOutput)
        {
            _settings = settings;
            _controllerEmulation = controllerEmulation;
            _aiming = aiming;
            _extendedView = extendedView;
            _radialMenu = radialMenu;
            _settingsMenu = settingsMenu;
            _gameState = gameState;

            _debugOutput = debugOutput;
            _controllerEmulation.OnModifyState += OnModifyControllerState;
        }
Esempio n. 35
0
 private void OnChangeMenuRequest(object s, RadialMenu sm)
 {
     if (ChangeMenuRequestEvent != null)
     {
         ChangeMenuRequestEvent(s, sm);
     }
 }
Esempio n. 36
0
        public override void Initialize()
        {
            m_context = new RadialMenuContext(m_device, m_content);

            //Textures
            Texture2D dummy = m_content.Load<Texture2D>("radialTemp");
            Texture2D tileCollection = m_content.Load<Texture2D>("collection");
            Texture2D main = m_content.Load<Texture2D>("close");
            Texture2D characters = m_content.Load<Texture2D>("Radial/Characters/characters");
            Texture2D cheeseboy = m_content.Load<Texture2D>("Radial/Characters/player");
            Texture2D napoleon = m_content.Load<Texture2D>("Radial/Characters/napoleon");
            Texture2D rat1 = m_content.Load<Texture2D>("Radial/Characters/rat");
            Texture2D rat2 = m_content.Load<Texture2D>("Radial/Characters/rat2");

            Texture2D powerups = m_content.Load<Texture2D>("Radial/Powerups/powerups");
            Texture2D speed = m_content.Load<Texture2D>("OtherSheets/speedpowerup");
            Texture2D powerful = m_content.Load<Texture2D>("OtherSheets/Item_SuperCheesy");
            Texture2D bomb = m_content.Load<Texture2D>("OtherSheets/bombitem");

            Texture2D road = m_content.Load<Texture2D>("RoadToolIcon");

            Texture2D switches = m_content.Load<Texture2D>("OtherSheets/Switch_Tileset");
            Texture2D blocks = m_content.Load<Texture2D>("OtherSheets/Blockade_Tileset");

            Texture2D question = m_content.Load<Texture2D>("custom");

            Texture2D switchPreview = m_content.Load<Texture2D>("OtherSheets/swiitchesPreview");
            Texture2D blockPreview = m_content.Load<Texture2D>("OtherSheets/Blockade_Preview");

            Texture2D trap = m_content.Load<Texture2D>("OtherSheets/Trap_Spikes");

            EventSystem ev = (EventSystem)world.SystemManager.GetSystem<EventSystem>()[0];
            int start = 3 * 30;

            List<EventData> events = new List<EventData>();
            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    IntPair pair;
                    pair.i1 = start + i + j * 30;
                    pair.i2 = start + i + j * 30;
                    EventData eventData = new EventData(setToolCallback, pair);
                    ev.addEvent(eventData);
                    events.Add(eventData);
                }
            }

            EventData tempEvent = new EventData(null, null);

            //Character events
            EventData avatarEvent = new EventData(setToolCallback, new IntPair(270, 270));
            EventData robot = new EventData(setToolCallback, new IntPair(301, 301));
            EventData rat1E = new EventData(setToolCallback, new IntPair(300, 300));
            EventData rat2E = new EventData(setToolCallback, new IntPair(301, 301));
            events.Add(avatarEvent);
            events.Add(robot);
            events.Add(rat1E);
            events.Add(rat2E);

            //Power-Ups Events
            EventData speedE = new EventData(setToolCallback, new IntPair(360, 360));
            EventData bombE = new EventData(setToolCallback, new IntPair(390, 390));
            EventData superE = new EventData(setToolCallback, new IntPair(420, 420));
            events.Add(speedE);
            events.Add(bombE);
            events.Add(superE);

            //Switches Events
            EventData s1E = new EventData(setToolCallback, new IntPair(180, 180));
            EventData s2E = new EventData(setToolCallback, new IntPair(181, 181));
            EventData s3E = new EventData(setToolCallback, new IntPair(182, 182));
            EventData s4E = new EventData(setToolCallback, new IntPair(183, 183));
            EventData s5E = new EventData(setToolCallback, new IntPair(184, 184));
            EventData s6E = new EventData(setToolCallback, new IntPair(185, 185));
            events.Add(s1E);
            events.Add(s2E);
            events.Add(s3E);
            events.Add(s4E);
            events.Add(s5E);
            events.Add(s6E);

            //Blocks Events
            EventData b1E = new EventData(setToolCallback, new IntPair(210, 210));
            EventData b2E = new EventData(setToolCallback, new IntPair(211, 211));
            EventData b3E = new EventData(setToolCallback, new IntPair(212, 212));
            EventData b4E = new EventData(setToolCallback, new IntPair(213, 213));
            EventData b5E = new EventData(setToolCallback, new IntPair(214, 214));
            EventData b6E = new EventData(setToolCallback, new IntPair(215, 215));
            events.Add(b1E);
            events.Add(b2E);
            events.Add(b3E);
            events.Add(b4E);
            events.Add(b5E);
            events.Add(b6E);

            //Trap Event
            EventData trapE = new EventData(setToolCallback, new IntPair(450, 450));
            events.Add(trapE);

            //CHARACTERS MENU
            List<RadialMenuItem> characterList = new List<RadialMenuItem>();
            characterList.Add(new RadialMenuItem("Avatar", cheeseboy, avatarEvent));
            characterList.Add(new RadialMenuItem("Robotaparte", napoleon, robot));
            characterList.Add(new RadialMenuItem("Rat", rat1, rat1E));
            //characterList.Add(new RadialMenuItem("Infected Rat", rat2, rat2E));
            RadialMenu charactersMenu = new RadialMenu(m_device, m_content, characterList, characters, null, ev, this);

            //POWER-UPS MENU
            List<RadialMenuItem> powerupsList = new List<RadialMenuItem>();
            powerupsList.Add(new RadialMenuItem("Bomb", bomb, bombE));
            powerupsList.Add(new RadialMenuItem("Speed", speed, speedE));
            powerupsList.Add(new RadialMenuItem("Strength", powerful, superE));
            RadialMenu powerupsMenu = new RadialMenu(m_device, m_content, powerupsList, powerups, null, ev, this);

            //SWITCHES MENU
            List<RadialMenuItem> switchesList = new List<RadialMenuItem>();
            switchesList.Add(new RadialMenuItem("Switch 1", switches, s1E, new Rectangle(0, 0, 64, 64)));
            switchesList.Add(new RadialMenuItem("Switch 2", switches, s2E, new Rectangle(0, 64, 64, 64)));
            switchesList.Add(new RadialMenuItem("Switch 3", switches, s3E, new Rectangle(0, 128, 64, 64)));
            switchesList.Add(new RadialMenuItem("Switch 4", switches, s4E, new Rectangle(0, 192, 64, 64)));
            switchesList.Add(new RadialMenuItem("Switch 5", switches, s5E, new Rectangle(0, 256, 64, 64)));
            switchesList.Add(new RadialMenuItem("Switch 6", switches, s6E, new Rectangle(0, 320, 64, 64)));
            RadialMenu switchesMenu = new RadialMenu(m_device, m_content, switchesList, switchPreview, null, ev, this);

            //BLOCKS MENU
            List<RadialMenuItem> blockList = new List<RadialMenuItem>();
            blockList.Add(new RadialMenuItem("Block 1", blocks, b1E, new Rectangle(0, 0, 64, 64)));
            blockList.Add(new RadialMenuItem("Block 2", blocks, b2E, new Rectangle(0, 64, 64, 64)));
            blockList.Add(new RadialMenuItem("Block 3", blocks, b3E, new Rectangle(0, 128, 64, 64)));
            blockList.Add(new RadialMenuItem("Block 4", blocks, b4E, new Rectangle(0, 192, 64, 64)));
            blockList.Add(new RadialMenuItem("Block 5", blocks, b5E, new Rectangle(0, 256, 64, 64)));
            blockList.Add(new RadialMenuItem("Block 6", blocks, b6E, new Rectangle(0, 320, 64, 64)));
            RadialMenu blockMenu = new RadialMenu(m_device, m_content, blockList, blockPreview, null, ev, this);

            //CUSTOM MENU
            List<RadialMenuItem> customList = new List<RadialMenuItem>();
            RadialMenu customMenu = new RadialMenu(m_device, m_content, customList, question, null, ev, this);

            //COLLECTION MENU
            List<RadialMenuItem> collectionList = new List<RadialMenuItem>();
            collectionList.Add(new RadialMenuItem("Characters", characters, charactersMenu));
            collectionList.Add(new RadialMenuItem("Power-Ups", powerups, powerupsMenu));
            collectionList.Add(new RadialMenuItem("Switches", switchPreview, switchesMenu));
            collectionList.Add(new RadialMenuItem("Blocks", blockPreview, blockMenu));
            collectionList.Add(new RadialMenuItem("Trap", trap, trapE));
            collectionList.Add(new RadialMenuItem("Custom Selections", question, customMenu));
            RadialMenu collectionMenu = new RadialMenu(m_device, m_content, collectionList, tileCollection, null, ev, this);

            //MAIN MENU
            List<RadialMenuItem> items = new List<RadialMenuItem>();
            items.Add(new RadialMenuItem("Tile Collection", tileCollection, collectionMenu));
            items.Add(new RadialMenuItem("Recent 1", m_tilemap, events[0], new Rectangle(0, 96, 32, 32)));
            items.Add(new RadialMenuItem("Recent 2", m_tilemap, events[1], new Rectangle(0, 128, 32, 32)));
            items.Add(new RadialMenuItem("Recent 3", m_tilemap, events[2], new Rectangle(0, 160, 32, 32)));
            items.Add(new RadialMenuItem("Recent 4", m_tilemap, events[3], new Rectangle(32, 96, 32, 32)));
            items.Add(new RadialMenuItem("Recent 5", m_tilemap, events[4], new Rectangle(32, 128, 32, 32)));
            items.Add(new RadialMenuItem("Recent 6", m_tilemap, events[5], new Rectangle(32, 160, 32, 32)));
            items.Add(new RadialMenuItem("Recent 7", m_tilemap, events[6], new Rectangle(64, 96, 32, 32)));
            items.Add(new RadialMenuItem("Recent 8", m_tilemap, events[7], new Rectangle(64, 128, 32, 32)));
            items.Add(new RadialMenuItem("Recent 9", m_tilemap, events[8], new Rectangle(64, 160, 32, 32)));
            m_usesTilemap = new List<RadialMenuItem>();
            for (int i = 1; i < items.Count; i++)
            {
                m_usesTilemap.Add(items[i]);
            }

            RadialMenu menu = new RadialMenu(m_device, m_content, items, main, null, ev, this);

            //DETERMINE ALL PARENTING
            collectionMenu.setParent(menu);
            charactersMenu.setParent(collectionMenu);
            powerupsMenu.setParent(collectionMenu);
            switchesMenu.setParent(collectionMenu);
            customMenu.setParent(collectionMenu);
            blockMenu.setParent(collectionMenu);

            //ADD ALL MENUS
            m_context.addRadialMenu(menu);
            m_context.addRadialMenu(collectionMenu);
            m_context.addRadialMenu(charactersMenu);
            m_context.addRadialMenu(powerupsMenu);
            m_context.addRadialMenu(customMenu);
            m_context.addRadialMenu(switchesMenu);
            m_context.addRadialMenu(blockMenu);
            customID = 4;

            m_radialWindow = new RadialWindow(m_manager);
            m_radialWindow.Init();
            m_radialWindow.Left = 0;
            m_radialWindow.Top = 0;
            m_radialWindow.Width = m_manager.Window.Width;
            m_radialWindow.Height = m_manager.Window.Height;
            m_radialWindow.Parent = null;
            //m_canvasWindow.BorderVisible = false;
            m_radialWindow.Resizable = false;
            m_radialWindow.StayOnTop = true;
            m_radialWindow.RadialContext = m_context;
            m_radialWindow.DoubleClicks = false;
            m_radialWindow.Click += new TomShane.Neoforce.Controls.EventHandler(radialWindow_MouseClick);
            m_manager.Add(m_radialWindow);
            m_radialWindow.Hide();
        }
Esempio n. 37
0
 private void OnRadialMenuChanged(RadialMenu oldValue, RadialMenu newValue)
 {
     UpdateDisplay();
 }
 public RadialMenuRotateAroundPointBehavior(RadialMenu target)
 {
     AssociatedObject = target;
     OnAttached();
 }
Esempio n. 39
0
        public Gta5EyeTracking()
        {
            Debug.Log("Begin Initialize");

            //Disposing
            _shutDownRequestedEvent = new ManualResetEvent(false);

            //Settings
            _settingsStorage = new SettingsStorage();
            _settings = _settingsStorage.LoadSettings();

            //Statistics
            var version = Assembly.GetExecutingAssembly().GetName().Version;
            var versionString = version.Major + "." + version.Minor + "." + version.Build;
            _googleAnalyticsApi = new GoogleAnalyticsApi("UA-68420530-1", _settings.UserGuid, "GTA V Eye Tracking Mod", "gta5eyetracking", versionString);

            //Gaze
            _tobiiTracker = new TobiiInteractionEngineTracker();

            //Menu
            _menuPool = new MenuPool();
            _settingsMenu = new SettingsMenu(_menuPool, _settings);

            _introScreen = new IntroScreen(_menuPool, _settings);

            //Debug
            _debugGazeVisualization = new DefaultCrosshair(Color.FromArgb(220, 255, 0, 0), Color.FromArgb(220, 0, 255, 255));
            _debugOutput = new DebugOutput();

            //Hids
            _mouseEmulation = new MouseEmulation();
            _controllerEmulation = new ControllerEmulation();

            //Features
            _gameState = new GameState(_controllerEmulation, _menuPool);
            _animationHelper = new AnimationHelper();
            _aiming = new Aiming(_settings, _animationHelper, _gameState);
            _extendedView = new ExtendedView(_settings, _gameState, _tobiiTracker, _aiming, _debugOutput);
            _radialMenu = new RadialMenu(_controllerEmulation, _tobiiTracker);

            //Window
            _foregroundWindowWatcher = new ForegroundWindowWatcher();
            _foregroundWindowWatcher.ForegroundWindowChanged += ForegroundWindowWatcherOnForegroundWindowChanged;
            _isWindowForeground = _foregroundWindowWatcher.IsWindowForeground();

            //General
            _gazeProjector = new GazeProjector(_settings);
            _controlsProcessor = new ControlsProcessor(_settings,_controllerEmulation,_aiming,_extendedView,_radialMenu,_settingsMenu, _gameState, _debugOutput);

            KeyDown += OnKeyDown;
            Tick += OnTick;
            Aborted += OnAborted;
            Debug.Log("End Initialize");
        }