예제 #1
0
	public override IEnumerator Process()
	{
		yield return WaitFor(Recipient, PaperToUpdate);
		var paper = NetworkObjects[1].GetComponent<Paper>();
		paper.PaperString = Message;
		ControlTabs.RefreshTabs();
	}
예제 #2
0
        ///To be run on client
        public override void Process(NetMessage msg)
        {
            LoadNetworkObject(msg.SubjectPlayer);

            if (NetworkObject == null)
            {
                return;
            }

            Logger.LogTraceFormat("Processed {1}'s state: {0}", Category.Movement, this, NetworkObject.name);
            var playerSync = NetworkObject.GetComponent <PlayerSync>();

            playerSync.UpdateClientState(msg.State);

            if (NetworkObject == PlayerManager.LocalPlayer)
            {
                if (msg.State.ResetClientQueue)
                {
                    playerSync.ClearQueueClient();
                    playerSync.RollbackPrediction();
                }
                if (msg.State.MoveNumber == 0)
                {
                    //Logger.Log( "Zero step rollback" );
                    playerSync.ClearQueueClient();
                    playerSync.RollbackPrediction();
                }

                ControlTabs.CheckTabClose();
            }
        }
예제 #3
0
    private bool CheckAltClick()
    {
        if (KeyboardInputManager.IsAltPressed())
        {
            //Check for items on the clicked position, and display them in the Item List Tab, if they're in reach
            //and not FOV occluded
            Vector3 position = MouseWorldPosition;
            position.z = 0f;
            if (!lightingSystem.enabled || lightingSystem.IsScreenPointVisible(CommonInput.mousePosition))
            {
                if (PlayerManager.LocalPlayerScript.IsInReach(position, false))
                {
                    List <GameObject> objects = UITileList.GetItemsAtPosition(position);
                    //remove hidden wallmounts
                    objects.RemoveAll(obj =>
                                      obj.GetComponent <WallmountBehavior>() != null &&
                                      obj.GetComponent <WallmountBehavior>().IsHiddenFromLocalPlayer());
                    LayerTile tile = UITileList.GetTileAtPosition(position);
                    ControlTabs.ShowItemListTab(objects, tile, position);
                }
            }

            UIManager.SetToolTip = $"clicked position: {Vector3Int.RoundToInt(position)}";
            return(true);
        }
        return(false);
    }
예제 #4
0
    ///To be run on client
    public override IEnumerator Process()
    {
//		Logger.Log("Processed " + ToString());
        yield return(WaitFor(SubjectPlayer));

        if (NetworkObject == null)
        {
            yield break;
        }

        var playerSync = NetworkObject.GetComponent <PlayerSync>();

        playerSync.UpdateClientState(State);

        if (NetworkObject == PlayerManager.LocalPlayer)
        {
            if (State.ResetClientQueue)
            {
                playerSync.ClearQueueClient();
            }
            if (State.MoveNumber == 0)
            {
                //			Logger.Log( "Zero step rollback" );
                playerSync.ClearQueueClient();
                playerSync.RollbackPrediction();
            }

            ControlTabs.CheckTabClose();
        }
    }
