예제 #1
0
 // Use this for initialization
 void Start()
 {
     SoundManager.PlaySFX(CrowdClip, true);
     m_MenuControls = FindObjectOfType <MenuControls>();
     m_AllDatas     = Utilities.GetAllPlayerData();
     GameManager.instance.SetGameState(GameState.Loading);
 }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     SoundManager.PlaySFX(CrowdClip, true);
     m_MenuControls = FindObjectOfType<MenuControls>();
     m_AllDatas = Utilities.GetAllPlayerData();
     GameManager.instance.SetGameState(GameState.Loading);
 }
예제 #3
0
        public static sKeyConfig Get(MenuControls key)
        {
            int offset = Marshal.SizeOf <sKeyConfig>();

            long ptr = Kernel.Read <long>(Address.GetAddress("BASE") + Address.GetAddress("SETTINGS_KEYBOARD"));

            return(Kernel.ReadStructure <sKeyConfig>(ptr + 0xA50 + (offset * (int)key)));
        }
예제 #4
0
 public InventoryScreen(bool transparent, bool pauses, RLRootConsole rootConsole)
 {
     _rootConsole      = rootConsole;
     _inventoryConsole = new RLConsole(INVENTORYWIDTH, INVENTORYHEIGHT);
     _messageConsole   = new RLConsole(MESSAGEWIDTH, MESSAGEHEIGHT);
     inventorySystem   = GameController.InventorySystem;
     inventoryUI       = new InventoryUI(this);
     menuControls      = new MenuControls(rootConsole);
     Transparent       = transparent;
     Pauses            = pauses;
 }
예제 #5
0
    protected void Awake()
    {
        _controls = new MenuControls();
        // Jump:
        _up = new Subject <Unit>().AddTo(this);
        _controls.Inventory.Up.performed += context => _up.OnNext(Unit.Default);

        //ToggleMenu
        _down = new Subject <Unit>().AddTo(this);
        _controls.Inventory.Down.performed += context => _down.OnNext(Unit.Default);

        _closetextbox = new Subject <Unit>().AddTo(this);
        _controls.Inventory.CloseTextBox.performed += context => _closetextbox.OnNext(Unit.Default);
    }
예제 #6
0
    private void GetObjects()
    {
        m_MenuControls = FindObjectOfType <MenuControls>();
        if (m_MenuControls == null)
        {
            Debug.LogError("Loading Screen cannot find  Menu control object in scene.");
        }

        _delayManager = GetComponent <DelayManager>();
        if (_delayManager == null)
        {
            Debug.LogError("No delay manager found on loading screen");
        }

        if (_tipScreenGameObject == null)
        {
            Debug.LogError("Loading screen is missing the tip screen game object.");
        }
        else
        {
            _tipScreenSprite = _tipScreenGameObject.GetComponent <SpriteRenderer>();
            SetRandomColor();
        }

        _animator = GetComponent <Animator>();
        if (_animator == null)
        {
            Debug.LogError("Loading Screen is missing its animator. PANIC!");
        }

        if (_isGameplayScene)
        {
            m_spawner = FindObjectOfType <PlayerSpawner>();
            if (m_spawner == null)
            {
                Debug.LogError("Loading Screen cannot find player spawner. Is this a gameplay scene? If yes, set the IsGameplayScene to true.");
            }
            else
            {
                SubscribeToEvents(m_spawner);
            }
        }
    }
예제 #7
0
    // Start is called before the first frame update
    void Start()
    {
        levelNumber = transform.Find("Text").gameObject;
        padlock     = transform.Find("Lock").gameObject;
        levelId     = int.Parse(gameObject.name.Replace("Level_", ""));
        _menuctrl   = GameObject.FindGameObjectWithTag("LevelMenuBtn").GetComponent <MenuControls>();


        if (PlayerPrefs.GetInt("level" + levelId, 0) == 1)
        {
            padlock.SetActive(false);
            levelNumber.SetActive(true);
        }
        else
        {
            padlock.SetActive(true);
            levelNumber.SetActive(false);
        }
    }
예제 #8
0
        public static string GetUserMenuIds(int uid)
        {
            var muM = Sys_Manage_UserBLL.GetManageUserModel(uid);

            if (muM.MenuPermission != null)
            {
                return(muM.MenuPermission);
            }
            else
            {
                MenuControls mc   = new MenuControls();
                List <int>   list = mc.GetDepartmentMenuId(muM.PowerSession);

                string l = "";
                foreach (int i in list)
                {
                    l += "," + i.ToString();
                }
                return(l.Trim(','));
            }
        }
예제 #9
0
    // Start is called before the first frame update
    void Start()
    {
        lr = GetComponent <LineRenderer>();

        GameObject menu = GameObject.FindGameObjectWithTag("MenuControl");

        if (menu == null)
        {
            Debug.LogError("FAILED TO LOCATE MENU OBJECT");
        }

        if (menu.TryGetComponent <MenuControls>(out MenuControls attempt))
        {
            controlMenu = attempt;
        }
        else
        {
            Debug.LogError("FAILED TO LOCATE MENUS MENU CONTROLLER");
        }

        SteamVR_Actions.default_GrabPinch.AddOnStateDownListener(TriggerDown, leftController);
        SteamVR_Actions.default_GrabPinch.AddOnStateUpListener(TriggerUp, leftController);
    }
