idTech4.UI.idUserInterface.HandleEvent C# (CSharp) Method

HandleEvent() public method

public HandleEvent ( SystemEvent e, int time, bool &updateVisuals ) : string
e SystemEvent
time int
updateVisuals bool
return string
		public string HandleEvent(SystemEvent e, int time, ref bool updateVisuals)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			_time = time;

			if((_bindHandler != null) && (e.Type == SystemEventType.Key) && (e.Value2 == 1))
			{
				string ret = _bindHandler.HandleEvent(e, ref updateVisuals);
				_bindHandler = null;
				
				return ret;
			}

			if(e.Type == SystemEventType.Mouse)
			{
				_cursorX += e.Value;
				_cursorY += e.Value2;

				if(_cursorX < 0)
				{
					_cursorX = 0;
				}

				if(_cursorY < 0)
				{
					_cursorY = 0;
				}
			}

			if(this.Desktop != null)
			{
				this.Desktop.HandleEvent(e, ref updateVisuals);
			}

			return string.Empty;
		}

Same methods

idUserInterface::HandleEvent ( SystemEvent e, int time ) : string

Usage Example

示例#1
0
		public void SetUserInterface(idUserInterface ui, /* TODO: HandleGuiCommand_t*/ object handle)
		{
			_guiActive = ui;
			_guiHandle = handle;

			if(_guiMsgRestore != null)
			{
				idConsole.DeveloperWriteLine("idSession::SetUserInterface: cleared an active message box");
				_guiMsgRestore = null;
			}

			if(_guiActive == null)
			{
				return;
			}

			if(_guiActive == _guiMainMenu)
			{
				idConsole.Warning("TODO: SetSaveGameGuiVars();");
				SetMainMenuVariables();
			}
			else if(_guiActive == _guiRestartMenu)
			{
				idConsole.Warning("TODO: SetSaveGameGuiVars();");
			}

			_guiActive.HandleEvent(new SystemEvent(SystemEventType.None), idE.System.FrameTime);
			_guiActive.Activate(true, idE.System.FrameTime);
		}