예제 #5
0
		public override void Process(NetMessage msg)
		{
			Logger.LogTraceFormat("Processed {0}", Category.NetUI, this);
			LoadNetworkObject(msg.Provider);

			//If start or middle of message add to cache then stop
			if (msg.ID == TabMessageType.MoreIncoming)
			{
				//If Unique Id doesnt exist make new entry
				if (ElementValuesCache.Count == 0 || !ElementValuesCache.ContainsKey(msg.UniqueID))
				{
					ElementValuesCache.Add(msg.UniqueID, new Tuple<ElementValue[], int>(msg.ElementValues, 1));
					return;
				}

				//Sanity check to make sure this isnt the last message
				if (msg.NumOfMessages == ElementValuesCache[msg.UniqueID].Item2 + 1)
				{
					Logger.LogError("This message didnt arrive in time before the end message!", Category.NetUI);
					ElementValuesCache.Remove(msg.UniqueID);
					return;
				}

				//Unique Id already exists so add arrays to each other
				ElementValuesCache[msg.UniqueID] = new Tuple<ElementValue[], int>(Concat(ElementValuesCache[msg.UniqueID].Item1, msg.ElementValues), ElementValuesCache[msg.UniqueID].Item2 + 1);
				return;
			}

			//If end of message add and continue
			if(msg.ID == TabMessageType.EndOfMessage)
			{
				//Add the arrays together
				ElementValuesCache[msg.UniqueID] = new Tuple<ElementValue[], int>(Concat(ElementValuesCache[msg.UniqueID].Item1, msg.ElementValues), ElementValuesCache[msg.UniqueID].Item2 + 1);

				//Check to make sure its the last message
				if (msg.NumOfMessages != ElementValuesCache[msg.UniqueID].Item2)
				{
					Logger.LogError("Not all the messages arrived in time for the NetUI update.", Category.NetUI);
					return;
				}

				msg.ElementValues = ElementValuesCache[msg.UniqueID].Item1;
				ElementValuesCache.Remove(msg.UniqueID);
			}


			switch (msg.Action)
			{
				case TabAction.Open:
					ControlTabs.ShowTab(msg.Type, NetworkObject, msg.ElementValues);
					break;
				case TabAction.Close:
					ControlTabs.CloseTab(msg.Type, NetworkObject);
					break;
				case TabAction.Update:
					ControlTabs.UpdateTab(msg.Type, NetworkObject, msg.ElementValues, msg.Touched);
					break;
			}
		}
예제 #6
0
        public override void Process(NetMessage msg)
        {
            LoadMultipleObjects(new uint[] { msg.Recipient, msg.PDAToUpdate });
            var notes = NetworkObjects[1].GetComponent <PDANotesNetworkHandler>();

            notes.NoteString = msg.Message;
            ControlTabs.RefreshTabs();
        }
        public override void Process(NetMessage msg)
        {
            LoadMultipleObjects(new uint[] { msg.Recipient, msg.PaperToUpdate });
            var paper = NetworkObjects[1].GetComponent <Paper>();

            paper.PaperString = msg.Message;
            ControlTabs.RefreshTabs();
        }
예제 #8
0
 public void Reset()
 {
     image.sprite           = null;
     image.enabled          = false;
     secondaryImage.sprite  = null;
     secondaryImage.enabled = false;
     Item = null;
     ControlTabs.CheckTabClose();
 }
예제 #9
0
    public void Reset()
    {
        image.ClearAll();
        if (amountText)
        {
            amountText.enabled = false;
        }

        ControlTabs.CheckTabClose();
    }
예제 #10
0
        private void Synchronize()
        {
            if (isLocalPlayer && GameData.IsHeadlessServer)
            {
                return;
            }

            if (!playerMove.isGhost)
            {
                CheckSpaceWalk();

                if (isLocalPlayer && playerMove.IsPushing || pushPull.pulledBy != null)
                {
                    return;
                }

                PlayerState state = isLocalPlayer ? predictedState : serverState;
                transform.localPosition = Vector3.MoveTowards(transform.localPosition, state.Position,
                                                              playerMove.speed * Time.deltaTime);

                //Check if we should still be displaying an ItemListTab and update it, if so.
                ControlTabs.CheckItemListTab();

                if (state.Position != transform.localPosition)
                {
                    lastDirection = (state.Position - transform.localPosition).normalized;
                }

                if (pullingObject != null)
                {
                    if (transform.hasChanged)
                    {
                        transform.hasChanged = false;
                        PullObject();
                    }
                    else if (pullingObject.transform.localPosition != pullPos)
                    {
                        pullingObject.transform.localPosition = pullPos;
                    }
                }

                //Registering
                if (registerTile.Position != Vector3Int.RoundToInt(state.Position))
                {
                    RegisterObjects();
                }
            }
            else
            {
                PlayerState state = isLocalPlayer ? predictedState : serverState;
                playerScript.ghost.transform.localPosition = Vector3.MoveTowards(
                    playerScript.ghost.transform.localPosition, state.Position, playerMove.speed * Time.deltaTime);
            }
        }
