Преглед на файлове

All numpad keys now work properly for character input
Project window properly selects the last open project in the recent projects list

BearishSun преди 10 години
родител
ревизия
d2f288272b
променени са 2 файла, в които са добавени 20 реда и са изтрити 14 реда
  1. 14 14
      BansheeCore/Source/Win32/BsWin32Platform.cpp
  2. 6 0
      MBansheeEditor/ProjectWindow.cs

+ 14 - 14
BansheeCore/Source/Win32/BsWin32Platform.cpp

@@ -376,9 +376,7 @@ namespace BansheeEngine
 	bool isShiftPressed = false;
 	bool isShiftPressed = false;
 	bool isCtrlPressed = false;
 	bool isCtrlPressed = false;
 
 
-	/**
-	 * @brief	Translate engine non client area to win32 non client area.
-	 */
+	/**	Translate engine non client area to win32 non client area. */
 	LRESULT translateNonClientAreaType(NonClientAreaBorderType type)
 	LRESULT translateNonClientAreaType(NonClientAreaBorderType type)
 	{
 	{
 		LRESULT dir = HTCLIENT;
 		LRESULT dir = HTCLIENT;
@@ -413,9 +411,7 @@ namespace BansheeEngine
 		return dir;
 		return dir;
 	}
 	}
 
 
-	/**
-	 * @brief	Method triggered whenever a mouse event happens.
-	 */
+	/**	Method triggered whenever a mouse event happens. */
 	void getMouseData(HWND hWnd, WPARAM wParam, LPARAM lParam, bool nonClient, Vector2I& mousePos, OSPointerButtonStates& btnStates)
 	void getMouseData(HWND hWnd, WPARAM wParam, LPARAM lParam, bool nonClient, Vector2I& mousePos, OSPointerButtonStates& btnStates)
 	{
 	{
 		POINT clientPoint;
 		POINT clientPoint;
@@ -437,25 +433,29 @@ namespace BansheeEngine
 	}
 	}
 
 
 	/**
 	/**
-	 * @brief	Converts a virtual key code into an input command, if possible. Returns true
-	 *			if conversion was done.
+	 * Converts a virtual key code into an input command, if possible. Returns true if conversion was done.
+	 *
+	 * @param[in]	virtualKeyCode	Virtual key code to try to translate to a command.
+	 * @param[out]	command			Input command. Only valid if function returns true.
+	 * @param[in]	ignoreMovement	If true, then movement keys (up/down/left/right) will be ignored and not considered
+	 *								as input commands (useful if you need to parse num keys as numbers and not movement).
 	 */
 	 */
-	bool getCommand(unsigned int virtualKeyCode, InputCommandType& command)
+	bool getCommand(unsigned int virtualKeyCode, InputCommandType& command, bool ignoreMovement = false)
 	{
 	{
 		switch (virtualKeyCode) 
 		switch (virtualKeyCode) 
 		{ 
 		{ 
 		case VK_LEFT:
 		case VK_LEFT:
 			command = isShiftPressed ? InputCommandType::SelectLeft : InputCommandType::CursorMoveLeft;
 			command = isShiftPressed ? InputCommandType::SelectLeft : InputCommandType::CursorMoveLeft;
-			return true;
+			return !ignoreMovement;
 		case VK_RIGHT:
 		case VK_RIGHT:
 			command = isShiftPressed ? InputCommandType::SelectRight : InputCommandType::CursorMoveRight;
 			command = isShiftPressed ? InputCommandType::SelectRight : InputCommandType::CursorMoveRight;
-			return true;
+			return !ignoreMovement;
 		case VK_UP:
 		case VK_UP:
 			command = isShiftPressed ? InputCommandType::SelectUp : InputCommandType::CursorMoveUp;
 			command = isShiftPressed ? InputCommandType::SelectUp : InputCommandType::CursorMoveUp;
-			return true;
+			return !ignoreMovement;
 		case VK_DOWN:
 		case VK_DOWN:
 			command = isShiftPressed ? InputCommandType::SelectDown : InputCommandType::CursorMoveDown;
 			command = isShiftPressed ? InputCommandType::SelectDown : InputCommandType::CursorMoveDown;
-			return true;
+			return !ignoreMovement;
 		case VK_ESCAPE:
 		case VK_ESCAPE:
 			command = InputCommandType::Escape;
 			command = InputCommandType::Escape;
 			return true;
 			return true;
@@ -990,7 +990,7 @@ namespace BansheeEngine
 							return 0;
 							return 0;
 
 
 						InputCommandType command = InputCommandType::Backspace;
 						InputCommandType command = InputCommandType::Backspace;
-						if(getCommand(vk, command)) // We ignore character combinations that are special commands
+						if(getCommand(vk, command, true)) // We ignore character combinations that are special commands
 							return 0;
 							return 0;
 
 
 						UINT32 finalChar = (UINT32)wParam;
 						UINT32 finalChar = (UINT32)wParam;

+ 6 - 0
MBansheeEditor/ProjectWindow.cs

@@ -180,7 +180,10 @@ namespace BansheeEditor
 
 
             string selectedPath;
             string selectedPath;
             if (BrowseDialog.OpenFolder(projectPath, out selectedPath))
             if (BrowseDialog.OpenFolder(projectPath, out selectedPath))
+            {
                 projectInputBox.Value = selectedPath;
                 projectInputBox.Value = selectedPath;
+                OpenProject();
+            }
         }
         }
 
 
         /// <summary>
         /// <summary>
@@ -236,6 +239,9 @@ namespace BansheeEditor
                 entryBtn.OnClick += () => OnEntryClicked(projectPath);
                 entryBtn.OnClick += () => OnEntryClicked(projectPath);
                 entryBtn.OnDoubleClick += () => OnEntryDoubleClicked(projectPath);
                 entryBtn.OnDoubleClick += () => OnEntryDoubleClicked(projectPath);
 
 
+                if (PathEx.Compare(projectPath, projectInputBox.Value))
+                    entryBtn.Value = true;
+
                 scrollLayout.AddElement(entryBtn);
                 scrollLayout.AddElement(entryBtn);
             }
             }
         }
         }