浏览代码

Check in before attempting first release build

Marko Pintera 12 年之前
父节点
当前提交
3b65191d6a

+ 10 - 2
BansheeEngine/Source/BsEngineGUI.cpp

@@ -142,6 +142,10 @@ namespace BansheeEngine
 		tabbedBarButton.activeOn.texture = tabbedBarButton.hover.texture;
 		tabbedBarButton.activeOn.texture = tabbedBarButton.hover.texture;
 		tabbedBarButton.fixedHeight = true;
 		tabbedBarButton.fixedHeight = true;
 		tabbedBarButton.height = 13;
 		tabbedBarButton.height = 13;
+		tabbedBarButton.font = font;
+		tabbedBarButton.fontSize = DefaultFontSize;
+		tabbedBarButton.textHorzAlign = THA_Center;
+		tabbedBarButton.textVertAlign = TVA_Center;
 
 
 		mSkin.setStyle("TabbedBarBtn", tabbedBarButton);
 		mSkin.setStyle("TabbedBarBtn", tabbedBarButton);
 
 
@@ -163,7 +167,9 @@ namespace BansheeEngine
 		winMinButtonStyle.hover.texture = cm_shared_ptr<SpriteTexture, PoolAlloc>(std::cref(winMinBtnHover));
 		winMinButtonStyle.hover.texture = cm_shared_ptr<SpriteTexture, PoolAlloc>(std::cref(winMinBtnHover));
 		winMinButtonStyle.active.texture = winMinButtonStyle.hover.texture;
 		winMinButtonStyle.active.texture = winMinButtonStyle.hover.texture;
 		winMinButtonStyle.fixedHeight = true;
 		winMinButtonStyle.fixedHeight = true;
-		winMinButtonStyle.height = 13;
+		winMinButtonStyle.fixedWidth = true;
+		winMinButtonStyle.height = 7;
+		winMinButtonStyle.width = 8;
 
 
 		mSkin.setStyle("WinMinimizeBtn", winMinButtonStyle);
 		mSkin.setStyle("WinMinimizeBtn", winMinButtonStyle);
 
 
@@ -176,7 +182,9 @@ namespace BansheeEngine
 		winCloseButtonStyle.hover.texture = cm_shared_ptr<SpriteTexture, PoolAlloc>(std::cref(winCloseBtnHover));
 		winCloseButtonStyle.hover.texture = cm_shared_ptr<SpriteTexture, PoolAlloc>(std::cref(winCloseBtnHover));
 		winCloseButtonStyle.active.texture = winCloseButtonStyle.active.texture;
 		winCloseButtonStyle.active.texture = winCloseButtonStyle.active.texture;
 		winCloseButtonStyle.fixedHeight = true;
 		winCloseButtonStyle.fixedHeight = true;
-		winCloseButtonStyle.height = 13;
+		winCloseButtonStyle.fixedWidth = true;
+		winCloseButtonStyle.height = 7;
+		winCloseButtonStyle.width = 8;
 
 
 		mSkin.setStyle("WinCloseBtn", winCloseButtonStyle);
 		mSkin.setStyle("WinCloseBtn", winCloseButtonStyle);
 	}
 	}

+ 2 - 4
BansheeEngine/Source/BsGUIToggle.cpp

@@ -194,20 +194,18 @@ namespace BansheeEngine
 			else
 			else
 				mImageDesc.texture = mStyle->active.texture;
 				mImageDesc.texture = mStyle->active.texture;
 
 
-			mIsToggled = !mIsToggled;
-
 			markAsDirty();
 			markAsDirty();
 			return true;
 			return true;
 		}
 		}
 		else if(ev.getType() == GUIMouseEventType::MouseUp)
 		else if(ev.getType() == GUIMouseEventType::MouseUp)
 		{
 		{
+			mIsToggled = !mIsToggled;
+
 			if(mIsToggled)
 			if(mIsToggled)
 				mImageDesc.texture = mStyle->normalOn.texture;
 				mImageDesc.texture = mStyle->normalOn.texture;
 			else
 			else
 				mImageDesc.texture = mStyle->normal.texture;
 				mImageDesc.texture = mStyle->normal.texture;
 
 
-			mIsToggled = !mIsToggled;
-
 			markAsDirty();
 			markAsDirty();
 			return true;
 			return true;
 		}
 		}

+ 10 - 8
CamelotClient/BsGUITabbedTitleBar.cpp