예제 #11
0
 private void CheckAltClick()
 {
     if (Input.GetMouseButtonDown(0) && (Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightAlt)))
     {
         //Check for items on the clicked possition, and display them in the Item List Tab, if they're in reach
         var position = Camera.main.ScreenToWorldPoint(Input.mousePosition);
         if (PlayerManager.LocalPlayerScript.IsInReach(position))
         {
             List <GameObject> tiles = UITileList.GetItemsAtPosition(position);
             ControlTabs.ShowItemListTab(tiles);
         }
     }
 }
예제 #12
0
 private void LoadDatabaseButton_Click(object sender, EventArgs e)
 {
     m_eventInformation.databaseFileName = LoadDatabaseFileName.Text;
     if (!File.Exists(m_eventInformation.databaseFileName))
     {
         MessageBox.Show(m_eventInformation.databaseFileName + " does not exist!!!!");
         return;
     }
     PairsGeneral.loadPairsDatabaseInformation(m_eventInformation.databaseFileName, out m_databaseParameters);
     PairsGeneral.loadPairsEventInformation(m_databaseParameters, m_eventInformation.databaseFileName, out m_eventInformation);
     CW_RootFolder.Text = m_eventInformation.webpagesDirectory;
     ControlTabs.SelectTab("CreateWebpagesTab");
 }
예제 #13
0
	/// <summary>
	///     clientside simulation of placement
	/// </summary>
	public bool PlaceItem(Vector3 pos)
	{
		var item = Clear();
		if (!item)
		{
			return false;
		}
		var itemTransform = item.GetComponent<CustomNetTransform>();
		itemTransform.AppearAtPosition(pos);
		var itemAttributes = item.GetComponent<ItemAttributes>();
		Logger.LogTraceFormat("Placing item {0}/{1} from {2} to {3}", Category.UI, item.name, itemAttributes ? itemAttributes.itemName : "(no iAttr)", eventName, pos);
		ControlTabs.CheckTabClose();
		return true;
	}
예제 #14
0
    public void Reset()
    {
        image.ClearAll();
        if (amountText)
        {
            amountText.enabled = false;
        }
        if (placeholderImage)
        {
            placeholderImage.color = Color.white;
        }

        ControlTabs.CheckTabClose();
    }
예제 #15
0
    public void Reset()
    {
        sprite                 = null;
        image.sprite           = null;
        image.enabled          = false;
        secondarySprite        = null;
        secondaryImage.sprite  = null;
        secondaryImage.enabled = false;
        if (amountText)
        {
            amountText.enabled = false;
        }

        ControlTabs.CheckTabClose();
    }
예제 #16
0
 private void CheckAltClick()
 {
     if (UnityEngine.Input.GetMouseButtonDown(0) &&
         (UnityEngine.Input.GetKey(KeyCode.LeftAlt) || UnityEngine.Input.GetKey(KeyCode.RightAlt)))
     {
         //Check for items on the clicked possition, and display them in the Item List Tab, if they're in reach
         Vector3 position = Camera.main.ScreenToWorldPoint(UnityEngine.Input.mousePosition);
         position.z = 0f;
         if (PlayerManager.LocalPlayerScript.IsInReach(position))
         {
             List <GameObject> objects = UITileList.GetItemsAtPosition(position);
             LayerTile         tile    = UITileList.GetTileAtPosition(position);
             ControlTabs.ShowItemListTab(objects, tile, position);
         }
     }
 }
