Exemplo n.º 1
0
		// Add the virtual keyboard to the HUDs
		// IN: N/A
		// OUT: N/A
		public void AddKeyboard()
		{
			if ( HUDElement_Keyboard[0] != null ) { return; }; // Already added

			// Display the HUD elements
			for ( short hud = 0; hud < HUDs; hud++ )
			{
				HUDElement_Keyboard[hud] = new HUDElement_KeyboardClass(
					CurrentScene, // Reference to the current scene
					Game.Instance.HalfHeight / 2, // Position X
					Game.Instance.HalfWidth / 3, // Position Y
					hud // The HUD index, for the player the keyboard belongs to
				);
			}

			Add( HUDElement_Keyboard[0], HUDElement_Keyboard[1] );
		}
		private void TweetInThread()
		{
			// Setup tweet text
			HUDElement_KeyboardClass[] keyboard = new HUDElement_KeyboardClass[2];
			{
				keyboard[0] = (HUDElement_KeyboardClass) CurrentScene.HUDHandler.HUDElement_Keyboard[0];
				keyboard[1] = (HUDElement_KeyboardClass) CurrentScene.HUDHandler.HUDElement_Keyboard[1];
			}
			string tweet = "";
			{
				// 1. First wizard's twitter handle
				{
					string username = "******";
					if ( keyboard[1].UserString.Length > 0 )
					{
						username = "******" + keyboard[1].UserString;
					}
					tweet += "" + username;
				}
				// 2. First wizard's score
				{
					tweet += " (" + Outcome[1].Score + ")";
				}
				// 3. Match outcome
				{
					if ( Outcome[1].Winner )
					{
						tweet += " beat";
					}
					else if ( Outcome[0].Winner )
					{
						tweet += " lost to";
					}
					else
					{
						tweet += " drew with";
					}
				}
				// 4. Second wizard's twitter handle
				{
					string username = "******";
					if ( keyboard[0].UserString.Length > 0 )
					{
						username = "******" + keyboard[0].UserString;
					}
					tweet += " " + username;
				}
				// 5. Second wizard's score
				{
					tweet += " (" + Outcome[0].Score + ")!";
				}
			}
			// Remove HUD keyboards
			CurrentScene.HUDHandler.RemoveKeyboard();

			// Tweet the image & text
			TweetinviClass.TweetImage( tweet );
		}