@@ -30,7 +30,7 @@ namespace BansheeEditor
 
 
 	void TabbedTitleBar::insertTab(UINT32 idx, const CM::String& name)
 	void TabbedTitleBar::insertTab(UINT32 idx, const CM::String& name)
 	{
 	{
-		GUIToggle* newTabToggle = GUIToggle::create(*this, GUILayoutOptions::expandableX(13, 100, 200), name);
+		GUIToggle* newTabToggle = GUIToggle::create(*this, GUILayoutOptions::expandableX(13, 100, 200), name, EngineGUI::instance().getSkin().getStyle("TabbedBarBtn"));
 		GUITexture* newDragDropElement = GUITexture::create(*this, GUIImageScaleMode::StretchToFit, EngineGUI::instance().getSkin().getStyle("TabbedBarDropArea"));
 		GUITexture* newDragDropElement = GUITexture::create(*this, GUIImageScaleMode::StretchToFit, EngineGUI::instance().getSkin().getStyle("TabbedBarDropArea"));
 
 
 		idx = Math::Clamp(idx, 0U, (UINT32)mTabButtons.size());
 		idx = Math::Clamp(idx, 0U, (UINT32)mTabButtons.size());
@@ -39,7 +39,7 @@ namespace BansheeEditor
 		mDragDropElements.insert(mDragDropElements.begin() + idx, newDragDropElement);
 		mDragDropElements.insert(mDragDropElements.begin() + idx, newDragDropElement);
 
 
 		mMainArea->getLayout().insertElement(idx * 2, newTabToggle);
 		mMainArea->getLayout().insertElement(idx * 2, newTabToggle);
-		mMainArea->getLayout().insertElement(idx * 2, newTabToggle);
+		mMainArea->getLayout().insertElement(idx * 2, newDragDropElement);
 	}
 	}
 
 
 	void TabbedTitleBar::removeTab(UINT32 idx)
 	void TabbedTitleBar::removeTab(UINT32 idx)
@@ -64,17 +64,19 @@ namespace BansheeEditor
 		GUITexture* titleBarBg = GUITexture::create(*this, GUIImageScaleMode::StretchToFit, EngineGUI::instance().getSkin().getStyle("TitleBarBackground"));
 		GUITexture* titleBarBg = GUITexture::create(*this, GUIImageScaleMode::StretchToFit, EngineGUI::instance().getSkin().getStyle("TitleBarBackground"));
 		backgroundArea->getLayout().addElement(titleBarBg);
 		backgroundArea->getLayout().addElement(titleBarBg);
 
 
-		GUIArea* mainArea = GUIArea::create(*this, 0, 0, 0, 0, 499);
+		mMainArea = GUIArea::create(*this, 0, 0, 0, 0, 499);
 
 
 		GUITexture* dragDropElement = GUITexture::create(*this, GUILayoutOptions::expandableX(13, 20), GUIImageScaleMode::StretchToFit, EngineGUI::instance().getSkin().getStyle("TabbedBarDropArea"));
 		GUITexture* dragDropElement = GUITexture::create(*this, GUILayoutOptions::expandableX(13, 20), GUIImageScaleMode::StretchToFit, EngineGUI::instance().getSkin().getStyle("TabbedBarDropArea"));
 		mLastDropElement = dragDropElement;
 		mLastDropElement = dragDropElement;
 
 
-		mMinBtn = GUIButton::create(*this, "");
-		mCloseBtn = GUIButton::create(*this, "");
+		mMinBtn = GUIButton::create(*this, "", EngineGUI::instance().getSkin().getStyle("WinMinimizeBtn"));
+		mCloseBtn = GUIButton::create(*this, "", EngineGUI::instance().getSkin().getStyle("WinCloseBtn"));
+
+		mMainArea->getLayout().addElement(dragDropElement);
+		mMainArea->getLayout().addElement(mMinBtn);
+		mMainArea->getLayout().addElement(mCloseBtn);
 
 
-		mainArea->getLayout().addElement(dragDropElement);
-		mainArea->getLayout().addElement(mMinBtn);
-		mainArea->getLayout().addElement(mCloseBtn);
+		addTab("TEST!");
 	}
 	}
 
 
 	void TabbedTitleBar::update()
 	void TabbedTitleBar::update()

+ 2 - 2
CamelotClient/CamelotClient.cpp

@@ -30,9 +30,9 @@
 #include "CmRTTIType.h"
 #include "CmRTTIType.h"
 #include "CmCursor.h"
 #include "CmCursor.h"
 
 
-//#define DX11
+#define DX11
 //#define DX9
 //#define DX9
-#define GL
+//#define GL
 
 
 using namespace CamelotFramework;
 using namespace CamelotFramework;
 using namespace BansheeEditor;
 using namespace BansheeEditor;

+ 7 - 4
CamelotClient/CmEditorWindow.cpp