예제 #17
0
    /// <summary>
    /// Clears the displayed image.
    /// </summary>
    public void Clear()
    {
        PlayerScript lps = PlayerManager.LocalPlayerScript;

        if (!lps)
        {
            return;
        }

        sprite                 = null;
        image.enabled          = false;
        secondaryImage.enabled = false;
        ControlTabs.CheckTabClose();
        image.sprite          = null;
        secondarySprite       = null;
        secondaryImage.sprite = null;
    }
        private void checkCredentials_Button_Click(object sender, EventArgs e)
        {
            String username = this.userName_Textbox.Text;
            String password = this.password_Textbox.Text;
            String scope    = "http://www.google.com/calendar/feeds/[email protected]/private/full";

            this.checkCredentials_Status_Textbox.Clear();
            TextBoxTraceListener _textBoxListener = new TextBoxTraceListener(this.checkCredentials_Status_Textbox);

            Trace.Listeners.Add(_textBoxListener);
            Tuple <Boolean, Boolean> check = CalendarAPI.checkCredentials(scope: scope, username: username, password: password);
            String  message = "";
            Boolean proceed = true;

            if (!check.Item1)
            {
                message += "Invalid Username and Password!!!";
                proceed  = false;
            }
            else
            {
                if (!check.Item2)
                {
                    message += "You do not have authorization to edit Indian Bridge Calendar!!!\n";
                    proceed  = false;
                }
                String sitesUrl = "https://sites.google.com/feeds/content/site/" + this.googleSiteRoot_Textbox.Text;
                if (SitesAPI.checkCredentials(url: sitesUrl, username: username, password: password))
                {
                    message = "You are authorized to publish results!!!\nPlease Click OK to continue";
                    proceed = true;
                }
                else
                {
                    message += "You do not have authorization to edit Website!!!";
                    proceed  = false;
                }
                Trace.Listeners.Remove(_textBoxListener);
            }
            MessageBox.Show(message);
            if (proceed)
            {
                ControlTabs.SelectTab("SelectEventTab");
            }
        }
예제 #19
0
	//        public bool TrySetItem(GameObject item) {
	//            if(!IsFull && item != null && CheckItemFit(item)) {
	////                Debug.LogErrorFormat("TrySetItem TRUE for {0}", item.GetComponent<ItemAttributes>().hierarchy);
	//                InventoryInteractMessage.Send(eventName, item, true);
	//               //predictions:
	//                UIManager.UpdateSlot(new UISlotObject(eventName, item));
	////                SetItem(item);
	//
	//                return true;
	//            }
	////            Debug.LogErrorFormat("TrySetItem FALSE for {0}", item.GetComponent<ItemAttributes>().hierarchy);
	//            return false;
	//        }

	/// <summary>
	///     removes item from slot
	/// </summary>
	/// <returns></returns>
	public GameObject Clear()
	{
		PlayerScript lps = PlayerManager.LocalPlayerScript;
		if (!lps || lps.canNotInteract())
		{
			return null;
		}

		GameObject item = Item;
		//            InputTrigger.Touch(Item);
		Item = null;
		image.enabled = false;
		secondaryImage.enabled = false;
		ControlTabs.CheckTabClose();
		image.sprite = null;
		secondaryImage.sprite = null;
		return item;
	}
예제 #20
0
 public void Reset()
 {
     image.ClearAll();
     if (amountText)
     {
         amountText.enabled = false;
     }
     if (placeholderImage)
     {
         placeholderImage.color = Color.white;
     }
     if (MoreInventoryImage)
     {
         HasSubInventory.itemStorage = null;
         MoreInventoryImage.enabled  = false;
     }
     ControlTabs.CheckTabClose();
 }