예제 #10
0
파일: UIMenu.cs 프로젝트: frodzet/NativeUI
 /// <summary>
 /// Set a GTA.Control to control a menu. Can be multiple controls. This applies it to all indexes.
 /// </summary>
 /// <param name="control"></param>
 /// <param name="gtaControl"></param>
 public void SetKey(MenuControls control, Control gtaControl)
 {
     SetKey(control, gtaControl, 0);
     SetKey(control, gtaControl, 1);
     SetKey(control, gtaControl, 2);
 }
예제 #11
0
파일: UIMenu.cs 프로젝트: frodzet/NativeUI
 /// <summary>
 /// Set a key to control a menu. Can be multiple keys for each control.
 /// </summary>
 /// <param name="control"></param>
 /// <param name="keyToSet"></param>
 public void SetKey(MenuControls control, Keys keyToSet)
 {
     if (_keyDictionary.ContainsKey(control))
         _keyDictionary[control].Item1.Add(keyToSet);
     else
     {
         _keyDictionary.Add(control,
             new Tuple<List<Keys>, List<Tuple<Control, int>>>(new List<Keys>(), new List<Tuple<Control, int>>()));
         _keyDictionary[control].Item1.Add(keyToSet);
     }
 }
예제 #12
0
 // Use this for initialization
 protected virtual void Start()
 {
     m_Controls = FindObjectOfType<MenuControls>();
 }
예제 #13
0
    private void GetObjects()
    {
        m_MenuControls = FindObjectOfType<MenuControls>();
        if (m_MenuControls == null) Debug.LogError("Loading Screen cannot find  Menu control object in scene.");

        _delayManager = GetComponent<DelayManager>();
        if (_delayManager == null) Debug.LogError("No delay manager found on loading screen");

        if (_tipScreenGameObject == null) Debug.LogError("Loading screen is missing the tip screen game object.");
        else
        {
            _tipScreenSprite = _tipScreenGameObject.GetComponent<SpriteRenderer>();
            SetRandomColor();
        }

        _animator = GetComponent<Animator>();
        if (_animator == null) Debug.LogError("Loading Screen is missing its animator. PANIC!");

        if (_isGameplayScene)
        {
            m_spawner = FindObjectOfType<PlayerSpawner>();
            if (m_spawner == null) Debug.LogError("Loading Screen cannot find player spawner. Is this a gameplay scene? If yes, set the IsGameplayScene to true.");
            else SubscribeToEvents(m_spawner);
        }
    }
예제 #14
0
 public static ControlMembers GetNewMenuControl(MenuControls controlEnum) =>
 Instance.GetNewControlFunc((int)controlEnum);
예제 #15
0
 public override bool OnActivated()
 {
     MenuControls.Close();
     return(false);
 }
예제 #16
0
 public TerminalControlBase(MenuControls controlEnum) : this(RichHudTerminal.GetNewMenuControl(controlEnum))
 {
     // Register event callback
     GetOrSetMember(new Action(ControlChangedCallback), (int)TerminalControlAccessors.GetOrSetControlCallback);
 }
예제 #17
0
파일: UIMenu.cs 프로젝트: frodzet/NativeUI
 /// <summary>
 /// Check whether a menucontrol is being pressed.
 /// </summary>
 /// <param name="control"></param>
 /// <param name="key"></param>
 /// <returns></returns>
 public bool IsControlBeingPressed(MenuControls control, Keys key = Keys.None)
 {
     List<Keys> tmpKeys = new List<Keys>(_keyDictionary[control].Item1);
     List<Tuple<Control, int>> tmpControls = new List<Tuple<Control, int>>(_keyDictionary[control].Item2);
     if (_controlCounter > 0)
     {
         _controlCounter++;
         if (_controlCounter > 30)
             _controlCounter = 0;
         return false;
     }
     if (key != Keys.None)
     {
         if (tmpKeys.Any(Game.IsKeyPressed))
         {
             _controlCounter = 1;
             return true;
         }
     }
     if (tmpControls.Any(tuple => Game.IsControlPressed(tuple.Item2, tuple.Item1)))
     {
         _controlCounter = 1;
         return true;
     }
     return false;
 }
예제 #18
0
파일: UIMenu.cs 프로젝트: frodzet/NativeUI
 /// <summary>
 /// Set a GTA.Control to control a menu only on a specific index.
 /// </summary>
 /// <param name="control"></param>
 /// <param name="gtaControl"></param>
 /// <param name="controlIndex"></param>
 public void SetKey(MenuControls control, Control gtaControl, int controlIndex)
 {
     if (_keyDictionary.ContainsKey(control))
         _keyDictionary[control].Item2.Add(new Tuple<Control, int>(gtaControl, controlIndex));
     else
     {
         _keyDictionary.Add(control,
             new Tuple<List<Keys>, List<Tuple<Control, int>>>(new List<Keys>(), new List<Tuple<Control, int>>()));
         _keyDictionary[control].Item2.Add(new Tuple<Control, int>(gtaControl, controlIndex));
     }
 }