@@ -48,11 +48,13 @@ namespace BansheeEditor
 
 
 		mGUI = so->addComponent<GUIWidget>();
 		mGUI = so->addComponent<GUIWidget>();
 		mGUI->initialize(camera->getViewport().get(), mRenderWindow.get());
 		mGUI->initialize(camera->getViewport().get(), mRenderWindow.get());
+		mGUI->setDepth(128);
 
 
 		mGUI->setSkin(&EngineGUI::instance().getSkin());
 		mGUI->setSkin(&EngineGUI::instance().getSkin());
 
 
 		GameObjectHandle<TabbedTitleBar> titleBar = so->addComponent<TabbedTitleBar>();
 		GameObjectHandle<TabbedTitleBar> titleBar = so->addComponent<TabbedTitleBar>();
 		titleBar->initialize(camera->getViewport().get(), mRenderWindow.get());
 		titleBar->initialize(camera->getViewport().get(), mRenderWindow.get());
+		titleBar->setDepth(127);
 
 
 		//// DEBUG
 		//// DEBUG
 		
 		
@@ -73,11 +75,11 @@ namespace BansheeEditor
 		//otherLayout.addElement(GUIButton::create(*mGUI, "Test"));
 		//otherLayout.addElement(GUIButton::create(*mGUI, "Test"));
 		//otherLayout.addElement(GUIWindowFrame::create(*mGUI));
 		//otherLayout.addElement(GUIWindowFrame::create(*mGUI));
 		
 		
-		GUIArea* backgroundArea = GUIArea::create(*mGUI, 0, 0, 0, 0, 2000);
-		backgroundArea->getLayout().addElement(GUITexture::create(*mGUI, GUILayoutOptions::expandableXY(), GUIImageScaleMode::RepeatToFit, mGUI->getSkin()->getStyle("WindowBackground")));
+		//GUIArea* backgroundArea = GUIArea::create(*mGUI, 0, 0, 0, 0, 2000);
+		//backgroundArea->getLayout().addElement(GUITexture::create(*mGUI, GUILayoutOptions::expandableXY(), GUIImageScaleMode::RepeatToFit, mGUI->getSkin()->getStyle("WindowBackground")));
 
 
-		GUIArea* windowFrameArea = GUIArea::create(*mGUI, 0, 0, 0, 0, 1999);
-		windowFrameArea->getLayout().addElement(GUIWindowFrame::create(*mGUI));
+		//GUIArea* windowFrameArea = GUIArea::create(*mGUI, 0, 0, 0, 0, 1999);
+		//windowFrameArea->getLayout().addElement(GUIWindowFrame::create(*mGUI));
 
 
 		//GUIArea* titleBarBackgroundArea = GUIArea::create(*mGUI, 0, 1, 0, 11, 1999);
 		//GUIArea* titleBarBackgroundArea = GUIArea::create(*mGUI, 0, 1, 0, 11, 1999);
 		//titleBarBackgroundArea->getLayout().addSpace(1);
 		//titleBarBackgroundArea->getLayout().addSpace(1);
@@ -95,5 +97,6 @@ namespace BansheeEditor
 		Int2 cursorPos = Cursor::getWindowPosition(*mRenderWindow);
 		Int2 cursorPos = Cursor::getWindowPosition(*mRenderWindow);
 		
 		
 		mDbgLabel->setText("Position: " + toString(cursorPos.x) + ", " + toString(cursorPos.y));
 		mDbgLabel->setText("Position: " + toString(cursorPos.x) + ", " + toString(cursorPos.y));
+		
 	}
 	}
 }
 }

+ 2 - 2
CamelotOISInput/Source/CmInputHandlerOIS.cpp

@@ -13,9 +13,9 @@ namespace CamelotFramework
 		pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
 		pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
 
 
 #if defined CM_PLATFORM == CM_PLATFORM_WIN32
 #if defined CM_PLATFORM == CM_PLATFORM_WIN32
-		pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_FOREGROUND" )));
+		pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_BACKGROUND" )));
 		pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_NONEXCLUSIVE")));
 		pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_NONEXCLUSIVE")));
-		pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_FOREGROUND")));
+		pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_BACKGROUND")));
 		pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_NONEXCLUSIVE")));
 		pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_NONEXCLUSIVE")));
 #elif defined CM_PLATFORM == CM_PLATFORM_LINUX || CM_PLATFORM == CM_PLATFORM_APPLE
 #elif defined CM_PLATFORM == CM_PLATFORM_LINUX || CM_PLATFORM == CM_PLATFORM_APPLE
 		pl.insert(std::make_pair(std::string("x11_mouse_grab"), std::string("false")));
 		pl.insert(std::make_pair(std::string("x11_mouse_grab"), std::string("false")));