예제 #21
0
 private void FillComboBoxes()
 {
     ColorSelection.UseCustomBackColor = false;
     ControlTabs.SelectTab(0);
     RefreshComPorts();
     foreach (InterpolationMode interpmode in Enum.GetValues(typeof(InterpolationMode)))
     {
         if (interpmode != InterpolationMode.Invalid)
         {
             InterpMode.Items.Add(interpmode);                                                                                                                          //fetch all possible interpolation modes
         }
     }
     foreach (MMDevice dev in new MMDeviceEnumerator().EnumerateAudioEndPoints(DataFlow.All, DeviceState.Active))
     {
         AudioInputs.Items.Add(dev);
     }
     for (int i = 0; i < BaudRatesList.Length; i++)
     {
         BaudRate.Items.Add(BaudRatesList[i]);
     }
     CaptureArea.Items.Add("Fullscreen");
     CaptureArea.Items.Add("Custom resolution");
     CaptureArea.Items.Add("Custom offsets");
     AmbilightModes.Items.Add("Dynamic Ambilight");
     AmbilightModes.Items.Add("Rainbow");
     AmbilightModes.Items.Add("Single Color");
     AmbilightModes.Items.Add("Single Color Fade");
     AmbilightModes.Items.Add("Multicolor Fade");
     AmbilightModes.Items.Add("Multicolor Wipe");
     AmbilightModes.Items.Add("Running Dot");
     AmbilightModes.Items.Add("Cylon Bounce");
     AmbilightModes.Items.Add("Theater Chase");
     AmbilightModes.Items.Add("Happy New Year");
     AmbilightModes.Items.Add("Sparkle");
     AmbilightModes.Items.Add("Twinkle");
     AmbilightModes.Items.Add("Bouncing Ball");
     AmbilightModes.Items.Add("Single Color VU Meter");
     AmbilightModes.Items.Add("Multicolor VU Meter");
     AmbilightModes.Items.Add("Fade VU Meter");
     foreach (SharpDX.DXGI.Adapter adapters in new SharpDX.DXGI.Factory1().Adapters)
     {
         CapturedDevice.Items.Add(adapters.Description.Description);
     }
 }
예제 #22
0
    public override void Process()
    {
        Logger.LogTraceFormat("Processed {0}", Category.NetUI, this);
        LoadNetworkObject(Provider);
        switch (Action)
        {
        case TabAction.Open:
            ControlTabs.ShowTab(Type, NetworkObject, ElementValues);
            break;

        case TabAction.Close:
            ControlTabs.CloseTab(Type, NetworkObject);
            break;

        case TabAction.Update:
            ControlTabs.UpdateTab(Type, NetworkObject, ElementValues, Touched);
            break;
        }
    }
예제 #23
0
    private bool CheckAltClick()
    {
        if (UnityEngine.Input.GetKey(KeyCode.LeftAlt) || UnityEngine.Input.GetKey(KeyCode.RightAlt))
        {
            //Check for items on the clicked possition, and display them in the Item List Tab, if they're in reach
            Vector3 position = Camera.main.ScreenToWorldPoint(UnityEngine.Input.mousePosition);
            position.z = 0f;
            if (PlayerManager.LocalPlayerScript.IsInReach(position))
            {
                List <GameObject> objects = UITileList.GetItemsAtPosition(position);
                LayerTile         tile    = UITileList.GetTileAtPosition(position);
                ControlTabs.ShowItemListTab(objects, tile, position);
            }

            UIManager.SetToolTip = $"clicked position: {Vector3Int.RoundToInt(position)}";
            return(true);
        }
        return(false);
    }
예제 #24
0
        private void loadSummaryIntoDatabase()
        {
            PairsSummaryToDatabase std = new PairsSummaryToDatabase(m_eventInformation);
            TextBoxTraceListener   _textBoxListener = new TextBoxTraceListener(CD_Status);

            Trace.Listeners.Add(_textBoxListener);
            try
            {
                std.loadSummaryIntoDatabase();
                m_databaseParameters = std.getDatabaseParameters();
                Trace.Listeners.Remove(_textBoxListener);
                CW_RootFolder.Text = m_eventInformation.webpagesDirectory;
                ControlTabs.SelectTab("CreateWebpagesTab");
            }
            catch (Exception e)
            {
                Trace.Listeners.Remove(_textBoxListener);
                throw e;
            }
        }