예제 #19
0
파일: UIMenu.cs 프로젝트: xdidx/gta-demago
        /// <summary>
        /// Remove all controls on a control.
        /// </summary>
        /// <param name="control"></param>
        public void ResetKey(MenuControls control)
        {
            if (!_keyDictionary.ContainsKey(control))
                return;

            _keyDictionary[control].Item1.Clear();
            _keyDictionary[control].Item2.Clear();
        }
예제 #20
0
 // Use this for initialization
 protected virtual void Start()
 {
     m_Controls = FindObjectOfType <MenuControls>();
 }
예제 #21
0
파일: UIMenu.cs 프로젝트: frodzet/NativeUI
        /// <summary>
        /// Check whether a menucontrol has been released.
        /// </summary>
        /// <param name="control">Control to check for.</param>
        /// <param name="key">Key if you're using keys.</param>
        /// <returns></returns>
        public bool HasControlJustBeenReleaseed(MenuControls control, Keys key = Keys.None)
        {
            List<Keys> tmpKeys = new List<Keys>(_keyDictionary[control].Item1);
            List<Tuple<Control, int>> tmpControls = new List<Tuple<Control, int>>(_keyDictionary[control].Item2);

            if (key != Keys.None)
            {
                if (tmpKeys.Any(Game.IsKeyPressed))
                    return true;
            }
            if (tmpControls.Any(tuple => Game.IsControlJustReleased(tuple.Item2, tuple.Item1)))
                return true;
            return false;
        }
예제 #22
0
	protected void MenuTypeOptions_ItemDataBound(object sender, RepeaterItemEventArgs e)
	{
		if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
			return;
		KeyValuePair<string, string> pair = (KeyValuePair<string, string>)e.Item.DataItem;
		MenuControls c = new MenuControls();
		menuControls[pair.Key] = c;
		c.Where = (HtmlTable)e.Item.FindControl("Where");
		c.New = (RadioButtonList)e.Item.FindControl("New");
		c.NewOptions = (HtmlTable)e.Item.FindControl("NewOptions");
		c.Name = (TextBox)e.Item.FindControl("Name");
		c.Before = (DropDownList)e.Item.FindControl("Before");
		c.ExistsOptions = (HtmlTable)e.Item.FindControl("ExistsOptions");
		c.AddTo = (DropDownList)e.Item.FindControl("AddTo");

		c.New.Items[0].Attributes["onclick"] = string.Format("jsUtils.ShowTable('{1}', false);jsUtils.ShowTable('{0}', true, 'inline');", c.NewOptions.ClientID, c.ExistsOptions.ClientID);
		c.New.Items[1].Attributes["onclick"] = string.Format("jsUtils.ShowTable('{1}', false);jsUtils.ShowTable('{0}', true, 'inline');", c.ExistsOptions.ClientID, c.NewOptions.ClientID);

		MenuTypesScript.AppendFormat("jsUtils.ShowTable('{0}', this.value=='{1}', 'inline');", c.Where.ClientID, BXJSUtility.Encode(pair.Key));

		if (!String.IsNullOrEmpty(pair.Key) && (pair.Key.IndexOfAny(Path.GetInvalidFileNameChars()) == -1))
			try
			{
				string menuPath = BXPath.Combine(this.curDir, pair.Key + ".menu");
				BXSecureIO.DemandView(menuPath);
				BXPublicMenuItemCollection menu = BXPublicMenu.Menu.Load(this.curDir, pair.Key);// new BXMenu(BXPath.ToPhysicalPath(menuPath));
				/*menu.Sort(delegate(BXMenuItem a, BXMenuItem b)
				{
					return a.Sort.CompareTo(b.Sort);
				});*/
				for (int i = 0; i < menu.Count; i++)
				{
					BXPublicMenuItem item = menu[i];
					c.Before.Items.Add(new ListItem(item.Title, i.ToString()));
					c.AddTo.Items.Add(new ListItem(item.Title, i.ToString()));
				}
				c.Before.Items.Add(new ListItem(GetMessageRaw("LastItem"), menu.Count.ToString()));
				c.Before.SelectedIndex = c.Before.Items.Count - 1;
			}
			catch
			{
			}
	}
예제 #23
0
파일: UIMenu.cs 프로젝트: frodzet/NativeUI
 /// <summary>
 /// Remove all controls on a control.
 /// </summary>
 /// <param name="control"></param>
 public void ResetKey(MenuControls control)
 {
     _keyDictionary[control].Item1.Clear();
     _keyDictionary[control].Item2.Clear();
 }
예제 #24
0
 public TerminalValue(MenuControls controlEnum) : base(controlEnum)
 {
 }