예제 #25
0
    public override IEnumerator Process()
    {
        Logger.LogTraceFormat("Processed {0}", Category.NetUI, this);
        yield return(WaitFor(Provider));

        switch (Action)
        {
        case TabAction.Open:
            ControlTabs.ShowTab(Type, NetworkObject, ElementValues);
            break;

        case TabAction.Close:
            ControlTabs.CloseTab(Type, NetworkObject);
            break;

        case TabAction.Update:
            ControlTabs.UpdateTab(Type, NetworkObject, ElementValues, Touched);
            break;
        }
    }
예제 #26
0
        private void CheckAltClick()
        {
            Event e = Event.current;

            if (e.type != EventType.Used && e.button == 0 && (UnityEngine.Input.GetKey(KeyCode.LeftAlt) || UnityEngine.Input.GetKey(KeyCode.RightAlt)))
            {
                //Check for items on the clicked possition, and display them in the Item List Tab, if they're in reach
                Vector3 position = Camera.main.ScreenToWorldPoint(UnityEngine.Input.mousePosition);
                position.z = 0f;
                if (PlayerManager.LocalPlayerScript.IsInReach(position))
                {
                    List <GameObject> objects = UITileList.GetItemsAtPosition(position);
                    LayerTile         tile    = UITileList.GetTileAtPosition(position);
                    ControlTabs.ShowItemListTab(objects, tile, position);
                }

                UIManager.SetToolTip = $"clicked position: {Vector3Int.RoundToInt(position)}";
                e.Use();
            }
        }
예제 #27
0
    public override IEnumerator Process()
    {
//		Logger.Log("Processed " + ToString());
        yield return(WaitFor(Provider));

        switch (Action)
        {
        case TabAction.Open:
            ControlTabs.ShowTab(Type, NetworkObject, ElementValues);
            break;

        case TabAction.Close:
            ControlTabs.CloseTab(Type, NetworkObject);
            break;

        case TabAction.Update:
            ControlTabs.UpdateTab(Type, NetworkObject, ElementValues, Touched);
            break;
        }
    }
예제 #28
0
 private void CW_CreateButton_Click(object sender, EventArgs e)
 {
     m_eventInformation.webpagesDirectory = CW_RootFolder.Text;
     if (Directory.Exists(m_eventInformation.webpagesDirectory))
     {
         DialogResult result = MessageBox.Show(m_eventInformation.webpagesDirectory + " exists!!!\nShould the contents be overwritten?", "Overwrite?", MessageBoxButtons.OKCancel);
         if (result == DialogResult.OK)
         {
             createWebpages();
         }
     }
     else
     {
         DialogResult result = MessageBox.Show(m_eventInformation.databaseFileName + " does not exist!!!\nShould a new folder be created?", "Create?", MessageBoxButtons.OKCancel);
         if (result == DialogResult.OK)
         {
             Directory.CreateDirectory(m_eventInformation.webpagesDirectory);
             createWebpages();
         }
     }
     UW_webpagesDirectory.Text = m_eventInformation.webpagesDirectory;
     ControlTabs.SelectTab("UploadWebpagesTab");
 }
예제 #29
0
    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            Destroy(gameObject);
            //Killing net tabs on round restart
//				Logger.LogError( "ControlTabs cleanup!" );
            foreach (var tab in Instance.HiddenNetTabs)
            {
                Destroy(Instance.HeaderForTab(tab.Value)?.gameObject);
                Destroy(tab.Value.gameObject);
            }
            foreach (var tab in Instance.OpenedNetTabs)
            {
                Destroy(Instance.HeaderForTab(tab.Value)?.gameObject);
                Destroy(tab.Value.gameObject);
            }
            Instance.SelectTab(ClientTabType.Stats, false);
        }
    }
예제 #30
0
 public void CloseTab()
 {
     ControlTabs.CloseTab(Type, Provider);
 }